|
| 1 | +# TODO — known gaps & follow-ups |
| 2 | + |
| 3 | +Running list of concrete follow-ups and known gaps, complementing the high-level |
| 4 | +[Roadmap](CLAUDE.md#roadmap). Most items here were surfaced by **live-validating |
| 5 | +the SDK against the real Vendus API** — they record what is *not* yet verified or |
| 6 | +done, so nothing is silently assumed. Keep this honest: only check an item when it |
| 7 | +is actually done/verified, not just coded. |
| 8 | + |
| 9 | +## Live-validation gaps |
| 10 | + |
| 11 | +- [ ] **Run `create_credit_note` through the SDK end-to-end live in REAL mode.** It is |
| 12 | + validated by unit tests (wire body) plus a manual raw-HTTP call that succeeded |
| 13 | + (NC 01P2026/9). The SDK method has been fired live only in **test** mode, where it |
| 14 | + correctly fails (`NotFoundError`, see next item). Do one real FT/FR → |
| 15 | + `create_credit_note(...)` cycle to confirm the SDK builds a working real NC. |
| 16 | +- [x] **NC in test mode is verified impossible.** `create_credit_note` on a test-mode |
| 17 | + FT or FR fails with `NotFoundError` ("No data") because the original test document |
| 18 | + is not retrievable via `/documents/{id}`. NC only works on real, retrievable |
| 19 | + originals. (Verified live for both FT and FR.) |
| 20 | +- [ ] **Clearer error when crediting a non-retrievable original.** The GET inside |
| 21 | + `create_credit_note` raises a generic `NotFoundError`; wrap it with a hint that the |
| 22 | + original must be a real (non-test) document. Cannot distinguish "test doc" from |
| 23 | + "genuinely missing" (both 404), so keep it a hint, not a hard claim. |
| 24 | +- [ ] **Multi-line credit notes.** `document_row` is only verified for a single-line |
| 25 | + original (row=1). The builder assumes `row = 1-based position`; verify against a |
| 26 | + real multi-line invoice. |
| 27 | +- [ ] **`mode=tests` override on a `normal` register.** Unverified whether a per-request |
| 28 | + `mode=tests` produces a non-fiscal document on a register configured as `normal`. |
| 29 | + Our register is in `tests` mode, so we never exercised the override direction. |
| 30 | +- [ ] **FR payment variations.** Only validated with cash (type `NU`). Not tested: |
| 31 | + other methods (MB/MBWAY/CC…), multiple `payments`, and deferred `date_due`. |
| 32 | + |
| 33 | +## SDK gaps / decisions to revisit |
| 34 | + |
| 35 | +- [ ] **Partial credit notes.** Vendus supports crediting part of a document |
| 36 | + (`qty_nc` per line). The SDK only does **full** credit in v0.1. Add a partial API |
| 37 | + (select lines/quantities) when needed. |
| 38 | +- [ ] **`cancel` for non-FT/FR/NC types.** The SDK blocks the three fiscal types we |
| 39 | + know are non-cancellable (FT verified; FR/NC by rule). Which other types Vendus |
| 40 | + actually lets you cancel is unverified — do not expand the block list without |
| 41 | + checking. Consider also translating Vendus's "não é permitido cancelar" error as a |
| 42 | + backstop. |
| 43 | +- [ ] **`DocumentType` enum vs the authoritative `documents/types` list.** The enum |
| 44 | + still has `OR` and `RC`, which are absent from the reference list |
| 45 | + (FT/FS/NC/FR/FG/ND/GA/GD/GR/GT/DC/PF/OT/EC). The live account also returns `RG`, |
| 46 | + which is in *no* list. Decide: align the enum to the reference (likely `QUOTE` → |
| 47 | + `OT`, add the missing codes) and how to model `RG`. Unknown codes already fall back |
| 48 | + to `DocumentType.UNKNOWN`, so this is correctness/ergonomics, not a crash risk. |
| 49 | + |
| 50 | +## Robustness / correctness |
| 51 | + |
| 52 | +- [ ] **Error mapping by code, not just HTTP status.** Vendus returns HTTP 403 for some |
| 53 | + validation errors (e.g. `P001`) and 400 for others. The transport maps 403 → |
| 54 | + `AuthorizationError`, which is misleading for a field-validation error. Map known |
| 55 | + error codes (P001, A001, …) to clearer exceptions. |
| 56 | +- [ ] **Stronger non-fiscal assertion in the FR/FT integration tests.** `tax_authority_id` |
| 57 | + is empty in the POST response even for *real* fiscal documents, so it is necessary |
| 58 | + but not sufficient proof of non-fiscality. The real discriminator is the series |
| 59 | + prefix (`FT T01P…` test vs `FT 01P…` real) — consider asserting on it. |
| 60 | + |
| 61 | +## Docs |
| 62 | + |
| 63 | +- [ ] **Document `list_payment_methods` and the `Payment` model** on a dedicated docs |
| 64 | + page (currently only shown inline in the FR examples). |
| 65 | +- [ ] **Mention the cancel restriction prominently** in the getting-started flow (FT/FR |
| 66 | + can't be cancelled → credit note), not only on the per-document pages. |
0 commit comments