From 3a869a2d5731a2393a687ed7773eda5344bd8e3f Mon Sep 17 00:00:00 2001 From: SamraatBansal <55536657+SamraatBansal@users.noreply.github.com> Date: Thu, 8 Feb 2024 14:38:20 +0530 Subject: [PATCH] docs: add list mandates for customer (#3592) --- crates/openapi/src/openapi.rs | 1 + crates/openapi/src/routes/customers.rs | 16 +++++++++++++ openapi/openapi_spec.json | 33 ++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/crates/openapi/src/openapi.rs b/crates/openapi/src/openapi.rs index 1936300ee149..dc38181a6839 100644 --- a/crates/openapi/src/openapi.rs +++ b/crates/openapi/src/openapi.rs @@ -114,6 +114,7 @@ Never share your secret api keys. Keep them guarded and secure. routes::customers::customers_list, routes::customers::customers_update, routes::customers::customers_delete, + routes::customers::customers_mandates_list, //Routes for payment methods routes::payment_method::create_payment_method_api, diff --git a/crates/openapi/src/routes/customers.rs b/crates/openapi/src/routes/customers.rs index 7517cdc61a04..19901cbbeb97 100644 --- a/crates/openapi/src/routes/customers.rs +++ b/crates/openapi/src/routes/customers.rs @@ -100,3 +100,19 @@ pub async fn customers_delete() {} security(("api_key" = [])) )] pub async fn customers_list() {} + +/// Customers - Mandates List +/// +/// Lists all the mandates for a particular customer id. +#[utoipa::path( + post, + path = "/customers/{customer_id}/mandates", + responses( + (status = 200, description = "List of retrieved mandates for a customer", body = Vec), + (status = 400, description = "Invalid Data"), + ), + tag = "Customers Mandates List", + operation_id = "List all Mandates for a Customer", + security(("api_key" = [])) +)] +pub async fn customers_mandates_list() {} diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 2803141b38bd..be011422e036 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -1608,6 +1608,39 @@ ] } }, + "/customers/{customer_id}/mandates": { + "post": { + "tags": [ + "Customers Mandates List" + ], + "summary": "Customers - Mandates List", + "description": "Customers - Mandates List\n\nLists all the mandates for a particular customer id.", + "operationId": "List all Mandates for a Customer", + "responses": { + "200": { + "description": "List of retrieved mandates for a customer", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MandateResponse" + } + } + } + } + }, + "400": { + "description": "Invalid Data" + } + }, + "security": [ + { + "api_key": [] + } + ] + } + }, "/customers/{customer_id}/payment_methods": { "get": { "tags": [