# Stale Waiting Process

This tutorial explains step by step how **packages stuck in the Waiting status for a long time** are moved to **Stale Waiting**, how reservations are managed, cancellations are handled, and how packages can be moved to Delivered status.

<figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2FZR0CcPW8UV8RtK2339PD%2Funknown.png?alt=media&#x26;token=227d3620-9126-4bad-b56b-74f40641f0d3" alt=""><figcaption></figcaption></figure>

***

## <mark style="color:red;">**1. Moving Packages to Stale Waiting**</mark>

#### **Purpose:**

Automatically move packages that have been in **Waiting** status for a long time to **Stale Waiting**, allowing the brand to handle the subsequent process.

#### **Steps:**

**1.1 Configuration**

* The **`MARK_STALE_WAITING_PACKAGES_DAY`** variable in **Application Settings** defines the reference for moving packages to Stale Waiting.
* **Default value:** 15 days
  * Packages that have been in Waiting status for 15 days or more will be marked as Stale Waiting.
* This value can be updated according to operational needs:
  * Example: For longer operational timelines, set to 20 days.

**1.2 Runtime**

* A **nightly automated task** runs at **03:00 AM**.
* The task checks all packages in Waiting status and identifies those that have been waiting **equal to or longer than `MARK_STALE_WAITING_PACKAGES_DAY`**.
* These packages are automatically moved to **Stale Waiting** status.

**1.3 Reservation Management**

* All reservations for packages moved to Stale Waiting are **automatically cancelled**.
* This frees up inventory and leaves the package handling to the brand.

**Note:** This step does not require manual intervention; the automated task handles all cancellations.

***

## <mark style="color:red;">**2. Cancellation of Packages in Stale Waiting**</mark>

#### **Purpose:**

The brand can manage Stale Waiting packages in Omnitron through **partial or full cancellation**.

### <mark style="color:red;">**2.1 Partial Cancellation**</mark>

* Steps:
  1. The **first package** in the Stale Waiting package is fully cancelled.
  2. For products not cancelled in Omnitron, a **new package** is created at the same location.
  3. The new package is started in **Stale Waiting** status and the process continues under the brand’s control.

**Example Scenario:**

* Package contains 10 products, 4 are cancelled → Remaining 6 products are placed in a new Stale Waiting package.

### <mark style="color:red;">**2.2 Full Cancellation**</mark>

* Steps:
  1. All products in the package are **cancelled**.
  2. The package process is **fully terminated**.

**Example Scenario:**

* Package contains 5 products, all are cancelled → Package is completely closed.

**Note:** Full cancellation does not create a new package; the process stops entirely.

***

## <mark style="color:red;">**3. Moving Packages to Delivered**</mark>

#### **Purpose:**

If requested by the brand, packages in **Stale Waiting** can be moved **directly to Delivered** status without any intermediate state.

#### **Steps:**

1. Execute the **Deliver The Package** command in Omnitron.
2. The package moves directly to **Delivered** without going through any intermediate status.

**Notes:**

* This allows Stale Waiting packages to be marked as delivered quickly.
* Can be applied based on brand request.
