Skip to content

Commit 6c193da

Browse files
committed
Auto Append Mock Data for Inventory missing tables
1 parent c45393c commit 6c193da

20 files changed

+454
-16
lines changed

deploy/append_mock.js

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
const fs = require('fs');
2+
const fixFile = 'deploy/fix_seed.sql';
3+
4+
// MOCK DATA ĐỂ TRÁNH LỖI SCHEMA (CHỈ TẠO 1-2 BẢN GHI DEMO CHO MỖI BẢNG)
5+
const MOCK_DATA = `
6+
7+
-- ==========================================================
8+
-- DỮ LIỆU BÙ ĐẮP CHO CÁC BẢNG BỊ LỖI SCHEMA TRANSACTIONS
9+
-- ==========================================================
10+
11+
SET FOREIGN_KEY_CHECKS = 0;
12+
13+
-- 1. purchase_orders & items
14+
TRUNCATE TABLE purchase_orders;
15+
TRUNCATE TABLE purchase_order_items;
16+
INSERT INTO \`purchase_orders\` (\`id\`, \`order_number\`, \`supplier_id\`, \`created_by\`, \`location_id\`, \`order_date\`, \`status\`, \`subtotal\`, \`total_amount\`, \`paid_amount\`)
17+
VALUES
18+
(1, 'PO-202603-001', 1, 1, 1, '2026-03-28', 'DRAFT', 100000.00, 100000.00, 0.00);
19+
20+
INSERT INTO \`purchase_order_items\` (\`id\`, \`purchase_order_id\`, \`product_id\`, \`expected_quantity\`, \`actual_quantity\`, \`unit_price\`, \`total_price\`)
21+
VALUES
22+
(1, 1, 1, 10, 0, 10000.00, 100000.00);
23+
24+
25+
-- 2. sale_orders & items
26+
TRUNCATE TABLE sale_orders;
27+
TRUNCATE TABLE sale_order_items;
28+
INSERT INTO \`sale_orders\` (\`id\`, \`order_number\`, \`customer_id\`, \`cashier_id\`, \`location_id\`, \`order_time\`, \`status\`, \`total_amount\`, \`discount_amount\`, \`final_amount\`, \`payment_method\`, \`payment_status\`)
29+
VALUES
30+
(1, 'SO-202603-001', 1, 1, 1, '2026-03-28 10:00:00', 'COMPLETED', 50000.00, 0, 50000.00, 'CASH', 'PAID');
31+
32+
INSERT INTO \`sale_order_items\` (\`id\`, \`order_id\`, \`product_id\`, \`quantity\`, \`unit_price\`, \`subtotal\`)
33+
VALUES
34+
(1, 1, 1, 2, 25000.00, 50000.00);
35+
36+
37+
-- 3. inventory_counts & items
38+
TRUNCATE TABLE inventory_counts;
39+
TRUNCATE TABLE inventory_count_items;
40+
INSERT INTO \`inventory_counts\` (\`id\`, \`code\`, \`location_id\`, \`created_by\`, \`created_at\`, \`status\`, \`total_difference_value\`, \`total_overage_value\`, \`total_shortage_value\`, \`notes\`)
41+
VALUES
42+
(1, 'IC-202603-001', 1, 1, '2026-03-28 10:00:00', 'CONFIRMED', 0.00, 0.00, 0.00, 'Kiểm kho cuối tháng');
43+
44+
INSERT INTO \`inventory_count_items\` (\`id\`, \`inventory_count_id\`, \`product_id\`, \`system_quantity\`, \`actual_quantity\`, \`difference_quantity\`, \`difference_value\`)
45+
VALUES
46+
(1, 1, 1, 50, 50, 0, 0.00);
47+
48+
49+
-- 4. disposal_vouchers & items
50+
TRUNCATE TABLE disposal_vouchers;
51+
TRUNCATE TABLE disposal_voucher_items;
52+
INSERT INTO \`disposal_vouchers\` (\`id\`, \`code\`, \`location_id\`, \`reason_type\`, \`status\`, \`total_items\`, \`total_quantity\`, \`total_value\`, \`created_by\`, \`created_at\`)
53+
VALUES
54+
(1, 'DV-202603-001', 1, 'DAMAGED', 'CONFIRMED', 1, 5, 50000.00, 1, '2026-03-28 10:00:00');
55+
56+
INSERT INTO \`disposal_voucher_items\` (\`id\`, \`disposal_voucher_id\`, \`product_id\`, \`quantity\`, \`unit_cost\`, \`total_cost\`)
57+
VALUES
58+
(1, 1, 1, 5, 10000.00, 50000.00);
59+
60+
61+
-- 5. product_combos & items
62+
TRUNCATE TABLE product_combos;
63+
TRUNCATE TABLE product_combo_items;
64+
INSERT INTO \`product_combos\` (\`id\`, \`combo_code\`, \`combo_name\`, \`original_price\`, \`combo_price\`, \`is_active\`)
65+
VALUES
66+
(1, 'CB-SNACK-VIP', 'Combo Snack VIP', 150000.00, 120000.00, 1);
67+
68+
INSERT INTO \`product_combo_items\` (\`id\`, \`combo_id\`, \`product_id\`, \`quantity\`, \`unit_price\`, \`total_price\`)
69+
VALUES
70+
(1, 1, 1, 2, 75000.00, 150000.00);
71+
72+
73+
-- 6. price_expiry_alert_logs
74+
TRUNCATE TABLE price_expiry_alert_logs;
75+
INSERT INTO \`price_expiry_alert_logs\` (\`id\`, \`alert_date\`, \`batch_id\`, \`recipient_email\`, \`sent_at\`)
76+
VALUES
77+
(1, '2026-03-28', 1, 'admin@smalltrend.me', '2026-03-28 10:15:00');
78+
79+
SET FOREIGN_KEY_CHECKS = 1;
80+
`;
81+
82+
fs.appendFileSync(fixFile, MOCK_DATA, 'utf8');
83+
console.log('Successfully injected explicit MOCK_DATA for skipped inventory tables!');

