INSURANCE_FEATURES_SPEC §1. The office printed and mailed renewal letters from the legacy CONTROL <ramo> RENEW[2/3] paper log; 91% of policyholders have an email on file, so send the notice instead and keep the paper log as the fallback. A daily cron (06:00 America/Tijuana) sweeps three generations off policyTo — 30 and 15 days before expiry, 7 days after — sends each through SES, and upserts RenewalNotice by [policyId, generation] so a policy is never notified twice for the same milestone. RenewalNotice now records providerMessageId, so a later bounce or complaint webhook can be traced back to the row that sent it. - customers.emailOptOut excludes a customer from every sweep; editable from the customer form - scheduled_job_states holds the sweep's lock and last successful run; the window is widened to cover days the job did not run, so a weekend outage does not silently drop a generation - SES unconfigured is not an error outside production — messages are logged and skipped, so dev and CI never send - /renovaciones (renewal:send, MANAGER+) lists what is pending per generation, runs the sweep by hand, and marks a notice sent by mail for the customers with no email - POST /policies/:id/renewal-notices records that manual mark - the aviso-renovacion report and the emails now share one projection (reports/renewal-letter.ts) instead of two copies of the mapping
42 lines
1.5 KiB
Bash
42 lines
1.5 KiB
Bash
# Copy to .env and fill in for local development.
|
|
DATABASE_URL=mysql://jorgecuadros:jorgecuadros@localhost:3306/jorgecuadros
|
|
SESSION_SECRET=change-me-to-a-random-string
|
|
WEB_ORIGIN=http://localhost:3000
|
|
NEXT_PUBLIC_API_ORIGIN=http://localhost:3001
|
|
|
|
# Object storage (MinIO / S3) for document blobs and scanned receipt pages.
|
|
# Without S3_ENDPOINT + credentials the API still boots, but every document
|
|
# upload/download and the whole recibo OCR intake are disabled. Credentials fall
|
|
# back to MINIO_ROOT_USER / MINIO_ROOT_PASSWORD when the S3_* pair is unset.
|
|
S3_ENDPOINT=http://localhost:9000
|
|
S3_BUCKET=jorgecuadros-documents
|
|
S3_ACCESS_KEY=
|
|
S3_SECRET_KEY=
|
|
|
|
# Login the "Operaciones" screen runs mysqldump/mysql as. Optional locally: when
|
|
# unset it falls back to the DATABASE_URL credentials, which a dev MySQL usually
|
|
# grants enough for. Required in any deployment, where the application user has
|
|
# only ALL ON jorgecuadros.* and mysqldump --single-transaction needs the global
|
|
# RELOAD privilege. Host/port/database always come from DATABASE_URL.
|
|
OPS_DB_ADMIN_USER=
|
|
OPS_DB_ADMIN_PASSWORD=
|
|
|
|
# Company info — printed in the header of every report (PDF + browser
|
|
# print). Leave blank to use the placeholders. COMPANY_LOGO_PATH is
|
|
# optional; when unset the API falls back to apps/api/assets/company_logo.png.
|
|
COMPANY_NAME=Jorge Cuadros & Asociados
|
|
COMPANY_ADDRESS_LINE1=
|
|
COMPANY_ADDRESS_LINE2=
|
|
COMPANY_CITY_STATE=
|
|
COMPANY_PHONE=
|
|
COMPANY_EMAIL=
|
|
COMPANY_TAX_ID=
|
|
COMPANY_WEBSITE=
|
|
COMPANY_LOGO_PATH=
|
|
|
|
SES_REGION=
|
|
SES_FROM=
|
|
SES_ACCESS_KEY=
|
|
SES_SECRET_KEY=
|
|
SES_CONFIGURATION_SET=
|