WebKiosk/Rental Profiles

From CasperTech Wiki
Revision as of 04:04, 14 March 2018 by D1cd5b71-6209-4595-9bf0-771bf689ce00 (talk | contribs) (Protected "Rental Profiles" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
Jump to navigation Jump to search

NOTE This page relates to upcoming features and should not be used yet.

Rental Profiles are a nifty way of "selecting" units for display in our rental vendors and web kiosks. They're basically stored searches, which are intelligently cached by our servers to ensure that everything runs as quickly as possible.

What do they do?

By default, our rental vendors and kiosks will display all of your rentals. Rental profiles allow you to add rules to specify which units you want to display.

How do rules work?

You add any number of rules which the system interprets to filter your rental units.

The first option is include or exclude. Include rules are ran first, and units matching ANY of the "Include" rules are included in the profile. Exclude rules are ran last, and any of the previously included units which match these rules are thrown out.

The next option is the where clause, which is the type of search the rule is doing - you can search by Owner Name, Owner UUID, Unit Name, Unit UUID, Unit Group, or Region Name.

After that, comes the condition clause - which allows you to match as "equals", "contains", "doesn't equal" or "doesn't contain".

Finally, there's the term - which is the search query. You can enter some text.

Example

If I want to include units owned by "Casper Warden", but not those which include "demo" in the name, I would add two rules:

Rule #0: Include units where Owner Name equals "Casper Warden" Rule #1: Exclude units where Unit Name contains "Demo"

Testing

After you have added the rules, the system will perform a "test query" and will show you how many units were found, as well as how long the query took. Currently there is no limit on query time, however a limit may be enforced in the future.

Technical stuff

When a new rental unit is added, deleted, or a rental state change occurs, the system first tests each of your profiles against that single unit key to see if the unit is "included" in the profile.

If a match is found, then the full profile is regenerated, and cached.

This means that a query is not performed every time someone browses a vendor or loads the units on the website, but instead only when the data is stale. This keeps everything running quickly despite the complex queries involved.