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

    Variable manualBankAccountViewConst

    manualBankAccountView: PgViewWithSelection<
        {
            existing: false;
            isAlias: false;
            name: "manual_bank_account_bank_account_view";
            schema: "b2b";
            selectedFields: {
                accountNumber: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                bankId: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                bankName: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                createdAt: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                credits: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    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: false;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                creditsExInternal: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    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: false;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                currency: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    SetNotNull<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: true;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                customerId: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                customerName: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                debits: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    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: false;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                debitsExInternal: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    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: false;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                deletedAt: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    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: false;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                entityId: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                entityName: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                entityType: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                firstPostedAt: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    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: false;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                id: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    SetNotNull<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: true;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                impliedBalance: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    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: false;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                impliedBalanceExInternal: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    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: false;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                key: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    SetNotNull<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: true;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                keyable: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    SetNotNull<PgBooleanBuilder>,
                    {
                        data: boolean;
                        dataType: "boolean";
                        driverParam: boolean;
                        enumValues: undefined;
                        generated: undefined;
                        hasDefault: false;
                        hasRuntimeDefault: false;
                        identity: undefined;
                        isAutoincrement: false;
                        isPrimaryKey: false;
                        name: string;
                        notNull: true;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                lastPostedAt: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    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: false;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                ledgerAccountId: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                memo: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                name: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                parentKey: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                provider: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                providerAccountId: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                routingNumber: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                searchText: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                searchTextAdmin: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                source: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    SetNotNull<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: true;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                sourceRecordId: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                status: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    SetNotNull<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: true;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                transactionCount: PgBuildColumn<
                    "manual_bank_account_bank_account_view",
                    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: false;
                        tableName: "manual_bank_account_bank_account_view";
                    },
                >;
                type: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
                updatedAt: PgBuildColumn<
                    "manual_bank_account_bank_account_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: "manual_bank_account_bank_account_view";
                    },
                >;
            };
        },
    > = ...

    The MANUAL arm of bankAccountView — accounts an operator registered, with balances implied from the bank_transaction feed.

    Anti-joined against virtual_account, which a manual registration does not outrank: it is the provider's system of record, and a hand-typed row that shadowed one would present an operator's transcription as authoritative. Victor's core accounts are rows here (provider = 'VICTOR'), so they surface through this arm. A numberless row a virtual account names (a RouteFusion wallet) is left to the VIRTUAL_ACCOUNT arm, which carries the account's numbers. The inferred arms anti-join this TABLE rather than the reverse — a human confirmation outranks an inference. See § 4.7.

    bank_name prefers the joined partner bank and falls back to the free-text column, the only name a bank with no b2b.bank row has.

    The balance lateral correlates on the account alone, never on this arm's memo, and that is deliberate rather than an oversight. A memo here is an operator's label for a slice of a shared account — not the metcap FFC key that data -> 'methodData' ->> 'ffcMemo' carries — so narrowing by it would return zero for every registration that has one. The memo still participates in key, so two memo'd registrations of one account stay distinct rows that report the same account-level balance.

    dbmate owns the DDL: the body below is mirrored by 20261017164913_bank_account_view_search_text.sql.