[IMP]pms_api_rest: added color code for reservations in property datamodel and service

This commit is contained in:
braisab
2022-04-21 18:42:45 +02:00
committed by Darío Lodeiros
parent 6d2bd73d5a
commit 48f0a3ed7c
2 changed files with 36 additions and 0 deletions

View File

@@ -16,3 +16,16 @@ class PmsPropertyInfo(Datamodel):
name = fields.String(required=False, allow_none=True)
company = fields.String(required=False, allow_none=True)
defaultPricelistId = fields.Integer(required=False, allow_none=True)
colorOptionConfig = fields.String(required=False, allow_none=True)
preReservationColor = fields.String(required=False, allow_none=True)
confirmedReservationColor = fields.String(required=False, allow_none=True)
paidReservationColor = fields.String(required=False, allow_none=True)
onBoardReservationColor = fields.String(required=False, allow_none=True)
paidCheckinReservationColor = fields.String(required=False, allow_none=True)
outReservationColor = fields.String(required=False, allow_none=True)
staffReservationColor = fields.String(required=False, allow_none=True)
toAssignReservationColor = fields.String(required=False, allow_none=True)
pendingPaymentReservationColor = fields.String(required=False, allow_none=True)
simpleOutColor = fields.String(required=False, allow_none=True)
simpleInColor = fields.String(required=False, allow_none=True)
simpleFutureColor = fields.String(required=False, allow_none=True)

View File

@@ -34,6 +34,19 @@ class PmsPropertyService(Component):
name=prop.name,
company=prop.company_id.name,
defaultPricelistId=prop.default_pricelist_id.id,
colorOptionConfig=prop.color_option_config,
preReservationColor=prop.pre_reservation_color,
confirmedReservationColor=prop.confirmed_reservation_color,
paidReservationColor=prop.paid_reservation_color,
onBoardReservationColor=prop.on_board_reservation_color,
paidCheckinReservationColor=prop.paid_checkin_reservation_color,
outReservationColor=prop.out_reservation_color,
staffReservationColor=prop.staff_reservation_color,
toAssignReservationColor=prop.to_assign_reservation_color,
pendingPaymentReservationColor=prop.pending_payment_reservation_color,
simpleOutColor=prop.simple_out_color,
simpleInColor=prop.simple_in_color,
simpleFutureColor=prop.simple_future_color,
)
)
return result_properties
@@ -62,6 +75,16 @@ class PmsPropertyService(Component):
name=pms_property.name,
company=pms_property.company_id.name,
defaultPricelistId=pms_property.default_pricelist_id.id,
colorOptionConfig=pms_property.color_option_config,
preReservationColor=pms_property.pre_reservation_color,
confirmedReservationColor=pms_property.confirmed_reservation_color,
paidReservationColor=pms_property.paid_reservation_color,
onBoardReservationColor=pms_property.on_board_reservation_color,
paidCheckinReservationColor=pms_property.paid_checkin_reservation_color,
outReservationColor=pms_property.out_reservation_color,
staffReservationColor=pms_property.staff_reservation_color,
toAssignReservationColor=pms_property.to_assign_reservation_color,
pendingPaymentReservationColor=pms_property.pending_payment_reservation_color,
)
return res