Leave Request Approva lApp -Domain Model

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.  
2 answers

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.

Some questions;

  1. Manager and HOD, are both also an employee?
  2. 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

  1. Merge Employee, Manager and HOD into the Employee entity.
  2. 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:

  1. An employee can be team member of a team
    > Set by association Team_Employee_TeamMember
  2. The team is part of a department
    > Set by association Team_Department
  3. A team has a single manager
    > Set by association Team_Employee_Manager
  4. A Department has a HOD
    > Set by association Department_Employee_HOD
  5. A LeaveRequest can be filed by an employee
    > Set by association LeaveRequest_Employee_Requester
  6. 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.