Skip to content

Commit c8eb86a

Browse files
authored
Merge pull request #37 from touchmegit1:shift
feat: Add column mappings for product_combos and product_combo_items in seed generation script
2 parents 1a80678 + f8b13eb commit c8eb86a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

deploy/fix_seed.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ INSERT INTO `campaigns` (`id`,`campaign_code`,`campaign_name`,`campaign_type`,`d
171171
INSERT INTO `coupons` (id,allowed_categories,internal_notes,coupon_code,coupon_name,coupon_type,created_at,current_usage_count,description,discount_amount,discount_percent,end_date,end_time,get_quantity,min_quantity,max_discount_amount,min_purchase_amount,buy_quantity,start_date,start_time,status,total_usage_limit,updated_at,usage_per_customer,campaign_id,created_by) VALUES (1,NULL,NULL,'WELCOME10','Giảm 10% Đơn Đầu','PERCENTAGE','2026-03-18 01:40:09.000000',1,'Mã giảm 10% cho đơn hàng đầu tiên',NULL,10.00,'2026-03-31',NULL,NULL,NULL,50000.00,100000.00,NULL,'2026-02-01',NULL,'ACTIVE',1000,'2026-03-19 13:16:19.205862',1,1,2),(2,NULL,NULL,'FLASH50K','Giảm 50K Flash Sale','FIXED_AMOUNT','2026-03-18 01:40:09.000000',NULL,'Giảm ngay 50k cho đơn từ 300k',50000.00,NULL,'2026-02-15',NULL,NULL,NULL,NULL,300000.00,NULL,'2026-02-14',NULL,'ACTIVE',500,'2026-03-18 01:40:09.000000',2,2,2),(3,NULL,NULL,'SUMMER2026','SUMMER26','PERCENTAGE','2026-03-19 14:08:12.613974',0,'',NULL,10.00,'2026-03-28',NULL,NULL,NULL,200000.00,NULL,NULL,'2026-03-19',NULL,'ACTIVE',NULL,'2026-03-19 15:36:44.695509',NULL,8,NULL);
172172

173173
-- 16. PRODUCT COMBOS
174-
INSERT INTO `product_combos` VALUES (1,'CB-SNACK-1','Combo Siêu đn Vặt',200000.00,'DISCOUNT','2026-03-18 01:40:09.000000','Gói snack tổng hợp cho cuối tuần',12.28,1,'https://res.cloudinary.com/didvvefmu/image/upload/v1773919231/smalltrend/user-avatars/sbj0qhwxse75lpp3z4r6.jpg',0,0,5,228000.00,28000.00,'ACTIVE',100,'snack,combo,hot',0,'2026-03-19 11:51:12.370454','2026-02-01','2026-12-31',1),(2,'CB-DRINK-1','Combo Nước Giải Khát',30000.00,'BUNDLE','2026-03-18 01:40:09.000000','2 lon Coca và 1 bịch Oishi',22.68,2,'https://res.cloudinary.com/didvvefmu/image/upload/v1773923203/smalltrend/user-avatars/fsfoh612tomv6pii99xz.jpg',0,0,10,38800.00,8800.00,'ACTIVE',200,'drink,summer',0,'2026-03-19 12:26:40.038268','2026-02-01','2026-12-31',1),(3,'COMBO-BREAKFAST','Combo Sáng Năng Động',30000.00,'BUNDLE','2026-03-18 01:40:09.000000','Sữa +Mì gói',9.09,3,'https://res.cloudinary.com/didvvefmu/image/upload/v1773923539/smalltrend/user-avatars/asdtvrwzaqjzfvtha0gn.jpg',0,0,10,33000.00,3000.00,'ACTIVE',100,'breakfast',0,'2026-03-19 12:32:16.273987','2026-02-01','2026-03-31',2),(4,'COMBO-SNACK','Combo Snack Vui Vẻ',40000.00,'DISCOUNT','2026-03-18 01:40:09.000000','Snack + Nước ngọt',14.53,4,'https://res.cloudinary.com/didvvefmu/image/upload/v1773940913/smalltrend/user-avatars/rcobnefh5bxxnhitbgdm.jpg',0,0,10,46800.00,6800.00,'ACTIVE',100,'snack',0,'2026-03-19 17:21:50.415131','2026-02-14','2026-02-28',2),(5,'CB-MILK-1','Combo Nước Tương',84000.00,'BUNDLE','2026-03-18 01:40:09.000000','',4.55,5,'https://res.cloudinary.com/didvvefmu/image/upload/v1773941306/smalltrend/user-avatars/bmbsduhekrndip7f73uu.jpg',0,0,10,88000.00,4000.00,'ACTIVE',100,'milk,family',0,'2026-03-19 17:28:22.847343','2026-02-01','2026-12-31',1),(6,'CB-NOODLE-1','Combo Mì Tiết Kiệm',39000.00,'DISCOUNT','2026-03-18 01:40:09.000000','Mì Acecook + Mì Omachi\n',10.34,6,'https://res.cloudinary.com/didvvefmu/image/upload/v1773941731/smalltrend/user-avatars/sjwafuigae05bs83vsyg.jpg',0,0,10,43500.00,4500.00,'ACTIVE',150,'noodle,combo',0,'2026-03-19 17:53:31.362532','2026-02-01','2026-12-31',1),(9,'CB-SUMMER-1','Combo Mùa Hè',60000.00,'SUMMER','2026-03-18 01:40:09.000000','Pepsi + Coca + Snack',10.18,9,'https://res.cloudinary.com/didvvefmu/image/upload/v1773942104/smalltrend/user-avatars/xr8eanwle2ctfrites4q.jpg',0,0,10,66800.00,6800.00,'ACTIVE',200,'summer,drink',0,'2026-03-19 17:41:41.199506','2026-04-01','2026-08-31',1);
174+
INSERT INTO `product_combos` (id,combo_code,combo_name,combo_price,combo_type,created_at,description,discount_percent,display_order,image_url,is_active,is_featured,max_quantity_per_order,original_price,saved_amount,status,stock_limit,tags,total_sold,updated_at,valid_from,valid_to,created_by) VALUES (1,'CB-SNACK-1','Combo Siêu đn Vặt',200000.00,'DISCOUNT','2026-03-18 01:40:09.000000','Gói snack tổng hợp cho cuối tuần',12.28,1,'https://res.cloudinary.com/didvvefmu/image/upload/v1773919231/smalltrend/user-avatars/sbj0qhwxse75lpp3z4r6.jpg',0,0,5,228000.00,28000.00,'ACTIVE',100,'snack,combo,hot',0,'2026-03-19 11:51:12.370454','2026-02-01','2026-12-31',1),(2,'CB-DRINK-1','Combo Nước Giải Khát',30000.00,'BUNDLE','2026-03-18 01:40:09.000000','2 lon Coca và 1 bịch Oishi',22.68,2,'https://res.cloudinary.com/didvvefmu/image/upload/v1773923203/smalltrend/user-avatars/fsfoh612tomv6pii99xz.jpg',0,0,10,38800.00,8800.00,'ACTIVE',200,'drink,summer',0,'2026-03-19 12:26:40.038268','2026-02-01','2026-12-31',1),(3,'COMBO-BREAKFAST','Combo Sáng Năng Động',30000.00,'BUNDLE','2026-03-18 01:40:09.000000','Sữa +Mì gói',9.09,3,'https://res.cloudinary.com/didvvefmu/image/upload/v1773923539/smalltrend/user-avatars/asdtvrwzaqjzfvtha0gn.jpg',0,0,10,33000.00,3000.00,'ACTIVE',100,'breakfast',0,'2026-03-19 12:32:16.273987','2026-02-01','2026-03-31',2),(4,'COMBO-SNACK','Combo Snack Vui Vẻ',40000.00,'DISCOUNT','2026-03-18 01:40:09.000000','Snack + Nước ngọt',14.53,4,'https://res.cloudinary.com/didvvefmu/image/upload/v1773940913/smalltrend/user-avatars/rcobnefh5bxxnhitbgdm.jpg',0,0,10,46800.00,6800.00,'ACTIVE',100,'snack',0,'2026-03-19 17:21:50.415131','2026-02-14','2026-02-28',2),(5,'CB-MILK-1','Combo Nước Tương',84000.00,'BUNDLE','2026-03-18 01:40:09.000000','',4.55,5,'https://res.cloudinary.com/didvvefmu/image/upload/v1773941306/smalltrend/user-avatars/bmbsduhekrndip7f73uu.jpg',0,0,10,88000.00,4000.00,'ACTIVE',100,'milk,family',0,'2026-03-19 17:28:22.847343','2026-02-01','2026-12-31',1),(6,'CB-NOODLE-1','Combo Mì Tiết Kiệm',39000.00,'DISCOUNT','2026-03-18 01:40:09.000000','Mì Acecook + Mì Omachi\n',10.34,6,'https://res.cloudinary.com/didvvefmu/image/upload/v1773941731/smalltrend/user-avatars/sjwafuigae05bs83vsyg.jpg',0,0,10,43500.00,4500.00,'ACTIVE',150,'noodle,combo',0,'2026-03-19 17:53:31.362532','2026-02-01','2026-12-31',1),(9,'CB-SUMMER-1','Combo Mùa Hè',60000.00,'SUMMER','2026-03-18 01:40:09.000000','Pepsi + Coca + Snack',10.18,9,'https://res.cloudinary.com/didvvefmu/image/upload/v1773942104/smalltrend/user-avatars/xr8eanwle2ctfrites4q.jpg',0,0,10,66800.00,6800.00,'ACTIVE',200,'summer,drink',0,'2026-03-19 17:41:41.199506','2026-04-01','2026-08-31',1);
175175

176176

177177
-- PRODUCT COMBO ITEMS
178-
INSERT INTO `product_combo_items` VALUES (38,0,0,0,1,1,NULL,1,2,5),(41,0,0,0,1,1,NULL,1,3,1),(42,0,0,0,1,1,NULL,1,3,13),(43,0,0,0,2,1,NULL,2,1,5),(44,0,0,0,1,1,NULL,1,1,17),(45,0,0,0,4,1,NULL,4,1,10),(46,0,0,0,2,1,NULL,2,4,5),(48,0,0,0,1,1,NULL,1,5,6),(49,0,0,0,1,1,NULL,1,5,14),(50,0,0,0,1,1,NULL,1,5,20),(51,0,0,0,1,1,NULL,1,5,23),(55,0,0,0,2,1,NULL,2,9,18),(56,0,0,0,2,1,NULL,2,9,5),(57,0,0,0,3,1,NULL,3,6,12),(58,0,0,0,3,1,NULL,3,6,13);
178+
INSERT INTO `product_combo_items` (id,can_substitute,display_order,is_optional,max_quantity,min_quantity,notes,quantity,combo_id,product_variant_id) VALUES (38,0,0,0,1,1,NULL,1,2,5),(41,0,0,0,1,1,NULL,1,3,1),(42,0,0,0,1,1,NULL,1,3,13),(43,0,0,0,2,1,NULL,2,1,5),(44,0,0,0,1,1,NULL,1,1,17),(45,0,0,0,4,1,NULL,4,1,10),(46,0,0,0,2,1,NULL,2,4,5),(48,0,0,0,1,1,NULL,1,5,6),(49,0,0,0,1,1,NULL,1,5,14),(50,0,0,0,1,1,NULL,1,5,20),(51,0,0,0,1,1,NULL,1,5,23),(55,0,0,0,2,1,NULL,2,9,18),(56,0,0,0,2,1,NULL,2,9,5),(57,0,0,0,3,1,NULL,3,6,12),(58,0,0,0,3,1,NULL,3,6,13);
179179

180180
-- 17. CASH REGISTERS
181181
INSERT INTO `cash_registers` (id,created_at,max_cash_limit,device_id,current_cash,notes,location,total_card_today,total_cash_today,opening_balance,register_code,register_name,register_type,session_start_time,status,store_name,total_sales_today,total_transactions_today,variance,expected_balance,updated_at,last_transaction_time,current_operator_id) VALUES (1,'2026-03-18 01:40:09.000000',5000000.00,'DEV-POS-001',NULL,NULL,'Front Counter',NULL,NULL,2000000.00,'POS-001','Quầy 1','MAIN','2026-03-18 01:40:09.000000','ACTIVE','SmallTrend Store',NULL,NULL,NULL,0,'2026-03-18 01:40:09.000000',NULL,3),(2,'2026-03-18 01:40:09.000000',3000000.00,'DEV-POS-002',NULL,NULL,'Express Counter',NULL,NULL,1000000.00,'POS-002','Quầy 2','EXPRESS',NULL,'ACTIVE','SmallTrend Store',NULL,NULL,NULL,0,'2026-03-18 01:40:09.000000',NULL,NULL);

deploy/gen_fix_seed.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ const COLUMN_MAPS = {
1717
"supplier_contracts": "id,contract_number,created_at,currency,delivery_terms,description,end_date,notes,payment_terms,signed_by_company,signed_by_supplier,signed_date,start_date,status,title,total_value,updated_at,supplier_id",
1818
"tax_rates": "id,is_active,name,rate",
1919
"price_expiry_alert_logs": "id,alert_date,recipient_email,sent_at,variant_price_id",
20+
"product_combos": "id,combo_code,combo_name,combo_price,combo_type,created_at,description,discount_percent,display_order,image_url,is_active,is_featured,max_quantity_per_order,original_price,saved_amount,status,stock_limit,tags,total_sold,updated_at,valid_from,valid_to,created_by",
21+
"product_combo_items": "id,can_substitute,display_order,is_optional,max_quantity,min_quantity,notes,quantity,combo_id,product_variant_id",
2022
"products": "id,created_at,name,image_url,is_active,description,updated_at,brand_id,category_id,tax_rate_id",
2123
"units": "id,code,default_cost_price,default_sell_price,material_type,name,symbol",
2224
"unit_conversions": "id,conversion_factor,description,is_active,sell_price,to_unit_id,variant_id",

0 commit comments

Comments
 (0)