Story #3758
openEpic #3756: EPIC: Multi-Tenant Architecture (Hotel as Tenant)
As a developer, I want all key models (Device, Promotion, MediaAsset, WidgetConfig, AnalyticsEvent) to carry a ForeignKey to Hotel so that all data is tenant-scoped
0%
Updated by Ajay Maharjan 3 days ago
Model │ Tenant column │
├──────────────────┼─────────────────────────────────────────────┤
│ Template │ tenant (direct FK) │
├──────────────────┼─────────────────────────────────────────────┤
│ Slide │ slide → template → tenant (2 hops) │
├──────────────────┼─────────────────────────────────────────────┤
│ Playlist │ tenant (direct FK) │
├──────────────────┼─────────────────────────────────────────────┤
│ PlaylistItem │ playlist → tenant (1 hop) │
├──────────────────┼─────────────────────────────────────────────┤
│ Schedule │ playlist → tenant (1 hop) │
├──────────────────┼─────────────────────────────────────────────┤
│ DeviceGroup │ tenant (direct FK) │
├──────────────────┼─────────────────────────────────────────────┤
│ Device │ tenant (direct FK) │
├──────────────────┼─────────────────────────────────────────────┤
│ DeviceHeartbeat │ device → tenant (1 hop) │
├──────────────────┼─────────────────────────────────────────────┤
│ MediaAsset │ tenant (direct FK) │
├──────────────────┼─────────────────────────────────────────────┤
│ WidgetSettings │ tenant (OneToOne) │
├──────────────────┼─────────────────────────────────────────────┤
│ ForexCache │ tenant (OneToOne) │
├──────────────────┼─────────────────────────────────────────────┤
│ PlayEvent │ tenant (direct FK) │
├──────────────────┼─────────────────────────────────────────────┤
│ AppEvent │ tenant (direct FK) │
├──────────────────┼─────────────────────────────────────────────┤
│ ShortUrl │ tenant (direct FK) │
├──────────────────┼─────────────────────────────────────────────┤
│ UrlClick │ short_url → tenant (1 hop) │
├──────────────────┼─────────────────────────────────────────────┤
│ TenantMembership │ tenant (direct FK) — links users to tenants │