A remote site allowance set on the organization tree
The rule
Work at a remote site earns an allowance for every hour worked there. The amount belongs to the site: a region sets one amount for all its sites, and a site that is harder to reach sets its own. Someone who moves between sites earns each site’s allowance for the days they work there.
Who uses it
Mining, oil and gas, construction and utilities: remote area or isolation allowances in Australia, Canada, Norway, Chile and elsewhere; also city weighting (a London allowance) and any premium that depends on where in the organization someone works.
How the recipe does it
The tenant keeps its sites as a hierarchy (sites), and the allowance
as metadata on the organizations that set it:
[[organization]]hierarchy = "sites"id = "north"parent = "wa"metadata = { remote_allowance = 250 }The engine never reads an organization’s metadata: policies do. Here the
package (package.toml) has one layer for everyone with the standard
allowance step, its amount taken from the tree:
[[layer]]id = "remote"[[layer.step]]id = "remote"uses = "standard/allowance"params = { per_hour_from = { hierarchy = "sites", key = "remote_allowance" }, pay = "allowances", category = "remote_allowance" }For each day’s work, the step finds where the person is that day in the
sites hierarchy and takes the amount from that site, or from the
nearest organization above it that has one, as the tree was that day.
The day’s worked time earns that amount an hour. Time is grouped by
amount and the money worked out once for each over the pay period, as
money in a money measure.
An employment change places the person at another site from a day, and a move of an organization puts it under another parent from a day; both work the person out again from that day. Changing an organization’s metadata works out again everyone under it from now.
Where the allowance is a rule rather than a number (everyone under the
north region), an eligibility rule on a layer does it, with one
per_hour for the layer: applies_to = "under sites:north". Metadata
suits a number each site sets for itself, kept by the app that manages
the sites.
What your setup needs
Set up before you adopt the recipe; the recipe’s steps read them by name, and adopting it is refused, with a list of what is missing, until they exist.
- A measure called
allowances: the amount the recipe adds up (money in a currency, or a count).
The scenarios show each as it was set up for them.
Parameters
| Parameter | Meaning |
|---|---|
per_hour_from | Where the amount an hour is kept: the hierarchy of sites (sites) and the metadata key holding it, in minor units (remote_allowance). |
pay | The money measure the allowance is added in. |
category | The category of the money lines. |
What the scenarios show
a-site-takes-its-regions-allowance: a site with no amount takes its region’s, 40 hours at 2.50.a-site-sets-its-own: a site’s own amount, 4.00, over the region’s.a-move-to-the-mine-mid-week: from Wednesday only.the-office-earns-none: no organization up the chain sets one.
Legal note
Allowances are usually set by awards, agreements or employment contracts, and some count toward the rate overtime is paid at. Check the rules where you operate.
Get the recipe
The recipe’s package and its scenarios are in the example packages repository: attendance/site_allowance. Test it, or your own copy of it, with hourctl attend test, and publish it with hourctl attend pkg publish.
The policy package
The package’s layers, with the standard steps each one runs and their settings:
name = "site_allowance"version = "1.0.0"description = "Every hour worked at a remote site earns the allowance set on the site, or on the nearest region above it, in the organization tree."
# What the tenant must have set up for the recipe: the steps read these by name.[needs]measures = ["allowances"]
# Everyone: each day's worked time earns the amount an hour kept as# remote_allowance on the person's site that day, or on the nearest# organization above it with one, in the sites hierarchy.[[layer]]id = "remote"[[layer.step]]id = "remote"uses = "standard/allowance"params = { per_hour_from = { hierarchy = "sites", key = "remote_allowance" }, pay = "allowances", category = "remote_allowance" }Scenarios
Each scenario gives a person’s punches and setup and the timecard they must produce, worked out with this package adopted (the format).
Someone at the Perth office, which pays no allowance, moves to the mine on Wednesday: Monday and Tuesday earn nothing, Wednesday and Thursday 20 hours at 2.50, 50.00
description = "Someone at the Perth office, which pays no allowance, moves to the mine on Wednesday: Monday and Tuesday earn nothing, Wednesday and Thursday 20 hours at 2.50, 50.00"
punch = [ { at = "2026-10-05 07:00", kind = "in" }, { at = "2026-10-05 17:00", kind = "out" }, { at = "2026-10-06 07:00", kind = "in" }, { at = "2026-10-06 17:00", kind = "out" }, { at = "2026-10-07 07:00", kind = "in" }, { at = "2026-10-07 17:00", kind = "out" }, { at = "2026-10-08 07:00", kind = "in" }, { at = "2026-10-08 17:00", kind = "out" },]
[policy]zone = "Australia/Perth"pay_periods = { every_days = 7, from = "2026-10-05" }
[[measure]]id = "allowances"kind = "money"currency = "AUD"
# The sites: the north region pays 2.50 an hour at every site under it,# and camp 2, the most remote, 4.00. The Perth office pays none.[[organization]]hierarchy = "sites"id = "wa"
[[organization]]hierarchy = "sites"id = "north"parent = "wa"metadata = { remote_allowance = 250 }
[[organization]]hierarchy = "sites"id = "pilbara-mine"parent = "north"
[[organization]]hierarchy = "sites"id = "camp-2"parent = "north"metadata = { remote_allowance = 400 }
[[organization]]hierarchy = "sites"id = "perth-office"parent = "wa"
[[employment]]effective = "2026-01-05"kind = "hired"organizations = { sites = "perth-office" }
[[employment]]effective = "2026-10-07"kind = "changed"organizations = { sites = "pilbara-mine" }
[expect.period]day = "2026-10-05"quantities = ["2026-10-08 allowances 50.00 AUD remote_allowance"]Camp 2 sets its own allowance, 4.00 an hour, over the region's: the nearest organization with one decides. 40 hours earn 160.00
description = "Camp 2 sets its own allowance, 4.00 an hour, over the region's: the nearest organization with one decides. 40 hours earn 160.00"
punch = [ { at = "2026-10-05 07:00", kind = "in" }, { at = "2026-10-05 17:00", kind = "out" }, { at = "2026-10-06 07:00", kind = "in" }, { at = "2026-10-06 17:00", kind = "out" }, { at = "2026-10-07 07:00", kind = "in" }, { at = "2026-10-07 17:00", kind = "out" }, { at = "2026-10-08 07:00", kind = "in" }, { at = "2026-10-08 17:00", kind = "out" },]
[policy]zone = "Australia/Perth"pay_periods = { every_days = 7, from = "2026-10-05" }
[[measure]]id = "allowances"kind = "money"currency = "AUD"
# The sites: the north region pays 2.50 an hour at every site under it,# and camp 2, the most remote, 4.00. The Perth office pays none.[[organization]]hierarchy = "sites"id = "wa"
[[organization]]hierarchy = "sites"id = "north"parent = "wa"metadata = { remote_allowance = 250 }
[[organization]]hierarchy = "sites"id = "pilbara-mine"parent = "north"
[[organization]]hierarchy = "sites"id = "camp-2"parent = "north"metadata = { remote_allowance = 400 }
[[organization]]hierarchy = "sites"id = "perth-office"parent = "wa"
[[employment]]effective = "2026-01-05"kind = "hired"organizations = { sites = "camp-2" }
[expect.period]day = "2026-10-05"quantities = ["2026-10-08 allowances 160.00 AUD remote_allowance"]Four 10-hour days at the Pilbara mine, which sets no allowance of its own: it takes the 2.50 an hour of the north region above it, 100.00 for the 40 hours
description = "Four 10-hour days at the Pilbara mine, which sets no allowance of its own: it takes the 2.50 an hour of the north region above it, 100.00 for the 40 hours"
punch = [ { at = "2026-10-05 07:00", kind = "in" }, { at = "2026-10-05 17:00", kind = "out" }, { at = "2026-10-06 07:00", kind = "in" }, { at = "2026-10-06 17:00", kind = "out" }, { at = "2026-10-07 07:00", kind = "in" }, { at = "2026-10-07 17:00", kind = "out" }, { at = "2026-10-08 07:00", kind = "in" }, { at = "2026-10-08 17:00", kind = "out" },]
[policy]zone = "Australia/Perth"pay_periods = { every_days = 7, from = "2026-10-05" }
[[measure]]id = "allowances"kind = "money"currency = "AUD"
# The sites: the north region pays 2.50 an hour at every site under it,# and camp 2, the most remote, 4.00. The Perth office pays none.[[organization]]hierarchy = "sites"id = "wa"
[[organization]]hierarchy = "sites"id = "north"parent = "wa"metadata = { remote_allowance = 250 }
[[organization]]hierarchy = "sites"id = "pilbara-mine"parent = "north"
[[organization]]hierarchy = "sites"id = "camp-2"parent = "north"metadata = { remote_allowance = 400 }
[[organization]]hierarchy = "sites"id = "perth-office"parent = "wa"
[[employment]]effective = "2026-01-05"kind = "hired"organizations = { sites = "pilbara-mine" }
[expect.period]day = "2026-10-05"quantities = ["2026-10-08 allowances 100.00 AUD remote_allowance"]At the Perth office no organization from it up sets an allowance: the week earns none
description = "At the Perth office no organization from it up sets an allowance: the week earns none"
punch = [ { at = "2026-10-05 07:00", kind = "in" }, { at = "2026-10-05 17:00", kind = "out" }, { at = "2026-10-06 07:00", kind = "in" }, { at = "2026-10-06 17:00", kind = "out" }, { at = "2026-10-07 07:00", kind = "in" }, { at = "2026-10-07 17:00", kind = "out" }, { at = "2026-10-08 07:00", kind = "in" }, { at = "2026-10-08 17:00", kind = "out" },]
[policy]zone = "Australia/Perth"pay_periods = { every_days = 7, from = "2026-10-05" }
[[measure]]id = "allowances"kind = "money"currency = "AUD"
# The sites: the north region pays 2.50 an hour at every site under it,# and camp 2, the most remote, 4.00. The Perth office pays none.[[organization]]hierarchy = "sites"id = "wa"
[[organization]]hierarchy = "sites"id = "north"parent = "wa"metadata = { remote_allowance = 250 }
[[organization]]hierarchy = "sites"id = "pilbara-mine"parent = "north"
[[organization]]hierarchy = "sites"id = "camp-2"parent = "north"metadata = { remote_allowance = 400 }
[[organization]]hierarchy = "sites"id = "perth-office"parent = "wa"
[[employment]]effective = "2026-01-05"kind = "hired"organizations = { sites = "perth-office" }
[expect.period]day = "2026-10-05"quantities = []