Skip to content

Add a nullable address to sections and expose it - #282

Merged
hkdobrev merged 1 commit into
mainfrom
feature/abroad-section-addresses
Oct 26, 2026
Merged

hkdobrev merged 1 commit into
mainfrom
feature/abroad-section-addresses

Conversation

@hkdobrev

@hkdobrev hkdobrev commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Step 2 of moving the abroad section addresses out of the site and into the API (site PR #182 had to ship code for a single address change in Tromsø).

  • Migration 1792510000000-AddSectionAddress: ALTER TABLE sections ADD COLUMN IF NOT EXISTS address text NULL. No data changes.
  • Section.address and sectionAddress(): the column when set; otherwise place for a domestic section (domestic place already holds the address); null for an abroad section, never its committee name („Посолство“).
  • address is now returned by GET /sections?town=, GET /sections/:id and /results/<section>.json.

Tests: section-address.spec.ts, section.dto.spec.ts. The full suite also passes with the DB specs against postgres:13 (TEST_DATABASE_URL).

Next: the next PR adds GET /sections/abroad and PATCH /sections/abroad/addresses.

sections.address holds a section's street address. Abroad sections
need it: their place is the committee name (Посолство, Баркинг 2), and
the addresses from the МВнР table lived only in the new site's code.

GET /sections?town=, GET /sections/:id and /results/<section>.json now
return address: the column when set, else place for a domestic section,
else null for an abroad one (never the committee name).
@hkdobrev
hkdobrev merged commit 7f22f2b into main Oct 26, 2026
1 check passed
@hkdobrev
hkdobrev deleted the feature/abroad-section-addresses branch October 26, 2026 07:49
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