Update seat map and sms payload

This commit is contained in:
Roba Boru
2026-06-18 22:03:12 +03:00
parent e7dcf71519
commit 804d67ecc5
8 changed files with 419 additions and 201 deletions

View File

@@ -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,
});
}