/** * MJR (Metales y Joyas - Precious Metals and Jewelry) Clients Resource * * Extends MexClientsResource with MJR-specific behavior. * MJR clients have the same fields as Mexico clients (no additional activity fields). * Returns MexMJRClient models. */ import type { AtomicBatchResult, ClientRelationshipType, ClientSort, CreateBankAccountInput, CreateClientInput, CreateContactMethodInput, CreateMexAddressInput, CreateMJRClientInput, LinkedClient as LinkedClientInput, ListOptions, MJRClientFilter, MJRClientSort, PaginatedResponse, PartialBatchResult, SyncCreateDocumentInput, SyncItem, SyncResult, SyncUpdateDocumentInput, UpdateBankAccountInput, UpdateClientInput, UpdateContactMethodInput, UpdateMexAddressInput, UpdateMJRClientInput, UpsertMJRClientInput, UpsertResult } from "@artu-ai/shared"; import { type ClientData, ContactMethod, Document, LinkedClient, MexAddress, MexBankAccount, MexMJRClient } from "../../../../models"; import { type ClientIncludeMap } from "../../../clients"; import type { RelatedPartyParent, RelatedPartySubresource } from "../../../related-parties/base"; import { AVClientsResource } from "../clients"; /** * MJR (Metales y Joyas) scoped clients resource. * * @example * ```typescript * const mjrSdk = new ComplianceSDK({ * apiKey, * environment: "test", * scope: "MX", * actividadVulnerable: CodigoActividad.MJR, * }); * * const client = await mjrSdk.clients.create({ * type: ClientType.Person, * name: "Juan GarcĂ­a", * rfc: "GAJL850101ABC", * }); * * // Returns MexMJRClient * ``` */ export declare class MJRClientsResource extends AVClientsResource { readonly legalRepresentatives: RelatedPartySubresource; readonly controllingBeneficiaries: RelatedPartySubresource; protected relatedPartyParent(): RelatedPartyParent; create(data: CreateMJRClientInput): Promise; retrieve(id: string, options?: { include?: ClientIncludeMap; crossScope?: boolean; }): Promise; retrieveByExternalId(externalId: string, opts?: { crossScope?: boolean; }): Promise; update(id: string, data: UpdateMJRClientInput): Promise; /** * Lists MJR clients with optional filtering. * * Accepts flattened MJR filter (MX fields at root level) and automatically * transforms to nested format before calling the API. */ list(options?: ListOptions & { includePrimaryContacts?: boolean; includeNonPrimary?: boolean; crossScope?: boolean; }): Promise>; /** * Iterates over MJR clients. * * Accepts flattened MJR filter (MX fields at root level) and automatically * transforms to nested format before calling the API. */ iterate(options?: { filter?: MJRClientFilter; sort?: MJRClientSort; pageSize?: number; crossScope?: boolean; }): AsyncGenerator; /** * Counts MJR clients matching the given filter. * * @param filter - Optional filter criteria (with MJR fields at root level) * @returns The count of matching clients */ count(filter?: MJRClientFilter, options?: { includeNonPrimary?: boolean; crossScope?: boolean; }): Promise; createMany(clients: CreateMJRClientInput[], options?: { atomic?: true; }): Promise>; createMany(clients: CreateMJRClientInput[], options: { atomic: false; }): Promise>; updateMany(updates: { id: string; data: UpdateMJRClientInput; }[], options?: { atomic?: true; }): Promise>; updateMany(updates: { id: string; data: UpdateMJRClientInput; }[], options: { atomic: false; }): Promise>; /** * Creates or updates a MJR client by externalId. * * @param data - Client upsert data with MJR fields at root level (must include externalId) * @returns The created or updated client with action indicator */ upsertByExternalId(data: UpsertMJRClientInput): Promise>; /** * Creates or updates multiple MJR clients by externalId. * * @param clients - Array of client upsert data (each must include externalId) * @param options - Batch options (atomic: true by default) * @returns Atomic result with data array, or partial result with succeeded/failed */ upsertManyByExternalId(clients: UpsertMJRClientInput[], options?: { atomic?: true; }): Promise>>; upsertManyByExternalId(clients: UpsertMJRClientInput[], options: { atomic: false; }): Promise>>; linkClient(parentClientId: string, childClientId: string, relationshipType: ClientRelationshipType, metadata?: Record): Promise; unlinkClient(parentClientId: string, childClientId: string, relationshipType: ClientRelationshipType): Promise; listLinkedClients(parentClientId: string, relationshipType?: ClientRelationshipType): Promise; setLinkedClients(parentClientId: string, linkedClients: LinkedClientInput[]): Promise; syncAll(clientId: undefined, data: { client: CreateMJRClientInput; addresses?: SyncItem[]; contactMethods?: SyncItem[]; bankAccounts?: SyncItem[]; documents?: SyncItem[]; linkedClients?: LinkedClientInput[]; }, options?: { replaceMode?: boolean; }): Promise<{ client: MexMJRClient; addresses: SyncResult; contactMethods: SyncResult; bankAccounts: SyncResult; documents: SyncResult; }>; syncAll(clientId: string, data: { client?: UpdateMJRClientInput; addresses?: SyncItem[]; contactMethods?: SyncItem[]; bankAccounts?: SyncItem[]; documents?: SyncItem[]; linkedClients?: LinkedClientInput[]; }, options: { replaceMode: true; }): Promise<{ client: MexMJRClient; addresses: SyncResult; contactMethods: SyncResult; bankAccounts: SyncResult; documents: SyncResult; }>; syncAll(clientId: string, data: { client?: UpdateMJRClientInput; addresses?: SyncItem[]; contactMethods?: SyncItem[]; bankAccounts?: SyncItem[]; documents?: SyncItem[]; linkedClients?: LinkedClientInput[]; }, options?: { replaceMode?: boolean; }): Promise<{ client: MexMJRClient; addresses: SyncResult; contactMethods: SyncResult; bankAccounts: SyncResult; documents: SyncResult; }>; /** * Transforms MJR input to nested API format. * MJR has no additional fields, but we add the MJR activity marker. */ protected transformToNested(data: CreateMJRClientInput): CreateClientInput; /** * Transforms flattened MJR update input to nested API format. * * NOTE: Always includes `actividadVulnerable: { MJR: {} }` even if no * MJR-specific fields are provided. This ensures that records touched via * the MJR SDK can be filtered by `activityCodes: { in: ["MJR"] }`. */ protected transformUpdateToNested(data: UpdateMJRClientInput): UpdateClientInput; protected instantiate(data: ClientData): MexMJRClient; /** Materializes a raw payload into a {@link MexMJRClient} (return type narrowed via the `instantiate` override). */ materialize(data: ClientData): MexMJRClient; /** * Transforms a flattened MJRClientSort to nested ClientSort format. * * Maps flattened field names to their full API paths using MJR-specific field mapping. */ protected applyScopeToSort(sort?: MJRClientSort): ClientSort | undefined; }