D71 · A repossession runs through a request list and repo work orders, with a Repo Leader
Accepted · 2026-10-22 · zuki · Closes #235 · Partly supersedes D63 (the count of roles and permissions) · Partly superseded by D75 (the work order's tables are built in the data phase)
Decision: A repossession starts as a repo request and is carried out through a repo work order, as the higher-ups' General Flow of 2026-10-20 draws it (REP-01 to REP-08, VEH-30 to VEH-32).
- Two reasons open a request. Collection's "Tidak bayar" (COL-12), and "Tidak checkpoint": a driver who misses the weekly checkpoint for cp_skip_weeks_limit weeks in a row (VEH-32). cp_skip_weeks_limit is a pool setting, default 3, set by an admin like max_queue_miss (D43). The missed weeks are counted from the checkpoint invites, not kept in a counter column (D32).
- A rental has at most one open request. Opening one sets the rental to
repossessing(D67) and changes no driver stage (D66). - The Repo Leader groups open requests into a repo work order with one or more PICs from the Repo Team. Every PIC sees every unit in the work order and may close any of them; who closed each unit is recorded.
- A work order runs 24 hours from its assignment and closes when every unit is done or the 24 hours pass. A unit not collected by then is failed (REP-07), and its request goes back to the list (REP-08 → REP-01).
- A collected unit (REP-05, REP-06) is a car recovered: rent stops that day and the rental becomes
returned, thenendedat the repo BAST (VEH-14), as D67 and D66 say. - A work order's collection rate is collected units over its units. It is computed, never stored.
- Failed attempts have no hard limit. After the third failed attempt on one request, the request is flagged to Collection, which decides. The count is computed from the work orders.
- Two roles.
repostays as D63 made it, for the Repo Team. A new system role,repo_leader, holds the permissions ofrepoplus a new permission, repo:assign, which makes and closes repo work orders. admin and super_admin hold repo:assign. - Migrated repossessions get a request. The data phase opens one request for every v1 rental it maps to
repossessing, with v1's reason where v1 records one and otherwise a reason saying it came from v1, so the Repo Leader's list is complete on the first Monday. v1 has no repo work orders, so none migrate.
Why: zuki accepted the CTO's proposed answer on #235 on 2026-10-21 ("Yes, I accept the proposal. Proceed to build."). V13 has no tables for a request list or a work order, and #156's "repo tasks", child rows of the rental, no longer fit a flow where one work order carries many units and many PICs. zuki chose the migrated requests in a CTO session on 2026-10-22: without them, a rental moved to repossessing by D67 would have no request, and nobody would be sent to recover the car.
Consequences:
- Data phase, rules first (D27): a DOC pack writes the rules for the repo request (its statuses, its reasons, one open per rental, and the migrated request). Then a Backend Engineer pack adds repo_requests to the schema, edited in place before cutover (D11), before the rentals step. The rentals step (data phase row 5) opens the migrated requests, and its reconcile checks that every
repossessingrental has exactly one open request (D18). - M5 builds the rest: the work order tables with their units and PICs; the functions that open a request, assign and close a work order and close a unit, each status changed only by a function (D3); the job that closes a work order when its 24 hours pass and the daily job that counts missed checkpoints, both pg_cron jobs (D36); repo_leader and repo:assign; and the pages for the Repo Leader and the Repo Team.
- The catalogue grows to 51 permissions and the system roles to 14 in M5, beside D63's additions. The seed, the E2E logins and the per-role menu check grow with them.
- #156's repo tasks row is replaced by this decision.
- Not decided here, and settled with zuki before M5's DOC pack: whether a request can also be raised by hand or imported from a file, with reasons other than the two above, as the repo flow's design canvas shows; whether the Repo Leader may set a work order's deadline other than 24 hours; and whether opening a request makes a charge, which the sheet draws on REP-01 and which would be M6's.