Skip to content

Tích hợp

1. Dịch vụ chị em

Chị emHướngBề mặtAuthChế độ lỗiIdempotency
@nx/identityHTTP JWKS (/jw-certs) để xác thực JWTretry / fail bootrequest-id
@nx/searchComponents (ApplicationSearchComponent, Typesense, Embedding); CDC consumer ở vai trò WORKERreplay offset CDCupsert theo PK
@nx/inventory (CDC)public.Merchant, public.ProductVariantreplay Debeziumtheo PK; seed location + InventoryItem
@nx/pricing (CDC)pricing.Fare*, public.ProductVariantreplay Debeziumtheo PK; init fare
@nx/taxation (CDC)public.Product (taxGroupId)replay Debeziumtheo PK; cấp phát thuế
@nx/invoice (CDC)public.MerchantTaxInforeplay Debeziumtheo PK; TaxInfo có thẩm quyền
@nx/assetApplicationAssetComponent (Minio); MetaLinksretry uploadtheo asset id
@nx/saleHTTP đọc ProductVariant, ProductInfo, SaleChannel, CategoryJWT (s2s)retrysnapshot trên order

Commerce không push trực tiếp tới inventory/pricing/taxation/invoice — cả bốn đều tiêu thụ CDC. Xem ADR-0002.

2. Hệ thống bên ngoài

Hệ thốngQuaGhi chú
Minio@nx/assetLưu trữ object cho media product/variant
Typesense@nx/searchEngine tìm kiếm; được điền bởi CDC, không phải trực tiếp bởi commerce
Kafka / DebeziuminfraCommerce chỉ ghi Postgres; Debezium (Kafka Connect) thực hiện capture WAL
Provider thanh toán/hóa đơn điện tửConfiguration mã hóaCommerce lưu thông tin đăng nhập (AES-256-GCM); cuộc gọi thực tế do dịch vụ payment/invoice sở hữu

Không có cuộc gọi API bên thứ ba trực tiếp từ source commerce — thông tin đăng nhập provider được thu thập ở đây và tiêu thụ nơi khác.

3. Luồng cross-service quan trọng

3.1 Onboarding → Seed Inventory (CDC)

3.2 Product Variant → Inventory Item + Pricing Fare (CDC)

Variant COMBO không nằm trong STOCKABLE_SET, nên inventory không seed InventoryItem cho chúng.

3.3 Thông tin thuế Merchant → TaxInfo (CDC)

3.4 Sao chép sản phẩm đa Merchant (nội bộ)

4. Tính ổn định của hợp đồng

Bề mặtỔn địnhQuản lý phiên bản
HTTP /v1/api/commerce/*ổn địnhtiền tố URL /v1/
CDC topics (public.*)gắn schemathêm cột an toàn; đổi tên phá vỡ consumer — phối hợp
Hình dạng Merchant.metadata.taxổn địnhchỉ thêm trường (taxCode bắt buộc)
Khóa sự kiện EventBusnội bộkhông phải hợp đồng công khai
Hình dạng job BullMQnội bộkhông phải hợp đồng công khai

5. Trang liên quan

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