Backoffice updates, boarding pass, alternative schedule search and more

This commit is contained in:
Stephanos A
2026-06-23 10:10:55 +03:00
parent b491f39d42
commit 2d51787383
37 changed files with 1267 additions and 1040 deletions

View File

@@ -7,8 +7,8 @@ export class CreateStationDto {
@ApiProperty({ example: 'Addis Ababa' }) @IsString() city: string;
@ApiPropertyOptional() @IsOptional() @IsString() timezone?: string;
@ApiPropertyOptional() @IsOptional() @IsString() countryCode?: string;
@ApiProperty({ example: 9.0054 }) @IsNumber() lat: number;
@ApiProperty({ example: 38.7636 }) @IsNumber() lng: number;
@ApiPropertyOptional({ example: 9.0054 }) @IsOptional() @IsNumber() lat?: number;
@ApiPropertyOptional({ example: 38.7636 }) @IsOptional() @IsNumber() lng?: number;
@ApiPropertyOptional({ example: 1 }) @IsOptional() @IsInt() sequence?: number;
@ApiPropertyOptional({ example: true }) @IsOptional() @IsBoolean() isOperational?: boolean;
}

View File

@@ -50,7 +50,10 @@ export class StationsService {
}
async create(dto: CreateStationDto) {
const station = await this.prisma.station.create({ data: dto });
const { lat, lng, ...rest } = dto;
const station = await this.prisma.station.create({
data: { ...rest, ...(lat !== undefined && { lat }), ...(lng !== undefined && { lng }) } as any,
});
await this.auditService.log({
userId: this.request?.user?.id,