<UserStory> PAY001: Generate Invoice </UserStory>
<Changes>
1. Added Utility.h to project configuration for supporting invoice generation utilities.
2. Updated Invoice model to use string-based keys for parts mapping instead of integer keys.
3. Implemented PaymentManagementService::generateInvoice to aggregate labour cost, parts cost, and apply discounts.
4. Integrated invoice creation with Factory to instantiate Invoice objects and persist them into datastore.
5. Enhanced Enums with PaymentMode::NOTSET to handle default invoice state.
</Changes>
<Test>
Acceptance Criteria:
1. Invoice auto-generates for each service booking once jobs are completed.
2. Invoice shows a clear breakdown of charges including labour cost, parts cost, discount, and total amount.
Precondition:
1. Service booking exists with at least one service and required inventory items.
2. Datastore is available for storing invoices.
3. Payment mode and status enums are properly configured.
Steps:
1. Complete all jobs in a service booking.
- Verify that PaymentManagementService::generateInvoice is triggered.
2. Check datastore for newly created invoice.
- Verify that invoice contains booking ID, labour cost, parts cost, discount, and total amount.
3. Inspect invoice details.
- Verify that breakdown of charges is accurate and discount is applied correctly.
4. Confirm invoice status.
- Verify that invoice is created with PaymentMode::NOTSET and PaymentStatus::PENDING.
</Test>
<Review>
Sreeja Reghukumar, please review
</Review>
- Removed observer map from Subject base class
- Removed notify() from Subject interface
- Made NotificationManagementService abstract with pure virtual methods
- Added static observer maps to notification service implementations
- Added attach() and detach() overrides in inventory, payment, and service management services
- Added update() override in User model for observer pattern support
- Updated notification method declarations with override specifiers
<Changes>
1. Added State enum with ACTIVE and INACTIVE values in Enums.h.
2. Added state member, getter, and setter in User, Service, InventoryItem, and ComboPackage models.
3. Updated constructors to initialize model objects with ACTIVE state by default.
4. Added state string conversion helper functions in Enums.h.
5. Added default return values in Controller getter methods to complete stub implementations.
6. Added basic menu loop implementation in CustomerMenu and TechnicianMenu for handling user input.
</Changes>
Changes:
- Added stub implementations for Controller.cpp methods
- Fixed const issue in UserInterface methods (run, login, registerCustomer, handleOperation)
- Changed return types to use const pointers for read-only objects
- Updated maps and vectors to return const object pointers
- Fixed some function parameter names and signatures for consistency