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 TypeMethodDescriptionvoidaddAttendanceRecord(AttendanceRecord attendance) Adds a new attendance record.voidaddEmployeeCSV(String employeeCSVPath) Add employee records from a CSV file.voidaddEmployeeRecord(EmployeeRecord employeeRecord) Add a new employee record.voidaddLeaveBalance(LeaveBalanceRecord leaveBalanceRecord) Adds a new leave balance record.voidaddLeaveRecord(LeaveRecord leaveRecord) Adds a new leave record.voidaddPayrollRecord(PayrollRecord payrollRecords) Adds a new payroll record.voidaddUserCredentials(UserCredentials userCredentials) Adds user credentials.Retrieves all leave records.voiddeleteEmployeeRecord(EmployeeRecord selectedEmployee) Delete an employee record.voiddeleteUserCredentials_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.voidupdateAttendanceRecord(AttendanceRecord attendance) Updates an attendance record.voidupdateEmployeeRecord(EmployeeRecord employeeRecord) Update an existing employee record.voidupdateLeaveBalance(LeaveBalanceRecord leaveBalanceRecord) Updates the leave balance record.voidupdateLeaveRecord(LeaveRecord leaveRecord) Updates a leave record.voidupdateUserCredentials(UserCredentials userCredential) Updates user credentials.
-
Constructor Details
-
FileDataService
public FileDataService()
-
-
Method Details
-
getEmployeeRecord_ByEmployeeID
Description copied from interface:EmployeeDataServiceRetrieves an employee record by employee ID.- Specified by:
getEmployeeRecord_ByEmployeeIDin interfaceEmployeeDataService- Parameters:
employeeID- The ID of the employee.- Returns:
- The employee record.
-
getEmployeeID_List
Description copied from interface:EmployeeDataServiceRetrieves a list of employee IDs.- Specified by:
getEmployeeID_Listin interfaceEmployeeDataService- Returns:
- An array of employee IDs.
-
getActive_EmployeesID_List
Description copied from interface:EmployeeDataServiceRetrieves a list of active employee IDs.- Specified by:
getActive_EmployeesID_Listin interfaceEmployeeDataService- Returns:
- An array of active employee IDs.
-
getEmployeeList_ByPosition
Description copied from interface:EmployeeDataServiceRetrieves a list of employee records by position.- Specified by:
getEmployeeList_ByPositionin interfaceEmployeeDataService- Parameters:
position- The position of the employees.- Returns:
- A list of employee records.
-
getEmployee_ByDepartment
Description copied from interface:EmployeeDataServiceRetrieves a list of employee records by department.- Specified by:
getEmployee_ByDepartmentin interfaceEmployeeDataService- Parameters:
department- The department of the employees.- Returns:
- A list of employee records.
-
getAll_Active_Employees
Description copied from interface:EmployeeDataServiceRetrieves a list of all active employees.- Specified by:
getAll_Active_Employeesin interfaceEmployeeDataService- Returns:
- A list of active employee records.
-
getAll_Employees
Description copied from interface:EmployeeDataServiceRetrieves a list of all employees.- Specified by:
getAll_Employeesin interfaceEmployeeDataService- Returns:
- A list of all employee records.
-
addEmployeeRecord
Description copied from interface:EmployeeDataServiceAdd a new employee record.- Specified by:
addEmployeeRecordin interfaceEmployeeDataService- Parameters:
employeeRecord- The employee record to add.
-
updateEmployeeRecord
Description copied from interface:EmployeeDataServiceUpdate an existing employee record.- Specified by:
updateEmployeeRecordin interfaceEmployeeDataService- Parameters:
employeeRecord- The employee record to update.
-
deleteEmployeeRecord
Description copied from interface:EmployeeDataServiceDelete an employee record.- Specified by:
deleteEmployeeRecordin interfaceEmployeeDataService- Parameters:
selectedEmployee- The employee record to delete.
-
addEmployeeCSV
Description copied from interface:EmployeeDataServiceAdd employee records from a CSV file.- Specified by:
addEmployeeCSVin interfaceEmployeeDataService- Parameters:
employeeCSVPath- The path to the CSV file containing employee records.
-
getAttendanceRecord_ByAttendanceID
Description copied from interface:AttendanceDataServiceRetrieves an attendance record by its attendance ID.- Specified by:
getAttendanceRecord_ByAttendanceIDin interfaceAttendanceDataService- Parameters:
attendanceID- The ID of the attendance record.- Returns:
- The attendance record with the specified ID.
-
getAttendanceRecord_ByEmployeeID
Description copied from interface:AttendanceDataServiceRetrieves an attendance record by employee ID.- Specified by:
getAttendanceRecord_ByEmployeeIDin interfaceAttendanceDataService- Parameters:
employeeID- The ID of the employee.- Returns:
- The attendance record associated with the specified employee.
-
getAllAttendance_ByEmployeeID
Description copied from interface:AttendanceDataServiceRetrieves all attendance records for a specific employee.- Specified by:
getAllAttendance_ByEmployeeIDin interfaceAttendanceDataService- Parameters:
employeeID- The ID of the employee.- Returns:
- A list of all attendance records for the specified employee.
-
getAllAttendanceRecords
Description copied from interface:AttendanceDataServiceRetrieves all attendance records.- Specified by:
getAllAttendanceRecordsin 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:AttendanceDataServiceRetrieves all attendance records for a specified period.- Specified by:
getAll_AttendanceRecord_ForPeriodin 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:AttendanceDataServiceUpdates an attendance record.- Specified by:
updateAttendanceRecordin interfaceAttendanceDataService- Parameters:
attendance- The attendance record to be updated.
-
addAttendanceRecord
Description copied from interface:AttendanceDataServiceAdds a new attendance record.- Specified by:
addAttendanceRecordin interfaceAttendanceDataService- Parameters:
attendance- The attendance record to be added.
-
getLeaveByLeaveID
Description copied from interface:LeaveDataServiceRetrieves a leave record by its leave ID.- Specified by:
getLeaveByLeaveIDin interfaceLeaveDataService- Parameters:
leaveID- The ID of the leave record.- Returns:
- The leave record with the specified ID.
-
getLeaveRecords_ByEmployeeID
Description copied from interface:LeaveDataServiceRetrieves all leave records for a specific employee.- Specified by:
getLeaveRecords_ByEmployeeIDin interfaceLeaveDataService- Parameters:
employeeID- The ID of the employee.- Returns:
- A list of all leave records for the specified employee.
-
getLeaveRecordsByDate
Description copied from interface:LeaveDataServiceRetrieves all leave records for a specific date.- Specified by:
getLeaveRecordsByDatein 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:LeaveDataServiceRetrieves all leave records.- Specified by:
getAllLeaveRecordsin interfaceLeaveDataService- Returns:
- A list of all leave records.
-
updateLeaveRecord
Description copied from interface:LeaveDataServiceUpdates a leave record.- Specified by:
updateLeaveRecordin interfaceLeaveDataService- Parameters:
leaveRecord- The leave record to be updated.
-
allLeaveRecords
Description copied from interface:LeaveDataServiceRetrieves all leave records.- Specified by:
allLeaveRecordsin interfaceLeaveDataService- Returns:
- A list of all leave records.
-
addLeaveRecord
Description copied from interface:LeaveDataServiceAdds a new leave record.- Specified by:
addLeaveRecordin interfaceLeaveDataService- Parameters:
leaveRecord- The leave record to be added.
-
getLeaveBalance_ByEmployeeID
Description copied from interface:LeaveBalanceDataServiceRetrieves the leave balance record for a specific employee.- Specified by:
getLeaveBalance_ByEmployeeIDin interfaceLeaveBalanceDataService- Parameters:
employeeID- The ID of the employee.- Returns:
- The leave balance record associated with the specified employee.
-
updateLeaveBalance
Description copied from interface:LeaveBalanceDataServiceUpdates the leave balance record.- Specified by:
updateLeaveBalancein interfaceLeaveBalanceDataService- Parameters:
leaveBalanceRecord- The updated leave balance record.
-
addLeaveBalance
Description copied from interface:LeaveBalanceDataServiceAdds a new leave balance record.- Specified by:
addLeaveBalancein interfaceLeaveBalanceDataService- Parameters:
leaveBalanceRecord- The leave balance record to be added.
-
getPayroll_ByPayrollID
Description copied from interface:PayrollDataServiceRetrieves a payroll record by its payroll ID.- Specified by:
getPayroll_ByPayrollIDin interfacePayrollDataService- Parameters:
payrollID- The ID of the payroll record.- Returns:
- The payroll record with the specified ID.
-
getPayroll_ByEmployeeID
Description copied from interface:PayrollDataServiceRetrieves the payroll record for a specific employee.- Specified by:
getPayroll_ByEmployeeIDin interfacePayrollDataService- Parameters:
employeeID- The ID of the employee.- Returns:
- The payroll record associated with the specified employee.
-
getAll_Payroll_ByEmployeeID
Description copied from interface:PayrollDataServiceRetrieves all payroll records for a specific employee.- Specified by:
getAll_Payroll_ByEmployeeIDin 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:PayrollDataServiceRetrieves all payroll records for a specified period.- Specified by:
getAll_PayrollRecords_ForPeriodin 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:PayrollDataServiceRetrieves all payroll records.- Specified by:
getAll_PayrollRecordsin interfacePayrollDataService- Returns:
- A list of all payroll records.
-
addPayrollRecord
Description copied from interface:PayrollDataServiceAdds a new payroll record.- Specified by:
addPayrollRecordin interfacePayrollDataService- Parameters:
payrollRecords- The payroll record to be added.
-
getUserCredentials_ByEmployeeID
Description copied from interface:UserCredentialsDataServiceRetrieves user credentials by employee ID.- Specified by:
getUserCredentials_ByEmployeeIDin interfaceUserCredentialsDataService- Parameters:
employeeID- The ID of the employee.- Returns:
- The user credentials associated with the specified employee ID.
-
getUserCredentials_ByUserName
Description copied from interface:UserCredentialsDataServiceRetrieves user credentials by username.- Specified by:
getUserCredentials_ByUserNamein interfaceUserCredentialsDataService- Parameters:
userName- The username.- Returns:
- The user credentials associated with the specified username.
-
getUserCredentials_ByRole
Description copied from interface:UserCredentialsDataServiceRetrieves user credentials by role.- Specified by:
getUserCredentials_ByRolein 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:UserCredentialsDataServiceRetrieves user credentials by position.- Specified by:
getUserCredentials_ByPositionin 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:UserCredentialsDataServiceRetrieves user credentials by department.- Specified by:
getUserCredentials_ByDepartmentin interfaceUserCredentialsDataService- Parameters:
department- The department of the user.- Returns:
- A list of user credentials associated with the specified department.
-
getAllUserCredentials
Description copied from interface:UserCredentialsDataServiceRetrieves all user credentials.- Specified by:
getAllUserCredentialsin interfaceUserCredentialsDataService- Returns:
- A list of all user credentials.
-
updateUserCredentials
Description copied from interface:UserCredentialsDataServiceUpdates user credentials.- Specified by:
updateUserCredentialsin interfaceUserCredentialsDataService- Parameters:
userCredential- The user credentials to be updated.
-
addUserCredentials
Description copied from interface:UserCredentialsDataServiceAdds user credentials.- Specified by:
addUserCredentialsin interfaceUserCredentialsDataService- Parameters:
userCredentials- The user credentials to be added.
-
deleteUserCredentials_ByEmployeeID
Description copied from interface:UserCredentialsDataServiceDeletes user credentials by employee ID.- Specified by:
deleteUserCredentials_ByEmployeeIDin interfaceUserCredentialsDataService- Parameters:
employeeID- The ID of the employee whose credentials are to be deleted.
-