CREATE TABLE IF NOT EXISTS bank_setup (
  id integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
  eft_account_name text NOT NULL DEFAULT 'WWN Operations',
  eft_institution_number text NOT NULL DEFAULT '001',
  eft_transit_number text NOT NULL DEFAULT '12345',
  eft_account_number text NOT NULL DEFAULT '123456789',
  interac_recipient_name text NOT NULL DEFAULT 'WWN Escrow',
  interac_email text NOT NULL DEFAULT 'payments@wwn.ca',
  cashout_min_amount numeric(12, 2) NOT NULL DEFAULT 20,
  cashout_fee_pct numeric(6, 3) NOT NULL DEFAULT 2.5,
  cashout_fee_fixed numeric(12, 2) NOT NULL DEFAULT 0,
  created_at timestamptz NOT NULL DEFAULT now(),
  updated_at timestamptz NOT NULL DEFAULT now()
);

INSERT INTO bank_setup (id) VALUES (1) ON CONFLICT (id) DO NOTHING;
