separate flight class api and transportation class api into different module
This commit is contained in:
20
src/modules/flight-class/flight-class.mapper.ts
Normal file
20
src/modules/flight-class/flight-class.mapper.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import type { FlightClass } from "@/database/entities/flight-class.entity";
|
||||
import type { FlightMapper } from "@/modules/flight/flight.mapper";
|
||||
import type { FlightClassResponse } from "@/modules/flight/flight.types";
|
||||
|
||||
export class FlightClassMapper {
|
||||
public constructor(private readonly flightMapper: FlightMapper) {}
|
||||
|
||||
public mapEntityToResponse(flightClass: FlightClass): FlightClassResponse {
|
||||
return {
|
||||
id: flightClass.id,
|
||||
flight: this.flightMapper.mapEntityToResponse(flightClass.flight),
|
||||
class: flightClass.class,
|
||||
seat_layout: flightClass.seatLayout,
|
||||
baggage: flightClass.baggage,
|
||||
cabin_baggage: flightClass.cabinBaggage,
|
||||
created_at: flightClass.createdAt,
|
||||
updated_at: flightClass.updatedAt,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user