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