Bug 775 - The system allows users to select a hairdresser that does not provide any services
Summary: The system allows users to select a hairdresser that does not provide any ser...
Status: RESOLVED FIXED
Alias: None
Product: CS3343 Salon Booking System
Classification: Unclassified
Component: customers.bookings.Create (show other bugs)
Version: Beta
Hardware: PC Windows
: --- major
Assignee: kwanng9@my.cityu.edu.hk
URL:
Depends on:
Blocks:
 
Reported: 2023-11-10 20:14 HKT by kwanng9@my.cityu.edu.hk
Modified: 2023-11-10 20:15 HKT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kwanng9@my.cityu.edu.hk 2023-11-10 20:14:59 HKT
Description:
Customer place booking: When user selects a hairdresser that does not provide any services, the system still allows users to select booking date, but after selected the booking date, the program does not response anymore.

Step to Reproduce:
1. Customer login
2. Select “My Bookings”
3. Select “Add”
4. Choose a hairdresser that does not provide any services, for example “Sam”
5. Press the Date dropdown to select date
6. The program freeze


Actual Result:
The program allows users to select a hairdresser that does not provide any services.

Expected Result:
The program should not allow users to select a hairdresser that does not provide any services.
Comment 1 kwanng9@my.cityu.edu.hk 2023-11-10 20:15:39 HKT
The bug was caused by the SQL statement that only retrieve all hairdressers for user to select, without filtering those does not provide any services. Since users do not select any services, the system cannot calculate relevant duration, thus cannot pass duration parameters to calculate the available booking date and time. 

To solve the bug, the SQL statement within component “buildDropdownHairdresser()”
 has been updated to only retrieve hairdressers with at least one services provided, also added conditional statements before calculating the booking date and time.