Skip to main content

Deployment

Environments

EnvNamespaceArgoCD App
UATpos-uatpos-partner-api
Prodpos-prodpos-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.

KeySource
POS_DATA_DATABASE_URLReference to /dependencies/pos canonical
MCA_API_URLXano ZA API endpoint
MCA_API_KEYXano ZA API key
MCA_API_DATA_SOURCEXano workspace slug (extracted from API URL suffix, e.g. zr6jZOEU)
MCA_SA_LIVE_V1_URLLegacy ZA member database for member/card lookup; intended canonical source is /dependencies/mca-v1-za-db
MCA_UK_LIVE_V1_URLLegacy UK member database for member/card lookup; intended canonical source is /dependencies/mca-v1-uk-db
POS_PARTNER_API_KEYPartner authentication key
POS_PARTNER_MEMBER_ID_SECRETHMAC secret for member ID validation
POS_PARTNER_ADMIN_KEYRequired admin authentication key for /api/admin/pos/* operator routes
POS_PARTNER_MEMBER_SOURCE_DEFAULTDefault member source (mca_v1_za, mca_v1_uk, scl)
POS_PARTNER_MEMBER_SOURCE_BY_CLUBOptional 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