display booking charge incidents; refactor frontend
This commit is contained in:
@@ -247,7 +247,38 @@ const getAllIncidents = (dateRange, memberId) => {
|
||||
});
|
||||
});
|
||||
|
||||
allIncidents.push(...bookingChangeIncidents);
|
||||
bookingChangeIncidents.forEach((bookingChangeIncident) => {
|
||||
const {
|
||||
id,
|
||||
memberId,
|
||||
resourceId,
|
||||
oldBookingStart,
|
||||
oldBookingEnd,
|
||||
newBookingStart,
|
||||
newBookingEnd,
|
||||
incidentType,
|
||||
chargeFee,
|
||||
createdAt,
|
||||
} = bookingChangeIncident;
|
||||
const memberName = membersMap[memberId].name;
|
||||
const resource = resourcesMap[resourceId];
|
||||
const resourceName = resource.resourceName;
|
||||
const officeName = officesMap[resource.officeId].officeName;
|
||||
allIncidents.push({
|
||||
incidentId: id,
|
||||
memberId,
|
||||
memberName,
|
||||
resourceName,
|
||||
officeName,
|
||||
oldBookingStart: formatTime(oldBookingStart),
|
||||
oldBookingEnd: formatTime(oldBookingEnd),
|
||||
newBookingStart: formatTime(newBookingStart),
|
||||
newBookingEnd: formatTime(newBookingEnd),
|
||||
incidentType,
|
||||
totalChargeFee: chargeFee,
|
||||
incidentTimestamp: formatTime(createdAt),
|
||||
});
|
||||
});
|
||||
|
||||
resolve(allIncidents);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user