# Saturday Service

The Saturday Service application features a macro that operates within the Rules Engine as an action. This macro is designed to automatically assign the Saturday Service to open orders if their delivery date falls on a Saturday. Typically configured as a rules macro, it populates the service with the Saturday Service specified in the preset macro configuration.

This guide provides a step-by-step explanation of how to install and set up the macro in Linnworks.

### Start using the macro

There are three steps you need to complete to start using the macro:

1. Install the application.
   * Go to *Apps > Application Store > Saturday Service >* click Install and follow the on-screen instructions until the installation is complete.
2. Configure the macro.
3. Configure the rule in the *Rules Engine* screen.

#### Configure the macro

Once the Saturday Note  app is installed:

1\. Go to *Apps > Macro Configuration* and click  <mark style="color:purple;">+ Add new configuration.</mark>

<figure><img src="https://2079576606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFRkrZGowwT8Xbb5HKclZ%2Fuploads%2FGLdZfmKkjwce72q4EWuJ%2FAddOrderNoteMacro%20-%20AddNew.png?alt=media&#x26;token=81237e90-729e-4523-9d9a-9c6aef5ff347" alt=""><figcaption></figcaption></figure>

2. Select the SaturdayService macro and click  <mark style="color:purple;">Create Configuration.</mark>

<figure><img src="https://2079576606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFRkrZGowwT8Xbb5HKclZ%2Fuploads%2FAy4md7oyQhpTt2jshdR4%2Fsaturdayservice.PNG?alt=media&#x26;token=7b97a6b8-a9ff-4f97-acb2-6cce478013fb" alt=""><figcaption></figcaption></figure>

3. In the *Macro Configuration* screen, specify the below details and click *Save*:

<figure><img src="https://2079576606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFRkrZGowwT8Xbb5HKclZ%2Fuploads%2FZQ39GD8zzDo3zMRWWei1%2Fsaturdayservice2.PNG?alt=media&#x26;token=3f4ada1f-efa8-4c83-add5-1b7a4b99faf8" alt=""><figcaption></figcaption></figure>

3. Make sure to enable the macro to continue with the *Rules Engine* configuration.

<figure><img src="https://2079576606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFRkrZGowwT8Xbb5HKclZ%2Fuploads%2FSht72CPWjVWTORP54VCV%2Fsaturdayservice3.PNG?alt=media&#x26;token=13ec12ad-296b-41b5-8d45-96da49f64645" alt=""><figcaption></figcaption></figure>

**Functionality:**

1. **Parameter Input:**
   * `OrderIds`: List of OrderIds representing the open orders to be checked for Saturday delivery.
   * `serviceName`: Name or identifier of the service to be assigned (in this case, the Saturday Service).
2. **Rules Engine Integration:**
   * The macro integrates seamlessly within the Rules Engine, allowing it to be invoked based on predefined conditions or scheduled intervals.
3. **Date Evaluation:**
   * For each order in the provided list (`OrderIds`), the macro examines the delivery date.
   * If the delivery date falls on a Saturday, the macro proceeds to assign the Saturday Service to that order.
4. **Service Assignment:**
   * The macro automatically populates the service field with the specified Saturday Service, as configured in the preset macro settings.
5. **Logging and Error Handling:**
   * The macro incorporates logging mechanisms to record its actions, ensuring transparency and facilitating troubleshooting in case of errors.

**Usage:**

* **Parameters:**
  * `OrderIds`: List of OrderIds representing open orders to be evaluated for Saturday delivery.
  * `serviceName`: Name or identifier of the service to be assigned (e.g., "Saturday Service").
* **Execution:**
  * The macro is configured to operate within the Rules Engine, either triggered by specific conditions or scheduled to run at defined intervals.
  * Upon execution, it takes the list of OrderIds and the service name as input parameters.
  * The macro evaluates each order's delivery date and, if it falls on a Saturday, assigns the Saturday Service to the order.
* **Outcome:**
  * Orders with delivery dates falling on Saturdays are automatically assigned the Saturday Service.
  * This automated process ensures that orders scheduled for Saturday delivery are appropriately flagged and processed using the designated service.
  * Administrators can monitor the macro's actions through logging, facilitating oversight and ensuring the correct assignment of services.
