[IMP] pms_api_rest: add agency image in folio service and it's reservations

This commit is contained in:
Sara Lago
2022-02-24 13:04:54 +01:00
committed by Darío Lodeiros
parent f776c9dc89
commit e8095e0471
2 changed files with 11 additions and 0 deletions

View File

@@ -26,3 +26,4 @@ class PmsFolioInfo(Datamodel):
salesPerson = fields.String(required=False, allow_none=True)
paymentState = fields.String(required=False, allow_none=True)
propertyId = fields.Integer(required=False, allow_none=True)
agencyImage = fields.String(required=False, allow_none=True)

View File

@@ -80,6 +80,15 @@ class PmsFolioService(Component):
"folioId": reservation.folio_id.id
if reservation.folio_id
else "",
"saleChannel": reservation.channel_type_id.name
if reservation.channel_type_id
else "",
"agency": reservation.agency_id.name
if reservation.agency_id
else "",
"agencyImage": reservation.agency_id.image_1024.decode("utf-8")
if reservation.agency_id
else "",
}
)
result_folios.append(
@@ -107,6 +116,7 @@ class PmsFolioService(Component):
if folio.payment_state
else "",
propertyId=folio.pms_property_id,
agencyImage=folio.agency_id.image_1024 if folio.agency_id else "",
)
)
return result_folios