java.lang.Object
data.service.FileDataService
- All Implemented Interfaces:
AttendanceDataService
,EmployeeDataService
,LeaveBalanceDataService
,LeaveDataService
,PayrollDataService
,UserCredentialsDataService
public class FileDataService
extends Object
implements EmployeeDataService, AttendanceDataService, LeaveBalanceDataService, LeaveDataService, PayrollDataService, UserCredentialsDataService
Class for handling file-based data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttendanceRecord
(AttendanceRecord attendance) Adds a new attendance record.void
addEmployeeCSV
(String employeeCSVPath) Add employee records from a CSV file.void
addEmployeeRecord
(EmployeeRecord employeeRecord) Add a new employee record.void
addLeaveBalance
(LeaveBalanceRecord leaveBalanceRecord) Adds a new leave balance record.void
addLeaveRecord
(LeaveRecord leaveRecord) Adds a new leave record.void
addPayrollRecord
(PayrollRecord payrollRecords) Adds a new payroll record.void
addUserCredentials
(UserCredentials userCredentials) Adds user credentials.Retrieves all leave records.void
deleteEmployeeRecord
(EmployeeRecord selectedEmployee) Delete an employee record.void
deleteUserCredentials_ByEmployeeID
(String employeeID) Deletes user credentials by employee ID.Integer[]
Retrieves a list of active employee IDs.Retrieves a list of all active employees.getAll_AttendanceRecord_ForPeriod
(LocalDate periodStart, LocalDate periodEnd) Retrieves all attendance records for a specified period.Retrieves a list of all employees.getAll_Payroll_ByEmployeeID
(String employeeID) Retrieves all payroll records for a specific employee.Retrieves all payroll records.getAll_PayrollRecords_ForPeriod
(LocalDate startDate, LocalDate endDate) Retrieves all payroll records for a specified period.getAllAttendance_ByEmployeeID
(int employeeID) Retrieves all attendance records for a specific employee.Retrieves all attendance records.Retrieves all leave records.Retrieves all user credentials.getAttendanceRecord_ByAttendanceID
(String attendanceID) Retrieves an attendance record by its attendance ID.getAttendanceRecord_ByEmployeeID
(int employeeID) Retrieves an attendance record by employee ID.getEmployee_ByDepartment
(String department) Retrieves a list of employee records by department.Integer[]
Retrieves a list of employee IDs.getEmployeeList_ByPosition
(String position) Retrieves a list of employee records by position.getEmployeeRecord_ByEmployeeID
(int employeeID) Retrieves an employee record by employee ID.getLeaveBalance_ByEmployeeID
(int employeeID) Retrieves the leave balance record for a specific employee.getLeaveByLeaveID
(String leaveID) Retrieves a leave record by its leave ID.getLeaveRecords_ByEmployeeID
(int employeeID) Retrieves all leave records for a specific employee.getLeaveRecordsByDate
(LocalDate requestDate) Retrieves all leave records for a specific date.getPayroll_ByEmployeeID
(int employeeID) Retrieves the payroll record for a specific employee.getPayroll_ByPayrollID
(String payrollID) Retrieves a payroll record by its payroll ID.getUserCredentials_ByDepartment
(String department) Retrieves user credentials by department.getUserCredentials_ByEmployeeID
(String employeeID) Retrieves user credentials by employee ID.getUserCredentials_ByPosition
(String position) Retrieves user credentials by position.Retrieves user credentials by role.getUserCredentials_ByUserName
(String userName) Retrieves user credentials by username.void
updateAttendanceRecord
(AttendanceRecord attendance) Updates an attendance record.void
updateEmployeeRecord
(EmployeeRecord employeeRecord) Update an existing employee record.void
updateLeaveBalance
(LeaveBalanceRecord leaveBalanceRecord) Updates the leave balance record.void
updateLeaveRecord
(LeaveRecord leaveRecord) Updates a leave record.void
updateUserCredentials
(UserCredentials userCredential) Updates user credentials.
-
Constructor Details
-
FileDataService
public FileDataService()
-
-
Method Details
-
getEmployeeRecord_ByEmployeeID
Description copied from interface:EmployeeDataService
Retrieves an employee record by employee ID.- Specified by:
getEmployeeRecord_ByEmployeeID
in interfaceEmployeeDataService
- Parameters:
employeeID
- The ID of the employee.- Returns:
- The employee record.
-
getEmployeeID_List
Description copied from interface:EmployeeDataService
Retrieves a list of employee IDs.- Specified by:
getEmployeeID_List
in interfaceEmployeeDataService
- Returns:
- An array of employee IDs.
-
getActive_EmployeesID_List
Description copied from interface:EmployeeDataService
Retrieves a list of active employee IDs.- Specified by:
getActive_EmployeesID_List
in interfaceEmployeeDataService
- Returns:
- An array of active employee IDs.
-
getEmployeeList_ByPosition
Description copied from interface:EmployeeDataService
Retrieves a list of employee records by position.- Specified by:
getEmployeeList_ByPosition
in interfaceEmployeeDataService
- Parameters:
position
- The position of the employees.- Returns:
- A list of employee records.
-
getEmployee_ByDepartment
Description copied from interface:EmployeeDataService
Retrieves a list of employee records by department.- Specified by:
getEmployee_ByDepartment
in interfaceEmployeeDataService
- Parameters:
department
- The department of the employees.- Returns:
- A list of employee records.
-
getAll_Active_Employees
Description copied from interface:EmployeeDataService
Retrieves a list of all active employees.- Specified by:
getAll_Active_Employees
in interfaceEmployeeDataService
- Returns:
- A list of active employee records.
-
getAll_Employees
Description copied from interface:EmployeeDataService
Retrieves a list of all employees.- Specified by:
getAll_Employees
in interfaceEmployeeDataService
- Returns:
- A list of all employee records.
-
addEmployeeRecord
Description copied from interface:EmployeeDataService
Add a new employee record.- Specified by:
addEmployeeRecord
in interfaceEmployeeDataService
- Parameters:
employeeRecord
- The employee record to add.
-
updateEmployeeRecord
Description copied from interface:EmployeeDataService
Update an existing employee record.- Specified by:
updateEmployeeRecord
in interfaceEmployeeDataService
- Parameters:
employeeRecord
- The employee record to update.
-
deleteEmployeeRecord
Description copied from interface:EmployeeDataService
Delete an employee record.- Specified by:
deleteEmployeeRecord
in interfaceEmployeeDataService
- Parameters:
selectedEmployee
- The employee record to delete.
-
addEmployeeCSV
Description copied from interface:EmployeeDataService
Add employee records from a CSV file.- Specified by:
addEmployeeCSV
in interfaceEmployeeDataService
- Parameters:
employeeCSVPath
- The path to the CSV file containing employee records.
-
getAttendanceRecord_ByAttendanceID
Description copied from interface:AttendanceDataService
Retrieves an attendance record by its attendance ID.- Specified by:
getAttendanceRecord_ByAttendanceID
in interfaceAttendanceDataService
- Parameters:
attendanceID
- The ID of the attendance record.- Returns:
- The attendance record with the specified ID.
-
getAttendanceRecord_ByEmployeeID
Description copied from interface:AttendanceDataService
Retrieves an attendance record by employee ID.- Specified by:
getAttendanceRecord_ByEmployeeID
in interfaceAttendanceDataService
- Parameters:
employeeID
- The ID of the employee.- Returns:
- The attendance record associated with the specified employee.
-
getAllAttendance_ByEmployeeID
Description copied from interface:AttendanceDataService
Retrieves all attendance records for a specific employee.- Specified by:
getAllAttendance_ByEmployeeID
in interfaceAttendanceDataService
- Parameters:
employeeID
- The ID of the employee.- Returns:
- A list of all attendance records for the specified employee.
-
getAllAttendanceRecords
Description copied from interface:AttendanceDataService
Retrieves all attendance records.- Specified by:
getAllAttendanceRecords
in interfaceAttendanceDataService
- Returns:
- A list of all attendance records.
-
getAll_AttendanceRecord_ForPeriod
public List<AttendanceRecord> getAll_AttendanceRecord_ForPeriod(LocalDate periodStart, LocalDate periodEnd) Description copied from interface:AttendanceDataService
Retrieves all attendance records for a specified period.- Specified by:
getAll_AttendanceRecord_ForPeriod
in interfaceAttendanceDataService
- Parameters:
periodStart
- The start date of the period.periodEnd
- The end date of the period.- Returns:
- A list of all attendance records within the specified period.
-
updateAttendanceRecord
Description copied from interface:AttendanceDataService
Updates an attendance record.- Specified by:
updateAttendanceRecord
in interfaceAttendanceDataService
- Parameters:
attendance
- The attendance record to be updated.
-
addAttendanceRecord
Description copied from interface:AttendanceDataService
Adds a new attendance record.- Specified by:
addAttendanceRecord
in interfaceAttendanceDataService
- Parameters:
attendance
- The attendance record to be added.
-
getLeaveByLeaveID
Description copied from interface:LeaveDataService
Retrieves a leave record by its leave ID.- Specified by:
getLeaveByLeaveID
in interfaceLeaveDataService
- Parameters:
leaveID
- The ID of the leave record.- Returns:
- The leave record with the specified ID.
-
getLeaveRecords_ByEmployeeID
Description copied from interface:LeaveDataService
Retrieves all leave records for a specific employee.- Specified by:
getLeaveRecords_ByEmployeeID
in interfaceLeaveDataService
- Parameters:
employeeID
- The ID of the employee.- Returns:
- A list of all leave records for the specified employee.
-
getLeaveRecordsByDate
Description copied from interface:LeaveDataService
Retrieves all leave records for a specific date.- Specified by:
getLeaveRecordsByDate
in interfaceLeaveDataService
- Parameters:
requestDate
- The date for which leave records are requested.- Returns:
- A list of all leave records for the specified date.
-
getAllLeaveRecords
Description copied from interface:LeaveDataService
Retrieves all leave records.- Specified by:
getAllLeaveRecords
in interfaceLeaveDataService
- Returns:
- A list of all leave records.
-
updateLeaveRecord
Description copied from interface:LeaveDataService
Updates a leave record.- Specified by:
updateLeaveRecord
in interfaceLeaveDataService
- Parameters:
leaveRecord
- The leave record to be updated.
-
allLeaveRecords
Description copied from interface:LeaveDataService
Retrieves all leave records.- Specified by:
allLeaveRecords
in interfaceLeaveDataService
- Returns:
- A list of all leave records.
-
addLeaveRecord
Description copied from interface:LeaveDataService
Adds a new leave record.- Specified by:
addLeaveRecord
in interfaceLeaveDataService
- Parameters:
leaveRecord
- The leave record to be added.
-
getLeaveBalance_ByEmployeeID
Description copied from interface:LeaveBalanceDataService
Retrieves the leave balance record for a specific employee.- Specified by:
getLeaveBalance_ByEmployeeID
in interfaceLeaveBalanceDataService
- Parameters:
employeeID
- The ID of the employee.- Returns:
- The leave balance record associated with the specified employee.
-
updateLeaveBalance
Description copied from interface:LeaveBalanceDataService
Updates the leave balance record.- Specified by:
updateLeaveBalance
in interfaceLeaveBalanceDataService
- Parameters:
leaveBalanceRecord
- The updated leave balance record.
-
addLeaveBalance
Description copied from interface:LeaveBalanceDataService
Adds a new leave balance record.- Specified by:
addLeaveBalance
in interfaceLeaveBalanceDataService
- Parameters:
leaveBalanceRecord
- The leave balance record to be added.
-
getPayroll_ByPayrollID
Description copied from interface:PayrollDataService
Retrieves a payroll record by its payroll ID.- Specified by:
getPayroll_ByPayrollID
in interfacePayrollDataService
- Parameters:
payrollID
- The ID of the payroll record.- Returns:
- The payroll record with the specified ID.
-
getPayroll_ByEmployeeID
Description copied from interface:PayrollDataService
Retrieves the payroll record for a specific employee.- Specified by:
getPayroll_ByEmployeeID
in interfacePayrollDataService
- Parameters:
employeeID
- The ID of the employee.- Returns:
- The payroll record associated with the specified employee.
-
getAll_Payroll_ByEmployeeID
Description copied from interface:PayrollDataService
Retrieves all payroll records for a specific employee.- Specified by:
getAll_Payroll_ByEmployeeID
in interfacePayrollDataService
- Parameters:
employeeID
- The ID of the employee.- Returns:
- A list of all payroll records for the specified employee.
-
getAll_PayrollRecords_ForPeriod
Description copied from interface:PayrollDataService
Retrieves all payroll records for a specified period.- Specified by:
getAll_PayrollRecords_ForPeriod
in interfacePayrollDataService
- Parameters:
startDate
- The start date of the period.endDate
- The end date of the period.- Returns:
- A list of all payroll records within the specified period.
-
getAll_PayrollRecords
Description copied from interface:PayrollDataService
Retrieves all payroll records.- Specified by:
getAll_PayrollRecords
in interfacePayrollDataService
- Returns:
- A list of all payroll records.
-
addPayrollRecord
Description copied from interface:PayrollDataService
Adds a new payroll record.- Specified by:
addPayrollRecord
in interfacePayrollDataService
- Parameters:
payrollRecords
- The payroll record to be added.
-
getUserCredentials_ByEmployeeID
Description copied from interface:UserCredentialsDataService
Retrieves user credentials by employee ID.- Specified by:
getUserCredentials_ByEmployeeID
in interfaceUserCredentialsDataService
- Parameters:
employeeID
- The ID of the employee.- Returns:
- The user credentials associated with the specified employee ID.
-
getUserCredentials_ByUserName
Description copied from interface:UserCredentialsDataService
Retrieves user credentials by username.- Specified by:
getUserCredentials_ByUserName
in interfaceUserCredentialsDataService
- Parameters:
userName
- The username.- Returns:
- The user credentials associated with the specified username.
-
getUserCredentials_ByRole
Description copied from interface:UserCredentialsDataService
Retrieves user credentials by role.- Specified by:
getUserCredentials_ByRole
in interfaceUserCredentialsDataService
- Parameters:
role
- The role of the user.- Returns:
- A list of user credentials associated with the specified role.
-
getUserCredentials_ByPosition
Description copied from interface:UserCredentialsDataService
Retrieves user credentials by position.- Specified by:
getUserCredentials_ByPosition
in interfaceUserCredentialsDataService
- Parameters:
position
- The position of the user.- Returns:
- A list of user credentials associated with the specified position.
-
getUserCredentials_ByDepartment
Description copied from interface:UserCredentialsDataService
Retrieves user credentials by department.- Specified by:
getUserCredentials_ByDepartment
in interfaceUserCredentialsDataService
- Parameters:
department
- The department of the user.- Returns:
- A list of user credentials associated with the specified department.
-
getAllUserCredentials
Description copied from interface:UserCredentialsDataService
Retrieves all user credentials.- Specified by:
getAllUserCredentials
in interfaceUserCredentialsDataService
- Returns:
- A list of all user credentials.
-
updateUserCredentials
Description copied from interface:UserCredentialsDataService
Updates user credentials.- Specified by:
updateUserCredentials
in interfaceUserCredentialsDataService
- Parameters:
userCredential
- The user credentials to be updated.
-
addUserCredentials
Description copied from interface:UserCredentialsDataService
Adds user credentials.- Specified by:
addUserCredentials
in interfaceUserCredentialsDataService
- Parameters:
userCredentials
- The user credentials to be added.
-
deleteUserCredentials_ByEmployeeID
Description copied from interface:UserCredentialsDataService
Deletes user credentials by employee ID.- Specified by:
deleteUserCredentials_ByEmployeeID
in interfaceUserCredentialsDataService
- Parameters:
employeeID
- The ID of the employee whose credentials are to be deleted.
-