-- Ether业主小程序测试数据 - Finance服务
-- PostgreSQL语法

-- 清理旧测试数据
DELETE FROM finance_fee_bill WHERE bill_no LIKE 'TEST%';

-- 插入测试账单
INSERT INTO finance_fee_bill (id, bill_no, project_id, owner_id, fee_type, fee_item_name, amount, total_amount, paid_amount, unpaid_amount, status, due_date, billing_period_start, billing_period_end, created_at, updated_at) VALUES
('d9357f9a-1e11-45e4-b3a6-f2447bdde1a1', 'TEST2024001', 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'b9357f9a-1e11-45e4-b3a6-f2447bdde1a9', 'PROPERTY_FEE', '物业管理费', 500.00, 500.00, 0.00, 500.00, 'PENDING', CURRENT_DATE + INTERVAL '30 days', CURRENT_DATE - INTERVAL '1 month', CURRENT_DATE, NOW(), NOW()),
('d9357f9a-1e11-45e4-b3a6-f2447bdde1a2', 'TEST2024002', 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'b9357f9a-1e11-45e4-b3a6-f2447bdde1a9', 'WATER_FEE', '水费', 80.50, 80.50, 0.00, 80.50, 'PENDING', CURRENT_DATE + INTERVAL '15 days', CURRENT_DATE - INTERVAL '1 month', CURRENT_DATE, NOW(), NOW()),
('d9357f9a-1e11-45e4-b3a6-f2447bdde1a3', 'TEST2024003', 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'b9357f9a-1e11-45e4-b3a6-f2447bdde1a9', 'ELECTRIC_FEE', '电费', 120.00, 120.00, 0.00, 120.00, 'PENDING', CURRENT_DATE + INTERVAL '15 days', CURRENT_DATE - INTERVAL '1 month', CURRENT_DATE, NOW(), NOW());

SELECT 'Finance测试数据插入完成' AS result;
