Browse Source

Add tool to update account balance to MCP server

pull/8178/head
Thomas Kaul 11 hours ago
parent
commit
a9648b9029
  1. 5
      apps/api/src/app/endpoints/mcp/mcp.schemas.spec.ts
  2. 4
      apps/api/src/app/endpoints/mcp/mcp.service.spec.ts
  3. 0
      prisma/migrations/20261017000000_added_account_update_scope_to_mcp_access/migration.sql

5
apps/api/src/app/endpoints/mcp/mcp.schemas.spec.ts

@ -336,6 +336,11 @@ describe('UPDATE_ACCOUNT_BALANCE_PARAMETERS', () => {
expect(parse({ date: '2026-09-03' })).toBe(true);
});
// A user in a time zone east of UTC has already reached the next date
it('Accepts a cash balance of tomorrow in UTC', () => {
expect(parse({ date: '2026-09-04' })).toBe(true);
});
it('Accepts a negative cash balance', () => {
expect(parse({ balance: -1000 })).toBe(true);
});

4
apps/api/src/app/endpoints/mcp/mcp.service.spec.ts

@ -668,6 +668,10 @@ describe('McpService', () => {
HttpException
);
// The permission is checked first, hence the existence of the account
// stays hidden
expect(accountService.account).not.toHaveBeenCalled();
expect(
accountBalanceService.createOrUpdateAccountBalance
).not.toHaveBeenCalled();

0
prisma/migrations/20261014000000_added_account_update_scope_to_mcp_access/migration.sql → prisma/migrations/20261017000000_added_account_update_scope_to_mcp_access/migration.sql

Loading…
Cancel
Save