remove hotel schedule

This commit is contained in:
ItsMalma
2025-11-30 10:12:56 +07:00
parent c07d09c4e9
commit 66c8d9681a
6 changed files with 58 additions and 188 deletions

View File

@@ -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,
),