mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 22:18:12 +00:00
Update seat map and sms payload
This commit is contained in:
@@ -500,11 +500,12 @@ export class SearchService {
|
||||
coachTypeId: string;
|
||||
coachTypeName: string;
|
||||
coachTypeCode: string;
|
||||
coachId: string;
|
||||
classes: Array<{ name: string; baseFareMinor: number }>;
|
||||
}>> {
|
||||
const coachTypeMap = new Map<
|
||||
string,
|
||||
{ coachType: any; classNames: Set<string> }
|
||||
{ coachType: any; classNames: Set<string>; coachId: string }
|
||||
>();
|
||||
|
||||
for (const assignment of schedule.coachAssignments) {
|
||||
@@ -515,6 +516,7 @@ export class SearchService {
|
||||
coachTypeMap.set(coachType.id, {
|
||||
coachType,
|
||||
classNames: new Set(),
|
||||
coachId: assignment.coach.id,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -523,7 +525,7 @@ export class SearchService {
|
||||
}
|
||||
|
||||
const result = [];
|
||||
for (const [, { coachType, classNames }] of coachTypeMap) {
|
||||
for (const [, { coachType, classNames, coachId }] of coachTypeMap) {
|
||||
const classes = Array.from(classNames)
|
||||
.map((className) => {
|
||||
const fareInfo = faresByClass.find((f) => f.seatClassName === className);
|
||||
@@ -537,6 +539,7 @@ export class SearchService {
|
||||
coachTypeId: coachType.id,
|
||||
coachTypeName: coachType.name,
|
||||
coachTypeCode: coachType.code,
|
||||
coachId,
|
||||
classes,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user