File

apps/recallassess/recallassess-api/src/api/client/learning-group/dto/cancel-license.dto.ts

Description

DTO for cancelling a participant license allocation

Index

Properties

Properties

Optional notes
Type : string
Decorators :
@Expose()
@ApiPropertyOptional({description: 'Additional notes about the cancellation', example: 'Employee left the company on 2025-01-15', maxLength: 500})
@IsOptional()
@IsString()
@MaxLength(500)
reason
Type : CancellationReason
Decorators :
@Expose()
@ApiProperty({description: 'Reason for cancellation', enum: CancellationReason, example: undefined})
@IsNotEmpty()
@IsEnum(CancellationReason)
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;
}

results matching ""

    No results matching ""