Deployment
Environments
| Env | Namespace | ArgoCD App |
|---|---|---|
| UAT | pos-uat | pos-partner-api |
| Prod | pos-prod | pos-partner-api-prod |
Reconciliation sync runtime
Reconciliation freshness is maintained by a Kubernetes-owned CronJob, not an in-process API cron.
- CronJob:
pos-partner-api-reconciliation-sync - Execution path: app image runs
dist/apps/pos/partner-api/main.js reconciliation-sync-once - Required secret:
POS_DATA_DATABASE_URL - Optional secret:
POS_RECONCILIATION_SYNC_STALE_MINUTES
GET /admin/pos/reconciliation/report is read-only, including on an empty install. It no longer bootstraps sync state by writing through the report path.
Replica policy
pos-partner-api is intentionally deployed as a single replica today.
Reason:
- reconciliation sync runs in-process on a cron, so multiple replicas would create multiple concurrent sync writers
Do not scale this deployment above 1 replica until reconciliation sync is moved behind leader election or an external scheduler/worker.
Secrets
All secrets managed by Infisical at path /pos/partner-api.
| Key | Source |
|---|---|
POS_DATA_DATABASE_URL | Reference to /dependencies/pos canonical |
MCA_API_URL | Xano ZA API endpoint |
MCA_API_KEY | Xano ZA API key |
MCA_API_DATA_SOURCE | Xano workspace slug (extracted from API URL suffix, e.g. zr6jZOEU) |
MCA_SA_LIVE_V1_URL | Legacy ZA member database for member/card lookup; intended canonical source is /dependencies/mca-v1-za-db |
MCA_UK_LIVE_V1_URL | Legacy UK member database for member/card lookup; intended canonical source is /dependencies/mca-v1-uk-db |
POS_PARTNER_API_KEY | Partner authentication key |
POS_PARTNER_MEMBER_ID_SECRET | HMAC secret for member ID validation |
POS_PARTNER_ADMIN_KEY | Required admin authentication key for /api/admin/pos/* operator routes |
POS_PARTNER_MEMBER_SOURCE_DEFAULT | Default member source (mca_v1_za, mca_v1_uk, scl) |
POS_PARTNER_MEMBER_SOURCE_BY_CLUB | Optional per-club overrides, format club:source,club:source |
MCA_V2_POSTGRES_URL is not part of the pos-partner-api runtime contract.
The repo inventory now treats both MCA v1 URLs as shared dependency credentials. Before rollout, /pos/partner-api
must resolve valid values or references for both keys in the target environment.
Publish
Image published via pos-partner-api-publish.yml on push to main (paths-filtered) or pos-partner-api-v* tag.
Prisma Migration
Pre-sync migrate job runs automatically on ArgoCD sync:
npx prisma migrate deploy --schema=/app/prisma/pos-data/schema.prisma