• Mahmoud Aglan's avatar
    fix: writes that named columns the database does not have · 952e2ce6
    Mahmoud Aglan authored
    Every one of these was rejected by PostgREST and reported as success
    (found by checking each insert/update/select against the live schema):
    
    - workflows: approval_requests has reviewed_by/review_notes, not
      reviewer_id/review_note; reviewers and requesters are staff uuids, so the
      pages now show their names, "my requests" filters by the account id, and
      search no longer runs ilike on a uuid. workflow_rules has event_type, not
      event; created_by is a uuid; conditions/actions go in as jsonb lists.
    - RuleEngine: event_type, and its notify action writes a real notifications
      row (user_id, title_ar/body_ar) only when addressed to a player.
    - moderation: cheat_reports.reviewed_by references profiles, so a staff
      reviewer is stored in the new reviewed_by_admin column.
    - users: admin_users has no created_by.
    - org-transfers, org-frames, org-chat: org_members has player_id (not
      user_id) and no status column. Membership logic is unchanged.
    - org-achievements: an org achievement cannot be stored in
      player_achievements (its achievement_id references the game's
      achievements); granting now says so instead of failing the insert and
      still paying the reward. Progress reads completed/completed_at.
    - org-loyalty, org-partnerships: those tables have no updated_at.
    - live pages: phases are in tournament_phases ordered by phase_number; the
      arena tables never existed.
    Co-Authored-By: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
    952e2ce6
controller.php 13.1 KB