Line, note, vendor, sign-off and clock writes on a job

Featurekamo-shared-library
Ya
27 Agosti 2026, 09:53 UTC
Mwandishi
Kamo
Ahadi ya
610fd46

SW6b Task 3, library half. Eight new operations on ServiceJobService, plus the wire records for them and the three reads the detail page needs. Three things the server owns and no client may send: - The totals. labourTotal, materialTotal and total are recomputed from the job's lines on every line write, and a line's own total is quantity x unitAmount. LineInput has no total member and JobInput no longer has the job's three. They were on JobInput when SW6a shipped because there was nothing to derive them from; leaving them once there was would be a second door straight past the rule. **************** is what the far side of that door looks like -- it takes a subtotal off the request AND adds its line totals to it, so a client sending both gets a figure that matches neither, which is the failure QuoteTotals' javadoc exists to name. - The sign-off timestamp. signOff stamps signoffAt when the flag goes true and clears it when it goes false, so the pair can never disagree. SignoffInput carries a boolean and free text and no time. - The clock. clockVisit stamps actualStart/actualEnd AND moves the visit's status with them -- ON_SITE in, COMPLETED out. A clock-out with no clock-in is an IllegalStateException naming the visit's state (409 at the controller): an end with no beginning contributes zero to totalLabourMinutes, so the symptom would be a time sheet short by a day with nothing saying so. A second clock-in is refused too; a second stint is a second visit. Every child is resolved with its job uid AND the org as predicates in ONE query -- findByUidForJob on the line, vendor and visit repositories. Resolving by uid and org alone would make DELETE /{jobUid}/lines/{lineUid} reach any line in the org through a URL that looks entirely correct. JobView gains lines/notes/vendors: null in the list projection (not loaded), always filled in the detail projection (empty means none). Loading them per row would read four tables to paint a grid that shows none of it. Mutation-tested: 9 mutations of this file, each producing a distinct named failure -- dropping the recompute, adding line totals on top of the stored figure, dropping the clock-out guard, not moving the visit status, not stamping the sign-off, not clearing it, and resolving each of the three children by uid alone.

Mabadiliko yote

Je, unaona nini kuhusu usafiri?

Kila moja ya hizi updates ardhi katika nafasi yako ya kazi moja kwa moja. Kuanza bure na kuangalia kukua wiki baada ya wiki.

Kuwa Huru MileleMtazamo wa bei