<UserStory> SER004: View Service History </UserStory>
<Changes>
1. Added integration between Controller and ServiceManagementService to fetch service bookings by customer ID.
2. Enhanced ServiceBooking model to store technician as a User* instead of a string for richer details.
3. Implemented Controller::getServiceBookingsByUser to return a read-only map of bookings for safe access.
4. Updated CustomerMenu::viewServiceHistory to display bookings in tabular format with aligned columns.
5. Added condition check to show technician name if assigned, otherwise display "Not Assigned".
6. Included booking status and discount percentage in the service history output.
</Changes>
<Test>
Acceptance Criteria:
1. System should fetch real-time status.
2. Status should update automatically when technician changes it.
3. Customer should be able to view history.
Precondition:
1. Customer is logged into the console application.
2. At least one active service booking exists for the customer.
3. Technician has permission to update booking status.
Steps:
1. Navigate to Customer menu and choose "View Service History".
- Verify that the console displays current booking status along with technician assignment.
2. Technician updates the status of a booking.
- Verify that the console view reflects the updated status automatically.
3. Customer views service history again.
- Verify that the history shows the latest status changes.
</Test>
<Review>
Sreeja Reghukumar, please review
</Review>
<UserStory> SER003: Remove Service </UserStory>
<Changes>
1. Added integration between Controller and ServiceManagementService to support service removal.
2. Implemented ServiceManagementService::removeService with validation for service existence and marking as INACTIVE.
3. Enhanced Controller::getServices to return a read-only map of services for safe UI access.
4. Added AdminMenu::selectServicesToRemove helper to list active services in tabular format and capture user choice.
5. Updated AdminMenu::removeService to prompt for service selection, delegate removal to Controller, and display success/failure messages.
</Changes>
<Test>
Acceptance Criteria:
1. Admin selects service ID.
2. System confirms deletion.
3. Service removed from customer menu.
Precondition:
1. Admin is logged into the system.
2. At least one active service exists in the datastore.
3. Customer menu displays available services.
Steps:
1. Navigate to Admin menu and choose "Remove Service".
- Verify that the system lists active services in tabular format.
2. Select a service ID from the list.
- Verify that the system confirms deletion.
3. Check customer menu.
- Verify that the removed service no longer appears.
</Test>
<Review>
Sreeja Reghukumar, please review
</Review>
<UserStory> SER002: Create Service </UserStory>
<Changes>
1. Added integration between Controller and ServiceManagementService to support service creation.
2. Implemented ServiceManagementService::createService with validation for duplicate service IDs and insertion into datastore.
3. Enhanced AdminMenu with selectInventoryItems helper to display inventory in tabular format, allow selection, and handle exit condition.
4. Updated AdminMenu::createService to prompt for service name, allow inventory selection, capture labour cost, and create service via Controller.
</Changes>
<Test>
Acceptance Criteria:
1. Admin enters new service name.
2. Admin selects required parts for the services.
3. Service created and visible to customers.
Precondition:
1. Admin is logged into the system.
2. Inventory contains at least one active item.
3. Datastore is available for storing services.
Steps:
1. Navigate to Admin menu and choose "Create Service".
- Verify that the system prompts for service name.
2. Select inventory items from the tabular list.
- Verify that inactive items are skipped and active items can be added.
3. Enter labour cost and confirm creation.
- Verify that the service is created successfully and stored in datastore.
4. Check customer view.
- Verify that the newly created service is visible to customers.
</Test>
<Review>
Sreeja Reghukumar, please review
</Review>
<UserStory> SER001: Assign job to technician </UserStory>
<Changes>
1. Added ServiceManagementService logic to retrieve service bookings and create job cards for assigned technicians.
2. Added UserManagementService support to retrieve technicians by user type and fetch technician details by ID.
3. Connected Controller methods with ServiceManagementService and UserManagementService for service booking retrieval, technician listing, and job card creation.
4. Updated JobCard model to use util::ServiceJobStatus consistently and simplified constructor initialization for assigned and completion timestamps.
5. Added PENDING status in ServiceJobStatus enum for identifying unassigned service bookings.
6. Implemented AdminMenu job assignment flow to list pending service bookings, display available technicians, allow technician selection, and assign jobs for services in the booking.
7. Added notification trigger during job card creation for assigned technicians.
</Changes>
<Test>
Job assignment functionality validation
Precondition:
1. System is running.
2. Pending service bookings are available in the system.
3. Technician users are available in the system.
4. Admin user is logged in and admin menu is active.
Steps:
1. Launch the application and log in as an admin.
2. Select the Assign Job option from the admin menu.
3. View the list of available pending service bookings.
- Verify that pending bookings are displayed.
4. Select a valid service booking.
5. View the list of available technicians.
- Verify that technicians are listed for selection.
6. Select a technician to assign the job.
- Verify that job cards are created for services in the booking.
- Verify that assigned jobs are visible in the technician’s menu.
- Verify that a confirmation message is shown.
- Verify that a confirmation notification is sent to the assigned technician.
</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