deploy/check_columns.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const fs = require('fs');
2+
const data = fs.readFileSync('backend/src/main/resources/data.sql', 'utf8');
3+
const tables = [
4+
'tickets', 'shift_handovers', 'shift_swap_requests', 'payroll_calculations',
5+
'disposal_vouchers', 'disposal_voucher_items', 'inventory_counts', 'inventory_count_items',
6+
'gift_redemption_history', 'loyalty_transactions', 'coupon_usage', 'audit_logs',
7+
'cash_transactions', 'sale_order_histories', 'purchase_order_items', 'purchase_orders',
8+
'sale_order_items', 'sale_orders', 'stock_movements', 'price_expiry_alert_logs',
9+
'loyalty_gifts', 'product_combos', 'product_combo_items', 'purchase_history',
10+
'salary_configs', 'attendance', 'reports'
11+
];
12+
13+
for (let table of tables) {
14+
const match = data.match(new RegExp(`INSERT INTO \\\`${table}\\\`([^\n]*)`));
15+
if (match) {
16+
console.log(`${table}: ${match[1].length > 10 ? match[1].substring(0, 100) : 'NO EXPLICIT COLUMNS'}`);
17+
} else {
18+
const match2 = data.match(new RegExp(`INSERT INTO ${table}([^\n]*)`));
19+
console.log(`${table}: ${match2 ? 'YES without backticks' : 'NOT FOUND'}`);
20+
}
21+
}

