# Overnight and 24 Hour Availability

## How do I set up Overnight Availability Records?&#x20;

To enable Overnight or 24 Hour Availability for a `Resource`, you must first properly configure an `Operating Hour` Record. To do so, follow the steps outlined below.

{% hint style="success" %}
As **Maica** creates `Availability` by referencing `Operating Hour` records, it is critical to appropriately configure an Overnight or 24 Hour `Operating Hour` record before attempting to plan a `Resource's` `Availability`.
{% endhint %}

### 1. Search for `Operating Hours` in the App Launcher or directly from the `Resource`

In Maica, there are two ways to create your `Operating Hours` record, these are:&#x20;

* Through the Salesforce App Launcher&#x20;
* Directly from the Resource Availability Record

Follow the steps below to see how they both work:

#### 1. Salesforce App Launcher&#x20;

In the Salesforce App Launcher, search for `Operating Hours`.&#x20;

<figure><img src="https://293583916-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9selzjEx6KX7RYEawAVr%2Fuploads%2FssvZJyfnINwAuVsLQQdz%2FScreenshot%202025-02-06%20at%209.17.14%20am.png?alt=media&#x26;token=c3ce5344-08c5-435b-ae8c-0ac29875440c" alt="" width="294"><figcaption></figcaption></figure>

Then, simply select it to open the list view of all `Operating Hours` in your **Maica** instance, as shown below. Click `New` to begin populating your record.&#x20;

<figure><img src="https://293583916-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9selzjEx6KX7RYEawAVr%2Fuploads%2F2PoDEYR6vmzazLwdZMNy%2FScreenshot%202025-02-05%20at%202.14.16%20pm.png?alt=media&#x26;token=9714da56-8897-4126-ae9f-a4eba589bf7a" alt=""><figcaption></figcaption></figure>

#### 2. Through the Resource Availability Record

Navigate to a `Resource` you wish to create an Overnight or 24 hour Availability record for. Then, under `Availability`, click `New`.

This will bring up the New Availability module, as shown below. Once here, navigate to the Operating Hours field, select it as if you were to assign an Operating Hours record, and click `New Operating Hour`.&#x20;

<figure><img src="https://293583916-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9selzjEx6KX7RYEawAVr%2Fuploads%2FUYmBwfBUytqBbzmaWbdY%2FScreenshot%202025-02-06%20at%209.19.16%20am.png?alt=media&#x26;token=286bb007-0a0c-40f0-b86f-199d348bd5e1" alt=""><figcaption></figcaption></figure>

### 2. Create new `Operating Hours` Record

After the pop-up is displayed, you will be prompted to fill-in the following fields:&#x20;

<table><thead><tr><th width="267">Field </th><th>Description </th></tr></thead><tbody><tr><td><code>Name</code></td><td>A descriptive name for the Operating Hour record.</td></tr><tr><td><code>Weekday</code></td><td>The day(s) of the week when this operating hour applies. You can select one or multiple days.</td></tr><tr><td><code>Start Time</code></td><td>The time when the operating hour begins for the selected weekday(s).</td></tr><tr><td><code>End Time</code></td><td>The time when the operating hour ends for the selected weekday(s).</td></tr></tbody></table>

To configure the `Operating Hours` records that enable overnight or 24-hour `Availability` for `Resources` in **Maica**, you will need to follow slightly different processes.

See the respective sections below for further information on each one.

#### 24 Hour Availability Configuration&#x20;

To set up an Operating Hour record to allow for 24 hour Availability, you need to set up the record so that:

* The `Start Time` and `End Time` are the same (e.g., **12:00 AM to 12:00 AM**).
* The **selected weekdays define the active period** (e.g., selecting **Monday and Tuesday** allows bookings spanning from Monday through to Wednesday).

{% hint style="info" %}
The system allows **appointments to be booked across multiple days** as long as they do not exceed the defined maximum (e.g., **48 hours if two consecutive days are selected**).
{% endhint %}

***

#### For example:&#x20;

If you wanted to book a Resource for an overnight Appointment **on Mondays and Tuesdays**, meaning they can take appointments that span **Monday through Wednesday,** then:&#x20;

1. Assign an **Operating Hour** record with the following inputs:
   * **Name:** "*Organisation Preference*"
   * **Weekday:** Monday, Tuesday
   * **Start Time:** **12:00 AM**
   * **End Time:** **12:00 AM**
2. Save the record.

{% hint style="warning" %}
Note,&#x20;

* If a user tries to book an appointment beyond the allowed range (e.g., past Wednesday in this case), **Maica** will not allow it.
* If a non-consecutive day is selected (e.g., Monday and Wednesday but not Tuesday), the system **prevents bookings that cross the missing day**.
  {% endhint %}

#### Overnight  Availability Configuration

To set up an **Operating Hour** record to allow for **Overnight Availability**, you need to configure the record so that:

* The **End Time is earlier than the Start Time** (e.g., **6:00 PM to 6:00 AM**).
* A **single weekday is selected**, meaning the availability will carry into the following day.

{% hint style="info" %}
**Maica** recognises overnight availability when the End Time is before the Start Time, allowing availability to extend past midnight into the next day.
{% endhint %}

***

#### **For example:**

If you wanted to book a **Resource** for an overnight shift that starts on **Monday at 6:00 PM and runs until Tuesday at 6:00 AM**, then:

1. Assign an **Operating Hour** record with the following inputs:
   * **Name:** "*Organisation Preference*"
   * **Weekday:** Monday
   * **Start Time:** **6:00 PM**
   * **End Time:** **6:00 AM**
2. Save the record.

### 3. Assign Availability to the Resource&#x20;

Once the `Operating Hour` record has been created, the next step is to assign it to a `Resource’s` `Availability`. This ensures that the `Resource` follows the configured operating hours when scheduling Appointments.

Once your Availability Record has been created with the correctly configured Operating Hours, you will be ready to schedule Overnight or 24 Hour Appointments.&#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://knowledge.maica.com.au/maica-knowledge-base/maica-administration-guide/system-processes/configuring-maica-components/overnight-and-24-hour-availability.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.
