Repository navigation
feat(shillinq): build purchasing-approval-delegation - #3180
Draft
rubenvdlinde wants to merge 4 commits into
Draft
rubenvdlinde wants to merge 4 commits into
rubenvdlinde wants to merge 4 commits into
Conversation
Purchase order approval moves onto OpenRegister's declared approval chain (REQ-PAD-001, tasks 1.1 and 1.3): the PurchaseOrder schema declares the purchase-order-approval chain with cumulative tiers on totalExclVat, and the in-object chain, its service, controller, route, MCP tool and guard are retired. Sending waits for statusCode approved; the preview reads the schema tiers; a repair step clears the undeclared pending_approval state. Assisted-by: ClaudeCode:claude-opus-5-5
The purchase order page shows its OpenRegister approval steps in an Approval sidebar tab through the shared tasks widget, so a user who may decide a step approves it there (REQ-PAD-001, task 1.2). Assisted-by: ClaudeCode:claude-opus-5-5
A matched supplier invoice from EUR 10.000 waits for a controller step of the declared supplier-invoice-approval chain on approveMatched, shown in an Approval tab on the invoice page (REQ-PAD-004, part of task 1.4). The tasks file names what is left and why. Assisted-by: ClaudeCode:claude-opus-5-5
Task 1.4: the three-way matching engine hands every matched supplier invoice to its approveMatched transition and lets OpenRegister's supplier-invoice-approval chain decide. Below the controller tier the match approves the invoice; from EUR 10.000 the write is refused as approval-chain-pending and the invoice stays matched until the controller approves. SchemaRecordStore keeps the cause of a failed save so that refusal can be told apart from a storage failure. Adds ThreeWayMatchingEngineApprovalHandOverTest and the Playwright spec for tasks 1.2, 1.4 and (fixme) 2.1; existing engine tests and the golden record now expect the approved transition after matched. Assisted-by: ClaudeCode:claude-opus-5-5
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds
openspec/changes/purchasing-approval-delegation(continuation of the earlier partial pass).Tasks done
x-openregister-approval-chainspurchase-order-approvalonPurchaseOrder.approve: cumulative tiers ontotalExclVat(cents) — teamleider from 1 cent, facility_manager from EUR 10,000, procurement_manager from EUR 50,000 — with separation of duties andadvanceTransition. The three roles map toshillinq_teamleider,shillinq_facility_managerandshillinq_procurement_managerinauthorization.roles(the same way the commitment chain maps its roles). The order record now storestotalExclVat, so the chain has an amount to route on.taskswidget over the order's OpenRegister flow tasks (role, state, handler, deadline; outcomes offered to who may decide). Manifest configuration only.supplier-invoice-approvalchain onSupplierInvoice.approveMatched(controller from EUR 10,000 incl. VAT) and the same Approval tab on the invoice page.PurchaseOrderApprovalService(+ interface),PurchaseOrderApprovalController, routepurchaseOrderApproval#decide, MCP toolshillinq.purchase_order.decide,PurchaseOrderApprovalGuard(no longer onapprove),PurchaseOrderApprovalEntry, theApprovalDecisionvalue objects and thedelegatedenum value.blockSendUntilApproved()→markSent(), which waits forstatusCodeapproved.previewApprovalChain()reads the schema tiers through the newPurchaseOrderApprovalTiers.PurchaseOrderDecisionLockListenernow refuses any user write that adds or changes theapprovalChainhistory (stricter than before: no grant opens it any more). New repair stepResetPendingApprovalPurchaseOrdersdrops the undeclaredlifecycleState: pending_approval.Tasks left, and why
Commitment, hydra gates): need an instance.ThreeWayMatchingEnginefires no SupplierInvoice transition today, so handing matched invoices toapproveMatchedis new engine behaviour still to build.delegateverb with mandate andon_behalf_of, but the sharedtaskswidget in @conduction/nextcloud-vue has no delegate action; it belongs there.check:manifest-budgetalready fails on development (1,340,650 B vs 1,316,700 B); these two tabs add about 1.7 KB. One vitest failure (dunningNextRun.spec.js) is red on development too.Tests
PurchaseOrderApprovalChainFragmentTest,PurchaseOrderApprovalTiersTest,ResetPendingApprovalPurchaseOrdersTest; rewrote the purchase order service, controller, integration, register-schema, audit-trail, guard and MCP provider tests onto the new path; removed the tests of the retired classes.Generated by Claude Code