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

    Selecting stranded bank_transaction rows and handing them to the reconciliation workflow.

    Reconciliation is started by whoever writes the row, so a row that was already in the table when the workflow shipped has never been offered to it — and never will be. filterAlreadySeenVictorTransactions makes the Victor sync skip rows that already exist, so re-syncing does not reach them either. This service is the only path that does.

    The admin dashboard's reconcile queue is its one caller. Selection policy, the batch cap and the per-id outcome vocabulary live here.

    Every operation is idempotent. startReconciliation re-reads each row's status first and skips the ones already RECONCILED, the workflow itself short-circuits on ALREADY_RECONCILED, and the run is keyed on the bank transaction id — so running it twice costs a read and starts nothing new.

    Index
    instance: (...args: []) => BankTransactionReconciliationBackfillService = ...

    The process service, starting runs on the queue the temporal namespace names.

    • Read b2b.bank_transaction_reconcile_queue_view.

      The two filters that justify reading the view rather than BankTransactionService.search are CustomerAttribution and feedSources: ownership lives behind the view's LATERAL join and feed_source is raw ->> 'source', and the base-table search can express neither.

      Parameters

      • input: {
            bankIds?: string[];
            customerAttribution?: CustomerAttribution;
            customerIds?: string[];
            feedSources?: NonNullable<BankTransactionRawSource | null>[];
            ids?: string[];
            orderBy?: DbOrderByCriterion<
                PgViewWithSelection<
                    {
                        existing: true;
                        isAlias: false;
                        name: "bank_transaction_reconcile_queue_view";
                        schema: "b2b";
                        selectedFields: {
                            accountName: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                PgTextBuilder<[string, ...string[]]>,
                                {
                                    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: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            accountNumber: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                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: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            accountType: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                PgTextBuilder<[string, ...string[]]>,
                                {
                                    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: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            ageDays: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                SetNotNull<PgIntegerBuilder>,
                                {
                                    data: number;
                                    dataType: "number int32";
                                    driverParam: string | number;
                                    enumValues: undefined;
                                    generated: undefined;
                                    hasDefault: false;
                                    hasRuntimeDefault: false;
                                    identity: undefined;
                                    isAutoincrement: false;
                                    isPrimaryKey: false;
                                    name: string;
                                    notNull: true;
                                    tableName: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            amount: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                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: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            bankId: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                Set$Type<SetNotNull<PgTextBuilder<(...)>>, string>,
                                {
                                    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: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            createdAt: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                SetNotNull<PgTimestampBuilder>,
                                {
                                    data: Date;
                                    dataType: "object date";
                                    driverParam: string;
                                    enumValues: undefined;
                                    generated: undefined;
                                    hasDefault: false;
                                    hasRuntimeDefault: false;
                                    identity: undefined;
                                    isAutoincrement: false;
                                    isPrimaryKey: false;
                                    name: string;
                                    notNull: true;
                                    tableName: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            customerId: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                PgTextBuilder<[string, ...string[]]>,
                                {
                                    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: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            customerName: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                PgTextBuilder<[string, ...string[]]>,
                                {
                                    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: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            description: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                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: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            entityId: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                PgTextBuilder<[string, ...string[]]>,
                                {
                                    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: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            entityName: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                PgTextBuilder<[string, ...string[]]>,
                                {
                                    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: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            feedSource: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                Set$Type<PgTextBuilder<[(...), ...(...)[]]>, BankTransactionRawSource>,
                                {
                                    data: BankTransactionRawSource;
                                    dataType: "string";
                                    driverParam: string;
                                    enumValues: undefined;
                                    generated: undefined;
                                    hasDefault: false;
                                    hasRuntimeDefault: false;
                                    identity: undefined;
                                    isAutoincrement: false;
                                    isPrimaryKey: false;
                                    name: string;
                                    notNull: false;
                                    tableName: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            id: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                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: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            ledgerAccountId: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                PgTextBuilder<[string, ...string[]]>,
                                {
                                    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: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            postedAt: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                SetNotNull<PgTimestampBuilder>,
                                {
                                    data: Date;
                                    dataType: "object date";
                                    driverParam: string;
                                    enumValues: undefined;
                                    generated: undefined;
                                    hasDefault: false;
                                    hasRuntimeDefault: false;
                                    identity: undefined;
                                    isAutoincrement: false;
                                    isPrimaryKey: false;
                                    name: string;
                                    notNull: true;
                                    tableName: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            routingNumber: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                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: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            statementDescription: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                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: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                            type: PgBuildColumn<
                                "bank_transaction_reconcile_queue_view",
                                Set$Type<SetNotNull<PgTextBuilder<(...)>>, "CREDIT" | "DEBIT">,
                                {
                                    data: "CREDIT" | "DEBIT";
                                    dataType: "string";
                                    driverParam: string;
                                    enumValues: undefined;
                                    generated: undefined;
                                    hasDefault: false;
                                    hasRuntimeDefault: false;
                                    identity: undefined;
                                    isAutoincrement: false;
                                    isPrimaryKey: false;
                                    name: string;
                                    notNull: true;
                                    tableName: "bank_transaction_reconcile_queue_view";
                                },
                            >;
                        };
                    },
                >,
                UnreconciledBankTransactionOrderField,
            >[];
            page?: number;
            pageSize?: number;
            postedAt?: DbTimestampCriteria;
            types?: ("CREDIT" | "DEBIT")[];
        } = {}
        • OptionalbankIds?: string[]
        • OptionalcustomerAttribution?: CustomerAttribution

          Defaults to "REQUIRED". See CustomerAttribution.

        • OptionalcustomerIds?: string[]
        • OptionalfeedSources?: NonNullable<BankTransactionRawSource | null>[]
        • Optionalids?: string[]
        • OptionalorderBy?: DbOrderByCriterion<
              PgViewWithSelection<
                  {
                      existing: true;
                      isAlias: false;
                      name: "bank_transaction_reconcile_queue_view";
                      schema: "b2b";
                      selectedFields: {
                          accountName: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              PgTextBuilder<[string, ...string[]]>,
                              {
                                  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: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          accountNumber: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              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: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          accountType: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              PgTextBuilder<[string, ...string[]]>,
                              {
                                  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: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          ageDays: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              SetNotNull<PgIntegerBuilder>,
                              {
                                  data: number;
                                  dataType: "number int32";
                                  driverParam: string | number;
                                  enumValues: undefined;
                                  generated: undefined;
                                  hasDefault: false;
                                  hasRuntimeDefault: false;
                                  identity: undefined;
                                  isAutoincrement: false;
                                  isPrimaryKey: false;
                                  name: string;
                                  notNull: true;
                                  tableName: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          amount: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              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: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          bankId: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              Set$Type<SetNotNull<PgTextBuilder<(...)>>, string>,
                              {
                                  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: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          createdAt: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              SetNotNull<PgTimestampBuilder>,
                              {
                                  data: Date;
                                  dataType: "object date";
                                  driverParam: string;
                                  enumValues: undefined;
                                  generated: undefined;
                                  hasDefault: false;
                                  hasRuntimeDefault: false;
                                  identity: undefined;
                                  isAutoincrement: false;
                                  isPrimaryKey: false;
                                  name: string;
                                  notNull: true;
                                  tableName: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          customerId: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              PgTextBuilder<[string, ...string[]]>,
                              {
                                  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: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          customerName: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              PgTextBuilder<[string, ...string[]]>,
                              {
                                  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: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          description: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              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: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          entityId: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              PgTextBuilder<[string, ...string[]]>,
                              {
                                  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: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          entityName: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              PgTextBuilder<[string, ...string[]]>,
                              {
                                  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: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          feedSource: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              Set$Type<PgTextBuilder<[(...), ...(...)[]]>, BankTransactionRawSource>,
                              {
                                  data: BankTransactionRawSource;
                                  dataType: "string";
                                  driverParam: string;
                                  enumValues: undefined;
                                  generated: undefined;
                                  hasDefault: false;
                                  hasRuntimeDefault: false;
                                  identity: undefined;
                                  isAutoincrement: false;
                                  isPrimaryKey: false;
                                  name: string;
                                  notNull: false;
                                  tableName: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          id: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              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: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          ledgerAccountId: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              PgTextBuilder<[string, ...string[]]>,
                              {
                                  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: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          postedAt: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              SetNotNull<PgTimestampBuilder>,
                              {
                                  data: Date;
                                  dataType: "object date";
                                  driverParam: string;
                                  enumValues: undefined;
                                  generated: undefined;
                                  hasDefault: false;
                                  hasRuntimeDefault: false;
                                  identity: undefined;
                                  isAutoincrement: false;
                                  isPrimaryKey: false;
                                  name: string;
                                  notNull: true;
                                  tableName: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          routingNumber: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              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: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          statementDescription: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              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: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                          type: PgBuildColumn<
                              "bank_transaction_reconcile_queue_view",
                              Set$Type<SetNotNull<PgTextBuilder<(...)>>, "CREDIT" | "DEBIT">,
                              {
                                  data: "CREDIT" | "DEBIT";
                                  dataType: "string";
                                  driverParam: string;
                                  enumValues: undefined;
                                  generated: undefined;
                                  hasDefault: false;
                                  hasRuntimeDefault: false;
                                  identity: undefined;
                                  isAutoincrement: false;
                                  isPrimaryKey: false;
                                  name: string;
                                  notNull: true;
                                  tableName: "bank_transaction_reconcile_queue_view";
                              },
                          >;
                      };
                  },
              >,
              UnreconciledBankTransactionOrderField,
          >[]
        • Optionalpage?: number

          1-based; defaults to 1.

        • OptionalpageSize?: number

          Defaults to 50.

        • OptionalpostedAt?: DbTimestampCriteria

          Window on when the BANK posted, not when CFX wrote the row.

        • Optionaltypes?: ("CREDIT" | "DEBIT")[]

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

    • Hand each id to the reconciliation workflow, reporting what happened to every one.

      Reads the rows' current status first rather than starting blind: a row that has since been reconciled needs no run, and an id that names nothing would start a workflow whose only possible end is a non-retryable BANK_TRANSACTION_NOT_FOUND failure sitting in the run list. Both are reported instead, as is a row on a CFX_OPERATING account, which the workflow could only mint or burn against.

      A start that throws is not caught. Temporal being unreachable is a non-functional failure, and swallowing it would report a backfill that did not happen; the whole call is safe to retry because every start is keyed on the bank transaction id.

      Parameters

      • __namedParameters: { ids: string[] }

      Returns Promise<
          | { ok: true; value: BankTransactionReconciliationBackfillReport }
          | {
              error:
                  | ServiceError<"NO_BANK_TRANSACTIONS_SELECTED">
                  | ServiceError<"TOO_MANY_BANK_TRANSACTIONS">;
              ok: false;
          },
      >