FAQs

Q1. What datastore does the Cart Service use?

MongoDB (cartdb_{STAGE}) with Redis for caching, running as a serverless function. It can also run as a standalone HTTP server.

Q2. How are authentication and authorization done?

JWT bearer tokens from AWS Cognito. Each route declares a required privilege; the authorization hook validates the token and checks the privilege against the token claims, and admin routes additionally require admin status.

Q3. What’s the primary error-code prefix?

EQ-CRT- for cart operations. Auth codes use EQ-CART-, instances EQ-INS-, service registry EQ-SRV-, workflows EQ-CWF-, and shared/JWT codes EQ-USR-.

Q4. Are cart-action events (like cart.items.added) published to the event bus?

No. Those names are computed for logging only and dispatched to an in-process publisher whose handlers are empty stubs. The only real outbound events are the instance, service-registry, and cart-merge-completed events.

Q5. What events does the service consume?

Marketplace app lifecycle events (app.*) from the Marketplace Service, and cart-merge events from the User Service (guest-to-registered merge, gated by the user-merge switch).

Q6. How do per-tenant configurations work?

Each instance holds a properties object with workflow config (service mappings, marketplace app selections, resolution mode, channels), auth settings, the user-merge flag, and plugin config. Workflows resolve in 3 tiers: base, then instance default, then channel override.

Q7. How can I run it without MongoDB, Redis, or the event bus?

Set CART_USE_INMEMORY=true. The app seeds in-memory stores and replaces cache/event behaviour with no-ops; the cache-management and event-bus integrations are not registered.

Q8. How does GDPR deletion work?

A direct invocation triggers the cart-deletion action, which hard-deletes all cart documents matching the given instance and user. Items are embedded, so no separate cleanup is needed.

Q9. What happens when an external provider fails?

Adapter calls are wrapped by circuit breaker, retry, timeout, and fallback. Marketplace failures map to the 424/408/429 cart marketplace error codes.

Q10. Is the service registry still used?

It is deprecated (routes log a warning). Prefer cart workflows plus marketplace app selections; the registry resolution mode remains only as a rollback path.


Revision History
2026-08-05 | AN – Created the page and added the content.