<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