Müdavim (/mudavim)

House accounts (regulars): balances, collections, and charging orders to an account. Internal tab id: mudavim.

Who can open it

Barkasa and patron. Garson cannot open the tab (garson may still hit charge-account flows from an order dialog if permissions allow payment paths — account management UI is this page).

Purpose

  • List and search accounts (TR locale sorting/search)
  • Create / edit account profiles
  • Collect payments against debt
  • Inspect transaction history
  • Support charging an order to an account from Masalar (/orders/:id/charge-account/)

Key files

Area Paths
Page src/features/pos/MudavimPage.tsx
Dialogs MudavimCreateDialog.tsx, MudavimCollectDialog.tsx
POS picker Account picker components under components/pos
Lib src/lib/account.functions.ts, src/lib/accounts/*

Data & APIs

Call Role
/api/accounts/, /api/accounts/:id/ List / detail
…/update, …/collect/ Edit / collection
/api/account-transactions/ History / aggregates
Order charge-account From floor order dialog

State

  • Primarily local list/detail state on MudavimPage (not the same RQ-heavy pattern as Masalar)
  • Dialog drafts for create/edit/collect

UX details

  • Search with Turkish locale behavior
  • Balance sign/display conventions (UI may flip sign for readable debt presentation — preserve existing helper behavior when changing)
  • Create / edit / collect dialogs

Development notes

  • Keep money math in shared helpers; avoid floating UI-only rounding drift vs order payments
  • After collect or charge, invalidate related report/account queries if you wire RQ later
  • Coordinate field names with API account serializers before adding profile fields
  • Barkasa needs this tab for kasa workflows — do not patron-only lock it