"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OgPublicContainer = void 0;
const GeoMeasurementHelper_1 = require("../../../helpers/geo/GeoMeasurementHelper");
const const_1 = require("../../../schema-definitions/vehicle-positions/redis/const");
const const_2 = require("../../../schema-definitions/ropid-gtfs/redis/const");
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
const Di_1 = require("@golemio/core/dist/output-gateway/ioc/Di");
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
const VehicleDescriptorCachedRepository_1 = require("../data-access/VehicleDescriptorCachedRepository");
const DelayComputationRepository_1 = require("../data-access/redis/DelayComputationRepository");
const PublicGtfsDepartureRepository_1 = require("../data-access/redis/PublicGtfsDepartureRepository");
const PublicStopTimeRepository_1 = require("../data-access/redis/PublicStopTimeRepository");
const GtfsStopsRedisRepository_1 = require("../../ropid-gtfs/data-access/redis/GtfsStopsRedisRepository");
const PublicVehiclePositionsRepository_1 = require("../data-access/redis/PublicVehiclePositionsRepository");
const VPSubscriber_1 = require("../../shared/service/VPSubscriber");
const DepartureBoardFacade_1 = require("../service/facade/DepartureBoardFacade");
const DetailedTripFacade_1 = require("../service/facade/DetailedTripFacade");
const GtfsTripLookupFacade_1 = require("../service/facade/GtfsTripLookupFacade");
const VehiclePositionsFacade_1 = require("../service/facade/VehiclePositionsFacade");
const BoundingBoxHelper_1 = require("../service/helpers/BoundingBoxHelper");
const GtfsTripScopeHandlerFactory_1 = require("../service/helpers/gtfs-trip-scope/GtfsTripScopeHandlerFactory");
const InfoTripScopeHandler_1 = require("../service/helpers/gtfs-trip-scope/strategy/InfoTripScopeHandler");
const ShapesTripScopeHandler_1 = require("../service/helpers/gtfs-trip-scope/strategy/ShapesTripScopeHandler");
const StopTimesTripScopeHandler_1 = require("../service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler");
const VehicleDescriptorTripScopeHandler_1 = require("../service/helpers/gtfs-trip-scope/strategy/VehicleDescriptorTripScopeHandler");
const TripScopeHandlerFactory_1 = require("../service/helpers/trip-scope/TripScopeHandlerFactory");
const InfoTripScopeHandler_2 = require("../service/helpers/trip-scope/strategy/InfoTripScopeHandler");
const ShapesTripScopeHandler_2 = require("../service/helpers/trip-scope/strategy/ShapesTripScopeHandler");
const StopTimesTripScopeHandler_2 = require("../service/helpers/trip-scope/strategy/StopTimesTripScopeHandler");
const VehicleDescriptorTripScopeHandler_2 = require("../service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler");
const PublicGtfsTripInfoTransformation_1 = require("../service/transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation");
const PublicGtfsTripShapesTransformation_1 = require("../service/transformations/gtfs-trip-scopes/PublicGtfsTripShapesTransformation");
const PublicGtfsVehicleDescriptorTransformation_1 = require("../service/transformations/gtfs-trip-scopes/PublicGtfsVehicleDescriptorTransformation");
const PublicTripStopTimesTransformation_1 = require("../service/transformations/gtfs-trip-scopes/PublicTripStopTimesTransformation");
const OgModuleToken_1 = require("./OgModuleToken");
const ogPublicContainer = Di_1.OutputGatewayContainer.createChildContainer();
exports.OgPublicContainer = ogPublicContainer;
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.GeoMeasurementHelper, GeoMeasurementHelper_1.GeoMeasurementHelper);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.BoundingBoxHelper, BoundingBoxHelper_1.BoundingBoxHelper);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.VehicleDescriptorCachedRepository, VehicleDescriptorCachedRepository_1.VehicleDescriptorCachedRepository);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.PublicVehiclePositionsRepository, PublicVehiclePositionsRepository_1.PublicVehiclePositionsRepository);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.DelayComputationRepository, DelayComputationRepository_1.DelayComputationRepository);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.PublicStopTimeRepository, PublicStopTimeRepository_1.PublicStopTimeRepository);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.PublicGtfsDepartureRepository, PublicGtfsDepartureRepository_1.PublicGtfsDepartureRepository);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.GtfsStopsRedisRepository, GtfsStopsRedisRepository_1.GtfsStopsRedisRepository);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.InfoTripScopeHandler, InfoTripScopeHandler_2.InfoTripScopeHandler);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.StopTimesTripScopeHandler, StopTimesTripScopeHandler_2.StopTimesTripScopeHandler);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.ShapesTripScopeHandler, ShapesTripScopeHandler_2.ShapesTripScopeHandler);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.VehicleDescriptorTripScopeHandler, VehicleDescriptorTripScopeHandler_2.VehicleDescriptorTripScopeHandler);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.TripScopeHandlerFactory, TripScopeHandlerFactory_1.TripScopeHandlerFactory);
//#region GtfsTripLookup scope handlers
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.PublicGtfsTripInfoTransformation, PublicGtfsTripInfoTransformation_1.PublicGtfsTripInfoTransformation);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.PublicGtfsTripShapesTransformation, PublicGtfsTripShapesTransformation_1.PublicGtfsTripShapesTransformation);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.PublicGtfsVehicleDescriptorTransformation, PublicGtfsVehicleDescriptorTransformation_1.PublicGtfsVehicleDescriptorTransformation);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.PublicGtfsTripStopTimesTransformation, PublicTripStopTimesTransformation_1.PublicGtfsTripStopTimesTransformation);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.InfoGtfsTripScopeHandler, InfoTripScopeHandler_1.InfoGtfsTripScopeHandler);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.StopTimesGtfsTripScopeHandler, StopTimesTripScopeHandler_1.StopTimesGtfsTripScopeHandler);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.ShapesGtfsTripScopeHandler, ShapesTripScopeHandler_1.ShapesGtfsTripScopeHandler);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.VehicleDescriptorGtfsTripScopeHandler, VehicleDescriptorTripScopeHandler_1.VehicleDescriptorGtfsTripScopeHandler);
ogPublicContainer.registerSingleton(OgModuleToken_1.OgModuleToken.GtfsTripScopeHandlerFactory, GtfsTripScopeHandlerFactory_1.GtfsTripScopeHandlerFactory);
//#endregion
ogPublicContainer.register(OgModuleToken_1.OgModuleToken.GtfsTripLookupFacade, {
    useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
        return new GtfsTripLookupFacade_1.GtfsTripLookupFacade(c.resolve(OgModuleToken_1.OgModuleToken.GtfsTripScopeHandlerFactory));
    }),
});
ogPublicContainer.register(OgModuleToken_1.OgModuleToken.PublicVehiclePositionsFacade, {
    useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
        return new VehiclePositionsFacade_1.PublicVehiclePositionsFacade(c.resolve(OgModuleToken_1.OgModuleToken.PublicVehiclePositionsRepository), c.resolve(OgModuleToken_1.OgModuleToken.BoundingBoxHelper), c.resolve(CoreToken_1.CoreToken.Logger));
    }),
});
ogPublicContainer.register(OgModuleToken_1.OgModuleToken.DetailedTripFacade, {
    useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
        return new DetailedTripFacade_1.DetailedTripFacade(c.resolve(OgModuleToken_1.OgModuleToken.TripScopeHandlerFactory), c.resolve(OgModuleToken_1.OgModuleToken.PublicVehiclePositionsRepository));
    }),
});
ogPublicContainer.register(OgModuleToken_1.OgModuleToken.DepartureBoardFacade, {
    useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
        return new DepartureBoardFacade_1.DepartureBoardFacade(c.resolve(OgModuleToken_1.OgModuleToken.PublicGtfsDepartureRepository), c.resolve(OgModuleToken_1.OgModuleToken.PublicVehiclePositionsRepository), c.resolve(OgModuleToken_1.OgModuleToken.PublicStopTimeRepository), c.resolve(OgModuleToken_1.OgModuleToken.VehicleDescriptorCachedRepository), c.resolve(OgModuleToken_1.OgModuleToken.GtfsStopsRedisRepository));
    }),
});
ogPublicContainer.register(OgModuleToken_1.OgModuleToken.VPSubscriber, {
    useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
        const config = c.resolve(CoreToken_1.CoreToken.SimpleConfig);
        const logger = c.resolve(CoreToken_1.CoreToken.Logger);
        return new VPSubscriber_1.VPSubscriber({
            channelName: const_1.PUBLIC_CACHE_NAMESPACE_PREFIX,
            redisConnectionString: config.getValue("env.REDIS_CONN"),
            logger: logger,
        }, c.resolve(OgModuleToken_1.OgModuleToken.PublicVehiclePositionsRepository));
    }),
});
ogPublicContainer.register(OgModuleToken_1.OgModuleToken.GtfsStopsSubscriber, {
    useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => {
        const config = c.resolve(CoreToken_1.CoreToken.SimpleConfig);
        const logger = c.resolve(CoreToken_1.CoreToken.Logger);
        return new VPSubscriber_1.VPSubscriber({
            channelName: const_2.GTFS_STOPS_NAMESPACE_PREFIX,
            redisConnectionString: config.getValue("env.REDIS_CONN"),
            logger: logger,
        }, c.resolve(OgModuleToken_1.OgModuleToken.GtfsStopsRedisRepository));
    }),
});
//# sourceMappingURL=Di.js.map