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 ofno_tilang. - 2 · The bills: the form of
sourceby manual flag and status, the forms ofdeskripsi, and the bills' keys. - 3 · What matches:
sourceanddeskripsiagainstetle.idandno_tilang, anyetle.datavalue equal to a bill id, and any ETLE bill value equal to a row's id orno_tilang. - 4 · How many: rows per bill and bills per row (none, one, many), by
status_tagihanand 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.
Before
Section titled “Before”docker ps --filter name=v1copylists the copy as Up.- You are at the root of your clone, on the branch or
integrationholdingtools/migration/v1-copy/etle-link.sql.
mkdir -p ../opleet-privatedocker exec -i v1copy psql -qX -U postgres -d postgres < tools/migration/v1-copy/etle-link.sql > ../opleet-private/etle-link.txtwc -l ../opleet-private/etle-link.txtExpect
Section titled “Expect”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_statusnear 226, the rows the operations step reads.rowsmay be higher, because it counts every row. - 2a:
billsadds up to about 415. So does 2b. - 3a: six lines, always, even where a key finds nothing.
- 4a: for each
how,rowsadds up to 1a'srows, and on each lineno_bill,one_billandmany_billsadd up torows. - 4b: for each
how,billsadds up to 2a's total, and on each lineno_row,one_rowandmany_rowsadd up tobills.
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
deskripsican equal a short id, so line 6 leaves it out. one_to_onein 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_idortotalis 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 as9, 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_tagihanas 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.
If it fails
Section titled “If it fails”ERROR: column … does not existorrelation … 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 forjsonb_object_keys: a row'sdataisn't an object. Post the line. Stop there.- Anything else: post the
ERRORline, 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.