Skip to content

Franchise pay rules, shared and locked

The rule

A franchisor sets the pay rules every franchisee follows: the pay calendar, and overtime past 8 hours a day. Franchisees may add their own rules (a location’s union contract, a premium for a site) but may not loosen the franchisor’s overtime.

Who uses it

Franchise systems, and any builder serving many tenants that must share a core of rules: a payroll provider maintaining a state’s rules as the law changes, or a group of companies with one policy for all of them.

How the recipe does it

No Lua of its own. The recipe is a package (package.toml): two layers, published once for the install and adopted by each franchisee.

name = "franchise"
version = "1.0.0"
[[layer]]
id = "pay"
settings = { pay_periods = { every_days = 7, from = "2026-10-05" } }
[[layer]]
id = "overtime"
order = 10
locks = ["*"]
[[layer.step]]
id = "daily"
uses = "standard/threshold"
params = { over = "8h", to = "overtime", window = "day" }

The builder publishes it, with its scenarios, which run on the server before it is active:

hourctl attend pkg publish attend-engine/cookbook/franchise_pay_rules --shared
hourctl -t franchisee-12 attend pkg adopt franchise@1

A franchisee following franchise@1 gets every compatible version as it is published (1.1.0, from the day it says); one that pins [email protected] keeps that version. The package’s layers come before the franchisee’s own, and locks = ["*"] locks every setting and step of the overtime layer: a franchisee’s layer that changes the daily step is refused when it is added. A location adds its own layer for the people working there with an eligibility rule:

{ "id": "downtown", "revision": 1, "applies_to": "location = downtown",
"steps": [{ "add": { "id": "weekly", "uses": "standard/threshold",
"params": { "over": "38h", "to": "overtime", "window": "week" } } }] }

Parameters

SettingMeaning
locks* for every setting and step of the layer, or setting:<key>, step:<id>.
orderWhere the layer applies among the package’s: the lowest first.

What the scenarios show

  • the-franchise-overtime-applies: a 10-hour day is 8 of work and 2 of overtime, stamped with the package’s version and layer.
  • a-location-adds-its-own-layer: the downtown location’s 38-hour week makes Friday’s last 2 hours overtime, on top of the franchise’s rule.
  • a-location-cannot-loosen-the-overtime: a layer changing the locked step is refused, saying which layer locks it.

This is a common way franchise systems share pay rules; whether a franchisor may set its franchisees’ pay rules, and who is the employer, is a question for counsel where you operate.

Get the recipe

The recipe’s package and its scenarios are in the example packages repository: attendance/franchise_pay_rules. 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:

franchise_pay_rules/package.toml
name = "franchise"
version = "1.0.0"
description = "A franchisor's pay rules: weekly pay periods, and overtime past 8 hours a day, locked."
[[layer]]
id = "pay"
settings = { pay_periods = { every_days = 7, from = "2026-10-05" } }
[[layer]]
id = "overtime"
order = 10
locks = ["*"]
[[layer.step]]
id = "daily"
uses = "standard/threshold"
params = { over = "8h", to = "overtime", window = "day" }

Scenarios

Each scenario gives a person’s punches and setup and the timecard they must produce, worked out with this package adopted (the format).

One location adds its own layer, for the people working there: overtime past 38 hours a week, on top of the franchise's daily rule. Five 8-hour days there make Friday's last 2 hours overtime
scenarios/a-location-adds-its-own-layer.toml
description = "One location adds its own layer, for the people working there: overtime past 38 hours a week, on top of the franchise's daily rule. Five 8-hour days there make Friday's last 2 hours overtime"
[policy]
zone = "America/Chicago"
[[location]]
id = "downtown"
zone = "America/Chicago"
[[employment]]
effective = "2026-01-05"
kind = "hired"
location = "downtown"
[[layer]]
id = "downtown"
applies_to = "location = downtown"
[[layer.step]]
id = "weekly"
uses = "standard/threshold"
params = { over = "38h", to = "overtime", window = "week" }
[[punch]]
at = "2026-10-05 08:00"
kind = "in"
[[punch]]
at = "2026-10-05 16:00"
kind = "out"
[[punch]]
at = "2026-10-06 08:00"
kind = "in"
[[punch]]
at = "2026-10-06 16:00"
kind = "out"
[[punch]]
at = "2026-10-07 08:00"
kind = "in"
[[punch]]
at = "2026-10-07 16:00"
kind = "out"
[[punch]]
at = "2026-10-08 08:00"
kind = "in"
[[punch]]
at = "2026-10-08 16:00"
kind = "out"
[[punch]]
at = "2026-10-09 08:00"
kind = "in"
[[punch]]
at = "2026-10-09 16:00"
kind = "out"
[expect]
week = "2026-10-05"
allocations = [
"2026-10-05 08:00-16:00 work 8.00",
"2026-10-06 08:00-16:00 work 8.00",
"2026-10-07 08:00-16:00 work 8.00",
"2026-10-08 08:00-16:00 work 8.00",
"2026-10-09 08:00-14:00 work 6.00",
"2026-10-09 14:00-16:00 overtime 2.00",
]
stamps = ["2026-10-09 14:00-16:00 overtime: weekly [downtown rev 1]: moved 2h from work to overtime: over 38h in the week"]
A location's layer that would move the franchise's overtime to 10 hours a day is refused: the franchise locks every setting and step of its overtime layer
scenarios/a-location-cannot-loosen-the-overtime.toml
description = "A location's layer that would move the franchise's overtime to 10 hours a day is refused: the franchise locks every setting and step of its overtime layer"
[policy]
zone = "America/Chicago"
[[layer]]
id = "lenient"
[[layer.step]]
id = "daily"
change = "params"
params = { over = "10h" }
[[punch]]
at = "2026-10-06 08:00"
kind = "in"
[[punch]]
at = "2026-10-06 18:00"
kind = "out"
[expect]
week = "2026-10-05"
error = "layer lenient changes step daily, which [email protected] (its layer overtime) locks"
A franchisee adopting the franchise's pay rules: a 10-hour day is 8 hours of work and 2 of overtime, by the package's locked layer
scenarios/the-franchise-overtime-applies.toml
description = "A franchisee adopting the franchise's pay rules: a 10-hour day is 8 hours of work and 2 of overtime, by the package's locked layer"
[policy]
zone = "America/Chicago"
[[punch]]
at = "2026-10-06 08:00"
kind = "in"
[[punch]]
at = "2026-10-06 18:00"
kind = "out"
[expect]
week = "2026-10-05"
allocations = ["2026-10-06 08:00-16:00 work 8.00", "2026-10-06 16:00-18:00 overtime 2.00"]
stamps = ["2026-10-06 16:00-18:00 overtime: daily [[email protected]/overtime rev 1]: moved 2h from work to overtime: over 8h in the day"]