mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] pms-api-rest: add notif. rt capacity
This commit is contained in:
committed by
Darío Lodeiros
parent
c3fc102f0e
commit
d54344c373
@@ -13,3 +13,4 @@ class PmsCalendarInfo(Datamodel):
|
||||
isFirstDay = fields.Boolean(required=False, allow_none=True)
|
||||
isLastDay = fields.Boolean(required=False, allow_none=True)
|
||||
totalPrice = fields.Float(required=False, allow_none=True)
|
||||
numNotifications = fields.Integer(required=False, allow_none=True)
|
||||
|
||||
@@ -8,3 +8,4 @@ class PmsRoomInfo(Datamodel):
|
||||
id = fields.Integer(required=False, allow_none=True)
|
||||
name = fields.String(required=False, allow_none=True)
|
||||
roomTypeId = fields.Integer(required=False, allow_none=True)
|
||||
capacity = fields.Integer(required=False, allow_none=True)
|
||||
|
||||
@@ -46,12 +46,13 @@ class PmsCalendarService(Component):
|
||||
id=line.id,
|
||||
roomId=line.room_id.id,
|
||||
date=datetime.combine(line.date, datetime.min.time()).isoformat(),
|
||||
partnerId=line.reservation_id.partner_id.id,
|
||||
partnerId=line.reservation_id.partner_id.id or None,
|
||||
reservationId=line.reservation_id,
|
||||
isFirstDay=line.reservation_id.checkin == line.date,
|
||||
isLastDay=line.reservation_id.checkout
|
||||
== (line.date + timedelta(days=1)),
|
||||
totalPrice=line.reservation_id.price_total,
|
||||
numNotifications=len(line.reservation_id.message_ids),
|
||||
)
|
||||
)
|
||||
return result_lines
|
||||
|
||||
@@ -43,6 +43,7 @@ class PmsRoomService(Component):
|
||||
id=room.id,
|
||||
name=room.name,
|
||||
roomTypeId=room.room_type_id,
|
||||
capacity=room.capacity,
|
||||
)
|
||||
)
|
||||
return result_rooms
|
||||
|
||||
Reference in New Issue
Block a user