import{__decorate as t,__param as e,__metadata as i}from"tslib";import{injectable as o,inject as s}from"inversify";import{SERVER_TYPES as r}from"common";import{loadAllCountries as c,loadAllStates as a,loadAllCities as n}from"./load-utils.js";var l;let g=l=class{countryService;stateService;cityService;logger;get id(){return"CountriesAndCitiesMigration_20240811"}constructor(t,e,i,o){this.countryService=t,this.stateService=e,this.cityService=i,this.logger=o.child({className:l.name})}async up(){await this.down();const t=await c((async t=>this.countryService.bulkCreate(t)));this.logger.info("No. of Countries loaded is [%s]",t);const e=await a((async t=>this.stateService.bulkCreate(t)));this.logger.info("No. of States loaded is [%s]",e);const i=await n((async t=>this.cityService.bulkCreate(t)));this.logger.info("No. of Cities loaded is [%s]",i)}async down(){this.logger.info("Countries dropped!")}};g=l=t([o(),e(0,s(r.CountryRepository)),e(1,s(r.StateService)),e(2,s(r.CityRepository)),e(3,s("Logger")),i("design:paramtypes",[Object,Object,Object,Object])],g);export{g as CountriesAndCitiesMigration};