# Leave Application

From time to time, sales reps will need to take time off work. This is easily handled by the leave application module (<http://52.237.241.57/>[leaves](http://23.96.58.180/leaves)). Sales Managers and Admins can create a new leave application by clicking the "add new leave" button and select the time period and sales rep on vacation.

![](https://3399560481-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lxj0STqSZI_aq2Bjo8l%2F-Ly3AwdmrdwAEcVkkSrS%2F-Ly3I_8rmj_ToBoSrAtn%2FRB%20Admin%20\(6\).png?alt=media\&token=0f235cee-814f-450e-8a25-1cf69f7dd741)

When a sales rep applies for leave, the store visits on that day are pushed to another day based on the following business logic:

1. The number of visits in a day does not exceed the `maxStopsPerDay` parameter (by default, this is set to 15).
2. The day selected is not a public holiday or a leave day.
3. The visit is within the defined distanceRadius of another store.
4. A store will not been visited within the same week.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://afi-labs.gitbook.io/rb-scheduling-app/leave-application.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
