Bug 475 - Duplicate member registration problem with same customer ID on MacOS and Windows 10
Summary: Duplicate member registration problem with same customer ID on MacOS and Wind...
Status: CONFIRMED
Alias: None
Product: Group 4
Classification: Unclassified
Component: Main (show other bugs)
Version: unspecified
Hardware: Macintosh Mac OS
: High major
Deadline: 2020-11-27
Assignee: sharitsang97
URL:
Depends on:
Blocks:
 
Reported: 2020-11-26 12:00 HKT by kykao2-c
Modified: 2020-11-26 12:05 HKT (History)
1 user (show)

See Also:


Attachments
Duplicate member registration with same customer ID (83.50 KB, image/png)
2020-11-26 12:00 HKT, kykao2-c
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kykao2-c 2020-11-26 12:00:25 HKT
Created attachment 51 [details]
Duplicate member registration with same customer ID

The program is able to register customers as members repeatedly. That is, the program accepts duplicate customer ID that already exists in the database. This problem causes tremendous impact on purchase that it affects the customers' accumulative balance to be added without consumption and thus, the membership to be upgraded incorrectly. 

This bug has been tested on both MacOS and Windows OS, and this bug always occurs without any exception. The specification of the devices is as follows:
MacOS: Mojave version 10.14.6 [Device: Macbook Pro 2017, 13-inch]
Windows: Windows 10 version 20H2 build number 10.0.19042 [Device: HP Spectre x360 13]

Severity: Major.

Expectation:
The program should not accept customer ID to be reused. Customer ID must be unique for each member. However, the name of customers do not require to be unique.

Expected input (shown in "") and output:
input:   1. "regMember ShariTsang CID_0"
output:     "Customer ShariTsang (Member ID: CID_0) has been added.
input:   2. "regMember PatonChan CID_0"
output:     "Error: Member ID is taken."

Observation:
The program has not added a checking mechanism for declining all registration requests with existing customer ID in CmdRegMember.execute(String[] cmd);

Solution:
Add a checking statement for customer ID. If the customer ID already exists, do not register the member. Else, register.

A sample code snippet for checking duplicate customer ID is as follows:
if (customerDatabase.searchCustomer(customerID) == null) {
      //do registration
} else {
      //error message
}

Please fix this as soon as possible for enhancing the program correctness and usability.