SystemStatus - ERD

SystemStatus — ERD (Phase 1)

See SystemStatus-PRD for entity descriptions.

erDiagram
  Workspace ||--o{ Character : has
  Workspace ||--o{ NotificationTemplate : defines
  Workspace ||--o{ NotificationRule : configures

  User ||--o{ Character : owns

  Character ||--o{ CharacterSkill : has
  Character ||--o{ CharacterPath : has
  Character ||--o{ Event : emits
  Character ||--o{ Notification : receives

  Workspace ||--o{ Event : logs
  Workspace ||--o{ Notification : delivers

  Workspace {
    UUID id
    string name
    jsonb settings
  }

  User {
    UUID id
    string displayName
    string role
    string authProviderId
  }

  Character {
    UUID id
    UUID workspaceId
    UUID ownerUserId
    string name
    UUID speciesId
    UUID originId
    jsonb stats
    jsonb derived
    jsonb progressionWallet
    jsonb visibilityMap
    text notes
    timestamptz createdAt
    timestamptz updatedAt
  }

  CharacterSkill {
    UUID id
    UUID characterId
    UUID skillId
    int rarity
    int level
    int xp
    int xpToNext
    int powerLevel
  }

  CharacterPath {
    UUID id
    UUID characterId
    UUID pathId
    int level
    string branch
    jsonb milestones
  }

  Event {
    UUID id
    UUID workspaceId
    UUID characterId
    string type
    jsonb payload
    UUID actorUserId
    timestamptz ts
  }

  NotificationTemplate {
    UUID id
    UUID workspaceId
    string name
    string category
    text bodyTemplate
    jsonb variables
  }

  NotificationRule {
    UUID id
    UUID workspaceId
    string name
    string trigger
    jsonb conditions
    UUID templateId
    string throttle
    bool enabled
  }

  Notification {
    UUID id
    UUID workspaceId
    UUID characterId
    UUID templateId
    jsonb recipientUserIds
    text renderedBody
    timestamptz ts
    string status
  }