API na nahrávání účtenek #28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Records should be enterable by piping document filenames (receipts, invoices, e-receipt photos) to a CLI script that uploads each file to Helenka and creates a draft record. Detected metadata pre-fills the record; the user completes the remaining details (event, type, tax fields) in the existing web form. Heuristics run server-side so that both the CLI and the web benefit from them and they are unit-testable without the client.
A staged flow (CLI uploads and creates drafts, web finalizes) reuses the existing RecordForm, record_detail and the bank-transaction merge flow, and follows the established pattern that machine-created entries (Fio statement import) are curated by a human.
Proposed behavior
ls receipts/*.jpg | helenka-uploaduploads each document via a token-authenticated multipart endpoint and prints the URL of the created draft record.Record.is_draftflag, default True for API-created records; cleared on first save through record_edit).Server-side changes
is_draftboolean field onRecord; overview filter for drafts. (This can be reused for bank imports as well.)Authorization: Tokencheck against a token field on the user profile; DRF not required unless already a dependency).POST /budget/api/records/draft: multipart (document file plus optional fields), validated by aDraftRecordForm(subset of RecordForm). Returns record pk and finalization URL.records/import_heuristics.pywith the detection pipeline and unit tests.Client-side changes
Out of scope
Acceptance criteria