Skip to content

Add parking AvailabilityCondition validation - #369

Draft
teppope wants to merge 2 commits into
entur:mainfrom
tmfg:feat/parking-availability-condition-validation
Draft

Add parking AvailabilityCondition validation#369
teppope wants to merge 2 commits into
entur:mainfrom
tmfg:feat/parking-availability-condition-validation

Conversation

@teppope

@teppope teppope commented Jul 21, 2026

Copy link
Copy Markdown

Summary

Adds XPath validation rules for AvailabilityCondition elements on Parking entities inside a SiteFrame.

Changes

DefaultSiteFrameValidationTreeFactory
Narrows the 'unexpected SiteFrame' warning so it only fires when the SiteFrame contains no Parking elements. A SiteFrame used exclusively for park-and-ride data is intentional and should not be warned against.

DefaultParkingValidationTreeFactory (new)
Three validation rules for Parking/validityConditions/AvailabilityCondition:

  • PARKING_AVAILABILITY_CONDITION_WITHOUT_DAY_TYPE (ERROR): Each AvailabilityCondition must reference a DayType via dayTypes/DayTypeRef.
  • PARKING_TIMEBAND_WITHOUT_START_OR_END_TIME (ERROR): Each Timeband must have both StartTime and EndTime.
  • PARKING_TIMEBAND_INVALID_TIME_RANGE (ERROR): EndTime must not be before StartTime (00:00:00 is treated as midnight/24h and is exempt).

PublicationDeliveryValidationTreeFactory
Registers the new factory so parking rules run for both direct data-objects and frames-inside-CompositeFrame contexts.

Notes

This is part of a NeTEx Nordic CCB proposal to formally support park-and-ride opening hours (AvailabilityCondition inside Parking/validityConditions). All 270 tests pass.

teppope and others added 2 commits July 21, 2026 13:54
- Narrow SiteFrame 'unexpected' warning to fire only when SiteFrame
  has no Parking content
- Add DefaultParkingValidationTreeFactory with rules for AvailabilityCondition
  structure inside Parking/validityConditions: missing DayTypeRef,
  missing Timeband time fields, and invalid time range (EndTime < StartTime)
- Register parking validation tree in PublicationDeliveryValidationTreeFactory

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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