separate flight class api and transportation class api into different module

This commit is contained in:
ItsMalma
2025-11-29 12:06:39 +07:00
parent 1fd90fdeab
commit 84a04da1e6
11 changed files with 271 additions and 74 deletions

View File

@@ -17,6 +17,8 @@ import { CityController } from "@/modules/city/city.controller";
import { CityMapper } from "@/modules/city/city.mapper";
import { CountryController } from "@/modules/country/country.controller";
import { CountryMapper } from "@/modules/country/country.mapper";
import { FlightClassController } from "@/modules/flight-class/flight-class.controller";
import { FlightClassMapper } from "@/modules/flight-class/flight-class.mapper";
import { FlightController } from "@/modules/flight/flight.controller";
import { FlightMapper } from "@/modules/flight/flight.mapper";
import { HotelFacilityController } from "@/modules/hotel-facility/hotel-facility.controller";
@@ -30,6 +32,8 @@ import { PackageMapper } from "@/modules/package/package.mapper";
import { PartnerController } from "@/modules/partner/partner.controller";
import { PartnerMapper } from "@/modules/partner/partner.mapper";
import { StaticController } from "@/modules/static/static.controller";
import { TransportationClassController } from "@/modules/transportation-class/transportation-class.controller";
import { TransportationClassMapper } from "@/modules/transportation-class/transportation-class.mapper";
import { TransportationController } from "@/modules/transportation/transportation.controller";
import { TransportationMapper } from "@/modules/transportation/transportation.mapper";
import compression from "compression";
@@ -71,9 +75,13 @@ export class Application {
const airlineMapper = new AirlineMapper();
const airportMapper = new AirportMapper(cityMapper);
const flightMapper = new FlightMapper(airlineMapper, airportMapper);
const flightClassMapper = new FlightClassMapper(flightMapper);
const hotelFacilityMapper = new HotelFacilityMapper();
const hotelMapper = new HotelMapper(cityMapper, hotelFacilityMapper);
const transportationMapper = new TransportationMapper();
const transportationClassMapper = new TransportationClassMapper(
transportationMapper,
);
const packageMapper = new PackageMapper(
flightMapper,
hotelMapper,
@@ -104,6 +112,9 @@ export class Application {
flightMapper,
this._jwtService,
).buildRouter();
const flightClassRouter = new FlightClassController(
flightClassMapper,
).buildRouter();
const hotelFacilityRouter = new HotelFacilityController(
hotelFacilityMapper,
this._jwtService,
@@ -118,6 +129,9 @@ export class Application {
this._fileStorage,
this._jwtService,
).buildRouter();
const transportationClassRouter = new TransportationClassController(
transportationClassMapper,
).buildRouter();
const packageRouter = new PackageController(
packageMapper,
this._fileStorage,
@@ -147,9 +161,11 @@ export class Application {
this._app.use("/airlines", airlineRouter);
this._app.use("/airports", airportRouter);
this._app.use("/flights", flightRouter);
this._app.use("/flight-classes", flightClassRouter);
this._app.use("/hotel-facilities", hotelFacilityRouter);
this._app.use("/hotels", hotelRouter);
this._app.use("/transportations", transportationRouter);
this._app.use("/transportation-classes", transportationClassRouter);
this._app.use("/packages", packageRouter);
this._app.use("/admins", adminRouter);
this._app.use("/partners", partnerRouter);