-- Seed data for AvtoAmbor. Prices are in dirams (1 TJS = 100 dirams).
-- Names are biased toward Lada / Daewoo Nexia / Opel / Toyota, which are
-- common in Tajikistan.

INSERT INTO categories (id, name_en, name_tg, sort_order) VALUES
  (1, 'Filters',        'Филтрҳо',          10),
  (2, 'Brakes',         'Тормоз',           20),
  (3, 'Engine',         'Муҳаррик',         30),
  (4, 'Electrical',     'Барқӣ',            40),
  (5, 'Fluids',         'Моеъҳо',           50),
  (6, 'Belts & Hoses',  'Тасма ва шланг',   60);

INSERT INTO suppliers (name, phone, address, notes) VALUES
  ('Avtomir Dushanbe',     '+992 37 221 33 44', 'Dushanbe, Rudaki ave. 112',     'General auto parts wholesale.'),
  ('Nexia Parts TJ',       '+992 92 700 12 34', 'Dushanbe, Korvon market row 8', 'Daewoo / Chevrolet specialist.'),
  ('Vostok Auto',          '+992 93 555 77 11', 'Khujand, Lenin st. 45',         'VAZ / Lada / Niva parts.'),
  ('Korea Motors TJ',      '+992 90 411 22 33', 'Dushanbe, Sino district',       'Korean and Japanese imports.');

-- Parts ---------------------------------------------------------------------

INSERT INTO parts
  (sku, name_en, name_tg, description_en, description_tg,
   category_id, unit, cost_price, sale_price,
   quantity_on_hand, reorder_level, location, barcode)
