Wallet & Fintech

Withdraw limits

Daily withdraw cap blocks the next request once the rolling window is exhausted.

User story

As a compliance-aware user, I want clear feedback when I have hit my daily withdraw cap so I can plan accordingly.

Acceptance criteria

  • Withdrawals up to $5,000/day succeed
  • Beyond the cap, the API returns a 403 with reason 'limit_reached'
  • UI shows the remaining cap before the user submits
  • Retry tomorrow CTA appears in the error

Manual test steps

  1. 1.Open /wallet
  2. 2.Withdraw $4,500
  3. 3.Withdraw $700 immediately after
  4. 4.Confirm the second one fails

Expected result

Second withdraw shows 'Daily limit reached. Retry after 00:00 UTC.'

Possible bug risks

  • Window resets on the client clock instead of server time
  • Currency conversion bypasses the cap
  • Retry CTA is a real link that re-submits the same request

Reference Playwright spec

withdraw-limits.spec.ts
ts
1
2
3
4
5
6
7
8
9
10
11
12
13
import { test, expect } from '@playwright/test';

test('daily withdraw cap blocks second request @regression', async ({ page }) => {
  await page.goto('https://lab.hakdogan.com/wallet');

  await page.getByLabel(/^withdraw$/i).fill('4500');
  await page.getByRole('button', { name: /withdraw/i }).click();
  await expect(page.getByText(/posted/i).first()).toBeVisible();

  await page.getByLabel(/^withdraw$/i).fill('700');
  await page.getByRole('button', { name: /withdraw/i }).click();
  await expect(page.getByRole('alert')).toContainText(/daily limit/i);
});