import { TextObjectFilterParams, TextObjectFilterResult, } from "../../Models/TextObjectFilter.model"; import { IClientDocument } from "./Clients.Adapter.Mongoose"; export type FindClientsParams = { _id?: string; companyId?: string; email?: string; firstName?: string; lastName?: string; userId?: string; status?: boolean; }; export type DetachClientUserParams = { clientId: string; }; export type FindClientByIdParams = { id: string; companyId: string; sessionUser: string; }; export type PaginateClientsParams = FindClientsParams & { page: number; limit: number; }; export type PaginateClientsResults = { data: IClient[]; page: number; pages: number; }; export type PaginateOrganizationClientsParams = FindClientsParams & { page: number; limit: number; }; export type OrganizationClientsResults = { data: OrganizationClientView[]; page: number; pages: number; }; export type CreateClientByUserParams = { companyId: string; userId: string; sessionUser: string; }; export type CreateCustomClientParams = { companyId: string; sessionUser: string; firstName?: string; lastName?: string; phoneNumber?: string; phoneCountryCode?: string; phoneAreaCode?: string; email?: string; banned?: boolean; }; export type UpdateClientParams = CreateCustomClientParams & { id: string; }; export type DelteClientsByCompanyParams = { companyId: string; }; export type DeleteClientParams = { clientId: string; checkCashOnAccount?: boolean; sessionUser: string; }; export interface IClient { id?: string; companyId: string; userId?: string; fromClientId: string; status: boolean; firstName: string; lastName: string; phoneNumber: string; phoneCountryCode: string; phoneAreaCode: string; email: string; banned?: boolean; } export interface OrganizationClientView { id: string; firstName: string; lastName: string; fullName: string; phoneNumber: string; phoneCountryCode: string; phoneAreaCode: string; email: string; avatar: string; banned?: boolean; } export type ClientMergeParams = { fromClientId: string; toClientId: string; sessionUser: string; }; export interface IClientsAdapter { create( data: CreateClientByUserParams | CreateCustomClientParams ): Promise; delete(id: string): Promise; find(filters: FindClientsParams): Promise; findOne(filters: FindClientsParams): Promise; paginate(filters: PaginateClientsParams): Promise; detachUser(data: DetachClientUserParams): Promise; } export interface IClientsManager { clients: IClientsAdapter; createClientByUser( data: CreateClientByUserParams ): Promise; createCustomClient( data: CreateCustomClientParams ): Promise; updateClient(data: UpdateClientParams): Promise; findOrganizationClients( filters: PaginateOrganizationClientsParams ): Promise; textObjectFilter( data: TextObjectFilterParams ): Promise; findClientById(data: FindClientByIdParams): Promise; getClientWapNumber(data: IClient): Promise; getClientFullName(data: IClient): string; clientMerge(data: ClientMergeParams): Promise; deleteClientsByCompany(data: DelteClientsByCompanyParams): Promise; deleteClient(data: DeleteClientParams): Promise; }