73 lines
2.5 KiB
Markdown
73 lines
2.5 KiB
Markdown
|
|
# Seller Management — Architecture Diagrams
|
||
|
|
|
||
|
|
Companion diagrams for [ADR-011](adr/ADR-011-optional-seller-management-module.md).
|
||
|
|
Architecture only — no UI, no backend, no business logic exists yet.
|
||
|
|
|
||
|
|
## 1. Hierarchy
|
||
|
|
|
||
|
|
```mermaid
|
||
|
|
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
|
||
|
|
|
||
|
|
```mermaid
|
||
|
|
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)
|
||
|
|
|
||
|
|
```mermaid
|
||
|
|
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.
|