INSERT INTO users (name, email, password_hash) VALUES
('Administrator', 'admin@realfinance.local', '$2y$12$EV2C8H.jlojU7do/j4hI0OvhNGKgBqDNEiEl5vrs1GrXTaEcFMRjG');

INSERT INTO categories (name, category_type) VALUES
('Sales / Income', 'income'),
('Owner Drawings', 'expense'),
('Loan Repayments', 'expense'),
('Bank Charges', 'expense'),
('Fuel & Travel', 'expense'),
('Internet & Telecoms', 'expense'),
('Software & Subscriptions', 'expense'),
('Salaries / Contractors', 'expense'),
('Equipment / Purchases', 'expense'),
('Utilities', 'expense'),
('Insurance', 'expense'),
('Miscellaneous', 'expense');

INSERT INTO settings (setting_key, setting_value) VALUES
('company_name', 'ITUZATECH (PTY) LTD'),
('currency_symbol', 'R');

INSERT INTO allocation_rules (match_type, match_value, category_id, transaction_type, priority)
SELECT 'contains', 'ITU CAPITEC', id, 'expense', 10 FROM categories WHERE name='Owner Drawings';
INSERT INTO allocation_rules (match_type, match_value, category_id, transaction_type, priority)
SELECT 'contains', 'BIZFLEX LOAN', id, 'expense', 10 FROM categories WHERE name='Loan Repayments';
INSERT INTO allocation_rules (match_type, match_value, category_id, transaction_type, priority)
SELECT 'contains', 'HONOURING FEE', id, 'expense', 10 FROM categories WHERE name='Bank Charges';
INSERT INTO allocation_rules (match_type, match_value, category_id, transaction_type, priority)
SELECT 'contains', 'OVERDRAFT', id, 'expense', 10 FROM categories WHERE name='Bank Charges';
INSERT INTO allocation_rules (match_type, match_value, category_id, transaction_type, priority)
SELECT 'contains', 'SERVICE FEE', id, 'expense', 20 FROM categories WHERE name='Bank Charges';
INSERT INTO allocation_rules (match_type, match_value, category_id, transaction_type, priority)
SELECT 'contains', 'ENGEN', id, 'expense', 20 FROM categories WHERE name='Fuel & Travel';
INSERT INTO allocation_rules (match_type, match_value, category_id, transaction_type, priority)
SELECT 'contains', 'SHELL', id, 'expense', 20 FROM categories WHERE name='Fuel & Travel';
INSERT INTO allocation_rules (match_type, match_value, category_id, transaction_type, priority)
SELECT 'contains', 'TOTAL', id, 'expense', 20 FROM categories WHERE name='Fuel & Travel';
INSERT INTO allocation_rules (match_type, match_value, category_id, transaction_type, priority)
SELECT 'contains', 'MWEB', id, 'expense', 20 FROM categories WHERE name='Internet & Telecoms';
INSERT INTO allocation_rules (match_type, match_value, category_id, transaction_type, priority)
SELECT 'contains', 'TELKOM', id, 'expense', 20 FROM categories WHERE name='Internet & Telecoms';
INSERT INTO allocation_rules (match_type, match_value, category_id, transaction_type, priority)
SELECT 'contains', 'OPENAI', id, 'expense', 20 FROM categories WHERE name='Software & Subscriptions';
INSERT INTO allocation_rules (match_type, match_value, category_id, transaction_type, priority)
SELECT 'contains', 'TRACKER', id, 'expense', 20 FROM categories WHERE name='Insurance';
INSERT INTO allocation_rules (match_type, match_value, category_id, transaction_type, priority)
SELECT 'contains', 'INSURANCE', id, 'expense', 20 FROM categories WHERE name='Insurance';
