create table if not exists public.payment (
  ref text primary key,
  qr_string text not null,
  total_amount integer not null,
  note text,
  merchant text not null,
  created_at timestamptz not null,
  paid_at timestamptz,
  paid_signature text,
  paid_amount integer,
  paid_date text,
  paid_description text,
  paid_balance integer
);

alter table public.payment enable row level security;

create policy "payment_read_only"
on public.payment
for select
using (true);

grant usage on schema public to service_role;
grant all privileges on all tables in schema public to service_role;
grant all privileges on all sequences in schema public to service_role;
