Spaces:
Sleeping
Sleeping
| import { | |
| IsString, | |
| IsNotEmpty, | |
| Length, | |
| Matches, | |
| IsOptional, | |
| IsInt, | |
| IsPositive, | |
| IsEnum, | |
| Min, | |
| Max, | |
| } from 'class-validator'; | |
| import { PartialType } from '@nestjs/mapped-types'; | |
| import { Type } from 'class-transformer'; | |
| import { Status } from '../enums/status.enum'; | |
| import { DegreeType } from '../enums/degree-type.enum'; | |
| export class CreateProgramDto { | |
| (() => Number) | |
| () | |
| () | |
| departmentId: number; | |
| () | |
| () | |
| (1, 100) | |
| name: string; | |
| () | |
| () | |
| (/^[A-Z0-9]{2,20}$/, { | |
| message: 'Code must be 2-20 uppercase alphanumeric characters', | |
| }) | |
| code: string; | |
| (DegreeType) | |
| degreeType: DegreeType; | |
| (() => Number) | |
| () | |
| () | |
| (1) | |
| (10) | |
| durationYears: number; | |
| () | |
| () | |
| description?: string; | |
| () | |
| (Status) | |
| status?: Status; | |
| } | |
| export class UpdateProgramDto extends PartialType(CreateProgramDto) {} | |
| export class ProgramDto { | |
| id: number; | |
| departmentId: number; | |
| name: string; | |
| code: string; | |
| degreeType: DegreeType; | |
| durationYears: number; | |
| description: string; | |
| status: Status; | |
| createdAt: Date; | |
| updatedAt: Date; | |
| departmentName?: string; | |
| campusName?: string; | |
| } | |