-- Modify default country as Indonesia in Office
ALTER TABLE Office MODIFY COLUMN country VARCHAR(100) NOT NULL DEFAULT 'Indonesia';

-- Modify default country as Indonesia in Employee
ALTER TABLE Employee MODIFY COLUMN country VARCHAR(100) NOT NULL DEFAULT 'Indonesia';

--
-- Master table values for CountryMaster
--
LOCK TABLES CountryMaster WRITE;
DELETE FROM CountryMaster;
INSERT INTO CountryMaster(name) VALUES
('Indonesia');
UNLOCK TABLES;

-- Setting master values in variables for downstream usage
SELECT @indonesiaCountryId := id FROM CountryMaster WHERE name = 'Indonesia';

--
-- Master table values for CountryStateMaster
--
LOCK TABLES CountryStateMaster WRITE;
DELETE FROM CountryStateMaster;
INSERT INTO CountryStateMaster(country_id, name) VALUES
(@indonesiaCountryId, 'Aceh'),
(@indonesiaCountryId, 'Bali'),
(@indonesiaCountryId, 'Banten'),
(@indonesiaCountryId, 'Bengkulu'),
(@indonesiaCountryId, 'Daerah Istimewa Yogyakarta'),
(@indonesiaCountryId, 'Dki Jakarta'),
(@indonesiaCountryId, 'Gorontalo'),
(@indonesiaCountryId, 'Jambi'),
(@indonesiaCountryId, 'Jawa Barat'),
(@indonesiaCountryId, 'Jawa Tengah'),
(@indonesiaCountryId, 'Jawa Timur'),
(@indonesiaCountryId, 'Kalimantan Barat'),
(@indonesiaCountryId, 'Kalimantan Selatan'),
(@indonesiaCountryId, 'Kalimantan Tengah'),
(@indonesiaCountryId, 'Kalimantan Timur'),
(@indonesiaCountryId, 'Kalimantan Utara'),
(@indonesiaCountryId, 'Kepulauan Bangka Belitung'),
(@indonesiaCountryId, 'Kepulauan Riau'),
(@indonesiaCountryId, 'Lampung'),
(@indonesiaCountryId, 'Maluku'),
(@indonesiaCountryId, 'Maluku Utara'),
(@indonesiaCountryId, 'Nusa Tenggara Barat'),
(@indonesiaCountryId, 'Nusa Tenggara Timur'),
(@indonesiaCountryId, 'Papua'),
(@indonesiaCountryId, 'Papua Barat'),
(@indonesiaCountryId, 'Riau'),
(@indonesiaCountryId, 'Sulawesi Barat'),
(@indonesiaCountryId, 'Sulawesi Selatan'),
(@indonesiaCountryId, 'Sulawesi Tengah'),
(@indonesiaCountryId, 'Sulawesi Tenggara'),
(@indonesiaCountryId, 'Sulawesi Utara'),
(@indonesiaCountryId, 'Sumatera Barat'),
(@indonesiaCountryId, 'Sumatera Selatan'),
(@indonesiaCountryId, 'Sumatera Utara');
UNLOCK TABLES;

--
-- Master table values for IdentityProofMaster
--
LOCK TABLES IdentityProofMaster WRITE;
DELETE FROM IdentityProofMaster;
INSERT INTO IdentityProofMaster(name, valid_id_proof, valid_address_proof, is_identity_no_applicable, is_identity_no_mandatory, allow_multiple, system_defined, country_id) VALUES
("KTP",1,1,1,1,0,1,@indonesiaCountryId),
("Certificate of Domicile",0,0,0,0,0,1,@indonesiaCountryId),
("NomorPendaftaranWajibPajak NPWP",0,0,1,1,0,1,@indonesiaCountryId),
("KET DOMISILI",1,1,1,1,0,1,@indonesiaCountryId);
UNLOCK TABLES;








