Uploading and classifying documents
What happens when a file is added, how business scoping works, and where the five document types appear across the product.
Five document families are first-class
The repo consistently models five document types: invoice, claim, statement, supplier, and vault. Those types drive list pages, counters, routing, prompt queries, and export actions.
- Invoices: `/invoices/[tab]`
- Claims: `/claims/[tab]`
- Statements: `/statement/[tab]`
- Suppliers: `/supplier/[tab]`
- Other records: `/vault/[tab]`
Uploads are stored inside the current business scope
The upload API writes files to a business-specific storage path and creates a document record under that business. Business context is not optional; it is derived from the signed-in user permission check.
That is why the documentation should explain business selection and role scope before explaining document lists.
Document numbering is generated per business and type
The upload handler derives `kode_doc` by inspecting existing records for the same business and document type. In practice, the numbering logic is operational metadata, not a cosmetic label.
Continue with adjacent workflows
Reviewing document detail and line items
How detail view is structured, which accounting and payment fields matter, and how operators correct OCR output.
Document statuses, approvals, and archives
How list tabs and status mutations are wired, including processing, accurate, approval, and archive transitions.
Working with Vault and cross-type moves
How the Vault behaves as an operational catch-all and when moving a document type is useful.