import { IEntityAuditColumn } from "../entity-audit-columns.interface"; import { IUserEntity } from "../user.entity.interface"; import { IFieldMinMaxConstraint } from "./utils"; /** * excluded, and why: * - "role", "status" enums, they carry no min/max * - "id", keyof IEntityAuditColumn generated columns * - "permissions" string[], not a column on the user table * - "tempAddressSameAsPrimary" boolean, no min/max * - "joiningDate", "endDate", "dateOfBirth" datecodes held as varchar(32); they are * flagged for an int migration rather than * bounded against a column that is the wrong * type to begin with * - the four *DocumentUrl fields url fields are bounded by max_size, * allowed_file_formats and count, not by a * character length */ export type IUserFieldLengthConstraintsExclude = "role" | "status" | "id" | "permissions" | "tempAddressSameAsPrimary" | "joiningDate" | "endDate" | "dateOfBirth" | "panDocumentUrl" | "aadharDocumentUrl" | "passportDocumentUrl" | "academicQualificationDocumentUrl" | keyof IEntityAuditColumn; /** * since some fields are optional, but we still need their * min & max length constraints, we need to make them required in this type * hence we are using -? to make all properties required in this type */ export type IUserFieldMinMaxConstraints = { [K in keyof Omit]-?: IFieldMinMaxConstraint; }; export declare const userFieldMinMaxConstraints: IUserFieldMinMaxConstraints;