This commit is contained in:
Stephanos A
2026-06-23 10:13:36 +03:00
319 changed files with 24404 additions and 4370 deletions

View File

@@ -591,11 +591,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) {
@@ -606,6 +607,7 @@ export class SearchService {
coachTypeMap.set(coachType.id, {
coachType,
classNames: new Set(),
coachId: assignment.coach.id,
});
}
@@ -614,7 +616,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);
@@ -628,6 +630,7 @@ export class SearchService {
coachTypeId: coachType.id,
coachTypeName: coachType.name,
coachTypeCode: coachType.code,
coachId,
classes,
});
}