Feat/purchase order tracking#74
Conversation
Add nullable purchase_order column (max 256 chars) to track PO identifiers from KSeF XML (NrZamowienia / DodatkowyOpis) and PDF extraction. - Migration adds purchase_order string column - Schema: field, cast, validation in changeset and edit_changeset - Parser: extract NrZamowienia with DodatkowyOpis fallback - Context: upsert replace, extraction mapping, search ILIKE Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add purchase_order to invoice_json response - Add to @create_allowed_keys and @update_allowed_keys - Add purchase_order property to Invoice, CreateInvoiceRequest, and UpdateInvoiceRequest OpenAPI schemas Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Show PO row in details table (conditional, when present) - Add PO text input to edit form Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Parser tests: NrZamowienia extraction, DodatkowyOpis fallback, nil when absent, NrZamowienia precedence, value regex - Context tests: upsert stores PO, re-sync updates PO, update_invoice_fields updates PO, search matches PO, edit_changeset validation - API tests: show/create/update include purchase_order - New XML fixtures with PO data Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The pattern "zamowienie" (nominative) doesn't match "zamowienia" (genitive) as a substring. Use "zamowien" root instead to match all declension forms. Also use word-boundary regex for "po" key to avoid false positives on keys like "pozycja". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace if/else with case pattern matching in extract_purchase_order - Narrow @po_key_substrings: remove broad "order", use "order.number" - Update list_invoices @doc to mention purchase_order in :query filter - Extract dodatkowy_opis_xml/2 test helper to DRY inline XML fixtures - Add parser tests: P.O., Purchase Order variants, unrelated DodatkowyOpis - Add LiveView tests: PO display, hidden when nil, edit form field, save Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (15)
📝 WalkthroughWalkthroughThis PR adds comprehensive support for a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Summary by CodeRabbit
New Features
Tests