-- Auto-generated oleh scripts/gen_seeds_fbcover.py — JANGAN edit manual.
-- 200_fb_master.sql — fb_outlet (6) + fb_meal_period (31), ADR-016/pola ADR-015a


-- Master sebagai DATA (pola ADR-015a): tambah outlet/meal period = INSERT baris baru,
-- tanpa deploy. Master/config (bukan transaksional) -> ON DUPLICATE KEY UPDATE,
-- pola 190_room_master.sql. food_account_id/beverage_account_id dirujuk via SELECT
-- code (bukan id literal) supaya tahan bila coa_account di-regenerasi (ADR-004).

INSERT INTO fb_outlet (id, code, name, food_account_id, beverage_account_id, sort_order, is_active) VALUES
(1, 'MMR', 'Meditera Main Restaurant', (SELECT id FROM coa_account WHERE code = '40.01.2.01'), (SELECT id FROM coa_account WHERE code = '40.01.2.08'), 10, 1),
(2, 'MMB', 'Meditera Main Bar', (SELECT id FROM coa_account WHERE code = '40.01.2.02'), (SELECT id FROM coa_account WHERE code = '40.01.2.09'), 20, 1),
(3, 'MSB', 'Meditera Sunken Bar', (SELECT id FROM coa_account WHERE code = '40.01.2.02'), (SELECT id FROM coa_account WHERE code = '40.01.2.09'), 30, 1),
(4, 'IRD', 'Layanan Kamar - In Room Dining', (SELECT id FROM coa_account WHERE code = '40.01.2.03'), (SELECT id FROM coa_account WHERE code = '40.01.2.10'), 40, 1),
(5, 'FSR', 'Segening Restaurant', (SELECT id FROM coa_account WHERE code = '40.01.2.04'), (SELECT id FROM coa_account WHERE code = '40.01.2.11'), 50, 1),
(6, 'BQT', 'Banquet', (SELECT id FROM coa_account WHERE code = '40.01.2.05'), (SELECT id FROM coa_account WHERE code = '40.01.2.12'), 60, 1)
ON DUPLICATE KEY UPDATE name=VALUES(name), food_account_id=VALUES(food_account_id), beverage_account_id=VALUES(beverage_account_id), sort_order=VALUES(sort_order), is_active=VALUES(is_active);

INSERT INTO fb_meal_period (id, outlet_id, code, name, is_breakfast, sort_order, is_active) VALUES
(1, 1, 'BREAKFAST_IN_HOUSE', 'Breakfast (In House)', 1, 10, 1),
(2, 1, 'BREAKFAST_OUTSIDE', 'Breakfast (Outside)', 1, 20, 1),
(3, 1, 'LUNCH', 'Lunch', 0, 30, 1),
(4, 1, 'DINNER', 'Dinner', 0, 40, 1),
(5, 1, 'SUPPER', 'Supper', 0, 50, 1),
(6, 1, 'ALL_DAY', 'All Day', 0, 60, 1),
(7, 2, 'BREAKFAST', 'Breakfast', 1, 10, 1),
(8, 2, 'LUNCH', 'Lunch', 0, 20, 1),
(9, 2, 'DINNER', 'Dinner', 0, 30, 1),
(10, 2, 'SUPPER', 'Supper', 0, 40, 1),
(11, 2, 'ALL_DAY', 'All Day', 0, 50, 1),
(12, 3, 'BREAKFAST', 'Breakfast', 1, 10, 1),
(13, 3, 'LUNCH', 'Lunch', 0, 20, 1),
(14, 3, 'DINNER', 'Dinner', 0, 30, 1),
(15, 3, 'SUPPER', 'Supper', 0, 40, 1),
(16, 3, 'ALL_DAY', 'All Day', 0, 50, 1),
(17, 4, 'BREAKFAST', 'Breakfast', 1, 10, 1),
(18, 4, 'LUNCH', 'Lunch', 0, 20, 1),
(19, 4, 'DINNER', 'Dinner', 0, 30, 1),
(20, 4, 'SUPPER', 'Supper', 0, 40, 1),
(21, 4, 'ALL_DAY', 'All Day', 0, 50, 1),
(22, 5, 'LUNCH_COOKING_CLASS', 'Lunch - Cooking Class', 0, 10, 1),
(23, 5, 'LUNCH', 'Lunch', 0, 20, 1),
(24, 5, 'DINNER', 'Dinner', 0, 30, 1),
(25, 5, 'SUPPER', 'Supper', 0, 40, 1),
(26, 5, 'ALL_DAY', 'All Day', 0, 50, 1),
(27, 6, 'LUNCH_INDOOR_MULTI_FUNCTION', 'Lunch (In Door Multi Function)', 0, 10, 1),
(28, 6, 'LUNCH_WEDDING_CHAPEL', 'Lunch (Wedding Chapel)', 0, 20, 1),
(29, 6, 'DINNER_AMPHITHEATER', 'Dinner (Amphitherater)', 0, 30, 1),
(30, 6, 'SUPPER', 'Supper', 0, 40, 1),
(31, 6, 'ALL_DAY', 'All Day', 0, 50, 1)
ON DUPLICATE KEY UPDATE outlet_id=VALUES(outlet_id), name=VALUES(name), is_breakfast=VALUES(is_breakfast), sort_order=VALUES(sort_order), is_active=VALUES(is_active);
