Jerarquía física definitiva, compatibilidades N↔N de clasificaciones, Hallazgos y campos técnicos por familia, navegación WEB/Android y APK F6 0.14.0-debug.
76 lines
1.5 KiB
TypeScript
76 lines
1.5 KiB
TypeScript
import { Transform } from 'class-transformer';
|
|
import {
|
|
ArrayMaxSize,
|
|
IsArray,
|
|
IsBoolean,
|
|
IsIn,
|
|
IsOptional,
|
|
IsString,
|
|
IsUUID,
|
|
MaxLength,
|
|
MinLength,
|
|
} from 'class-validator';
|
|
|
|
export class CreateInventoryFamilyDto {
|
|
@IsIn(['INSTALLATION', 'SUBINSTALLATION'])
|
|
level!: 'INSTALLATION' | 'SUBINSTALLATION';
|
|
|
|
@Transform(({ value }) => typeof value === 'string' ? value.trim() : value)
|
|
@IsString()
|
|
@MinLength(1)
|
|
@MaxLength(240)
|
|
name!: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@ArrayMaxSize(200)
|
|
@IsUUID('4', { each: true })
|
|
parentFamilyIds?: string[];
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@ArrayMaxSize(100)
|
|
@IsString({ each: true })
|
|
@MaxLength(160, { each: true })
|
|
informationLabels?: string[];
|
|
}
|
|
|
|
export class UpdateInventoryFamilyDto {
|
|
@IsOptional()
|
|
@Transform(({ value }) => typeof value === 'string' ? value.trim() : value)
|
|
@IsString()
|
|
@MinLength(1)
|
|
@MaxLength(240)
|
|
name?: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@ArrayMaxSize(200)
|
|
@IsUUID('4', { each: true })
|
|
parentFamilyIds?: string[];
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@ArrayMaxSize(100)
|
|
@IsString({ each: true })
|
|
@MaxLength(160, { each: true })
|
|
informationLabels?: string[];
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
isActive?: boolean;
|
|
}
|
|
|
|
export class ReplaceInventoryFamilyFindingsDto {
|
|
@IsArray()
|
|
@ArrayMaxSize(2000)
|
|
@IsUUID('4', { each: true })
|
|
itemIds!: string[];
|
|
|
|
@Transform(({ value }) => typeof value === 'string' ? value.trim() : value)
|
|
@IsString()
|
|
@MinLength(5)
|
|
@MaxLength(2000)
|
|
reason!: string;
|
|
}
|