[IMP]pms-api_rest: added nights and numServices to reservation datamodel

This commit is contained in:
braisab
2023-05-29 13:51:04 +02:00
committed by Darío Lodeiros
parent 446e55d4a5
commit efad97b07b
3 changed files with 10 additions and 1 deletions

View File

@@ -29,6 +29,7 @@ class PmsReservationShortInfo(Datamodel):
nights = fields.Integer(required=False, allow_none=True)
numServices = fields.Integer(required=False, allow_none=True)
toAssign = fields.Boolean(required=False, allow_none=True)
overbooking = fields.Boolean(required=False, allow_none=True)
class PmsReservationInfo(Datamodel):
@@ -76,6 +77,8 @@ class PmsReservationInfo(Datamodel):
commissionAmount = fields.Float(required=False, allow_none=True)
priceOnlyServices = fields.Float(required=False, allow_none=True)
priceOnlyRoom = fields.Float(required=False, allow_none=True)
nights = fields.Integer(required=False, allow_none=True)
numServices = fields.Integer(required=False, allow_none=True)
reservationLines = fields.List(NestedModel("pms.reservation.line.info"))
services = fields.List(

View File

@@ -235,6 +235,7 @@ class PmsFolioService(Component):
"numServices": len(reservation.service_ids)
if reservation.service_ids
else 0,
"overbooking": reservation.overbooking,
}
)
result_folios.append(
@@ -484,6 +485,7 @@ class PmsFolioService(Component):
if reservation.service_ids
else 0,
toAssign=reservation.to_assign,
overbooking=reservation.overbooking,
)
)

View File

@@ -117,7 +117,11 @@ class PmsReservationService(Component):
partnerRequests=reservation.partner_requests
if reservation.partner_requests
else None,
)
nights=reservation.nights,
numServices=len(reservation.service_ids)
if reservation.service_ids
else 0,
)
return res
def _create_vals_from_params(self, reservation_vals, reservation_data, reservation_id):