apps/recallassess/recallassess-api/src/api/client/participant/dto/participant-save.dto.ts
DTO for saving (updating) a participant Note: Email is readonly and cannot be updated Note: Department is managed through ParticipantGroupHistory
Properties |
|
| Optional department |
Type : string
|
Decorators :
@Expose()
|
| Optional first_name |
Type : string
|
Decorators :
@Expose()
|
| Optional is_active |
Type : boolean
|
Decorators :
@Expose()
|
| Optional last_name |
Type : string
|
Decorators :
@Expose()
|
import { ApiPropertyOptional } from "@nestjs/swagger";
import { IsBoolean, IsOptional, IsString, MaxLength, MinLength } from "class-validator";
import { Exclude, Expose } from "class-transformer";
/**
* DTO for saving (updating) a participant
* Note: Email is readonly and cannot be updated
* Note: Department is managed through ParticipantGroupHistory
*/
@Exclude()
export class SaveParticipantDto {
@Expose()
@ApiPropertyOptional({
description: "First name",
example: "John",
minLength: 1,
maxLength: 100,
})
@IsOptional()
@IsString()
@MinLength(1)
@MaxLength(100)
first_name?: string;
@Expose()
@ApiPropertyOptional({
description: "Last name",
example: "Smith",
minLength: 1,
maxLength: 100,
})
@IsOptional()
@IsString()
@MinLength(1)
@MaxLength(100)
last_name?: string;
// Email is readonly - removed from DTO
// @ApiPropertyOptional({
// description: "Email address",
// example: "john.smith@company.com",
// })
// @IsOptional()
// @IsEmail()
// email?: string;
// Department is managed separately through ParticipantGroupHistory
// @ApiPropertyOptional({
// description: "Department (participant group name)",
// example: "Sales Team",
// })
// @IsOptional()
// @IsString()
// department?: string;
@Expose()
@ApiPropertyOptional({
description: "Department (participant group name)",
example: "Sales Team",
})
@IsOptional()
@IsString()
department?: string;
@Expose()
@ApiPropertyOptional({
description: "Active status (true = active, false = inactive/pending)",
example: true,
})
@IsOptional()
@IsBoolean()
is_active?: boolean;
}