CREATE TABLE IF NOT EXISTS banks (
  id TEXT PRIMARY KEY,
  code TEXT NOT NULL,
  name TEXT NOT NULL,
  name_en TEXT,
  account_id TEXT,
  account_code TEXT,
  bank_number TEXT,
  full_name TEXT,
  branch TEXT,
  iban TEXT,
  currency_code TEXT,
  raw JSONB NOT NULL DEFAULT '{}'::jsonb,
  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
  updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

CREATE TABLE IF NOT EXISTS customer_pricing (
  category TEXT PRIMARY KEY,
  raw JSONB NOT NULL DEFAULT '{}'::jsonb,
  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
  updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

CREATE INDEX IF NOT EXISTS idx_banks_code ON banks (code);
CREATE INDEX IF NOT EXISTS idx_banks_name ON banks (name);
