@cfxlabsinc/b2b-services
    Preparing search index...

    Links the PHONE recipients waiting on an identity's phone, for CFX's own callers.

    Hierarchy (View Summary)

    Index
    cache: ServiceCache<CachedSearchPage<PaymentInstrumentSearchItem>>
    db: B2bDatabase
    entityService: EntityService
    instance: (...args: []) => PhonePaymentInstrumentAdminService = ...

    The process default: built from each dependency's own instance().

    • Parameters

      • __namedParameters: Pick<
            {
                beneficiaryName: string
                | null;
                createdAt: Date;
                deletedAt: Date | null;
                id: string;
                linked: { entityId: string; name: string } | null;
                linkedLedgerAccountId: string | null;
                name: string;
                phone: E164Phone;
                provider:
                    | "MX_CLABE"
                    | `chn_${string}`
                    | "LEDGER_ACCOUNT"
                    | "WIRE_DEPOSIT"
                    | "ACH_PUSH_DEPOSIT"
                    | "YELLOWCARD"
                    | "QUILTT"
                    | "VICTOR"
                    | "CFX";
                providerId: string;
                referenceId?: string;
                sendEnabled: boolean;
                status: | "DELETED"
                | "PENDING_VERIFICATION"
                | "ACTION_REQUIRED"
                | "APPROVED"
                | "BLOCKED";
                statusDescription: string;
                type: "PHONE";
                typeDescription: string;
                updatedAt: Date;
            },
            "referenceId"
            | "name",
        > & { customerId: string; entityId: string; phone: string }
        • customerId: string
        • entityId: string
        • phone: string

          Any common format; one without a + is read in the owner's country.

      Returns Promise<
          | {
              ok: true;
              value: {
                  beneficiaryName: string
                  | null;
                  createdAt: Date;
                  deletedAt: Date | null;
                  id: string;
                  linked: { entityId: string; name: string } | null;
                  linkedLedgerAccountId: string | null;
                  name: string;
                  phone: E164Phone;
                  provider:
                      | "MX_CLABE"
                      | `chn_${string}`
                      | "LEDGER_ACCOUNT"
                      | "WIRE_DEPOSIT"
                      | "ACH_PUSH_DEPOSIT"
                      | "YELLOWCARD"
                      | "QUILTT"
                      | "VICTOR"
                      | "CFX";
                  providerId: string;
                  referenceId?: string;
                  sendEnabled: boolean;
                  status: | "DELETED"
                  | "PENDING_VERIFICATION"
                  | "ACTION_REQUIRED"
                  | "APPROVED"
                  | "BLOCKED";
                  statusDescription: string;
                  type: "PHONE";
                  typeDescription: string;
                  updatedAt: Date;
              };
          }
          | { error: ServiceError; ok: false },
      >

    • Also clears payment-instrument.text. Every writer busts by customer alone, which reaches no field tag, yet each write may change the text a cached transaction q page matched on.

      Parameters

      • args: {
            customerIds: readonly string[];
            keys?: readonly CacheKey[];
            records?: readonly string[];
        }

      Returns Promise<void>

    • Links the sender's instrument for phone to the claimed ledger account. The id, owner, customer and phone must all match, so an id taken from a transfer's metadata can never link another sender's instrument.

      Parameters

      • __namedParameters: {
            customerId: string;
            entityId: string;
            id: string;
            ledgerAccountId: string;
            phone: string;
        }
        • customerId: string

          The sender's customer and owner entity, from the transfer itself.

        • entityId: string
        • id: string
        • ledgerAccountId: string
        • phone: string

          The transfer's recipient phone, E.164.

      Returns Promise<
          | {
              ok: true;
              value: {
                  beneficiaryName: string
                  | null;
                  createdAt: Date;
                  deletedAt: Date | null;
                  id: string;
                  linked: { entityId: string; name: string } | null;
                  linkedLedgerAccountId: string | null;
                  name: string;
                  phone: E164Phone;
                  provider:
                      | "MX_CLABE"
                      | `chn_${string}`
                      | "LEDGER_ACCOUNT"
                      | "WIRE_DEPOSIT"
                      | "ACH_PUSH_DEPOSIT"
                      | "YELLOWCARD"
                      | "QUILTT"
                      | "VICTOR"
                      | "CFX";
                  providerId: string;
                  referenceId?: string;
                  sendEnabled: boolean;
                  status: | "DELETED"
                  | "PENDING_VERIFICATION"
                  | "ACTION_REQUIRED"
                  | "APPROVED"
                  | "BLOCKED";
                  statusDescription: string;
                  type: "PHONE";
                  typeDescription: string;
                  updatedAt: Date;
              };
          }
          | { error: ServiceError; ok: false },
      >

    • Links the PHONE instruments in customerId waiting for this identity's phone: live and unlinked, any owner. Each goes to the identity's oldest account, as create links one, in one conditional write, so a retry or a race links once and never re-points.

      Parameters

      • __namedParameters: { customerId: string; identityId: string }

      Returns Promise<{ ok: true; value: { linked: number } }>

    • Tags for a page: the scope its query searched (each customer's membership tag, else the collection tag), so an empty page is bustable too, plus the records it projects and the fields that chose or ordered its rows.

      Parameters

      • __namedParameters: {
            customerIds: readonly string[] | undefined;
            fields?: readonly string[];
            records?: readonly string[];
        }

      Returns string[]

    • Renames the recipient. The phone is immutable: a different number is a different instrument, so only name is read from data.

      Parameters

      Returns Promise<
          | { error: ServiceError; ok: false }
          | {
              ok: true;
              value: {
                  beneficiaryName: string | null;
                  createdAt: Date;
                  deletedAt: Date | null;
                  id: string;
                  linked: { entityId: string; name: string } | null;
                  linkedLedgerAccountId: string | null;
                  name: string;
                  phone: E164Phone;
                  provider:
                      | "MX_CLABE"
                      | `chn_${string}`
                      | "LEDGER_ACCOUNT"
                      | "WIRE_DEPOSIT"
                      | "ACH_PUSH_DEPOSIT"
                      | "YELLOWCARD"
                      | "QUILTT"
                      | "VICTOR"
                      | "CFX";
                  providerId: string;
                  referenceId?: string;
                  sendEnabled: boolean;
                  status: | "DELETED"
                  | "PENDING_VERIFICATION"
                  | "ACTION_REQUIRED"
                  | "APPROVED"
                  | "BLOCKED";
                  statusDescription: string;
                  type: "PHONE";
                  typeDescription: string;
                  updatedAt: Date;
              };
          },
      >