Skip to content

Integration

1. Sister Services

Direction: calls / called by (consumes from) / bidir.

SisterDirectionSurfaceContractAuthFailure ModeIdempotency
@nx/saleKafka payment.successevent → RECEIPT voucherat-least-once(SALE_ORDER, attempt.uid)
@nx/inventoryKafka purchase-order.receivedevent → PAYMENT voucher (party VENDOR)at-least-once(PURCHASE_ORDER, purchaseOrderId)
@nx/inventoryKafka inventory.issued-for-saleevent → COGS ADJUSTMENTat-least-once(SALE_ORDER, attemptUid)
@nx/inventoryKafka inventory.adjustedevent → INVENTORY ADJUSTMENTat-least-once(INVENTORY_ADJUSTMENT, inventoryTrackingId)
@nx/commerceDebezium CDC Merchantrow → account reconciliationat-least-onceaccount existence checks
@nx/corein-process (re-exported repos/services)DI bindings
@nx/assetin-process componentVN bank reference data
@nx/identityHTTP — JWKS verification (VerifierApplication)JWT (ES256)JWTretry / cacherequest-id propagated

Finance resolves PurchaseOrder + Vendor via re-exported @nx/core repositories (same DB) to enrich the PAYMENT voucher party — there is no HTTP call to inventory.

2. External Systems

None directly. Payment-gateway credentials (VNPAY, banks, e-wallets) are stored in PaymentIntegration (encrypted) but finance does not call those gateways — @nx/mq-pay owns provider traffic. @nx/asset supplies static Vietnamese bank reference data.

3. Critical Cross-Service Flows

3.1 Sale payment → ledger income

Contract: finance only posts when the sale payload carries the chosen account (attempt.finance.source.id). Split tenders post one RECEIPT per attempt, deduped by attempt.uid.

3.2 Purchase order received → vendor payment + inventory asset

3.3 Inventory issuance/adjustment → COGS & asset posting

3.4 Merchant onboarding (CDC)

4. Contract Stability

SurfaceStabilityVersioning
HTTP /v1/api/finance/*stableURL prefix /v1/
Kafka payment.success (consumed)stablepayload field-additive only
Kafka purchase-order.received (consumed)stablepayload field-additive only
Kafka inventory.issued-for-sale / inventory.adjusted (consumed)stablepayload field-additive only
Debezium Merchant CDCfollows commerce schemacolumn-additive
Outbound Kafkanone todayreserved

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