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

fix(router): validate schedule time before scheduling API key expiry reminder #1776

Merged
merged 3 commits into from
Jul 24, 2023
Merged

fix(router): validate schedule time before scheduling API key expiry reminder #1776

merged 3 commits into from
Jul 24, 2023

Conversation

trfdeer
Copy link
Contributor

@trfdeer trfdeer commented Jul 24, 2023

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

During the api_key expiry if the merchant sets the expiry to next day or any other day before 7 days, we need to perform a validation something like - calculate the schedule_time of 1st email during api_key creation. if it is before the current_time, don't create an entry in process_tracker.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Closes #1625

How did you test it?

I tested the changes manually.

  1. First created an API Key with expiry date after more than 7 days from today. Verified process_tracker entry is added.

    added_api

    added_db

  2. Then created an API key with expiry date less than 7 days from today. Verified process_tracker entry is not added.
    not_added_api
    not_added_db

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@trfdeer trfdeer requested a review from a team as a code owner July 24, 2023 12:02
@Chethan-rao Chethan-rao added A-process-tracker Area: Process tracker C-bug Category: Bug S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Jul 24, 2023
@Chethan-rao
Copy link
Contributor

Chethan-rao commented Jul 24, 2023

Just add the comment saying that if merchant wants the api_key to expire before 7 days, then we are not notifying the merchant about its expiry, so that we document this action.

Other than that, looks good to me!

@trfdeer
Copy link
Contributor Author

trfdeer commented Jul 24, 2023

Just add the comment saying that if merchant wants the api_key to expire before 7 days, then we are not notifying the merchant about its expiry, so that we document this action.

I've added comments describing the change.

Copy link
Member

@SanchithHegde SanchithHegde left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Thanks for the PR, @trfdeer!

@SanchithHegde SanchithHegde changed the title fix(router): Validate before adding API Key Expiry reminder fix(router): validate schedule time before scheduling API key expiry reminder Jul 24, 2023
@SanchithHegde SanchithHegde added this pull request to the merge queue Jul 24, 2023
Merged via the queue into juspay:main with commit 7b1dc78 Jul 24, 2023
@pixincreate pixincreate removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-process-tracker Area: Process tracker C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] update api_key_expiry_workflow to validate the expiry before scheduling the task
4 participants