feat(revenue_recovery): add support to fetch data and update additional token data in redis#9611
Merged
likhinbopanna merged 5 commits intomainfrom Oct 1, 2025
Merged
Conversation
Changed Files
|
| pub struct UpdateTokenStatusRequest { | ||
| pub connector_customer_id: String, | ||
| pub payment_processor_token: Secret<String, PhoneNumberStrategy>, | ||
| pub scheduled_at: Option<String>, |
Contributor
There was a problem hiding this comment.
Suggested change
| pub scheduled_at: Option<String>, | |
| pub scheduled_at: Option<PrimitiveDateTime>, |
| }) | ||
| .or_else(|| { | ||
| // Parse datetime | ||
| time::PrimitiveDateTime::parse( |
Contributor
There was a problem hiding this comment.
change type of scheduled_at to PrimitiveDataTime. So that this parsing is not needed
|
|
||
| // Check if key exists | ||
| let key_exists = redis_conn | ||
| .exists::<()>(&redis_key.clone().into()) |
Contributor
There was a problem hiding this comment.
This is not needed.
redis_conn.get_key() and get_hash_fields() itself will tell id the key is present or not
Comment on lines
+14
to
+17
| pub enum ScheduledAtUpdate { | ||
| SetToDateTime(#[serde(deserialize_with = "deserialize_primitive_datetime")] PrimitiveDateTime), | ||
| SetToNull(String), // matches "null" string | ||
| } |
Contributor
There was a problem hiding this comment.
With this you won't be needing the custom deserializer
Suggested change
| pub enum ScheduledAtUpdate { | |
| SetToDateTime(#[serde(deserialize_with = "deserialize_primitive_datetime")] PrimitiveDateTime), | |
| SetToNull(String), // matches "null" string | |
| } | |
| pub enum ScheduledAtUpdate { | |
| SetToDateTime(#[serde(with = "common_utils::custom_serde::iso8601")] PrimitiveDateTime), | |
| #[serde(rename = "null")] | |
| SetToNull, // matches "null" string | |
| } |
hrithikesh026
approved these changes
Oct 1, 2025
aniketburman014
approved these changes
Oct 1, 2025
srujanchikke
approved these changes
Oct 1, 2025
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.
Type of Change
Description
This PR introduces two new API:-
Additional Changes
Motivation and Context
How did you test it?
cURL to get redis data (token type:- Tokens)
Test case 1 (token is present)
Response:-
Test case 2 (token is not present)
cURL to get redis data (token type:- Status)
Test case 3 (status is not present)
cURL to update redis data
Test case 4 (token is present)
Test case 5 (token is not present)
Checklist
cargo +nightly fmt --allcargo clippy