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

    Owns deposit-quote-search. A quote write also busts deposit-search, held as a writer-only instance because single inheritance rules out extending both.

    Hierarchy (View Summary)

    Index
    cache: ServiceCache<CachedSearchPage<DepositQuote>>
    db: B2bDatabase
    instance: (...args: []) => DepositQuoteAdminQueryService = ...

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

    • The cash quote a barcode names, read from the database. The Green Dot drain settles, voids or revives on its barcodeStatus and depositId, and a settle mints.

      Parameters

      • __namedParameters: { barcodeNumber: string }

      Returns Promise<
          {
              ok: true;
              value: | {
                  aggregateQuote?: {
                      fees: (
                          {
                              amount: BigNumber;
                              receiver: (...)
                              | (...)
                              | (...);
                              type: (...) | (...);
                          } & { currency: string }
                      )[];
                      sourceAmount: BigNumber;
                      sourceAmountAfterFees: BigNumber;
                      sourceCurrency: string;
                      targetAmount: BigNumber;
                      targetAmountAfterFees: BigNumber;
                      targetCurrency: string;
                  };
                  createdAt: Date;
                  customerId: string;
                  data?: | {
                      address?: string;
                      barcodeNumber: string;
                      barcodeStatus: | "EXPIRED"
                      | "PENDING"
                      | "DECLINED"
                      | "CANCELLED"
                      | "CONSUMED"
                      | "CREATED"
                      | "VOIDED";
                      expiresAt: string;
                      firstName: string;
                      greendotId: string
                      | null;
                      lastName: string;
                      phone?: string;
                      retailerId: string;
                      retailerName: string;
                      targetCurrency?: "MOVEUSD" | "USDC";
                      zipcode: string;
                  }
                  | {
                      ffc_memo?: string;
                      imad?: string;
                      omad?: string;
                      originating_fi?: string;
                      originator_address_line1?: string;
                      originator_address_line2?: string;
                      originator_address_line3?: string;
                      originator_info?: string;
                      sender_name?: string;
                      sending_fi?: { code: string; name: string };
                  }
                  | {
                      achBatchId?: string;
                      achId: string;
                      bankId?: string;
                      routeFusionIncomingTransferId?: string;
                      sourcePaymentInstrumentId: string;
                      speed?: string;
                      vendorId?: string;
                      victorTransactionId?: string;
                  }
                  | { providerId?: string; providerTransactionId?: string }
                  | { ffcMemo?: string }
                  | {
                      achId?: string;
                      achTraceId?: string;
                      addenda?: string;
                      companyDiscretionaryData?: string;
                      companyEntryDescription?: string;
                      companyId?: string;
                      companyName?: string;
                      effectiveEntryDate?: string;
                      ffcMemo?: string;
                      secCode?: string;
                      senderName?: string;
                      settlementDate?: string;
                      vendorId?: string;
                  }
                  | { ffcMemo?: string; senderName?: string; tchInstitutionId?: string }
                  | { ffcMemo?: string; institutionId?: string; senderName?: string }
                  | null;
                  depositId?: string;
                  deviceIpAddress: string | null;
                  deviceLocation?: { lat: number; long: number; source: "ip" };
                  entityId: string;
                  id: string;
                  metadata: {
                      brand?: string;
                      marketing?:
                          | EmptyObject
                          | {
                              fbp?: string;
                              gclid?: string;
                              sub1?: string;
                              sub2?: string;
                              sub3?: string;
                              userAgent?: string;
                              utmCampaign?: string;
                              utmContent?: string;
                              utmMedium?: string;
                              utmSource?: string;
                          };
                  };
                  productQuoteId: string;
                  quote?: {
                      fees: (
                          {
                              amount: BigNumber;
                              receiver: (...)
                              | (...)
                              | (...);
                              type: (...) | (...);
                          } & { currency: string }
                      )[];
                      sourceAmount: BigNumber;
                      sourceAmountAfterFees: BigNumber;
                      sourceCurrency: string;
                      targetAmount: BigNumber;
                      targetAmountAfterFees: BigNumber;
                      targetCurrency: string;
                  };
                  reference: string;
                  status: "ACTIVE"
                  | "EXPIRED"
                  | "ACCEPTED"
                  | "REJECTED";
                  updatedAt: Date;
                  walletAddress: Address;
                  walletBlockchain: string;
              } & { type: "CASH" } & {
                  address?: string;
                  barcodeNumber: string;
                  barcodeStatus:
                      | "EXPIRED"
                      | "PENDING"
                      | "DECLINED"
                      | "CANCELLED"
                      | "CONSUMED"
                      | "CREATED"
                      | "VOIDED";
                  expiresAt: Date;
                  firstName: string;
                  greendotId?: string
                  | null;
                  lastName: string;
                  phone?: string;
                  retailerId: string;
                  retailerName: string;
                  zipcode: string;
              }
              | null;
          },
      >

    • The cash quote while its barcode is still in one of barcodeStatuses, read from the database. For the deadline checks, which expire or void it on that status.

      Parameters

      • __namedParameters: {
            barcodeStatuses: (
                | "EXPIRED"
                | "PENDING"
                | "DECLINED"
                | "CANCELLED"
                | "CONSUMED"
                | "CREATED"
                | "VOIDED"
            )[];
            id: string;
        }

      Returns Promise<
          {
              ok: true;
              value: | {
                  aggregateQuote?: {
                      fees: (
                          {
                              amount: BigNumber;
                              receiver: (...)
                              | (...)
                              | (...);
                              type: (...) | (...);
                          } & { currency: string }
                      )[];
                      sourceAmount: BigNumber;
                      sourceAmountAfterFees: BigNumber;
                      sourceCurrency: string;
                      targetAmount: BigNumber;
                      targetAmountAfterFees: BigNumber;
                      targetCurrency: string;
                  };
                  createdAt: Date;
                  customerId: string;
                  data?: | {
                      address?: string;
                      barcodeNumber: string;
                      barcodeStatus: | "EXPIRED"
                      | "PENDING"
                      | "DECLINED"
                      | "CANCELLED"
                      | "CONSUMED"
                      | "CREATED"
                      | "VOIDED";
                      expiresAt: string;
                      firstName: string;
                      greendotId: string
                      | null;
                      lastName: string;
                      phone?: string;
                      retailerId: string;
                      retailerName: string;
                      targetCurrency?: "MOVEUSD" | "USDC";
                      zipcode: string;
                  }
                  | {
                      ffc_memo?: string;
                      imad?: string;
                      omad?: string;
                      originating_fi?: string;
                      originator_address_line1?: string;
                      originator_address_line2?: string;
                      originator_address_line3?: string;
                      originator_info?: string;
                      sender_name?: string;
                      sending_fi?: { code: string; name: string };
                  }
                  | {
                      achBatchId?: string;
                      achId: string;
                      bankId?: string;
                      routeFusionIncomingTransferId?: string;
                      sourcePaymentInstrumentId: string;
                      speed?: string;
                      vendorId?: string;
                      victorTransactionId?: string;
                  }
                  | { providerId?: string; providerTransactionId?: string }
                  | { ffcMemo?: string }
                  | {
                      achId?: string;
                      achTraceId?: string;
                      addenda?: string;
                      companyDiscretionaryData?: string;
                      companyEntryDescription?: string;
                      companyId?: string;
                      companyName?: string;
                      effectiveEntryDate?: string;
                      ffcMemo?: string;
                      secCode?: string;
                      senderName?: string;
                      settlementDate?: string;
                      vendorId?: string;
                  }
                  | { ffcMemo?: string; senderName?: string; tchInstitutionId?: string }
                  | { ffcMemo?: string; institutionId?: string; senderName?: string }
                  | null;
                  depositId?: string;
                  deviceIpAddress: string | null;
                  deviceLocation?: { lat: number; long: number; source: "ip" };
                  entityId: string;
                  id: string;
                  metadata: {
                      brand?: string;
                      marketing?:
                          | EmptyObject
                          | {
                              fbp?: string;
                              gclid?: string;
                              sub1?: string;
                              sub2?: string;
                              sub3?: string;
                              userAgent?: string;
                              utmCampaign?: string;
                              utmContent?: string;
                              utmMedium?: string;
                              utmSource?: string;
                          };
                  };
                  productQuoteId: string;
                  quote?: {
                      fees: (
                          {
                              amount: BigNumber;
                              receiver: (...)
                              | (...)
                              | (...);
                              type: (...) | (...);
                          } & { currency: string }
                      )[];
                      sourceAmount: BigNumber;
                      sourceAmountAfterFees: BigNumber;
                      sourceCurrency: string;
                      targetAmount: BigNumber;
                      targetAmountAfterFees: BigNumber;
                      targetCurrency: string;
                  };
                  reference: string;
                  status: "ACTIVE"
                  | "EXPIRED"
                  | "ACCEPTED"
                  | "REJECTED";
                  updatedAt: Date;
                  walletAddress: Address;
                  walletBlockchain: string;
              } & { type: "CASH" } & {
                  address?: string;
                  barcodeNumber: string;
                  barcodeStatus:
                      | "EXPIRED"
                      | "PENDING"
                      | "DECLINED"
                      | "CANCELLED"
                      | "CONSUMED"
                      | "CREATED"
                      | "VOIDED";
                  expiresAt: Date;
                  firstName: string;
                  greendotId?: string
                  | null;
                  lastName: string;
                  phone?: string;
                  retailerId: string;
                  retailerName: string;
                  zipcode: string;
              }
              | null;
          },
      >

    • Clear each customer's membership tag and each record tag wherever cached, and always this namespace's collection tag. keys are exact deletes in this instance's key space: the only bust a null client honours.

      Parameters

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

      Returns Promise<void>

    • 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[]