VALUES
  -- Filters
  ('FLT-LDA-OIL-01', 'Oil filter Lada 2107',           'Филтри равған Lada 2107',
   'Standard oil filter for VAZ 2101–2107 engines.',
   'Филтри равғани муқаррарӣ барои ВАЗ 2101–2107.',
   1, 'pcs',  2500,  4000, 24, 6, 'A1-01', '4607000000017'),

  ('FLT-DWO-OIL-01', 'Oil filter Daewoo Nexia',        'Филтри равған Daewoo Nexia',
   'Oil filter for Daewoo Nexia 1.5 SOHC/DOHC.',
   'Филтри равған барои Daewoo Nexia 1.5 SOHC/DOHC.',
   1, 'pcs',  2800,  4500, 18, 6, 'A1-02', '4607000000024'),

  ('FLT-LDA-AIR-01', 'Air filter Lada Niva',           'Филтри ҳаво Lada Niva',
   'Round-style air filter for Lada Niva 1.7i.',
   'Филтри ҳавои гирд барои Lada Niva 1.7i.',
   1, 'pcs',  3200,  5000, 12, 4, 'A1-03', '4607000000031'),

  ('FLT-OPL-AIR-01', 'Air filter Opel Astra H',        'Филтри ҳаво Opel Astra H',
   'Panel air filter for Opel Astra H 1.6 / 1.8.',
   'Филтри ҳавои панелӣ барои Opel Astra H 1.6 / 1.8.',
   1, 'pcs',  4500,  7000,  9, 3, 'A1-04', '4607000000048'),

  ('FLT-TYT-FUL-01', 'Fuel filter Toyota Camry',       'Филтри сӯзишворӣ Toyota Camry',
   'In-line fuel filter for Toyota Camry V30/V40.',
   'Филтри сӯзишвории трубачагӣ барои Toyota Camry V30/V40.',
   1, 'pcs',  6000,  9500,  7, 3, 'A1-05', '4607000000055'),

  ('FLT-DWO-CAB-01', 'Cabin filter Daewoo Nexia',      'Филтри салон Daewoo Nexia',
   'Cabin / pollen filter for Daewoo Nexia.',
   'Филтри салон / гардолуд барои Daewoo Nexia.',
   1, 'pcs',  3500,  5500, 14, 4, 'A1-06', '4607000000062'),

  -- Brakes
  ('BRK-LDA-PAD-F',  'Front brake pads Lada 2110',     'Колодкаҳои пеши тормоз Lada 2110',
   'Front brake pad set for Lada 2110/2111/2112.',
   'Маҷмӯи колодкаҳои пеши тормоз барои Lada 2110/2111/2112.',
   2, 'set', 11000, 17000, 10, 3, 'B2-01', '4607000000079'),

  ('BRK-LDA-SHO-R',  'Rear brake shoes Lada Niva',     'Колодкаҳои қафои тормоз Lada Niva',
   'Rear drum brake shoe set for Lada Niva.',
   'Маҷмӯи колодкаҳои қафои барабаниро Lada Niva.',
   2, 'set',  9500, 15000,  8, 3, 'B2-02', '4607000000086'),

  ('BRK-DWO-DSC-F',  'Front brake disc Daewoo Nexia',  'Диски тормози пеш Daewoo Nexia',
   'Ventilated front brake disc, Daewoo Nexia.',
   'Диски тормози пеши вентилятсияшаванда, Daewoo Nexia.',
   2, 'pcs', 18000, 28000,  6, 2, 'B2-03', '4607000000093'),

  ('BRK-OPL-PAD-F',  'Front brake pads Opel Vectra B', 'Колодкаҳои пеши тормоз Opel Vectra B',
   'Front brake pad set, Opel Vectra B 1.6 / 1.8.',
   'Маҷмӯи колодкаҳои пеши тормоз, Opel Vectra B 1.6 / 1.8.',
   2, 'set', 16000, 24000,  5, 2, 'B2-04', '4607000000109'),

  ('BRK-TYT-PAD-F',  'Front brake pads Toyota Corolla','Колодкаҳои пеши тормоз Toyota Corolla',
   'Front brake pad set, Toyota Corolla E120/E150.',
   'Маҷмӯи колодкаҳои пеши тормоз, Toyota Corolla E120/E150.',
   2, 'set', 19000, 29500,  4, 2, 'B2-05', '4607000000116'),

  -- Engine
  ('ENG-SPK-NGK-01', 'Spark plug NGK BPR6E',           'Шамъи оташфурӯзӣ NGK BPR6E',
   'NGK BPR6E spark plug — common for VAZ.',
   'Шамъи оташфурӯзии NGK BPR6E — барои ВАЗ.',
   3, 'pcs',  1800,  3000, 60, 12, 'C3-01', '4607000000123'),

  ('ENG-SPK-DEN-01', 'Spark plug Denso K20TT',         'Шамъи оташфурӯзӣ Denso K20TT',
   'Denso K20TT twin-tip plug, Toyota / Daewoo.',
   'Шамъи Denso K20TT, Toyota / Daewoo.',
   3, 'pcs',  3200,  5000, 36,  8, 'C3-02', '4607000000130'),

  ('ENG-LDA-PR-01',  'Piston ring set Lada 2106 STD',  'Маҷмӯи ҳалқаҳои поршен Lada 2106 STD',
   'Standard-bore piston ring set for VAZ 2106.',
   'Маҷмӯи ҳалқаҳои поршени андозаи стандартӣ барои ВАЗ 2106.',
   3, 'set', 22000, 33000,  3, 1, 'C3-03', '4607000000147'),

  ('ENG-LDA-VCG-01', 'Valve cover gasket Lada 2110',   'Прокладкаи сарпӯши клапанҳо Lada 2110',
   'Valve cover gasket for Lada 2110 16V.',
   'Прокладкаи сарпӯши клапанҳо барои Lada 2110 16V.',
   3, 'pcs',  3000,  4800, 11, 3, 'C3-04', '4607000000154'),

  ('ENG-DWO-MNT-01', 'Engine mount Daewoo Nexia',      'Подушкаи муҳаррик Daewoo Nexia',
   'Right-side engine mount for Daewoo Nexia.',
   'Подушкаи рости муҳаррик барои Daewoo Nexia.',
   3, 'pcs', 14000, 22000,  4, 2, 'C3-05', '4607000000161'),

  ('ENG-OPL-THM-01', 'Thermostat Opel Astra H',        'Термостат Opel Astra H',
   'Thermostat with housing, Opel Astra H 1.6.',
   'Термостат бо корпус, Opel Astra H 1.6.',
   3, 'pcs', 17000, 26000,  3, 1, 'C3-06', '4607000000178'),

  ('ENG-DWO-WPM-01', 'Water pump Daewoo Nexia',        'Насоси об Daewoo Nexia',
   'Coolant water pump, Daewoo Nexia 1.5.',
   'Насоси хунуккунӣ, Daewoo Nexia 1.5.',
   3, 'pcs', 25000, 38000,  3, 1, 'C3-07', '4607000000185'),

  -- Electrical
  ('ELC-LDA-STR-01', 'Starter motor Lada 2107',        'Стартери Lada 2107',
   'Reduction-gear starter for Lada 2107 carb / inj.',
   'Стартери редукторӣ барои Lada 2107.',
   4, 'pcs', 65000, 95000,  2, 1, 'D4-01', '4607000000192'),

  ('ELC-DWO-ALT-01', 'Alternator 14V 80A Daewoo Nexia','Генератори 14V 80A Daewoo Nexia',
   '14V 80A alternator, Daewoo Nexia 1.5.',
   'Генератори 14V 80A, Daewoo Nexia 1.5.',
   4, 'pcs', 95000,140000,  2, 1, 'D4-02', '4607000000208'),

  ('ELC-BAT-60AH-01','Car battery 60Ah 12V',           'Батареяи мошин 60Ач 12В',
   'Maintenance-free 60Ah 12V battery, 500A CCA.',
   'Батареяи бе нигоҳдории 60Ач 12В, 500А CCA.',
   4, 'pcs', 55000, 78000,  6, 2, 'D4-03', '4607000000215'),

  ('ELC-H4-12V-01',  'Headlamp bulb H4 12V 60/55W',    'Лампаи фара H4 12V 60/55Вт',
   'Halogen H4 headlamp bulb 12V 60/55W.',
   'Лампаи галогении H4 барои фара 12V 60/55Вт.',
   4, 'pcs',  1200,  2200, 40, 10, 'D4-04', '4607000000222'),

  ('ELC-TYT-COL-01', 'Ignition coil Toyota Corolla',   'Ғалтаки оташфурӯзӣ Toyota Corolla',
   'Pencil-type ignition coil, Toyota Corolla 1.6 VVT-i.',
   'Ғалтаки оташфурӯзии қаламшакл, Toyota Corolla 1.6 VVT-i.',
   4, 'pcs', 28000, 42000,  4, 2, 'D4-05', '4607000000239'),

  -- Fluids
  ('FLD-OIL-5W40-4L','Engine oil 5W-40 synthetic 4L',  'Равғани муҳаррик 5W-40 синтетикӣ 4Л',
   'Fully synthetic 5W-40 motor oil, 4L jug.',
   'Равғани муҳаррики пурра синтетикии 5W-40, 4 литр.',
   5, 'btl', 14000, 21000, 15, 4, 'E5-01', '4607000000246'),

  ('FLD-OIL-10W40-4L','Engine oil 10W-40 semi-syn 4L', 'Равғани муҳаррик 10W-40 нимсинтетикӣ 4Л',
   'Semi-synthetic 10W-40 motor oil, 4L jug.',
   'Равғани муҳаррики нимсинтетикии 10W-40, 4 литр.',
   5, 'btl',  9500, 15000, 22, 6, 'E5-02', '4607000000253'),

  ('FLD-BRK-DOT4-1L','Brake fluid DOT-4 1L',           'Моеъи тормоз DOT-4 1Л',
   'DOT-4 brake fluid, 1L bottle.',
   'Моеъи тормози DOT-4, шишаи 1 литр.',
   5, 'btl',  2200,  3800, 20, 6, 'E5-03', '4607000000260'),

  ('FLD-AFR-G11-5L', 'Antifreeze G11 green 5L',        'Антифриз G11 сабз 5Л',
   'G11 (green) antifreeze concentrate, 5L.',
   'Антифризи G11 (сабз), консентрат, 5 литр.',
   5, 'btl',  6800, 10500, 10, 3, 'E5-04', '4607000000277'),

  -- Belts & Hoses
  ('BLT-DWO-TIM-01', 'Timing belt Daewoo Nexia 8V',    'Тасмаи газораспределение Daewoo Nexia 8V',
   'Timing belt for Daewoo Nexia 1.5 SOHC (8V).',
   'Тасмаи газораспределение барои Daewoo Nexia 1.5 SOHC (8V).',
   6, 'pcs',  5500,  9000,  8, 3, 'F6-01', '4607000000284'),

  ('BLT-LDA-VBL-01', 'V-belt Lada 2107 alternator',    'Тасмаи V Lada 2107 (генератор)',
   'V-belt for alternator, Lada 2107 carb engine.',
   'Тасмаи V барои генератор, муҳаррики карбюратории Lada 2107.',
   6, 'pcs',  1800,  3000, 20, 5, 'F6-02', '4607000000291'),

  ('HOS-LDA-RUP-01', 'Radiator upper hose Lada 2107',  'Шланги болоии радиатор Lada 2107',
   'Upper radiator hose, Lada 2107.',
   'Шланги болоии радиатор, Lada 2107.',
   6, 'pcs',  2400,  3900, 12, 4, 'F6-03', '4607000000307'),

  ('HOS-DWO-RLW-01', 'Radiator lower hose Daewoo Nexia','Шланги поёнии радиатор Daewoo Nexia',
   'Lower radiator hose, Daewoo Nexia.',
   'Шланги поёнии радиатор, Daewoo Nexia.',
   6, 'pcs',  3000,  4800,  9, 3, 'F6-04', '4607000000314');

-- A couple of opening "in" stock movements so the dashboard isn't empty.
INSERT INTO stock_movements (part_id, movement_type, quantity, unit_price, supplier_id, reference, notes)
SELECT id, 'in', quantity_on_hand, cost_price, 1, 'OPENING', 'Initial seeded stock'
FROM parts WHERE quantity_on_hand > 0;
