This commit is contained in:
2026-11-02 20:29:34 +02:00
parent 340f3bb5fa
commit fcf31e8d48
181 changed files with 33383 additions and 51 deletions
+64
View File
@@ -0,0 +1,64 @@
{
"schema_version": 1,
"id": "SGF-MODULE-FLOW-PREPARATION-v1",
"status": "preparation_only",
"date": "2026-11-02",
"modules": ["commercial", "purchasing", "stock", "workshop", "finance", "accounting"],
"first_increment": "SGF-STOCK-READ-SIM-v1",
"evidence_contract": {
"required": ["tenant_id", "company_id", "unit_scope", "actor_id", "source_system", "source_kind", "source_id", "source_version", "source_hash", "effect_kind", "decision_id", "decided_at", "reason", "idempotency_key", "correlation_id", "permission_scope", "before", "after"],
"optional_by_effect": ["warehouse_id", "stock_item_id", "quantity_milli", "quantity_unit", "currency", "amount_exact", "rounding_policy", "verified_by", "evidence_references", "due_date", "pending_reason"],
"source_evidence_required": true,
"runtime_implemented": false,
"unknown_is_zero": false,
"automatic_dependency_association": false,
"new_global_event_bus": false
},
"stages": [
{"id": "requisition_order", "owner": "purchasing", "effect": "approved_procurement_origin", "state": "partial_synthetic", "source_ids": ["requisitions_delivery"], "requires": [], "exit_evidence": ["approved_origin_version", "budget_receipt_when_applicable"], "gap": "Only basic requisitions demonstrated in 8039; full procurement composition not transferred."},
{"id": "accepted_receipt", "owner": "purchasing", "effect": "accepted_physical_receipt", "state": "source_not_integrated", "source_ids": ["receipt_workflow"], "requires": ["requisition_order"], "exit_evidence": ["receipt_id_version", "accepted_quantities", "quality_decision", "warehouse_mapping"], "gap": "No common SGF receipt/stock adapter demonstrated."},
{"id": "physical_stock", "owner": "stock", "effect": "physical_movement_once", "state": "source_not_integrated", "source_ids": ["stock_workflow", "stock_controller", "inventory_lots", "inventory_counts", "inventory_dispositions", "inventory_reversals", "warehouse_reservations", "stock_menu"], "requires": ["accepted_receipt"], "exit_evidence": ["movement_origin", "quantity_unit", "ledger_revision", "receipt_or_compensation"], "gap": "Common scoped reader, authoritative writer and SGF warehouse mapping pending."},
{"id": "supplier_invoice", "owner": "purchasing", "effect": "verified_supplier_document", "state": "partial_synthetic", "source_ids": ["invoice_workflow", "supplier_adapter"], "requires": ["requisition_order"], "exit_evidence": ["invoice_snapshot", "independent_review", "accepted_receipt_references_when_required"], "gap": "Does not assume every purchase is stock; existing eligibility/partial receipt rules must be preserved."},
{"id": "supplier_payable", "owner": "finance", "effect": "supplier_obligation_once", "state": "partial_synthetic", "source_ids": ["payables", "supplier_adapter"], "requires": ["supplier_invoice"], "exit_evidence": ["obligation_receipt", "principal_currency", "history_responsibility", "due_date_or_pending_reason"], "gap": "Synthetic core exists; common operational composition and historical source mapping remain delimited."},
{"id": "supplier_settlement", "owner": "finance", "effect": "confirmed_allocation_once", "state": "partial_synthetic", "source_ids": ["settlements", "settlement_delivery"], "requires": ["supplier_payable"], "exit_evidence": ["confirmed_payment_evidence", "distinct_confirmation", "allocation_receipt", "remaining_balance"], "gap": "Synthetic payments/allocations exist; no bank execution or complete bank reconciliation delivered."},
{"id": "workshop_execution", "owner": "workshop", "effect": "verified_work_record", "state": "partial_synthetic", "source_ids": ["workshop_workflow"], "requires": [], "exit_evidence": ["authorised_order", "verified_time_material_versions", "ownership_of_material"], "gap": "Verified observations exist; no automatic physical stock movement."},
{"id": "workshop_stock_consumption", "owner": "stock", "effect": "company_material_consumption_once", "state": "planned", "source_ids": ["stock_workflow", "workshop_workflow"], "requires": ["physical_stock", "workshop_execution"], "exit_evidence": ["explicit_item_warehouse_mapping", "movement_receipt", "consumption_origin_version"], "gap": "Linking observed material to a physical movement is not implemented; do not replay old observations."},
{"id": "verified_cost", "owner": "finance", "effect": "validated_cost_version", "state": "partial_synthetic", "source_ids": ["direct_costs", "industrial_costs"], "requires": ["workshop_execution"], "exit_evidence": ["verified_source_versions", "approved_rate_versions", "complete_or_explicitly_incomplete"], "gap": "Current costs are synthetic; physical movement linkage is future and absence of rate stays visible."},
{"id": "sales_draft", "owner": "commercial", "effect": "commercial_draft_from_unique_origins", "state": "partial_synthetic", "source_ids": ["workshop_billing"], "requires": ["workshop_execution"], "exit_evidence": ["billable_source_versions", "commercial_price_version", "distinct_commercial_review"], "gap": "Draft integration exists; cost is not sale price and draft does not decrement stock."},
{"id": "sales_invoice", "owner": "commercial", "effect": "issued_sales_document", "state": "partial_synthetic", "source_ids": ["service_invoicing"], "requires": ["sales_draft"], "exit_evidence": ["document_snapshot", "series_rule_version", "applicable_fiscal_decisions"], "gap": "Test issuance exists; real fiscal issuance remains guarded. Direct service origins remain valid."},
{"id": "customer_receivable", "owner": "finance", "effect": "customer_receipt_allocation_once", "state": "partial_synthetic", "source_ids": ["service_receivables"], "requires": ["sales_invoice"], "exit_evidence": ["receivable_origin", "payment_evidence", "distinct_confirmation", "allocation_history"], "gap": "Synthetic receipts exist; fiscal receipt/bank reconciliation not presumed."},
{"id": "general_ledger", "owner": "accounting", "effect": "balanced_journal_once", "state": "planned", "source_ids": ["catalogue_accounting", "accounting_menu"], "requires": [], "exit_evidence": ["approved_source_effect", "dated_account_mapping", "balanced_debit_credit", "open_accounting_period", "posting_receipt"], "gap": "Classification/menu exist; journal, ledger, accounting periods, close and reporting engine absent."}
],
"event_consumers": [
{"source": "supplier_payable", "target": "general_ledger", "status": "planned", "rule": "Accounting recognition eligibility must be delimited; never also book the same invoice through another competing writer."},
{"source": "supplier_settlement", "target": "general_ledger", "status": "planned", "rule": "Settlement is a separate effect, not another recognition of principal."},
{"source": "sales_invoice", "target": "general_ledger", "status": "planned", "rule": "Sales recognition and applicable tax rules require explicit scope; draft is insufficient."},
{"source": "customer_receivable", "target": "general_ledger", "status": "planned", "rule": "Receipt/allocation is distinct from revenue recognition."},
{"source": "physical_stock", "target": "general_ledger", "status": "planned", "rule": "Quantity alone is not valuation or an approved accounting entry."}
],
"sources": [
{"id": "requisitions_delivery", "repository": "sgf", "path": "docs/SGF_REQUISITIONS_8039_DELIVERY.md"},
{"id": "receipt_workflow", "repository": "compras", "path": "app/Services/ReceiptWorkflow.php"},
{"id": "stock_workflow", "repository": "compras", "path": "app/Services/StockWorkflow.php"},
{"id": "stock_controller", "repository": "compras", "path": "app/Http/Controllers/StockController.php"},
{"id": "inventory_lots", "repository": "compras", "path": "app/Services/InventoryLots.php"},
{"id": "inventory_counts", "repository": "compras", "path": "app/Services/InventoryCounts.php"},
{"id": "inventory_dispositions", "repository": "compras", "path": "app/Services/InventoryDispositions.php"},
{"id": "inventory_reversals", "repository": "compras", "path": "app/Services/InventoryReversals.php"},
{"id": "warehouse_reservations", "repository": "compras", "path": "app/Services/WarehouseReservations.php"},
{"id": "stock_menu", "repository": "sgf", "path": "resources/js/stock-menu.js"},
{"id": "invoice_workflow", "repository": "compras", "path": "app/Services/InvoiceWorkflow.php"},
{"id": "supplier_adapter", "repository": "sgf", "path": "app/Modules/Purchasing/SupplierPayables.php"},
{"id": "payables", "repository": "sgf", "path": "packages/payables/src/Payables.php"},
{"id": "settlements", "repository": "sgf", "path": "packages/payables/src/SupplierSettlements.php"},
{"id": "settlement_delivery", "repository": "sgf", "path": "docs/SUPPLIER_SETTLEMENT_DELIVERY.md"},
{"id": "workshop_workflow", "repository": "sgf", "path": "app/Modules/Workshop/WorkshopWorkflow.php"},
{"id": "direct_costs", "repository": "sgf", "path": "app/Modules/Workshop/DirectCosts.php"},
{"id": "industrial_costs", "repository": "sgf", "path": "app/Modules/Industry/IndustrialCosts.php"},
{"id": "workshop_billing", "repository": "sgf", "path": "app/Modules/Workshop/WorkshopBilling.php"},
{"id": "service_invoicing", "repository": "sgf", "path": "app/Modules/Services/ServiceInvoicing.php"},
{"id": "service_receivables", "repository": "sgf", "path": "app/Modules/Services/ServiceReceivables.php"},
{"id": "catalogue_accounting", "repository": "sgf", "path": "app/Modules/Services/CatalogueAccounting.php"},
{"id": "accounting_menu", "repository": "sgf", "path": "docs/ACCOUNTING_MENU_DELIVERY.md"}
]
}