deploy/clean_localseed.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,62 @@ for (let line of lines) {
7676

7777
fs.writeFileSync(outFile, out.join('\n'), 'utf8');
7878
console.log(`Lọc & Xử lý xong! Đã xuất ra file ${outFile}`);
79+
let sql = '-- ==========================================================\n';
80+
sql += '-- DỮ LIỆU BÙ ĐẮP CHO CÁC BẢNG BỊ LỖI SCHEMA TRANSACTIONS\n';
81+
sql += '-- ==========================================================\n\n';
82+
sql += 'SET FOREIGN_KEY_CHECKS = 0;\n\n';
83+
84+
const addMock = (table, cols, values) => {
85+
sql += `TRUNCATE TABLE ${table};\n`;
86+
sql += `INSERT INTO \`${table}\` (${cols}) VALUES \n(${values});\n\n`;
87+
}
88+
89+
// 1. Sale Orders
90+
addMock('sale_orders',
91+
'`id`, `order_code`, `customer_id`, `cashier_id`, `cash_register_id`, `order_date`, `subtotal`, `tax_amount`, `discount_amount`, `total_amount`, `payment_method`, `status`, `notes`, `created_at`, `updated_at`',
92+
"1, 'ORD-202603-001', 1, 1, 1, '2026-03-28 10:00:00', 50000, 0, 0, 50000, 'CASH', 'COMPLETED', 'Đơn MOCK 1', '2026-03-28 10:00:00', '2026-03-28 10:00:00'");
93+
addMock('sale_order_items',
94+
'`id`, `sale_order_id`, `product_variant_id`, `product_name`, `sku`, `quantity`, `unit_price`, `line_discount_amount`, `line_tax_amount`, `line_total_amount`, `notes`',
95+
"1, 1, 1, 'Mock Product', 'SKU-001', 2, 25000, 0, 0, 50000, ''");
96+
97+
// 2. Purchase Orders
98+
addMock('purchase_orders',
99+
'`id`, `order_number`, `supplier_id`, `contract_id`, `created_by`, `location_id`, `order_date`, `expected_delivery_date`, `actual_delivery_date`, `status`, `subtotal`, `tax_amount`, `tax_percent`, `discount_amount`, `shipping_fee`, `paid_amount`, `total_amount`, `notes`, `rejection_reason`, `shortage_reason`, `shortage_submitted_at`, `manager_decision`, `manager_decision_note`, `manager_decided_at`, `created_at`, `updated_at`',
100+
"1, 'PO-202603-001', 1, null, 1, 1, '2026-03-28', '2026-03-29', '2026-03-29', 'COMPLETED', 100000, 0, 0, 0, 0, 100000, 100000, 'Mock', null, null, null, null, null, null, '2026-03-28 10:00:00', '2026-03-28 10:00:00'");
101+
addMock('purchase_order_items',
102+
'`id`, `purchase_order_id`, `variant_id`, `quantity`, `unit_cost`, `total_cost`, `received_quantity`, `notes`, `expiry_date`',
103+
"1, 1, 1, 10, 10000, 100000, 10, 'Mock', '2030-01-01'");
104+
105+
// 3. Inventory Counts
106+
addMock('inventory_counts',
107+
'`id`, `code`, `status`, `location_id`, `total_shortage_value`, `total_overage_value`, `total_difference_value`, `created_by`, `confirmed_by`, `created_at`, `confirmed_at`',
108+
"1, 'IC-202603-001', 'CONFIRMED', 1, 0, 0, 0, 1, 1, '2026-03-28 10:00:00', '2026-03-28 10:05:00'");
109+
addMock('inventory_count_items',
110+
'`id`, `inventory_count_id`, `batch_id`, `system_quantity`, `actual_quantity`, `difference_quantity`, `difference_value`, `reason`',
111+
"1, 1, 1, 10, 10, 0, 0, 'Match'");
112+
113+
// 4. Disposal Vouchers
114+
addMock('disposal_vouchers',
115+
'`id`, `code`, `location_id`, `status`, `reason_type`, `notes`, `total_items`, `total_quantity`, `total_value`, `created_by`, `created_at`, `confirmed_by`, `confirmed_at`, `rejection_reason`, `version`',
116+
"1, 'DV-202603-001', 1, 'CONFIRMED', 'DAMAGED', 'Mock Notes', 1, 5, 50000, 1, '2026-03-28 10:00:00', 1, '2026-03-28 10:05:00', null, 1");
117+
addMock('disposal_voucher_items',
118+
'`id`, `disposal_voucher_id`, `batch_id`, `product_id`, `batch_code`, `quantity`, `unit_cost`, `total_cost`, `expiry_date`',
119+
"1, 1, 1, 1, 'BATCH-001', 5, 10000, 50000, '2030-01-01'");
120+
121+
// 5. Product Combos
122+
addMock('product_combos',
123+
'`id`, `combo_code`, `combo_name`, `description`, `image_url`, `original_price`, `combo_price`, `saved_amount`, `discount_percent`, `valid_from`, `valid_to`, `is_active`, `max_quantity_per_order`, `total_sold`, `stock_limit`, `combo_type`, `is_featured`, `display_order`, `tags`, `status`, `created_by_id`, `updated_at`, `category_id`',
124+
"1, 'CB-SNACK-VIP', 'Combo Snack VIP', 'Mock', '', 150000, 120000, 30000, 20, '2026-01-01', '2026-12-31', 1, 5, 0, 0, 'VIP', 0, 1, 'New', 'ACTIVE', 1, '2026-03-28 10:00:00', 1");
125+
addMock('product_combo_items',
126+
'`id`, `combo_id`, `product_variant_id`, `min_quantity`, `max_quantity`, `is_optional`, `can_substitute`, `display_order`, `notes`',
127+
"1, 1, 1, 1, 1, 0, 0, 1, 'None'");
128+
129+
// 6. Price Expiry Alert Logs
130+
addMock('price_expiry_alert_logs',
131+
'`id`, `variant_price_id`, `alert_date`, `sent_at`',
132+
"1, 1, '2026-03-28', '2026-03-28 10:15:00'");
133+
134+
sql += 'SET FOREIGN_KEY_CHECKS = 1;\n';
135+
136+
fs.appendFileSync('deploy/fix_seed.sql', sql, 'utf8');
137+
console.log('Appended fully parsed Mock data to deploy/fix_seed.sql');

deploy/fix_seed.sql

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,3 +468,54 @@ WHERE id > 0
468468

469469
-- SYNCED FROM BACKUP: work_shift_assignments
470470

471+
-- ==========================================================
472+
-- DỮ LIỆU BÙ ĐẮP CHO CÁC BẢNG BỊ LỖI SCHEMA TRANSACTIONS
473+
-- ==========================================================
474+
475+
SET FOREIGN_KEY_CHECKS = 0;
476+
477+
TRUNCATE TABLE sale_orders;
478+
INSERT INTO `sale_orders` (`id`, `order_code`, `customer_id`, `cashier_id`, `cash_register_id`, `order_date`, `subtotal`, `tax_amount`, `discount_amount`, `total_amount`, `payment_method`, `status`, `notes`, `created_at`, `updated_at`) VALUES
479+
(1, 'ORD-202603-001', 1, 1, 1, '2026-03-28 10:00:00', 50000, 0, 0, 50000, 'CASH', 'COMPLETED', 'Đơn MOCK 1', '2026-03-28 10:00:00', '2026-03-28 10:00:00');
480+
481+
TRUNCATE TABLE sale_order_items;
482+
INSERT INTO `sale_order_items` (`id`, `sale_order_id`, `product_variant_id`, `product_name`, `sku`, `quantity`, `unit_price`, `line_discount_amount`, `line_tax_amount`, `line_total_amount`, `notes`) VALUES
483+
(1, 1, 1, 'Mock Product', 'SKU-001', 2, 25000, 0, 0, 50000, '');
484+
485+
TRUNCATE TABLE purchase_orders;
486+
INSERT INTO `purchase_orders` (`id`, `order_number`, `supplier_id`, `contract_id`, `created_by`, `location_id`, `order_date`, `expected_delivery_date`, `actual_delivery_date`, `status`, `subtotal`, `tax_amount`, `tax_percent`, `discount_amount`, `shipping_fee`, `paid_amount`, `total_amount`, `notes`, `rejection_reason`, `shortage_reason`, `shortage_submitted_at`, `manager_decision`, `manager_decision_note`, `manager_decided_at`, `created_at`, `updated_at`) VALUES
487+
(1, 'PO-202603-001', 1, null, 1, 1, '2026-03-28', '2026-03-29', '2026-03-29', 'COMPLETED', 100000, 0, 0, 0, 0, 100000, 100000, 'Mock', null, null, null, null, null, null, '2026-03-28 10:00:00', '2026-03-28 10:00:00');
488+
489+
TRUNCATE TABLE purchase_order_items;
490+
INSERT INTO `purchase_order_items` (`id`, `purchase_order_id`, `variant_id`, `quantity`, `unit_cost`, `total_cost`, `received_quantity`, `notes`, `expiry_date`) VALUES
491+
(1, 1, 1, 10, 10000, 100000, 10, 'Mock', '2030-01-01');
492+
493+
TRUNCATE TABLE inventory_counts;
494+
INSERT INTO `inventory_counts` (`id`, `code`, `status`, `location_id`, `total_shortage_value`, `total_overage_value`, `total_difference_value`, `created_by`, `confirmed_by`, `created_at`, `confirmed_at`) VALUES
495+
(1, 'IC-202603-001', 'CONFIRMED', 1, 0, 0, 0, 1, 1, '2026-03-28 10:00:00', '2026-03-28 10:05:00');
496+
497+
TRUNCATE TABLE inventory_count_items;
498+
INSERT INTO `inventory_count_items` (`id`, `inventory_count_id`, `batch_id`, `system_quantity`, `actual_quantity`, `difference_quantity`, `difference_value`, `reason`) VALUES
499+
(1, 1, 1, 10, 10, 0, 0, 'Match');
500+
501+
TRUNCATE TABLE disposal_vouchers;
502+
INSERT INTO `disposal_vouchers` (`id`, `code`, `location_id`, `status`, `reason_type`, `notes`, `total_items`, `total_quantity`, `total_value`, `created_by`, `created_at`, `confirmed_by`, `confirmed_at`, `rejection_reason`, `version`) VALUES
503+
(1, 'DV-202603-001', 1, 'CONFIRMED', 'DAMAGED', 'Mock Notes', 1, 5, 50000, 1, '2026-03-28 10:00:00', 1, '2026-03-28 10:05:00', null, 1);
504+
505+
TRUNCATE TABLE disposal_voucher_items;
506+
INSERT INTO `disposal_voucher_items` (`id`, `disposal_voucher_id`, `batch_id`, `product_id`, `batch_code`, `quantity`, `unit_cost`, `total_cost`, `expiry_date`) VALUES
507+
(1, 1, 1, 1, 'BATCH-001', 5, 10000, 50000, '2030-01-01');
508+
509+
TRUNCATE TABLE product_combos;
510+
INSERT INTO `product_combos` (`id`, `combo_code`, `combo_name`, `description`, `image_url`, `original_price`, `combo_price`, `saved_amount`, `discount_percent`, `valid_from`, `valid_to`, `is_active`, `max_quantity_per_order`, `total_sold`, `stock_limit`, `combo_type`, `is_featured`, `display_order`, `tags`, `status`, `created_by_id`, `updated_at`, `category_id`) VALUES
511+
(1, 'CB-SNACK-VIP', 'Combo Snack VIP', 'Mock', '', 150000, 120000, 30000, 20, '2026-01-01', '2026-12-31', 1, 5, 0, 0, 'VIP', 0, 1, 'New', 'ACTIVE', 1, '2026-03-28 10:00:00', 1);
512+
513+
TRUNCATE TABLE product_combo_items;
514+
INSERT INTO `product_combo_items` (`id`, `combo_id`, `product_variant_id`, `min_quantity`, `max_quantity`, `is_optional`, `can_substitute`, `display_order`, `notes`) VALUES
515+
(1, 1, 1, 1, 1, 0, 0, 1, 'None');
516+
517+
TRUNCATE TABLE price_expiry_alert_logs;
518+
INSERT INTO `price_expiry_alert_logs` (`id`, `variant_price_id`, `alert_date`, `sent_at`) VALUES
519+
(1, 1, '2026-03-28', '2026-03-28 10:15:00');
520+
521+
SET FOREIGN_KEY_CHECKS = 1;

deploy/gen_final_mock.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
const fs = require('fs');
2+
3+
let sql = '-- ==========================================================\n';
4+
sql += '-- DỮ LIỆU BÙ ĐẮP CHO CÁC BẢNG BỊ LỖI SCHEMA TRANSACTIONS\n';
5+
sql += '-- ==========================================================\n\n';
6+
sql += 'SET FOREIGN_KEY_CHECKS = 0;\n\n';
7+
8+
const addMock = (table, cols, values) => {
9+
sql += `TRUNCATE TABLE ${table};\n`;
10+
sql += `INSERT INTO \`${table}\` (${cols}) VALUES \n(${values});\n\n`;
11+
}
12+
13+
// 1. Sale Orders
14+
addMock('sale_orders',
15+
'`id`, `order_code`, `customer_id`, `cashier_id`, `cash_register_id`, `order_date`, `subtotal`, `tax_amount`, `discount_amount`, `total_amount`, `payment_method`, `status`, `notes`, `created_at`, `updated_at`',
16+
"1, 'ORD-202603-001', 1, 1, 1, '2026-03-28 10:00:00', 50000, 0, 0, 50000, 'CASH', 'COMPLETED', 'Đơn MOCK 1', '2026-03-28 10:00:00', '2026-03-28 10:00:00'");
17+
addMock('sale_order_items',
18+
'`id`, `sale_order_id`, `product_variant_id`, `product_name`, `sku`, `quantity`, `unit_price`, `line_discount_amount`, `line_tax_amount`, `line_total_amount`, `notes`',
19+
"1, 1, 1, 'Mock Product', 'SKU-001', 2, 25000, 0, 0, 50000, ''");
20+
21+
// 2. Purchase Orders
22+
addMock('purchase_orders',
23+
'`id`, `order_number`, `supplier_id`, `contract_id`, `created_by`, `location_id`, `order_date`, `expected_delivery_date`, `actual_delivery_date`, `status`, `subtotal`, `tax_amount`, `tax_percent`, `discount_amount`, `shipping_fee`, `paid_amount`, `total_amount`, `notes`, `rejection_reason`, `shortage_reason`, `shortage_submitted_at`, `manager_decision`, `manager_decision_note`, `manager_decided_at`, `created_at`, `updated_at`',
24+
"1, 'PO-202603-001', 1, null, 1, 1, '2026-03-28', '2026-03-29', '2026-03-29', 'COMPLETED', 100000, 0, 0, 0, 0, 100000, 100000, 'Mock', null, null, null, null, null, null, '2026-03-28 10:00:00', '2026-03-28 10:00:00'");
25+
addMock('purchase_order_items',
26+
'`id`, `purchase_order_id`, `variant_id`, `quantity`, `unit_cost`, `total_cost`, `received_quantity`, `notes`, `expiry_date`',
27+
"1, 1, 1, 10, 10000, 100000, 10, 'Mock', '2030-01-01'");
28+
29+
// 3. Inventory Counts
30+
addMock('inventory_counts',
31+
'`id`, `code`, `status`, `location_id`, `total_shortage_value`, `total_overage_value`, `total_difference_value`, `created_by`, `confirmed_by`, `created_at`, `confirmed_at`',
32+
"1, 'IC-202603-001', 'CONFIRMED', 1, 0, 0, 0, 1, 1, '2026-03-28 10:00:00', '2026-03-28 10:05:00'");
33+
addMock('inventory_count_items',
34+
'`id`, `inventory_count_id`, `batch_id`, `system_quantity`, `actual_quantity`, `difference_quantity`, `difference_value`, `reason`',
35+
"1, 1, 1, 10, 10, 0, 0, 'Match'");
36+
37+
// 4. Disposal Vouchers
38+
addMock('disposal_vouchers',
39+
'`id`, `code`, `location_id`, `status`, `reason_type`, `notes`, `total_items`, `total_quantity`, `total_value`, `created_by`, `created_at`, `confirmed_by`, `confirmed_at`, `rejection_reason`, `version`',
40+
"1, 'DV-202603-001', 1, 'CONFIRMED', 'DAMAGED', 'Mock Notes', 1, 5, 50000, 1, '2026-03-28 10:00:00', 1, '2026-03-28 10:05:00', null, 1");
41+
addMock('disposal_voucher_items',
42+
'`id`, `disposal_voucher_id`, `batch_id`, `product_id`, `batch_code`, `quantity`, `unit_cost`, `total_cost`, `expiry_date`',
43+
"1, 1, 1, 1, 'BATCH-001', 5, 10000, 50000, '2030-01-01'");
44+
45+
// 5. Product Combos
46+
addMock('product_combos',
47+
'`id`, `combo_code`, `combo_name`, `description`, `image_url`, `original_price`, `combo_price`, `saved_amount`, `discount_percent`, `valid_from`, `valid_to`, `is_active`, `max_quantity_per_order`, `total_sold`, `stock_limit`, `combo_type`, `is_featured`, `display_order`, `tags`, `status`, `created_by_id`, `updated_at`, `category_id`',
48+
"1, 'CB-SNACK-VIP', 'Combo Snack VIP', 'Mock', '', 150000, 120000, 30000, 20, '2026-01-01', '2026-12-31', 1, 5, 0, 0, 'VIP', 0, 1, 'New', 'ACTIVE', 1, '2026-03-28 10:00:00', 1");
49+
addMock('product_combo_items',
50+
'`id`, `combo_id`, `product_variant_id`, `min_quantity`, `max_quantity`, `is_optional`, `can_substitute`, `display_order`, `notes`',
51+
"1, 1, 1, 1, 1, 0, 0, 1, 'None'");
52+
53+
// 6. Price Expiry Alert Logs
54+
addMock('price_expiry_alert_logs',
55+
'`id`, `variant_price_id`, `alert_date`, `sent_at`',
56+
"1, 1, '2026-03-28', '2026-03-28 10:15:00'");
57+
58+
sql += 'SET FOREIGN_KEY_CHECKS = 1;\n';
59+
60+
fs.appendFileSync('deploy/fix_seed.sql', sql, 'utf8');
61+
console.log('Appended fully parsed Mock data to deploy/fix_seed.sql');

0 commit comments

Comments
 (0)