85 lines
15 KiB
Markdown
85 lines
15 KiB
Markdown
# Module 2 Gap Analysis
|
|
|
|
Comparison of the live implementation (`piam-api/`, `piam-web/`) against the procurement requirements captured in `docs/references/module2.text`. Status legend: ✅ Implemented, ⚠️ Partial, ❌ Missing.
|
|
|
|
## 2.1 Purchase Requisition (PR)
|
|
| Requirement | Status | Key observations |
|
|
| --- | --- | --- |
|
|
| 2.1.1 Standard PR header and supplier data | ⚠️ Partial | Draft/submit lifecycle is implemented (`piam-api/src/PiamMasterData.Api/Controllers/PurchaseRequisitionsController.cs:18`), but both the DTO and UI only capture title, department, requester, budget, and dates—no supplier, VAT type, procurement method, contract number, or company code as required (`piam-api/src/PiamMasterData.Application/DTOs/CreatePurchaseRequisitionDto.cs:7`; `piam-web/src/app/features/procurement/components/purchase-requisition-form/purchase-requisition-form.component.html:55`). |
|
|
| 2.1.2 Budget linkage & visibility | ✅ | Budget code is mandatory and budget snapshots/commitments are enforced during submit (`piam-api/src/PiamMasterData.Infrastructure/Repositories/PurchaseRequisitionRepository.cs:341`), with the form surfacing available-to-commit balances (`piam-web/src/app/features/procurement/components/purchase-requisition-form/purchase-requisition-form.component.html:100`). |
|
|
| 2.1.3 Item selection insights | ⚠️ Partial | Item search, unit selection, and quantity capture exist, but there is no UI/API for last purchase price or on-hand stock visibility, nor packaging-unit handling (`piam-web/src/app/features/procurement/components/purchase-requisition-form/purchase-requisition-form.component.html:145`; `piam-api/src/PiamMasterData.Application/DTOs/PurchaseRequisitionLineUpsertDto.cs:7`). |
|
|
| 2.1.4 Real-time budget check & commitment | ✅ | Submission verifies encumbrance headroom and creates/updates active commitments atomically (`piam-api/src/PiamMasterData.Infrastructure/Repositories/PurchaseRequisitionRepository.cs:341`). |
|
|
| 2.1.5 Approval workflow | ⚠️ Partial | Workflow engine supports multi-step approvals (`piam-api/src/PiamMasterData.Infrastructure/Services/ApprovalWorkflowEngine.cs:51`), yet the Angular form auto-approves immediately after submission, bypassing segregation of duties (`piam-web/src/app/features/procurement/components/purchase-requisition-form/purchase-requisition-form.component.ts:268`). |
|
|
| 2.1.6 PR search & tracking | ⚠️ Partial | Listing API handles keyword, status, department, budget, and dates (`piam-api/src/PiamMasterData.Infrastructure/Repositories/PurchaseRequisitionRepository.cs:17`), but there is no support for company/vendor filters or listing company codes requested in the spec. |
|
|
| 2.1.7 Document numbering & authoring | ⚠️ Partial | Automatic sequencing is present (`piam-api/src/PiamMasterData.Infrastructure/Repositories/PurchaseRequisitionRepository.cs:711`) and submission comments are stored, but manual number overrides and contract metadata are absent from the model (`piam-api/src/PiamMasterData.Domain/Entities/PurchaseRequisition.cs:7`). |
|
|
| 2.1.8 Additional controls (lead time, price governance) | ⚠️ Partial | Required-by date is supported (`piam-web/src/app/features/procurement/components/purchase-requisition-form/purchase-requisition-form.component.html:92`), yet there is no enforcement around editable price permissions, automatic vendor price suggestion, or inventory thresholds. |
|
|
|
|
## 2.2 Request for Quotation (RFQ)
|
|
| Requirement | Status | Key observations |
|
|
| --- | --- | --- |
|
|
| 2.2.1 Create RFQ from approved PR lines | ✅ | RFQ endpoints build from eligible requisition lines and maintain linkages (`piam-api/src/PiamMasterData.Api/Controllers/RfqsController.cs:31`; `piam-api/src/PiamMasterData.Infrastructure/Repositories/RfqRepository.cs:38`). |
|
|
| 2.2.2 Invite qualified suppliers | ✅ | Supplier lookup/invite flows and committee validation exist, including portal onboarding (`piam-api/src/PiamMasterData.Api/Controllers/RfqsController.cs:86`; `piam-api/src/PiamMasterData.Api/Controllers/SupplierPortalController.cs:19`). |
|
|
| 2.2.3 Supplier portal submissions & deadline control | ⚠️ Partial | Portal authentication and bid submission are implemented (`piam-api/src/PiamMasterData.Application/Services/SupplierPortalService.cs:177`), but there is no guard against bids submitted after `submissionDeadlineUtc`, so late submissions are not blocked as the requirement demands (`piam-api/src/PiamMasterData.Application/Services/SupplierPortalService.cs:200`). |
|
|
| 2.2.4 Bid comparison screen | ⚠️ Partial | RFQ detail page lists bids and allows award selection, yet there is no side-by-side comparison or automatic “best price” highlighting per line (`piam-web/src/app/features/procurement/components/rfq-detail/rfq-detail.component.html:248`). |
|
|
| 2.2.5 Auto-create PO/contract from winners | ✅ | Award endpoint transitions RFQ lines and downstream `CreatePurchaseOrderFromRequisitionsDto` consumes awarded requisition lines (`piam-api/src/PiamMasterData.Infrastructure/Repositories/RfqRepository.cs:193`; `piam-api/src/PiamMasterData.Infrastructure/Repositories/PurchaseOrderRepository.cs:183`). |
|
|
|
|
## 2.3 Purchase Orders (PO)
|
|
| Requirement | Status | Key observations |
|
|
| --- | --- | --- |
|
|
| 2.3.1 Build PO from approved PRs | ✅ | Workbench and creation path assemble PO items from approved requisition lines (`piam-api/src/PiamMasterData.Infrastructure/Repositories/PurchaseOrderRepository.cs:23`; `piam-web/src/app/features/procurement/components/purchase-order-workbench`). |
|
|
| 2.3.2 Header fields (supplier, VAT type, department) | ⚠️ Partial | Supplier selection, payment terms, delivery dates, project metadata, and procurement method exist (`piam-web/src/app/features/procurement/components/purchase-order-form/purchase-order-form.component.ts:27`), but VAT type and purchasing department fields are absent. |
|
|
| 2.3.3 Item grid with VAT calculations | ⚠️ Partial | Quantities and unit price editing are present (`piam-web/src/app/features/procurement/components/purchase-order-form/purchase-order-form.component.html:166`), yet neither the API nor UI handle VAT modes, gross/net toggles, freebies, or per-line tax splits (`piam-api/src/PiamMasterData.Application/DTOs/PurchaseOrderItemDto.cs:3`). |
|
|
| 2.3.4 Numbering & VAT schema | ❌ | Only auto-incremented `PO-<year>-####` numbers exist (`piam-api/src/PiamMasterData.Infrastructure/Repositories/PurchaseOrderRepository.cs:320`); there is no manual numbering option or VAT scheme configuration. |
|
|
| 2.3.5 Special PO structures (milestones/freebies/versioning) | ❌ | No support for multi-tranche scheduling, free goods, document versioning, or cost/discount allocation is present in domain models (`piam-api/src/PiamMasterData.Domain/Entities/PurchaseOrderItem.cs:5`). |
|
|
| 2.3.6 Approval workflow & spend gates | ⚠️ Partial | Submission triggers the central workflow engine (`piam-api/src/PiamMasterData.Application/Services/PurchaseOrderService.cs:28`), but the UI auto-submits without presenting approval routing or spend-based controls (`piam-web/src/app/features/procurement/components/purchase-order-form/purchase-order-form.component.ts:260`). |
|
|
| 2.3.7 Distribution & e-signatures | ❌ | Controllers expose CRUD only; no API or UI exists to render PDFs, email suppliers, or capture electronic signatures (`piam-api/src/PiamMasterData.Api/Controllers/PurchaseOrdersController.cs:19`). |
|
|
| 2.3.8 Change tracking & audit | ❌ | There is no change-order log or revision history persisted for POs (`piam-api/src/PiamMasterData.Domain/Entities/PurchaseOrder.cs:5`). |
|
|
| 2.3.9 PO inquiry & alerts | ⚠️ Partial | List endpoint supports supplier/date/status filters (`piam-api/src/PiamMasterData.Infrastructure/Repositories/PurchaseOrderRepository.cs:237`), but there is no PO type filter nor due-date alerting. |
|
|
| 2.3.10 Financial postings & attachments | ❌ | Automatic AP/GL postings, withholding tax capture, billing intake, and PO file attachments are not implemented; models only store simple notes (`piam-api/src/PiamMasterData.Application/DTOs/PurchaseOrderDetailDto.cs:15`). |
|
|
|
|
## 2.4 Goods Receipt Note (GRN)
|
|
| Requirement | Status | Key observations |
|
|
| --- | --- | --- |
|
|
| 2.4.1 Initiate receiving (PO & non-PO) | ⚠️ Partial | Back-end workbench filters approved/partial POs and supports partial receipts (`piam-api/src/PiamMasterData.Infrastructure/Repositories/GoodsReceiptRepository.cs:23`), but there is no path for non-PO receipts and the procurement UI is placeholder data only (`piam-web/src/app/features/procurement/components/procurement-goods-receipts/procurement-goods-receipts.component.ts:20`). |
|
|
| 2.4.2 PO data pull | ✅ | Selecting a PO hydrates supplier and line items (`piam-api/src/PiamMasterData.Infrastructure/Repositories/GoodsReceiptRepository.cs:89`). |
|
|
| 2.4.3 Header capture (invoice, warehouse, delivery note) | ⚠️ Partial | Supplier invoice number/date fields exist (`piam-api/src/PiamMasterData.Application/DTOs/GoodsReceiptNoteDetailDto.cs:7`), but there is no field for receiving warehouse or delivery note metadata. |
|
|
| 2.4.4 Item grid (freebies, packaging) | ❌ | Only quantity-to-receive is tracked; there is no representation of packaging conversions or free-goods tracking (`piam-api/src/PiamMasterData.Application/DTOs/GoodsReceiptNoteItemDto.cs:7`). |
|
|
| 2.4.5 Lot/serial enforcement | ✅ | Lot/serial requirements and validation paths are fully implemented, including expiry enforcement (`piam-api/src/PiamMasterData.Infrastructure/Repositories/GoodsReceiptRepository.cs:328`). |
|
|
| 2.4.6 Put-away suggestions | ✅ | Default bin resolution and assignment occur during draft creation and posting (`piam-api/src/PiamMasterData.Infrastructure/Repositories/GoodsReceiptRepository.cs:165`). |
|
|
| 2.4.7 Quality inspection flow | ✅ | Posting creates quarantine tasks for inspected items (`piam-api/src/PiamMasterData.Infrastructure/Repositories/GoodsReceiptRepository.cs:465`). |
|
|
| 2.4.8 Inventory, PO status, AP trigger | ✅ | Posting moves inventory, updates PO status, and creates pending AP invoices (`piam-api/src/PiamMasterData.Infrastructure/Repositories/GoodsReceiptRepository.cs:487`). |
|
|
| 2.4.9 Permissions & audit | ❌ | No role-based guardrails or audit trail specific to GRN operations exist beyond generic API authorization; procurement UI lacks status inspection tooling (`piam-web/src/app/features/procurement/components/procurement-goods-receipts/procurement-goods-receipts.component.ts:65`). |
|
|
| 2.4.10 Direct-to-department receiving | ❌ | There is no option to post receipts directly as departmental issues; all receipts flow into inventory (`piam-api/src/PiamMasterData.Application/DTOs/GoodsReceiptNoteItemDto.cs:7`). |
|
|
| 2.4.11 Output documents & barcode | ❌ | No GRN printing/export endpoints or barcode generation after posting are present. |
|
|
| 2.4.12 Discounts/VAT on receipt | ❌ | GRN items do not carry VAT/discount or total-value fields, so financial adjustments per receipt are unsupported (`piam-api/src/PiamMasterData.Application/DTOs/GoodsReceiptNoteItemDto.cs:7`). |
|
|
|
|
## 2.5 Return to Supplier
|
|
| Requirement | Status | Key observations |
|
|
| --- | --- | --- |
|
|
| 2.5.x Return order lifecycle | ❌ | There is no API, repository, or domain workflow for return-to-supplier; the Angular view is mock data with TODO comments (`piam-web/src/app/features/procurement/components/return-to-supplier-workspace/return-to-supplier-workspace.component.ts:20`). |
|
|
|
|
## 2.6 Procurement Documents & Reports
|
|
| Requirement | Status | Key observations |
|
|
| --- | --- | --- |
|
|
| 2.6.1 Document template builder | ✅ | Template CRUD and editor UI exist for PO/RFQ printouts (`piam-api/src/PiamMasterData.Api/Controllers/PrintTemplatesController.cs:18`; `piam-web/src/app/features/print-templates/components`). |
|
|
| 2.6.2 Standard reporting | ⚠️ Partial | Analytics services and dashboards are present (`piam-api/src/PiamMasterData.Api/Controllers/AnalyticsController.cs:9`), but specific PR/PO/GRN canned reports and Excel/PDF exports referenced in the TOR are not surfaced in the procurement area. |
|
|
| 2.6.3 End-to-end procurement overview | ⚠️ Partial | Procurement dashboard DTOs provide KPIs (`piam-api/src/PiamMasterData.Application/DTOs/ProcurementDashboardDtos.cs`), yet the procurement UI only links to generic analytics without module-specific summaries (`piam-web/src/app/features/procurement/components/procurement-reports-hub/procurement-reports-hub.component.ts:21`). |
|
|
| 2.6.4 Real-time summaries by procurement method | ⚠️ Partial | Dashboard APIs can filter by status/method, but no dedicated UI exists to slice results by procurement method as described. |
|
|
|
|
## 2.7 Integrations & Automation
|
|
| Requirement | Status | Key observations |
|
|
| --- | --- | --- |
|
|
| 2.7.1 System integrations (GL/AP/Inventory/Assets) | ⚠️ Partial | Budget commitments and AP pending invoices are wired (`piam-api/src/PiamMasterData.Infrastructure/Repositories/PurchaseRequisitionRepository.cs:341`; `piam-api/src/PiamMasterData.Infrastructure/Repositories/GoodsReceiptRepository.cs:501`), but there is no integration with GL or asset capitalization workflows. |
|
|
| 2.7.2 Cross-department data consolidation | ⚠️ Partial | APIs expose procurement data via REST, yet there is no unified data mart or cross-module audit workspace per requirement. |
|
|
| 2.7.3 Workflow configurability | ✅ | Central workflow admin and execution services meet the configurable approval requirement (`piam-api/src/PiamMasterData.Api/Controllers/ApprovalWorkflowAdminController.cs`; `piam-api/src/PiamMasterData.Infrastructure/Services/ApprovalWorkflowEngine.cs:51`). |
|
|
|
|
## 2.8 Additional Procurement Features
|
|
| Requirement | Status | Key observations |
|
|
| --- | --- | --- |
|
|
| 2.8.1 Reorder planning & auto PO | ⚠️ Partial | AI-driven requisition suggestions are implemented (`piam-api/src/PiamMasterData.Infrastructure/Repositories/PurchaseRequisitionRepository.cs:585`), but there is no configurable reorder point or alert UI. |
|
|
| 2.8.2 Multi-device support | ✅ | Angular front-end is responsive and built for desktop/tablet/mobile form factors. |
|
|
| 2.8.3 Committee management | ✅ | Committee maintenance and PO committee linkage are complete (`piam-api/src/PiamMasterData.Api/Controllers/CommitteesController.cs`; `piam-web/src/app/features/procurement/components/purchase-order-form/purchase-order-form.component.html:202`). |
|
|
| 2.8.4 Budgetary fields (VAT, deposits, guarantees) | ❌ | PO models lack VAT breakdowns, deposits, guarantees, or discount aggregates (`piam-api/src/PiamMasterData.Application/DTOs/PurchaseOrderDetailDto.cs:15`). |
|
|
| 2.8.5 Special procurement conditions & timeline fields | ⚠️ Partial | PO captures TOR reference and shipping dates, but fields for submission deadlines, officials, automatic workday calendars, and payment scheduling are absent (`piam-web/src/app/features/procurement/components/purchase-order-form/purchase-order-form.component.html:131`). |
|
|
|