Skip to content

feat(quotes): bound signing and execution dates - #6138

Merged
toommz merged 1 commit into
mainfrom
feat/quotes/date-validations-fixes
Aug 18, 2026
Merged

feat(quotes): bound signing and execution dates#6138
toommz merged 1 commit into
mainfrom
feat/quotes/date-validations-fixes

Conversation

@toommz

@toommz toommz commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Context

Three quote dates are refused in the past by the execution flow: the subscription ending date (end_date, plans[].payload.endDate), a wallet expirationAt and a recurring rule expirationAt. 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_at at approve (OrderForms::CreateService)
  • execute_at at signing and on update, via the shared ExecutionSettingsValidation concern

Both fail with after_deal_expiration. The comparison is by date and strictly earlier, matching valid_ending_at?, which already fails on a same-day landing. one_off quotes carry none of these fields, so the check is a no-op for them.

Two known limits: an order with no execute_at is executed manually at any time, so the execution-time failure stays the backstop; and a short-lived wallet now constrains the signing window too.

@toommz toommz self-assigned this Aug 12, 2026
@toommz
toommz marked this pull request as ready for review August 13, 2026 12:06
@toommz
toommz requested review from aquinofb and mariohd August 13, 2026 12:06
@toommz
toommz force-pushed the feat/quotes/date-validations-fixes branch from 08362cc to de880dd Compare August 17, 2026 07:33

@aquinofb aquinofb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

2 participants