TorbatYar/docs/frontend/frontend-api-integration.md
Mortezakoohjani 12c8615615 Ship enterprise Accounting FE/API with CRUD parity and production wiring.
Adds accounting-service PATCH/archive, fiscal helpers, COA templates and setup status, plus SuperApp Accounting UI (DS, scoreboard, masters, vouchers, ledger, ops modules) with session refresh and HTTPS public API URLs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 15:26:43 +03:30

23 lines
524 B
Markdown

# Frontend API Integration
## Client
`lib/accounting-api.ts`:
- Base URL from `NEXT_PUBLIC_ACCOUNTING_API_URL`
- Always sets `Content-Type`, `X-Tenant-ID`, Bearer token
- Throws `AccountingApiError` with backend `error.code` / `error.message`
- No mock adapters, no fake fixtures
## Env
```
NEXT_PUBLIC_ACCOUNTING_API_URL=http://localhost:8002
```
Also wired in `next.config.mjs`, `.env.example`, and `docker-compose.yml`.
## Query keys
Convention: `["accounting", tenantId, resource, ...ids]`