mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 22:18:12 +00:00
32 lines
1005 B
TypeScript
32 lines
1005 B
TypeScript
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { IsBoolean, IsInt, IsOptional, IsString, MaxLength, Min } from 'class-validator';
|
|
|
|
const ROLES = ['LINE_STAFF', 'DIRECTOR', 'CEO'] as const;
|
|
|
|
export class CreateApprovalRuleDto {
|
|
@ApiProperty({ description: 'True = Director+CEO chain; False = LineStaff+Director chain' })
|
|
@IsBoolean()
|
|
requiresDirectorApproval!: boolean;
|
|
|
|
@ApiProperty({ description: 'Step sequence number (1 = first, 2 = second)', minimum: 1 })
|
|
@IsInt()
|
|
@Min(1)
|
|
stepOrder!: number;
|
|
|
|
@ApiProperty({ enum: ROLES, description: 'Role required to action this step' })
|
|
@IsString()
|
|
@MaxLength(30)
|
|
requiredRole!: string;
|
|
|
|
@ApiProperty({ description: 'Label shown in UI, e.g. "Review & Approve"', maxLength: 50 })
|
|
@IsString()
|
|
@MaxLength(50)
|
|
actionLabel!: string;
|
|
|
|
@ApiPropertyOptional({ enum: ROLES, description: 'Role explicitly blocked from actioning this step' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(30)
|
|
blocksRole?: string;
|
|
}
|