Skip to content

[ext-fintraffic] Persist and expose vehicle entrance accessModes - #431

Open
teppope wants to merge 25 commits into
entur:masterfrom
tmfg:feat/ext-fintraffic-vehicle-entrance-access-modes
Open

[ext-fintraffic] Persist and expose vehicle entrance accessModes#431
teppope wants to merge 25 commits into
entur:masterfrom
tmfg:feat/ext-fintraffic-vehicle-entrance-access-modes

Conversation

@teppope

@teppope teppope commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Persists NeTEx ParkingEntranceForVehicles.accessModes (AccessModeEnumeration list, e.g. foot, bicycle) on the Fintraffic parking extension so pedestrian/bicycle port access mapped by the Liipi migration tool (see digitraffic-tis-parking-netex-migration PR Can't find stop places with no valid version from UI #12) round-trips through Tiamat's GraphQL API and NeTEx import/export.
  • AccessModes is an XML list-typed field (single element containing space-separated tokens, e.g. <AccessModes>foot bicycle</AccessModes>), not a repeatable element, so it is stored as a single VARCHAR(128) column (access_modes) on FintrafficParkingEntranceForVehicles rather than a nested @ElementCollection table. A parsed List<String> convenience view (getAccessModesList()/setAccessModesList()) is provided for callers.
  • Adds GraphQL accessModes field (new accessModeEnum type) on both the vehicle entrance output and input types, wired through FintrafficParkingUpdater for mutations.
  • Adds Flyway migration V8__FintrafficParkingVehicleEntranceAccessModes for the new column.

Depends on this stacked ext branch chain being merged first, in order: #422 (paymentMethods) → #424 (infoLinks) → #425 (vehicleEntrances) → #429 (lighting) → #430 (opening hours) → this branch. This branch is based on the tip of that stack (feat/ext-fintraffic-parking-opening-hours) so the new migration could be assigned version V8 without colliding with V6/V7 already claimed by branches ahead of it in the stack.

Type of change

  • New feature (non-breaking change which adds functionality)

Unit tests

  • Added FintrafficParkingEntranceForVehiclesTest covering the accessModes raw-string ↔ List<String> conversion helpers and equals()/hashCode().
  • Extended FintrafficParkingMapperContributorTest (NeTEx↔Tiamat mapping) and FintrafficMergingParkingImporterTest (new test verifying a change to only accessModes triggers a new parking version) with accessModes coverage.
  • Added mutateParking_vehicleEntrances_accessModes_persistedAndReturnedInResponse to FintrafficGraphQLParkingIntegrationTest verifying the full GraphQL mutate → persist → query round trip.
  • All targeted tests pass locally (mvn test -Dtest=FintrafficParkingEntranceForVehiclesTest,FintrafficParkingMapperContributorTest,FintrafficMergingParkingImporterTest,FintrafficGraphQLParkingIntegrationTest).

teppope and others added 25 commits July 17, 2026 08:45
Implements the extension hook infrastructure from feat/parking-extension-hooks
to persist and expose paymentMethods on the Fintraffic Parking entity:

- FintrafficParking: @entity subclass with @ElementCollection paymentMethods
- FintrafficParkingEntityFactory: produces FintrafficParking instances
- FintrafficMergingParkingImporter: copies paymentMethods into the persisted entity
- FintrafficParkingGraphQLTypeContributor: adds paymentMethods to the GraphQL schema
- FintrafficParkingUpdater: populates and preserves paymentMethods on GraphQL mutations
- FintrafficParkingMapperContributor: bridges paymentMethods between NeTEx and Tiamat enums
- V3__FintrafficParkingExtensions: Flyway migration adding dtype column and payment methods table
- Full test coverage: unit + integration tests for all components

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…Factory

Orika cannot auto-map paymentMethods because the NeTEx and Tiamat enum
types differ. The FintrafficParkingMapperContributor already handles the
conversion explicitly, so including paymentMethods in the Orika classmap
was redundant and confusing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…xtProvider static field

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… core tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…t completeness

- Add UNIQUE (parking_id, day_type_ref) constraint to V7 migration
- Importer deduplicates by dayTypeRef (warn + keep last) to prevent DB constraint violations
- GraphQL updater rejects duplicate dayTypeRef with IllegalArgumentException
- parseLocalTime validates input; handles 24:00->midnight; throws IllegalArgumentException on bad values
- Timeband created on export when either startTime or endTime is non-null
- Tests for deduplication in importer and error paths in GraphQL updater

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Guard against empty first token after split in parseLocalTime (e.g. input ':')
- Add export test for endTime-only timeband (startTime null)
- Error-path tests verify no parking is persisted on duplicate dayTypeRef or invalid time

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…cognized JPA entity

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@teppope teppope changed the title Persist vehicle entrance access modes for pedestrian/bicycle ports [ext-fintraffic] Persist and expose vehicle entrance accessModes Jul 28, 2026
@teppope
teppope marked this pull request as ready for review July 30, 2026 06:12
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