Skip to content

[ext-fintraffic] Persist and expose parking vehicleEntrances - #425

Closed
teppope wants to merge 19 commits into
entur:masterfrom
tmfg:feat/ext-fintraffic-vehicle-entrances
Closed

[ext-fintraffic] Persist and expose parking vehicleEntrances#425
teppope wants to merge 19 commits into
entur:masterfrom
tmfg:feat/ext-fintraffic-vehicle-entrances

Conversation

@teppope

@teppope teppope commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

⚠️ This PR depends on feat/ext-fintraffic-parking-entity-factory (#422) and feat/ext-fintraffic-info-links (#424) being merged first. Both PRs introduce the ext infrastructure (ParkingEntityFactory, ParkingMapperContributor, ParkingGraphQLTypeContributor hooks) and the infoLinks field that this PR builds on. The diff shown here includes all changes from those branches.

Summary

Persists vehicleEntrances on FintrafficParking as an @ElementCollection of embeddable FintrafficParkingEntranceForVehicles objects. This is a Fintraffic-specific extension that stores vehicle entrance data (label, entranceType, width, height, isEntry, isExit, publicCode) from NeTEx imports and makes it queryable and mutable via GraphQL.

The following fields are persisted per entrance:

  • label — free-text label (from NeTEx MultilingualString)
  • entranceTypeEntranceEnumeration value (e.g. door, gate)
  • width, height — physical dimensions (decimal)
  • isEntry, isExit — directional flags
  • publicCode — short identifier

Type of change

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

Issue

This is a Fintraffic-specific extension to support migration of Liipi P&R data (DPO-4809). The implementation follows the pure-ext pattern established by the paymentMethods and infoLinks fields — all persistence, mapping, and GraphQL wiring stays in src/ext/.

Changes overview (ext layer only):

  • FintrafficParkingEntranceForVehicles — new @Embeddable value object with equals()/hashCode() on all fields
  • FintrafficParking — new @ElementCollection(EAGER) fintrafficVehicleEntrances backed by parking_vehicle_entrances table
  • V5__FintrafficParkingVehicleEntrances — Flyway migration creating the collection table with a CHECK constraint on entrance_type
  • FintrafficFlywayConfig — V5 registered in the explicit migration list
  • FintrafficParkingEntityFactoryvehicleEntrances added to Orika exclusion list
  • FintrafficParkingMapperContributor — NeTEx ↔ Tiamat mapping for vehicleEntrances in both directions
  • FintrafficMergingParkingImportermergeExtendedFields detects changes and copies vehicleEntrances
  • FintrafficParkingUpdaterpopulateExtendedFields maps GraphQL input; preserveExtendedFields copies on version update
  • FintrafficParkingGraphQLTypeContributorEntranceTypeEnum, FintrafficVehicleEntrance output type, FintrafficVehicleEntranceInput input type, and custom DataFetcher

Unit tests

  • FintrafficParkingMapperContributorTest — unit tests for NeTEx → Tiamat and Tiamat → NeTEx mapping of vehicleEntrances (4 new test methods)
  • FintrafficMergingParkingImporterTest — integration tests for new/existing parking import preserving vehicleEntrances, and idempotent import not creating new versions (3 new test methods)
  • FintrafficGraphQLParkingIntegrationTest — GraphQL integration tests for mutateParking with vehicleEntrances and preserve-on-update semantics (2 new test methods)

All 180 test classes pass (0 failures, 0 errors).

Documentation

Javadoc on FintrafficParkingEntranceForVehicles and V5__FintrafficParkingVehicleEntrances.

Follow-up fix: NeTEx export failure for vehicle entrances

FintrafficParkingMapperContributor's Tiamat-to-NeTEx mapping built VehicleEntrance
NeTEx elements without an id/version, violating the versioned-key XSD requirement on
export. Fixed by synthesizing a deterministic id/version for each vehicle entrance during
NeTEx mapping. Verified with a real end-to-end regression test: GraphQL mutation sets
vehicleEntrances, then the parent StopPlace is exported via the real
GET /api/services/stop_places/netex?idList= endpoint (the same one Kooste/PETI's
publication pipeline uses), confirming no 500 and correct XML content.

Follow-up fix (merged forward): Parking never appears in the Read API cache

Brings in the fix from #422 for ReadApiNetexMarshallingService deriving the Read API
cache's type column from the runtime class name ("FintrafficParking") instead of the
correct NeTEx element type name ("Parking"), which made every new Parking permanently
invisible to Read API queries. Also includes a fix for the new regression test's nested
@TestConfiguration leaking into unrelated tests' contexts via the shared
@ComponentScan, resolved by gating it with @Profile("fintraffic-read-api").

teppope and others added 11 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>
@teppope
teppope force-pushed the feat/ext-fintraffic-vehicle-entrances branch from 5bf9ffc to 6a93cee Compare July 20, 2026 12:16
teppope and others added 3 commits July 23, 2026 13:02
teppope and others added 5 commits July 28, 2026 08:13
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 vehicleEntrances on FintrafficParking [ext-fintraffic] Persist and expose parking vehicleEntrances Jul 28, 2026
@teppope
teppope marked this pull request as ready for review July 30, 2026 06:10
@teppope

teppope commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Closing in favour of #465.

Following the revert of the parking extension-hook infrastructure (#450, #452) and the request to land all parking additions as core Tiamat features in a single PR, this work has been re-authored on top of current master (which has also since moved to the multi-module tiamat-core/tiamat-app layout, so this branch no longer rebases cleanly).

#465 carries the same feature as one of its commits, implemented directly on the core Parking model rather than via a FintrafficParking subclass. No functionality is dropped by closing this.

@teppope teppope closed this Sep 7, 2026
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