Skip to content

BE-DP-41 · Whether any key ties a v1 ETLE bill to its etle row

ID BE-DP-41 · Level L0 · Pack Row 5 · The domain steps · Run order row 5, before #538's rule and test · Issue #538

The money step loads ETLE bills as charges, and etle_violations.charge_id stayed empty until this read and R-ETLE-09. Whether it can be filled depends on a key no earlier read looked for. tools/migration/v1-copy/etle-link.sql prints, from the copy:

  • 1 · The rows: etle.data's keys, and the forms of no_tilang.
  • 2 · The bills: the form of source by manual flag and status, the forms of deskripsi, and the bills' keys.
  • 3 · What matches: source and deskripsi against etle.id and no_tilang, any etle.data value equal to a bill id, and any ETLE bill value equal to a row's id or no_tilang.
  • 4 · How many: rows per bill and bills per row (none, one, many), by status_tagihan and by the bill's status.

The outcome, zuki's on 2026-11-05: an exact key giving one bill links in the money step, everything else stays empty and is counted, and a violation with several candidates stays empty and is listed. With no exact key, the rule says charge_id stays empty for migrated rows. Nothing guesses on a plate, a lead, an amount or a date.

It prints counts only, never a name, a plate, a ticket number or one driver's amount (D15, D89). Tickets and free text are compared and never printed. The read changes nothing in the copy.

  • docker ps --filter name=v1copy lists the copy as Up.
  • You are at the root of your clone, on the branch or integration holding tools/migration/v1-copy/etle-link.sql.
Terminal window
mkdir -p ../opleet-private
docker exec -i v1copy psql -qX -U postgres -d postgres < tools/migration/v1-copy/etle-link.sql > ../opleet-private/etle-link.txt
wc -l ../opleet-private/etle-link.txt

Eleven short tables, in seconds, headed 1a to 4b. The counts below are from the copy of 2026-11-02; v1 moves (D75), so a difference here isn't a failure. Post it as printed.

  • 1a: with_status near 226, the rows the operations step reads. rows may be higher, because it counts every row.
  • 2a: bills adds up to about 415. So does 2b.
  • 3a: six lines, always, even where a key finds nothing.
  • 4a: for each how, rows adds up to 1a's rows, and on each line no_bill, one_bill and many_bills add up to rows.
  • 4b: for each how, bills adds up to 2a's total, and on each line no_row, one_row and many_rows add up to bills.

How to read it, for whoever takes the counts:

  • The exact key is on 3a's lines 1, 2, 3 and 5, and line 6 is any of them. Line 4 is weak, because a day or a sum in deskripsi can equal a short id, so line 6 leaves it out.
  • one_to_one in 4a is the number that matters: a row with one bill that holds no other row.
  • In 3b and 3c, a key such as lead_id or total is coincidence, not a link. Short ids meet other numbers. That's why those tables print by key.

Before you post, read 1b, 1c, 2a, 2b, 2c, 3b, 3c, 4a and 4b in ../opleet-private/etle-link.txt. They are the only tables that print a label from v1.

  • 1c, 2a and 2b print forms: letters as a, digits as 9, with (none), (empty) or (rare).
  • 1b, 2c, 3b and 3c print key names, or (odd key).
  • 2a's word is a known source word, (other word) or (none).
  • 2a, 4a and 4b print a status or status_tagihan as v1 wrote it.

If any line shows a person's name, a plate or a ticket number, don't post it. Post the table's heading and say what it looks like, with no value.

  • ERROR: column … does not exist or relation … does not exist: v1's table isn't the one this read expects. Post the line on #538.
  • ERROR: cannot call jsonb_each on a non-object, or the same for jsonb_object_keys: a row's data isn't an object. Post the line. Stop there.
  • Anything else: post the ERROR line, with any detail holding a name or an amount removed.

Nothing to undo: it reads only, and its tables and functions are temporary. ../opleet-private/etle-link.txt stays on your Mac.

Log each run as a comment on #538: date · who · the copy's date · the tables, once you've read them as Check says.