Skip to content

Build for 2026-04-19 parliamentary election#269

Merged
hkdobrev merged 4 commits intomainfrom
election-2026-04-19
Apr 19, 2026
Merged

Build for 2026-04-19 parliamentary election#269
hkdobrev merged 4 commits intomainfrom
election-2026-04-19

Conversation

@hkdobrev
Copy link
Copy Markdown
Member

Summary

  • Prepare data and configuration for the 2026-04-19 parliamentary election
  • Accept both city_region (snake_case, documented) and cityRegion (camelCase) query params on GET /sections for backwards compatibility with older clients
  • Fix build for Node.js 22+ by upgrading @nestjs/cli to v10 and @nestjs/swagger to v7 (util.isObject was removed in Node 22)
  • Fix always-truthy bug in Violation.publish() — was missing .includes(this.status)

Test plan

  • GET /sections?town=68134&city_region=02 returns ~93 sections (Красно Село)
  • GET /sections?town=68134&cityRegion=02 returns the same ~93 sections
  • npm run build succeeds on Node.js 22+
  • Violation publishing status check works correctly

🤖 Generated with Claude Code

hkdobrev and others added 4 commits April 15, 2026 14:58
Adds operational scripts, seed pipeline updates, and CLAUDE.md notes
used to rebuild sections/parties/organizations for the new cycle:

- scripts/update-parties-orgs.sql: parties and organizations for NS 19.04.2026
- scripts/reset-sections.sh: truncate geo/parties/people FKs, reseed
- scripts/carryover-people.sql: dblink import from prior DB, deduped
- scripts/sections-preprocess/build_sections_csv.py: regenerates sections.csv
  from CIK xlsx files (canonical ER names, abroad cleanup, machine count)
- scripts/test-sections-seed.sql: dry-run the seed SQL locally
- src/seeds/nullify.sql: template for wiping cycle data
- src/seeds/1607202587052-Sections.ts: point seed at src/seeds/sections.csv
  and derive is_machine from machines_count
- protocols.repository.ts: left join results so protocols without results
  still appear in the listing
- package.json: widen engines to node <21/npm <13, switch typeorm scripts
  to typeorm-ts-node-commonjs (ESM loader incompatible with commonjs config),
  prebuild before seed:run so dist/seeds/*.csv is available
- docker-compose.yml: drop obsolete compose file version
- CLAUDE.md: operational notes for pm2 env refresh, election rebuild
  pipeline, npm script gotchas, staging/prod DB moves
- Remove stale 2021/2023 seed placeholders

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Support camelCase `cityRegion` as a fallback for the documented
`city_region` query parameter on GET /sections, so older clients
that send the camelCase variant still get correct filtering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Upgrade @nestjs/cli from 9 to 10 (v9 used removed `util.isObject`)
- Upgrade @nestjs/swagger from 6 to 7 (required by CLI 10 plugin)
- Fix always-truthy condition in violation.entity.ts `publish()` method
  (missing `.includes(this.status)`, caught by newer TypeScript)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hkdobrev hkdobrev merged commit a06ba0c into main Apr 19, 2026
1 check passed
@hkdobrev hkdobrev deleted the election-2026-04-19 branch April 19, 2026 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant