TorbatYar/docs/frontend/form-patterns.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

484 B

Form Patterns

  • Library: React Hook Form + Zod + @hookform/resolvers
  • Feedback: FieldError under controls; Sonner for server errors
  • Submit: disable while mutation.isPending
  • Dirty: rely on RHF formState.isDirty for future autosave
  • Server validation: map AccountingApiError.message to toast (field mapping when backend returns field errors)

Voucher create uses useFieldArray with minimum two balanced lines (enforced by Zod + backend).