# OC Prime - New Temp Permit Functionality

<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>

## Why We Built This

Every setting below exists to solve a specific problem we heard from customers. Keep these in mind as you read — they're the "why" behind the "how":

- Duration-First Selection — parkers pick their date and time first, and the system automatically applies the cheapest available rate. No more manually choosing between permit types.
- Early Bird Sale Windows — reward parkers who buy ahead of a deadline with a lower rate that disappears once the window closes.
- The Rate Stacker — bill accurately for stays that span more than one rate type (e.g., a few hourly hours followed by an evening flat rate), instead of forcing the whole stay onto a single rate.
- The Overnight Bridge — keep overnight stays valid instead of having permits expire at midnight regardless of when the lot actually reopens.
- Speed and scale for admins — Reusable Pricing Templates and the Visual Block Painter cut down the time it takes to price many lots individually.
- Event and exception pricing — Layered Priority lets admins override standard pricing for a one-off event without rebuilding the whole template.
- Hidden or restricted pricing — promo codes and password-protected templates support scenarios like volunteer rates or private group rates without exposing them to the general public.

## Setup and Configuration

#### Enable This Feature

To enable the new booking flow feature you must turn the feature on from the Rate Template Tab in Lot admin.

1. Navigate to the **Lot Admin** page and chose your lot.
2. Click on the **Rate Template** tab.
3. Toggle on **Enable new temp permits for this lot**.

<p class="callout info">This is where you build the "shape" of your pricing — painting different scenarios (peak hours, overnight, weekends) directly onto a calendar instead of configuring rules in the abstract.  
</p>

### 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

<p class="callout info">Use this when you want one flat price for a stretch of time, or want to reward early purchases with a rate that disappears after a cutoff — this is what powers Early Bird Sale Windows.</p>

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

<p class="callout info">This is where you decide who can use a given template, and how many permits it can cover — useful for scenarios like staff-only rates or capacity-limited event pricing.</p>

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

<p class="callout info">Layers let you handle exceptions without rebuilding your whole pricing — e.g., a holiday rate that should always win, layered on top of your everyday template.</p>

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

<p class="callout info">This determines whether a parker is charged for exactly the time they used, or a flat fee no matter when they arrived — worth understanding so you can explain a charge if a parker asks about it.</p>

- **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

<p class="callout info">The goal on the parker side is getting from "I need to park" to "I'm parked" in as few taps as possible, while still surfacing special offers to those who qualify.</p>

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

<p class="callout info">Built for scenarios like volunteer parking, private group rates, or limited-time discounts — visible only to people who have the code.</p>

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)

**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.

### Concept Overview

<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);">**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>