Commit 12230ae0 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix migration: add effective_from to business_rules INSERTs

Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 6cb14f82
......@@ -6,10 +6,10 @@ return [
UPDATE business_rules SET current_value_json = '{\"percentage_of_subscription\":\"10.00\"}', name_ar = 'غرامة تأخير — بعد فترة السماح (أكتوبر)', name_en = 'Late Fine — After Grace (Oct)' WHERE rule_code = 'LATE_SUB_FINE_YEAR_1';
UPDATE business_rules SET current_value_json = '{\"percentage_of_subscription\":\"50.00\"}', name_ar = 'غرامة تأخير — سنة واحدة متأخرة', name_en = 'Late Fine — 1 Year Overdue (50%)' WHERE rule_code = 'LATE_SUB_FINE_YEAR_2';
UPDATE business_rules SET current_value_json = '{\"percentage_of_subscription\":\"100.00\"}', name_ar = 'غرامة تأخير — سنتان متأخرة', name_en = 'Late Fine — 2 Years Overdue (100%)' WHERE rule_code = 'LATE_SUB_FINE_YEAR_3';
INSERT INTO business_rules (rule_code, category, name_ar, name_en, data_type, current_value_json, parameters_json, is_active, created_at, updated_at) VALUES ('LATE_SUB_FINE_YEAR_4', 'penalty', 'غرامة تأخير — 3 سنوات متأخرة', 'Late Fine — 3 Years Overdue (200%)', 'percentage', '{\"percentage_of_subscription\":\"200.00\"}', '{\"percentage_of_subscription\":\"decimal\"}', 1, NOW(), NOW()) ON DUPLICATE KEY UPDATE current_value_json = '{\"percentage_of_subscription\":\"200.00\"}', name_ar = 'غرامة تأخير — 3 سنوات متأخرة';
INSERT INTO business_rules (rule_code, category, name_ar, name_en, data_type, current_value_json, parameters_json, is_active, created_at, updated_at) VALUES ('LATE_SUB_FINE_YEAR_5', 'penalty', 'غرامة تأخير — 4 سنوات متأخرة', 'Late Fine — 4 Years Overdue (300%)', 'percentage', '{\"percentage_of_subscription\":\"300.00\"}', '{\"percentage_of_subscription\":\"decimal\"}', 1, NOW(), NOW()) ON DUPLICATE KEY UPDATE current_value_json = '{\"percentage_of_subscription\":\"300.00\"}', name_ar = 'غرامة تأخير — 4 سنوات متأخرة';
INSERT INTO business_rules (rule_code, category, name_ar, name_en, data_type, current_value_json, parameters_json, is_active, created_at, updated_at) VALUES ('SUB_GRACE_MONTHS', 'penalty', 'فترة السماح للاشتراك السنوي', 'Subscription Grace Period (months)', 'integer', '{\"months\":3}', '{\"months\":\"integer\"}', 1, NOW(), NOW()) ON DUPLICATE KEY UPDATE current_value_json = '{\"months\":3}', name_ar = 'فترة السماح للاشتراك السنوي';
INSERT INTO business_rules (rule_code, category, name_ar, name_en, data_type, current_value_json, parameters_json, is_active, created_at, updated_at) VALUES ('SUB_EXTENDED_GRACE_MONTHS', 'penalty', 'فترة السماح الممتدة (بقرار مجلس الأمناء)', 'Extended Grace Period (Trustees)', 'integer', '{\"months\":4}', '{\"months\":\"integer\"}', 1, NOW(), NOW()) ON DUPLICATE KEY UPDATE current_value_json = '{\"months\":4}', name_ar = 'فترة السماح الممتدة (بقرار مجلس الأمناء)'
INSERT INTO business_rules (rule_code, category, name_ar, name_en, data_type, current_value_json, parameters_json, is_active, effective_from, created_at, updated_at) VALUES ('LATE_SUB_FINE_YEAR_4', 'penalty', 'غرامة تأخير — 3 سنوات متأخرة', 'Late Fine — 3 Years Overdue (200%)', 'percentage', '{\"percentage_of_subscription\":\"200.00\"}', '{\"percentage_of_subscription\":\"decimal\"}', 1, '2020-01-01', NOW(), NOW()) ON DUPLICATE KEY UPDATE current_value_json = '{\"percentage_of_subscription\":\"200.00\"}', name_ar = 'غرامة تأخير — 3 سنوات متأخرة';
INSERT INTO business_rules (rule_code, category, name_ar, name_en, data_type, current_value_json, parameters_json, is_active, effective_from, created_at, updated_at) VALUES ('LATE_SUB_FINE_YEAR_5', 'penalty', 'غرامة تأخير — 4 سنوات متأخرة', 'Late Fine — 4 Years Overdue (300%)', 'percentage', '{\"percentage_of_subscription\":\"300.00\"}', '{\"percentage_of_subscription\":\"decimal\"}', 1, '2020-01-01', NOW(), NOW()) ON DUPLICATE KEY UPDATE current_value_json = '{\"percentage_of_subscription\":\"300.00\"}', name_ar = 'غرامة تأخير — 4 سنوات متأخرة';
INSERT INTO business_rules (rule_code, category, name_ar, name_en, data_type, current_value_json, parameters_json, is_active, effective_from, created_at, updated_at) VALUES ('SUB_GRACE_MONTHS', 'penalty', 'فترة السماح للاشتراك السنوي', 'Subscription Grace Period (months)', 'integer', '{\"months\":3}', '{\"months\":\"integer\"}', 1, '2020-01-01', NOW(), NOW()) ON DUPLICATE KEY UPDATE current_value_json = '{\"months\":3}', name_ar = 'فترة السماح للاشتراك السنوي';
INSERT INTO business_rules (rule_code, category, name_ar, name_en, data_type, current_value_json, parameters_json, is_active, effective_from, created_at, updated_at) VALUES ('SUB_EXTENDED_GRACE_MONTHS', 'penalty', 'فترة السماح الممتدة (بقرار مجلس الأمناء)', 'Extended Grace Period (Trustees)', 'integer', '{\"months\":4}', '{\"months\":\"integer\"}', 1, '2020-01-01', NOW(), NOW()) ON DUPLICATE KEY UPDATE current_value_json = '{\"months\":4}', name_ar = 'فترة السماح الممتدة (بقرار مجلس الأمناء)'
",
'down' => "
UPDATE business_rules SET current_value_json = '{\"percentage_of_subscription\":\"100.00\"}', name_ar = 'غرامة تأخير سنة أولى' WHERE rule_code = 'LATE_SUB_FINE_YEAR_1';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment