feat: add new routes for profile level list apis (#5589)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Hrithikesh
2024-08-22 17:02:38 +05:30
committed by GitHub
parent 22743ac370
commit d3521e7e76
10 changed files with 509 additions and 0 deletions

View File

@ -42,3 +42,30 @@ pub async fn retrieve_dispute() {}
security(("api_key" = []))
)]
pub async fn retrieve_disputes_list() {}
/// Disputes - List Disputes for The Given Business Profiles
/// Lists all the Disputes for a merchant
#[utoipa::path(
get,
path = "/disputes/profile/list",
params(
("limit" = Option<i64>, Query, description = "The maximum number of Dispute Objects to include in the response"),
("dispute_status" = Option<DisputeStatus>, Query, description = "The status of dispute"),
("dispute_stage" = Option<DisputeStage>, Query, description = "The stage of dispute"),
("reason" = Option<String>, Query, description = "The reason for dispute"),
("connector" = Option<String>, Query, description = "The connector linked to dispute"),
("received_time" = Option<PrimitiveDateTime>, Query, description = "The time at which dispute is received"),
("received_time.lt" = Option<PrimitiveDateTime>, Query, description = "Time less than the dispute received time"),
("received_time.gt" = Option<PrimitiveDateTime>, Query, description = "Time greater than the dispute received time"),
("received_time.lte" = Option<PrimitiveDateTime>, Query, description = "Time less than or equals to the dispute received time"),
("received_time.gte" = Option<PrimitiveDateTime>, Query, description = "Time greater than or equals to the dispute received time"),
),
responses(
(status = 200, description = "The dispute list was retrieved successfully", body = Vec<DisputeResponse>),
(status = 401, description = "Unauthorized request")
),
tag = "Disputes",
operation_id = "List Disputes for The given Business Profiles",
security(("api_key" = []))
)]
pub async fn retrieve_disputes_list_profile() {}

View File

@ -459,6 +459,33 @@ pub fn payments_cancel() {}
)]
pub fn payments_list() {}
/// Business Profile level Payments - List
///
/// To list the payments
#[utoipa::path(
get,
path = "/payments/list",
params(
("customer_id" = String, Query, description = "The identifier for the customer"),
("starting_after" = String, Query, description = "A cursor for use in pagination, fetch the next list after some object"),
("ending_before" = String, Query, description = "A cursor for use in pagination, fetch the previous list before some object"),
("limit" = i64, Query, description = "Limit on the number of objects to return"),
("created" = PrimitiveDateTime, Query, description = "The time at which payment is created"),
("created_lt" = PrimitiveDateTime, Query, description = "Time less than the payment created time"),
("created_gt" = PrimitiveDateTime, Query, description = "Time greater than the payment created time"),
("created_lte" = PrimitiveDateTime, Query, description = "Time less than or equals to the payment created time"),
("created_gte" = PrimitiveDateTime, Query, description = "Time greater than or equals to the payment created time")
),
responses(
(status = 200, description = "Received payment list"),
(status = 404, description = "No payments found")
),
tag = "Payments",
operation_id = "List all Payments for the Profile",
security(("api_key" = []))
)]
pub async fn profile_payments_list() {}
/// Payments - Incremental Authorization
///
/// Authorized amount for a payment can be incremented if it is in status: requires_capture

View File

@ -107,6 +107,28 @@ pub async fn payouts_fulfill() {}
)]
pub async fn payouts_list() {}
/// Payouts - List for the Given Profiles
#[utoipa::path(
get,
path = "/payouts/profile/list",
params(
("customer_id" = String, Query, description = "The identifier for customer"),
("starting_after" = String, Query, description = "A cursor for use in pagination, fetch the next list after some object"),
("ending_before" = String, Query, description = "A cursor for use in pagination, fetch the previous list before some object"),
("limit" = String, Query, description = "limit on the number of objects to return"),
("created" = String, Query, description = "The time at which payout is created"),
("time_range" = String, Query, description = "The time range for which objects are needed. TimeRange has two fields start_time and end_time from which objects can be filtered as per required scenarios (created_at, time less than, greater than etc).")
),
responses(
(status = 200, description = "Payouts listed", body = PayoutListResponse),
(status = 404, description = "Payout not found")
),
tag = "Payouts",
operation_id = "List payouts using generic constraints for the given Profiles",
security(("api_key" = []))
)]
pub async fn payouts_list_profile() {}
/// Payouts - List available filters
#[utoipa::path(
post,
@ -136,6 +158,21 @@ pub async fn payouts_list_filters() {}
)]
pub async fn payouts_list_by_filter() {}
/// Payouts - List using filters for the given Profiles
#[utoipa::path(
post,
path = "/payouts/list",
request_body=PayoutListFilterConstraints,
responses(
(status = 200, description = "Payouts filtered", body = PayoutListResponse),
(status = 404, description = "Payout not found")
),
tag = "Payouts",
operation_id = "Filter payouts using specific constraints for the given Profiles",
security(("api_key" = []))
)]
pub async fn payouts_list_by_filter_profile() {}
/// Payouts - Confirm
#[utoipa::path(
post,

View File

@ -128,6 +128,22 @@ pub async fn refunds_update() {}
)]
pub fn refunds_list() {}
/// Refunds - List For the Given profiles
///
/// Lists all the refunds associated with the merchant or a payment_id if payment_id is not provided
#[utoipa::path(
post,
path = "/refunds/profile/list",
request_body=RefundListRequest,
responses(
(status = 200, description = "List of refunds", body = RefundListResponse),
),
tag = "Refunds",
operation_id = "List all Refunds for the given Profiles",
security(("api_key" = []))
)]
pub fn refunds_list_profile() {}
/// Refunds - Filter
///
/// To list the refunds filters associated with list of connectors, currencies and payment statuses