Skip to content

Business flow

What happens to a driver and a car, in order. Each box starts with the step's node ID from the higher-ups' General Flow (the Whimsical board "[revised] general flow V2" and the General_Flow_Rules sheet, Node Rules and Transitions tabs), then names the step and the schema V13 tables it writes. Under each diagram, a table gives the rules that hold the steps; the rules themselves are on the rule pages, the tables on Data model.

The flow is taken in V13's terms (D41), as far as D42 to D47 and D63 to D64 settle it. A box with a dashed border is a step still open: it is drawn as it works today, and its issue is named under the diagram.

flowchart LR
  A["1 · Queue and lead<br/>DRV-01 to DRV-07"] --> B["2 · Admin fee and checks<br/>DRV-08 to DRV-17"]
  B --> C["3 · Book, train, hand over<br/>DRV-18 to DRV-21"]
  C --> D["4 · On the road<br/>COL-01 to COL-17, VEH-06 to VEH-12"]
  D --> E["5 · Return or repo<br/>VEH-13 to VEH-16, REP-01, COL-18"]
  E --> F["6 · Work order and preparation<br/>VEH-17 to VEH-29"]
  F -. "car ready again (VEH-28 → VEH-03)" .-> C
  E --> G["7 · Rejoin<br/>DRV-24 to DRV-27"]
  G -. "approved (DRV-25 → DRV-17)" .-> C
  B -. "rejected (DRV-06)" .-> X(["Driver leaves"])
