CREATE TABLE IF NOT EXISTS `master_incoterms` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned NOT NULL DEFAULT 1,
  `incoterm_code` varchar(10) NOT NULL,
  `incoterm_name` varchar(255) NOT NULL,
  `description` text,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `company_id` (`company_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

INSERT INTO `master_incoterms` (`company_id`, `incoterm_code`, `incoterm_name`, `description`, `status`) VALUES
(1, 'EXW', 'Ex Works', 'Seller makes goods available at their premises. Buyer bears all costs and risks from that point.', 'active'),
(1, 'FCA', 'Free Carrier', 'Seller delivers goods to the carrier nominated by the buyer at the named place.', 'active'),
(1, 'FAS', 'Free Alongside Ship', 'Seller delivers goods alongside the vessel at the named port of shipment.', 'active'),
(1, 'FOB', 'Free On Board', 'Seller delivers goods on board the vessel at the named port of shipment. Risk transfers when goods are on board.', 'active'),
(1, 'CFR', 'Cost and Freight', 'Seller delivers goods on board the vessel and pays freight to the named port of destination. Risk transfers on board.', 'active'),
(1, 'CIF', 'Cost, Insurance & Freight', 'Seller delivers goods on board the vessel, pays freight and procures marine insurance to the named port of destination.', 'active'),
(1, 'CPT', 'Carriage Paid To', 'Seller pays freight to the named destination. Risk transfers when goods are delivered to the carrier.', 'active'),
(1, 'CIP', 'Carriage & Insurance Paid To', 'Seller pays freight and insurance to the named destination. Risk transfers when goods are delivered to the carrier.', 'active'),
(1, 'DAP', 'Delivered at Place', 'Seller delivers goods ready for unloading at the named destination. Seller bears all risks.', 'active'),
(1, 'DPU', 'Delivered at Place Unloaded', 'Seller delivers goods unloaded at the named destination. Seller bears all risks and unloading costs.', 'active'),
(1, 'DDP', 'Delivered Duty Paid', 'Seller delivers goods cleared for import at the named destination. Seller bears all risks and costs including duties and taxes.', 'active');
