From 48f0a3ed7cba5970c93d3cd25ef179cd0a3c4718 Mon Sep 17 00:00:00 2001 From: braisab Date: Thu, 21 Apr 2022 18:42:45 +0200 Subject: [PATCH] [IMP]pms_api_rest: added color code for reservations in property datamodel and service --- pms_api_rest/datamodels/pms_property.py | 13 +++++++++++ pms_api_rest/services/pms_property_service.py | 23 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/pms_api_rest/datamodels/pms_property.py b/pms_api_rest/datamodels/pms_property.py index 24664c7d7..c345d8617 100644 --- a/pms_api_rest/datamodels/pms_property.py +++ b/pms_api_rest/datamodels/pms_property.py @@ -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) diff --git a/pms_api_rest/services/pms_property_service.py b/pms_api_rest/services/pms_property_service.py index 59cb8865c..539bb560d 100644 --- a/pms_api_rest/services/pms_property_service.py +++ b/pms_api_rest/services/pms_property_service.py @@ -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