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.

Client users and operators 8 min read

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.

Related

Continue with adjacent workflows