feat: add inbox-direct supplier invoice creation from inbox items (#558)
* feat: add inbox-direct supplier invoice creation from inbox items - Implemented `gnubok_create_supplier_invoice_from_inbox` tool in the MCP server for creating supplier invoices directly from inbox items. - Enhanced the input schema to include `inbox_item_id` and `document_id` for direct booking. - Added logic to validate inbox items and link documents to journal entries during the commit process. - Introduced `commitCreateSupplierInvoiceFromInbox` function to handle the creation and linking of supplier invoices. - Added unit tests to cover various scenarios including happy path, idempotency, error handling, and rollbacks. - Updated database migration to extend the `pending_operations` table to include the new operation type. * fix: extend CHECK constraint to include create_supplier_invoice_from_inbox operation * feat: add validation for financial fields in supplier invoice creation from inbox
This commit is contained in:
@@ -1445,6 +1445,8 @@ export type PendingOperationType =
|
||||
// Stream 1 Phase 1: supplier invoice lifecycle
|
||||
| 'approve_supplier_invoice'
|
||||
| 'credit_supplier_invoice'
|
||||
// Phase 5: convert an OCR'd inbox item to a leverantörsfaktura + registration JE
|
||||
| 'create_supplier_invoice_from_inbox'
|
||||
// Stream 1 Phase 1: invoice operations beyond simple create/send
|
||||
| 'credit_invoice'
|
||||
| 'convert_invoice'
|
||||
|
||||
Reference in New Issue
Block a user