import { ClientActionEnum } from "../enums/client_action_enum"; import { IClientFlowConfigContextData } from "../flow-configs/client_flow.config"; import { IUserEntity } from "../interface/user.entity.interface"; import { IRowActions } from "./interface/row-actions.interface"; import { UserEntityModel } from "./user.entity.model"; import { IDtoValidationError, Result } from "../../misc"; import { DeleteDocumentDetails, DocumentFields } from "../../utils/document-validate.util"; import { ClientStatusEnum } from "../enums/client_status_enum"; import { IClientEntity } from "../interface/client.entity.interface"; import { EntityEnum, Nullable } from "../interface/entity.utils.interface"; import { RelationConfigs } from "../interface/relation-config.interface"; import { BaseEntityModel } from "./base.entity.model"; import { ClientAffiliateEntityModel } from "./client_affiliate.entity.model"; import { ClientIntroducingMappingEntityModel } from "./client_introducing_mapping.entity.model"; import { ProjectEntityModel } from "./project.entity.model"; export declare class ClientEntityModel extends BaseEntityModel implements IClientEntity { createdOn: number; updatedOn: number; id: number; name: string; primaryContactName: string; primaryContact: string; primaryEmail: string; organizationId: number; createdBy: number; updatedBy: number; secondaryContactName: Nullable; secondaryEmail: Nullable; address?: Nullable; secondaryContact: Nullable; reference?: Nullable; billingOverdueDays?: Nullable; country?: Nullable; industry?: Nullable; zipCode?: Nullable; description?: Nullable; gstNumber?: Nullable; gstDocument?: Nullable; panNumber?: Nullable; panDocument?: Nullable; tanNumber?: Nullable; tanDocument?: Nullable; vendorCode?: Nullable; status: ClientStatusEnum; projectIds?: number[]; projects: ProjectEntityModel[]; clientAffiliates: ClientAffiliateEntityModel[]; clientIntroducingMappings: ClientIntroducingMappingEntityModel[]; static readonly CLIENT_ENTITY_DOCUMENT_TYPES: readonly ["pan", "tan", "gst"]; getRelationConfigs(): any; static relationConfigs: RelationConfigs<[EntityEnum.PROJECT, EntityEnum.CLIENT_AFFILIATE, EntityEnum.CLIENT_INTRODUCING_MAPPING], EntityEnum.CLIENT>; static fromEntity(apiEntity: IClientEntity): ClientEntityModel; populateProjectIds(projects: ProjectEntityModel[]): ClientEntityModel; static isValidGST(gstNumber: string | null): boolean; static isValidPan(panNumber: string | null): boolean; static isValidTan(tanNumber: string | null): boolean; /** * Validates that for each configured document type, * a document file is present whenever the corresponding document number exists. * * This method enforces the rule: * - If `Number` is provided, then `Document` must also be provided. * * Supported document types are defined in {@link CLIENT_ENTITY_DOCUMENT_TYPES}. * The validation is generic and reusable across DTOs and entities by passing * a data object containing number/document pairs. * * @example * ```ts * ClientEntityModel.validateCombineDocumentNoDocumentFile({ * panNumber: "ABCDE1234F", * panDocument: null, // ❌ validation error * }); * ``` * * @param data - Object containing document number and document file fields * (e.g. panNumber/panDocument, gstNumber/gstDocument). * @returns Result * - Ok if validation passes * - Err with validation errors if any rule is violated */ static validateDocumentNoDocumentFile(data: DocumentFields, deleteDetails?: DeleteDocumentDetails): Result; get gstNo(): string; private get parsedAddress(); get addressLineOne(): string; get addressLineTwo(): string; get city(): string; get state(): string; getBillingsFromProfileCode(billingProfileCode?: string): import("./billing.entity.model").BillingEntityModel[]; getCreditNoteTransactions(billingProfileCode?: string): import("./billing_transaction.entity.model").BillingTransactionEntityModel[]; get debitNoteAddress(): string; getNextStatus(currentUser: IUserEntity, action: ClientActionEnum, clientFlowConfigContextData: IClientFlowConfigContextData): ClientStatusEnum; getAvailableActions(currentUser: UserEntityModel, config?: { combinedActions?: Record; customLabels?: Partial>; }): IRowActions[]; getUpdateActionVisibility(currentUser: UserEntityModel): { [key: string]: () => boolean; }; }