Files
Training-Team2-Zenvy-Jan26/Trenser.Zenvy/Trenser.Zenvy/models/Payroll.h
T
joelthomastrenser 47b44ccaa0 Added payroll persistance and updated Talent Acquisition role
<SRS> SRS02 : Employee Management </SRS>

<Changes>
 - Added Payroll  getHeaders, serialize and deserialize functions
 - Stored payrolls in DataStore
 - Loaded and saved payrolls along with employees
 - Linked payroll to employees during creation and load
 - Added employeeId to Payroll
- Renamed TAG role to TALENT_ACQUISITION across the project
 - Added missing TalentExecutive case in Employee deserialization
 - Added constructor to TalentExecutive for FileManager integration
 - Renamed ID counters to m_uid for consistency
 - Updated salary values in ApplicationConfig
</Changes>

<Review>
Smitha Mohan
</Review>
2026-04-11 12:13:23 +05:30

58 lines
1.9 KiB
C++

#pragma once
#include <string>
#include <memory>
class Payroll
{
private:
static int m_uid;
std::string m_id;
std::string m_employeeId;
double m_basicSalary;
double m_houseRentAllowance;
double m_foodAllowance;
double m_employeePFContribution;
double m_employerPFContribution;
public:
Payroll()
: m_id("PR" + std::to_string(++m_uid)),
m_basicSalary(0.0),
m_houseRentAllowance(0.0),
m_foodAllowance(0.0),
m_employeePFContribution(0.0),
m_employerPFContribution(0.0) {}
Payroll(double basicSalary,
double houseRentAllowance,
double foodAllowance,
double employeePFContribution,
double employerPFContribution)
: m_id("PR" + std::to_string(++m_uid)),
m_basicSalary(basicSalary),
m_houseRentAllowance(houseRentAllowance),
m_foodAllowance(foodAllowance),
m_employeePFContribution(employeePFContribution),
m_employerPFContribution(employerPFContribution) {}
Payroll(const std::string& id,
const std::string& employeeId,
double basicSalary,
double houseRentAllowance,
double foodAllowance,
double employeePFContribution,
double employerPFContribution);
const std::string& getId() const;
const std::string& getEmployeeId() const;
void setEmployeeId(const std::string&);
double getBasicSalary() const;
double getHouseRentAllowance() const;
double getFoodAllowance() const;
double getEmployeePFContribution() const;
double getEmployerPFContribution() const;
void setBasicSalary(double);
void setHouseRentAllowance(double);
void setFoodAllowance(double);
void setEmployeePFContribution(double);
void setEmployerPFContribution(double);
virtual std::string serialize() const;
static std::shared_ptr<Payroll> deserialize(const std::string&);
static std::string getHeaders();
};