-- Criar estabelecimentos de exemplo na VPS
-- Execute: sudo -u postgres psql -d maktubia_points -f criar-establishments-vps.sql

-- Inserir estabelecimentos de exemplo
INSERT INTO establishments (est_id, name, type, image_url, qr_code, is_active, created_at, updated_at)
VALUES 
    ('MAKTUBIA_SHOP_001', 'Maktubia Shop Principal', 'Loja', NULL, 'MAKTUBIA_SHOP_001', TRUE, NOW(), NOW()),
    ('MAKTUBIA_SHOP_002', 'Maktubia Shop Centro', 'Loja', NULL, 'MAKTUBIA_SHOP_002', TRUE, NOW(), NOW()),
    ('MAKTUBIA_REST_001', 'Maktubia Restaurant', 'Restaurante', NULL, 'MAKTUBIA_REST_001', TRUE, NOW(), NOW()),
    ('MAKTUBIA_CAFE_001', 'Maktubia Café', 'Café', NULL, 'MAKTUBIA_CAFE_001', TRUE, NOW(), NOW()),
    ('MAKTUBIA_SUPER_001', 'Maktubia Supermercado', 'Supermercado', NULL, 'MAKTUBIA_SUPER_001', TRUE, NOW(), NOW())
ON CONFLICT (est_id) DO UPDATE SET
    name = EXCLUDED.name,
    type = EXCLUDED.type,
    is_active = EXCLUDED.is_active,
    updated_at = NOW();

-- Verificar estabelecimentos criados
SELECT 
    est_id,
    name,
    type,
    qr_code,
    is_active,
    created_at,
    updated_at
FROM establishments
ORDER BY created_at DESC;













