BE-DP-34 · The values and shapes the rentals step will meet
ID BE-DP-34 · Level L0 · Pack Row 5 · The domain steps · Run order row 5, before the rentals step's rules and pull request · Issue #302
The rentals step loads v1's onboarding rows as rentals with their contracts (D67, D69). Its value_map rows must ship complete (R-MIG-02), and DOC's rules need to know what v1 holds. This step prints both, so the rules and the step are written from the copy.
tools/migration/v1-copy/rentals-values.sql prints:
- 1 · Onboarding status ×
deduction_stopped: with how many rows have a plate assigned and how many of those plates find a car (D69: Approve ispending; Listed with the flag ispaused; a missing flag is unmapped). - 2 · Rental fee names: each one with its rows, whether a fee is set, and whether v1's rentalFees list has that name (the pricing group).
- 3 · The dates each status carries: assignment, contract start and end, deduction end, booking, release, and the original assignment.
- 4 · What the step would find twice, or not at all:
- a plate on two live rows;
- a live row with no plate;
- a plate that finds no car, or two;
- a row whose lead is missing or deleted;
- a lead on two rows.
- 5 · v1's contracts table: its rows against the onboarding rows, and how many rows name a contract file.
- 6 · Other values:
kontrak_platform,survey_type,deduction_frequency. - 7 · The rate history: the columns of
v_rental_fee_audit, if the copy has it (D38: a rate history becomes a chain of rentals).
It prints statuses, tariff names, column names and counts, never a name, a plate or a phone (D15). It reads the copy and changes nothing in it.
Before
Section titled “Before”docker ps --filter name=v1copylists the copy as Up.- You are at the root of your clone, on main, after
git pull.
docker exec -i v1copy psql -qX -U postgres -d postgres < tools/migration/v1-copy/rentals-values.sqlExpect
Section titled “Expect”Seven tables, headed 1 to 7, in a few seconds.
- 1: its rows add up to 2,440, as BE-DP-20 counted them: Approve 758, Booked 20, Listed 1,529, On Process 133.
- 2: the tariff names BE-DP-25 listed under rentalFees, most of them found.
- 4: one line per kind of problem; a kind with no row prints no line.
- 5: 291 contracts.
- 7: a list of columns, or no row if the copy has no such view.
Read table 2's names before posting. Each should be a tariff, such as Rental Sigra. If one reads like a person's name or a number plate, delete that line and say you did. Then post the seven tables on #302.
If it fails
Section titled “If it fails”ERROR: relation "public.…" does not exist: the copy isn't the one BE-DP-20 read. Post the line on #302.- Anything else: post the
ERRORline on #302.
Nothing to undo: it reads only, and its tables are temporary.
Log each run as a comment on #302: date · who · result, with the seven tables.