[ext-fintraffic] Persist and expose parking availabilityConditions - #430
Open
teppope wants to merge 30 commits into
Open
[ext-fintraffic] Persist and expose parking availabilityConditions#430teppope wants to merge 30 commits into
teppope wants to merge 30 commits into
Conversation
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>
…xt-fintraffic-info-links
…c-vehicle-entrances
…ntraffic-parking-lighting
…traffic-parking-opening-hours
1 task
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…traffic-parking-opening-hours
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>
…xt-fintraffic-vehicle-entrances
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…xt-fintraffic-vehicle-entrances
…ntraffic-parking-opening-hours # Conflicts: # src/ext-test/java/org/rutebanken/tiamat/ext/fintraffic/rest/graphql/FintrafficGraphQLParkingIntegrationTest.java # src/ext/java/org/rutebanken/tiamat/ext/fintraffic/importer/FintrafficParkingMapperContributor.java
teppope
marked this pull request as ready for review
July 30, 2026 06:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Persist and expose parking
AvailabilityConditionelements (opening hours) in the Fintraffic ext layer.What
FintrafficParkingAvailabilityCondition(@Embeddable): storesdayTypeRef,isAvailable,startTime,endTime.FintrafficParking: new@ElementCollectionfieldavailabilityConditionsbacked byparking_availability_conditionstable.parking_availability_conditionstable + index onparking_id.FintrafficParkingMapperContributor): readsAvailabilityConditionelements fromvalidityConditions, extracts day type ref,isAvailable, and firstTimebandstart/end; ignores non-AvailabilityConditionentries.FintrafficParkingMapperContributor): rebuildsAvailabilityConditionJAXBElements in the outputParking'svalidityConditions, appended after any existingValidBetweenentries.FintrafficMergingParkingImporter): copiesavailabilityConditionsfrom existing record when merging so data is not lost.FintrafficParkingGraphQLTypeContributor): exposesavailabilityConditionsas a list ofFintrafficAvailabilityConditionDtoobjects queryable viafintrafficParking { availabilityConditions { dayTypeRef isAvailable startTime endTime } }.FintrafficParkingUpdater): preserves existing conditions on updates.Notes
ValidBetween(soft-delete end date) invalidityConditions.Fintraffic*test classes).Follow-up fix: NeTEx export failure for availability conditions
mapAvailabilityConditionsToNetexis invoked twice per export for the same targetParking (a pre-existing Tiamat export-pipeline behavior). Two bugs surfaced as a result:
Timeband/AvailabilityConditionelements — fixed touse the correct element type and wrapping expected by the XSD.
ValidityConditions_RelStructurelist rather than replacing its own previously-addedentries, so the second invocation duplicated entries with identical deterministic ids,
violating the XSD's versioned-key uniqueness constraint. Fixed by removing any
previously-added
AvailabilityConditionentries before re-appending fresh ones(idempotent), while leaving unrelated entries (e.g.
ValidBetween) untouched.Verified with a real end-to-end regression test: GraphQL mutation sets
availabilityConditions, then the parent StopPlace is exported via the realGET /api/services/stop_places/netex?idList=endpoint (the same one Kooste/PETI'spublication pipeline uses), confirming no 500 and correct XML content.
Follow-up fix (merged forward): Parking never appears in the Read API cache / NeTEx export failure for vehicle entrances
Brings in the fixes from #422 and #425:
ReadApiNetexMarshallingServicederived the Read API cache'stypecolumn from theruntime class name (
"FintrafficParking") instead of the correct NeTEx element typename (
"Parking"), making every new Parking permanently invisible to Read API queries.vehicleEntrancesNeTEx export built elements without an id/version, violating theversioned-key XSD requirement.
@TestConfigurationleaking into unrelated tests' contextsvia the shared
@ComponentScan, resolved by gating it with@Profile("fintraffic-read-api").