feat(api): one-time legacy catalogue import, KWS_MODE=seed (#7) #151
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/kws!151
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/legacy-catalogue-import"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes part of #7: the one-time import of the legacy catalogue. Design:
docs/superpowers/specs/2026-11-03-legacy-catalogue-import-design.md.What it does
api/cmd/legacy-exportreads the legacypg_dump(250205.sql) only for allowlisted catalogue tables (legacyimport.Tables), line by line; sales, tickets, users, visitor answers andMediasare never read or held.api/internal/legacyimport/seed/catalogue.sql(plain INSERTs, ids fromuuidv7()through a temp map, no legacy ids stored) andREVIEW.md(counts and every quirk).KWS_MODE=seedloads the embedded seed once, aftermigrate, in one transaction. It is refused (ErrNotEmpty) if any catalogue table has rows.Owner ruling applied
My calls (please check)
L<legacy id>. Park codes 701 and 702 stay on the oldest park; "Lake Nakuru" and "Mt. Longonot N. Park" get none.valid_frommoves to the next day when its time is 12:00 or later (rows written in UTC+3/UTC+8).mailto:links keep only their text.Owner questions
park_entryproducts (as in legacy), notvehicle.7.3is imported as a percent.Checks
make cover: 91.6 % total (legacyimport 92.5 %, app 92.1 %);make lintclean; gitleaks clean on the new package.GET /v1/parkslists the 11 active parks. A test now checks every REVIEW.md count against the loaded DB and the public parks list.parksis locked; no explicitstandard_conforming_strings; the convenience fee is not checked against the settings rules.Deploy
Run once at go-live:
KWS_MODE=migrate, thenKWS_MODE=seed. Not in CI and not automatic.🤖 Generated with Claude Code