Files
edr-platform/apps/edr-hr-api/src/modules/employees/dto/find-employee-profiles.dto.ts
2026-08-25 00:11:39 +03:00

62 lines
1.6 KiB
TypeScript

import { ApiPropertyOptional } from "@nestjs/swagger";
import { Transform } from "class-transformer";
import { IsBoolean, IsEnum, IsOptional, IsString, IsUUID } from "class-validator";
import { PaginationQueryDto } from "../../../common/pagination.dto";
import {
EEmploymentState,
EEmploymentType,
} from "../entities/employee-profile.entity";
export class FindEmployeeProfilesDto extends PaginationQueryDto {
@ApiPropertyOptional({
description: "Matches employee number, and IAM name / username / email.",
})
@IsOptional()
@IsString()
search?: string;
@ApiPropertyOptional({ enum: EEmploymentState })
@IsOptional()
@IsEnum(EEmploymentState)
employmentState?: EEmploymentState;
@ApiPropertyOptional({ enum: EEmploymentType })
@IsOptional()
@IsEnum(EEmploymentType)
employmentType?: EEmploymentType;
@ApiPropertyOptional({ format: "uuid" })
@IsOptional()
@IsUUID()
jobTitleId?: string;
@ApiPropertyOptional({
format: "uuid",
description:
"iam.units.id. Includes every sub-unit beneath it, so a division filter covers its departments.",
})
@IsOptional()
@IsUUID()
unitId?: string;
@ApiPropertyOptional({
description:
"true = only people with an HR profile, false = only those still to be onboarded.",
})
@IsOptional()
@Transform(({ value }) =>
value === "true" ? true : value === "false" ? false : value,
)
@IsBoolean()
onboarded?: boolean;
@ApiPropertyOptional({
format: "uuid",
description: "Direct reports of this iam.employees.id (override or hierarchy).",
})
@IsOptional()
@IsUUID()
managerEmployeeId?: string;
}