Recording time spent waiting does not automatically determine an amount owed. I wanted observed facts and agreement-dependent values to remain separate inputs.

The actual production log explicitly limits the tool to confirmed dispatch and agreement values rather than invented standard rates. This story explains that decision and a new synthetic calculation, not current legal or tax guidance.

Show which time was removed

The original inputs separate start and end, excluded time and a free portion. The new function first calculates elapsed minutes, removes exclusions and then the free portion, flooring the proposed billable time at zero. Output retains enough stages to explain why that number differs from the original clock interval.

The function cannot decide whether a period legally or contractually qualifies as waiting, or whether it satisfies actual rest requirements. It grants no authority to exclude time. A caller supplies reviewed values. Making those stages inspectable helps compare a proposed request with the underlying recorded facts later.

Proportional and started-unit rates are different agreements

A confirmed hourly amount can be prorated by minutes, or a declared amount can apply to each started interval. These agreements can produce different results for the same observed time. The model therefore requires an explicit mode and rejects leftover rate fields belonging to the inactive mode.

The actual agreement determines the appropriate method. There is no built-in statutory rate or universally free interval. The shared contract also excludes tax calculation, making it narrower than the original tool. A smaller readable example should expose that boundary rather than masquerade as a complete reconstruction of the operational form.

The same seventy minutes can produce different proposals

The fixed example runs from nine to eleven thirty: one hundred fifty minutes, minus twenty excluded and sixty free, leaving seventy. A synthetic hourly value of thirty-six yields forty-two proportionally. A value of eighteen per started thirty-minute unit yields fifty-four across three units.

These are demonstration values rather than transport rates. Explicit work and expense rows add separate amounts. In the proportional example, waiting forty-two plus work fifty and expense eight totals one hundred. The result is a proposed request, not establishment of a debt, approval by another party or confirmation of payment.

Stop on an inconsistent basis

An end before the start, exclusions exceeding elapsed time, invalid dates and unsupported modes fail. Crossing midnight requires an explicitly entered next date; the code does not guess that an earlier clock reading means tomorrow. Convenience should not silently alter the recorded event.

Extra rows require synthetic identifiers, positive whole quantities and declared unit prices. Duplicate identifiers within a row type are rejected, but different identifiers can still describe the same underlying expense. Evidence sufficiency remains a separate review. Executable arithmetic is not evidence that every original record and agreement was reviewed automatically.

Keep the name proposal meaningful

Tests compare both rate methods, excess free time, invalid exclusions, inactive rate fields and extra-row totals. Output keeps proposal_only true and entitlement_decided false. No company name, counterpart contact, work photograph or original receipt enters the public package. The evidence is a synthetic code run.

Other time-based services may need the same separation among observation, agreement variables and requested amount. Actual transmission, acknowledgement and payment require distinct states. I consider a restrained action name part of implementation: it helps people understand what they prepared and what still needs confirmation instead of letting arithmetic imply a completed business outcome.