Skip to content

D91 · One maintenance status for a car; whether it is TOP's or the insurer's, and where it is, come from its work order and claim

Proposed · 2026-11-09 · zuki, in a CTO session reviewing the vehicle lifecycle; it binds when this page's pull request is merged · Applies to vehicles.status, the vehicles step (R-VEH-28), the status history (R-VEH-31) and the work order flow (phase 6 of the business flow)

Decision: vehicle_status has one value, maintenance, in place of maintenance_internal and maintenance_insurance. The enum is edited in place (D11).

  • Who repairs it: the car's open work order. Its route is insurance for the insurer's repair; maintenance or pool_repair is TOP's. The checker team sets the route at the inspection, as today (R-WO-04, R-WO-07).
  • Where it is: a car TOP repairs stays in the pool (zuki, 2026-11-09). A car the insurer repairs is at its open claim's garage (insurance_claims.garage_id, always one of the insurer's partner garages) from the time it leaves through a garage_out gate pass until its garage_in; before that, it is still in the pool. The database gives each car's place in one read, so no screen works it out.
  • The screens keep v1's split. A car in maintenance shows as Undermaintain - TOP or Undermaintain - Asuransi from its work order's route, so the people using v1 see no change. It stays this way until the team leads say the split isn't needed.
  • The migration: v1's 2. Undermaintain - TOP and 3. Undermaintain - Asuransi both map to maintenance, for a car's status (R-VEH-28) and for its history (R-VEH-31). A history row loaded from v1 keeps v1's label as text, so the history screen can still show which it was.

Why: the two statuses answer neither question zuki needs answered: is the car in the pool, and if not, at which garage. A car waiting for its SPK or for pickup is maintenance_insurance but still in the pool, and the garage is on the claim, not the car. The route already holds TOP versus the insurer, so a second copy on the car's status can drift from it, the way 113 migrated cars already differ from their latest history row (R-VEH-31). One status, with the split read from the records that own it, keeps one source for each fact.

Consequences:

  • DOC (#578): R-VEH-28 and R-VEH-31 lose the two labels in their examples; new rules for when a car becomes maintenance and leaves it (from its work order's route), how the screens label it, and where the car is. Phase 6 of the business flow gains the maintenance step.
  • BE (#579): the enum, the vehicles step's value_map, the history's v1 label column (D84's naming), the place of a car in one read, and the pgTAP tests that name the old values. R-OPN-05's recorded status takes maintenance too.
  • FE: the status label reads the route, never the status alone.
  • v1's copy is unchanged: a count by v1 label still comes from it.