Status: Accepted (in force). Reconstructed from implementation.

Context

Payroll must be reviewed before it's real. Admins need to see exact take-home and company cost, adjust (add changes, skip people), and re-check — all without producing live records or moving money.

Decision

A two-phase model:

  1. Prepare computes everything into TempPayrollItems / TempPayrollItemSummaries (preview/staging). Nothing live changes. Re-preparing calls spRollbackPayrollPreview to wipe the temp set and recompute.
  2. Submit copies the preview into the live PayrollItems / PayrollItemSummaries and enters approval + payment.

Read endpoints come in matched pairs — a live family (Select…PayrollItem…) and a preview family with a Temp infix (Select…TempPayrollItem…).

Consequences

Good:

Bad / costs:

Alternatives considered