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

    Variable ledgerAccountWithdrawalTransactionViewConst

    ledgerAccountWithdrawalTransactionView: PgViewWithSelection<
        {
            existing: false;
            isAlias: false;
            name: "ledger_account_withdrawal_transaction_view";
            schema: "b2b";
            selectedFields: {
                accountId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                accountName: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                accountRef: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                amount: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                bankId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                bankName: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                bankTransactionId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                cardFirstName: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                cardId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                cardLabel: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                cardLast4: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                cardLastName: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                cardMerchantName: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                cardTransactionType: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                commitExternalId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                commitTxId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                counterpartyAddress: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                counterpartyCustomerId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                counterpartyCustomerName: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                counterpartyDescription: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                counterpartyIdentityId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                counterpartyLedgerAccountId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                counterpartyName: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                counterpartyOrganizationId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                counterpartyPhone: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                counterpartyWalletAddress: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                createdAt: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                currency: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                customerId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                customerName: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                dataSource: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                description: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                deviceLat: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                deviceLong: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                entityEmail: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                entityId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                entityName: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                entityType: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                entityTypeDescription: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                failureReason: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                fees: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                id: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                impliedRate: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                key: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                method: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                methodColumnLabel: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                methodDescription: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                organizationId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                outcome: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                paymentInstrumentId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                personId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                postBalance: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                preBalance: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                productQuoteId: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                railFamily: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                rewardKind: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                searchText: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                signature: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                signedAmount: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                sourceAmount: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                sourceCurrency: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                status: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                statusDescription: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                subType: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                subTypeDescription: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                targetAmount: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                targetCurrency: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                type: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                typeDescription: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                updatedAt: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
                walletAddress: PgBuildColumn<
                    "ledger_account_withdrawal_transaction_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: "ledger_account_withdrawal_transaction_view";
                    },
                >;
            };
        },
    > = ...

    The backstop arm: a ledger_account_withdrawal that no other arm represents.

    Four producers write this table, and three of them are already on transaction_view through some other arm:

    • the blockchain and self-custody withdrawal activities set withdrawal_id, and the withdrawal arm's own wd_ row IS that movement;
    • a reward claim's payout is the reward arm's CLEARING sub-arm (and its RETURN when voided), joined on idempotency_key = reward_claim.external_id.

    The fourth has no representation at all: rows minted with neither a parent withdrawal nor a claim, by Interval's "Create New Ledger Account Withdrawal" and by the admin dashboard's own createLedgerAccountWithdrawal server action. Those reach no view, so they are invisible on /transactions and unsearchable by their redwd_ id — real money out with no read-model row.

    Hence more than one exclusion. Guarding only on the parent withdrawal would emit a SECOND row for every reward payout: those rows carry no withdrawalId either, so they satisfy that guard, and the reward arm has already emitted them under a rew_ id. Different keys, so nothing would dedupe the pair.

    Both parent guards test the row itself (withdrawal_id IS NULL, data ? 'rewardClaimId'), backed by a partial index carrying the same predicate, so ownership needs no join. It replaced reading ownership off idempotency_key, whose value is the result of a precedence rule rather than a declared relationship.

    The third exclusion, the reward_claim anti-join, is the ROLLOUT guard rather than part of the contract. A payout created between the migration applying and the writer shipping carries neither key, and would otherwise be double-counted against the reward arm forever. It is retirable once no such row can exist.

    One row per withdrawal, not two. A VOIDED row reads RETURNED on its own debit rather than growing a paired credit — this arm exists so the movement is visible and searchable, and the rows it covers are operator-initiated one-offs rather than a rail with a settlement lifecycle to reconstruct.

    securityInvoker is required, not cosmetic: every underlying table has RLS enabled, and without it the view runs with the owner's row visibility and silently bypasses the querying role's policies.