1032fc64bd
<User Story> Complete Payments - 1797</User Story> <Changes> 1. Added Controller::getAllInvoices - Retrieves all invoices from PaymentManagementService and returns them as a read-only map. 2. Implemented Controller::confirmPayment - Delegates payment confirmation for a given invoice ID to PaymentManagementService. 3. Introduced PaymentManagementService::getAllInvoice - Provides access to all invoices stored in the datastore. 4. Added PaymentManagementService::confirmPayment - Confirms payment for a specific invoice, updates payment date and status, and sends notification. 5. Extended util::PaymentStatus enum - Added PAID status and updated string conversion. 6. Integrated AdminMenu::confirmPayment - Validates invoice list, filters by status, allows selection, and confirms payment. 7. Updated CustomerMenu::completePayments - Uses parameterized status filtering for invoice selection. 8. Enhanced MenuHelper::selectInvoiceFromUserForPayment - Accepts requiredStatus parameter for flexible filtering. 9. Adjusted AdminMenu options - Added "Confirm Payment" before Logout. </Changes> <Test> Acceptance Criteria: 1. Admin selects "Confirm Payment" from menu. - Verify system prompts and displays invoices filtered by status. 2. Admin selects invoice with status = PAID. - Verify payment confirmation updates date, sets status, and sends notification. 3. Admin attempts confirmation with empty invoice list. - Verify error message: "No pending invoices available for confirmation." 4. Customer completes payment. - Verify selection uses util::PaymentStatus::PENDING and payment flow works correctly. 5. Invalid invoice ID entered. - Verify system throws runtime_error with "Payment failed: invalid invoice ID." Precondition: 1. Admin logged into system. 2. At least one invoice exists in datastore. 3. Notification system available. Steps: 1. Navigate to Admin menu → Confirm Payment. 2. Select invoice with PAID status. 3. Confirm payment and check notification. 4. Attempt with empty invoice list. 5. Attempt with invalid invoice ID. </Test> <Review> Sreeja Reghukumar </Review>