Skip to content

BE-DP-25 · The values the master data and vehicles steps map, and what v1 doesn't hold

ID BE-DP-25 · Level L0 · Pack Row 5 · The domain steps · Run order row 5, after the pull request with migration.step_master_data() and migration.step_vehicles() is merged · Issue #280

The master_data and vehicles steps are in the database, but a night can't run them yet. Two things are missing.

  • The values to map (R-MIG-02, R-MD-18). These have no value_map rows yet: each car's type, partner and service area, and each v1 type's powertrain. No default is allowed, so migration.unmapped_values() lists them and no step starts.
  • What v1 doesn't hold. That is the organization v2 loads into, its pools, and its legal entities.

This step prints what the Backend Engineer needs to write those rows. You add the choices that are yours. The Backend Engineer then writes them into the migration in one pull request, and BE-DP-26 runs the night.

tools/migration/v1-copy/master-values.sql prints:

  • 1 · v1's lists: the names in app_settings, with how often each is listed, whether it is active and, for fees, the amount. The lists are brands, types (with their brand), rentalFees, admFees, partners, asuransi and the garages' codes.
  • 2 · The values the cars carry: each type, partner and service area in vehicle_master, with how many cars carry it. Beside it is the list entry it names, case aside. An empty names means no entry has that name, so the Backend Engineer needs your word on what it maps to.
  • 3 · Each type's powertrain hints: its tipe (such as Sedan EV) and its cars' transmisi.
  • 4 · What the vehicles step would find twice: unit ids on two rows, plates on two cars that aren't Not Aktif, temporary plates on two cars, and VINs on two cars. These are counts only.

It prints the names of products, companies and areas, never a person's. Plates, unit ids and VINs appear only as counts (D15). It reads the copy and changes nothing in it.

  • The pull request for #279 and #280 is merged.
  • docker ps --filter name=v1copy lists the copy as Up.
  • You are at the root of your clone, on main, after git pull.
Terminal window
docker exec -i v1copy psql -qX -U postgres -d postgres < tools/migration/v1-copy/master-values.sql

Four tables, in a few seconds, headed 1 to 4.

  • 1: about 9 brands, 22 types, 21 rentalFees, 12 admFees, 11 partners, 6 asuransi and 23 garages, as BE-DP-20 counted them.
  • 2: its cars add up to 1,750 for each of the three fields, one per car.
  • 3: one line per type.
  • 4: five lines. VIN empty or not one counts the cars that would load with no VIN.

Read table 2 before posting. Each value should be a model, a company or an area. If one reads like a person's name or a number plate, delete that line and say you did.

Then post the four tables on #280, and under them your answers:

  1. The organization: its name and its slug. The slug is short, lower case and has no spaces.

  2. The pools: one line per service area in table 2, with its pool's code, name, city and time zone. A time zone is Asia/Jakarta unless the pool is in another one. Two areas may share a pool.

  3. The legal entities: each entity's code and legal name, such as TOP. The rentals step puts contracts onto them later.

  4. The values with an empty names in table 2: the type, partner or brand each one is. A partner may also be our own car, with no rental company.

  5. The powertrains: which types in table 3 are electric.

  6. Two of the Backend Engineer's choices, already in the pull request:

    • a car with status_mobil Not Aktif loads inactive, which retires it (D39);
    • an empty status_mobil (30 cars) loads as active.

    Say yes to each, or say what each should be.

  • ERROR: relation "public.app_settings" does not exist or vehicle_master: the copy isn't the one BE-DP-20 read. Post the line on #280.
  • ERROR: invalid input syntax for type boolean: an aktif key holds something other than true or false. Post the line. It names the type, not the value.
  • Anything else: post the ERROR line on #280.

Nothing to undo: it reads only, and its one table is temporary.

Log each run as a comment on #280: date · who · result, with the tables and your answers.