mirror of
https://github.com/n08i40k/schedule-parser-next.git
synced 2025-12-06 09:47:46 +03:00
2.0.0
Я пока перечислю - умру. Надо научиться писать changelog постепенно.
This commit is contained in:
25
src/schedule/dto/v1/v1-group.dto.ts
Normal file
25
src/schedule/dto/v1/v1-group.dto.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { IsArray, IsOptional, IsString, ValidateNested } from "class-validator";
|
||||
import { Type } from "class-transformer";
|
||||
import { V1DayDto } from "./v1-day.dto";
|
||||
|
||||
export class V1GroupDto {
|
||||
@ApiProperty({
|
||||
example: "ИС-214/23",
|
||||
description: "Название группы",
|
||||
})
|
||||
@IsString()
|
||||
name: string;
|
||||
|
||||
@ApiProperty({ example: [], description: "Дни недели" })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@IsOptional()
|
||||
@Type(() => V1DayDto)
|
||||
days: Array<V1DayDto | null>;
|
||||
|
||||
constructor(name: string) {
|
||||
this.name = name;
|
||||
this.days = [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user