-- ERP test data (schema-compatible)
-- Date: 2026-02-27

USE HRapp;

START TRANSACTION;

INSERT INTO fiscal_profile (
    code,
    company_name,
    address,
    city,
    state_province,
    postal_code,
    country_code,
    tax_id_label,
    tax_id_value,
    secondary_tax_id_label,
    secondary_tax_id_value,
    default_currency,
    fiscal_year_start,
    phone,
    email,
    website,
    logo_path,
    is_active,
    is_default,
    metadata,
    created_at,
    updated_at
) VALUES (
    'TN',
    'Starz Electronics Tunisia',
    'Rue de l''Industrie, Zone A',
    'Tunis',
    'Tunis',
    '1000',
    'TN',
    'Matricule Fiscal',
    'TN1234567',
    'CNSS',
    'CNSS-998877',
    'TND',
    '01-01',
    '+216-71-000000',
    'finance.tn@starzelectronics.com',
    'https://starzelectronics.com',
    NULL,
    1,
    0,
    JSON_OBJECT('vat_rate', 19, 'timezone', 'Africa/Tunis'),
    NOW(),
    NOW()
)
ON DUPLICATE KEY UPDATE
    company_name = VALUES(company_name),
    address = VALUES(address),
    city = VALUES(city),
    state_province = VALUES(state_province),
    postal_code = VALUES(postal_code),
    country_code = VALUES(country_code),
    tax_id_label = VALUES(tax_id_label),
    tax_id_value = VALUES(tax_id_value),
    secondary_tax_id_label = VALUES(secondary_tax_id_label),
    secondary_tax_id_value = VALUES(secondary_tax_id_value),
    default_currency = VALUES(default_currency),
    fiscal_year_start = VALUES(fiscal_year_start),
    phone = VALUES(phone),
    email = VALUES(email),
    website = VALUES(website),
    is_active = VALUES(is_active),
    is_default = VALUES(is_default),
    metadata = VALUES(metadata),
    updated_at = NOW();

INSERT INTO quotation_customer (
    name,
    address,
    contact_name,
    email,
    phone
) VALUES
('ABC Corporation', '500 Business Plaza, Los Angeles, CA 90001', 'Olivia Parker', 'purchasing@abccorp.com', '+1-555-3001'),
('XYZ Industries', '600 Industrial Park, Houston, TX 77001', 'Liam Scott', 'orders@xyzind.com', '+1-555-3002'),
('Tech Solutions Inc', '700 Tech Center, Seattle, WA 98101', 'Emma Turner', 'procurement@techsol.com', '+1-555-3003');

COMMIT;
