Step 3: Configure Queries

Queries will enable users to access specific datasets as needed, ensuring that the application can deliver relevant information promptly. Below is a detailed description of each required query, outlining its purpose, expected data output, and any necessary parameters.

Queries Needed for my Leave Request App

GetAllDepartments

This query retrieves a complete list of all departments within the organization, providing a foundational structure for departmental data management.

The purpose is to provide a full overview of all departments and to support operations requiring selection or categorization based on departments.

Inputs
Authorization
Main Entity
Related Entity
Outputs

None

Authenticated User

Department

User

To get Manager Details

Department ID

Department Name

Manager ID

Manager First Name

Manager Last Name

GetAllEmployees

This query retrieves all employee records within the organization. It serves as a fundamental query for listing or managing employee information.

The purpose is to provide a comprehensive list of employees for display or management purposes and to enable filtering or operations based on employee details.

Inputs
Authorization
Main Entity
Related Entity
Outputs

None

Authenticated User

Employees

  • User: To get Employee details

  • Department: To get Deparment details

Employee ID

Employee First Name

Employee Last Name

Employee Email

Employee Leave Balance

Employee Roles

Department Name

GetAllEmployeesByDepartment

This query retrieves a list of employees associated with a specific department, allowing users to view personnel within a department context.

The purpose is to filter and display employees based on their department affiliation.

Inputs
Authorization
Main Entity
Related Entity
Outputs

DepartmentID

Authenticated User

Employees

  • User: To get Employee details

  • Department: To get Deparment details

Employee ID

Employee First Name

Employee Last Name

Employee Email

Employee Leave Balance

Employee Roles

Department Name

GetAllLeaveRequests

This query retrieves all leave requests submitted by employees, crucial for monitoring and managing employee leave.

Inputs
Authorization
Main Entity
Related Entity
Outputs

None

Authenticated User

LeaveRequest

  • User: To get Requester details

RequestID

Requester ID

Requester First Name

Requester Last Name

LeaveType

StartDate

EndDate

Status

Reason

GetAllManagers

This query retrieves a list of all managers within the organization. This is vital for operations that require oversight or interaction with managerial roles.

The purpose is to provide a comprehensive list of managers for reporting and management purposes.

Inputs
Authorization
Main Entity
Related Entity
Outputs

None

Authenticated User

Department

  • User: To get Manager details

ManagerID

Manager First Name

Manager Last Name

Manager Email

Department Name

GetEmployee

This query retrieves detailed information about a specific employee based on their unique identifier.

Inputs
Authorization
Main Entity
Related Entity
Outputs

EmployeeID

Authenticated User

Employees

  • User: To get Employee details

  • Department: To get Deparment details

Employee ID

Employee First Name

Employee Last Name

Employee Email

Employee Leave Balance

Employee Roles

Department Name

GetEmployeeRequests

This query retrieves all leave requests submitted by a specific employee by status. It helps managers track current leave situations.

The purpose is to provide visibility into an employee’s ongoing leave requests and yo assist managers in managing workloads and planning accordingly.

Inputs
Authorization
Main Entity
Related Entity
Outputs

Status

EmployeeID

Role = Manager

LeaveRequest

  • User: To get Requester details

RequestID

Requester ID

Requester First Name

Requester Last Name

LeaveType

StartDate

EndDate

Status

Reason

Summary of Query Definitions

Defining these queries is essential for creating a robust data retrieval framework within the application. Each query serves a specific function and is designed to return relevant data sets, allowing users to efficiently access and manage the information they require.

Implementation Considerations

When implementing these queries, consider the following:

  1. Database Structure: Ensure that the underlying database schema supports these queries effectively.

  2. Performance Optimization: Evaluate indexing and performance strategies to handle potentially large datasets.

  3. Access Control: Establish permissions to ensure that sensitive information is only accessible to authorized users.

Last updated