juspay / hyperswitch

An open source payments switch written in Rust to make payments fast, reliable and affordable
https://hyperswitch.io/
Apache License 2.0
12.63k stars 1.36k forks source link

fix(payments_list): remove time range to filter payments attempts #6159

Closed apoorvdixit88 closed 1 month ago

apoorvdixit88 commented 1 month ago

Type of Change

Description

Currently created_at is not indexed in payment attempt table, when applying filtering with active attempt ids. We are adding extra overhead of checking time_range, though we need not to as we will be already getting filtered attempt ids from intent table.

Additional Changes

Motivation and Context

Closes #6160

How did you test it?

We can hit test api

curl --location 'http://localhost:8080/payments/list' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \

--header 'Authorization: Bearer JWT' \
--data '{

    "limit": 50,

}'

Checklist

semanticdiff-com[bot] commented 1 month ago

Review changes with SemanticDiff.

Analyzed 6 of 6 files.

Filename Status
:heavy_check_mark: crates/storage_impl/src/payments/payment_attempt.rs Analyzed
:heavy_check_mark: crates/storage_impl/src/mock_db/payment_attempt.rs Analyzed
:heavy_check_mark: crates/router/src/db/kafka_store.rs Analyzed
:heavy_check_mark: crates/router/src/core/payments.rs Analyzed
:heavy_check_mark: crates/hyperswitch_domain_models/src/payments/payment_attempt.rs Analyzed
:heavy_check_mark: crates/diesel_models/src/query/payment_attempt.rs Analyzed