Table of Contents

Bodu.Globalization.Calendar.RangeResolution Namespace

Bodu.Globalization.Calendar.RangeResolution

Bodu.Globalization.Calendar.RangeResolution

Purpose

Bodu.Globalization.Calendar.RangeResolution holds the policy vocabulary that governs how a document's duplicate declarations are settled when it is loaded, how same-day collisions and overlapping spans are settled, which priority wins, what an adjustment emits, which span of an occurrence controls range inclusion, and which days count as the working week.

These policies are carried by the document's <ResolutionPolicy> element and surfaced as ResolutionPolicy on the loaded NotableDateResource. They are resource-level (authored once per document) rather than per-query.

Static documentation

Key types

  • ResolutionPolicy - the policy bundle: DuplicatePolicy, SameDayCollisionPolicy, SpanCollisionPolicy, PriorityDirection, ObservedDateRangePolicy, the category precedence, and the working week (a Bodu.Core DayOfWeekSet, default Monday-Friday). ResolutionPolicy.Default is the all-defaults instance.
  • DuplicatePolicy - how the loader settles two concepts, or two rules of a concept, that the loaded document declares with one identifier: Error (BODU-CAL-DUP-ND / BODU-CAL-DUP-RULE), KeepFirst, KeepLast, or Merge (a later concept's rules appended to the first).
  • CollisionPolicy - how distinct occurrences that collide are settled: KeepAll, HighestPriorityOnly, CategoryPriority, Custom. SameDayCollisionPolicy applies it to occurrences that share an emitted date, and SpanCollisionPolicy then to every chain of occurrences connected through overlapping spans that holds a multi-day occurrence.
  • PriorityDirection - whether a higher or lower Priority wins: HigherWins, LowerWins.
  • EmissionMode - what an adjustment emits: ActualOnly, ObservedOnly, ActualAndObserved, Suppress. ObservedAsAdditional is obsolete: it behaves identically to ActualAndObserved, is normalized to it, and is kept only for document and binary compatibility.
  • ObservedDateRangePolicy - which span a range query tests against the window: the emitted span (ObservedOccurrenceControlsInclusion, the default), the actual span (ActualOccurrenceControlsInclusion), or either (BothOccurrencesControlInclusion).
  • INotableDateCollisionResolver - Resolve(DateOnly date, IReadOnlyList<NotableDate> colliding). Implement this to settle collisions yourself; it is consulted only under CollisionPolicy.Custom, for a same-day group with its shared date and for an overlap chain with its earliest date, and is supplied through NotableDateServiceOptions.CollisionResolver when the NotableDateService is constructed.

Authored example

<ResolutionPolicy duplicatePolicy="KeepFirst"
                  sameDayCollisionPolicy="HighestPriorityOnly"
                  priorityDirection="HigherWins"
                  observedDateRangePolicy="ObservedOccurrenceControlsInclusion"
                  workingDays="0111110" />   <!-- Sunday-first; Mon-Fri working -->

Classes

ResolutionPolicy

Captures the resource-level policies that govern duplicate declarations, same-day and span collisions, priority direction, category precedence, range inclusion, and the working week.

Interfaces

INotableDateCollisionResolver

Resolves a group of colliding notable-date occurrences, used when the resource's same-day or span collision policy is Custom.

Enums

CollisionPolicy

Determines how the resolver treats multiple distinct notable dates that resolve to the same day.

DuplicatePolicy

Specifies how the loader treats two concepts, or two rules of one concept, that a document declares with the same identifier.

EmissionMode

Controls which occurrences an adjustment policy emits when its trigger is active: the originally calculated (actual) occurrence, the adjusted (observed) occurrence, both, or neither.

ObservedDateRangePolicy

Specifies which span of a resolved occurrence decides whether a date-range query includes it: the emitted span, the actual span, or either.

PriorityDirection

Determines whether a higher or lower numeric priority value wins a same-day collision.