import {ContainerModule}from'inversify';import {BaseRepository}from'@common-stack/store-mongo';import {CountriesAndCitiesMigration}from'../migrations/countries-and-cities-migration.js';import {TYPES}from'../constants/types.js';import {CityService}from'../services/city-service.js';import {CountryService}from'../services/country-service.js';import {StateService}from'../services/state-service.js';import {CityDataLoader}from'../dataloaders/city-data-loader.js';import {CountryDataLoader}from'../dataloaders/country-data-loader.js';import {StateDataLoader}from'../dataloaders/state-data-loader.js';import {CityRepository}from'../store/repositories/city-repository.js';import {CountryRepository}from'../store/repositories/country-repository.js';import {StateRepository}from'../store/repositories/state-repository.js';/**
 * Local services and exposed micro services to serve remote connections.
 * Operates within in the Gateway.
 *
 */
const localContainerModule = () => new ContainerModule((bind) => {
    bind('BaseRepository').to(BaseRepository).inSingletonScope().whenTargetIsDefault();
});
const DataloaderContainerModule = () => new ContainerModule((bind) => {
    bind(TYPES.CountryDataLoader).to(CountryDataLoader).inSingletonScope().whenTargetIsDefault();
    bind(TYPES.StateDataLoader).to(StateDataLoader).inSingletonScope().whenTargetIsDefault();
    bind(TYPES.CityDataLoader).to(CityDataLoader).inSingletonScope().whenTargetIsDefault();
});
const MigrationContainerModule = () => new ContainerModule((bind) => {
    bind('MongodbMigration').to(CountriesAndCitiesMigration).whenTargetNamed(CountriesAndCitiesMigration.name);
});
const DBServiceContainerModule = () => new ContainerModule((bind) => {
    bind(TYPES.CityRepository).to(CityRepository).inSingletonScope().whenTargetIsDefault();
    bind(TYPES.CityService).to(CityService).inSingletonScope().whenTargetIsDefault();
    bind(TYPES.StateRepository).to(StateRepository).inSingletonScope().whenTargetIsDefault();
    bind(TYPES.StateService).to(StateService).inSingletonScope().whenTargetIsDefault();
    bind(TYPES.CountryRepository).to(CountryRepository).inSingletonScope().whenTargetIsDefault();
    bind(TYPES.CountryService).to(CountryService).inSingletonScope().whenTargetIsDefault();
});export{DBServiceContainerModule,DataloaderContainerModule,MigrationContainerModule,localContainerModule};