Skip to content

Commit faef299

Browse files
authored
Merge pull request Expensify#62776 from software-mansion-labs/@zfurtak/travel-updates
2 parents 81674b1 + 383e2b3 commit faef299

14 files changed

Lines changed: 343 additions & 8 deletions

File tree

cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,8 @@
467467
"reactnativekeycommand",
468468
"reauthentication",
469469
"Reauthenticator",
470+
"Rebooked",
471+
"REBOOKED",
470472
"recategorize",
471473
"recents",
472474
"REDIRECTURI",

src/CONST.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,7 @@ const CONST = {
13601360
TASK_COMPLETED: 'TASKCOMPLETED',
13611361
TASK_EDITED: 'TASKEDITED',
13621362
TASK_REOPENED: 'TASKREOPENED',
1363+
TRAVEL_UPDATE: 'TRAVEL_TRIP_ROOM_UPDATE',
13631364
TRIP_PREVIEW: 'TRIPPREVIEW',
13641365
UNAPPROVED: 'UNAPPROVED',
13651366
UNHOLD: 'UNHOLD',
@@ -7162,6 +7163,28 @@ const CONST = {
71627163
PROVISIONING: {
71637164
ERROR_PERMISSION_DENIED: 'permissionDenied',
71647165
},
7166+
UPDATE_OPERATION_TYPE: {
7167+
BOOKING_TICKETED: 'BOOKING_TICKETED',
7168+
TICKET_VOIDED: 'TICKET_VOIDED',
7169+
TICKET_REFUNDED: 'TICKET_REFUNDED',
7170+
FLIGHT_CANCELLED: 'FLIGHT_CANCELLED',
7171+
FLIGHT_SCHEDULE_CHANGE_PENDING: 'FLIGHT_SCHEDULE_CHANGE_PENDING',
7172+
FLIGHT_SCHEDULE_CHANGE_CLOSED: 'FLIGHT_SCHEDULE_CHANGE_CLOSED',
7173+
FLIGHT_CHANGED: 'FLIGHT_CHANGED',
7174+
FLIGHT_CABIN_CHANGED: 'FLIGHT_CABIN_CHANGED',
7175+
FLIGHT_SEAT_CONFIRMED: 'FLIGHT_SEAT_CONFIRMED',
7176+
FLIGHT_SEAT_CHANGED: 'FLIGHT_SEAT_CHANGED',
7177+
FLIGHT_SEAT_CANCELLED: 'FLIGHT_SEAT_CANCELLED',
7178+
PAYMENT_DECLINED: 'PAYMENT_DECLINED',
7179+
BOOKING_CANCELED_BY_TRAVELER: 'BOOKING_CANCELED_BY_TRAVELER',
7180+
BOOKING_CANCELED_BY_VENDOR: 'BOOKING_CANCELED_BY_VENDOR',
7181+
BOOKING_REBOOKED: 'BOOKING_REBOOKED',
7182+
BOOKING_UPDATED: 'BOOKING_UPDATED',
7183+
TRIP_UPDATED: 'TRIP_UPDATED',
7184+
BOOKING_OTHER_UPDATE: 'BOOKING_OTHER_UPDATE',
7185+
REFUND: 'REFUND',
7186+
EXCHANGE: 'EXCHANGE',
7187+
},
71657188
},
71667189
LAST_PAYMENT_METHOD: {
71677190
LAST_USED: 'lastUsed',

src/languages/en.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type {
1212
AddOrDeletePolicyCustomUnitRateParams,
1313
AddressLineParams,
1414
AdminCanceledRequestParams,
15+
AirlineParams,
1516
AlreadySignedInParams,
1617
ApprovalWorkflowErrorParams,
1718
ApprovedAmountParams,
@@ -83,6 +84,7 @@ import type {
8384
FileLimitParams,
8485
FiltersAmountBetweenParams,
8586
FlightLayoverParams,
87+
FlightParams,
8688
FormattedMaxLengthParams,
8789
GoBackMessageParams,
8890
GoToRoomParams,
@@ -137,6 +139,7 @@ import type {
137139
PolicyDisabledReportFieldAllOptionsParams,
138140
PolicyDisabledReportFieldOptionParams,
139141
PolicyExpenseChatNameParams,
142+
RailTicketParams,
140143
ReconciliationWorksParams,
141144
RemovedFromApprovalWorkflowParams,
142145
RemovedTheRequestParams,
@@ -191,6 +194,7 @@ import type {
191194
TotalAmountGreaterOrLessThanOriginalParams,
192195
ToValidateLoginParams,
193196
TransferParams,
197+
TravelTypeParams,
194198
TrialStartedTitleParams,
195199
UnapproveWithIntegrationWarningParams,
196200
UnshareParams,
@@ -2998,6 +3002,33 @@ const translations = {
29983002
title: 'Get started with travel today!',
29993003
message: `Please contact your Account manager or salesteam@expensify.com to get a demo of travel and have it enabled for your company.`,
30003004
},
3005+
updates: {
3006+
bookingTicketed: ({airlineCode, origin, destination, startDate, confirmationID = ''}: FlightParams) =>
3007+
`Your flight ${airlineCode} (${origin}${destination}) on ${startDate} has been booked. Confirmation code: ${confirmationID}`,
3008+
ticketVoided: ({airlineCode, origin, destination, startDate}: FlightParams) =>
3009+
`Your ticket for flight ${airlineCode} (${origin}${destination}) on ${startDate} has been voided.`,
3010+
ticketRefunded: ({airlineCode, origin, destination, startDate}: FlightParams) =>
3011+
`Your ticket for flight ${airlineCode} (${origin}${destination}) on ${startDate} has been refunded or exchanged.`,
3012+
flightCancelled: ({airlineCode, origin, destination, startDate}: FlightParams) =>
3013+
`Your flight ${airlineCode} (${origin}${destination}) on ${startDate}} has been canceled by the airline.`,
3014+
flightScheduleChangePending: ({airlineCode}: AirlineParams) => `The airline has proposed a schedule change for flight ${airlineCode}; we are awaiting confirmation.`,
3015+
flightScheduleChangeClosed: ({airlineCode, startDate}: AirlineParams) => `Schedule change confirmed: flight ${airlineCode} now departs at ${startDate}.`,
3016+
flightUpdated: ({airlineCode, origin, destination, startDate}: FlightParams) => `Your flight ${airlineCode} (${origin}${destination}) on ${startDate} has been updated.`,
3017+
flightCabinChanged: ({airlineCode, cabinClass}: AirlineParams) => `Your cabin class has been updated to ${cabinClass} on flight ${airlineCode}.`,
3018+
flightSeatConfirmed: ({airlineCode}: AirlineParams) => `Your seat assignment on flight ${airlineCode} has been confirmed.`,
3019+
flightSeatChanged: ({airlineCode}: AirlineParams) => `Your seat assignment on flight ${airlineCode} has been changed.`,
3020+
flightSeatCancelled: ({airlineCode}: AirlineParams) => `Your seat assignment on flight ${airlineCode} was removed.`,
3021+
paymentDeclined: 'Payment for your air booking failed. Please try again.',
3022+
bookingCancelledByTraveler: ({type, id = ''}: TravelTypeParams) => `You cancelled your ${type} reservation ${id}.`,
3023+
bookingCancelledByVendor: ({type, id = ''}: TravelTypeParams) => `The vendor cancelled your ${type} reservation ${id}.`,
3024+
bookingRebooked: ({type, id = ''}: TravelTypeParams) => `Your ${type} reservation was re-booked. New confirmation #:${id}.`,
3025+
bookingUpdated: ({type}: TravelTypeParams) => `Your ${type} booking was updated. Review the new details in the itinerary.`,
3026+
railTicketRefund: ({origin, destination, startDate}: RailTicketParams) =>
3027+
`Your rail ticket for ${origin}${destination} on ${startDate} has been refunded. A credit will be processed.`,
3028+
railTicketExchange: ({origin, destination, startDate}: RailTicketParams) => `Your rail ticket for ${origin}${destination} on ${startDate} has been exchanged.`,
3029+
railTicketUpdate: ({origin, destination, startDate}: RailTicketParams) => `Your rail ticket for ${origin}${destination} on ${startDate} has been updated.`,
3030+
defaultUpdate: ({type}: TravelTypeParams) => `Your ${type} reservation was updated.`,
3031+
},
30013032
},
30023033
workspace: {
30033034
common: {

src/languages/es.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import type {
1111
AddOrDeletePolicyCustomUnitRateParams,
1212
AddressLineParams,
1313
AdminCanceledRequestParams,
14+
AirlineParams,
1415
AlreadySignedInParams,
1516
ApprovalWorkflowErrorParams,
1617
ApprovedAmountParams,
@@ -82,6 +83,7 @@ import type {
8283
FileLimitParams,
8384
FiltersAmountBetweenParams,
8485
FlightLayoverParams,
86+
FlightParams,
8587
FormattedMaxLengthParams,
8688
GoBackMessageParams,
8789
GoToRoomParams,
@@ -136,6 +138,7 @@ import type {
136138
PolicyDisabledReportFieldAllOptionsParams,
137139
PolicyDisabledReportFieldOptionParams,
138140
PolicyExpenseChatNameParams,
141+
RailTicketParams,
139142
ReconciliationWorksParams,
140143
RemovedFromApprovalWorkflowParams,
141144
RemovedTheRequestParams,
@@ -190,6 +193,7 @@ import type {
190193
TotalAmountGreaterOrLessThanOriginalParams,
191194
ToValidateLoginParams,
192195
TransferParams,
196+
TravelTypeParams,
193197
TrialStartedTitleParams,
194198
UnapproveWithIntegrationWarningParams,
195199
UnshareParams,
@@ -3022,6 +3026,33 @@ const translations = {
30223026
title: '¡Empieza a viajar hoy mismo!',
30233027
message: `Por favor, contacta a tu gestor de cuenta o a salesteam@expensify.com para solicitar una demostración de Travel y habilitarlo para tu empresa.`,
30243028
},
3029+
updates: {
3030+
bookingTicketed: ({airlineCode, origin, destination, startDate, confirmationID = ''}: FlightParams) =>
3031+
`Tu vuelo ${airlineCode} (${origin}${destination}) para el ${startDate} ha sido reservado. Código de confirmación: ${confirmationID}`,
3032+
ticketVoided: ({airlineCode, origin, destination, startDate}: FlightParams) =>
3033+
`Tu billete para el vuelo ${airlineCode} (${origin}${destination}) del ${startDate} ha sido anulado.`,
3034+
ticketRefunded: ({airlineCode, origin, destination, startDate}: FlightParams) =>
3035+
`Tu billete para el vuelo ${airlineCode} (${origin}${destination}) del ${startDate} ha sido reembolsado o cambiado.`,
3036+
flightCancelled: ({airlineCode, origin, destination, startDate}: FlightParams) =>
3037+
`Tu vuelo ${airlineCode} (${origin}${destination}) del ${startDate} ha sido cancelado por la aerolínea.`,
3038+
flightScheduleChangePending: ({airlineCode}: AirlineParams) => `La aerolínea ha propuesto un cambio de horario para el vuelo ${airlineCode}; estamos esperando la confirmación.`,
3039+
flightScheduleChangeClosed: ({airlineCode, startDate}: AirlineParams) => `Cambio de horario confirmado: el vuelo ${airlineCode} ahora sale a las ${startDate}.`,
3040+
flightUpdated: ({airlineCode, origin, destination, startDate}: FlightParams) => `Tu vuelo ${airlineCode} (${origin}${destination}) del ${startDate} ha sido actualizado.`,
3041+
flightCabinChanged: ({airlineCode, cabinClass}: AirlineParams) => `Tu clase de cabina ha sido actualizada a ${cabinClass} en el vuelo ${airlineCode}.`,
3042+
flightSeatConfirmed: ({airlineCode}: AirlineParams) => `Tu asignación de asiento en el vuelo ${airlineCode} ha sido confirmada.`,
3043+
flightSeatChanged: ({airlineCode}: AirlineParams) => `Tu asignación de asiento en el vuelo ${airlineCode} ha sido modificada.`,
3044+
flightSeatCancelled: ({airlineCode}: AirlineParams) => `Tu asignación de asiento en el vuelo ${airlineCode} fue eliminada.`,
3045+
paymentDeclined: 'El pago de tu reserva aérea ha fallado. Por favor, inténtalo de nuevo.',
3046+
bookingCancelledByTraveler: ({type, id = ''}: TravelTypeParams) => `Cancelaste tu reserva de ${type} ${id}.`,
3047+
bookingCancelledByVendor: ({type, id = ''}: TravelTypeParams) => `El proveedor canceló tu reserva de ${type} ${id}.`,
3048+
bookingRebooked: ({type, id = ''}: TravelTypeParams) => `Tu reserva de ${type} fue reprogramada. Nuevo número de confirmación: ${id}.`,
3049+
bookingUpdated: ({type}: TravelTypeParams) => `Tu reserva de ${type} fue actualizada. Revisa los nuevos detalles en el itinerario.`,
3050+
railTicketRefund: ({origin, destination, startDate}: RailTicketParams) =>
3051+
`Tu billete de tren de ${origin} a ${destination} para el ${startDate} ha sido reembolsado. Se procesará un crédito.`,
3052+
railTicketExchange: ({origin, destination, startDate}: RailTicketParams) => `Tu billete de tren de ${origin} a ${destination} para el ${startDate} ha sido cambiado.`,
3053+
railTicketUpdate: ({origin, destination, startDate}: RailTicketParams) => `Tu billete de tren de ${origin} a ${destination} para el ${startDate} ha sido actualizado.`,
3054+
defaultUpdate: ({type}: TravelTypeParams) => `Tu reserva de ${type} fue actualizada.`,
3055+
},
30253056
},
30263057
workspace: {
30273058
common: {

src/languages/params.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,31 @@ type EmployeeInviteMessageParams = {
740740
name: string;
741741
};
742742

743+
type FlightParams = {
744+
startDate: string;
745+
airlineCode: string;
746+
origin: string;
747+
destination: string;
748+
confirmationID?: string;
749+
};
750+
751+
type AirlineParams = {
752+
airlineCode: string;
753+
startDate?: string;
754+
cabinClass?: string;
755+
};
756+
757+
type RailTicketParams = {
758+
origin: string;
759+
destination: string;
760+
startDate: string;
761+
};
762+
763+
type TravelTypeParams = {
764+
type: string;
765+
id?: string;
766+
};
767+
743768
export type {
744769
SplitExpenseEditTitleParams,
745770
SplitExpenseSubtitleParams,
@@ -1005,4 +1030,8 @@ export type {
10051030
ReviewParams,
10061031
CurrencyInputDisabledTextParams,
10071032
EmployeeInviteMessageParams,
1033+
FlightParams,
1034+
AirlineParams,
1035+
RailTicketParams,
1036+
TravelTypeParams,
10081037
};

src/libs/OptionsListUtils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ import {
6464
getReportActionMessageText,
6565
getRetractedMessage,
6666
getSortedReportActions,
67+
getTravelUpdateMessage,
6768
getUpdateRoomDescriptionMessage,
6869
isActionableAddPaymentCard,
6970
isActionableJoinRequest,
@@ -831,6 +832,8 @@ function getLastMessageTextForReport(
831832
lastMessageTextFromReport = getReopenedMessage();
832833
} else if (isActionOfType(lastReportAction, CONST.REPORT.ACTIONS.TYPE.CHANGE_POLICY)) {
833834
lastMessageTextFromReport = getPolicyChangeMessage(lastReportAction);
835+
} else if (isActionOfType(lastReportAction, CONST.REPORT.ACTIONS.TYPE.TRAVEL_UPDATE)) {
836+
lastMessageTextFromReport = getTravelUpdateMessage(lastReportAction);
834837
}
835838

836839
// we do not want to show report closed in LHN for non archived report so use getReportLastMessage as fallback instead of lastMessageText from report

0 commit comments

Comments
 (0)