Car Park Rules Engine

C# .NET · MVC · Rules engine · Azure SQL

Car Park Rules Engine

Works out what a parking visit costs and whether it's an overstay, by running the car park's rules in priority order: free parking windows, grace periods, no-return limits, paid time and validation.

Evaluate a parking session

Pick an example or enter your own. Nothing is saved: the session is only checked against the rules.

About this demo

The database is on a low-cost tier that sleeps when unused, so the first request can take 30 to 90 seconds.

How the rules work

  1. Each car park has a list of rules, each with a priority.
  2. A rule can apply to every car, or only to a group of registrations, and only in a time window.
  3. The engine checks the rules in priority order; the first one that matches decides the charge.
  4. It also looks up the car's previous exit, so a quick return can break a no-return rule.
  5. The result shows every step it took (the trace).

Architecture for a car park rules engine

Click the diagram to open it full size.