remove hotel schedule
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import type { FlightSchedule } from "@/database/entities/flight-schedule.entity";
|
||||
import type { HotelSchedule } from "@/database/entities/hotel-schedule.entity";
|
||||
import type { PackageDetail } from "@/database/entities/package-detail.entity";
|
||||
import type { PackageItineraryDay } from "@/database/entities/package-itinerary-day.entity";
|
||||
import type {
|
||||
@@ -16,7 +15,6 @@ import type { FlightClassResponse } from "@/modules/flight/flight.types";
|
||||
import type { HotelMapper } from "@/modules/hotel/hotel.mapper";
|
||||
import type {
|
||||
PackageDetailResponse,
|
||||
PackageHotelResponse,
|
||||
PackageItineraryDayResponse,
|
||||
PackageItineraryResponse,
|
||||
PackageItineraryWidgetResponse,
|
||||
@@ -63,22 +61,6 @@ export class PackageMapper {
|
||||
return flightClassResponses;
|
||||
}
|
||||
|
||||
private mapHotelSchedule(hotelSchedule: HotelSchedule): PackageHotelResponse {
|
||||
const checkIn = dateFns.parse(hotelSchedule.checkIn, "H:mm:ss", new Date());
|
||||
|
||||
const checkOut = dateFns.parse(
|
||||
hotelSchedule.checkOut,
|
||||
"H:mm:ss",
|
||||
new Date(),
|
||||
);
|
||||
|
||||
return {
|
||||
hotel: this.hotelMapper.mapEntityToResponse(hotelSchedule.hotel),
|
||||
check_in: dateFns.format(checkIn, "HH:mm"),
|
||||
check_out: dateFns.format(checkOut, "HH:mm"),
|
||||
};
|
||||
}
|
||||
|
||||
private mapItineraryWidget(
|
||||
packageItineraryWidget: PackageItineraryWidget,
|
||||
): PackageItineraryWidgetResponse {
|
||||
@@ -174,9 +156,15 @@ export class PackageMapper {
|
||||
: null,
|
||||
outbound_flights: this.mapFlightSchedule(packageDetail.outboundFlight),
|
||||
inbound_flights: this.mapFlightSchedule(packageDetail.inboundFlight),
|
||||
tour_hotels: packageDetail.tourHotels.map(this.mapHotelSchedule),
|
||||
makkah_hotel: this.mapHotelSchedule(packageDetail.makkahHotel),
|
||||
madinah_hotel: this.mapHotelSchedule(packageDetail.madinahHotel),
|
||||
tour_hotels: packageDetail.tourHotels.map(
|
||||
this.hotelMapper.mapEntityToResponse,
|
||||
),
|
||||
makkah_hotel: this.hotelMapper.mapEntityToResponse(
|
||||
packageDetail.makkahHotel,
|
||||
),
|
||||
madinah_hotel: this.hotelMapper.mapEntityToResponse(
|
||||
packageDetail.madinahHotel,
|
||||
),
|
||||
transportation: this.transportationMapper.mapClassEntityToResponse(
|
||||
packageDetail.transportation,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user