-- Hotel payment methods (configurable per hotel)
CREATE TABLE hotel_payment_methods (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  hotel_id UUID NOT NULL REFERENCES hotels(id) ON DELETE CASCADE,
  name TEXT NOT NULL,
  currency TEXT NOT NULL DEFAULT 'RUB',
  type TEXT NOT NULL DEFAULT 'cash', -- cash, card, transfer, other
  is_active BOOLEAN NOT NULL DEFAULT true,
  sort_order INTEGER NOT NULL DEFAULT 0
);

-- Require payment on check-in: none | soft | hard
ALTER TABLE hotels ADD COLUMN IF NOT EXISTS require_payment_checkin TEXT NOT NULL DEFAULT 'none';

-- Seed default payment methods for existing hotels
INSERT INTO hotel_payment_methods (hotel_id, name, currency, type, sort_order)
SELECT id, 'Наличные', 'RUB', 'cash', 0 FROM hotels;

INSERT INTO hotel_payment_methods (hotel_id, name, currency, type, sort_order)
SELECT id, 'Банковская карта', 'RUB', 'card', 1 FROM hotels;

INSERT INTO hotel_payment_methods (hotel_id, name, currency, type, sort_order)
SELECT id, 'Перевод (СБП)', 'RUB', 'transfer', 2 FROM hotels;
