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

    Admin-tier CRUD over product_route.

    Identity / version split: product_route is the lifecycle row (status, priority, deletedAt). product_route_version carries the routing decision — which vendor + which matcher — plus the vendor's per-route terms (fee + limit ceilings). The vendor row carries identity only.

    Soft-delete is the terminal signal.

    Index
    db: B2bDatabase
    • Parameters

      • input: {
            data?: ProductRouteVersionData;
            effectiveFrom?: Instant;
            feeVisible?: boolean | null;
            fixedFeeAmount?: BigNumber | null;
            label?: string | null;
            limit24hMaxCount?: BigNumber | null;
            limit24hMaxUsd?: BigNumber | null;
            limit30dMaxCount?: BigNumber | null;
            limit30dMaxUsd?: BigNumber | null;
            limit7dMaxCount?: BigNumber | null;
            limit7dMaxUsd?: BigNumber | null;
            limitTransactionMaxUsd?: BigNumber | null;
            limitTransactionMinUsd?: BigNumber | null;
            matcher?: Matcher;
            productName:
                | "organization.v1"
                | "identity.v1"
                | "card.physical_card.v1"
                | "card.virtual_card.v1"
                | "deposit.us_cash.v1"
                | "deposit.rtp.v1"
                | "deposit.us_bank_ach.v1"
                | "deposit.ach_credit.v1"
                | "deposit.us_wire.v1"
                | "deposit.swift_wire.v1"
                | "transfer.redemption.v1"
                | "swap.v1"
                | "withdraw.blockchain.v1"
                | "withdraw.ke_bank.v1"
                | "withdraw.ke_momo.v1"
                | "withdraw.mx_bank_spei.v1"
                | "withdraw.swift_wire.v1"
                | "withdraw.tg_momo.v1"
                | "withdraw.us_bank_ach.v1"
                | "withdraw.us_instant.v1"
                | "withdraw.us_wire.v1"
                | "withdraw.ach_pull.v1"
                | "withdraw.us_wire_drawdown.v1"
                | "account.virtual-account.v1"
                | "deposit.*"
                | "withdraw.*";
            variableFeeBps?: BigNumber
            | null;
            vendor: Vendor;
        }
        • Optionaldata?: ProductRouteVersionData

          Per-route operational knobs (timezone, quote TTL, ...). Persisted to product_route_version.data. Defaults to {} when omitted. cutoffTimezone must be an IANA Area/Location name — see invalidCutoffTimezone.

        • OptionaleffectiveFrom?: Instant

          When this version becomes effective. Defaults to now() at the DB layer when omitted. Pass a future Temporal.Instant to schedule a route change.

        • OptionalfeeVisible?: boolean | null
        • OptionalfixedFeeAmount?: BigNumber | null

          Vendor fee for THIS route (CFX-to-vendor cost). Persisted on the version row; omitted fields default to null (no fee).

        • Optionallabel?: string | null
        • Optionallimit24hMaxCount?: BigNumber | null
        • Optionallimit24hMaxUsd?: BigNumber | null
        • Optionallimit30dMaxCount?: BigNumber | null
        • Optionallimit30dMaxUsd?: BigNumber | null
        • Optionallimit7dMaxCount?: BigNumber | null
        • Optionallimit7dMaxUsd?: BigNumber | null
        • OptionallimitTransactionMaxUsd?: BigNumber | null
        • OptionallimitTransactionMinUsd?: BigNumber | null

          Vendor limit ceilings for THIS route. Persisted on the version row; omitted fields default to null (no ceiling).

        • Optionalmatcher?: Matcher
        • productName:
              | "organization.v1"
              | "identity.v1"
              | "card.physical_card.v1"
              | "card.virtual_card.v1"
              | "deposit.us_cash.v1"
              | "deposit.rtp.v1"
              | "deposit.us_bank_ach.v1"
              | "deposit.ach_credit.v1"
              | "deposit.us_wire.v1"
              | "deposit.swift_wire.v1"
              | "transfer.redemption.v1"
              | "swap.v1"
              | "withdraw.blockchain.v1"
              | "withdraw.ke_bank.v1"
              | "withdraw.ke_momo.v1"
              | "withdraw.mx_bank_spei.v1"
              | "withdraw.swift_wire.v1"
              | "withdraw.tg_momo.v1"
              | "withdraw.us_bank_ach.v1"
              | "withdraw.us_instant.v1"
              | "withdraw.us_wire.v1"
              | "withdraw.ach_pull.v1"
              | "withdraw.us_wire_drawdown.v1"
              | "account.virtual-account.v1"
              | "deposit.*"
              | "withdraw.*"
        • OptionalvariableFeeBps?: BigNumber | null
        • vendor: Vendor

      Returns RouteWriteResult<"DUPLICATE_MATCHER">

    • Parameters

      • input: {
            bankIds?: string[];
            createdAt?: DbTimestampCriteria<Instant>;
            ids?: string[];
            orderBy?: DbOrderByCriterion<
                Omit<
                    PgTableWithColumns<
                        {
                            columns: {
                                createdAt: PgBuildColumn<
                                    "product_route",
                                    SetHasDefault<SetNotNull<(...)>>,
                                    {
                                        data: Instant;
                                        dataType: "custom";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "product_route";
                                    },
                                >;
                                currentVersionId: PgBuildColumn<
                                    "product_route",
                                    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: "product_route";
                                    },
                                >;
                                deletedAt: PgBuildColumn<
                                    "product_route",
                                    PgCustomColumnBuilder<{ data: ...; dataType: ...; driverParam: ... }>,
                                    {
                                        data: Instant;
                                        dataType: "custom";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: false;
                                        tableName: "product_route";
                                    },
                                >;
                                externalId: PgBuildColumn<
                                    "product_route",
                                    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: "product_route";
                                    },
                                >;
                                id: PgBuildColumn<
                                    "product_route",
                                    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: "product_route";
                                    },
                                >;
                                matcherHash: PgBuildColumn<
                                    "product_route",
                                    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: "product_route";
                                    },
                                >;
                                priority: PgBuildColumn<
                                    "product_route",
                                    SetHasDefault<SetNotNull<(...)>>,
                                    {
                                        data: number;
                                        dataType: "number int32";
                                        driverParam: (...) | (...);
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "product_route";
                                    },
                                >;
                                productId: PgBuildColumn<
                                    "product_route",
                                    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: "product_route";
                                    },
                                >;
                                status: PgBuildColumn<
                                    "product_route",
                                    SetHasDefault<Set$Type<(...), (...)>>,
                                    {
                                        data: (...) | (...);
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "product_route";
                                    },
                                >;
                                updatedAt: PgBuildColumn<
                                    "product_route",
                                    SetHasDefault<SetHasDefault<(...)>>,
                                    {
                                        data: Instant;
                                        dataType: "custom";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "product_route";
                                    },
                                >;
                                vendorId: PgBuildColumn<
                                    "product_route",
                                    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: "product_route";
                                    },
                                >;
                            };
                            dialect: "pg";
                            name: "product_route";
                            schema: "b2b";
                        },
                    >,
                    "enableRLS",
                >,
                "createdAt"
                | "updatedAt"
                | "priority",
            >[];
            page?: number;
            pageSize?: number;
            productNames?: (
                | "organization.v1"
                | "identity.v1"
                | "card.physical_card.v1"
                | "card.virtual_card.v1"
                | "deposit.us_cash.v1"
                | "deposit.rtp.v1"
                | "deposit.us_bank_ach.v1"
                | "deposit.ach_credit.v1"
                | "deposit.us_wire.v1"
                | "deposit.swift_wire.v1"
                | "transfer.redemption.v1"
                | "swap.v1"
                | "withdraw.blockchain.v1"
                | "withdraw.ke_bank.v1"
                | "withdraw.ke_momo.v1"
                | "withdraw.mx_bank_spei.v1"
                | "withdraw.swift_wire.v1"
                | "withdraw.tg_momo.v1"
                | "withdraw.us_bank_ach.v1"
                | "withdraw.us_instant.v1"
                | "withdraw.us_wire.v1"
                | "withdraw.ach_pull.v1"
                | "withdraw.us_wire_drawdown.v1"
                | "account.virtual-account.v1"
                | "deposit.*"
                | "withdraw.*"
            )[];
            q?: string;
            updatedAt?: DbTimestampCriteria<Instant>;
            vendors?: Vendor[];
        }
        • OptionalbankIds?: string[]
        • OptionalcreatedAt?: DbTimestampCriteria<Instant>
        • Optionalids?: string[]
        • OptionalorderBy?: DbOrderByCriterion<
              Omit<
                  PgTableWithColumns<
                      {
                          columns: {
                              createdAt: PgBuildColumn<
                                  "product_route",
                                  SetHasDefault<SetNotNull<(...)>>,
                                  {
                                      data: Instant;
                                      dataType: "custom";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: true;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "product_route";
                                  },
                              >;
                              currentVersionId: PgBuildColumn<
                                  "product_route",
                                  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: "product_route";
                                  },
                              >;
                              deletedAt: PgBuildColumn<
                                  "product_route",
                                  PgCustomColumnBuilder<{ data: ...; dataType: ...; driverParam: ... }>,
                                  {
                                      data: Instant;
                                      dataType: "custom";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: false;
                                      tableName: "product_route";
                                  },
                              >;
                              externalId: PgBuildColumn<
                                  "product_route",
                                  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: "product_route";
                                  },
                              >;
                              id: PgBuildColumn<
                                  "product_route",
                                  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: "product_route";
                                  },
                              >;
                              matcherHash: PgBuildColumn<
                                  "product_route",
                                  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: "product_route";
                                  },
                              >;
                              priority: PgBuildColumn<
                                  "product_route",
                                  SetHasDefault<SetNotNull<(...)>>,
                                  {
                                      data: number;
                                      dataType: "number int32";
                                      driverParam: (...) | (...);
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: true;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "product_route";
                                  },
                              >;
                              productId: PgBuildColumn<
                                  "product_route",
                                  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: "product_route";
                                  },
                              >;
                              status: PgBuildColumn<
                                  "product_route",
                                  SetHasDefault<Set$Type<(...), (...)>>,
                                  {
                                      data: (...) | (...);
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: true;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "product_route";
                                  },
                              >;
                              updatedAt: PgBuildColumn<
                                  "product_route",
                                  SetHasDefault<SetHasDefault<(...)>>,
                                  {
                                      data: Instant;
                                      dataType: "custom";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: true;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "product_route";
                                  },
                              >;
                              vendorId: PgBuildColumn<
                                  "product_route",
                                  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: "product_route";
                                  },
                              >;
                          };
                          dialect: "pg";
                          name: "product_route";
                          schema: "b2b";
                      },
                  >,
                  "enableRLS",
              >,
              "createdAt"
              | "updatedAt"
              | "priority",
          >[]
        • Optionalpage?: number
        • OptionalpageSize?: number
        • OptionalproductNames?: (
              | "organization.v1"
              | "identity.v1"
              | "card.physical_card.v1"
              | "card.virtual_card.v1"
              | "deposit.us_cash.v1"
              | "deposit.rtp.v1"
              | "deposit.us_bank_ach.v1"
              | "deposit.ach_credit.v1"
              | "deposit.us_wire.v1"
              | "deposit.swift_wire.v1"
              | "transfer.redemption.v1"
              | "swap.v1"
              | "withdraw.blockchain.v1"
              | "withdraw.ke_bank.v1"
              | "withdraw.ke_momo.v1"
              | "withdraw.mx_bank_spei.v1"
              | "withdraw.swift_wire.v1"
              | "withdraw.tg_momo.v1"
              | "withdraw.us_bank_ach.v1"
              | "withdraw.us_instant.v1"
              | "withdraw.us_wire.v1"
              | "withdraw.ach_pull.v1"
              | "withdraw.us_wire_drawdown.v1"
              | "account.virtual-account.v1"
              | "deposit.*"
              | "withdraw.*"
          )[]
        • Optionalq?: string

          Free-text match over the route external id, product name, vendor name, and route label — the selector search box (searchRoutes) feeds this.

        • OptionalupdatedAt?: DbTimestampCriteria<Instant>
        • Optionalvendors?: Vendor[]

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

    • Update a route. priority and status edits update the identity row in place; matcher/vendor/label/fee edits insert a new version and flip the pointer. Both can happen in the same transaction. productName is part of identity and not editable. Untouched fee fields carry forward from the previous version. Per-vendor limit ceilings aren't editable here — those live on product_vendor (use the vendor admin service).

      Parameters

      • input: {
            data: {
                effectiveFrom?: Instant;
                priority?: number;
                status?: "ACTIVE" | "DISABLED";
            } & RouteVersionFields;
            id: string;
        }

      Returns RouteWriteResult<"ROUTE_NOT_FOUND">