I am creating a simple leave request approval app. When employee applies leave less than 2 days it goes to manger to approve/deny that request. When employee applies leave greater than 2 days it goes to HOD to approve/deny that request. For this requirement I have created entities. Could please check my domain model and let me know do I need to modify any of them for this application.
hi Ladi Tanooja,
use microflow and check the leaves applied, have a condition based on your requirement based on the total leaves show the desired role page
I do have some feedback/ remarks on your domain model.
Manager and HOD, are both also an employee?
A Manager and HOD should be able to file a LeaveRequest as well?
Your current domain model isn’t supporting this.
So I would change it as follows
Merge Employee, Manager and HOD into the Employee entity.
Make department and the team of the manager part of the model, so you can distinct the team, the department, who is the team manager and who is the HOD of the department.
This would lead to this domain model where:
An employee can be team member of a team
> Set by association Team_Employee_TeamMember
The team is part of a department
> Set by association Team_Department
A team has a single manager
> Set by association Team_Employee_Manager
A Department has a HOD
> Set by association Department_Employee_HOD
A LeaveRequest can be filed by an employee
> Set by association LeaveRequest_Employee_Requester
A LeaveRequest can be approved by an employee, being the Manager or HOD
> Set by association LeaveRequest_Employee_Approver
When a leave request is filed, the association LeaveRequest_Employee_Requester can be set to the employee which is filing the request.
On submit of the LeaveRequest, you can determine based on start & end date, how many days are requested. If > 2, the set association LeaveRequest_Employee_Approver to the employee which is HOD of the department the team of the employee belong to. Otherwise set association to employee which is the manager of the employees team.