acupedia-api/docs/schema.md

85 lines
3.9 KiB
Markdown

| Entity | Schema | Domain |
| ---------------------------------- | ---------- | ------------------------ |
| `app_users` | `auth` | Identity |
| `roles` | `auth` | RBAC |
| `user_roles` | `auth` | RBAC |
| `permissions` | `auth` | Authorization |
| `role_permissions` | `auth` | Authorization |
| `password_reset_otps` | `auth` | Credential recovery |
| `devices` | `auth` | Trusted/device identity |
| `device_change_requests` | `auth` | Device security workflow |
| `attribute_definition_sets` | `content` | Content schema |
| `attribute_definitions` | `content` | Content schema |
| `attribute_definition_members` | `content` | Content hierarchy |
| `content_items` | `content` | Clinical content |
| `content_attributes` | `content` | Typed-EAV |
| `content_translations` | `content` | Localization |
| `template_presentation_contracts` | `content` | Presentation |
| `template_attribute_presentations` | `content` | Presentation |
| `tags` | `content` | Content taxonomy |
| `content_tags` | `content` | Content taxonomy |
| `media_assets` | `content` | Media |
| `content_media` | `content` | Media association |
| `modules` | `content` | Product content modules |
| `module_contents` | `content` | Module composition |
| `module_tags` | `content` | Module taxonomy |
| `search_facet_definitions` | `content` | Search |
| `search_facet_values` | `content` | Search |
| `search_facet_mappings` | `content` | Search |
| `content_search_documents` | `content` | Search projection |
| `content_search_facets` | `content` | Search projection |
| `user_billing_profiles` | `commerce` | Billing |
| `access_plans` | `commerce` | Commercial plans |
| `access_plan_modules` | `commerce` | Plan composition |
| `user_subscriptions` | `commerce` | Subscriptions |
| `user_entitlements` | `commerce` | Access grants |
| `coupons` | `commerce` | Discounts |
| `coupon_redemptions` | `commerce` | Discounts |
| `payment_transactions` | `commerce` | Payments |
| `invoices` | `commerce` | Billing/tax |
| `refund_decisions` | `commerce` | Refunds |
| `user_activity_logs` | `platform` | Operational telemetry |
| `admin_audit_logs` | `platform` | Audit |
| `notifications` | `platform` | Notifications |
### Cross-schema dependency rules
We should enforce this directional dependency graph:
```
auth
↑
│
├──────── content
│
├──────── commerce ─────────► content
│
└──────── platform
```
More explicitly:
```
auth
depends on: nobody
content
may reference: auth
commerce
may reference: auth
may reference: content
platform
may reference: auth
```
Avoid:
```
auth → commerce
auth → content
auth → platform
content → commerce
content → platform
```