feat(quotes): bound signing and execution dates - #6138
Merged
Conversation
toommz
force-pushed
the
feat/quotes/date-validations-fixes
branch
from
August 17, 2026 07:33
08362cc to
de880dd
Compare
This was referenced Aug 18, 2026
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.
Context
Three quote dates are refused in the past by the execution flow: the subscription ending date (
end_date,plans[].payload.endDate), a walletexpirationAtand a recurring ruleexpirationAt. They are only checked for futureness at approve, and nothing ties them to the dates that decide when execution happens, so a deal can be signed or scheduled past its own term and only blows up at execution as a failed order.Description
Adds
QuoteVersions::DealExpiration, which folds those fields into the earliest date the deal must still be running, and bounds both write points against it:expires_atat approve (OrderForms::CreateService)execute_atat signing and on update, via the sharedExecutionSettingsValidationconcernBoth fail with
after_deal_expiration. The comparison is by date and strictly earlier, matchingvalid_ending_at?, which already fails on a same-day landing.one_offquotes carry none of these fields, so the check is a no-op for them.Two known limits: an order with no
execute_atis executed manually at any time, so the execution-time failure stays the backstop; and a short-lived wallet now constrains the signing window too.