change incident fee name format and add weekday name
This commit is contained in:
@@ -65,7 +65,7 @@ const createFeeFromIncident = (incident) => {
|
|||||||
switch (incidentTypeNumber){
|
switch (incidentTypeNumber){
|
||||||
case incidentType.UNLOCKED_INCIDENT_RELATED_WITH_RESERVATION:
|
case incidentType.UNLOCKED_INCIDENT_RELATED_WITH_RESERVATION:
|
||||||
roomExplanation = resourceName;
|
roomExplanation = resourceName;
|
||||||
dateExplanation = bookingStartMoment.clone().startOf('day').format('MMM DD');
|
dateExplanation = bookingStartMoment.clone().startOf('day').format('ddd, MMM DD');
|
||||||
bookingTimeExplanation = `${bookingStartMoment.clone().format('HH:mm a')} - ${bookingEndMoment.clone().format('HH:mm a')}`;
|
bookingTimeExplanation = `${bookingStartMoment.clone().format('HH:mm a')} - ${bookingEndMoment.clone().format('HH:mm a')}`;
|
||||||
incidentTimeExplanation = ''; // `UNLOCK : ${unlockMoment.clone().format('HH:mm a')}`;
|
incidentTimeExplanation = ''; // `UNLOCK : ${unlockMoment.clone().format('HH:mm a')}`;
|
||||||
additionalIncidentExplanation = ` ${unlockedIncidentLevelsPrices[incidentLevel].description},`;
|
additionalIncidentExplanation = ` ${unlockedIncidentLevelsPrices[incidentLevel].description},`;
|
||||||
@@ -79,7 +79,7 @@ const createFeeFromIncident = (incident) => {
|
|||||||
break;
|
break;
|
||||||
case incidentType.UNSCHEDULED_INCIDENT_BEFORE_RESERVATION:
|
case incidentType.UNSCHEDULED_INCIDENT_BEFORE_RESERVATION:
|
||||||
roomExplanation = resourceName;
|
roomExplanation = resourceName;
|
||||||
dateExplanation = bookingStartMoment.clone().startOf('day').format('MMM DD');
|
dateExplanation = bookingStartMoment.clone().startOf('day').format('ddd, MMM DD');
|
||||||
bookingTimeExplanation = `${bookingStartMoment.clone().format('HH:mm a')} - ${bookingEndMoment.clone().format('HH:mm a')}`;
|
bookingTimeExplanation = `${bookingStartMoment.clone().format('HH:mm a')} - ${bookingEndMoment.clone().format('HH:mm a')}`;
|
||||||
incidentTimeExplanation = ` Unlock : ${unlockMoment.clone().format('HH:mm a')},`;
|
incidentTimeExplanation = ` Unlock : ${unlockMoment.clone().format('HH:mm a')},`;
|
||||||
incidentTypeExplanation = '';
|
incidentTypeExplanation = '';
|
||||||
@@ -92,7 +92,7 @@ const createFeeFromIncident = (incident) => {
|
|||||||
break;
|
break;
|
||||||
case incidentType.UNSCHEDULED_INCIDENT_AFTER_RESERVATION:
|
case incidentType.UNSCHEDULED_INCIDENT_AFTER_RESERVATION:
|
||||||
roomExplanation = resourceName;
|
roomExplanation = resourceName;
|
||||||
dateExplanation = bookingStartMoment.clone().startOf('day').format('MMM DD');
|
dateExplanation = bookingStartMoment.clone().startOf('day').format('ddd, MMM DD');
|
||||||
bookingTimeExplanation = `${bookingStartMoment.clone().format('HH:mm a')} - ${bookingEndMoment.clone().format('HH:mm a')}`;
|
bookingTimeExplanation = `${bookingStartMoment.clone().format('HH:mm a')} - ${bookingEndMoment.clone().format('HH:mm a')}`;
|
||||||
incidentTimeExplanation = ` Lock : ${lockMoment.clone().format('HH:mm a')},`;
|
incidentTimeExplanation = ` Lock : ${lockMoment.clone().format('HH:mm a')},`;
|
||||||
incidentTypeExplanation = '';
|
incidentTypeExplanation = '';
|
||||||
@@ -105,7 +105,7 @@ const createFeeFromIncident = (incident) => {
|
|||||||
break;
|
break;
|
||||||
case incidentType.UNLOCKED_INCIDENT_STANDALONE:
|
case incidentType.UNLOCKED_INCIDENT_STANDALONE:
|
||||||
roomExplanation = resourceName;
|
roomExplanation = resourceName;
|
||||||
dateExplanation = unlockMoment.clone().startOf('day').format('MMM DD');
|
dateExplanation = unlockMoment.clone().startOf('day').format('ddd, MMM DD');
|
||||||
bookingTimeExplanation = `No reservation`;
|
bookingTimeExplanation = `No reservation`;
|
||||||
incidentTimeExplanation = ''; // `UNLOCK : ${unlockMoment.clone().format('HH:mm a')}`;
|
incidentTimeExplanation = ''; // `UNLOCK : ${unlockMoment.clone().format('HH:mm a')}`;
|
||||||
additionalIncidentExplanation = ` ${unlockedIncidentLevelsPrices[incidentLevel].description},`;
|
additionalIncidentExplanation = ` ${unlockedIncidentLevelsPrices[incidentLevel].description},`;
|
||||||
@@ -119,7 +119,7 @@ const createFeeFromIncident = (incident) => {
|
|||||||
break;
|
break;
|
||||||
case incidentType.UNSCHEDULED_INCIDENT_STANDALONE:
|
case incidentType.UNSCHEDULED_INCIDENT_STANDALONE:
|
||||||
roomExplanation = resourceName;
|
roomExplanation = resourceName;
|
||||||
dateExplanation = unlockMoment.clone().startOf('day').format('MMM DD');
|
dateExplanation = unlockMoment.clone().startOf('day').format('ddd, MMM DD');
|
||||||
bookingTimeExplanation = `No reservation`;
|
bookingTimeExplanation = `No reservation`;
|
||||||
incidentTimeExplanation = ` Unlock : ${unlockMoment.clone().format('HH:mm a')} Lock : ${lockMoment.clone().format('HH:mm a')},`;
|
incidentTimeExplanation = ` Unlock : ${unlockMoment.clone().format('HH:mm a')} Lock : ${lockMoment.clone().format('HH:mm a')},`;
|
||||||
incidentTypeExplanation = '';
|
incidentTypeExplanation = '';
|
||||||
@@ -137,7 +137,7 @@ const createFeeFromIncident = (incident) => {
|
|||||||
roomExplanation = oldResourceName;
|
roomExplanation = oldResourceName;
|
||||||
}
|
}
|
||||||
|
|
||||||
dateExplanation = `${oldBookingStartMoment.clone().format('MMM DD')} -> ${newBookingStartMoment.clone().format('MMM DD')}`;
|
dateExplanation = `${oldBookingStartMoment.clone().format('ddd, MMM DD')} -> ${newBookingStartMoment.clone().format('ddd, MMM DD')}`;
|
||||||
bookingTimeExplanation = `(${oldBookingStartMoment.clone().format('HH:mm a')} - ${oldBookingEndMoment.clone().format('HH:mm a')}) -> (${newBookingStartMoment.clone().format('HH:mm a')} - ${newBookingEndMoment.clone().format('HH:mm a')})`;
|
bookingTimeExplanation = `(${oldBookingStartMoment.clone().format('HH:mm a')} - ${oldBookingEndMoment.clone().format('HH:mm a')}) -> (${newBookingStartMoment.clone().format('HH:mm a')} - ${newBookingEndMoment.clone().format('HH:mm a')})`;
|
||||||
incidentTimeExplanation = ` Moved on : ${incidentTimestampMoment.clone().format('MMM DD, HH:mm a')},`;
|
incidentTimeExplanation = ` Moved on : ${incidentTimestampMoment.clone().format('MMM DD, HH:mm a')},`;
|
||||||
incidentTypeExplanation = '[Cancellation]';
|
incidentTypeExplanation = '[Cancellation]';
|
||||||
@@ -155,7 +155,7 @@ const createFeeFromIncident = (incident) => {
|
|||||||
roomExplanation = oldResourceName;
|
roomExplanation = oldResourceName;
|
||||||
}
|
}
|
||||||
|
|
||||||
dateExplanation = `${oldBookingStartMoment.clone().format('MMM DD')}`;
|
dateExplanation = `${oldBookingStartMoment.clone().format('ddd, MMM DD')}`;
|
||||||
bookingTimeExplanation = `(${oldBookingStartMoment.clone().format('HH:mm a')} - ${oldBookingEndMoment.clone().format('HH:mm a')}) -> (${newBookingStartMoment.clone().format('HH:mm a')} - ${newBookingEndMoment.clone().format('HH:mm a')})`;
|
bookingTimeExplanation = `(${oldBookingStartMoment.clone().format('HH:mm a')} - ${oldBookingEndMoment.clone().format('HH:mm a')}) -> (${newBookingStartMoment.clone().format('HH:mm a')} - ${newBookingEndMoment.clone().format('HH:mm a')})`;
|
||||||
incidentTimeExplanation = ` Shortened on : ${incidentTimestampMoment.clone().format('MMM DD, HH:mm a')},`;
|
incidentTimeExplanation = ` Shortened on : ${incidentTimestampMoment.clone().format('MMM DD, HH:mm a')},`;
|
||||||
incidentTypeExplanation = '[Cancellation]';
|
incidentTypeExplanation = '[Cancellation]';
|
||||||
@@ -168,7 +168,7 @@ const createFeeFromIncident = (incident) => {
|
|||||||
break;
|
break;
|
||||||
case incidentType.BOOKING_CANCELED_LATE:
|
case incidentType.BOOKING_CANCELED_LATE:
|
||||||
roomExplanation = oldResourceName;
|
roomExplanation = oldResourceName;
|
||||||
dateExplanation = `${oldBookingStartMoment.clone().format('MMM DD')}`;
|
dateExplanation = `${oldBookingStartMoment.clone().format('ddd, MMM DD')}`;
|
||||||
bookingTimeExplanation = `${oldBookingStartMoment.clone().format('HH:mm a')} - ${oldBookingEndMoment.clone().format('HH:mm a')}`;
|
bookingTimeExplanation = `${oldBookingStartMoment.clone().format('HH:mm a')} - ${oldBookingEndMoment.clone().format('HH:mm a')}`;
|
||||||
incidentTimeExplanation = ` Canceled on : ${incidentTimestampMoment.clone().format('MMM DD, HH:mm a')},`;
|
incidentTimeExplanation = ` Canceled on : ${incidentTimestampMoment.clone().format('MMM DD, HH:mm a')},`;
|
||||||
incidentTypeExplanation = '[Cancellation]';
|
incidentTypeExplanation = '[Cancellation]';
|
||||||
@@ -181,7 +181,7 @@ const createFeeFromIncident = (incident) => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const formattedName = `${incidentTypeExplanation} ${incidentExplanation},${additionalIncidentExplanation}${incidentTimeExplanation} ${officeName}, ${roomExplanation}, ${dateExplanation}, ${bookingTimeExplanation}`;
|
const formattedName = `${dateExplanation}, ${bookingTimeExplanation}, ${roomExplanation}, ${incidentExplanation}, ${officeName}`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: formattedName,
|
name: formattedName,
|
||||||
|
|||||||
Reference in New Issue
Block a user