Phase What happens Statuses that change
1 · Queue and lead The driver takes a ticket, staff call it, and the driver is registered as a lead. A blacklisted NIK is turned away. ticket: waiting → called → converted, skipped or closed; stage: lead
2 · Admin fee and checks Paying the admin fee opens a virtual and a visit check at once. A passed virtual check approves the driver without waiting for the visit. stage: screening → approved or rejected; rental: pending
3 · Book, train, hand over The car is booked and the contract signed, the driver is trained (v2 doesn't record it yet, D64), and the car is handed over and goes out. rental: booked → active; car: ready → booked → rented; stage: booked → listed
4 · On the road Rent is billed, payments are reconciled, the overdue limits are watched, a checkpoint is due every two weeks and ETLE is scanned weekly. A charged damage puts a surat hutang in Collection's hands. charge: open → partially_paid → paid (computed)
5 · Return or repo The driver returns the car, or the repo team recovers it. Rent stops the day the car is back; the BASTK ends the rental. The driver's stage follows the reason. rental: active → returning → ended, or active → repossessing → returned → ended (D67); car: returned; stage by reason
6 · Work order and preparation The reason routes the work order: an accident or a breakdown to a repair, anything else to preparation. Only the Preparation Leader's check makes the car ready, and only with a valid STNK. car: returned → not_ready → ready; work order: waiting → routed → repair_done → ready
7 · Rejoin A driver without a car asks to come back. The Driver Team takes them back to onboarding, or they become inactive. stage: inactive, or back to approved
flowchart TD
  S(["DRV-01 · Driver arrives at the pool"]) --> T["DRV-02 · Takes a queue ticket with their NIK<br/>queue_tickets · waiting"]
  T --> C["DRV-03 · Staff call the ticket<br/>queue_events · called"]
  C --> R{"DRV-04 · Driver answers?"}
  R -- "not there" --> K["DRV-05 · Ticket skipped<br/>queue_events · skipped"]
  K -- "fewer than max_queue_miss skips" --> C
  K -- "max_queue_miss skips" --> CL(["Ticket closed"])
  R -- "declines" --> RJ(["DRV-06 · Refused<br/>queue_tickets · refused"])
  R -- "there" --> L["DRV-07 · Registered as a lead<br/>drivers · stage lead<br/>queue_tickets · converted"]
  L --> F["Admin fee charged<br/>charges · admin_fee"]
  F --> BC(["To phase 2"])
Node Rules
DRV-02 R-QUE-01, R-QUE-02, R-QUE-07 (one open ticket per NIK), R-QUE-08 (no ticket for a blacklisted NIK), R-QUE-09 (v1's form fields)
DRV-03 R-QUE-11, R-QUE-12 (the queue TV)
DRV-05 R-QUE-06 (closed after max_queue_miss skips), R-SET-08
DRV-07 R-QUE-03, R-QUE-10 (the form fields copied to the driver), R-DRV-01, R-DRV-02, R-DRV-05, R-DRV-24 (no lead for a blacklisted NIK), R-MON-24, R-MON-25
flowchart TD
  P["DRV-08 · Admin fee paid<br/>payments · payment_allocations"] --> V["DRV-09 · Virtual check<br/>background_checks · virtual"]
  P --> VS["DRV-13 · Visit check, worked P0 to P2<br/>background_checks · visit"]
  V --> VR{"DRV-10 · Virtual passed?"}
  VR -- "yes" --> AP["DRV-12 · Approved on the virtual check"]
  AP --> ON["DRV-17 · Onboarding<br/>drivers · stage approved<br/>rentals · pending"]
  VR -- "no" --> VQ{"DRV-11 · Visit still goes ahead?"}
  VQ -- "yes, P2" --> VS
  VQ -- "no" --> RJ(["DRV-06 · Rejected<br/>drivers · stage rejected<br/>charge_adjustments · refund, if refunded"])
  VS --> VD{"DRV-14 · Visit passed?"}
  VD -- "yes" --> HC{"DRV-15 · Has a car?"}
  HC -- "no" --> ON
  HC -- "yes" --> OK(["DRV-21 · Stays listed, fully cleared"])
  VD -- "no" --> HC2{"Has a car?"}
  HC2 -- "no" --> RJ
  HC2 -- "yes" --> AL["DRV-16 · Alert to Collection and Vehicle Management<br/>the rental goes on"]
  AL --> COL(["COL-12 · Return or repo? (phase 5)"])
  ON --> BK(["To phase 3"])
Node Rules
DRV-08 R-BC-14 (both checks open with the payment), R-BC-18 (the visit is due three days later)
DRV-09, DRV-13 R-BC-01 to R-BC-05, R-BC-13 (the visit queue, P0 to P2)
DRV-11 R-BC-16 (the answer is recorded), R-BC-17 (no visit: rejected)
DRV-12, DRV-15, DRV-17 R-BC-08 (one passed check approves), R-BC-09 (a car before the visit), R-BC-20 (clearance reads the latest check of each kind)
DRV-06 R-BC-07, R-BC-11, R-BC-12, R-BC-15 (a failed visit with no car), R-BC-19 (the open visit is cancelled)
DRV-16 R-BC-10 (alert and return-or-repo, the rental goes on)

Open: the alert record is on #156.

The car's side starts when it joins the fleet; the driver's side joins it at booking.

flowchart TD
  VS(["VEH-01 · Car joins the fleet<br/>vehicles · not_ready<br/>work_orders · preparation"]) --> I1["VEH-02 · First inspection, the work order's preparation inspection<br/>inspections · preparation"]
  I1 --> RD["VEH-03 · Car ready, STNK valid<br/>vehicles · ready<br/>vehicle_status_history"]
  DS(["DRV-17 · Approved driver<br/>rentals · pending"]) --> BK
  RD --> BK["DRV-18 · Contract signed, car booked<br/>rentals · booked · contracts<br/>VEH-04 · vehicles · booked"]
  BK --> TR["DRV-19 · Onboarding training<br/>not recorded or checked in v2 yet"]
  TR --> HO["DRV-20 · Handover inspection and BASTK<br/>inspections · handover<br/>rentals · active · VEH-05 · vehicles · rented"]
  HO --> LS["DRV-21 · Driver listed<br/>drivers · stage listed"]
  HO --> GO["Gate OUT<br/>gate_passes · pickup"]
  LS --> RO(["To phase 4"])
  classDef open stroke-dasharray: 5 5
  class TR open
Node Rules
VEH-01 R-VEH-01 to R-VEH-05, R-VEH-22 (a new car opens a preparation work order), R-VEH-26 (VIN unique)
VEH-02, VEH-03 R-VEH-25 (ready only with a valid STNK), R-VEH-27 (ready only through the work order)
DRV-18, VEH-04 R-RNT-20 and R-RNT-21 (one live rental per car and per driver, D67), R-RNT-03, R-RNT-04, R-RNT-12, R-RNT-18 (no booking for a blacklisted driver)
DRV-19 None: the training flow is designed after cutover, and the handover doesn't check it (D64; R-RNT-19 is retired). driver_trainings stays in the schema, unused.
DRV-20 R-INSP-09, R-BC-09

Four loops run while the car is out.

flowchart TD
  RJ["COL-03 · Rent billed per billing frequency<br/>charges · rent"] --> CL["COL-05 · Payment team calls<br/>collection_calls"]
  CL --> PY["COL-06 · Payment received with proof<br/>payments · payment_allocations"]
  PY --> RC{"COL-07 · Reconciled one by one or in bulk?"}
  RC -- "manual" --> RM["COL-08 · Reconciled per driver"]
  RC -- "bulk" --> RB["COL-09 · Reconciled in bulk"]
  RM --> OD["COL-10 · Balance and overdue computed<br/>v_driver_balance"]
  RB --> OD
  OD --> LM{"COL-11 · Over either overdue limit?"}
  LM -- "no" --> GO(["VEH-09 · Rental goes on, to the checkpoint"])
  LM -- "yes" --> Q(["COL-12 · Return or repo? (phase 5)"])
Node Rules
COL-03 R-MON-03, R-MON-49 (who is billed, D67)
COL-05 R-COL-03
COL-06 R-MON-13 to R-MON-16, R-MON-43 (one transfer, one payment), R-MON-50 to R-MON-53 (the suggested split, oldest due first; finance decides), R-MON-54 (migrated payments keep v1's split)
COL-07 to COL-09 R-MON-44 (manual or bulk), R-MON-45 (a reconciled payment is never edited)
COL-10, COL-11 R-MON-07, R-MON-08 (the days limit), R-MON-41 (the amount limit), R-MON-42 (either one goes to Collection), R-GATE-06

Decided: a bulk payment's split is suggested oldest due first, and finance decides (D72, #148). Open: the limits' final values and invoices that group a cycle's charges are on #158. The flow's bills (COL-04) are V13's charges with due dates.

flowchart TD
  GI["Gate IN<br/>gate_passes · visit"] --> CP["VEH-10 · Checkpoint inspection<br/>inspections · checkpoint"]
  CP --> DM{"VEH-11 · New damage?"}
  DM -- "yes" --> DC["VEH-12 · Damage charged to the driver<br/>inspection_damages · charges"]
  DC --> SH["COL-13 · Draft surat hutang for the inspection<br/>debt_letters · draft · debt_letter_items"]
  SH --> CT{"COL-14 · Continue renting?<br/>recorded on the rental"}
  CT -- "yes" --> EX
  CT -- "no" --> RT(["VEH-13 · Return (phase 5)"])
  DM -- "no" --> OD{"COL-15 · Overdue?"}
  OD -- "no" --> EX
  OD -- "yes" --> FM["COL-16 · Meeting with Finance"]
  FM --> CB{"COL-17 · Can pay?"}
  CB -- "yes" --> PY(["COL-06 · Payment"])
  CB -- "no" --> RT
  EX{"Exit check:<br/>checkpoint, service, debt"} -- "an aspect fails" --> AP["Approval for that aspect<br/>gate_pass_approvals"]
  AP --> GO["Gate OUT<br/>gate_passes"]
  EX -- "all pass" --> GO
  classDef open stroke-dasharray: 5 5
  class FM,CB open
Node Rules
VEH-10 R-INSP-06, R-INSP-08, R-INSP-10
VEH-12 R-INSP-05, R-INSP-11 (a charged damage is billed in the same step)
COL-13 R-COL-05 (one draft letter per inspection), R-COL-06 (numbered when issued), R-NUM-10
COL-14 R-COL-07 (the answer, who and when), R-COL-08 (no: the return starts)
Exit check R-GATE-02, R-GATE-05, R-GATE-06, R-GATE-07

Open: the meeting with Finance (COL-16, COL-17) is proposed as a kind of collection call on #156; who decides "continue renting?" is on #157.

flowchart TD
  SC["VEH-06, VEH-07 · Every car that isn't inactive scanned weekly<br/>etle_scans"] --> FD{"VEH-08 · Fine found?"}
  FD -- "no" --> CL(["Clean"])
  FD -- "yes" --> VI["Violation recorded<br/>etle_violations"]
  VI --> WR{"COL-01 · Rental active<br/>at that time?"}
  WR -- "yes" --> FC["COL-03 · Billed to that driver<br/>charges · etle_fine"]
  WR -- "no" --> CO["COL-02 · Paid by the company<br/>etle_violations · payer company"]
Node Rules
VEH-06 to COL-03 R-ETLE-01 to R-ETLE-05 (every car that isn't inactive, D39, not only ready ones as the flow draws it)

The rental's statuses follow D67: a return starts as returning; a repo as repossessing, then returned when the car is back before its BASTK; the BASTK sets ended. Rent stops the day the car is back, never at the BASTK. The repo team's own steps are dashed: a repossession runs through a repo request and a repo work order (D71). The request's rules are under Repossession; the work order's come with M5 (#270). The driver's stage follows D66: a voluntary return sets it by its reason when the return starts, and a repossession sets it at the repo BASTK.

flowchart TD
  Q{"COL-12 · Will the driver return the car themselves?"}
  Q -- "yes" --> RS["VEH-13 · Return starts, with its reason<br/>rentals · returning"]
  Q -- "no" --> RP["REP-01 · Repo request opens<br/>rentals · repossessing · reason repossessed<br/>charges · repo_fine"]
  RS -- "the driver never brings the car" --> RP
  RP --> RC["VEH-14 · Car recovered by the repo team<br/>rent stops: rentals · billing_ends_on"]
  RS --> SG{"DRV-22 · Return reason"}
  SG -- "on_leave, resigned, suspended" --> ST["DRV-23 · Stage of that name"]
  SG -- "accident, breakdown, contract_ended" --> AV["DRV-23 · Stage approved"]
  RC --> AT["VEH-15 · Car at the pool, BASTK to come<br/>gate_passes · dropoff<br/>rentals · returned · vehicles · returned"]
  RS -- "voluntary: one event the day the car is back" --> BA["VEH-16 · Return inspection and BASTK<br/>inspections · return<br/>rent stops: rentals · billing_ends_on<br/>rentals · ended"]
  AT -- "repo: BASTK on a later day" --> BB["VEH-16, COL-18 · Repo BASTK<br/>rentals · ended · reason repossessed"]
  BA --> WO(["VEH-17 · Work order (phase 6)"])
  BB --> WO
  BB --> RL{"DRV-27 · Their repossessions reach max_repossessions?"}
  RL -- "no" --> IA(["Inactive (phase 7)"])
  RL -- "yes" --> BL(["Blacklisted"])
  ST --> RJ(["DRV-24 · May ask to rejoin (phase 7)"])
  AV --> RJ
  classDef open stroke-dasharray: 5 5
  class RC open
Node Rules
COL-12 R-BC-10, R-MON-42, R-COL-08 (the ways in)
DRV-22, DRV-23 R-DRV-45 (the stage follows the reason)
DRV-27 R-DRV-30 (a repo BASTK: inactive, or blacklisted at the limit), R-DRV-31 (a repo request changes no stage), R-SET-10 (max_repossessions)
VEH-13 R-RNT-24 (returning, with its reason), R-RNT-23 (keeps its rate), R-MON-49 (still billed)
REP-01 R-RNT-25 (repossessing, from active or from a return never completed), R-REP-06 (the request opens with it), R-REP-03 (its reason), R-REP-05 (one per rental), R-DRV-31 (no stage change), R-RNT-23, R-MON-49
VEH-14 R-RNT-28 (rent stops the day the car is recovered)
VEH-15 R-RNT-26 (returned until the BASTK), R-RNT-20 (still live)
VEH-16, COL-18 R-RNT-27 (only a BASTK ends it), R-INSP-12 (a voluntary return: one event), R-INSP-13 (a repo's inspection and BASTK later, at the pool), R-INSP-14 (the inspection takes the rental's reason), R-RNT-28, R-INSP-03, R-INSP-04, R-INSP-09, R-RNT-07

Decided: the lifecycle and when the reason is set (D67, #155); which statuses a return or a repo starts from, and what paused means (#228: R-RNT-24, R-RNT-25, R-RNT-30). Decided too: what a repossession does to the driver's stage (D66, #159: R-DRV-30), and that a repossession runs through repo requests and repo work orders (D71). Still to write: the work order's rules, on #270. V13's reason swap isn't in the flow.

flowchart TD
  RE(["VEH-17 · Work order opened, by return reason<br/>work_orders · work_order_events"]) -- "accident, breakdown" --> AS["VEH-18 · Waiting for the Preparation Team<br/>vehicles · not_ready"]
  RE -- "any other reason" --> PR["VEH-24 · Routed to preparation, PIC assigned"]
  AS --> IN{"VEH-19 · Insurance?"}
  IN -- "yes" --> IC["VEH-20 · Insurance claim<br/>insurance_claims"]
  IN -- "no" --> MN{"VEH-21 · Maintenance?"}
  MN -- "yes" --> MR["VEH-22 · Maintenance<br/>maintenance_records"]
  MN -- "no" --> PRp["VEH-23 · Pool repair<br/>work_order_events"]
  PR --> PC["VEH-25 · Checked by the Preparation Team"]
  IC --> LC
  MR --> LC
  PRp --> LC
  PC --> LC["VEH-26 · Preparation Leader's check<br/>inspections · preparation"]
  LC --> RQ{"VEH-27 · Outcome ok?"}
  RQ -- "needs_insurance or needs_maintenance" --> AS
  RQ -- "ok" --> RD["VEH-28 · Work order ready<br/>work_orders · ready"]
  RD --> VR(["VEH-03 · Car ready, STNK valid<br/>vehicles · ready"])
Node Rules
VEH-17, VEH-18, VEH-24 R-WO-01, R-WO-05 (accident or breakdown: waiting to be routed), R-WO-06 (any other reason: preparation)
VEH-19 to VEH-23 R-WO-04, R-WO-07 (the team may change the route)
VEH-26 to VEH-28 R-WO-02, R-WO-08 (ready only through the leader's check), R-WO-09 (rework)
VEH-03 R-VEH-25 (STNK), R-VEH-27 (ready only through the work order)

Not drawn: the checker's quick check (VEH-29), which sends a car that needs nothing straight to the leader's check, and the flow's release to ready without that check, which v2 keeps blocked (D41). Who holds the leader's check is on #157.

flowchart TD
  S(["Driver without a car:<br/>on_leave, resigned or suspended"]) --> RQ["DRV-24 · Asks to rejoin"]
  AP(["Approved, with no live rental"]) -- "30 days (daily job)" --> IN
  RQ --> EV{"DRV-25 · Driver Team decides"}
  EV -- "yes" --> ON(["DRV-17 · Back to onboarding (phase 2)"])
  EV -- "no" --> IN["DRV-26 · Inactive: can't rent until taken back<br/>drivers · stage inactive"]
  IN -- "may ask to rejoin" --> RQ
  RP(["A repo BASTK under the limit (phase 5)"]) --> IN
  IN -. "a call by a holder of driver:blacklist" .-> BL(["DRV-27 · Blacklisted<br/>NIK refused at the queue, registration and booking"])
  BL -- "lifted, with driver:blacklist" --> IN
  classDef open stroke-dasharray: 5 5
  class RQ,EV open
Node Rules
DRV-24 R-DRV-47 (a rejoin may come from inactive too)
DRV-26 R-DRV-44, R-DRV-29 (inactive: can't rent until taken back), R-DRV-22 (refused: inactive), R-DRV-46 (30 days as approved with no live rental), R-DRV-23 (nothing blacklists them by itself)
DRV-27 R-DRV-34 (set and lifted with driver:blacklist), R-DRV-40 (by a call only once the car is back), R-DRV-35 (lifted: inactive), R-DRV-30, R-QUE-08, R-DRV-24, R-RNT-18

Decided: who blacklists and lifts a blacklist, and a driver who never asks to rejoin (D66, #159). Open: the rejoin request record, on #156.