Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate Order expires_at Using valid_for_iso #1865

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pavelbrm
Copy link
Contributor

Summary

This PR is aiming at addressing #1864.

The validity period in ISO format is not part of the order data. It's available on the order's item. (While the code technically allows multiple items per order, at present there is always one item. Consulted with real data).

The fix works as follows:

  • When there is a need to update expires_at (which is when an order goes to paid), fetch it's items.
  • From the first (the only) item, get the duration corresponding to the value in valid_for_iso.
  • If that was successful, use that duration instead of valid_for for calculating expires_at.
  • Otherwise, fallback on the old behaviour for now.

Type of Change

  • Product feature
  • Bug fix
  • Performance improvement
  • Refactor
  • Other

Tested Environments

  • Development
  • Staging
  • Production

Before Submitting This PR

  • Does your code build cleanly without any errors or warnings?
  • Have you used auto closing keywords?
  • Have you added tests for new functionality?
  • Have validated query efficiency for new database queries?
  • Have documented new functionality in README or in comments?
  • Have you squashed all intermediate commits?
  • Is there a clear title that explains what the PR does?
  • Have you used intuitive function, variable and other naming?
  • Have you requested security / privacy review if needed
  • Have you performed a self review of this PR?

Manual Test Plan


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