-- Super Admin donations mailbox · award correspondence feeding L4

create table if not exists grant_inbox (
  id text primary key,
  mailbox text not null default 'donations@capitalforgeleague.org',
  from_name text not null,
  from_email text not null,
  subject text not null,
  body text not null,
  received_at timestamptz not null default now(),
  status text not null default 'unread',
  kind text not null default 'inbound',
  linked_donation_id text,
  linked_solicitation_id text,
  linked_relationship_id text,
  amount_cents integer
);

create index if not exists grant_inbox_received_idx on grant_inbox (received_at desc);
create index if not exists grant_inbox_status_idx on grant_inbox (status);
