diff --git a/src/modules/package/package.controller.ts b/src/modules/package/package.controller.ts index 483de3d..7db8063 100644 --- a/src/modules/package/package.controller.ts +++ b/src/modules/package/package.controller.ts @@ -1303,35 +1303,41 @@ export class PackageController extends Controller { }); } - wrap(packageDetail).assign({ - departureDate: body.departure_date, - tourFlight: tourFlightSchedule, - outboundFlight: outboundFlightSchedule, - inboundFlight: inboundFlightSchedule, - makkahHotel: { - hotel: makkahHotel, - checkIn: body.makkah_hotel.check_in, - checkOut: body.makkah_hotel.check_out, + wrap(packageDetail).assign( + { + departureDate: body.departure_date, + tourFlight: tourFlightSchedule, + outboundFlight: outboundFlightSchedule, + inboundFlight: inboundFlightSchedule, + makkahHotel: { + hotel: makkahHotel, + checkIn: body.makkah_hotel.check_in, + checkOut: body.makkah_hotel.check_out, + updatedAt: new Date(), + }, + madinahHotel: { + hotel: madinahHotel, + checkIn: body.madinah_hotel.check_in, + checkOut: body.madinah_hotel.check_out, + updatedAt: new Date(), + }, + transportation: transportationClass, + quadPrice: body.quad_price, + quadDiscount: body.quad_discount, + triplePrice: body.triple_price, + tripleDiscount: body.triple_discount, + doublePrice: body.double_price, + doubleDiscount: body.double_discount, + infantPrice: body.infant_price, + infantDiscount: body.infant_discount, + itinerary: itineraryEntity, updatedAt: new Date(), }, - madinahHotel: { - hotel: madinahHotel, - checkIn: body.madinah_hotel.check_in, - checkOut: body.madinah_hotel.check_out, - updatedAt: new Date(), + { + mergeObjectProperties: true, + updateByPrimaryKey: false, }, - transportation: transportationClass, - quadPrice: body.quad_price, - quadDiscount: body.quad_discount, - triplePrice: body.triple_price, - tripleDiscount: body.triple_discount, - doublePrice: body.double_price, - doubleDiscount: body.double_discount, - infantPrice: body.infant_price, - infantDiscount: body.infant_discount, - itinerary: itineraryEntity, - updatedAt: new Date(), - }); + ); packageDetail.tourHotels.set([]); for (const [index, tourHotel] of (body.tour_hotels ?? []).entries()) {