Skip to content

Operations

1. Deployment

PropertyValue
Imageregistry/taxation:<tag> (built from packages/taxation/Dockerfile)
Container Port3000 (external 31130)
Replicas1 (Snowflake worker id 13 is hardcoded — see warning)
ProbesGET /healthz (live), GET /readyz (ready)
Snowflake ID13 (APP_ENV_SNOWFLAKE_WORKER_ID)
Run modesRUN_MODE=startup (app + CDC consumer) · RUN_MODE=migrate (seeds)
Migration moderun-once bun run migrate job before/at boot

Scale warning: worker id 13 is hardcoded in env. Running >1 replica risks Snowflake id collisions. Multiple replicas also each run a CDC consumer in the same group — partition rebalance applies, but the id hazard is the blocker.

Traefik labels

yaml
labels:
  - "traefik.enable=true"
  - "traefik.http.routers.taxation.rule=PathPrefix(`/v1/api/taxation`)"
  - "traefik.http.services.taxation.loadbalancer.server.port=3000"

2. Observability

SignalSourceWhere to look
Logsstdout (structured key-value)kubectl logs <pod> / Loki
HealthGET /healthz, GET /readyzGateway portal
Metricsnone package-specific
Tracesnone

Key log lines

ScopeNotable lines
ApplicationKafkaComponentConnected/Disconnected to broker, Received message | Topic | Partition | Offset, Error processing message
TaxationWorkerServiceHandling product CDC | OP | After, DONE product CDC reconcile (provisioned/deprovisioned)
TaxProvisioningServiceSTART/DONE provision, SKIP provision — already provisioned, DEACTIVATED existing TaxSet
TaxGroupServiceVALIDATED | TaxGroup ... for Merchant ...

3. Security

ConcernMitigation
AuthNJWT (ES256, JWKS from identity) + HTTP Basic; strategies: ['jwt','basic'] on every route
AuthZResource-based permissions seeded per controller; baseline grant to OWNER/EMPLOYEE/CASHIER
Secretsenv-mounted (APP_ENV_POSTGRES_PASSWORD, Kafka SASL creds); never in code
KafkaSASL SCRAM-SHA-512
Soft-deletedeletedAt — no hard-delete; deprovision uses status DEACTIVATED
No audit trailTax-config changes are not audited (unlike invoice's InvoiceAuditTracing)

4. Runbook

4.1 Alert classes

AlertTriggerCheckFixEscalate
taxationCDCLagproducts updated but no TaxSet changelogs Received message, consumer group lagrestart consumer; verify brokeron-call backend
taxationProvisionErrorsTaxGroup not found / has no items errorslogs level=error in provisioningverify seeds ran (migrate); check taxGroupId validityon-call backend
taxationMissingBackfillproducts created while consumer down show no taxmanual POST /tax-provisioning/provision per producton-call backend

4.2 Common operations

OperationCommand
Tail logskubectl logs -n <ns> -f deploy/taxation
Re-run seedsbun run migrate (in pod, RUN_MODE=migrate)
Manual provisionPOST /v1/api/taxation/tax-provisioning/provision { productId, taxGroupId }
Manual deprovisionPOST /v1/api/taxation/tax-provisioning/deprovision { productId }
Replay product CDCre-trigger a product update in commerce (no built-in replay job)

No CDC backfill. fallbackMode: latest means products changed before the consumer's offset window are never reprocessed. Recover via manual provisioning endpoints or by re-saving the product in commerce.

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.