# New Temporary Permit Rate Templates

<p class="callout info">The Temporary Permit Rate Templates feature allows administrators to control pricing, eligibility, and special conditions for temporary parking permits on a per-lot basis. Its primary purpose is to define how temporary permit pricing is calculated using assignable templates with customizable hourly rates and priority layers. This article is intended for OPS-COM administrators.</p>

## Setup and Configuration

### Creating a Rate Template

1. Navigate to the **Rate Templates** admin page.
2. Click the **Create** button to open a blank template.
3. Select the **Brush** tool in the template editor to paint pricing onto hourly sections of the day.
4. Set a name, color, and price to add a new brush.
5. Edit existing brushes by adjusting their name, color, and price parameters.

<p class="callout success">**Unpainted Time Slots:** Any hourly section left unpainted is treated as not bookable. Users cannot book a permit or park in the lot during that time.</p>

### Fixed Rate Blocks and Early Bird Pricing

1. Hold **Ctrl** on your keyboard and click multiple time slots.
2. Choose the **Merge** option to create a fixed-rate block.
3. Configure a booking cutoff time using the **Sale End** field if you want the block to stop being bookable at that specific price after a certain time. Once the cutoff passes, the price reverts to whatever other layer applies for that time.
4. Scroll to the form at the bottom of the template page to edit all created blocks.

### Assigning Templates to a Lot

1. Navigate to the lot edit page and click the **Rate Templates** tab.
2. Enable the temporary permits feature for the specific lot.
3. Select at least one template to assign it to the lot.
4. Choose the specific user types in the eligibility list to define who can use this template. Only user types already enabled for the lot will appear.
5. Enter a password in the password protection field to restrict access to the template.
6. Enter a value for **Max Permits** to set the maximum number of permits sellable under this specific pairing.
7. Refresh the lot page after assignment to see the template applied.

## Using this Feature

### Layers and Priority Calculation

Each template can contain multiple layers, and each layer is assigned a priority on a per-day basis.

- **Same Priority Layers:** If two layers share a priority and their time blocks overlap, both are considered during price calculation. The system automatically selects the cheapest price for the current hour block.
- **Higher Priority Layers:** If a layer has a higher priority, its pricing always takes precedence over lower-priority layers, even if the lower priority is cheaper. A single hour block on a higher priority layer will be the only bookable slot for that day, though lower priority blocks on other days of the week will remain bookable.
- **Cross Template Calculation:** If a user qualifies for multiple templates on the same lot, the system calculates the price under each eligible template and automatically selects the cheapest. Layers from different templates are never combined. Administrators can use the admin-only **Price Calculator** tool on the template page to simulate a given time slot and view the full price breakdown.

### Proration Rules

- **Single Hourly Blocks:** These blocks are prorated. If a user arrives or leaves mid-hour, they are only charged for the portion of the hour actually used.
- **Fixed Rate Blocks:** These blocks are not prorated. Booking anywhere within the block requires paying the full block price, but grants the permit for the entire block duration.

<p class="callout warning">**Developer Note on Time Blocks:** The `sale_start`, `sale_end`, and `valid_until` fields on time blocks are time-only reference values stored against a placeholder date. **They must never be given a timezone cast.** Doing so causes the weekly rate grid to silently stop rendering saved blocks. A code comment flags this at the cast site and must not be removed.</p>

### User Booking Flow

1. Select a start time for the temporary permit.
2. Choose a quick option for the end time or select **Other** to pick a specific date.
3. Check the **Assign to all vehicles on profile** checkbox if the lot allows bookings longer than 30 days and a duration of 31 or more days is selected.
4. Enter a promo code or template password to unlock additional hidden templates.
5. Review the price breakdown overview.
6. Proceed to checkout to have the permit added to the cart.

### Promo Codes

Administrators can create a promo code tied to a specific lot and optionally restrict it to a specific template. Available configuration options include:

- **Discount Percentage**
- **Valid Date Range**
- **Usage Limit** (total number of redemptions)

<table data-path-to-node="22" id="bkmrk-concept-behavior-unp"><thead><tr><td>**Concept**</td><td>**Behavior**</td></tr></thead><tbody><tr><td><span data-path-to-node="22,1,0,0">**Unpainted time slot**</span></td><td><span data-path-to-node="22,1,1,0">Not bookable</span></td></tr><tr><td><span data-path-to-node="22,2,0,0">**Same priority layers overlapping**</span></td><td><span data-path-to-node="22,2,1,0">Cheapest price wins</span></td></tr><tr><td><span data-path-to-node="22,3,0,0">**Higher priority layer**</span></td><td><span data-path-to-node="22,3,1,0">Always wins, even if pricier</span></td></tr><tr><td><span data-path-to-node="22,4,0,0">**Fixed rate block**</span></td><td><span data-path-to-node="22,4,1,0">No proration, full price for any partial use</span></td></tr><tr><td><span data-path-to-node="22,5,0,0">**Single hourly block**</span></td><td><span data-path-to-node="22,5,1,0">Prorated to actual time used</span></td></tr><tr><td><span data-path-to-node="22,6,0,0">**Multiple eligible templates**</span></td><td><span data-path-to-node="22,6,1,0">Cheapest template auto-selected; no cross-template layer mixing</span></td></tr><tr><td><span data-path-to-node="22,7,0,0">**Promo code**</span></td><td><span data-path-to-node="22,7,1,0">One use per user per permit; freed up if permit is removed from cart</span></td></tr><tr><td><span data-path-to-node="22,8,0,0">**Max permits limits**</span></td><td><span data-path-to-node="22,8,1,0">Template maximum is a sub-limit within the lot's overall maximum</span></td></tr></tbody></table>

---

## <span style="color: rgb(22, 145, 121);">Best Practices and Considerations</span>

- <span style="color: rgb(22, 145, 121);">**Utilize higher priority layers for exceptions:** **Reserve higher priority layers for specific events like holidays**, ensuring special pricing always overrides standard rates.</span>
- <span style="color: rgb(22, 145, 121);">**Understand template limits:** **The template maximum permits setting is a sub-limit within the lot's overall maximum.** If multiple template assignments sum to more than the lot's overall limit, the system allows the intentional overlap but will display a warning message.</span>
- <span style="color: rgb(22, 145, 121);">**Promo code redemption rules:** Each user can redeem a given promo code once per permit. If a user removes that permit from their cart before purchasing, the code becomes usable again for a new permit.</span>
- <span style="color: rgb(22, 145, 121);">**Enforce booking windows:** Enable the 30-day limit restriction on the lot-level setting to block users from selecting dates beyond a 29-day window.</span>