Files
schedule-parser-next/src/schedule/dto/v1/v1-schedule.dto.ts
n08i40k 5fe5d56ca9 2.0.0
Я пока перечислю - умру.
Надо научиться писать changelog постепенно.
2024-10-19 02:12:37 +04:00

37 lines
935 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { IsDate, IsObject, IsOptional } from "class-validator";
import { ApiProperty } from "@nestjs/swagger";
import { Transform, Type } from "class-transformer";
export class V1ScheduleDto {
@ApiProperty({
example: new Date(),
description:
"Дата когда последний раз расписание было скачано с сервера политехникума",
})
@IsDate()
updatedAt: Date;
@ApiProperty({ description: "Расписание групп" })
@IsObject()
@IsOptional()
groups: any;
@ApiProperty({
example: { "ИС-214/23": [5, 6] },
description: "Обновлённые дни с последнего изменения расписания",
})
@IsObject()
@Type(() => Object)
@Transform(({ value }) => {
const object = {};
for (const key in value) {
object[key] = value[key];
}
return object;
})
@Type(() => Object)
lastChangedDays: Array<Array<number>>;
}