apps/recallassess/recallassess-api/src/api/client/learning-group/dto/cancel-license.dto.ts
DTO for cancelling a participant license allocation
Properties |
| Optional notes |
Type : string
|
Decorators :
@Expose()
|
| reason |
Type : CancellationReason
|
Decorators :
@Expose()
|
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IsEnum, IsNotEmpty, IsOptional, IsString, MaxLength } from "class-validator";
import { Exclude, Expose } from "class-transformer";
export enum CancellationReason {
EMPLOYEE_LEFT = "employee_left",
ROLE_CHANGED = "role_changed",
PERFORMANCE = "performance",
ADMIN_ERROR = "admin_error",
OTHER = "other",
}
/**
* DTO for cancelling a participant license allocation
*/
@Exclude()
export class CancelLicenseDto {
@Expose()
@ApiProperty({
description: "Reason for cancellation",
enum: CancellationReason,
example: CancellationReason.EMPLOYEE_LEFT,
})
@IsNotEmpty()
@IsEnum(CancellationReason)
reason!: CancellationReason;
@Expose()
@ApiPropertyOptional({
description: "Additional notes about the cancellation",
example: "Employee left the company on 2025-01-15",
maxLength: 500,
})
@IsOptional()
@IsString()
@MaxLength(500)
notes?: string;
}