Refactored validation logic and centralized employee validators
<SRS> SRS02 : Employee Management </SRS> <Changes> - Moved employee validation logic (active type check, email and phone duplication) to Validator utility - Updated service to use util::hasActiveEmployeeOfType, util::isEmailDuplicate, and util::isPhoneDuplicate - Integrated validator usage in MenuHelper for input validation - Cleaned up formatting and minor inconsistencies </Changes> <Review> Smitha Mohan </Review>
This commit is contained in:
@@ -1,11 +1,21 @@
|
||||
#pragma once
|
||||
#include<string>
|
||||
#include<map>
|
||||
#include<memory>
|
||||
#include<vector>
|
||||
#include<algorithm>
|
||||
#include<cctype>
|
||||
#include "Enums.h"
|
||||
|
||||
class Employee;
|
||||
|
||||
namespace util
|
||||
{
|
||||
bool isPhoneNumberValid(const std::string&);
|
||||
bool isEmailValid(const std::string&);
|
||||
bool isPasswordValid(const std::string&);
|
||||
bool hasActiveEmployeeOfType(Enums::EmployeeType, const std::map<std::string, std::shared_ptr<Employee>>&);
|
||||
bool isEmailDuplicate(const std::string&, const std::map<std::string, std::shared_ptr<Employee>>&);
|
||||
bool isPhoneDuplicate(const std::string&, const std::map<std::string, std::shared_ptr<Employee>>&);
|
||||
bool isPhoneDuplicate(const std::string&, const std::vector<std::shared_ptr<const Employee>>&);
|
||||
}
|
||||
Reference in New Issue
Block a user