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

feat(router): add total count for refunds list #1935

Merged
merged 6 commits into from
Aug 18, 2023

Conversation

apoorvdixit88
Copy link
Contributor

Type of Change

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

Description

Added support for total count of available refunds in refunds list. This will support better pagination and also work well with filters applied on refunds list.

Additional Changes

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

Motivation and Context

The current refund list api doesn't have support for proper pagination.

How did you test it?

Screenshot 2023-08-16 at 1 58 53 AM

Checklist

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

@apoorvdixit88 apoorvdixit88 added C-feature Category: Feature request or enhancement A-refunds Area: Refund flows labels Aug 15, 2023
@apoorvdixit88 apoorvdixit88 requested review from a team as code owners August 15, 2023 20:35
@apoorvdixit88 apoorvdixit88 self-assigned this Aug 15, 2023
@apoorvdixit88 apoorvdixit88 added the R-waiting-on-L1 Review: Waiting on L1 reviewer label Aug 17, 2023
merchant_account.storage_scheme,
)
.await
.to_not_found_response(errors::ApiErrorResponse::InternalServerError)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be 0 instead of error response?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

count 0 case is handled, error can occur in cases, such as DB is down or some unexpected behaviour.

@@ -160,7 +162,9 @@ pub struct TimeRange {
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize, ToSchema)]
pub struct RefundListResponse {
/// The number of refunds included in the list
pub size: usize,
pub count: usize,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not backward compatible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now it is not being used

@inventvenkat inventvenkat added this pull request to the merge queue Aug 18, 2023
Merged via the queue into main with commit 84967d3 Aug 18, 2023
9 of 10 checks passed
@inventvenkat inventvenkat deleted the total-count-of-refunds-list branch August 18, 2023 14:12
@SanchithHegde SanchithHegde removed the R-waiting-on-L1 Review: Waiting on L1 reviewer label Aug 20, 2023
SamraatBansal added a commit that referenced this pull request Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-refunds Area: Refund flows C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants