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

    Hierarchy (View Summary)

    Index
    db: B2bDatabase
    • Parameters

      • args: {
            data?: Omit<
                { idempotencyKey?: string } & (
                    | {
                        merchantId?: string;
                        retailChain?: string;
                        retailerName?: string;
                        storeAddress1?: string;
                        storeAddress2?: string;
                        storeCity?: string;
                        storeCounty?: string;
                        storeLatitude?: string;
                        storeLongitude?: string;
                        storeName?: string;
                        storeNumber?: string;
                        storeState?: string;
                        storeTransactionDate?: string;
                        storeZipcode?: string;
                        type: "CASH";
                    }
                    | { type: "US_WIRE" }
                    | { type: "SWIFT_WIRE" }
                    | { type: "US_BANK_ACH" }
                    | { type: "RTP" }
                    | { type: "ACH_CREDIT" }
                ),
                "idempotencyKey",
            >;
            idempotencyKey: string;
            quoteId: string;
            reviveCancelled?: boolean;
            tx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>;
        }
        • Optionaldata?: Omit<
              { idempotencyKey?: string } & (
                  | {
                      merchantId?: string;
                      retailChain?: string;
                      retailerName?: string;
                      storeAddress1?: string;
                      storeAddress2?: string;
                      storeCity?: string;
                      storeCounty?: string;
                      storeLatitude?: string;
                      storeLongitude?: string;
                      storeName?: string;
                      storeNumber?: string;
                      storeState?: string;
                      storeTransactionDate?: string;
                      storeZipcode?: string;
                      type: "CASH";
                  }
                  | { type: "US_WIRE" }
                  | { type: "SWIFT_WIRE" }
                  | { type: "US_BANK_ACH" }
                  | { type: "RTP" }
                  | { type: "ACH_CREDIT" }
              ),
              "idempotencyKey",
          >
        • idempotencyKey: string
        • quoteId: string
        • OptionalreviveCancelled?: boolean

          Treat this call as a re-authorisation: if the key already resolves to a CANCELLED deposit, bring it back to PENDING rather than returning the terminal row.

          Only the Green Dot AUTH path sets this. A void at the register is reversible — Green Dot returns the barcode to NEW, so the same barcode can be authorised again, under the same key (the deposit quote's id, which does not change between attempts). Without this, AUTH_VOID's cancellation stands while the barcode goes back to PENDING, and cashDepositWorkflow settles the deposit straight out of CANCELLED — which reaches the integrator as a statusUpdated CANCELLED webhook for a deposit that then completes.

          Off by default: on every other rail a cancelled deposit is terminal, and a replayed create under the same key must not resurrect it.

        • Optionaltx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>

      Returns Promise<Deposit>

    • Get a deposit by ID without customer restriction

      Parameters

      • __namedParameters: {
            id: string;
            includeHistory?: boolean;
            tx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>;
        }

      Returns Promise<{ ok: true; value: Deposit | null }>

    • Admin search for deposits without customer restriction

      Parameters

      • __namedParameters: {
            achBatchId?: string;
            createdAt?: DbTimestampCriteria;
            customerId?: string;
            entityIds?: string[];
            ids?: string[];
            includeHistory?: boolean;
            orderBy?: DbOrderByCriterion<
                Omit<
                    PgTableWithColumns<
                        {
                            columns: {
                                amount: PgBuildColumn<
                                    "deposit",
                                    SetNotNull<PgNumericBuilder>,
                                    {
                                        data: string;
                                        dataType: "string numeric";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "deposit";
                                    },
                                >;
                                createdAt: PgBuildColumn<
                                    "deposit",
                                    SetHasDefault<SetNotNull<(...)>>,
                                    {
                                        data: Date;
                                        dataType: "object date";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "deposit";
                                    },
                                >;
                                currency: PgBuildColumn<
                                    "deposit",
                                    SetNotNull<PgTextBuilder<(...)>>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "deposit";
                                    },
                                >;
                                customerId: PgBuildColumn<
                                    "deposit",
                                    SetNotNull<PgIntegerBuilder>,
                                    {
                                        data: number;
                                        dataType: "number int32";
                                        driverParam: (...) | (...);
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "deposit";
                                    },
                                >;
                                data: PgBuildColumn<
                                    "deposit",
                                    Set$Type<SetNotNull<(...)>, (...) & (...)>,
                                    {
                                        data: (...) & (...);
                                        dataType: "object json";
                                        driverParam: unknown;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "deposit";
                                    },
                                >;
                                depositQuoteId: PgBuildColumn<
                                    "deposit",
                                    SetNotNull<PgIntegerBuilder>,
                                    {
                                        data: number;
                                        dataType: "number int32";
                                        driverParam: (...) | (...);
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "deposit";
                                    },
                                >;
                                externalId: PgBuildColumn<
                                    "deposit",
                                    SetHasRuntimeDefault<SetNotNull<(...)>>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "deposit";
                                    },
                                >;
                                feeSweepTxId: PgBuildColumn<
                                    "deposit",
                                    PgTextBuilder<[(...), ...(...)[]]>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: false;
                                        tableName: "deposit";
                                    },
                                >;
                                feeSweepTxType: PgBuildColumn<
                                    "deposit",
                                    Set$Type<PgTextBuilder<(...)>, "SOLANA_TRANSACTION_SIGNATURE">,
                                    {
                                        data: "SOLANA_TRANSACTION_SIGNATURE";
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: false;
                                        tableName: "deposit";
                                    },
                                >;
                                id: PgBuildColumn<
                                    "deposit",
                                    HasIdentity<SetIsPrimaryKey<(...)>, "byDefault">,
                                    {
                                        data: number;
                                        dataType: "number int32";
                                        driverParam: (...) | (...);
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: "byDefault";
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "deposit";
                                    },
                                >;
                                ledgerAccountId: PgBuildColumn<
                                    "deposit",
                                    PgIntegerBuilder,
                                    {
                                        data: number;
                                        dataType: "number int32";
                                        driverParam: (...)
                                        | (...);
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: false;
                                        tableName: "deposit";
                                    },
                                >;
                                receiptId: PgBuildColumn<
                                    "deposit",
                                    PgTextBuilder<[(...), ...(...)[]]>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: false;
                                        tableName: "deposit";
                                    },
                                >;
                                receiptType: PgBuildColumn<
                                    "deposit",
                                    Set$Type<PgTextBuilder<(...)>, (...) | (...)>,
                                    {
                                        data: (...) | (...);
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: false;
                                        tableName: "deposit";
                                    },
                                >;
                                status: PgBuildColumn<
                                    "deposit",
                                    SetHasDefault<SetNotNull<(...)>>,
                                    {
                                        data: (...) | (...) | (...) | (...);
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "deposit";
                                    },
                                >;
                                updatedAt: PgBuildColumn<
                                    "deposit",
                                    SetHasDefault<SetHasDefault<(...)>>,
                                    {
                                        data: Date;
                                        dataType: "object date";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "deposit";
                                    },
                                >;
                            };
                            dialect: "pg";
                            name: "deposit";
                            schema: "b2b";
                        },
                    >,
                    "enableRLS",
                >,
                "createdAt"
                | "updatedAt",
            >[];
            page?: number;
            pageSize?: number;
            statuses?: ("PENDING" | "CANCELLED" | "DEPOSITED" | "PROCESSING")[];
            tx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>;
            types?: (
                | "US_WIRE"
                | "SWIFT_WIRE"
                | "CASH"
                | "US_BANK_ACH"
                | "RTP"
                | "ACH_CREDIT"
            )[];
            updatedAt?: DbTimestampCriteria;
        }

      Returns Promise<
          {
              ok: true;
              value: { hasNext: boolean; items: Deposit[]; total: number };
          },
      >

    • Parameters

      • args: {
            data: {
                feeSweepTxId?: string | null;
                feeSweepTxType?: "SOLANA_TRANSACTION_SIGNATURE" | null;
                receiptId?: string | null;
                receiptType?: "SOLANA_TRANSACTION_SIGNATURE" | null;
                status?: "PENDING" | "CANCELLED" | "DEPOSITED" | "PROCESSING";
                storeData?: Partial<
                    Omit<
                        { idempotencyKey?: string } & {
                            merchantId?: string;
                            retailChain?: string;
                            retailerName?: string;
                            storeAddress1?: string;
                            storeAddress2?: string;
                            storeCity?: string;
                            storeCounty?: string;
                            storeLatitude?: string;
                            storeLongitude?: string;
                            storeName?: string;
                            storeNumber?: string;
                            storeState?: string;
                            storeTransactionDate?: string;
                            storeZipcode?: string;
                            type: "CASH";
                        },
                        "idempotencyKey"
                        | "type",
                    >,
                >;
            };
            id: string;
            reason?: string;
        }
        • data: {
              feeSweepTxId?: string | null;
              feeSweepTxType?: "SOLANA_TRANSACTION_SIGNATURE" | null;
              receiptId?: string | null;
              receiptType?: "SOLANA_TRANSACTION_SIGNATURE" | null;
              status?: "PENDING" | "CANCELLED" | "DEPOSITED" | "PROCESSING";
              storeData?: Partial<
                  Omit<
                      { idempotencyKey?: string } & {
                          merchantId?: string;
                          retailChain?: string;
                          retailerName?: string;
                          storeAddress1?: string;
                          storeAddress2?: string;
                          storeCity?: string;
                          storeCounty?: string;
                          storeLatitude?: string;
                          storeLongitude?: string;
                          storeName?: string;
                          storeNumber?: string;
                          storeState?: string;
                          storeTransactionDate?: string;
                          storeZipcode?: string;
                          type: "CASH";
                      },
                      "idempotencyKey"
                      | "type",
                  >,
              >;
          }
        • id: string
        • Optionalreason?: string

          Operator-entered reason, recorded on the status transition.

      Returns Promise<void>