Documents the decision behind the typed contracts added in the previous commit: Seller Management is an optional platform capability module (Platform -> Marketplace -> Seller, 0..N per marketplace), not a second tenancy tier. Backend resolves seller scope the same way it already resolves tenant (ADR-001); frontend never resolves it itself. Gated by one typed flag (modules.sellerManagement.enabled), same capability-guard discipline as ADR-009, defaulting to disabled/absent so existing marketplaces are byte-identical. Explicitly scopes out UI, backend, and business logic as future work requiring its own ADR/implementation pass once the module is actually built out. Added companion diagrams (Seller-Management-Diagrams.md): hierarchy, bootstrap module-gate flow, and the type-contract class diagram. Registered ADR-011 in the foundation README's ADR index.
2.5 KiB
2.5 KiB
Seller Management — Architecture Diagrams
Companion diagrams for ADR-011. Architecture only — no UI, no backend, no business logic exists yet.
1. Hierarchy
graph TD
Platform["Platform<br/>(one Angular runtime)"]
Marketplace["Marketplace (tenant)<br/>always present · backend-resolved from Host<br/>ADR-001"]
SellerA["Seller A<br/>optional, 0..N"]
SellerB["Seller B<br/>optional, 0..N"]
NoSeller["No sellers<br/>(default — most marketplaces today)"]
Platform --> Marketplace
Marketplace --> SellerA
Marketplace --> SellerB
Marketplace -.default state.-> NoSeller
Marketplace is the only primary tenant. Seller is a child scope of exactly one marketplace — never a sibling tier, never resolved on its own.
2. Bootstrap module gate
graph LR
Request["GET /bootstrap"] --> Backend["Backend resolves:<br/>tenant (always)<br/>seller (only if applicable)"]
Backend --> Bootstrap["BootstrapConfig"]
Bootstrap --> ModulesCheck{"modules.sellerManagement.enabled?"}
ModulesCheck -->|false / absent, default| Identical["Behavior identical to today.<br/>No new routes, menus, or API calls."]
ModulesCheck -->|true| Available["Seller-aware behavior becomes available<br/>(not built yet — future work, own ADR)"]
Bootstrap -.optional field.-> SellerField["BootstrapConfig.seller<br/>(SellerConfig, present only when<br/>backend resolved a seller scope)"]
The frontend performs no resolution — it reads whatever the backend already
decided into BootstrapConfig.modules / BootstrapConfig.seller, exactly
the same discipline as tenant resolution (ADR-001) and feature-flag gating
(ADR-009).
3. Type contracts introduced (this ADR only)
classDiagram
class BootstrapConfig {
+TenantConfig tenant
+PlatformModulesConfig? modules
+SellerConfig? seller
...existing fields unchanged
}
class PlatformModulesConfig {
+SellerManagementModuleConfig sellerManagement
}
class SellerManagementModuleConfig {
+boolean enabled
}
class SellerConfig {
+UUID id
+UUID marketplaceId
+string slug
+string name
+string defaultLocale
+string[] supportedLocales
}
BootstrapConfig --> PlatformModulesConfig
BootstrapConfig --> SellerConfig
PlatformModulesConfig --> SellerManagementModuleConfig
modules and seller are both optional on BootstrapConfig. Every field
already on BootstrapConfig is untouched.