Publish timesheet norms

Publishes resolved weekly norms and holidays for each employee so the timesheet calendar always has data for the next ~13 weeks.

How it works

Each employee’s weekly norm (expected working minutes per day) and holiday list are pre-computed and stored as events so the timesheet UI can read them without recomputing on every page load. This job advances that forward edge one week at a time:

  1. Picks candidates — active or pending employees whose forward edge is below the target horizon
  2. Computes a week — for each missing ISO week, resolves the norm and holidays from the employee’s current employment terms and work-time policy
  3. Emits a single batched event — one event per employee carries every newly resolved week
  4. Skips no-op weeks — when a week’s resolved values are identical to what was previously published, it is dropped from the batch (the cursor still advances)

On a non-Monday run, the bound did not move from the previous day, every active employee is already caught up, and the job does no work — by design.

When it runs

The job is registered as a daily scheduled job and always reports “should run”. Run cost is proportional to the number of employees whose cursor is behind the bound — on a healthy steady state, that’s only those who had a terms or policy change in the last 24 hours.

Parameters

ParameterDescription
ForceRe-emit every week in the emission window for every active or pending employee, ignoring the cursor and the per-week diff. Use this as an escape hatch when timesheet projections look out of sync with the configured terms/policies

Job results

MetricDescription
processedNumber of employees the job acted on
emittedNumber of week entries emitted across all events
candidatesNumber of employees the candidate query returned
skippedEmployees the job could not process (load errors)
forceWhether the run used the Force parameter

When to use Force

  • After a major change to work-time policies that should reflect retroactively
  • When the timesheet calendar appears to show wrong norms or missing holidays for active or pending employees
  • After restoring a backup or running a migration that touched terms/policies

Force re-emits weeks across the full window (from the start of each employee’s open statement, or the start of last month, up to the forward horizon). Expect the run to be longer and produce many more events than a normal run.

Troubleshooting

IssueSolution
Wrong norm shown on a future weekVerify the employment terms or work-time policy for that employee resolves to the expected value. Run with Force to re-publish
Holidays missing on the calendarCheck the holiday calendar attached to the work-time policy. Run with Force to refresh
New employee has no calendar dataActive and pending employees are picked up automatically on the next run. To bring an employee in immediately, run the job