Skip to content

Integration

1. Sister Services

Direction: calls / called by / bidir. The build-time dependency is @nx/core only; all coupling below is via shared DB or Kafka CDC.

SisterDirectionSurfaceContractAuthFailure ModeIdempotency
@nx/commerceKafka public.Product (Debezium)CDC envelope (TProductPgRow)at-least-once; log + skip(productId, taxGroupId, op)
@nx/pricingShared DB read pricing.TaxSet / pricing.TaxDrizzle row shapen/a (read)n/a
@nx/invoiceTaxInfo consumer (no taxation surface)coupled via core models onlyn/an/a
@nx/identityJWT issuer; JWKS verified per requestES256 JWKSJWTrequest fails 401n/a
commerce MerchantRepositoryIn-process DI (MerchantRepository) for taxMethod lookuprepository contractthrows on not-foundn/a

TaxGroupService injects a MerchantRepository-like binding to read merchant taxMethod during validation. The binding is resolved from the shared DI graph, not via HTTP.

2. External Systems

SystemDirectionSurfaceAuthFailure Mode
Kafka / DebeziumConsume public.ProductSASL SCRAM-SHA-512broker reconnect (logged)
PostgreSQLtax + pricing schemasuser/passpool error

3. Critical Cross-Service Flows

3.1 Product change → tax provisioning

StepDetail
1-2Commerce owns Product; Debezium captures the row change
3-4Taxation reconciles: provision when taxGroupId set, else deprovision
5Pricing reads the provisioned TaxSet/Tax directly — no event from taxation

3.2 Merchant tax-method validation

StepDetail
4DIRECT merchant cannot use a DEDUCTION group (and vice versa); unset merchant taxMethod allows any

4. Contract Stability

SurfaceStabilityVersioning
HTTP /tax-groups, /tax-group-itemsstableURL /v1/
HTTP /tax-provisioning/*stableURL /v1/
HTTP /vn-* readsstableURL /v1/
Kafka public.Product (inbound)external (Debezium-defined)Debezium schema
pricing.TaxSet / pricing.Tax shared readstable (core-owned)schema migration

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