Alternative: RepeatingWithin cycle kind (I notation) — subclasses Within#72
Closed
Alternative: RepeatingWithin cycle kind (I notation) — subclasses Within#72
Conversation
Alternative to #71 (Interval) — same behavior, different class structure. RepeatingWithin subclasses Within to make the relationship explicit. V1I24MF2026-03-31 = complete 1 every 24 months from March 31, 2026. After satisfaction, consuming app calls reactivated_notation(date) to start the next window. Overrides from Within: - recurring? → true (Within is false) - to_s → "every...from" format (Within uses "within...range") - extend_period → no-op (re-anchors instead of extending) - last_completed → returns from_date (current window anchor) - expiration_of → returns final_date - satisfied_by? → checks anchor <= final_date - start_date/final_date → nil-safe for dormant state Also adds reactivated_notation(date) alias for activated_notation to make the re-anchoring call site self-documenting.
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
Alternative to #71 — same behavior, different class structure. This PR subclasses
Withinto make the relationship explicit, per jdowd's feedback on #69.V1I24MF2026-03-31= complete 1 every 24 months from March 31, 2026. After satisfaction, the consuming app callsreactivated_notation(completion_date)to start the next window.Design: Subclass vs Sibling
final_date,start_date,date_rangerecurring?,to_s,extend_period,last_completed,expiration_of,satisfied_by?,start_date(nil-safe),final_date(nil-safe)recurring?returns opposite of parentTradeoffs
Subclass (this PR):
final_date/start_datecomputation (DRY)recurring?,satisfied_by?)start_date/final_datebecause Within assumes active stateSibling (#71):
final_date/start_dateone-liners from WithinBonus:
reactivated_notationaliasAdded
reactivated_notation(date)as an alias foractivated_notation(date). Same operation, but self-documenting at the call site:Test plan
RepeatingWithin < Withininheritancefinal_date/start_datematch Within's computationAddresses QUAL-6317
Alternative to #71
Depends on #70 (EndOf fix)