Skip to content

A punch's path

A punch crosses both engines on its way to a pay period’s ledger.

Connect turns what the clock sent into a stored, neutral event. It also says whom the punch is for. The outbox hands the event on. Time and Attendance keeps it as a fact and works it into a ledger. No step changes what came before it. So you can trace any number back to the punch it came from.

Clock keeps the punch until answered its own protocol Connect Protocol package reads it: a punch event Store committed, then the clock gets OK Outbox each sink in order, at least once signed webhook Your systems deduplicate on the event id time sink in the program Time and Attendance Other facts corrections, entries, approvals Setup and policy dated; policies and rules Punch fact kept as it came kept once Attendance store per tenant, each fact once worked out again Pay period ledger lines, carried hours days, weeks, reports, exports: sums of its lines, never worked out again
The time sink is an ordinary sink. The outbox feeds it like any webhook, in order. It hands the punches to Time and Attendance running in the same program.
  1. The clock sends the punch in its own protocol and keeps it until it is answered. A clock that cannot reach the server stores punches and uploads them later. So an outage delays punches rather than dropping them.
  2. The protocol package reads it. The package for the endpoint turns the message into events with neutral fields. The event is a punch. It holds the person’s clock user id, the instant and its zone. It also holds what the clock reported with it, such as a work code (punch).
  3. The store commits it before the clock is answered. The message’s events, and everything else it changed, are saved together. Only then does the clock get its OK. If they cannot be stored, the clock is not answered and sends again.
  4. Connect says where it goes. This applies where the person’s sync group keeps people. The punch is routed as it arrives. The person’s route to a receiving system gives the tenant there and the person’s id there. The punch carries both (data.route).
    • A person can have several routes, such as a worker placed by two agencies. Then the endpoint’s policy package picks one.
    • A punch with no route it can take is set aside as unrouted. It stays there until it is routed through the API. It is never copied to several places.
    • Someone enrolled at the clock and not linked yet can still punch. Their punches carry Connect’s own id for them.
  5. The outbox hands it on. Each sink gets its events in the order they were stored, at least once. A sink that is down holds up only itself. The same record always has the same event id, so receivers deduplicate on it.
    • The time sink feeds Time and Attendance. It speaks for the system attendance. It gets the punches routed there, each with the person’s id (person_id).
    • It names the tenant its punches are for. It carries one of that tenant’s delivery keys.

Nothing on this side decides anything about the time. It does not decide whether the person is late, which job the time is for, or whether it is overtime. Connect says only where a punch goes.

  1. The punch becomes a fact. A punch is kept as it came and never changed. It records these things:

    • when the person punched;
    • the kind of punch: in, out, lunch, break, transfer, or unknown when the clock does not say;
    • any labor context values picked with it;
    • when it was recorded.

    It belongs to the person the event’s person_id names. Sometimes a punch has no person_id, because the sender knows the person only by its own ids. Then the punch is kept for an unlinked person until someone says who they are. A punch from a clock takes the event’s id as its own. So a punch uploaded twice stays one fact (from punch event to punch fact). Punches can also come from the web, mobile apps, imports and entry by hand.

  2. The store keeps it. The attendance store keeps each fact once, per tenant and person. The same punch sent again changes nothing. A new punch makes the person’s affected ledgers get worked out again (recalculation).

  3. Other facts lie beside it. A supervisor’s correction does not edit the punch. It is another fact laid over it. Labor entries, approvals, period closes, employment changes and leave requests are facts too (three kinds of information).

  4. The ledger is worked out. Three things go through fixed stages:

    • the pay period’s facts;
    • the setup in force;
    • the policy, meaning the policy layers whose eligibility rules pick the person that day.

    The result is ledger lines. Each line is time in a pay category, against a labor context. Hours are in decimals that add up exactly.

  5. Everything shown is a sum of ledger lines. A day, a week, a category, a report or an export adds lines up. None works time out again, so the numbers match.

A late punch, a correction and a changed policy are handled the same way. The ledger is worked out again. Approvals that no longer match say so.

Some changes matter to other systems: an exception raised or resolved, a timecard approved, a period closed. These go out as events to Time and Attendance’s own sinks. A change to a period already closed becomes an adjustment.

StepWhat existsChanged by
ClockThe clock’s own record.Nothing: the clock keeps it until answered.
StoreA punch event, neutral JSON, with an id, and where it goes.Nothing: events are kept as stored, and removed after retention_days once every sink they are for has taken them. A punch routed later is sent again with the same id and its route.
SinkThe same event, at least once, in stored order.Nothing; the receiver deduplicates.
FactA punch, with its origin, kept once in the attendance store.Nothing: a correction is a new fact over it.
LedgerLines derived from the facts.Never edited: worked out again when facts, setup or policy change.