Files
jorgecuadros-platform/deploy/jorgecuadros-app.env.example
T
rmancinas 87d8743251
Build and Push Images / Build jorgecuadros-web (push) Successful in 1m48s
Build and Push Images / Build jorgecuadros-api (push) Successful in 2m4s
feat(renovaciones): renewal notification emails over SES
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
2026-08-02 02:00:02 -07:00

41 lines
1.5 KiB
Bash

# Stack env for deploy/jorgecuadros-app.stack.yml (PROD).
# Paste these into the Portainer stack's "Environment variables" at deploy time.
# Do NOT commit real secrets — this file is a template only.
#
# HOST below = the swarm host the db/minio/app stacks publish on (cubex).
# Which built image tag to run. latest = default-branch build; or pin sha-<x> / vX.Y.Z.
APP_TAG=latest
# --- Public URLs (what the end user's BROWSER hits) ---------------------------
# API_ORIGIN is injected into the web app at runtime and used for browser fetches
# + document download links, so it must be browser-reachable (not swarm-internal).
# WEB_ORIGIN is the web app's own public origin; the API allows it via CORS.
API_ORIGIN=http://192.168.4.212:3001
WEB_ORIGIN=http://192.168.4.212:3000
# Published ports on the swarm host.
API_PORT=3001
WEB_PORT=3000
# --- Database (points at the jorgecuadros-prod-db stack) ----------------------
# prod db publishes 3306 on the host (see deploy/jorgecuadros-db.stack.yml).
DATABASE_URL=mysql://jorgecuadros:CHANGE_ME@192.168.4.212:3306/jorgecuadros
# --- Auth --------------------------------------------------------------------
# 64-hex random. Generate: openssl rand -hex 32
SESSION_SECRET=CHANGE_ME
# --- Object storage (points at the jorgecuadros-prod-minio stack) -------------
# Server-side only; prod minio API publishes 9000 on the host.
S3_ENDPOINT=http://192.168.4.212:9000
S3_BUCKET=jorgecuadros-documents
MINIO_ROOT_USER=jc_minio
MINIO_ROOT_PASSWORD=CHANGE_ME
SES_REGION=
SES_FROM=
SES_ACCESS_KEY=
SES_SECRET_KEY=
SES_CONFIGURATION_SET=