Skip to content

INSP · Inspections

One inspections table holds every kind: initial, checkpoint, handover, return and preparation. Each has checklist items, photos and damages. A damage can become a charge on the driver. Code INSP.

These questions are open in #83. Each gets a rule with a new ID once it is answered.

  • INSP open 1 · Damage price

R-INSP-01 · An inspection answers each checklist item at most once

Section titled “R-INSP-01 · An inspection answers each checklist item at most once”
  • Status: planned
  • Example: given a checkpoint with an answer for the front tyres, when a second answer for the front tyres is saved on it, then it is refused.
  • Refusal: none: unique_violation (23505).
  • Who: every writer.
  • Source: D9 (P4).

R-INSP-02 · A checklist item graded K (yellow) or M (red) has a note

Section titled “R-INSP-02 · A checklist item graded K (yellow) or M (red) has a note”
  • Status: planned
  • Example: given a checkpoint, when the wipers are graded M with no note, then it is refused; graded H (green), no note is needed.
  • Refusal: none: check_violation (23514).
  • Who: every writer.
  • Source: [Ref] Data model V13: inspection_items.

R-INSP-03 · Only a return inspection has a return reason

Section titled “R-INSP-03 · Only a return inspection has a return reason”
  • Status: planned
  • Example: given a checkpoint inspection, when it is saved with return_reason accident, then it is refused.
  • Refusal: none: check_violation (23514).
  • Who: every writer.
  • Source: [Ref] Data model V13: inspections.

R-INSP-04 · A BASTK number is unique within the organization

Section titled “R-INSP-04 · A BASTK number is unique within the organization”
  • Status: planned
  • Example: given a handover with a BASTK number, when a second inspection with the same number is saved in the organization, then it is refused.
  • Refusal: none: unique_violation (23505).
  • Who: every writer.
  • Source: [Ref] Data model V13: inspections.

R-INSP-05 · A damage that isn't charged to the driver records who decided that

Section titled “R-INSP-05 · A damage that isn't charged to the driver records who decided that”
  • Status: planned
  • Example: given a scratch found at return, when charge_driver is switched off with no charge_decided_by, then it is refused.
  • Refusal: none: check_violation (23514).
  • Who: every writer.
  • Source: [Ref] Data model V13: inspection_damages.

R-INSP-06 · A rented car's next checkpoint is due checkpoint_interval_days after its last checkpoint, or after its handover when it has none, in the pool's date

Section titled “R-INSP-06 · A rented car's next checkpoint is due checkpoint_interval_days after its last checkpoint, or after its handover when it has none, in the pool's date”
  • Status: planned
  • Example: given a PML car handed over on 2026-10-01 with no checkpoint since, and an interval of 14 days, when v_checkpoint_due is read, then its next checkpoint is due on 2026-10-15; if pool PML sets 10 days, it is due on 2026-10-11.
  • Refusal: none.
  • Who: v_checkpoint_due and everything that reads it: the checkpoint list, the gate.
  • Source: D9 (S2); [Ref] Database rules and conventions, Views.

R-INSP-07 · Reading inspections needs inspection:read at their pool

Section titled “R-INSP-07 · Reading inspections needs inspection:read at their pool”
  • Status: planned
  • Example: given a finance user at PML, when she reads inspections, then nothing comes back; a checker at PML sees them.
  • Refusal: none: hidden.
  • Who: super_admin, admin, admin_fleet, maintenance, asuransi, checker and viewer hold inspection:read.
  • Source: [Ref] Roles, policy matrix.

R-INSP-08 · Recording an inspection needs inspection:write at its pool

Section titled “R-INSP-08 · Recording an inspection needs inspection:write at its pool”
  • Status: planned
  • Example: given a maintenance user at PML, when he records a checkpoint, then it is refused; a checker at PML may.
  • Refusal: none: insufficient_privilege (42501) on insert; no effect on update.
  • Who: super_admin, admin, admin_fleet and checker hold inspection:write.
  • Source: [Ref] Roles, policy matrix.

R-INSP-09 · Recording a handover or a return needs inspection:handover at its pool

Section titled “R-INSP-09 · Recording a handover or a return needs inspection:handover at its pool”
  • Status: planned
  • Example: given a checker at SBY, when she records a handover at PML, then it is refused; a checker at PML may.
  • Refusal: none: insufficient_privilege (42501) on insert; no effect on update.
  • Who: super_admin, admin, admin_fleet and checker hold inspection:handover.
  • Source: [Ref] Roles, policy matrix.