# Step 1: Define Entities & Properties

Entities and properties define the core data of the application. Key entities include `User`, `Team`, `Employee`, and `LeaveRequest`. Each of these entities has associated properties, such as `FirstName`, `LastName`, `LeaveBalance`, and `StartDate`, which stores specific data points.

This section outlines the purpose of each entity and the data it holds. Each entity plays a specific role in managing user information, team structures, employee data, and leave request processing.

## **Entities Needed for my Leave Request App**

### **User Entity**

The **User** entity holds essential information about individuals who use the system, whether they are employees, managers, or administrators.

The **User** entity is crucial for managing individual user profiles, handling authentication, and controlling role-based access within the system.

Below is the list of **properties** needed:

<table><thead><tr><th width="167">Property Name</th><th width="193">Property Type</th><th width="141">Is Nullable</th><th width="132">Searchable</th><th>Is List</th></tr></thead><tbody><tr><td>FirstName</td><td>Text</td><td>False</td><td>True</td><td>False</td></tr><tr><td>LastName</td><td>Text</td><td>False</td><td>True</td><td>False</td></tr><tr><td>Email</td><td>Text</td><td>False</td><td>True</td><td>False</td></tr><tr><td>PhoneNumber</td><td>Text</td><td>True</td><td>True</td><td>False</td></tr><tr><td>Roles</td><td>Enum [Employee, Admin, Manager]</td><td>True</td><td>True</td><td>True</td></tr><tr><td>Status</td><td>Enum [Active/Inactive]</td><td>False</td><td>True</td><td>False</td></tr></tbody></table>

### **Department Entity**

The **Department** entity represents organizational groups or departments, helping to structure the organization and assign employees to their respective teams.

The **Department** entity organizes employees into logical groups, ensuring users can be assigned to teams and managed appropriately. It also facilitates team-level operations such as leave approvals and oversight by team managers.

Below is the list of **properties** needed:

<table><thead><tr><th width="167">Property Name</th><th width="168">Property Type</th><th width="141">Is Nullable</th><th width="132">Searchable</th><th>Is List</th></tr></thead><tbody><tr><td>Name</td><td>Text</td><td>False</td><td>True</td><td>False</td></tr><tr><td>ManagerID</td><td>Entity Reference [User Entity]</td><td>False</td><td>True</td><td>False</td></tr></tbody></table>

### **Employee Entity**

The **Employee** entity captures information specific to an individual’s role as an employee in the organization.

The **Employee** entity holds employment-specific data, differentiating general users from employees and associating them with teams and their leave entitlements. This enables the system to manage human resources more effectively.

Below is the list of **properties** needed:

<table><thead><tr><th width="167">Property Name</th><th width="168">Property Type</th><th width="141">Is Nullable</th><th width="132">Searchable</th><th>Is List</th></tr></thead><tbody><tr><td>UserID</td><td>Entity Reference [User Entity]</td><td>False</td><td>True</td><td>False</td></tr><tr><td>DepartmentID</td><td>Entity Reference [Department Entity]</td><td>False</td><td>True</td><td>False</td></tr><tr><td>LeaveBalance</td><td>Decimal</td><td>True</td><td>True</td><td>False</td></tr></tbody></table>

### LeaveRequest Entity

The **LeaveRequests** entity manages employee leave requests, including the request details, its status, and any approvals or rejections.

The **LeaveRequests** entity is vital for managing employee leave applications and tracking the approval process. It allows the system to handle various types of leave, monitor statuses, and maintain a transparent approval workflow.

Below is the list of **properties** needed:

<table><thead><tr><th width="167">Property Name</th><th width="168">Property Type</th><th width="141">Is Nullable</th><th width="132">Searchable</th><th>Is List</th></tr></thead><tbody><tr><td>RequesterID</td><td>Entity Reference [Employee Entity]</td><td>False</td><td>True</td><td>False</td></tr><tr><td>Status</td><td>Enum [Rejected, Approved, Pending, Cancelled]</td><td>False</td><td>True</td><td>False</td></tr><tr><td>LeaveType</td><td>Enum [SickLeave, Vacation]</td><td>False</td><td>True</td><td>False</td></tr><tr><td>StartDate</td><td>Date/Time</td><td>False</td><td>True</td><td>False</td></tr><tr><td>EndDate</td><td>Date/Time</td><td>False</td><td>True</td><td>False</td></tr><tr><td>Reason</td><td>Text</td><td>False</td><td>True</td><td>False</td></tr><tr><td>RejectedOn</td><td>Date/Time</td><td>True</td><td>True</td><td>False</td></tr><tr><td>ApprovedOn</td><td>Date/Time</td><td>True</td><td>True</td><td>False</td></tr><tr><td>RejectedBy</td><td>EntityReference [User Entity]</td><td>True</td><td>True</td><td>False</td></tr><tr><td>RejectedOn</td><td>EntityReference [User Entity]</td><td>True</td><td>True</td><td>False</td></tr></tbody></table>
