Fix: add duplicate user validation and update register customer UI

- add username duplicate validation
- add email duplicate validation
- add phone duplicate validation
- move duplicate checks to Validator utility
- add Register Customer header
- update registration success message

Fixes #1737
This commit is contained in:
2026-05-26 16:47:11 +05:30
parent 5fd0a47459
commit 31e660bc9e
4 changed files with 51 additions and 10 deletions
@@ -136,6 +136,7 @@ void UserInterface::registerCustomer()
{
std::string username, name, email, phone, password;
util::clear();
std::cout << "Register Customer\n";
std::cout << "Enter username: ";
util::read(username);
std::cout << "Enter name: ";
@@ -165,6 +166,6 @@ void UserInterface::registerCustomer()
return;
}
m_controller.createCustomer(username, name, password, email, phone);
std::cout << "Registration is successful";
std::cout << "Registration is successfull";
util::pressEnter();
}