feat: ( payment ) create payment microservice

This commit is contained in:
Abubeker Yasin
2026-06-11 15:25:24 +03:00
parent 3235567b41
commit 2b430f8e76
54 changed files with 2809 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { registerAs } from "@nestjs/config";
export default registerAs("app", () => ({
port: parseInt(process.env.PORT ?? "3003", 10),
/**
* Shared secret for service-to-service auth (apps -> /payments/*, payment -> mark-paid).
* Required in production; in development an empty value disables the guard with a warning.
* TODO: integrate @tria-plc IAM / mTLS as the long-term mechanism (docs/payment-service §14).
*/
serviceAuthToken: process.env.SERVICE_AUTH_TOKEN ?? "",
reconciliation: {
/** How often the stale-intent sweep runs. */
sweepIntervalMs: parseInt(
process.env.RECONCILE_SWEEP_INTERVAL_MS ?? "60000",
10,
),
/** An intent is "stale" when non-terminal and untouched for this long. */
staleAfterMs: parseInt(process.env.RECONCILE_STALE_AFTER_MS ?? "60000", 10),
batchSize: parseInt(process.env.RECONCILE_BATCH_SIZE ?? "20", 10),
},
}));