-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(disputes): add filters for disputes list #5637
Conversation
55b83a2
to
d10f28a
Compare
pub limit: Option<i64>, | ||
pub struct DisputeListGetConstraints { | ||
/// The identifier for dispute | ||
pub dispute_id: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need dispute_id
in DisputeListGetConstraints? We can use Dispute retrieve for point query right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its good to have:
- Users will be able to search for a specific dispute by its ID and see the result directly in the list and then it can be retrieved. If the dispute doesn't exist, the list page should display a message indicating that the dispute is not present.
- Users will have the ability to search for disputes one by one, without needing to repeatedly navigate back to the retrieve page. They should be able to see disputes directly in list (if it exists), making the process more user-friendly and efficient.
time_range, | ||
} = value; | ||
let profile_id_from_request_body = profile_id; | ||
let profile_id_list = match (profile_id_from_request_body, auth_profile_id_list) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please explain here with some code comments?
crates/router/src/core/disputes.rs
Outdated
{ | ||
data | ||
} else { | ||
return Err(errors::ApiErrorResponse::InternalServerError.into()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please add an attach printable here?
Ok(locked_disputes | ||
let limit_usize = dispute_constraints | ||
.limit | ||
.unwrap_or(u32::MAX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not good idea to keep it to MAX if value is not present right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its for MockDb we can change this. Will create good first issue for this.
pub dispute_stage: Option<DisputeStage>, | ||
/// reason for the dispute | ||
/// The comma separated list of status of the disputes | ||
#[serde(default, deserialize_with = "parse_comma_separated")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the parse comma thing for backwards compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and it will support for open source users too.
Also it is because we will be passing list in query params, Get api, so parsing logic is required. For passing lists like this there is also other syntax where actix will handle things, list[]=1
&list[]=2
. But for now as dashboard frontend is passing comma separated, for all the similar get apis where list is required, using the same for it.
Later we can change this if required.
Type of Change
Description
Add filters for disputes list
Additional Changes
Motivation and Context
Closes #5626
How did you test it?
The following endpoints will give profile or merchant level filters:
The start_time and end_time are in primitive data time format:
start_time
=2024-07-03T18:00:00.000Z
end_time
=2024-10-03T18:00:00.000Z
Response: Set of dropdown filters:
The list api will accept set of filters in query param and gives desired response
Response will be list after applying the filters passed in query param.
Checklist
cargo +nightly fmt --all
cargo clippy