# Lead Summary Component Capability Matrix Version: `1.1.0` Implementation status: merged into the target component and covered by the canonical lead-summary DTO. Target component: `src/views/budget/collection/components/LeadDepartmentSummaryForm.vue` Retained rollback component: `src/views/budget/collection/components/SummarySubmitForm.vue` The target component becomes the only component referenced by the lead-department page. The rollback component remains in source control until the observation-period cleanup task. ## 1. Capability Decision | Capability | LeadDepartmentSummaryForm | SummarySubmitForm | Target decision | |---|---|---|---| | Effective department package list | Present | Present as sub-package data | Keep the lead form implementation and normalize its DTO. | | Department submission status and date | Present | Partial | Keep; include `pending/draft/submitted/approved`. | | View department submission detail | Present | Present | Keep one dialog and one normalized detail DTO. | | Approve or return department submission | Missing | Missing from the component | Add explicit events for the lead workbench. | | Application basis, purpose, reason and project content | Present | Loaded from package submission | Keep; source only from the level-2 `lead_submission`. | | Economic classification aggregation | Present | Present with richer detail | Keep aggregation and department drill-down. | | Summary calculation basis | Present | Present | Keep editable in draft only. | | Economic item attachments | Implemented | Present | Merged into the target component. | | General attachments | Implemented | Present | Merged into the target component. | | New-project funding table | Implemented | Present | Merged with four-decimal amount validation. | | Old-project funding table | Implemented | Present | Merged contract, historical amount, balance and fixed-asset fields. | | Plain implementation schedule | Present | Present | Keep. | | Current/next/third-year schedule detail | Implemented | Present | Merged into the target component. | | Twelve-month current-year amount split | Implemented | Present | Merged and validated with shared money utilities. | | Department schedule comparison | Missing | Present | Keep as read-only drill-down. | | Department performance indicators | Present | Present | Keep one read-only table. | | Lead summary performance indicators | Present | Present | Keep editable in draft only. | | Other notes | Present | Present | Keep. | | Save draft | Implemented | Mixed with legacy save/update | Uses a dedicated `save-draft` event. | | Submit and resubmit | Present as `submit` | Present with direct API behavior | Keep event-driven submission; no direct decomposition API call. | | Returned-to-draft editing | Partial | Partial | Add state-driven edit mode and latest review notes. | | Approved/rejected read-only mode | Partial | Partial | Drive entirely from `lead_submission.status`. | | Four-decimal money handling | Implemented with `decimal.js` | Uses native Number/parseFloat | Target component no longer performs native floating-point business calculations. | | Mock fallback data | Removed | Present debug paths | Target component has no production mock fallback. | | Direct API calls inside component | Present | Present | Move orchestration to page/API modules where practical. | ## 2. Canonical Form Model ```text package leadSubmission departmentSubmissions[] applicationInfo economicSummary[] fundApplication.newProject fundApplication.oldProject implementationSchedule implementationScheduleDetail departmentPerformanceIndicators[] summaryPerformanceIndicators[] generalFileIds[] otherNotes latestApprovalNotes ``` Every money property remains a four-decimal string in component state. ## 3. Component Events | Event | Payload | Owner | |---|---|---| | `save-draft` | Canonical lead summary request DTO | Lead department page | | `submit` | Canonical lead summary request DTO | Lead department page | | `review-department` | `{ submissionId, action, approval_notes }` | Lead department page | | `view-department` | Department submission ID | Lead department page | | `cancel` | None | Lead department page | The component must not import or call `submitBudgetDecomposition`. ## 4. Regression Baseline | Scenario | Expected evidence | |---|---| | New lead draft | Every retained field is editable and serialized. | | Existing lead draft | All fields, attachments and four-decimal values round-trip without loss. | | Department submission pending | Summary submit is disabled and the department is listed as blocking. | | Department submission submitted | Approve and return actions are available to the owning lead department. | | Department submission returned | Blocking reason is visible and the department can resubmit. | | All department submissions approved | Summary save and submit are enabled. | | Lead summary returned | Latest approval notes are visible and the form is editable. | | Lead summary submitted | Form is read-only and awaiting leader review. | | Lead summary approved or rejected | Form is terminal and read-only. | | API failure | Current form state and uploaded file references remain intact. | | Money edge `0.0001` | Input, sum, comparison, request and response stay `0.0001`. | | Monthly schedule | Twelve-month sum must exactly equal current-year amount at four decimals. | ## 5. Removal Gate `SummarySubmitForm.vue` can be deleted only when: 1. Every capability marked "Merge" or "Keep" has a passing regression test against the target component. 2. The lead-department page no longer imports or renders the rollback component. 3. The new frontend has completed its stable observation period. 4. The cleanup change passes unit tests, lint, production build and the lead summary smoke test.