diff --git a/packages/backend/src/accounting/psql/ledger-transfer/index.test.ts b/packages/backend/src/accounting/psql/ledger-transfer/index.test.ts index 239ada549d..4a75ce60cc 100644 --- a/packages/backend/src/accounting/psql/ledger-transfer/index.test.ts +++ b/packages/backend/src/accounting/psql/ledger-transfer/index.test.ts @@ -261,7 +261,7 @@ describe('Ledger Transfer', (): void => { const accountTransfers = await getAccountTransfers( serviceDeps, account.id, - 100_000, + 20, knex ) diff --git a/packages/backend/src/accounting/psql/ledger-transfer/index.ts b/packages/backend/src/accounting/psql/ledger-transfer/index.ts index 77f0227a8a..3c9cc119a7 100644 --- a/packages/backend/src/accounting/psql/ledger-transfer/index.ts +++ b/packages/backend/src/accounting/psql/ledger-transfer/index.ts @@ -39,7 +39,7 @@ export type CreateLedgerTransferArgs = Pick< export async function getAccountTransfers( deps: ServiceDependencies, id: string | number, - limit?: number, + limit: number = 20, trx?: TransactionOrKnex ): Promise { const builder = LedgerTransfer.query(trx || deps.knex) diff --git a/packages/backend/src/accounting/tigerbeetle/transfers.ts b/packages/backend/src/accounting/tigerbeetle/transfers.ts index 8b28465786..dd4da05636 100644 --- a/packages/backend/src/accounting/tigerbeetle/transfers.ts +++ b/packages/backend/src/accounting/tigerbeetle/transfers.ts @@ -170,14 +170,14 @@ export async function createTransfers( export async function getAccountTransfers( deps: ServiceDependencies, id: string | number, - limit: number = 100_000 + limit: number = 20 ): Promise { const account_id = toTigerBeetleId(id) const filter: AccountFilter = { account_id, timestamp_min: 0n, timestamp_max: 0n, - limit, //100_000 is the default limit for TB. + limit, flags: AccountFilterFlags.credits | AccountFilterFlags.debits } const tbAccountTransfers: TbTransfer[] = diff --git a/packages/backend/src/graphql/generated/graphql.schema.json b/packages/backend/src/graphql/generated/graphql.schema.json index f0a9d3f643..a4fa9fb362 100644 --- a/packages/backend/src/graphql/generated/graphql.schema.json +++ b/packages/backend/src/graphql/generated/graphql.schema.json @@ -6163,7 +6163,7 @@ }, { "name": "limit", - "description": "Limit the number of results returned. If no limit is provided, the default limit of 100,000 is set for TigerBeetle.", + "description": "Limit the number of results returned. If no limit is provided, the default limit is 20.", "type": { "kind": "SCALAR", "name": "Int", diff --git a/packages/backend/src/graphql/resolvers/accounting_transfer.psql.test.ts b/packages/backend/src/graphql/resolvers/accounting_transfer.psql.test.ts index 3725ebee1d..6be3b65e3c 100644 --- a/packages/backend/src/graphql/resolvers/accounting_transfer.psql.test.ts +++ b/packages/backend/src/graphql/resolvers/accounting_transfer.psql.test.ts @@ -99,7 +99,7 @@ describe('Accounting Transfer', (): void => { // Top up debit account first: const transferAmount = 123 const ledger = 1 - const queryLimit = 100_000 + const queryLimit = 20 const insertedTransfer = await createLedgerTransfer( { diff --git a/packages/backend/src/graphql/resolvers/accounting_transfer.tigerbeetle.test.ts b/packages/backend/src/graphql/resolvers/accounting_transfer.tigerbeetle.test.ts index 65f6fc2d1c..94d7e81540 100644 --- a/packages/backend/src/graphql/resolvers/accounting_transfer.tigerbeetle.test.ts +++ b/packages/backend/src/graphql/resolvers/accounting_transfer.tigerbeetle.test.ts @@ -73,7 +73,7 @@ describe('TigerBeetle: Accounting Transfer', (): void => { // Top up debit account first: const transferAmount = 123 - const queryLimit = 100_000 + const queryLimit = 20 const depositId = uuid() const insertedTransfer = await accountingService.createDeposit({ id: depositId, diff --git a/packages/backend/src/graphql/schema.graphql b/packages/backend/src/graphql/schema.graphql index a41dcd85ac..ef622b214d 100644 --- a/packages/backend/src/graphql/schema.graphql +++ b/packages/backend/src/graphql/schema.graphql @@ -139,7 +139,7 @@ type Query { accountingTransfers( "Unique identifier of the account." id: String! - "Limit the number of results returned. If no limit is provided, the default limit of 100,000 is set for TigerBeetle." + "Limit the number of results returned. If no limit is provided, the default limit is 20." limit: Int ): AccountingTransferConnection!