# Set rules on an activity

A rule attaches conditions — time slots, group size, date range, days of week — to an action on one activity. Only the Deposit Required rule type is actually enforced when a booking is priced; Price Override, Min Group Size and Blocked are saved but do nothing.

Source: https://help.pigi.io/guides/company-setup/activities/activity-rules

## Quick answers

**Where do I add a rule to an activity?**
Two places, same list: the activity's own **Rules** tab at
/school/admin/bookings/activities/edit/&lt;ref&gt;, or **Bookings → Settings →
Rules & Availability**, which shows the rules for every activity. Click **+ Rule**.

**How do I require a bigger deposit in peak season?**
Add a rule of type **Deposit Required** on the activity, tick **Date Range** in the
conditions, set the from/to dates (tick **Recurring every year** for a season that
repeats), and in the actions set **Deposit Amount** and **Deposit Type** (Fixed
Amount or Percentage).

**Can I use a rule to block bookings on certain dates?**
No — the **Blocked** rule type is saved but never enforced. Close the dates with a
**Close** entry in Manage Availability instead.

**Which rule wins when two match?**
Rules are evaluated in descending **Priority**. Every matching deposit rule is
applied in turn, so the last one evaluated sets the final deposit.

**What happens when no deposit rule matches anymore?**
The rule-imposed deposit is cleared from the booking when it is repriced, and the
activity's own default deposit applies again.

## What this is

Rules are per-activity conditional policy. Each rule carries a set of conditions
and a set of actions; when a booking is priced, PiGi walks the activity's active
rules in priority order, keeps the ones whose conditions match the booking, and
applies their actions. Today the only action that has an effect is setting the
required deposit.

## Before you start

- The activity must exist and you need the company admin role.
- Know your base deposit first — a rule overrides the activity's **Default Deposit
  Amount** rather than adding to it.

## Steps

1. Open the activity and select **Rules**, or go to **Bookings → Settings → Rules &
   Availability**.
2. Click **+ Rule**.
3. Give the rule a **Name** and optional **Description**, and choose the rule type.
4. Add conditions using the toggles — **Time Slot**, **Group Size**, **Date Range**,
   **Day of Week**. A rule with no conditions matches every booking.
5. Fill the action fields for the type you chose.
6. Set **Priority** and leave **Active** on.
7. Save.

## Conditions

| Condition | What it matches |
|---|---|
| Time Slot | The booking's start time must be one of the selected slot times. Slot options are generated from the activity's operating window. |
| Group Size | Number of participants, using *At least*, *At most* or *Exactly*. |
| Date Range | The booking start date falls between From and To. With **Recurring every year** on, you pick month/day pairs and the range repeats annually, including ranges that wrap year-end. |
| Day of Week | The booking start date falls on one of the ticked days. |

All conditions on a rule must match for the rule to apply. Dates and times are
compared in **your school's local time** — the same clock the slot times are
labelled with — so a rule for Saturday means your Saturday.

## Actions

| Rule type | Action fields | Enforced? |
|---|---|---|
| Deposit Required | Deposit Amount, Deposit Type (Fixed Amount / Percentage), Customer Message | Yes — sets the booking's required deposit. Percentage is a percentage of the booking total. |
| Price Override | Price Override | No — saved, never applied. |
| Min Group Size | (group-size conditions) | No — saved, never applied. |
| Blocked | Customer Message | No — saved, never applied. Does not block anything. |

## Known limitations

- **Three of the four rule types are inert.** Only Deposit Required reaches the
  booking. A Blocked rule in particular gives no warning that it will never fire.
- **The Customer Message action is stored but not shown to customers** anywhere in
  the booking flow.
- **A rule cannot lower a deposit to zero by matching with no amount.** A matching
  deposit rule with no amount leaves whatever deposit is already on the booking.

## Related

- [Price an activity](activity-pricing.md)
- [Close dates and change capacity](manage-availability.md)
- [Booking settings and automation](booking-settings.md)
