From 4c8bf3ad2d93f63c99581e7d0b6ed7de0e74dabf Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Fri, 6 Dec 2024 11:23:35 +0000 Subject: [PATCH 01/49] feat(DEV-13300): add finance sdk and api integration setup --- packages/sdk-react/generate-api-client.sh | 2 +- packages/sdk-react/package.json | 1 + packages/sdk-react/src/api/schema.json | 6416 +++++++++++++---- .../src/core/queries/useFinancing.ts | 152 + packages/sdk-react/src/core/queries/useMe.ts | 5 + yarn.lock | 11 + 6 files changed, 5365 insertions(+), 1222 deletions(-) create mode 100644 packages/sdk-react/src/core/queries/useFinancing.ts diff --git a/packages/sdk-react/generate-api-client.sh b/packages/sdk-react/generate-api-client.sh index d9a185d35..e388f7f73 100755 --- a/packages/sdk-react/generate-api-client.sh +++ b/packages/sdk-react/generate-api-client.sh @@ -5,6 +5,6 @@ set -o errexit yarn exec openapi-qraft src/api/schema.json --plugin tanstack-query-react --plugin openapi-typescript \ --output-dir src/api --clean --filter-services '**,!/portal/**' \ --operation-predefined-parameters \ - '/**,!/auth/**,!/entities/**,!/entity_users/me,!/entity_users/my_entity,!/entity_users/my_role,!/events/**,!/mail_templates/**,!/webhook_subscriptions/**,!/webhook_settings/**,!/receivables/variables,!/settings/**,!/files/**,!/mailbox_domains/**,!/payable_purchase_orders/**,!/frontend/bank_account_masks,!/frontend/document_type_descriptions,!/frontend/person_mask,!/frontend/bank_accounts_currency_to_supported_countries,!/internal/**:header.x-monite-entity-id' \ + '/**,!/auth/**,!/entities/**,!/entity_users/me,!/entity_users/my_entity,!/entity_users/my_role,!/events/**,!/mail_templates/**,!/webhook_subscriptions/**,!/webhook_settings/**,!/receivables/variables,!/settings/**,!/files/**,!/mailbox_domains/**,!/payable_purchase_orders/**,!/frontend/bank_account_masks,!/frontend/document_type_descriptions,!/frontend/person_mask,!/frontend/bank_accounts_currency_to_supported_countries,!/internal/**,!/payables/validations/**:header.x-monite-entity-id' \ '/**:header.x-monite-version' \ && prettier --write src/api/**/**.ts diff --git a/packages/sdk-react/package.json b/packages/sdk-react/package.json index a1f406df0..9950ea5c6 100644 --- a/packages/sdk-react/package.json +++ b/packages/sdk-react/package.json @@ -58,6 +58,7 @@ "react-infinite-scroll-component": "~6.1.0", "react-international-phone": "~4.2.4", "react-router-dom": "^6.3.0", + "react-script-hook": "~1.7.2", "react-use": "^17.3.2", "react-virtuoso": "~4.7.10", "yup": "~0.32.11" diff --git a/packages/sdk-react/src/api/schema.json b/packages/sdk-react/src/api/schema.json index 4169ff6b7..603335ba1 100644 --- a/packages/sdk-react/src/api/schema.json +++ b/packages/sdk-react/src/api/schema.json @@ -1179,6 +1179,400 @@ "security": [{ "HTTPBearer": [] }] } }, + "/analytics/payables": { + "get": { + "tags": ["Analytics"], + "summary": "Get payables", + "description": "Retrieve aggregated statistics for payables with different breakdowns.", + "operationId": "get_analytics_payables", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": false, + "schema": { "$ref": "#/components/schemas/PayableDimensionEnum" }, + "name": "dimension", + "in": "query" + }, + { + "required": true, + "schema": { "$ref": "#/components/schemas/PayableMetricEnum" }, + "name": "metric", + "in": "query" + }, + { + "required": true, + "schema": { + "$ref": "#/components/schemas/AggregationFunctionEnum" + }, + "name": "aggregation_function", + "in": "query" + }, + { + "required": false, + "schema": { + "$ref": "#/components/schemas/DateDimensionBreakdownEnum" + }, + "name": "date_dimension_breakdown", + "in": "query" + }, + { + "description": "Return only payables created in Monite after the specified date and time. The value must be in the ISO 8601 format YYYY-MM-DDThh:mm[:ss[.ffffff]][Z|±hh:mm].", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__gt", + "in": "query" + }, + { + "description": "Return only payables created in Monite before the specified date and time.", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__lt", + "in": "query" + }, + { + "description": "Return only payables created in Monite on or after the specified date and time.", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__gte", + "in": "query" + }, + { + "description": "Return only payables created in Monite before or on the specified date and time.", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__lte", + "in": "query" + }, + { + "description": "Return only payables that have the specified [status](https://docs.monite.com/accounts-payable/payables/index).\n\nTo query multiple statuses at once, use the `status__in` parameter instead.", + "required": false, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/PayableStateEnum" }] + }, + "name": "status", + "in": "query" + }, + { + "description": "Return only payables that have the specified [statuses](https://docs.monite.com/accounts-payable/payables/index).\n\nTo specify multiple statuses, repeat this parameter for each value: `status__in=draft&status__in=new`", + "required": false, + "schema": { + "items": { "$ref": "#/components/schemas/PayableStateEnum" }, + "type": "array" + }, + "name": "status__in", + "in": "query" + }, + { + "description": "Return only payables with specified IDs. Valid but nonexistent IDs do not raise errors but produce no results.\n\nTo specify multiple IDs, repeat this parameter for each value: `id__in=<id1>&id__in=<id2>`", + "required": false, + "schema": { + "items": { "type": "string", "format": "uuid" }, + "type": "array" + }, + "name": "id__in", + "in": "query" + }, + { + "description": "Return only payables with the exact specified total amount. The amount must be specified in the minor units of currency. For example, $12.5 is represented as 1250.", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount", + "in": "query" + }, + { + "description": "Return only payables whose total amount (in minor units) exceeds the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount__gt", + "in": "query" + }, + { + "description": "Return only payables whose total amount (in minor units) is less than the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount__lt", + "in": "query" + }, + { + "description": "Return only payables whose total amount (in minor units) is greater than or equal to the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount__gte", + "in": "query" + }, + { + "description": "Return only payables whose total amount (in minor units) is less than or equal to the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount__lte", + "in": "query" + }, + { + "description": "Return only payables with the specified amount.", + "required": false, + "schema": { "type": "integer" }, + "name": "amount", + "in": "query" + }, + { + "description": "Return only payables whose amount (in minor units) exceeds the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "amount__gt", + "in": "query" + }, + { + "description": "Return only payables whose amount (in minor units) is less than the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "amount__lt", + "in": "query" + }, + { + "description": "Return only payables whose amount (in minor units) is greater than or equal to the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "amount__gte", + "in": "query" + }, + { + "description": "Return only payables whose amount (in minor units) is less than or equal to the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "amount__lte", + "in": "query" + }, + { + "description": "Return only payables that use the specified currency.", + "required": false, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/CurrencyEnum" }] + }, + "name": "currency", + "in": "query" + }, + { + "description": "Return only payables received from counterparts with the specified name (exact match, case-sensitive).\n\nFor counterparts of `type = individual`, the full name is formatted as `first_name last_name`.", + "required": false, + "schema": { "type": "string" }, + "name": "counterpart_name", + "in": "query" + }, + { + "description": "Return only payables received from counterparts whose name contains the specified string (case-sensitive).", + "required": false, + "schema": { "type": "string" }, + "name": "counterpart_name__contains", + "in": "query" + }, + { + "description": "Return only payables received from counterparts whose name contains the specified string (case-insensitive).", + "required": false, + "schema": { "type": "string" }, + "name": "counterpart_name__icontains", + "in": "query" + }, + { + "description": "Apply the `icontains` condition to search for the specified text in the `document_id` and `counterpart_name` fields in the payables.", + "required": false, + "schema": { "type": "string" }, + "name": "search_text", + "in": "query" + }, + { + "description": "Return payables that are due on the specified date (YYYY-MM-DD)", + "required": false, + "schema": { "type": "string", "format": "date" }, + "name": "due_date", + "in": "query" + }, + { + "description": "Return payables that are due after the specified date (exclusive, YYYY-MM-DD).", + "required": false, + "schema": { "type": "string", "format": "date" }, + "name": "due_date__gt", + "in": "query" + }, + { + "description": "Return payables that are due before the specified date (exclusive, YYYY-MM-DD).", + "required": false, + "schema": { "type": "string", "format": "date" }, + "name": "due_date__lt", + "in": "query" + }, + { + "description": "Return payables that are due on or after the specified date (YYYY-MM-DD).", + "required": false, + "schema": { "type": "string", "format": "date" }, + "name": "due_date__gte", + "in": "query" + }, + { + "description": "Return payables that are due before or on the specified date (YYYY-MM-DD).", + "required": false, + "schema": { "type": "string", "format": "date" }, + "name": "due_date__lte", + "in": "query" + }, + { + "description": "Return a payable with the exact specified document number (case-sensitive).\n\nThe `document_id` is the user-facing document number such as INV-00042, not to be confused with Monite resource IDs (`id`).", + "required": false, + "schema": { "type": "string" }, + "name": "document_id", + "in": "query" + }, + { + "description": "Return only payables whose document number (`document_id`) contains the specified string (case-sensitive).", + "required": false, + "schema": { "type": "string" }, + "name": "document_id__contains", + "in": "query" + }, + { + "description": "Return only payables whose document number (`document_id`) contains the specified string (case-insensitive).", + "required": false, + "schema": { "type": "string" }, + "name": "document_id__icontains", + "in": "query" + }, + { + "description": "Return only payables created in Monite by the entity user with the specified ID.", + "required": false, + "schema": { "type": "string", "format": "uuid" }, + "name": "was_created_by_user_id", + "in": "query" + }, + { + "description": "Return only payables received from the counterpart with the specified ID.\n\nCounterparts that have been deleted but have associated payables will still return results here because the payables contain a frozen copy of the counterpart data.\n\nIf the specified counterpart ID does not exist and never existed, no results are returned.", + "required": false, + "schema": { "type": "string", "format": "uuid" }, + "name": "counterpart_id", + "in": "query" + }, + { + "description": "Return only payables coming from the specified source.", + "required": false, + "schema": { + "allOf": [ + { "$ref": "#/components/schemas/SourceOfPayableDataEnum" } + ] + }, + "name": "source_of_payable_data", + "in": "query" + }, + { + "description": "Return only payables with specific OCR statuses.", + "required": false, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/OcrStatusEnum" }] + }, + "name": "ocr_status", + "in": "query" + }, + { + "description": "Search for a payable by the identifier of the line item associated with it.", + "required": false, + "schema": { "type": "string", "format": "uuid" }, + "name": "line_item_id", + "in": "query" + }, + { + "description": "Search for a payable by the identifier of the purchase order associated with it.", + "required": false, + "schema": { "type": "string", "format": "uuid" }, + "name": "purchase_order_id", + "in": "query" + }, + { + "description": "Return only payables assigned to the project with the specified ID.\n\nValid but nonexistent project IDs do not raise errors but return no results.", + "required": false, + "schema": { "type": "string", "format": "uuid" }, + "name": "project_id", + "in": "query" + }, + { + "description": "Return only payables whose `tags` include at least one of the tags with the specified IDs. Valid but nonexistent tag IDs do not raise errors but produce no results.", + "required": false, + "schema": { + "items": { "type": "string", "format": "uuid" }, + "type": "array" + }, + "name": "tag_ids", + "in": "query" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayableAnalyticsResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, "/approval_policies": { "get": { "tags": ["Approval policies"], @@ -11881,6 +12275,502 @@ "security": [{ "HTTPBearer": [] }] } }, + "/financing_invoices": { + "get": { + "tags": ["Financing"], + "summary": "Get invoices", + "description": "Returns a list of invoices requested for financing", + "operationId": "get_financing_invoices", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "description": "Order by", + "required": false, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/OrderEnum" }], + "default": "asc" + }, + "name": "order", + "in": "query" + }, + { + "description": "Max is 100", + "required": false, + "schema": { + "type": "integer", + "maximum": 100.0, + "minimum": 1.0, + "default": 100 + }, + "name": "limit", + "in": "query" + }, + { + "description": "A token, obtained from previous page. Prior over other filters", + "required": false, + "schema": { "type": "string" }, + "name": "pagination_token", + "in": "query" + }, + { + "description": "Allowed sort fields", + "required": false, + "schema": { + "allOf": [ + { "$ref": "#/components/schemas/FinancingInvoiceCursorFields" } + ] + }, + "name": "sort", + "in": "query" + }, + { + "description": "ID of a payable or receivable invoice. ", + "required": false, + "schema": { "type": "string", "format": "uuid" }, + "name": "invoice_id", + "in": "query" + }, + { + "description": "List of invoice IDs. ", + "required": false, + "schema": { + "items": { "type": "string", "format": "uuid" }, + "type": "array" + }, + "name": "invoice_id__in", + "in": "query" + }, + { + "description": "Status of the invoice. ", + "required": false, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/WCInvoiceStatus" }] + }, + "name": "status", + "in": "query" + }, + { + "description": "List of invoice statuses. ", + "required": false, + "schema": { + "items": { "$ref": "#/components/schemas/WCInvoiceStatus" }, + "type": "array" + }, + "name": "status__in", + "in": "query" + }, + { + "description": "Type of the invoice. payable or receivable. ", + "required": false, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/FinancingInvoiceType" }] + }, + "name": "type", + "in": "query" + }, + { + "description": "List of invoice types. ", + "required": false, + "schema": { + "items": { "$ref": "#/components/schemas/FinancingInvoiceType" }, + "type": "array" + }, + "name": "type__in", + "in": "query" + }, + { + "description": "Document ID of the invoice. ", + "required": false, + "schema": { "type": "string" }, + "name": "document_id", + "in": "query" + }, + { + "description": "List of document IDs. ", + "required": false, + "schema": { "items": { "type": "string" }, "type": "array" }, + "name": "document_id__in", + "in": "query" + }, + { + "description": "Issue date greater than. ", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "issue_date__gt", + "in": "query" + }, + { + "description": "Issue date less than. ", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "issue_date__lt", + "in": "query" + }, + { + "description": "Issue date greater than or equal. ", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "issue_date__gte", + "in": "query" + }, + { + "description": "Issue date less than or equal. ", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "issue_date__lte", + "in": "query" + }, + { + "description": "Due date greater than. ", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "due_date__gt", + "in": "query" + }, + { + "description": "Due date less than. ", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "due_date__lt", + "in": "query" + }, + { + "description": "Due date greater than or equal. ", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "due_date__gte", + "in": "query" + }, + { + "description": "Due date less than or equal. ", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "due_date__lte", + "in": "query" + }, + { + "description": "Created date greater than. ", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__gt", + "in": "query" + }, + { + "description": "Created date less than. ", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__lt", + "in": "query" + }, + { + "description": "Created date greater than or equal. ", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__gte", + "in": "query" + }, + { + "description": "Created date less than or equal. ", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__lte", + "in": "query" + }, + { + "description": "Total amount of the invoice in minor units. ", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount", + "in": "query" + }, + { + "description": "Total amount greater than. ", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount__gt", + "in": "query" + }, + { + "description": "Total amount less than. ", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount__lt", + "in": "query" + }, + { + "description": "Total amount greater than or equal. ", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount__gte", + "in": "query" + }, + { + "description": "Total amount less than or equal. ", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount__lte", + "in": "query" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FinancingInvoiceListResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + }, + "post": { + "tags": ["Financing"], + "summary": "Request financing for invoices", + "description": "Returns a session token and a connect token to open Kanmon SDK for confirming invoice details.", + "operationId": "post_financing_invoices", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FinancingPushInvoicesRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FinancingPushInvoicesResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/financing_offers": { + "get": { + "tags": ["Financing"], + "summary": "Get financing offers and the business status", + "description": "Returns a list of financing offers and the business's onboarding status", + "operationId": "get_financing_offers", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FinancingOffersResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/financing_tokens": { + "post": { + "tags": ["Financing"], + "summary": "Create a token for Kanmon SDK", + "description": "Returns a token for Kanmon SDK. Creates a business and user on Kanmon if not already exist.", + "operationId": "post_financing_tokens", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FinancingTokenResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, "/frontend/bank_account_masks": { "get": { "tags": ["Onboarding requirements"], @@ -16712,11 +17602,11 @@ "security": [{ "HTTPBearer": [] }] } }, - "/payable_purchase_orders": { + "/payable_credit_notes": { "get": { - "tags": ["Purchase orders"], - "summary": "Get purchase orders", - "operationId": "get_payable_purchase_orders", + "tags": ["Credit Notes"], + "summary": "Get all credit notes for an entity", + "operationId": "get_payable_credit_notes", "parameters": [ { "required": true, @@ -16726,7 +17616,7 @@ "in": "header" }, { - "description": "Order by", + "description": "Sort order (ascending by default). Typically used together with the `sort` parameter.", "required": false, "schema": { "allOf": [{ "$ref": "#/components/schemas/OrderEnum" }], @@ -16736,7 +17626,7 @@ "in": "query" }, { - "description": "Max is 100", + "description": "The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page.", "required": false, "schema": { "type": "integer", @@ -16748,18 +17638,18 @@ "in": "query" }, { - "description": "A token, obtained from previous page. Prior over other filters", + "description": "A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query.\n\nIf not specified, the first page of results will be returned.", "required": false, "schema": { "type": "string" }, "name": "pagination_token", "in": "query" }, { - "description": "Allowed sort fields", + "description": "The field to sort the results by. Typically used together with the `order` parameter.", "required": false, "schema": { "allOf": [ - { "$ref": "#/components/schemas/PurchaseOrderCursorFields" } + { "$ref": "#/components/schemas/CreditNoteCursorFields" } ] }, "name": "sort", @@ -16791,76 +17681,110 @@ }, { "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "updated_at__gt", + "schema": { "type": "string", "format": "date" }, + "name": "issued_at", "in": "query" }, { "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "updated_at__lt", + "schema": { "type": "string", "format": "date" }, + "name": "issued_at__gt", "in": "query" }, { "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "updated_at__gte", + "schema": { "type": "string", "format": "date" }, + "name": "issued_at__lt", "in": "query" }, { "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "updated_at__lte", + "schema": { "type": "string", "format": "date" }, + "name": "issued_at__gte", "in": "query" }, { "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "issued_at__gt", + "schema": { "type": "string", "format": "date" }, + "name": "issued_at__lte", "in": "query" }, { "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "issued_at__lt", + "schema": { "type": "string" }, + "name": "document_id", "in": "query" }, { "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "issued_at__gte", + "schema": { "type": "string" }, + "name": "document_id__iexact", "in": "query" }, { "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "issued_at__lte", + "schema": { "type": "string" }, + "name": "document_id__contains", "in": "query" }, { "required": false, - "schema": { - "$ref": "#/components/schemas/PurchaseOrderStatusEnum" - }, - "name": "status", + "schema": { "type": "string" }, + "name": "document_id__icontains", "in": "query" }, { "required": false, - "schema": { "type": "string" }, - "name": "document_id", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "amount__gt", "in": "query" }, { "required": false, - "schema": { "items": { "type": "string" }, "type": "array" }, - "name": "document_id__in", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "amount__lt", + "in": "query" + }, + { + "required": false, + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "amount__gte", + "in": "query" + }, + { + "required": false, + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "amount__lte", + "in": "query" + }, + { + "required": false, + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "subtotal__gt", + "in": "query" + }, + { + "required": false, + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "subtotal__lt", + "in": "query" + }, + { + "required": false, + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "subtotal__gte", + "in": "query" + }, + { + "required": false, + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "subtotal__lte", "in": "query" }, { "required": false, "schema": { "type": "string", "format": "uuid" }, - "name": "created_by", + "name": "based_on", "in": "query" }, { @@ -16871,32 +17795,38 @@ }, { "required": false, - "schema": { - "items": { "type": "string", "format": "uuid" }, - "type": "array" - }, - "name": "counterpart_id__in", + "schema": { "type": "string", "format": "uuid" }, + "name": "created_by_entity_user_id", "in": "query" }, { "required": false, - "schema": { "type": "string" }, - "name": "counterpart.name", + "schema": { "$ref": "#/components/schemas/CreditNoteStateEnum" }, + "name": "status", "in": "query" }, { "required": false, - "schema": { "$ref": "#/components/schemas/CurrencyEnum" }, - "name": "currency", + "schema": { + "items": { "$ref": "#/components/schemas/CreditNoteStateEnum" }, + "type": "array" + }, + "name": "status__in", "in": "query" }, { "required": false, "schema": { - "items": { "$ref": "#/components/schemas/CurrencyEnum" }, + "items": { "$ref": "#/components/schemas/CreditNoteStateEnum" }, "type": "array" }, - "name": "currency__in", + "name": "status__not_in", + "in": "query" + }, + { + "required": false, + "schema": { "$ref": "#/components/schemas/CurrencyEnum" }, + "name": "currency", "in": "query" }, { @@ -16917,7 +17847,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PurchaseOrderPaginationResponse" + "$ref": "#/components/schemas/CreditNotePaginationResponse" } } } @@ -16946,8 +17876,24 @@ } } }, - "404": { - "description": "Not found", + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "406": { + "description": "Not Acceptable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -16966,9 +17912,9 @@ "security": [{ "HTTPBearer": [] }] }, "post": { - "tags": ["Purchase orders"], - "summary": "Create a purchase order", - "operationId": "post_payable_purchase_orders", + "tags": ["Credit Notes"], + "summary": "Create a new credit note.", + "operationId": "post_payable_credit_notes", "parameters": [ { "required": true, @@ -16993,7 +17939,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PurchaseOrderPayloadSchema" + "$ref": "#/components/schemas/CreditNoteCreateRequest" } } }, @@ -17004,9 +17950,7 @@ "description": "Successful Response", "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/PurchaseOrderResponseSchema" - } + "schema": { "$ref": "#/components/schemas/CreditNoteResponse" } } } }, @@ -17034,68 +17978,16 @@ } } }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } - } - }, - "security": [{ "HTTPBearer": [] }] - } - }, - "/payable_purchase_orders/variables": { - "get": { - "tags": ["Purchase orders"], - "summary": "Get the available variables for purchase orders", - "description": "Get a list of placeholders allowed to insert into an email template for customization", - "operationId": "get_payable_purchase_orders_variables", - "parameters": [ - { - "required": true, - "schema": { "type": "string", "format": "date" }, - "example": "2024-05-25", - "name": "x-monite-version", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/VariablesObjectList" } - } - } - }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -17114,11 +18006,11 @@ "security": [{ "HTTPBearer": [] }] } }, - "/payable_purchase_orders/{purchase_order_id}": { + "/payable_credit_notes/{credit_note_id}": { "get": { - "tags": ["Purchase orders"], - "summary": "Get a purchase order by ID", - "operationId": "get_payable_purchase_orders_id", + "tags": ["Credit Notes"], + "summary": "Get a credit note with the given ID.", + "operationId": "get_payable_credit_notes_id", "parameters": [ { "required": true, @@ -17130,7 +18022,7 @@ { "required": true, "schema": { "type": "string", "format": "uuid" }, - "name": "purchase_order_id", + "name": "credit_note_id", "in": "path" }, { @@ -17150,9 +18042,7 @@ "description": "Successful Response", "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/PurchaseOrderResponseSchema" - } + "schema": { "$ref": "#/components/schemas/CreditNoteResponse" } } } }, @@ -17172,8 +18062,8 @@ } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -17188,6 +18078,14 @@ } } }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "422": { "description": "Validation Error", "content": { @@ -17200,9 +18098,9 @@ "security": [{ "HTTPBearer": [] }] }, "delete": { - "tags": ["Purchase orders"], - "summary": "Delete a purchase order", - "operationId": "delete_payable_purchase_orders_id", + "tags": ["Credit Notes"], + "summary": "Delete a credit note.", + "operationId": "delete_payable_credit_notes_id", "parameters": [ { "required": true, @@ -17214,7 +18112,7 @@ { "required": true, "schema": { "type": "string", "format": "uuid" }, - "name": "purchase_order_id", + "name": "credit_note_id", "in": "path" }, { @@ -17247,8 +18145,8 @@ } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -17263,6 +18161,22 @@ } } }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "409": { + "description": "Business logic error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "422": { "description": "Validation Error", "content": { @@ -17275,9 +18189,9 @@ "security": [{ "HTTPBearer": [] }] }, "patch": { - "tags": ["Purchase orders"], - "summary": "Update a purchase order", - "operationId": "patch_payable_purchase_orders_id", + "tags": ["Credit Notes"], + "summary": "Update a credit note.", + "operationId": "patch_payable_credit_notes_id", "parameters": [ { "required": true, @@ -17289,7 +18203,7 @@ { "required": true, "schema": { "type": "string", "format": "uuid" }, - "name": "purchase_order_id", + "name": "credit_note_id", "in": "path" }, { @@ -17308,7 +18222,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdatePurchaseOrderPayloadSchema" + "$ref": "#/components/schemas/CreditNoteUpdateRequest" } } }, @@ -17319,9 +18233,7 @@ "description": "Successful Response", "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/PurchaseOrderResponseSchema" - } + "schema": { "$ref": "#/components/schemas/CreditNoteResponse" } } } }, @@ -17341,8 +18253,8 @@ } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -17357,6 +18269,14 @@ } } }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "422": { "description": "Validation Error", "content": { @@ -17369,11 +18289,12 @@ "security": [{ "HTTPBearer": [] }] } }, - "/payable_purchase_orders/{purchase_order_id}/preview": { + "/payable_credit_notes/{credit_note_id}/approve": { "post": { - "tags": ["Purchase orders"], - "summary": "Preview a purchase order's email message", - "operationId": "post_payable_purchase_orders_id_preview", + "tags": ["Credit Notes"], + "summary": "Approve a credit note", + "description": "Approve the credit note for appliance.", + "operationId": "post_payable_credit_notes_id_approve", "parameters": [ { "required": true, @@ -17385,7 +18306,7 @@ { "required": true, "schema": { "type": "string", "format": "uuid" }, - "name": "purchase_order_id", + "name": "credit_note_id", "in": "path" }, { @@ -17400,24 +18321,12 @@ "in": "header" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PurchaseOrderEmailPreviewRequest" - } - } - }, - "required": true - }, "responses": { - "201": { + "200": { "description": "Successful Response", "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/PurchaseOrderEmailPreviewResponse" - } + "schema": { "$ref": "#/components/schemas/CreditNoteResponse" } } } }, @@ -17437,14 +18346,6 @@ } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "401": { "description": "Unauthorized", "content": { @@ -17469,6 +18370,14 @@ } } }, + "409": { + "description": "Business logic error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "422": { "description": "Validation Error", "content": { @@ -17481,11 +18390,12 @@ "security": [{ "HTTPBearer": [] }] } }, - "/payable_purchase_orders/{purchase_order_id}/send": { + "/payable_credit_notes/{credit_note_id}/cancel": { "post": { - "tags": ["Purchase orders"], - "summary": "Send a purchase order via email", - "operationId": "post_payable_purchase_orders_id_send", + "tags": ["Credit Notes"], + "summary": "Cancel a credit note", + "description": "Cancel the credit note that was not confirmed during the review.", + "operationId": "post_payable_credit_notes_id_cancel", "parameters": [ { "required": true, @@ -17497,7 +18407,7 @@ { "required": true, "schema": { "type": "string", "format": "uuid" }, - "name": "purchase_order_id", + "name": "credit_note_id", "in": "path" }, { @@ -17512,24 +18422,12 @@ "in": "header" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SendPurchaseOrderViaEmailRequest" - } - } - }, - "required": true - }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/PurchaseOrderEmailSentResponse" - } + "schema": { "$ref": "#/components/schemas/CreditNoteResponse" } } } }, @@ -17549,14 +18447,6 @@ } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "401": { "description": "Unauthorized", "content": { @@ -17601,12 +18491,11 @@ "security": [{ "HTTPBearer": [] }] } }, - "/payables": { + "/payable_credit_notes/{credit_note_id}/line_items": { "get": { - "tags": ["Payables"], - "summary": "Get payables", - "description": "Lists all payables from the connected entity.\n\nIf you already have the data of the payable (amount in [minor units](\nhttps://docs.monite.com/docs/currencies#minor-units), currency, vendor information, and other details)\nstored somewhere as individual attributes, you can create a payable with these attributes by calling [POST\n/payables](https://docs.monite.com/reference/post_payables) and providing the [base64-encoded](\nhttps://en.wikipedia.org/wiki/Base64) contents of the original invoice file in the field `base64_encoded_file`.\n\nA payable is a financial document given by an entity`s supplier itemizing the purchase of a good or a service and\ndemanding payment.\n\nThe `file_name` field is optional. If omitted, it defaults to “default_file_name”. If the settings are configured\nto automatically set `suggested_payment_term`, this object can be omitted from the request body.\n\nThe `id` generated for this payable can be used in other API calls to update the data of this payable or trigger [\nstatus transitions](https://docs.monite.com/docs/payable-status-transitions), for example. essential data\nfields to move from `draft` to `new`\n\nRelated guide: [Create a payable from data](https://docs.monite.com/docs/collect-payables#create-a-payable-from-data)\n\nSee also:\n\n\n[Automatic calculation of due date](https://docs.monite.com/docs/collect-payables#automatic-calculation-of-due-date)\n\n[Suggested payment date](https://docs.monite.com/docs/collect-payables#suggested-payment-date)\n\n[Attach file](https://docs.monite.com/docs/collect-payables#attach-file)\n\n[Collect payables by email](https://docs.monite.com/docs/collect-payables#send-payables-by-email)\n\n[Manage line items](https://docs.monite.com/docs/manage-line-items)", - "operationId": "get_payables", + "tags": ["Credit Notes"], + "summary": "Get all credit note line items.", + "operationId": "get_payable_credit_notes_id_line_items", "parameters": [ { "required": true, @@ -17616,7 +18505,13 @@ "in": "header" }, { - "description": "Order by", + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "credit_note_id", + "in": "path" + }, + { + "description": "Sort order (ascending by default). Typically used together with the `sort` parameter.", "required": false, "schema": { "allOf": [{ "$ref": "#/components/schemas/OrderEnum" }], @@ -17626,7 +18521,7 @@ "in": "query" }, { - "description": "Max is 100", + "description": "The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page.", "required": false, "schema": { "type": "integer", @@ -17638,17 +18533,21 @@ "in": "query" }, { - "description": "A token, obtained from previous page. Prior over other filters", + "description": "A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query.\n\nIf not specified, the first page of results will be returned.", "required": false, "schema": { "type": "string" }, "name": "pagination_token", "in": "query" }, { - "description": "Allowed sort fields", + "description": "The field to sort the results by. Typically used together with the `order` parameter.", "required": false, "schema": { - "allOf": [{ "$ref": "#/components/schemas/PayableCursorFields" }] + "allOf": [ + { + "$ref": "#/components/schemas/CreditNoteLineItemCursorFields" + } + ] }, "name": "sort", "in": "query" @@ -17679,221 +18578,218 @@ }, { "required": false, - "schema": { "$ref": "#/components/schemas/PayableStateEnum" }, - "name": "status", + "schema": { "type": "string" }, + "name": "name", "in": "query" }, { "required": false, - "schema": { - "items": { "$ref": "#/components/schemas/PayableStateEnum" }, - "type": "array" - }, - "name": "status__in", + "schema": { "type": "string" }, + "name": "name__iexact", "in": "query" }, { "required": false, - "schema": { - "items": { "type": "string", "format": "uuid" }, - "type": "array" - }, - "name": "id__in", + "schema": { "type": "string" }, + "name": "name__contains", "in": "query" }, { "required": false, - "schema": { "type": "integer" }, - "name": "total_amount", + "schema": { "type": "string" }, + "name": "name__icontains", "in": "query" }, { "required": false, - "schema": { "type": "integer" }, - "name": "total_amount__gt", + "schema": { "type": "string" }, + "name": "description", "in": "query" }, { "required": false, - "schema": { "type": "integer" }, - "name": "total_amount__lt", + "schema": { "type": "string" }, + "name": "description__contains", "in": "query" }, { "required": false, - "schema": { "type": "integer" }, - "name": "total_amount__gte", + "schema": { "type": "string" }, + "name": "description__icontains", "in": "query" }, { "required": false, - "schema": { "type": "integer" }, - "name": "total_amount__lte", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "total__gt", "in": "query" }, { "required": false, - "schema": { "type": "integer" }, - "name": "amount", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "total__lt", "in": "query" }, { "required": false, - "schema": { "type": "integer" }, - "name": "amount__gt", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "total__gte", "in": "query" }, { "required": false, - "schema": { "type": "integer" }, - "name": "amount__lt", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "total__lte", "in": "query" }, { "required": false, - "schema": { "type": "integer" }, - "name": "amount__gte", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "subtotal__gt", "in": "query" }, { "required": false, - "schema": { "type": "integer" }, - "name": "amount__lte", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "subtotal__lt", "in": "query" }, { "required": false, - "schema": { "$ref": "#/components/schemas/CurrencyEnum" }, - "name": "currency", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "subtotal__gte", "in": "query" }, { "required": false, - "schema": { "type": "string" }, - "name": "counterpart_name", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "subtotal__lte", "in": "query" }, { "required": false, - "schema": { "type": "string" }, - "name": "counterpart_name__contains", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "unit_price__gt", "in": "query" }, { "required": false, - "schema": { "type": "string" }, - "name": "counterpart_name__icontains", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "unit_price__lt", "in": "query" }, { "required": false, - "schema": { "type": "string" }, - "name": "search_text", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "unit_price__gte", "in": "query" }, { "required": false, - "schema": { "type": "string", "format": "date" }, - "name": "due_date", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "unit_price__lte", "in": "query" }, { "required": false, - "schema": { "type": "string", "format": "date" }, - "name": "due_date__gt", + "schema": { "type": "number", "minimum": 0.0 }, + "name": "quantity__gt", "in": "query" }, { "required": false, - "schema": { "type": "string", "format": "date" }, - "name": "due_date__lt", + "schema": { "type": "number", "minimum": 0.0 }, + "name": "quantity__lt", "in": "query" }, { "required": false, - "schema": { "type": "string", "format": "date" }, - "name": "due_date__gte", + "schema": { "type": "number", "minimum": 0.0 }, + "name": "quantity__gte", "in": "query" }, { "required": false, - "schema": { "type": "string", "format": "date" }, - "name": "due_date__lte", + "schema": { "type": "number", "minimum": 0.0 }, + "name": "quantity__lte", "in": "query" }, { "required": false, - "schema": { "type": "string" }, - "name": "document_id", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "tax__gt", "in": "query" }, { "required": false, - "schema": { "type": "string" }, - "name": "document_id__contains", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "tax__lt", "in": "query" }, { "required": false, - "schema": { "type": "string" }, - "name": "document_id__icontains", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "tax__gte", "in": "query" }, { "required": false, - "schema": { "type": "string", "format": "uuid" }, - "name": "was_created_by_user_id", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "tax__lte", "in": "query" }, { "required": false, - "schema": { "type": "string", "format": "uuid" }, - "name": "counterpart_id", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "tax_amount__gt", "in": "query" }, { "required": false, - "schema": { - "$ref": "#/components/schemas/SourceOfPayableDataEnum" - }, - "name": "source_of_payable_data", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "tax_amount__lt", "in": "query" }, { "required": false, - "schema": { "$ref": "#/components/schemas/OcrStatusEnum" }, - "name": "ocr_status", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "tax_amount__gte", "in": "query" }, { - "description": "Search for a payable by the identifier of the line item associated with it.", "required": false, - "schema": { "type": "string", "format": "uuid" }, - "name": "line_item_id", + "schema": { "type": "integer", "minimum": 0.0 }, + "name": "tax_amount__lte", "in": "query" }, { - "description": "Search for a payable by the identifier of the purchase order associated with it.", "required": false, "schema": { "type": "string", "format": "uuid" }, - "name": "purchase_order_id", + "name": "created_by_user_id", "in": "query" }, { - "description": "Search for a payable by the identifier of the project associated with it.", "required": false, - "schema": { "type": "string", "format": "uuid" }, - "name": "project_id", + "schema": { "type": "string" }, + "name": "unit", "in": "query" }, { - "description": "Search for a payable by the identifiers of the tags associated with it.", "required": false, - "schema": { - "items": { "type": "string", "format": "uuid" }, - "type": "array" - }, - "name": "tag_ids", + "schema": { "type": "string" }, + "name": "unit__iexact", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string" }, + "name": "source", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string" }, + "name": "source_id", "in": "query" }, { @@ -17914,7 +18810,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PayablePaginationResponse" + "$ref": "#/components/schemas/CreditNoteLineItemPaginationResponse" } } } @@ -17935,16 +18831,16 @@ } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -17959,8 +18855,102 @@ } } }, - "406": { - "description": "Not Acceptable", + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + }, + "put": { + "tags": ["Credit Notes"], + "summary": "Replace all line items of a credit note.", + "operationId": "put_payable_credit_notes_id_line_items", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "credit_note_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreditNoteLineItemReplaceRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreditNoteLineItemPaginationResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -17979,10 +18969,9 @@ "security": [{ "HTTPBearer": [] }] }, "post": { - "tags": ["Payables"], - "summary": "Create a payable", - "description": "Add a new payable by providing the amount, currency, vendor name, and other details.\nYou can provide the base64_encoded contents of the original invoice file in the field `base64_encoded_file`.\n\nYou can use this endpoint to bypass the Monite OCR service and provide the data directly\n(for example, if you already have the data in place).\n\nA newly created payable has the the `draft` [status](https://docs.monite.com/docs/payables-lifecycle).", - "operationId": "post_payables", + "tags": ["Credit Notes"], + "summary": "Add a new line item to a credit note.", + "operationId": "post_payable_credit_notes_id_line_items", "parameters": [ { "required": true, @@ -17991,6 +18980,12 @@ "name": "x-monite-version", "in": "header" }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "credit_note_id", + "in": "path" + }, { "description": "The ID of the entity that owns the requested resource.", "required": true, @@ -18007,19 +19002,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PayableUploadWithDataSchema" + "$ref": "#/components/schemas/CreditNoteLineItemCreateRequest" } } }, "required": true }, "responses": { - "200": { + "201": { "description": "Successful Response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PayableResponseSchema" + "$ref": "#/components/schemas/CreditNoteLineItemResponse" } } } @@ -18040,16 +19035,16 @@ } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -18076,12 +19071,1409 @@ "security": [{ "HTTPBearer": [] }] } }, - "/payables/analytics": { + "/payable_credit_notes/{credit_note_id}/line_items/{line_item_id}": { + "get": { + "tags": ["Credit Notes"], + "summary": "Get a single line item of a credit note.", + "operationId": "get_payable_credit_notes_id_line_items_id", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "credit_note_id", + "in": "path" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "line_item_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreditNoteLineItemResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + }, + "delete": { + "tags": ["Credit Notes"], + "summary": "Delete a single line item of a credit note.", + "operationId": "delete_payable_credit_notes_id_line_items_id", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "credit_note_id", + "in": "path" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "line_item_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreditNoteLineItemPaginationResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + }, + "patch": { + "tags": ["Credit Notes"], + "summary": "Update a single line item of a credit note.", + "operationId": "patch_payable_credit_notes_id_line_items_id", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "credit_note_id", + "in": "path" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "line_item_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreditNoteLineItemUpdateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreditNoteLineItemResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/payable_credit_notes/{credit_note_id}/reject": { + "post": { + "tags": ["Credit Notes"], + "summary": "Reject a credit note", + "description": "Decline the credit note when an approver finds any mismatch or discrepancies.", + "operationId": "post_payable_credit_notes_id_reject", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "credit_note_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/CreditNoteResponse" } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "409": { + "description": "Business logic error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/payable_credit_notes/{credit_note_id}/submit_for_approval": { + "post": { + "tags": ["Credit Notes"], + "summary": "Submit a credit note for approval", + "description": "Start the approval process once the uploaded credit note is validated.", + "operationId": "post_payable_credit_notes_id_submit_for_approval", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "credit_note_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/CreditNoteResponse" } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "409": { + "description": "Business logic error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/payable_purchase_orders": { + "get": { + "tags": ["Purchase orders"], + "summary": "Get purchase orders", + "operationId": "get_payable_purchase_orders", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "description": "Sort order (ascending by default). Typically used together with the `sort` parameter.", + "required": false, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/OrderEnum" }], + "default": "asc" + }, + "name": "order", + "in": "query" + }, + { + "description": "The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page.", + "required": false, + "schema": { + "type": "integer", + "maximum": 100.0, + "minimum": 1.0, + "default": 100 + }, + "name": "limit", + "in": "query" + }, + { + "description": "A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query.\n\nIf not specified, the first page of results will be returned.", + "required": false, + "schema": { "type": "string" }, + "name": "pagination_token", + "in": "query" + }, + { + "description": "The field to sort the results by. Typically used together with the `order` parameter.", + "required": false, + "schema": { + "allOf": [ + { "$ref": "#/components/schemas/PurchaseOrderCursorFields" } + ] + }, + "name": "sort", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__gt", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__lt", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__gte", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__lte", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "updated_at__gt", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "updated_at__lt", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "updated_at__gte", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "updated_at__lte", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "issued_at__gt", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "issued_at__lt", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "issued_at__gte", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "issued_at__lte", + "in": "query" + }, + { + "required": false, + "schema": { + "$ref": "#/components/schemas/PurchaseOrderStatusEnum" + }, + "name": "status", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string" }, + "name": "document_id", + "in": "query" + }, + { + "required": false, + "schema": { "items": { "type": "string" }, "type": "array" }, + "name": "document_id__in", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "uuid" }, + "name": "created_by", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "uuid" }, + "name": "counterpart_id", + "in": "query" + }, + { + "required": false, + "schema": { + "items": { "type": "string", "format": "uuid" }, + "type": "array" + }, + "name": "counterpart_id__in", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string" }, + "name": "counterpart.name", + "in": "query" + }, + { + "required": false, + "schema": { "$ref": "#/components/schemas/CurrencyEnum" }, + "name": "currency", + "in": "query" + }, + { + "required": false, + "schema": { + "items": { "$ref": "#/components/schemas/CurrencyEnum" }, + "type": "array" + }, + "name": "currency__in", + "in": "query" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PurchaseOrderPaginationResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + }, + "post": { + "tags": ["Purchase orders"], + "summary": "Create a purchase order", + "operationId": "post_payable_purchase_orders", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PurchaseOrderPayloadSchema" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PurchaseOrderResponseSchema" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/payable_purchase_orders/variables": { + "get": { + "tags": ["Purchase orders"], + "summary": "Get the available variables for purchase orders", + "description": "Get a list of placeholders allowed to insert into an email template for customization", + "operationId": "get_payable_purchase_orders_variables", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/VariablesObjectList" } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/payable_purchase_orders/{purchase_order_id}": { + "get": { + "tags": ["Purchase orders"], + "summary": "Get a purchase order by ID", + "operationId": "get_payable_purchase_orders_id", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "purchase_order_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PurchaseOrderResponseSchema" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + }, + "delete": { + "tags": ["Purchase orders"], + "summary": "Delete a purchase order", + "operationId": "delete_payable_purchase_orders_id", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "purchase_order_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "responses": { + "204": { "description": "Successful Response" }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + }, + "patch": { + "tags": ["Purchase orders"], + "summary": "Update a purchase order", + "operationId": "patch_payable_purchase_orders_id", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "purchase_order_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdatePurchaseOrderPayloadSchema" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PurchaseOrderResponseSchema" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/payable_purchase_orders/{purchase_order_id}/preview": { + "post": { + "tags": ["Purchase orders"], + "summary": "Preview a purchase order's email message", + "operationId": "post_payable_purchase_orders_id_preview", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "purchase_order_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PurchaseOrderEmailPreviewRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PurchaseOrderEmailPreviewResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/payable_purchase_orders/{purchase_order_id}/send": { + "post": { + "tags": ["Purchase orders"], + "summary": "Send a purchase order via email", + "operationId": "post_payable_purchase_orders_id_send", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "purchase_order_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SendPurchaseOrderViaEmailRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PurchaseOrderEmailSentResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "409": { + "description": "Business logic error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/payables": { "get": { "tags": ["Payables"], - "summary": "Analytics", - "description": "Retrieve aggregated statistics for payables, including total amount and count, both overall and by status.", - "operationId": "get_payables_analytics", + "summary": "Get payables", + "description": "Lists all payables from the connected entity.\n\nIf you already have the data of the payable (amount in [minor units](\nhttps://docs.monite.com/docs/currencies#minor-units), currency, vendor information, and other details)\nstored somewhere as individual attributes, you can create a payable with these attributes by calling [POST\n/payables](https://docs.monite.com/reference/post_payables) and providing the [base64-encoded](\nhttps://en.wikipedia.org/wiki/Base64) contents of the original invoice file in the field `base64_encoded_file`.\n\nA payable is a financial document given by an entity`s supplier itemizing the purchase of a good or a service and\ndemanding payment.\n\nThe `file_name` field is optional. If omitted, it defaults to “default_file_name”. If the settings are configured\nto automatically set `suggested_payment_term`, this object can be omitted from the request body.\n\nThe `id` generated for this payable can be used in other API calls to update the data of this payable or trigger [\nstatus transitions](https://docs.monite.com/docs/payable-status-transitions), for example. essential data\nfields to move from `draft` to `new`\n\nRelated guide: [Create a payable from data](https://docs.monite.com/docs/collect-payables#create-a-payable-from-data)\n\nSee also:\n\n\n[Automatic calculation of due date](https://docs.monite.com/docs/collect-payables#automatic-calculation-of-due-date)\n\n[Suggested payment date](https://docs.monite.com/docs/collect-payables#suggested-payment-date)\n\n[Attach file](https://docs.monite.com/docs/collect-payables#attach-file)\n\n[Collect payables by email](https://docs.monite.com/docs/collect-payables#send-payables-by-email)\n\n[Manage line items](https://docs.monite.com/docs/manage-line-items)", + "operationId": "get_payables", "parameters": [ { "required": true, @@ -18091,36 +20483,82 @@ "in": "header" }, { + "description": "Sort order (ascending by default). Typically used together with the `sort` parameter.", + "required": false, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/OrderEnum" }], + "default": "asc" + }, + "name": "order", + "in": "query" + }, + { + "description": "The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page.", + "required": false, + "schema": { + "type": "integer", + "maximum": 100.0, + "minimum": 1.0, + "default": 100 + }, + "name": "limit", + "in": "query" + }, + { + "description": "A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query.\n\nIf not specified, the first page of results will be returned.", + "required": false, + "schema": { "type": "string" }, + "name": "pagination_token", + "in": "query" + }, + { + "description": "The field to sort the results by. Typically used together with the `order` parameter.", + "required": false, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/PayableCursorFields" }] + }, + "name": "sort", + "in": "query" + }, + { + "description": "Return only payables created in Monite after the specified date and time. The value must be in the ISO 8601 format YYYY-MM-DDThh:mm[:ss[.ffffff]][Z|±hh:mm].", "required": false, "schema": { "type": "string", "format": "date-time" }, "name": "created_at__gt", "in": "query" }, { + "description": "Return only payables created in Monite before the specified date and time.", "required": false, "schema": { "type": "string", "format": "date-time" }, "name": "created_at__lt", "in": "query" }, { + "description": "Return only payables created in Monite on or after the specified date and time.", "required": false, "schema": { "type": "string", "format": "date-time" }, "name": "created_at__gte", "in": "query" }, { + "description": "Return only payables created in Monite before or on the specified date and time.", "required": false, "schema": { "type": "string", "format": "date-time" }, "name": "created_at__lte", "in": "query" }, { + "description": "Return only payables that have the specified [status](https://docs.monite.com/accounts-payable/payables/index).\n\nTo query multiple statuses at once, use the `status__in` parameter instead.", "required": false, - "schema": { "$ref": "#/components/schemas/PayableStateEnum" }, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/PayableStateEnum" }] + }, "name": "status", "in": "query" }, { + "description": "Return only payables that have the specified [statuses](https://docs.monite.com/accounts-payable/payables/index).\n\nTo specify multiple statuses, repeat this parameter for each value: `status__in=draft&status__in=new`", "required": false, "schema": { "items": { "$ref": "#/components/schemas/PayableStateEnum" }, @@ -18130,6 +20568,7 @@ "in": "query" }, { + "description": "Return only payables with specified IDs. Valid but nonexistent IDs do not raise errors but produce no results.\n\nTo specify multiple IDs, repeat this parameter for each value: `id__in=<id1>&id__in=<id2>`", "required": false, "schema": { "items": { "type": "string", "format": "uuid" }, @@ -18139,166 +20578,199 @@ "in": "query" }, { + "description": "Return only payables with the exact specified total amount. The amount must be specified in the minor units of currency. For example, $12.5 is represented as 1250.", "required": false, "schema": { "type": "integer" }, "name": "total_amount", "in": "query" }, { + "description": "Return only payables whose total amount (in minor units) exceeds the specified value.", "required": false, "schema": { "type": "integer" }, "name": "total_amount__gt", "in": "query" }, { + "description": "Return only payables whose total amount (in minor units) is less than the specified value.", "required": false, "schema": { "type": "integer" }, "name": "total_amount__lt", "in": "query" }, { + "description": "Return only payables whose total amount (in minor units) is greater than or equal to the specified value.", "required": false, "schema": { "type": "integer" }, "name": "total_amount__gte", "in": "query" }, { + "description": "Return only payables whose total amount (in minor units) is less than or equal to the specified value.", "required": false, "schema": { "type": "integer" }, "name": "total_amount__lte", "in": "query" }, { + "description": "Return only payables with the specified amount.", "required": false, "schema": { "type": "integer" }, "name": "amount", "in": "query" }, { + "description": "Return only payables whose amount (in minor units) exceeds the specified value.", "required": false, "schema": { "type": "integer" }, "name": "amount__gt", "in": "query" }, { + "description": "Return only payables whose amount (in minor units) is less than the specified value.", "required": false, "schema": { "type": "integer" }, "name": "amount__lt", "in": "query" }, { + "description": "Return only payables whose amount (in minor units) is greater than or equal to the specified value.", "required": false, "schema": { "type": "integer" }, "name": "amount__gte", "in": "query" }, { + "description": "Return only payables whose amount (in minor units) is less than or equal to the specified value.", "required": false, "schema": { "type": "integer" }, "name": "amount__lte", "in": "query" }, { + "description": "Return only payables that use the specified currency.", "required": false, - "schema": { "$ref": "#/components/schemas/CurrencyEnum" }, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/CurrencyEnum" }] + }, "name": "currency", "in": "query" }, { + "description": "Return only payables received from counterparts with the specified name (exact match, case-sensitive).\n\nFor counterparts of `type = individual`, the full name is formatted as `first_name last_name`.", "required": false, "schema": { "type": "string" }, "name": "counterpart_name", "in": "query" }, { + "description": "Return only payables received from counterparts whose name contains the specified string (case-sensitive).", "required": false, "schema": { "type": "string" }, "name": "counterpart_name__contains", "in": "query" }, { + "description": "Return only payables received from counterparts whose name contains the specified string (case-insensitive).", "required": false, "schema": { "type": "string" }, "name": "counterpart_name__icontains", "in": "query" }, { + "description": "Apply the `icontains` condition to search for the specified text in the `document_id` and `counterpart_name` fields in the payables.", "required": false, "schema": { "type": "string" }, "name": "search_text", "in": "query" }, { + "description": "Return payables that are due on the specified date (YYYY-MM-DD)", "required": false, "schema": { "type": "string", "format": "date" }, "name": "due_date", "in": "query" }, { + "description": "Return payables that are due after the specified date (exclusive, YYYY-MM-DD).", "required": false, "schema": { "type": "string", "format": "date" }, "name": "due_date__gt", "in": "query" }, { + "description": "Return payables that are due before the specified date (exclusive, YYYY-MM-DD).", "required": false, "schema": { "type": "string", "format": "date" }, "name": "due_date__lt", "in": "query" }, { + "description": "Return payables that are due on or after the specified date (YYYY-MM-DD).", "required": false, "schema": { "type": "string", "format": "date" }, "name": "due_date__gte", "in": "query" }, { + "description": "Return payables that are due before or on the specified date (YYYY-MM-DD).", "required": false, "schema": { "type": "string", "format": "date" }, "name": "due_date__lte", "in": "query" }, { + "description": "Return a payable with the exact specified document number (case-sensitive).\n\nThe `document_id` is the user-facing document number such as INV-00042, not to be confused with Monite resource IDs (`id`).", "required": false, "schema": { "type": "string" }, "name": "document_id", "in": "query" }, { + "description": "Return only payables whose document number (`document_id`) contains the specified string (case-sensitive).", "required": false, "schema": { "type": "string" }, "name": "document_id__contains", "in": "query" }, { + "description": "Return only payables whose document number (`document_id`) contains the specified string (case-insensitive).", "required": false, "schema": { "type": "string" }, "name": "document_id__icontains", "in": "query" }, { + "description": "Return only payables created in Monite by the entity user with the specified ID.", "required": false, "schema": { "type": "string", "format": "uuid" }, "name": "was_created_by_user_id", "in": "query" }, { + "description": "Return only payables received from the counterpart with the specified ID.\n\nCounterparts that have been deleted but have associated payables will still return results here because the payables contain a frozen copy of the counterpart data.\n\nIf the specified counterpart ID does not exist and never existed, no results are returned.", "required": false, "schema": { "type": "string", "format": "uuid" }, "name": "counterpart_id", "in": "query" }, { + "description": "Return only payables coming from the specified source.", "required": false, "schema": { - "$ref": "#/components/schemas/SourceOfPayableDataEnum" + "allOf": [ + { "$ref": "#/components/schemas/SourceOfPayableDataEnum" } + ] }, "name": "source_of_payable_data", "in": "query" }, { + "description": "Return only payables with specific OCR statuses.", "required": false, - "schema": { "$ref": "#/components/schemas/OcrStatusEnum" }, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/OcrStatusEnum" }] + }, "name": "ocr_status", "in": "query" }, @@ -18317,14 +20789,14 @@ "in": "query" }, { - "description": "Search for a payable by the identifier of the project associated with it.", + "description": "Return only payables assigned to the project with the specified ID.\n\nValid but nonexistent project IDs do not raise errors but return no results.", "required": false, "schema": { "type": "string", "format": "uuid" }, "name": "project_id", "in": "query" }, { - "description": "Search for a payable by the identifiers of the tags associated with it.", + "description": "Return only payables whose `tags` include at least one of the tags with the specified IDs. Valid but nonexistent tag IDs do not raise errors but produce no results.", "required": false, "schema": { "items": { "type": "string", "format": "uuid" }, @@ -18351,7 +20823,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PayableAggregatedDataResponse" + "$ref": "#/components/schemas/PayablePaginationResponse" } } } @@ -18372,6 +20844,14 @@ } } }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "401": { "description": "Unauthorized", "content": { @@ -18388,6 +20868,14 @@ } } }, + "406": { + "description": "Not Acceptable", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "422": { "description": "Validation Error", "content": { @@ -18398,14 +20886,12 @@ } }, "security": [{ "HTTPBearer": [] }] - } - }, - "/payables/upload_from_file": { + }, "post": { "tags": ["Payables"], - "summary": "Upload a payable from a file", - "description": "Upload an incoming invoice (payable) in PDF, PNG, JPEG, or TIFF format and scan its contents. The maximum file size is 10MB.", - "operationId": "post_payables_upload_from_file", + "summary": "Create a payable", + "description": "Add a new payable by providing the amount, currency, vendor name, and other details.\nYou can provide the base64_encoded contents of the original invoice file in the field `base64_encoded_file`.\n\nYou can use this endpoint to bypass the Monite OCR service and provide the data directly\n(for example, if you already have the data in place).\n\nA newly created payable has the the `draft` [status](https://docs.monite.com/docs/payables-lifecycle).", + "operationId": "post_payables", "parameters": [ { "required": true, @@ -18428,14 +20914,16 @@ ], "requestBody": { "content": { - "multipart/form-data": { - "schema": { "$ref": "#/components/schemas/PayableUploadFile" } + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayableUploadWithDataSchema" + } } }, "required": true }, "responses": { - "201": { + "200": { "description": "Successful Response", "content": { "application/json": { @@ -18485,14 +20973,6 @@ } } }, - "409": { - "description": "Error uploading the file. You can check the upload\n [limitations in the documentation](https://docs.monite.com/docs/collect-payables#about-monite-ocr).", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "422": { "description": "Validation Error", "content": { @@ -18505,12 +20985,12 @@ "security": [{ "HTTPBearer": [] }] } }, - "/payables/validations": { + "/payables/analytics": { "get": { "tags": ["Payables"], - "summary": "Get payables validations", - "description": "Get payable validations.", - "operationId": "get_payables_validations", + "summary": "Analytics", + "description": "Retrieve aggregated statistics for payables, including total amount and count, both overall and by status.\n\nFor more flexible configuration and retrieval of other data types, use GET /analytics/payables.", + "operationId": "get_payables_analytics", "parameters": [ { "required": true, @@ -18520,91 +21000,289 @@ "in": "header" }, { - "description": "The ID of the entity that owns the requested resource.", - "required": true, + "description": "Return only payables created in Monite after the specified date and time. The value must be in the ISO 8601 format YYYY-MM-DDThh:mm[:ss[.ffffff]][Z|±hh:mm].", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__gt", + "in": "query" + }, + { + "description": "Return only payables created in Monite before the specified date and time.", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__lt", + "in": "query" + }, + { + "description": "Return only payables created in Monite on or after the specified date and time.", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__gte", + "in": "query" + }, + { + "description": "Return only payables created in Monite before or on the specified date and time.", + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__lte", + "in": "query" + }, + { + "description": "Return only payables that have the specified [status](https://docs.monite.com/accounts-payable/payables/index).\n\nTo query multiple statuses at once, use the `status__in` parameter instead.", + "required": false, "schema": { - "type": "string", - "format": "uuid", - "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + "allOf": [{ "$ref": "#/components/schemas/PayableStateEnum" }] }, - "name": "x-monite-entity-id", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PayableValidationsResource" - } - } - } + "name": "status", + "in": "query" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } + { + "description": "Return only payables that have the specified [statuses](https://docs.monite.com/accounts-payable/payables/index).\n\nTo specify multiple statuses, repeat this parameter for each value: `status__in=draft&status__in=new`", + "required": false, + "schema": { + "items": { "$ref": "#/components/schemas/PayableStateEnum" }, + "type": "array" + }, + "name": "status__in", + "in": "query" }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } + { + "description": "Return only payables with specified IDs. Valid but nonexistent IDs do not raise errors but produce no results.\n\nTo specify multiple IDs, repeat this parameter for each value: `id__in=<id1>&id__in=<id2>`", + "required": false, + "schema": { + "items": { "type": "string", "format": "uuid" }, + "type": "array" + }, + "name": "id__in", + "in": "query" }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } + { + "description": "Return only payables with the exact specified total amount. The amount must be specified in the minor units of currency. For example, $12.5 is represented as 1250.", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount", + "in": "query" }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } + { + "description": "Return only payables whose total amount (in minor units) exceeds the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount__gt", + "in": "query" }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } + { + "description": "Return only payables whose total amount (in minor units) is less than the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount__lt", + "in": "query" }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } - } - }, - "security": [{ "HTTPBearer": [] }] - }, - "put": { - "tags": ["Payables"], - "summary": "Update payables validations", - "description": "Update payable validations.", - "operationId": "put_payables_validations", - "parameters": [ { - "required": true, + "description": "Return only payables whose total amount (in minor units) is greater than or equal to the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount__gte", + "in": "query" + }, + { + "description": "Return only payables whose total amount (in minor units) is less than or equal to the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "total_amount__lte", + "in": "query" + }, + { + "description": "Return only payables with the specified amount.", + "required": false, + "schema": { "type": "integer" }, + "name": "amount", + "in": "query" + }, + { + "description": "Return only payables whose amount (in minor units) exceeds the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "amount__gt", + "in": "query" + }, + { + "description": "Return only payables whose amount (in minor units) is less than the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "amount__lt", + "in": "query" + }, + { + "description": "Return only payables whose amount (in minor units) is greater than or equal to the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "amount__gte", + "in": "query" + }, + { + "description": "Return only payables whose amount (in minor units) is less than or equal to the specified value.", + "required": false, + "schema": { "type": "integer" }, + "name": "amount__lte", + "in": "query" + }, + { + "description": "Return only payables that use the specified currency.", + "required": false, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/CurrencyEnum" }] + }, + "name": "currency", + "in": "query" + }, + { + "description": "Return only payables received from counterparts with the specified name (exact match, case-sensitive).\n\nFor counterparts of `type = individual`, the full name is formatted as `first_name last_name`.", + "required": false, + "schema": { "type": "string" }, + "name": "counterpart_name", + "in": "query" + }, + { + "description": "Return only payables received from counterparts whose name contains the specified string (case-sensitive).", + "required": false, + "schema": { "type": "string" }, + "name": "counterpart_name__contains", + "in": "query" + }, + { + "description": "Return only payables received from counterparts whose name contains the specified string (case-insensitive).", + "required": false, + "schema": { "type": "string" }, + "name": "counterpart_name__icontains", + "in": "query" + }, + { + "description": "Apply the `icontains` condition to search for the specified text in the `document_id` and `counterpart_name` fields in the payables.", + "required": false, + "schema": { "type": "string" }, + "name": "search_text", + "in": "query" + }, + { + "description": "Return payables that are due on the specified date (YYYY-MM-DD)", + "required": false, "schema": { "type": "string", "format": "date" }, - "example": "2024-05-25", - "name": "x-monite-version", - "in": "header" + "name": "due_date", + "in": "query" + }, + { + "description": "Return payables that are due after the specified date (exclusive, YYYY-MM-DD).", + "required": false, + "schema": { "type": "string", "format": "date" }, + "name": "due_date__gt", + "in": "query" + }, + { + "description": "Return payables that are due before the specified date (exclusive, YYYY-MM-DD).", + "required": false, + "schema": { "type": "string", "format": "date" }, + "name": "due_date__lt", + "in": "query" + }, + { + "description": "Return payables that are due on or after the specified date (YYYY-MM-DD).", + "required": false, + "schema": { "type": "string", "format": "date" }, + "name": "due_date__gte", + "in": "query" + }, + { + "description": "Return payables that are due before or on the specified date (YYYY-MM-DD).", + "required": false, + "schema": { "type": "string", "format": "date" }, + "name": "due_date__lte", + "in": "query" + }, + { + "description": "Return a payable with the exact specified document number (case-sensitive).\n\nThe `document_id` is the user-facing document number such as INV-00042, not to be confused with Monite resource IDs (`id`).", + "required": false, + "schema": { "type": "string" }, + "name": "document_id", + "in": "query" + }, + { + "description": "Return only payables whose document number (`document_id`) contains the specified string (case-sensitive).", + "required": false, + "schema": { "type": "string" }, + "name": "document_id__contains", + "in": "query" + }, + { + "description": "Return only payables whose document number (`document_id`) contains the specified string (case-insensitive).", + "required": false, + "schema": { "type": "string" }, + "name": "document_id__icontains", + "in": "query" + }, + { + "description": "Return only payables created in Monite by the entity user with the specified ID.", + "required": false, + "schema": { "type": "string", "format": "uuid" }, + "name": "was_created_by_user_id", + "in": "query" + }, + { + "description": "Return only payables received from the counterpart with the specified ID.\n\nCounterparts that have been deleted but have associated payables will still return results here because the payables contain a frozen copy of the counterpart data.\n\nIf the specified counterpart ID does not exist and never existed, no results are returned.", + "required": false, + "schema": { "type": "string", "format": "uuid" }, + "name": "counterpart_id", + "in": "query" + }, + { + "description": "Return only payables coming from the specified source.", + "required": false, + "schema": { + "allOf": [ + { "$ref": "#/components/schemas/SourceOfPayableDataEnum" } + ] + }, + "name": "source_of_payable_data", + "in": "query" + }, + { + "description": "Return only payables with specific OCR statuses.", + "required": false, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/OcrStatusEnum" }] + }, + "name": "ocr_status", + "in": "query" + }, + { + "description": "Search for a payable by the identifier of the line item associated with it.", + "required": false, + "schema": { "type": "string", "format": "uuid" }, + "name": "line_item_id", + "in": "query" + }, + { + "description": "Search for a payable by the identifier of the purchase order associated with it.", + "required": false, + "schema": { "type": "string", "format": "uuid" }, + "name": "purchase_order_id", + "in": "query" + }, + { + "description": "Return only payables assigned to the project with the specified ID.\n\nValid but nonexistent project IDs do not raise errors but return no results.", + "required": false, + "schema": { "type": "string", "format": "uuid" }, + "name": "project_id", + "in": "query" + }, + { + "description": "Return only payables whose `tags` include at least one of the tags with the specified IDs. Valid but nonexistent tag IDs do not raise errors but produce no results.", + "required": false, + "schema": { + "items": { "type": "string", "format": "uuid" }, + "type": "array" + }, + "name": "tag_ids", + "in": "query" }, { "description": "The ID of the entity that owns the requested resource.", @@ -18618,23 +21296,13 @@ "in": "header" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PayableValidationsUpdateRequest" - } - } - }, - "required": true - }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PayableValidationsResource" + "$ref": "#/components/schemas/PayableAggregatedDataResponse" } } } @@ -18655,14 +21323,6 @@ } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "401": { "description": "Unauthorized", "content": { @@ -18688,15 +21348,16 @@ } } }, + "deprecated": true, "security": [{ "HTTPBearer": [] }] } }, - "/payables/validations/reset": { + "/payables/upload_from_file": { "post": { "tags": ["Payables"], - "summary": "Reset payables validations", - "description": "Reset payable validations to default ones.", - "operationId": "post_payables_validations_reset", + "summary": "Upload a payable from a file", + "description": "Upload an incoming invoice (payable) in PDF, PNG, JPEG, or TIFF format and scan its contents. The maximum file size is 10MB.", + "operationId": "post_payables_upload_from_file", "parameters": [ { "required": true, @@ -18717,6 +21378,264 @@ "in": "header" } ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { "$ref": "#/components/schemas/PayableUploadFile" } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayableResponseSchema" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "409": { + "description": "Error uploading the file. You can check the upload\n [limitations in the documentation](https://docs.monite.com/docs/collect-payables#about-monite-ocr).", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/payables/validations": { + "get": { + "tags": ["Payables"], + "summary": "Get payables validations", + "description": "Get payable validations.", + "operationId": "get_payables_validations", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayableValidationsResource" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + }, + "put": { + "tags": ["Payables"], + "summary": "Update payables validations", + "description": "Update payable validations.", + "operationId": "put_payables_validations", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayableValidationsUpdateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayableValidationsResource" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/payables/validations/reset": { + "post": { + "tags": ["Payables"], + "summary": "Reset payables validations", + "description": "Reset payable validations to default ones.", + "operationId": "post_payables_validations_reset", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + } + ], "responses": { "200": { "description": "Successful Response", @@ -19622,7 +22541,7 @@ "in": "path" }, { - "description": "Order by", + "description": "Sort order (ascending by default). Typically used together with the `sort` parameter.", "required": false, "schema": { "allOf": [{ "$ref": "#/components/schemas/OrderEnum" }], @@ -19632,7 +22551,7 @@ "in": "query" }, { - "description": "Max is 100", + "description": "The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page.", "required": false, "schema": { "type": "integer", @@ -19644,14 +22563,14 @@ "in": "query" }, { - "description": "A token, obtained from previous page. Prior over other filters", + "description": "A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query.\n\nIf not specified, the first page of results will be returned.", "required": false, "schema": { "type": "string" }, "name": "pagination_token", "in": "query" }, { - "description": "Allowed sort fields", + "description": "The field to sort the results by. Typically used together with the `order` parameter.", "required": false, "schema": { "allOf": [{ "$ref": "#/components/schemas/LineItemCursorFields" }] @@ -27653,7 +30572,7 @@ "in": "header" }, { - "description": "Order by", + "description": "Sort order (ascending by default). Typically used together with the `sort` parameter.", "required": false, "schema": { "allOf": [{ "$ref": "#/components/schemas/OrderEnum" }], @@ -27663,7 +30582,7 @@ "in": "query" }, { - "description": "Max is 100", + "description": "The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page.", "required": false, "schema": { "type": "integer", @@ -27675,14 +30594,14 @@ "in": "query" }, { - "description": "A token, obtained from previous page. Prior over other filters", + "description": "A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query.\n\nIf not specified, the first page of results will be returned.", "required": false, "schema": { "type": "string" }, "name": "pagination_token", "in": "query" }, { - "description": "Allowed sort fields", + "description": "The field to sort the results by. Typically used together with the `order` parameter.", "required": false, "schema": { "allOf": [{ "$ref": "#/components/schemas/ProjectCursorFields" }] @@ -30111,307 +33030,14 @@ } } }, - "409": { - "description": "Business logic error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } - } - }, - "security": [{ "HTTPBearer": [] }] - } - }, - "/receivables/{receivable_id}/mails": { - "get": { - "tags": ["Receivables"], - "summary": "Get a list of all mails sent by receivable", - "operationId": "get_receivables_id_mails", - "parameters": [ - { - "required": true, - "schema": { "type": "string", "format": "date" }, - "example": "2024-05-25", - "name": "x-monite-version", - "in": "header" - }, - { - "required": true, - "schema": { "type": "string", "format": "uuid" }, - "name": "receivable_id", - "in": "path" - }, - { - "description": "Order by", - "required": false, - "schema": { - "allOf": [{ "$ref": "#/components/schemas/OrderEnum" }], - "default": "asc" - }, - "name": "order", - "in": "query" - }, - { - "description": "Max is 100", - "required": false, - "schema": { - "type": "integer", - "maximum": 100.0, - "minimum": 1.0, - "default": 100 - }, - "name": "limit", - "in": "query" - }, - { - "description": "A token, obtained from previous page. Prior over other filters", - "required": false, - "schema": { "type": "string" }, - "name": "pagination_token", - "in": "query" - }, - { - "description": "Allowed sort fields", - "required": false, - "schema": { - "allOf": [ - { "$ref": "#/components/schemas/ReceivableMailCursorFields" } - ] - }, - "name": "sort", - "in": "query" - }, - { - "required": false, - "schema": { - "$ref": "#/components/schemas/ReceivableMailStatusEnum" - }, - "name": "status", - "in": "query" - }, - { - "required": false, - "schema": { - "items": { - "$ref": "#/components/schemas/ReceivableMailStatusEnum" - }, - "type": "array" - }, - "name": "status__in", - "in": "query" - }, - { - "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "created_at__gt", - "in": "query" - }, - { - "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "created_at__lt", - "in": "query" - }, - { - "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "created_at__gte", - "in": "query" - }, - { - "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "created_at__lte", - "in": "query" - }, - { - "description": "The ID of the entity that owns the requested resource.", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] - }, - "name": "x-monite-entity-id", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReceivableMailPaginationResponse" - } - } - } - }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } - } - }, - "security": [{ "HTTPBearer": [] }] - } - }, - "/receivables/{receivable_id}/mails/{mail_id}": { - "get": { - "tags": ["Receivables"], - "summary": "Get a mail sent by receivable", - "operationId": "get_receivables_id_mails_id", - "parameters": [ - { - "required": true, - "schema": { "type": "string", "format": "date" }, - "example": "2024-05-25", - "name": "x-monite-version", - "in": "header" - }, - { - "required": true, - "schema": { "type": "string", "format": "uuid" }, - "name": "receivable_id", - "in": "path" - }, - { - "required": true, - "schema": { "type": "string", "format": "uuid" }, - "name": "mail_id", - "in": "path" - }, - { - "description": "The ID of the entity that owns the requested resource.", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] - }, - "name": "x-monite-entity-id", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReceivableMailResponse" - } - } - } - }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, + "409": { + "description": "Business logic error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "422": { "description": "Validation Error", "content": { @@ -30424,11 +33050,11 @@ "security": [{ "HTTPBearer": [] }] } }, - "/receivables/{receivable_id}/mark_as_paid": { - "post": { + "/receivables/{receivable_id}/mails": { + "get": { "tags": ["Receivables"], - "summary": "Mark an invoice as paid", - "operationId": "post_receivables_id_mark_as_paid", + "summary": "Get a list of all mails sent by receivable", + "operationId": "get_receivables_id_mails", "parameters": [ { "required": true, @@ -30443,6 +33069,89 @@ "name": "receivable_id", "in": "path" }, + { + "description": "Order by", + "required": false, + "schema": { + "allOf": [{ "$ref": "#/components/schemas/OrderEnum" }], + "default": "asc" + }, + "name": "order", + "in": "query" + }, + { + "description": "Max is 100", + "required": false, + "schema": { + "type": "integer", + "maximum": 100.0, + "minimum": 1.0, + "default": 100 + }, + "name": "limit", + "in": "query" + }, + { + "description": "A token, obtained from previous page. Prior over other filters", + "required": false, + "schema": { "type": "string" }, + "name": "pagination_token", + "in": "query" + }, + { + "description": "Allowed sort fields", + "required": false, + "schema": { + "allOf": [ + { "$ref": "#/components/schemas/ReceivableMailCursorFields" } + ] + }, + "name": "sort", + "in": "query" + }, + { + "required": false, + "schema": { + "$ref": "#/components/schemas/ReceivableMailStatusEnum" + }, + "name": "status", + "in": "query" + }, + { + "required": false, + "schema": { + "items": { + "$ref": "#/components/schemas/ReceivableMailStatusEnum" + }, + "type": "array" + }, + "name": "status__in", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__gt", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__lt", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__gte", + "in": "query" + }, + { + "required": false, + "schema": { "type": "string", "format": "date-time" }, + "name": "created_at__lte", + "in": "query" + }, { "description": "The ID of the entity that owns the requested resource.", "required": true, @@ -30455,19 +33164,14 @@ "in": "header" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ReceivablePaidPayload" } - } - } - }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ReceivableResponse" } + "schema": { + "$ref": "#/components/schemas/ReceivableMailPaginationResponse" + } } } }, @@ -30519,8 +33223,108 @@ } } }, - "409": { - "description": "Business logic error", + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/receivables/{receivable_id}/mails/{mail_id}": { + "get": { + "tags": ["Receivables"], + "summary": "Get a mail sent by receivable", + "operationId": "get_receivables_id_mails_id", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "receivable_id", + "in": "path" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "mail_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReceivableMailResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -30539,12 +33343,11 @@ "security": [{ "HTTPBearer": [] }] } }, - "/receivables/{receivable_id}/mark_as_partially_paid": { + "/receivables/{receivable_id}/mark_as_paid": { "post": { "tags": ["Receivables"], - "summary": "Mark an invoice as partially paid", - "description": "Deprecated. Use `POST /payment_records` to record an invoice payment.", - "operationId": "post_receivables_id_mark_as_partially_paid", + "summary": "Mark an invoice as paid", + "operationId": "post_receivables_id_mark_as_paid", "parameters": [ { "required": true, @@ -30574,12 +33377,9 @@ "requestBody": { "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/ReceivablePartiallyPaidPayload" - } + "schema": { "$ref": "#/components/schemas/ReceivablePaidPayload" } } - }, - "required": true + } }, "responses": { "200": { @@ -30655,15 +33455,15 @@ } } }, - "deprecated": true, "security": [{ "HTTPBearer": [] }] } }, - "/receivables/{receivable_id}/mark_as_uncollectible": { + "/receivables/{receivable_id}/mark_as_partially_paid": { "post": { "tags": ["Receivables"], - "summary": "Mark an invoice as uncollectible", - "operationId": "post_receivables_id_mark_as_uncollectible", + "summary": "Mark an invoice as partially paid", + "description": "Deprecated. Use `POST /payment_records` to record an invoice payment.", + "operationId": "post_receivables_id_mark_as_partially_paid", "parameters": [ { "required": true, @@ -30694,10 +33494,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReceivableUncollectiblePayload" + "$ref": "#/components/schemas/ReceivablePartiallyPaidPayload" } } - } + }, + "required": true }, "responses": { "200": { @@ -30773,14 +33574,15 @@ } } }, + "deprecated": true, "security": [{ "HTTPBearer": [] }] } }, - "/receivables/{receivable_id}/pdf_link": { - "get": { + "/receivables/{receivable_id}/mark_as_uncollectible": { + "post": { "tags": ["Receivables"], - "summary": "Get a link to the PDF version of a receivable", - "operationId": "get_receivables_id_pdf_link", + "summary": "Mark an invoice as uncollectible", + "operationId": "post_receivables_id_mark_as_uncollectible", "parameters": [ { "required": true, @@ -30807,12 +33609,21 @@ "in": "header" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReceivableUncollectiblePayload" + } + } + } + }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ReceivableFileUrl" } + "schema": { "$ref": "#/components/schemas/ReceivableResponse" } } } }, @@ -30864,6 +33675,14 @@ } } }, + "409": { + "description": "Business logic error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "422": { "description": "Validation Error", "content": { @@ -30876,11 +33695,11 @@ "security": [{ "HTTPBearer": [] }] } }, - "/receivables/{receivable_id}/preview": { - "post": { + "/receivables/{receivable_id}/pdf_link": { + "get": { "tags": ["Receivables"], - "summary": "Preview a receivable's email message", - "operationId": "post_receivables_id_preview", + "summary": "Get a link to the PDF version of a receivable", + "operationId": "get_receivables_id_pdf_link", "parameters": [ { "required": true, @@ -30907,24 +33726,12 @@ "in": "header" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReceivablePreviewRequest" - } - } - }, - "required": true - }, "responses": { - "201": { + "200": { "description": "Successful Response", "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/ReceivablePreviewResponse" - } + "schema": { "$ref": "#/components/schemas/ReceivableFileUrl" } } } }, @@ -30988,11 +33795,11 @@ "security": [{ "HTTPBearer": [] }] } }, - "/receivables/{receivable_id}/send": { + "/receivables/{receivable_id}/preview": { "post": { "tags": ["Receivables"], - "summary": "Send a receivable via email", - "operationId": "post_receivables_id_send", + "summary": "Preview a receivable's email message", + "operationId": "post_receivables_id_preview", "parameters": [ { "required": true, @@ -31022,18 +33829,20 @@ "requestBody": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ReceivableSendRequest" } + "schema": { + "$ref": "#/components/schemas/ReceivablePreviewRequest" + } } }, "required": true }, "responses": { - "200": { + "201": { "description": "Successful Response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReceivableSendResponse" + "$ref": "#/components/schemas/ReceivablePreviewResponse" } } } @@ -31086,14 +33895,6 @@ } } }, - "409": { - "description": "Business logic error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "422": { "description": "Validation Error", "content": { @@ -31106,11 +33907,11 @@ "security": [{ "HTTPBearer": [] }] } }, - "/receivables/{receivable_id}/send_test_reminder": { + "/receivables/{receivable_id}/send": { "post": { "tags": ["Receivables"], - "summary": "Send a test reminder", - "operationId": "post_receivables_id_send_test_reminder", + "summary": "Send a receivable via email", + "operationId": "post_receivables_id_send", "parameters": [ { "required": true, @@ -31140,9 +33941,7 @@ "requestBody": { "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/ReceivableSendTestReminderPayload" - } + "schema": { "$ref": "#/components/schemas/ReceivableSendRequest" } } }, "required": true @@ -31153,7 +33952,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReceivablesSendResponse" + "$ref": "#/components/schemas/ReceivableSendResponse" } } } @@ -31226,11 +34025,11 @@ "security": [{ "HTTPBearer": [] }] } }, - "/receivables/{receivable_id}/verify": { + "/receivables/{receivable_id}/send_test_reminder": { "post": { "tags": ["Receivables"], - "summary": "Verify a receivable", - "operationId": "post_receivables_id_verify", + "summary": "Send a test reminder", + "operationId": "post_receivables_id_send_test_reminder", "parameters": [ { "required": true, @@ -31257,13 +34056,23 @@ "in": "header" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReceivableSendTestReminderPayload" + } + } + }, + "required": true + }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReceivablesVerifyResponse" + "$ref": "#/components/schemas/ReceivablesSendResponse" } } } @@ -31316,6 +34125,14 @@ } } }, + "409": { + "description": "Business logic error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "422": { "description": "Validation Error", "content": { @@ -31328,11 +34145,11 @@ "security": [{ "HTTPBearer": [] }] } }, - "/recurrences": { - "get": { - "tags": ["Recurrences"], - "summary": "Get recurrences", - "operationId": "get_recurrences", + "/receivables/{receivable_id}/verify": { + "post": { + "tags": ["Receivables"], + "summary": "Verify a receivable", + "operationId": "post_receivables_id_verify", "parameters": [ { "required": true, @@ -31341,6 +34158,12 @@ "name": "x-monite-version", "in": "header" }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "receivable_id", + "in": "path" + }, { "description": "The ID of the entity that owns the requested resource.", "required": true, @@ -31358,7 +34181,9 @@ "description": "Successful Response", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GetAllRecurrences" } + "schema": { + "$ref": "#/components/schemas/ReceivablesVerifyResponse" + } } } }, @@ -31420,11 +34245,13 @@ } }, "security": [{ "HTTPBearer": [] }] - }, - "post": { + } + }, + "/recurrences": { + "get": { "tags": ["Recurrences"], - "summary": "Create a recurrence", - "operationId": "post_recurrences", + "summary": "Get recurrences", + "operationId": "get_recurrences", "parameters": [ { "required": true, @@ -31445,22 +34272,12 @@ "in": "header" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateRecurrencePayload" - } - } - }, - "required": true - }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/Recurrence" } + "schema": { "$ref": "#/components/schemas/GetAllRecurrences" } } } }, @@ -31522,13 +34339,11 @@ } }, "security": [{ "HTTPBearer": [] }] - } - }, - "/recurrences/{recurrence_id}": { - "get": { + }, + "post": { "tags": ["Recurrences"], - "summary": "Get a recurrence by ID", - "operationId": "get_recurrences_id", + "summary": "Create a recurrence", + "operationId": "post_recurrences", "parameters": [ { "required": true, @@ -31537,12 +34352,6 @@ "name": "x-monite-version", "in": "header" }, - { - "required": true, - "schema": { "type": "string", "format": "uuid" }, - "name": "recurrence_id", - "in": "path" - }, { "description": "The ID of the entity that owns the requested resource.", "required": true, @@ -31555,6 +34364,16 @@ "in": "header" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateRecurrencePayload" + } + } + }, + "required": true + }, "responses": { "200": { "description": "Successful Response", @@ -31622,11 +34441,13 @@ } }, "security": [{ "HTTPBearer": [] }] - }, - "patch": { + } + }, + "/recurrences/{recurrence_id}": { + "get": { "tags": ["Recurrences"], - "summary": "Update a recurrence", - "operationId": "patch_recurrences_id", + "summary": "Get a recurrence by ID", + "operationId": "get_recurrences_id", "parameters": [ { "required": true, @@ -31653,16 +34474,6 @@ "in": "header" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateRecurrencePayload" - } - } - }, - "required": true - }, "responses": { "200": { "description": "Successful Response", @@ -31730,13 +34541,11 @@ } }, "security": [{ "HTTPBearer": [] }] - } - }, - "/recurrences/{recurrence_id}/cancel": { - "post": { + }, + "patch": { "tags": ["Recurrences"], - "summary": "Cancel a recurrence", - "operationId": "post_recurrences_id_cancel", + "summary": "Update a recurrence", + "operationId": "patch_recurrences_id", "parameters": [ { "required": true, @@ -31763,8 +34572,25 @@ "in": "header" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateRecurrencePayload" + } + } + }, + "required": true + }, "responses": { - "204": { "description": "Successful Response" }, + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/Recurrence" } + } + } + }, "405": { "description": "Method Not Allowed", "content": { @@ -31813,14 +34639,6 @@ } } }, - "409": { - "description": "Business logic error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "422": { "description": "Validation Error", "content": { @@ -31833,12 +34651,11 @@ "security": [{ "HTTPBearer": [] }] } }, - "/roles": { - "get": { - "tags": ["Roles"], - "summary": "Search roles", - "description": "Find all roles that match the search criteria.", - "operationId": "get_roles", + "/recurrences/{recurrence_id}/cancel": { + "post": { + "tags": ["Recurrences"], + "summary": "Cancel a recurrence", + "operationId": "post_recurrences_id_cancel", "parameters": [ { "required": true, @@ -31848,87 +34665,10 @@ "in": "header" }, { - "description": "Order by", - "required": false, - "schema": { - "allOf": [{ "$ref": "#/components/schemas/OrderEnum" }], - "default": "asc" - }, - "name": "order", - "in": "query" - }, - { - "description": "Max is 100", - "required": false, - "schema": { - "type": "integer", - "maximum": 100.0, - "minimum": 1.0, - "default": 100 - }, - "name": "limit", - "in": "query" - }, - { - "description": "A token, obtained from previous page. Prior over other filters", - "required": false, - "schema": { "type": "string" }, - "name": "pagination_token", - "in": "query" - }, - { - "description": "Allowed sort fields", - "required": false, - "schema": { - "allOf": [{ "$ref": "#/components/schemas/RoleCursorFields" }] - }, - "name": "sort", - "in": "query" - }, - { - "required": false, - "schema": { - "items": { "type": "string", "format": "uuid" }, - "type": "array" - }, - "name": "id__in", - "in": "query" - }, - { - "required": false, - "schema": { "type": "string" }, - "name": "name", - "in": "query" - }, - { - "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "created_at", - "in": "query" - }, - { - "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "created_at__gt", - "in": "query" - }, - { - "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "created_at__lt", - "in": "query" - }, - { - "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "created_at__gte", - "in": "query" - }, - { - "required": false, - "schema": { "type": "string", "format": "date-time" }, - "name": "created_at__lte", - "in": "query" + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "recurrence_id", + "in": "path" }, { "description": "The ID of the entity that owns the requested resource.", @@ -31943,16 +34683,7 @@ } ], "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RolePaginationResponse" - } - } - } - }, + "204": { "description": "Successful Response" }, "405": { "description": "Method Not Allowed", "content": { @@ -31985,6 +34716,14 @@ } } }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "403": { "description": "Forbidden", "content": { @@ -31993,8 +34732,8 @@ } } }, - "406": { - "description": "Not Acceptable", + "409": { + "description": "Business logic error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32011,7 +34750,9 @@ } }, "security": [{ "HTTPBearer": [] }] - }, + } + }, + "/roles": { "post": { "tags": ["Roles"], "summary": "Create a role", @@ -32026,24 +34767,24 @@ "in": "header" }, { - "description": "The ID of the entity that owns the requested resource.", + "name": "x-monite-entity-id", + "in": "header", "required": true, "schema": { "type": "string", "format": "uuid", "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] }, - "name": "x-monite-entity-id", - "in": "header" + "description": "The ID of the entity that owns the requested resource." } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRoleRequest" } } - }, - "required": true + } }, "responses": { "200": { @@ -32088,6 +34829,217 @@ } }, "security": [{ "HTTPBearer": [] }] + }, + "get": { + "tags": ["Roles"], + "summary": "Search roles", + "description": "Find all roles that match the search criteria.", + "operationId": "get_roles", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/OrderEnum", + "default": "asc" + }, + "description": "Order by" + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "maximum": 100, + "minimum": 1, + "default": 100 + }, + "description": "Max is 100" + }, + { + "name": "pagination_token", + "in": "query", + "required": false, + "schema": { "anyOf": [{ "type": "string" }, { "type": "null" }] }, + "description": "A token, obtained from previous page. Prior over other filters" + }, + { + "name": "sort", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { "$ref": "#/components/schemas/RoleCursorFields" }, + { "type": "null" } + ] + }, + "description": "Allowed sort fields" + }, + { + "name": "id__in", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "array", + "items": { "type": "string", "format": "uuid" } + }, + { "type": "null" } + ] + } + }, + { + "name": "name", + "in": "query", + "required": false, + "schema": { "anyOf": [{ "type": "string" }, { "type": "null" }] } + }, + { + "name": "created_at", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { "type": "string", "format": "date-time" }, + { "type": "null" } + ] + } + }, + { + "name": "created_at__gt", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { "type": "string", "format": "date-time" }, + { "type": "null" } + ] + } + }, + { + "name": "created_at__lt", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { "type": "string", "format": "date-time" }, + { "type": "null" } + ] + } + }, + { + "name": "created_at__gte", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { "type": "string", "format": "date-time" }, + { "type": "null" } + ] + } + }, + { + "name": "created_at__lte", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { "type": "string", "format": "date-time" }, + { "type": "null" } + ] + } + }, + { + "name": "x-monite-entity-id", + "in": "header", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "description": "The ID of the entity that owns the requested resource." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RolePaginationResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "406": { + "description": "Not Acceptable", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + } + }, + "security": [{ "HTTPBearer": [] }] } }, "/roles/{role_id}": { @@ -32104,21 +35056,21 @@ "in": "header" }, { - "required": true, - "schema": { "type": "string", "format": "uuid" }, "name": "role_id", - "in": "path" + "in": "path", + "required": true, + "schema": { "type": "string", "format": "uuid" } }, { - "description": "The ID of the entity that owns the requested resource.", + "name": "x-monite-entity-id", + "in": "header", "required": true, "schema": { "type": "string", "format": "uuid", "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] }, - "name": "x-monite-entity-id", - "in": "header" + "description": "The ID of the entity that owns the requested resource." } ], "responses": { @@ -32179,30 +35131,30 @@ "in": "header" }, { - "required": true, - "schema": { "type": "string", "format": "uuid" }, "name": "role_id", - "in": "path" + "in": "path", + "required": true, + "schema": { "type": "string", "format": "uuid" } }, { - "description": "The ID of the entity that owns the requested resource.", + "name": "x-monite-entity-id", + "in": "header", "required": true, "schema": { "type": "string", "format": "uuid", "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] }, - "name": "x-monite-entity-id", - "in": "header" + "description": "The ID of the entity that owns the requested resource." } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateRoleRequest" } } - }, - "required": true + } }, "responses": { "200": { @@ -32396,7 +35348,7 @@ "in": "header" }, { - "description": "Order by", + "description": "Sort order (ascending by default). Typically used together with the `sort` parameter.", "required": false, "schema": { "allOf": [{ "$ref": "#/components/schemas/OrderEnum" }], @@ -32406,7 +35358,7 @@ "in": "query" }, { - "description": "Max is 100", + "description": "The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page.", "required": false, "schema": { "type": "integer", @@ -32418,14 +35370,14 @@ "in": "query" }, { - "description": "A token, obtained from previous page. Prior over other filters", + "description": "A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters are ignored and inferred from the initial query.\n\nIf not specified, the first page of results will be returned.", "required": false, "schema": { "type": "string" }, "name": "pagination_token", "in": "query" }, { - "description": "Allowed sort fields", + "description": "The field to sort the results by. Typically used together with the `order` parameter.", "required": false, "schema": { "allOf": [{ "$ref": "#/components/schemas/TagCursorFields" }] @@ -34588,6 +37540,18 @@ "additionalProperties": false, "type": "object" }, + "AccountingSettings": { + "properties": { + "ledger_account_ids": { + "allOf": [ + { "$ref": "#/components/schemas/DefaultLedgerAccountIDs" } + ], + "description": "Default ledger accounts that will be used for various objects pushed into an accounting system. Use `GET /ledger_accounts` to get the IDs of these ledger accounts." + } + }, + "additionalProperties": false, + "type": "object" + }, "AccountingTaxRateListResponse": { "properties": { "data": { @@ -34651,12 +37615,12 @@ "ActionSchema": { "properties": { "action_name": { - "allOf": [{ "$ref": "#/components/schemas/ActionEnum" }], + "$ref": "#/components/schemas/ActionEnum", "description": "Action name", "default": "read" }, "permission": { - "allOf": [{ "$ref": "#/components/schemas/PermissionEnum" }], + "$ref": "#/components/schemas/PermissionEnum", "description": "Permission type", "default": "allowed" } @@ -34702,6 +37666,10 @@ "type": "object", "required": ["body_template", "name", "subject_template", "type"] }, + "AggregationFunctionEnum": { + "type": "string", + "enum": ["count", "average", "summary", "min", "max"] + }, "AirwallexData": { "properties": { "payment_intent_id": { "type": "string" }, @@ -35353,6 +38321,15 @@ "receivable_signatures" ] }, + "AnalyticsDataPoint": { + "properties": { + "dimension_value": { "type": "string" }, + "metric_value": { "type": "integer" } + }, + "additionalProperties": false, + "type": "object", + "required": ["metric_value"] + }, "ApprovalPolicyCreate": { "properties": { "starts_at": { @@ -35912,17 +38889,6 @@ "type": "string", "enum": ["invoice", "credit_note"] }, - "BizObjectsSchema": { - "properties": { - "objects": { - "items": { "$ref": "#/components/schemas/RootSchema" }, - "type": "array", - "description": "List of objects" - } - }, - "additionalProperties": false, - "type": "object" - }, "BusinessProfile": { "properties": { "description_of_goods_or_services": { @@ -36066,50 +39032,6 @@ "additionalProperties": false, "type": "object" }, - "CommonSchema": { - "properties": { - "actions": { - "items": { "$ref": "#/components/schemas/ActionSchema" }, - "type": "array", - "description": "List of actions" - }, - "object_type": { - "type": "string", - "enum": [ - "person", - "onboarding", - "comment", - "counterpart", - "entity_user", - "entity", - "entity_vat_ids", - "counterpart_vat_id", - "entity_bank_account", - "export", - "payables_purchase_order", - "payment_reminder", - "overdue_reminder", - "product", - "project", - "receivable", - "reconciliation", - "role", - "tag", - "todo_task", - "todo_task_mute", - "transaction", - "workflow", - "approval_request", - "approval_policy", - "payment_record" - ], - "description": "Object type", - "default": "comment" - } - }, - "additionalProperties": false, - "type": "object" - }, "CompanyLogoUpdate": { "properties": { "file": { "type": "string", "format": "binary" } }, "type": "object", @@ -37749,7 +40671,8 @@ "maxLength": 2083, "minLength": 1, "format": "uri", - "example": "https://pay.monite.com/result" + "description": "The URL where to redirect the payer after the payment. If `return_url` is specified, then after the payment is completed the payment page will display the \"Return to platform\" link that navigates to this URL.", + "example": "https://pay.example.com/complete" } }, "additionalProperties": false, @@ -37790,7 +40713,7 @@ "description": "Role name" }, "permissions": { - "allOf": [{ "$ref": "#/components/schemas/BizObjectsSchema" }], + "$ref": "#/components/schemas/BizObjectsSchema-Input", "description": "Access permissions" } }, @@ -37824,6 +40747,591 @@ "type": "object", "required": ["object_type", "url"] }, + "CreditNoteCreateRequest": { + "properties": { + "amount": { + "type": "integer", + "minimum": 0.0, + "description": "The total amount including taxes", + "example": 1200 + }, + "based_on": { + "type": "string", + "format": "uuid", + "description": "ID of the payable this credit note is based on. The credit note will be linked to this payable", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "based_on_document_id": { + "type": "string", + "maxLength": 255, + "description": "The document ID of the original payable that this credit note refers to", + "example": "INV-2287" + }, + "counterpart_address_id": { + "type": "string", + "format": "uuid", + "description": "The ID of the counterpart's address", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "counterpart_bank_account_id": { + "type": "string", + "format": "uuid", + "description": "The ID of the counterpart's bank account", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "counterpart_id": { + "type": "string", + "format": "uuid", + "description": "The ID of the counterpart (vendor/supplier)", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "counterpart_vat_id_id": { + "type": "string", + "format": "uuid", + "description": "The ID of the counterpart's VAT registration", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "currency": { + "allOf": [{ "$ref": "#/components/schemas/CurrencyEnum" }], + "description": "The currency code of the credit note", + "default": "EUR", + "example": "EUR" + }, + "description": { + "type": "string", + "maxLength": 255, + "description": "An arbitrary description of this credit note", + "example": "Credit note for returned items from invoice INV-2287" + }, + "document_id": { + "type": "string", + "maxLength": 255, + "description": "A unique credit note number assigned by the credit note issuer for tracking purposes", + "example": "CN-2287" + }, + "issued_at": { + "type": "string", + "format": "date", + "description": "The date when the credit note was issued, in the YYYY-MM-DD format", + "example": "2024-01-15" + }, + "project_id": { + "type": "string", + "format": "uuid", + "description": "The ID of the project this credit note belongs to", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "sender": { + "type": "string", + "maxLength": 255, + "description": "The email address from which the credit note was received", + "example": "supplier@example.com" + }, + "subtotal": { + "type": "integer", + "minimum": 0.0, + "description": "The subtotal amount before taxes", + "example": 1000 + }, + "tag_ids": { + "items": { "type": "string", "format": "uuid" }, + "type": "array", + "description": "List of tag IDs associated with this credit note", + "example": ["123e4567-e89b-12d3-a456-426614174000"] + }, + "tax": { + "type": "integer", + "maximum": 10000.0, + "minimum": 0.0, + "description": "The tax percentage applied to the subtotal", + "example": 20 + }, + "tax_amount": { + "type": "integer", + "minimum": 0.0, + "description": "The calculated tax amount", + "example": 200 + } + }, + "additionalProperties": false, + "type": "object", + "required": ["amount", "based_on", "document_id", "issued_at"], + "description": "Schema for creating a new credit note." + }, + "CreditNoteCursorFields": { + "type": "string", + "enum": ["id", "created_at"] + }, + "CreditNoteLineItemCreateRequest": { + "properties": { + "description": { + "type": "string", + "description": "Detailed description of the line item", + "example": "Premium version of Product XYZ with extended warranty" + }, + "name": { + "type": "string", + "description": "Name or title of the line item", + "example": "Product XYZ" + }, + "quantity": { + "type": "number", + "minimum": 0.0, + "description": "Quantity of items", + "example": 2.0 + }, + "subtotal": { + "type": "integer", + "minimum": 0.0, + "description": "Subtotal amount before tax in smallest currency unit", + "example": 10000 + }, + "tax": { + "type": "integer", + "maximum": 10000.0, + "minimum": 0.0, + "description": "Tax percentage", + "example": 20 + }, + "tax_amount": { + "type": "integer", + "minimum": 0.0, + "description": "Tax amount in smallest currency unit", + "example": 2000 + }, + "total": { + "type": "integer", + "minimum": 0.0, + "description": "Total amount including tax in smallest currency unit", + "example": 12000 + }, + "unit": { + "type": "string", + "description": "Unit of measurement", + "example": "pieces" + }, + "unit_price": { + "type": "integer", + "minimum": 0.0, + "description": "Price per unit in smallest currency unit (e.g. cents)", + "example": 5000 + } + }, + "additionalProperties": false, + "type": "object", + "description": "Schema for creating a new credit note line item." + }, + "CreditNoteLineItemCursorFields": { + "type": "string", + "enum": ["id", "created_at", "name", "total", "quantity", "unit_price"] + }, + "CreditNoteLineItemPaginationResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/CreditNoteLineItemResponse" + }, + "type": "array", + "description": "List of credit note line items for the current page" + }, + "next_pagination_token": { + "type": "string", + "description": "Token to retrieve the next page of results", + "example": "eyJwYWdlIjoyfQ==" + }, + "prev_pagination_token": { + "type": "string", + "description": "Token to retrieve the previous page of results", + "example": "eyJwYWdlIjoxfQ==" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["data"], + "description": "A paginated list of credit note line items." + }, + "CreditNoteLineItemReplaceRequest": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/CreditNoteLineItemCreateRequest" + }, + "type": "array", + "description": "List of credit note line items to replace existing ones" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["data"], + "description": "Schema for replacing all line items of a credit note." + }, + "CreditNoteLineItemResponse": { + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier of the line item", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the line item was created", + "example": "2024-01-15T14:30:00Z" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the line item was last updated", + "example": "2024-01-15T14:30:00Z" + }, + "created_by_user_id": { + "type": "string", + "format": "uuid", + "description": "ID of the user who created the line item", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "credit_note_id": { + "type": "string", + "format": "uuid", + "description": "ID of the parent credit note", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "description": { + "type": "string", + "description": "Detailed description of the line item", + "example": "Premium version of Product XYZ with extended warranty" + }, + "name": { + "type": "string", + "description": "Name or title of the line item", + "example": "Product XYZ" + }, + "quantity": { + "type": "number", + "minimum": 0.0, + "description": "Quantity of items", + "example": 2.0 + }, + "subtotal": { + "type": "integer", + "minimum": 0.0, + "description": "Subtotal amount before tax", + "example": 10000 + }, + "tax": { + "type": "integer", + "minimum": 0.0, + "description": "Tax percentage", + "example": 20 + }, + "tax_amount": { + "type": "integer", + "minimum": 0.0, + "description": "Tax amount", + "example": 2000 + }, + "total": { + "type": "integer", + "minimum": 0.0, + "description": "Total amount including tax", + "example": 12000 + }, + "unit": { + "type": "string", + "description": "Unit of measurement", + "example": "pieces" + }, + "unit_price": { + "type": "integer", + "minimum": 0.0, + "description": "Price per unit in smallest currency unit", + "example": 5000 + } + }, + "additionalProperties": false, + "type": "object", + "required": ["id", "created_at", "updated_at", "credit_note_id"], + "description": "Schema for credit note line item response. Includes all fields that can be returned from the API." + }, + "CreditNoteLineItemUpdateRequest": { + "properties": { + "description": { + "type": "string", + "description": "Detailed description of the line item", + "example": "Premium version of Product XYZ with extended warranty" + }, + "name": { + "type": "string", + "description": "Name or title of the line item", + "example": "Product XYZ" + }, + "quantity": { + "type": "number", + "minimum": 0.0, + "description": "Quantity of items", + "example": 2.0 + }, + "subtotal": { + "type": "integer", + "minimum": 0.0, + "description": "Subtotal amount before tax", + "example": 10000 + }, + "tax": { + "type": "integer", + "maximum": 10000.0, + "minimum": 0.0, + "description": "Tax percentage", + "example": 20 + }, + "tax_amount": { + "type": "integer", + "minimum": 0.0, + "description": "Tax amount", + "example": 2000 + }, + "total": { + "type": "integer", + "minimum": 0.0, + "description": "Total amount including tax", + "example": 12000 + }, + "unit": { + "type": "string", + "description": "Unit of measurement", + "example": "pieces" + }, + "unit_price": { + "type": "integer", + "minimum": 0.0, + "description": "Price per unit in smallest currency unit", + "example": 5000 + } + }, + "additionalProperties": false, + "type": "object", + "description": "Schema for updating an existing credit note line item. All fields are optional." + }, + "CreditNotePaginationResponse": { + "properties": { + "data": { + "items": { "$ref": "#/components/schemas/CreditNoteResponse" }, + "type": "array", + "description": "List of credit notes for the current page" + }, + "next_pagination_token": { + "type": "string", + "description": "Token to retrieve the next page of results", + "example": "eyJwYWdlIjoyfQ==" + }, + "prev_pagination_token": { + "type": "string", + "description": "Token to retrieve the previous page of results", + "example": "eyJwYWdlIjoxfQ==" + } + }, + "additionalProperties": false, + "type": "object", + "required": ["data"], + "description": "A paginated list of credit notes." + }, + "CreditNoteResponse": { + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique identifier of the credit note", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Date and time when the credit note was created in the system", + "example": "2024-01-15T14:30:00Z" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Date and time of the last update to the credit note", + "example": "2024-01-15T14:30:00Z" + }, + "amount": { + "type": "integer", + "description": "The total amount including taxes", + "example": 1200 + }, + "based_on": { + "type": "string", + "format": "uuid", + "description": "ID of the payable this credit note is based on", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "based_on_document_id": { + "type": "string", + "maxLength": 255, + "description": "The document ID of the original payable that this credit note refers to", + "example": "INV-2287" + }, + "counterpart_address_id": { + "type": "string", + "format": "uuid", + "description": "ID of the counterpart's address", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "counterpart_bank_account_id": { + "type": "string", + "format": "uuid", + "description": "ID of the counterpart's bank account", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "counterpart_id": { + "type": "string", + "format": "uuid", + "description": "ID of the counterpart", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "counterpart_vat_id_id": { + "type": "string", + "format": "uuid", + "description": "ID of the counterpart's VAT registration", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "created_by_external_user_id": { + "type": "string", + "maxLength": 255, + "description": "External system's user ID for the creator", + "example": "ext_user_123" + }, + "created_by_external_user_name": { + "type": "string", + "maxLength": 255, + "description": "Name of the external user who created the credit note", + "example": "John Doe" + }, + "created_by_user_id": { + "type": "string", + "format": "uuid", + "description": "ID of the user who created the credit note", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "currency": { + "type": "string", + "maxLength": 5, + "description": "The currency code", + "example": "EUR" + }, + "currency_exchange": { + "$ref": "#/components/schemas/package__payables__v2024_05_25__credit_notes__schemas__CurrencyExchangeSchema" + }, + "description": { + "type": "string", + "maxLength": 255, + "description": "Description of the credit note", + "example": "Credit note for returned items from invoice INV-2287" + }, + "document_id": { + "type": "string", + "maxLength": 255, + "description": "The credit note's unique document number", + "example": "CN-2287" + }, + "entity_id": { + "type": "string", + "format": "uuid", + "description": "The ID of the entity to which the credit note belongs", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "issued_at": { + "type": "string", + "format": "date", + "description": "Date when the credit note was issued", + "example": "2024-01-15" + }, + "ocr_request_id": { + "type": "string", + "format": "uuid", + "description": "ID of the OCR processing request", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "ocr_status": { + "type": "string", + "maxLength": 10, + "description": "Status of OCR processing", + "example": "completed" + }, + "origin": { + "type": "string", + "maxLength": 128, + "description": "The origin or source system of the credit note", + "example": "SAP" + }, + "project_id": { + "type": "string", + "format": "uuid", + "description": "ID of the associated project", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "sender": { + "type": "string", + "maxLength": 255, + "description": "Email address of the sender", + "example": "supplier@example.com" + }, + "source_of_data": { + "type": "string", + "maxLength": 128, + "description": "How the data was input (ocr/user_specified)", + "example": "user_specified" + }, + "status": { + "type": "string", + "maxLength": 30, + "description": "The current status of the credit note in its lifecycle", + "example": "submitted_for_approval" + }, + "subtotal": { + "type": "integer", + "description": "The subtotal amount before taxes", + "example": 1000 + }, + "tags": { + "items": { "$ref": "#/components/schemas/TagReadSchema" }, + "type": "array", + "description": "List of tags associated with this credit note", + "example": [ + { + "id": "123e4567-e89b-12d3-a456-426614174000", + "name": "Department A", + "category": "department" + } + ] + }, + "tax": { + "type": "integer", + "description": "The tax percentage", + "example": 20 + }, + "tax_amount": { + "type": "integer", + "description": "The calculated tax amount", + "example": 200 + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id", + "created_at", + "updated_at", + "based_on", + "entity_id", + "origin", + "source_of_data", + "status" + ], + "description": "Schema for credit note response. Includes all fields that can be returned from the API." + }, "CreditNoteResponsePayload": { "properties": { "id": { "type": "string", "format": "uuid" }, @@ -38081,6 +41589,115 @@ "type": "string", "enum": ["draft", "issued", "deleted"] }, + "CreditNoteUpdateRequest": { + "properties": { + "amount": { + "type": "integer", + "minimum": 0.0, + "description": "The total amount including taxes", + "example": 1200 + }, + "based_on": { + "type": "string", + "format": "uuid", + "description": "ID of the payable this credit note is based on. The credit note will be linked to this payable", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "based_on_document_id": { + "type": "string", + "maxLength": 255, + "description": "The document ID of the original payable", + "example": "INV-2287" + }, + "counterpart_address_id": { + "type": "string", + "format": "uuid", + "description": "ID of the counterpart's address", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "counterpart_bank_account_id": { + "type": "string", + "format": "uuid", + "description": "ID of the counterpart's bank account", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "counterpart_id": { + "type": "string", + "format": "uuid", + "description": "ID of the counterpart", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "counterpart_vat_id_id": { + "type": "string", + "format": "uuid", + "description": "ID of the counterpart's VAT registration", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "currency": { + "allOf": [{ "$ref": "#/components/schemas/CurrencyEnum" }], + "description": "The currency code of the credit note", + "example": "EUR" + }, + "description": { + "type": "string", + "maxLength": 255, + "description": "An arbitrary description of this credit note", + "example": "Credit note for returned items from invoice INV-2287" + }, + "document_id": { + "type": "string", + "maxLength": 255, + "description": "A unique credit note number assigned by the credit note issuer for tracking purposes", + "example": "CN-2287" + }, + "issued_at": { + "type": "string", + "format": "date", + "description": "The date when the credit note was issued, in the YYYY-MM-DD format", + "example": "2024-01-15" + }, + "project_id": { + "type": "string", + "format": "uuid", + "description": "The ID of the project this credit note belongs to", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "sender": { + "type": "string", + "maxLength": 255, + "description": "Email address of the sender", + "example": "supplier@example.com" + }, + "subtotal": { + "type": "integer", + "minimum": 0.0, + "description": "The subtotal amount before taxes", + "example": 1000 + }, + "tag_ids": { + "items": { "type": "string", "format": "uuid" }, + "type": "array", + "description": "List of tag IDs associated with this credit note", + "example": ["123e4567-e89b-12d3-a456-426614174000"] + }, + "tax": { + "type": "integer", + "maximum": 10000.0, + "minimum": 0.0, + "description": "The tax percentage applied to the subtotal", + "example": 20 + }, + "tax_amount": { + "type": "integer", + "minimum": 0.0, + "description": "The calculated tax amount", + "example": 200 + } + }, + "additionalProperties": false, + "type": "object", + "description": "Schema for updating an existing credit note. All fields are optional." + }, "CurrencyDetails": { "properties": { "minor_units": { "type": "integer" }, @@ -38232,16 +41849,6 @@ "ZMW" ] }, - "CurrencyExchangeSchema": { - "properties": { - "default_currency_code": { "type": "string" }, - "rate": { "type": "number", "exclusiveMinimum": true }, - "total": { "type": "number" } - }, - "additionalProperties": false, - "type": "object", - "required": ["default_currency_code", "rate", "total"] - }, "CurrencySettings": { "properties": { "default": { "$ref": "#/components/schemas/CurrencyEnum" }, @@ -38376,6 +41983,10 @@ "required": ["receiving_dns_records", "sending_dns_records"] }, "DataExportCursorFields": { "type": "string", "enum": ["created_at"] }, + "DateDimensionBreakdownEnum": { + "type": "string", + "enum": ["daily", "weekly", "monthly", "quarterly", "yearly"] + }, "DayOfMonth": { "type": "string", "enum": ["first_day", "last_day"] }, "DecryptTokenResponse": { "properties": { @@ -38389,6 +42000,17 @@ "type": "object", "required": ["company_name", "email", "expired", "token_type"] }, + "DefaultLedgerAccountIDs": { + "properties": { + "payments": { + "type": "string", + "format": "uuid", + "description": "ID of the ledger account to which all payment records will be pushed. Changing this value affects only future data pushes and does not affect payment records that already exist in the accounting system." + } + }, + "additionalProperties": false, + "type": "object" + }, "DictsResponse": { "properties": { "name": { "type": "string" } }, "type": "object", @@ -38441,23 +42063,23 @@ "properties": { "include_date": { "type": "boolean", - "description": "Optionally add 4-digit of the current year", + "description": "Optionally add 4-digit of the current year.", "default": false }, "prefix": { "type": "string", "maxLength": 25, "minLength": 1, - "description": "Optional prefix. Does not substitute document_type prefix" + "description": "Optional prefix. Does not substitute document_type prefix." }, "separator": { "allOf": [{ "$ref": "#/components/schemas/DocumentIDSeparators" }], - "description": "Which character should separate each part of the document_id", + "description": "Which character should separate each part of the document_id.", "default": "-" }, "document_type_prefix": { "allOf": [{ "$ref": "#/components/schemas/DocumentTypePrefix" }], - "description": "Prefixes for each document_type", + "description": "Prefixes for each document_type.", "default": { "quote": "Q", "invoice": "INV", @@ -38469,7 +42091,7 @@ "type": "integer", "maximum": 25.0, "minimum": 1.0, - "description": "Minimal size of number in document ID Number will be left padded with zeros if less", + "description": "Minimal size of number in document ID Number will be left padded with zeros if less.", "default": 5 } }, @@ -38506,23 +42128,23 @@ "properties": { "include_date": { "type": "boolean", - "description": "Optionally add 4-digit of the current year", + "description": "Optionally add 4-digit of the current year.", "default": false }, "prefix": { "type": "string", "maxLength": 25, "minLength": 1, - "description": "Optional prefix. Does not substitute document_type prefix" + "description": "Optional prefix. Does not substitute document_type prefix." }, "separator": { "allOf": [{ "$ref": "#/components/schemas/DocumentIDSeparators" }], - "description": "Which character should separate each part of the document_id", + "description": "Which character should separate each part of the document_id.", "default": "-" }, "document_type_prefix": { "allOf": [{ "$ref": "#/components/schemas/DocumentTypePrefix" }], - "description": "Prefixes for each document_type", + "description": "Prefixes for each document_type.", "default": { "quote": "Q", "invoice": "INV", @@ -38534,14 +42156,14 @@ "type": "integer", "maximum": 25.0, "minimum": 1.0, - "description": "Minimal size of number in document ID Number will be left padded with zeros if less", + "description": "Minimal size of number in document ID Number will be left padded with zeros if less.", "default": 5 }, "next_number": { "allOf": [ { "$ref": "#/components/schemas/DocumentIDsSettingsNextNumber" } ], - "description": "Write-only field. Changes which number will be issued next. Can't be less than the last issued document number" + "description": "Write-only field. Changes which number will be issued next. Can't be less than the last issued document number." } }, "additionalProperties": false, @@ -38615,7 +42237,13 @@ "required": ["data"] }, "DomainRequest": { - "properties": { "domain": { "type": "string" } }, + "properties": { + "domain": { + "type": "string", + "format": "hostname", + "description": "The domain name, such as `mail.mycompany.com`. Can contain only alphanumeric characters (A..Z a..z 0..9), dots (.), and hyphens (-). Each segment of the domain name must start and end with either a letter or a digit." + } + }, "additionalProperties": false, "type": "object", "required": ["domain"] @@ -38637,7 +42265,11 @@ { "type": "object" } ] }, - "domain": { "type": "string" }, + "domain": { + "type": "string", + "format": "hostname", + "description": "The domain name." + }, "last_updated_at": { "type": "string", "format": "date-time", @@ -39622,6 +43254,217 @@ "type": "object", "required": ["data"] }, + "FinancingInvoice": { + "properties": { + "type": { + "allOf": [{ "$ref": "#/components/schemas/FinancingInvoiceType" }], + "description": "The type of the invoice i.e. receivable or payable." + }, + "status": { + "allOf": [{ "$ref": "#/components/schemas/WCInvoiceStatus" }], + "description": "Status of the invoice." + }, + "invoice_id": { + "type": "string", + "format": "uuid", + "description": "Monite invoice ID." + }, + "document_id": { + "type": "string", + "description": "Monite document ID." + }, + "due_date": { + "type": "string", + "format": "date", + "description": "Monite invoice due date." + }, + "issue_date": { + "type": "string", + "format": "date", + "description": "Monite invoice issue date." + }, + "total_amount": { + "type": "integer", + "minimum": 0.0, + "description": "Total amount of the invoice in minor units." + }, + "currency": { + "allOf": [{ "$ref": "#/components/schemas/CurrencyEnum" }], + "description": "Currency code." + }, + "description": { + "type": "string", + "description": "Description of the invoice." + }, + "payer_type": { + "type": "string", + "description": "Payer type. BUSINESS or INDIVIDUAL" + }, + "payer_business_name": { + "type": "string", + "description": "Payer business name. Only applicable for BUSINESS payer type." + }, + "payer_first_name": { + "type": "string", + "description": "Payer first name. Only applicable for INDIVIDUAL payer type." + }, + "payer_last_name": { + "type": "string", + "description": "Payer last name. Only applicable for INDIVIDUAL payer type." + }, + "repayment_schedule": { + "allOf": [{ "$ref": "#/components/schemas/RepaymentSchedule" }], + "description": "Repayment schedule of the invoice.", + "example": { + "repayment_date": "2025-03-01", + "repayment_amount": 100000, + "repayment_fee_amount": 3000, + "repayment_principal_amount": 97000 + } + } + }, + "type": "object", + "required": [ + "type", + "status", + "invoice_id", + "document_id", + "due_date", + "issue_date", + "total_amount", + "currency", + "payer_type" + ] + }, + "FinancingInvoiceCursorFields": { + "type": "string", + "enum": ["id", "created_at"] + }, + "FinancingInvoiceListResponse": { + "properties": { + "data": { + "items": { "$ref": "#/components/schemas/FinancingInvoice" }, + "type": "array", + "description": "A list of invoices requested for financing." + }, + "prev_pagination_token": { + "type": "string", + "description": "A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page)." + }, + "next_pagination_token": { + "type": "string", + "description": "A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page)." + } + }, + "type": "object", + "required": ["data"] + }, + "FinancingInvoiceType": { + "type": "string", + "enum": ["payable", "receivable"] + }, + "FinancingOffer": { + "properties": { + "status": { + "allOf": [{ "$ref": "#/components/schemas/WCOfferStatus" }], + "description": "The status of the financing offer.", + "example": "CURRENT" + }, + "total_amount": { + "type": "integer", + "description": "The total credit limit in minor units.", + "example": 1000000 + }, + "available_amount": { + "type": "integer", + "description": "The available credit limit in minor units.", + "example": 500000 + }, + "currency": { + "allOf": [{ "$ref": "#/components/schemas/CurrencyEnum" }], + "description": "The currency code.", + "example": "USD" + }, + "pricing_plans": { + "items": { "$ref": "#/components/schemas/PricingPlan" }, + "type": "array", + "minItems": 1, + "description": "A list of pricing plans for the offer." + } + }, + "type": "object", + "required": ["status", "total_amount", "currency", "pricing_plans"] + }, + "FinancingOffersResponse": { + "properties": { + "offers": { + "items": { "$ref": "#/components/schemas/FinancingOffer" }, + "type": "array", + "description": "A list of financing offers extended to the business." + }, + "business_status": { + "allOf": [{ "$ref": "#/components/schemas/WCBusinessStatus" }], + "description": "The business's onboarding status.", + "example": "ONBOARDED" + } + }, + "type": "object", + "required": ["offers", "business_status"] + }, + "FinancingPushInvoicesRequest": { + "properties": { + "invoices": { + "items": { + "$ref": "#/components/schemas/FinancingPushInvoicesRequestInvoice" + }, + "type": "array", + "maxItems": 10, + "minItems": 1, + "description": "A list of invoices to request financing for." + } + }, + "type": "object", + "required": ["invoices"] + }, + "FinancingPushInvoicesRequestInvoice": { + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The invoice ID." + }, + "type": { + "allOf": [{ "$ref": "#/components/schemas/FinancingInvoiceType" }], + "description": "The invoice type." + } + }, + "type": "object", + "required": ["id", "type"] + }, + "FinancingPushInvoicesResponse": { + "properties": { + "connect_token": { + "type": "string", + "description": "A connect token for Kanmon SDK." + }, + "session_token": { + "type": "string", + "description": "An embedded session token for Kanmon SDK." + } + }, + "type": "object", + "required": ["connect_token", "session_token"] + }, + "FinancingTokenResponse": { + "properties": { + "connect_token": { + "type": "string", + "description": "A connect token for Kanmon SDK." + } + }, + "type": "object", + "required": ["connect_token"] + }, "GetAllPaymentReminders": { "properties": { "data": { @@ -39717,7 +43560,12 @@ "maxLength": 100, "description": "A last name of an individual" }, - "ssn_last_4": { "type": "string" }, + "ssn_last_4": { + "type": "string", + "maxLength": 4, + "minLength": 4, + "description": "The last four digits of the individual's Social Security number" + }, "title": { "type": "string", "maxLength": 10, @@ -41468,18 +45316,18 @@ "tag_id": { "type": "string", "format": "uuid", - "description": "Tag identifier that will be assigned to the payable document if one of the words listed in keywords is found during OCR" + "description": "Tag identifier that will be assigned to the payable document if one of the words listed in keywords is found during OCR." }, "keywords": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "minItems": 1, - "description": "A list of words that will be searched for assigning a tag in the recognized fields of the document after OCR processing. If at least one match is found, the tag will be assigned. Each keyword must be between 2 and 25 characters long" + "description": "A list of words that will be searched for assigning a tag in the recognized fields of the document after OCR processing. If at least one match is found, the tag will be assigned. Each keyword must be between 2 and 25 characters long." }, "enabled": { "type": "boolean", - "description": "A switch to temporarily disable a keyword without removing it from the list" + "description": "A switch to temporarily disable a keyword without removing it from the list." } }, "additionalProperties": false, @@ -42442,7 +46290,7 @@ }, "legal_name": { "type": "string", - "maxLength": 100, + "maxLength": 255, "minLength": 1, "description": "A legal name of an organization" }, @@ -42631,7 +46479,7 @@ "legal_name": { "type": "string", "maxLength": 255, - "description": "A legal name of an organization" + "description": "The legal name of the organization." }, "owners_provided": { "type": "boolean" }, "representative_provided": { "type": "boolean" } @@ -42658,9 +46506,9 @@ }, "legal_name": { "type": "string", - "maxLength": 100, + "maxLength": 255, "minLength": 1, - "description": "A legal name of an organization" + "description": "The legal name of the organization. If this organization will use Monite payment rails, this name must be up to 100 characters long, otherwise it can be up to 255 characters long." }, "owners_provided": { "type": "boolean" }, "representative_provided": { "type": "boolean" } @@ -42992,7 +46840,7 @@ }, "payment_priority": { "allOf": [{ "$ref": "#/components/schemas/PaymentPriorityEnum" }], - "description": "Payment preferences for entity to automate calculating suggested payment date basing on payment terms and entity preferences", + "description": "Payment preferences for entity to automate calculating suggested payment date based on payment terms and entity preferences.", "default": "working_capital" }, "allow_purchase_order_autolinking": { @@ -43016,45 +46864,15 @@ }, "quote_signature_required": { "type": "boolean", - "description": "Sets the default behavior of whether a signature is required to accept quotes", + "description": "Sets the default behavior of whether a signature is required to accept quotes.", "default": false }, "generate_paid_invoice_pdf": { "type": "boolean", - "description": "If enabled, the paid invoice's pdf will be in a new layout set by the user", + "description": "If enabled, the paid invoice's PDF will be in a new layout set by the user.", "default": false - } - }, - "additionalProperties": false, - "type": "object" - }, - "PayableActionEnum": { - "type": "string", - "enum": [ - "create", - "read", - "update", - "delete", - "pay", - "approve", - "cancel", - "submit", - "create_from_mail", - "reopen" - ] - }, - "PayableActionSchema": { - "properties": { - "action_name": { - "allOf": [{ "$ref": "#/components/schemas/PayableActionEnum" }], - "description": "Action name", - "default": "read" }, - "permission": { - "allOf": [{ "$ref": "#/components/schemas/PermissionEnum" }], - "description": "Permission type", - "default": "allowed" - } + "accounting": { "$ref": "#/components/schemas/AccountingSettings" } }, "additionalProperties": false, "type": "object" @@ -43098,12 +46916,68 @@ "type": "object", "required": ["count", "status", "sum_total_amount"] }, + "PayableAnalyticsResponse": { + "properties": { + "data": { + "items": { "$ref": "#/components/schemas/AnalyticsDataPoint" }, + "type": "array" + } + }, + "type": "object", + "required": ["data"] + }, "PayableAttachFile": { "properties": { "file": { "type": "string", "format": "binary" } }, "type": "object", "required": ["file"] }, + "PayableCreditNoteData": { + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique identifier of the credit note.", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "document_id": { + "type": "string", + "description": "The credit note's unique document number.", + "example": "CN-123456" + }, + "issued_at": { + "type": "string", + "format": "date", + "description": "The date when the credit note was issued, in the YYYY-MM-DD format", + "example": "2024-01-15" + }, + "status": { + "type": "string", + "maxLength": 30, + "description": "The current status of the credit note in its lifecycle", + "example": "submitted_for_approval" + }, + "total_amount": { + "type": "integer", + "description": "Credit note total amount.", + "example": 1000 + } + }, + "type": "object", + "required": ["id", "status"] + }, "PayableCursorFields": { "type": "string", "enum": ["id", "created_at"] }, + "PayableDimensionEnum": { + "type": "string", + "enum": [ + "created_at", + "status", + "counterpart_id", + "currency", + "issued_at", + "due_date", + "project_id" + ] + }, "PayableEntityAddressSchema": { "properties": { "city": { @@ -43313,6 +47187,7 @@ "required": ["first_name", "last_name"], "description": "A schema contains metadata for an individual" }, + "PayableMetricEnum": { "type": "string", "enum": ["id", "total_amount"] }, "PayableOrganizationSchema": { "properties": { "business_structure": { @@ -43475,13 +47350,18 @@ "format": "uuid", "description": "The ID of the role that the entity user who created this payable had at that time. If the payable was created using a partner access token, the value is `null`." }, + "credit_notes": { + "items": { "$ref": "#/components/schemas/PayableCreditNoteData" }, + "type": "array", + "description": "The list of linked credit notes of the payable." + }, "currency": { "allOf": [{ "$ref": "#/components/schemas/CurrencyEnum" }], "description": "The [currency code](https://docs.monite.com/docs/currencies) of the currency used in the payable.", "example": "EUR" }, "currency_exchange": { - "$ref": "#/components/schemas/CurrencyExchangeSchema" + "$ref": "#/components/schemas/package__payables__v2024_05_25__payables__schemas__CurrencyExchangeSchema" }, "description": { "type": "string", @@ -43628,6 +47508,10 @@ "description": "The total amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.", "example": 1500 }, + "total_amount_with_credit_notes": { + "type": "integer", + "description": "The total price of the payable in [minor units](https://docs.monite.com/docs/currencies#minor-units), excluding all issued credit notes." + }, "was_created_by_user_id": { "type": "string", "format": "uuid" } }, "type": "object", @@ -43635,6 +47519,7 @@ "id", "created_at", "updated_at", + "credit_notes", "entity_id", "payable_origin", "source_of_payable_data", @@ -43642,23 +47527,6 @@ ], "description": "Represents an Accounts Payable document received from a vendor or supplier." }, - "PayableSchema": { - "properties": { - "actions": { - "items": { "$ref": "#/components/schemas/PayableActionSchema" }, - "type": "array", - "description": "List of actions" - }, - "object_type": { - "type": "string", - "enum": ["payable"], - "description": "Object type", - "default": "payable" - } - }, - "additionalProperties": false, - "type": "object" - }, "PayableSettingsPayload": { "properties": { "allow_cancel_duplicates_automatically": { @@ -45359,6 +49227,33 @@ "type": "object", "required": ["currency", "value"] }, + "PricingPlan": { + "properties": { + "advance_rate_percentage": { + "type": "integer", + "description": "Advance rate percentage. 10000 means 100%" + }, + "fee_percentage": { + "type": "integer", + "description": "Transaction fee percentage. 300 means 3.00%" + }, + "repayment_type": { + "allOf": [{ "$ref": "#/components/schemas/WCRepaymentType" }], + "description": "Repayment type of the loan." + }, + "repayment_duration_days": { + "type": "integer", + "description": "This amount of days after which the repayment duration is due. This is only applicable for FIXED_DURATION repayment type" + } + }, + "type": "object", + "required": [ + "advance_rate_percentage", + "fee_percentage", + "repayment_type" + ], + "description": "A pricing plan of a financing offer" + }, "ProcessResource": { "properties": { "id": { "type": "string", "format": "uuid" }, @@ -45825,7 +49720,11 @@ "recipient": { "$ref": "#/components/schemas/RecipientAccountResponse" }, - "return_url": { "type": "string" }, + "return_url": { + "type": "string", + "description": "The URL where to redirect the payer after the payment. If `return_url` is specified, then after the payment is completed the payment page will display the \"Return to platform\" link that navigates to this URL.", + "example": "https://pay.example.com/complete" + }, "status": { "type": "string" } }, "type": "object", @@ -47009,6 +50908,11 @@ "type": "object", "required": ["based_on", "type"] }, + "ReceivableCreatedEventData": { + "properties": {}, + "additionalProperties": false, + "type": "object" + }, "ReceivableCursorFields": { "type": "string", "enum": [ @@ -47613,10 +51517,13 @@ "type": "string", "enum": [ "status_changed", + "receivable_created", "receivable_updated", "based_on_receivable_created", "payment_received", - "mail_sent" + "mail_sent", + "payment_reminder_mail_sent", + "overdue_reminder_mail_sent" ] }, "ReceivableHistoryPaginationResponse": { @@ -47659,11 +51566,13 @@ "anyOf": [ { "$ref": "#/components/schemas/StatusChangedEventData" }, { "$ref": "#/components/schemas/ReceivableUpdatedEventData" }, + { "$ref": "#/components/schemas/ReceivableCreatedEventData" }, { "$ref": "#/components/schemas/BasedOnReceivableCreatedEventData" }, { "$ref": "#/components/schemas/PaymentReceivedEventData" }, - { "$ref": "#/components/schemas/MailSentEventData" } + { "$ref": "#/components/schemas/MailSentEventData" }, + { "$ref": "#/components/schemas/ReminderMailSentEventData" } ], "description": "Payload of the event." }, @@ -48339,6 +52248,21 @@ "type": "object", "required": ["body", "days_before", "subject"] }, + "ReminderMailSentEventData": { + "properties": { + "mail_id": { "type": "string", "format": "uuid" }, + "mail_status": { + "$ref": "#/components/schemas/ReceivableMailStatusEnum" + }, + "recipients": { + "$ref": "#/components/schemas/ReceivableMailRecipients" + }, + "term": { "$ref": "#/components/schemas/ReminderTypeEnum" } + }, + "additionalProperties": false, + "type": "object", + "required": ["mail_id", "mail_status", "recipients", "term"] + }, "ReminderTypeEnum": { "type": "string", "enum": ["term_1", "term_2", "term_final", "overdue"] @@ -48347,6 +52271,34 @@ "properties": { "enabled": { "type": "boolean", "default": true } }, "type": "object" }, + "RepaymentSchedule": { + "properties": { + "repayment_date": { + "type": "string", + "description": "Repayment date in ISO 8601 format" + }, + "repayment_amount": { + "type": "integer", + "description": "Repayment amount in minor units" + }, + "repayment_fee_amount": { + "type": "integer", + "description": "Repayment fee amount in minor units" + }, + "repayment_principal_amount": { + "type": "integer", + "description": "Repayment principal amount in minor units" + } + }, + "type": "object", + "required": [ + "repayment_date", + "repayment_amount", + "repayment_fee_amount", + "repayment_principal_amount" + ], + "description": "Repayment schedule model" + }, "RequestResendInvite": { "properties": { "email": { "type": "string", "format": "email" }, @@ -48415,13 +52367,13 @@ "type": "array", "description": "array of records" }, - "next_pagination_token": { - "type": "string", - "description": "A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page)." - }, "prev_pagination_token": { - "type": "string", + "anyOf": [{ "type": "string" }, { "type": "null" }], "description": "A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page)." + }, + "next_pagination_token": { + "anyOf": [{ "type": "string" }, { "type": "null" }], + "description": "A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page)." } }, "additionalProperties": false, @@ -48435,38 +52387,38 @@ "format": "uuid", "description": "UUID role ID" }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "UTC datetime" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "description": "UTC datetime" - }, "name": { "type": "string", "minLength": 1, "description": "Role name" }, "permissions": { - "allOf": [{ "$ref": "#/components/schemas/BizObjectsSchema" }], + "$ref": "#/components/schemas/BizObjectsSchema-Output", "description": "Access permissions" }, "status": { - "allOf": [{ "$ref": "#/components/schemas/StatusEnum" }], + "$ref": "#/components/schemas/StatusEnum", "description": "record status, 'active' by default" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "UTC datetime" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "UTC datetime" } }, "type": "object", "required": [ "id", - "created_at", - "updated_at", "name", "permissions", - "status" + "status", + "created_at", + "updated_at" ] }, "RolesCreatePayload": { @@ -48514,45 +52466,6 @@ "additionalProperties": false, "type": "object" }, - "RootSchema": { - "oneOf": [ - { "$ref": "#/components/schemas/CommonSchema" }, - { "$ref": "#/components/schemas/PayableSchema" } - ], - "additionalProperties": false, - "discriminator": { - "propertyName": "object_type", - "mapping": { - "person": "#/components/schemas/CommonSchema", - "onboarding": "#/components/schemas/CommonSchema", - "comment": "#/components/schemas/CommonSchema", - "counterpart": "#/components/schemas/CommonSchema", - "entity_user": "#/components/schemas/CommonSchema", - "entity": "#/components/schemas/CommonSchema", - "entity_vat_ids": "#/components/schemas/CommonSchema", - "counterpart_vat_id": "#/components/schemas/CommonSchema", - "entity_bank_account": "#/components/schemas/CommonSchema", - "export": "#/components/schemas/CommonSchema", - "payables_purchase_order": "#/components/schemas/CommonSchema", - "payment_reminder": "#/components/schemas/CommonSchema", - "overdue_reminder": "#/components/schemas/CommonSchema", - "product": "#/components/schemas/CommonSchema", - "project": "#/components/schemas/CommonSchema", - "receivable": "#/components/schemas/CommonSchema", - "reconciliation": "#/components/schemas/CommonSchema", - "role": "#/components/schemas/CommonSchema", - "tag": "#/components/schemas/CommonSchema", - "todo_task": "#/components/schemas/CommonSchema", - "todo_task_mute": "#/components/schemas/CommonSchema", - "transaction": "#/components/schemas/CommonSchema", - "workflow": "#/components/schemas/CommonSchema", - "approval_request": "#/components/schemas/CommonSchema", - "approval_policy": "#/components/schemas/CommonSchema", - "payment_record": "#/components/schemas/CommonSchema", - "payable": "#/components/schemas/PayableSchema" - } - } - }, "SecretRequest": { "properties": { "name": { "type": "string" }, @@ -48598,7 +52511,7 @@ }, "payment_priority": { "allOf": [{ "$ref": "#/components/schemas/PaymentPriorityEnum" }], - "description": "Payment preferences for entity to automate calculating suggested payment date basing on payment terms and entity preferences", + "description": "Payment preferences for entity to automate calculating suggested payment date based on payment terms and entity preferences.", "default": "working_capital" }, "allow_purchase_order_autolinking": { @@ -48622,14 +52535,15 @@ }, "quote_signature_required": { "type": "boolean", - "description": "Sets the default behavior of whether a signature is required to accept quotes", + "description": "Sets the default behavior of whether a signature is required to accept quotes.", "default": false }, "generate_paid_invoice_pdf": { "type": "boolean", - "description": "If enabled, the paid invoice's pdf will be in a new layout set by the user", + "description": "If enabled, the paid invoice's PDF will be in a new layout set by the user.", "default": false - } + }, + "accounting": { "$ref": "#/components/schemas/AccountingSettings" } }, "type": "object" }, @@ -50081,13 +53995,17 @@ "UpdateRoleRequest": { "properties": { "name": { - "type": "string", - "maxLength": 255, - "minLength": 1, + "anyOf": [ + { "type": "string", "maxLength": 255, "minLength": 1 }, + { "type": "null" } + ], "description": "Role name" }, "permissions": { - "allOf": [{ "$ref": "#/components/schemas/BizObjectsSchema" }], + "anyOf": [ + { "$ref": "#/components/schemas/BizObjectsSchema-Input" }, + { "type": "null" } + ], "description": "Access permissions" } }, @@ -50471,12 +54389,44 @@ "format": "uuid", "description": "Entry UUID" }, - "domain": { "type": "string" }, + "domain": { + "type": "string", + "format": "hostname", + "description": "The domain name." + }, "status": { "type": "string" } }, "type": "object", "required": ["id", "domain", "status"] }, + "WCBusinessStatus": { + "type": "string", + "enum": ["NEW", "INPUT_REQUIRED", "ONBOARDED"], + "description": "- NEW: A business has been created within Kanmon\n- ONBOARDED: A business has completed all of the onboarding steps within Kanmon and is now awaiting underwriting.\n- INPUT_REQUIRED: A business will be asked to provide required data" + }, + "WCInvoiceStatus": { + "type": "string", + "enum": ["NEW", "FUNDED", "PAID", "LATE", "REJECTED", "DEFAULTED"], + "description": "- NEW: The business has submitted an invoice and it is under review.\n- FUNDED: The funds for the invoice have been disbursed. The business is now expected to pay back the funds.\n- PAID: A payment was made that fully paid off an outstanding invoice.\n- LATE: A payment was not made towards an outstanding invoice.\n- REJECTED: An invoice was rejected during the funding step.\n- DEFAULTED: A payment was not made towards an outstanding invoice." + }, + "WCOfferStatus": { + "type": "string", + "enum": [ + "NEW", + "ACCEPTED", + "EXPIRED", + "CURRENT", + "LATE", + "CLOSED", + "DEFAULTED" + ], + "description": "- NEW: A new offer has been extended to the business.\n- ACCEPTED: Business has accepted an offer and is waiting on the closing process.\n- EXPIRED: Business has not accepted the offer, and the offer has expired.\n- CURRENT: A loan has been originated and does not currently have any outstanding delayed payments.\n- LATE: One or more repayments on the issued product have failed.\n- CLOSED: The issued product is no longer available to the business.\n- DEFAULTED: The business has failed to meet agreed-upon terms of the loan agreement." + }, + "WCRepaymentType": { + "type": "string", + "enum": ["MULTIPLE_DURATION", "FIXED_DURATION", "FIXED_DATE"], + "description": "- MULTIPLE_DURATION: The business can repay the loan over multiple durations.\n- FIXED_DURATION: The business must repay the loan over a fixed duration.\n- FIXED_DATE: The business must repay the loan on a fixed date." + }, "WebhookDeliveryCursorFields": { "type": "string", "enum": ["created_at", "updated_at"] @@ -50524,9 +54474,11 @@ "type": "string", "enum": [ "account", + "accounting_connection", "approval", "approval_request", "approval_policy", + "approval_policy_process", "batch_payment", "comment", "counterpart", @@ -50540,26 +54492,25 @@ "entity_settings", "entity_user", "export", + "overdue_reminder", "partner_settings", "payable", + "payables_credit_note", "payables_purchase_order", "payable.line_item", "payment", "payment_intent", "payment_link", + "payment_reminder", "product", + "project", "receivable", "recurrence", "role", "tag", "todo_task", "workflow", - "workflow_pipeline", - "overdue_reminder", - "payment_reminder", - "accounting_connection", - "project", - "approval_policy_process" + "workflow_pipeline" ] }, "WebhookSubscriptionCursorFields": { @@ -50922,7 +54873,7 @@ "created_at": { "type": "string", "format": "date-time", - "description": "UTC date and time when this workflow was uploaded to Monite. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format." + "description": "UTC date and time when this file was uploaded to Monite. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format." }, "file_type": { "type": "string", @@ -51047,6 +54998,26 @@ "type": "object", "required": ["height", "url", "width"], "description": "A preview image generated for a file." + }, + "package__payables__v2024_05_25__credit_notes__schemas__CurrencyExchangeSchema": { + "properties": { + "default_currency_code": { "type": "string" }, + "rate": { "type": "number", "exclusiveMinimum": true }, + "total": { "type": "number" } + }, + "additionalProperties": false, + "type": "object", + "required": ["default_currency_code", "rate", "total"] + }, + "package__payables__v2024_05_25__payables__schemas__CurrencyExchangeSchema": { + "properties": { + "default_currency_code": { "type": "string" }, + "rate": { "type": "number", "exclusiveMinimum": true }, + "total": { "type": "number" } + }, + "additionalProperties": false, + "type": "object", + "required": ["default_currency_code", "rate", "total"] } }, "securitySchemes": { "HTTPBearer": { "type": "http", "scheme": "bearer" } } @@ -51057,6 +55028,7 @@ { "name": "Accounting data pull" }, { "name": "Accounting synchronized records" }, { "name": "Accounting tax rates" }, + { "name": "Analytics" }, { "name": "Approval policies" }, { "name": "Approval requests" }, { "name": "Audit logs" }, @@ -51069,6 +55041,7 @@ { "name": "Counterpart bank accounts" }, { "name": "Counterpart contacts" }, { "name": "Counterparts" }, + { "name": "Credit Notes" }, { "name": "Currencies internal" }, { "name": "Data export" }, { "name": "Data export - extra data" }, @@ -51082,6 +55055,7 @@ { "name": "Entity users" }, { "name": "Events" }, { "name": "Files" }, + { "name": "Financing" }, { "name": "Internal" }, { "name": "Ledger accounts" }, { "name": "Mail templates" }, diff --git a/packages/sdk-react/src/core/queries/useFinancing.ts b/packages/sdk-react/src/core/queries/useFinancing.ts new file mode 100644 index 000000000..dee9c88bd --- /dev/null +++ b/packages/sdk-react/src/core/queries/useFinancing.ts @@ -0,0 +1,152 @@ +import { useEffect, useState } from 'react'; +import useScript from 'react-script-hook'; + +import { Services } from '@/api'; + +import { useMoniteContext } from '../context/MoniteContext'; +import { useMyEntity } from './useMe'; + +export const useGetFinancedInvoices = ( + query: Services['financingInvoices']['getFinancingInvoices']['types']['parameters']['query'], + enabled = true +) => { + const { api } = useMoniteContext(); + + return api.financingInvoices.getFinancingInvoices.useQuery( + { + query, + }, + { enabled } + ); +}; + +export const useFinanceAnInvoice = () => { + const { api } = useMoniteContext(); + + return api.financingInvoices.postFinancingInvoices.useMutation( + {}, + { + onError: () => {}, + } + ); +}; + +export const useGetFinancingConnectToken = () => { + const { api } = useMoniteContext(); + + return api.financingTokens.postFinancingTokens.useMutation( + {}, + { + onError: () => {}, + } + ); +}; + +export const useGetFinanceOffers = () => { + const { api } = useMoniteContext(); + + return api.financingOffers.getFinancingOffers.useQuery(); +}; + +const KANMON_CONNECT_SCRIPT_URL = `https://cdn.sandbox.kanmon.dev/scripts/v2/kanmon-connect.js`; + +type startFinanceSessionOptions = { + sessionToken?: string; + component?: string; +}; + +declare global { + interface Window { + KANMON_CONNECT: + | { + start: (options: { + connectToken: string; + onEvent: (event: { + eventType: string; + data: { actionMessage: string; actionRequired: boolean }; + }) => void; + }) => void; + show: (options?: startFinanceSessionOptions) => void; + stop: () => void; + } + | undefined; + } +} + +export const useFinancing = () => { + const [displayButtonMessage, setDisplayButtonMessage] = useState(''); + const [actionRequired, setActionRequired] = useState(false); + const getConnectToken = useGetFinancingConnectToken(); + const { isUSEntity, isLoading: isUSEntityLoading } = useMyEntity(); + + const [scriptLoading] = useScript({ + src: KANMON_CONNECT_SCRIPT_URL, + }); + const [isInitializing, setIsInitializing] = useState(false); + const [isFetchingConnectToken, setIsFetchingConnectToken] = useState(true); + + const startFinanceSession = ({ + sessionToken, + component, + }: startFinanceSessionOptions = {}) => { + window?.KANMON_CONNECT?.show({ sessionToken, component }); + }; + + const initialiseFinanceSdk = ({ connectToken }: { connectToken: string }) => { + setIsInitializing(true); + window?.KANMON_CONNECT?.start({ + connectToken, + onEvent: (event) => { + switch (event.eventType) { + case 'USER_STATE_CHANGED': + setIsInitializing(false); + setDisplayButtonMessage(event.data.actionMessage); + setActionRequired(event.data.actionRequired); + break; + default: + setIsInitializing(false); + } + }, + }); + }; + + const stopFinanceSession = () => { + window?.KANMON_CONNECT?.stop(); + }; + + useEffect(() => { + const setupFinanceSdkConnection = async () => { + try { + if (scriptLoading || !isUSEntity) { + return; + } + const response = await getConnectToken.mutateAsync(); + + initialiseFinanceSdk({ connectToken: response.connect_token }); + } catch { + // Intentionally left empty + } finally { + setIsFetchingConnectToken(false); + } + }; + + setupFinanceSdkConnection(); + + return () => { + stopFinanceSession(); + }; + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [scriptLoading, isUSEntity]); // Escaped the eslint rule to avoid unnecessary dependencies from causing the hook to re-run + + const isLoading = isFetchingConnectToken || isUSEntityLoading; + const isEnabled = isUSEntity; + + return { + displayButtonMessage, + actionRequired, + startFinanceSession, + isInitializing, + isLoading, + isEnabled, + }; +}; diff --git a/packages/sdk-react/src/core/queries/useMe.ts b/packages/sdk-react/src/core/queries/useMe.ts index 10ff88e36..648c8a7f1 100644 --- a/packages/sdk-react/src/core/queries/useMe.ts +++ b/packages/sdk-react/src/core/queries/useMe.ts @@ -46,12 +46,17 @@ export const useMyEntity = () => { VAT_SUPPORTED_COUNTRIES.includes(queryProps.data?.address.country) ); + const isUSEntity = Boolean( + queryProps.data?.address && queryProps.data?.address.country === 'US' + ); + const entityName = getEntityName(queryProps.data); return { ...queryProps, entityName, isNonVatSupported: !isVatSupported, + isUSEntity, }; }; diff --git a/yarn.lock b/yarn.lock index 596f57658..ffd85b6ba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5015,6 +5015,7 @@ __metadata: react-infinite-scroll-component: "npm:~6.1.0" react-international-phone: "npm:~4.2.4" react-router-dom: "npm:^6.3.0" + react-script-hook: "npm:~1.7.2" react-select-event: "npm:~5.5.1" react-use: "npm:^17.3.2" react-virtuoso: "npm:~4.7.10" @@ -21367,6 +21368,16 @@ __metadata: languageName: node linkType: hard +"react-script-hook@npm:~1.7.2": + version: 1.7.2 + resolution: "react-script-hook@npm:1.7.2" + peerDependencies: + react: ^16.8.6 || 17 - 18 + react-dom: ^16.8.6 || 17 - 18 + checksum: 10/a9ed431997fa9df629bd3ec51302141173d8d1d77fa561127fa8fee088769af9af25f14b7e655715e3c9ee9b5fc161dfab413706d9ddbb72c577021959654482 + languageName: node + linkType: hard + "react-select-event@npm:~5.5.1": version: 5.5.1 resolution: "react-select-event@npm:5.5.1" From 88691dd4dcbf5b653985e8ce6de225893c50e5a2 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Fri, 6 Dec 2024 12:18:10 +0000 Subject: [PATCH 02/49] docs(changeset): feat(DEV-13428): add wrapper for finance faq --- .changeset/kind-impalas-give.md | 5 ++ .../FinanceFaq/FinanceFaqDetails.tsx | 76 +++++++++++++++++++ .../FinanceFaq/FinanceFaqWrapper.tsx | 31 ++++++++ .../src/core/i18n/locales/en/messages.po | 18 +++++ 4 files changed, 130 insertions(+) create mode 100644 .changeset/kind-impalas-give.md create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceFaq/FinanceFaqWrapper.tsx diff --git a/.changeset/kind-impalas-give.md b/.changeset/kind-impalas-give.md new file mode 100644 index 000000000..b9a4e7881 --- /dev/null +++ b/.changeset/kind-impalas-give.md @@ -0,0 +1,5 @@ +--- +'@monite/sdk-react': patch +--- + +feat(DEV-13428): add wrapper for finance faq diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx new file mode 100644 index 000000000..c5ae9abc1 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx @@ -0,0 +1,76 @@ +import { t } from '@lingui/macro'; +import { useLingui } from '@lingui/react'; +import { Box, Typography } from '@mui/material'; + +const faqs = [ + { + id: 1, + // eslint-disable-next-line lingui/no-unlocalized-strings + question: 'Does enrolling in the program affect my credit score?', + answer: + // eslint-disable-next-line lingui/no-unlocalized-strings + 'Nope! During the onboarding process we will only conduct a soft pull on your credit report, which will not affect your personal credit score.', + }, + { + id: 2, + // eslint-disable-next-line lingui/no-unlocalized-strings + question: 'Why do I need to provide my bank connection details?', + answer: + // eslint-disable-next-line lingui/no-unlocalized-strings + 'Securely connecting your business bank account allows us to review your cashflow and determine your best loan offers.', + }, + { + id: 3, + // eslint-disable-next-line lingui/no-unlocalized-strings + question: 'When should I expect to receive a loan offer?', + answer: + // eslint-disable-next-line lingui/no-unlocalized-strings + 'Once you are enrolled into the program, we will be actively analyzing your financials and creating pre-approved offers that work best for your business needs. We do this to help you avoid debt trap. Loan offers are usually provided within less than 48 hours.', + }, + { + id: 4, + // eslint-disable-next-line lingui/no-unlocalized-strings + question: 'How do I repay the loan?', + answer: + // eslint-disable-next-line lingui/no-unlocalized-strings + 'At the moment we support monthly loan repayment once you agree to the loan payment schedule. A fixed amount will be automatically deducted from the bank you linked during the onboarding.In the near future, you can also choose to pay back the loan as a fixed percentage of your daily sales until the loan is fully repaid.', + }, +]; + +export const FinanceFaqDetails = () => { + const { i18n } = useLingui(); + return ( + <Box p={4}> + <Box> + <Typography variant="h3"> + {t(i18n)`Simplified, fast funding for your growing business`} + </Typography> + <Typography variant="subtitle2" mt={2}> + {t( + i18n + )`Get your business moving and accelerate growth with quick and easy access to funding. Multiple options available.`} + </Typography> + </Box> + <Box mt={5}> + <Typography mb={1} variant="h3">{t(i18n)`FAQ`}</Typography> + {faqs.map((faq) => ( + <Box key={faq.id} mt={3}> + <Typography variant="subtitle2">{t( + i18n + )`${faq.question}`}</Typography> + <Typography variant="body1" mt={1}> + {t(i18n)`${faq.answer}`} + </Typography> + </Box> + ))} + </Box> + <Box mt={5}> + <Typography variant="body2"> + {t( + i18n + )`All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon here.`} + </Typography> + </Box> + </Box> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceFaq/FinanceFaqWrapper.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceFaq/FinanceFaqWrapper.tsx new file mode 100644 index 000000000..ecc77937f --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceFaq/FinanceFaqWrapper.tsx @@ -0,0 +1,31 @@ +import { useState } from 'react'; + +import { Dialog } from '@/components/Dialog'; + +import { FinanceFaqDetails } from './FinanceFaqDetails'; + +export const FinanceFaqWrapper = ({ + children, +}: { + children: ({ openModal }: { openModal: () => void }) => React.ReactNode; +}) => { + const [dialogIsOpen, setDialogIsOpen] = useState(false); + + const openModal = () => { + setDialogIsOpen(true); + }; + + return ( + <> + {children({ openModal })} + + <Dialog + open={dialogIsOpen} + onClose={() => setDialogIsOpen(false)} + alignDialog="right" + > + <FinanceFaqDetails /> + </Dialog> + </> + ); +}; diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index 2a4af2a28..96f75c4c4 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -67,6 +67,8 @@ msgstr "{0, select, credit_note {Credit Note has been sent} invoice {Invoice has #: src/components/onboarding/OnboardingBankAccount/OnboardingBankAccount.tsx:81 #: src/components/onboarding/OnboardingPersonsReview/OnboardingAddressView/OnboardingAddressView.tsx:20 +#: src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx:58 +#: src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx:62 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:64 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/InvoiceRecurrenceCancelModal.tsx:89 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/ReceivableRecurrence/InvoiceRecurrenceDetails.tsx:37 @@ -478,6 +480,10 @@ msgstr "All invoices" msgid "All items" msgstr "All items" +#: src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx:69 +msgid "All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon here." +msgstr "All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon here." + #: src/components/receivables/ReceivableFilters/ReceivableFilters.tsx:89 msgid "All statuses" msgstr "All statuses" @@ -3026,6 +3032,10 @@ msgstr "Falkland Islands (Malvinas)" msgid "Family Clothing Stores" msgstr "Family Clothing Stores" +#: src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx:55 +msgid "FAQ" +msgstr "FAQ" + #: src/core/utils/countries.ts:89 msgid "Faroe Islands" msgstr "Faroe Islands" @@ -3254,6 +3264,10 @@ msgstr "Germany" #~ msgid "Germany Frankfurt am Main" #~ msgstr "Germany Frankfurt am Main" +#: src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx:49 +msgid "Get your business moving and accelerate growth with quick and easy access to funding. Multiple options available." +msgstr "Get your business moving and accelerate growth with quick and easy access to funding. Multiple options available." + #: src/core/utils/countries.ts:100 msgid "Ghana" msgstr "Ghana" @@ -6158,6 +6172,10 @@ msgstr "Sierra Leone" msgid "Sierra Leonean Leone" msgstr "Sierra Leonean Leone" +#: src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx:46 +msgid "Simplified, fast funding for your growing business" +msgstr "Simplified, fast funding for your growing business" + #: src/core/utils/countries.ts:214 msgid "Singapore" msgstr "Singapore" From 66e853abb1b30862cf35fd1292686f1a724bb4d7 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Fri, 6 Dec 2024 12:33:18 +0000 Subject: [PATCH 03/49] docs(changeset): feat(DEV-13399): add integrations page and finance application card --- .changeset/hungry-snakes-provide.md | 6 + .changeset/shy-otters-perform.md | 6 + packages/sdk-demo/src/apps/Base/Base.tsx | 9 ++ packages/sdk-demo/src/apps/Base/consts.ts | 1 + .../sdk-demo/src/components/Menu/consts.tsx | 5 + packages/sdk-demo/src/locales/en/messages.po | 4 + packages/sdk-react/src/components/index.ts | 1 + .../integrations/Integrations.stories.tsx | 30 +++++ .../components/integrations/Integrations.tsx | 33 ++++++ .../src/components/integrations/index.ts | 1 + .../FinanceApplicationCard.stories.tsx | 34 ++++++ .../FinanceApplicationCard.tsx | 108 ++++++++++++++++++ .../FinanceApplicationCard/index.tsx | 1 + .../src/core/i18n/locales/en/messages.po | 24 ++++ 14 files changed, 263 insertions(+) create mode 100644 .changeset/hungry-snakes-provide.md create mode 100644 .changeset/shy-otters-perform.md create mode 100644 packages/sdk-react/src/components/integrations/Integrations.stories.tsx create mode 100644 packages/sdk-react/src/components/integrations/Integrations.tsx create mode 100755 packages/sdk-react/src/components/integrations/index.ts create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.stories.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/index.tsx diff --git a/.changeset/hungry-snakes-provide.md b/.changeset/hungry-snakes-provide.md new file mode 100644 index 000000000..5813fe7ce --- /dev/null +++ b/.changeset/hungry-snakes-provide.md @@ -0,0 +1,6 @@ +--- +'@monite/sdk-react': patch +'@team-monite/sdk-demo': patch +--- + +feat(DEV-13399): add integrations page and finance application card diff --git a/.changeset/shy-otters-perform.md b/.changeset/shy-otters-perform.md new file mode 100644 index 000000000..68af823db --- /dev/null +++ b/.changeset/shy-otters-perform.md @@ -0,0 +1,6 @@ +--- +'@monite/sdk-react': minor +'@team-monite/sdk-demo': minor +--- + +feat(DEV-13399): add integrations page and finance application card diff --git a/packages/sdk-demo/src/apps/Base/Base.tsx b/packages/sdk-demo/src/apps/Base/Base.tsx index 74440f624..bed58d113 100644 --- a/packages/sdk-demo/src/apps/Base/Base.tsx +++ b/packages/sdk-demo/src/apps/Base/Base.tsx @@ -9,6 +9,7 @@ import { Products, Tags, Onboarding, + Integrations, RolesAndApprovalPolicies, } from '@monite/sdk-react'; import { Box } from '@mui/material'; @@ -94,6 +95,14 @@ export const Base = () => { } /> <Route path={ROUTES.onboarding} element={<Onboarding />} /> + <Route + path={ROUTES.integrations} + element={ + <Gutter> + <Integrations /> + </Gutter> + } + /> <Route path="*" element={<Navigate to={ROUTES.counterparts} />} /> </Routes> ); diff --git a/packages/sdk-demo/src/apps/Base/consts.ts b/packages/sdk-demo/src/apps/Base/consts.ts index d86eb3c1f..189be2630 100644 --- a/packages/sdk-demo/src/apps/Base/consts.ts +++ b/packages/sdk-demo/src/apps/Base/consts.ts @@ -9,5 +9,6 @@ export const ROUTES = { receivables: '/receivables', products: '/products', onboarding: '/onboarding', + integrations: '/integrations', rolesApprovals: '/settings/roles-approvals', }; diff --git a/packages/sdk-demo/src/components/Menu/consts.tsx b/packages/sdk-demo/src/components/Menu/consts.tsx index fe5c53acd..fa6152108 100644 --- a/packages/sdk-demo/src/components/Menu/consts.tsx +++ b/packages/sdk-demo/src/components/Menu/consts.tsx @@ -62,6 +62,11 @@ export const getNavigationData = ( url: ROUTES.onboarding, renderIcon: (props) => <LabelIcon {...props} />, }, + integrations: { + label: t(i18n)`Integrations`, + url: ROUTES.integrations, + renderIcon: (props) => <LabelIcon {...props} />, + }, }, }, }); diff --git a/packages/sdk-demo/src/locales/en/messages.po b/packages/sdk-demo/src/locales/en/messages.po index 6abea6b1f..bf36aaff4 100644 --- a/packages/sdk-demo/src/locales/en/messages.po +++ b/packages/sdk-demo/src/locales/en/messages.po @@ -35,6 +35,10 @@ msgstr "Entity User ID" msgid "Error: <0>{0}</0>" msgstr "Error: <0>{0}</0>" +#: src/components/Menu/consts.tsx:66 +msgid "Integrations" +msgstr "Integrations" + #: src/components/LoginForm/LoginForm.tsx:128 msgid "Login" msgstr "Login" diff --git a/packages/sdk-react/src/components/index.ts b/packages/sdk-react/src/components/index.ts index 010651ee7..9a99eb065 100644 --- a/packages/sdk-react/src/components/index.ts +++ b/packages/sdk-react/src/components/index.ts @@ -9,3 +9,4 @@ export * from './tags'; export * from './userRoles'; export * from './PageHeader'; export * from './Dialog'; +export * from './integrations'; diff --git a/packages/sdk-react/src/components/integrations/Integrations.stories.tsx b/packages/sdk-react/src/components/integrations/Integrations.stories.tsx new file mode 100644 index 000000000..3efab0770 --- /dev/null +++ b/packages/sdk-react/src/components/integrations/Integrations.stories.tsx @@ -0,0 +1,30 @@ +import { css } from '@emotion/react'; +import { StoryObj } from '@storybook/react'; + +import { Integrations as IntegrationsComponent } from './Integrations'; + +const Story = { + title: 'Integrations', + component: IntegrationsComponent, +}; + +type Story = StoryObj<typeof IntegrationsComponent>; + +export const Integrations: Story = { + args: {}, + render: () => ( + <div + css={css` + box-sizing: border-box; + display: flex; + flex-direction: column; + height: 100vh; + padding: 20px; + `} + > + <IntegrationsComponent /> + </div> + ), +}; + +export default Story; diff --git a/packages/sdk-react/src/components/integrations/Integrations.tsx b/packages/sdk-react/src/components/integrations/Integrations.tsx new file mode 100644 index 000000000..664ef0f7d --- /dev/null +++ b/packages/sdk-react/src/components/integrations/Integrations.tsx @@ -0,0 +1,33 @@ +import { MoniteScopedProviders } from '@/core/context/MoniteScopedProviders'; +import { t } from '@lingui/macro'; +import { useLingui } from '@lingui/react'; +import { Box } from '@mui/material'; + +import { PageHeader } from '../PageHeader'; +import { FinanceApplicationCard } from '../receivables/Financing/FinanceApplicationCard/FinanceApplicationCard'; + +export function Integrations() { + return ( + <MoniteScopedProviders> + <IntegrationsComponent /> + </MoniteScopedProviders> + ); +} + +function IntegrationsComponent() { + const { i18n } = useLingui(); + return ( + <Box> + <PageHeader title={<>{t(i18n)`Integrations`}</>} /> + <Box + sx={{ + display: 'grid', + gridTemplateColumns: 'minmax(360px, 480px) minmax(360px, 480px)', + gap: 2, + }} + > + <FinanceApplicationCard /> + </Box> + </Box> + ); +} diff --git a/packages/sdk-react/src/components/integrations/index.ts b/packages/sdk-react/src/components/integrations/index.ts new file mode 100755 index 000000000..4b7e7c78b --- /dev/null +++ b/packages/sdk-react/src/components/integrations/index.ts @@ -0,0 +1 @@ +export * from './Integrations'; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.stories.tsx new file mode 100644 index 000000000..f49c1b375 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.stories.tsx @@ -0,0 +1,34 @@ +import { MemoryRouter } from 'react-router-dom'; + +import { css } from '@emotion/react'; +import { StoryObj } from '@storybook/react'; + +import { FinanceApplicationCard as FinanceApplicationCardComponent } from './FinanceApplicationCard'; + +const Story = { + title: 'Financing/FinanceApplicationCard', + component: FinanceApplicationCardComponent, +}; + +type Story = StoryObj<typeof FinanceApplicationCardComponent>; + +export const FinanceApplicationCard: Story = { + args: {}, + render: () => ( + <div + css={css` + box-sizing: border-box; + display: flex; + flex-direction: column; + height: 100vh; + padding: 20px; + `} + > + <MemoryRouter> + <FinanceApplicationCardComponent /> + </MemoryRouter> + </div> + ), +}; + +export default Story; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx new file mode 100644 index 000000000..7c94ce24d --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx @@ -0,0 +1,108 @@ +import { useFinancing } from '@/core/queries/useFinancing'; +import { useTheme } from '@emotion/react'; +import { t } from '@lingui/macro'; +import { useLingui } from '@lingui/react'; +import { + Box, + Button, + CircularProgress, + lighten, + Skeleton, + Stack, + Typography, +} from '@mui/material'; + +import { MoneyIcon } from '../infographics/MoneyIcon'; +import { FinanceFaqWrapper } from './FinanceFaq/FinanceFaqWrapper'; + +export const FinanceApplicationCard = () => { + const { i18n } = useLingui(); + const theme = useTheme(); + + const { + displayButtonMessage, + actionRequired, + startFinanceSession, + isInitializing, + isLoading, + isEnabled, + } = useFinancing(); + + if (isLoading) { + return <CircularProgress color="inherit" size={20} />; + } + + if (!isEnabled) { + return ( + <Stack + gap={3} + sx={{ border: '1px solid', borderColor: 'divider' }} + borderRadius={3} + p={3} + > + <Typography variant="body1"> + {t(i18n)`Financing is currently only available for US entities`} + </Typography> + </Stack> + ); + } + + return ( + <Stack + gap={3} + sx={{ border: '1px solid', borderColor: 'divider' }} + borderRadius={3} + p={3} + > + <Box> + <Box + sx={{ + backgroundColor: lighten(theme.palette.primary.main, 0.9), + borderRadius: '100%', + width: '40px', + height: '40px', + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + p: 2, + }} + > + <MoneyIcon /> + </Box> + </Box> + <Stack gap={1}> + <Typography variant="subtitle1">{t( + i18n + )`Invoice financing`}</Typography> + <Typography variant="body1"> + {t( + i18n + )`Apply for a monthly plan loans to manage your business more efficiently`} + </Typography> + </Stack> + <Stack direction="row" gap={1} alignItems="center"> + {isInitializing ? ( + <Skeleton variant="rounded" width="140px" height="32px" /> + ) : ( + displayButtonMessage && ( + <Button + disabled={!actionRequired} + onClick={() => { + startFinanceSession(); + }} + variant="outlined" + >{t(i18n)`${displayButtonMessage}`}</Button> + ) + )} + + <FinanceFaqWrapper> + {({ openModal }) => ( + <Button onClick={openModal} variant="text">{t( + i18n + )`Read more`}</Button> + )} + </FinanceFaqWrapper> + </Stack> + </Stack> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/index.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/index.tsx new file mode 100644 index 000000000..f197f0594 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/index.tsx @@ -0,0 +1 @@ +export * from './FinanceApplicationCard'; diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index 2a4af2a28..e775a437d 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -120,6 +120,10 @@ msgstr "{days_before} {day_plural} till overdue" msgid "{days, plural, one {day} two {days} few {days} many {days} zero {days} other {days}}" msgstr "{days, plural, one {day} two {days} few {days} many {days} zero {days} other {days}}" +#: src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx:94 +msgid "{displayButtonMessage}" +msgstr "{displayButtonMessage}" + #: src/ui/DueDateCell/DueDateCell.tsx:45 msgid "{overdueDays} {0} overdue" msgstr "{overdueDays} {0} overdue" @@ -610,6 +614,10 @@ msgstr "Any user with role" msgid "Applied policy" msgstr "Applied policy" +#: src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx:78 +msgid "Apply for a monthly plan loans to manage your business more efficiently" +msgstr "Apply for a monthly plan loans to manage your business more efficiently" + #: src/components/approvalPolicies/ApprovalPoliciesTable/ApprovalPoliciesTable.test.tsx:69 #: src/components/approvalPolicies/useApprovalPolicyScript.tsx:193 msgid "Approval chain" @@ -3066,6 +3074,10 @@ msgstr "File successfully attached" msgid "Financial Institutions" msgstr "Financial Institutions" +#: src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx:44 +msgid "Financing is currently only available for US entities" +msgstr "Financing is currently only available for US entities" + #: src/components/onboarding/dicts/mccCodes.ts:625 msgid "Fines - Government Administrative Entities" msgstr "Fines - Government Administrative Entities" @@ -3607,6 +3619,10 @@ msgstr "Insurance - Default" msgid "Insurance Underwriting, Premiums" msgstr "Insurance Underwriting, Premiums" +#: src/components/integrations/Integrations.tsx:21 +msgid "Integrations" +msgstr "Integrations" + #: src/components/onboarding/dicts/mccCodes.ts:787 msgid "Intra-Company Purchases" msgstr "Intra-Company Purchases" @@ -3687,6 +3703,10 @@ msgstr "Invoice date" msgid "Invoice delete confirmation" msgstr "Invoice delete confirmation" +#: src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx:74 +msgid "Invoice financing" +msgstr "Invoice financing" + #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/EmailInvoiceDetails.tsx:102 msgid "Invoice from {entityName}" msgstr "Invoice from {entityName}" @@ -5582,6 +5602,10 @@ msgstr "Railroads" msgid "Read" msgstr "Read" +#: src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx:100 +msgid "Read more" +msgstr "Read more" + #: src/components/onboarding/dicts/mccCodes.ts:1140 msgid "Real Estate Agents and Managers - Rentals" msgstr "Real Estate Agents and Managers - Rentals" From 5828ac17833589713584b035ab38915166ecef88 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Fri, 6 Dec 2024 12:38:39 +0000 Subject: [PATCH 04/49] docs(changeset): feat(DEV-13304): implement finance banner --- .changeset/forty-onions-join.md | 5 + .../FinanceBanner/FinanceBanner.stories.tsx | 34 +++++ .../Financing/FinanceBanner/FinanceBanner.tsx | 124 ++++++++++++++++++ .../Financing/FinanceBanner/index.tsx | 1 + .../infographics/FinanceCardStack.tsx | 28 ++++ .../Financing/infographics/MoneyIcon.tsx | 18 +++ .../InvoicesTable/InvoicesTable.tsx | 4 + .../src/core/i18n/locales/en/messages.po | 54 +++++--- 8 files changed, 251 insertions(+), 17 deletions(-) create mode 100644 .changeset/forty-onions-join.md create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceBanner/FinanceBanner.stories.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceBanner/FinanceBanner.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceBanner/index.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/infographics/FinanceCardStack.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/infographics/MoneyIcon.tsx diff --git a/.changeset/forty-onions-join.md b/.changeset/forty-onions-join.md new file mode 100644 index 000000000..c25f77b2d --- /dev/null +++ b/.changeset/forty-onions-join.md @@ -0,0 +1,5 @@ +--- +'@monite/sdk-react': minor +--- + +feat(DEV-13304): implement finance banner diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceBanner/FinanceBanner.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceBanner/FinanceBanner.stories.tsx new file mode 100644 index 000000000..a71c13134 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceBanner/FinanceBanner.stories.tsx @@ -0,0 +1,34 @@ +import { MemoryRouter } from 'react-router-dom'; + +import { css } from '@emotion/react'; +import { StoryObj } from '@storybook/react'; + +import { FinanceBanner as FinanceBannerComponent } from './FinanceBanner'; + +const Story = { + title: 'Financing/FinanceBanner', + component: FinanceBannerComponent, +}; + +type Story = StoryObj<typeof FinanceBannerComponent>; + +export const FinanceBanner: Story = { + args: {}, + render: () => ( + <div + css={css` + box-sizing: border-box; + display: flex; + flex-direction: column; + height: 100vh; + padding: 20px; + `} + > + <MemoryRouter> + <FinanceBannerComponent /> + </MemoryRouter> + </div> + ), +}; + +export default Story; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceBanner/FinanceBanner.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceBanner/FinanceBanner.tsx new file mode 100644 index 000000000..97cdaf0d6 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceBanner/FinanceBanner.tsx @@ -0,0 +1,124 @@ +import { useState } from 'react'; + +import { useFinancing } from '@/core/queries/useFinancing'; +import { useTheme } from '@emotion/react'; +import { t } from '@lingui/macro'; +import { useLingui } from '@lingui/react'; +import { MoneyOutlined } from '@mui/icons-material'; +import { + Box, + Button, + lighten, + Skeleton, + Stack, + Typography, +} from '@mui/material'; + +import { FinanceFaqWrapper } from './FinanceFaq/FinanceFaqWrapper'; + +const LOCAL_STORAGE_KEY = 'financing_banner_hidden'; + +export const FinanceBanner = () => { + const { i18n } = useLingui(); + const theme = useTheme(); + const { + displayButtonMessage, + actionRequired, + startFinanceSession, + isInitializing, + isLoading, + isEnabled, + } = useFinancing(); + + const [isHidden, setIsHidden] = useState( + Boolean(localStorage.getItem(LOCAL_STORAGE_KEY)) + ); + const handleHide = () => { + setIsHidden(true); + localStorage.setItem(LOCAL_STORAGE_KEY, 'true'); + }; + + if (isHidden) { + return null; + } + + if (isLoading) { + return <Skeleton variant="rounded" height="98px" width="100%" />; + } + + if (!isEnabled) { + return null; + } + + return ( + <Box + sx={{ + border: '1px solid', + borderColor: 'divider', + borderRadius: 3, + p: 3, + display: 'flex', + alignItems: 'center', + gap: 2, + justifyContent: 'space-between', + }} + > + <Box + sx={{ + display: 'flex', + gap: 2, + flex: '1 1 0%', + alignItems: 'center', + }} + > + <Box + sx={{ + backgroundColor: lighten(theme.palette.primary.main, 0.9), + borderRadius: 3, + p: 1, + }} + > + <MoneyOutlined + sx={{ color: lighten(theme.palette.primary.main, 0.6) }} + /> + </Box> + <Box sx={{ flex: '1 1 0%' }}> + <Typography variant="subtitle2">{t( + i18n + )`Fund your sales/purchases`}</Typography> + <Typography variant="body1"> + {t( + i18n + )`Get a small business loan plan to manage finances more efficiently.`}{' '} + <FinanceFaqWrapper> + {({ openModal }) => ( + <Typography + onClick={openModal} + variant="body1" + sx={{ textDecoration: 'underline', cursor: 'pointer' }} + component="span" + >{t(i18n)`Read more >`}</Typography> + )} + </FinanceFaqWrapper> + </Typography> + </Box> + </Box> + <Stack direction="row" gap={1} alignItems="center"> + <Button onClick={handleHide} variant="text">{t(i18n)`Hide`}</Button> + {isInitializing ? ( + <Skeleton variant="rounded" width="140px" height="32px" /> + ) : ( + displayButtonMessage && ( + <Button + disabled={!actionRequired} + onClick={() => { + startFinanceSession(); + }} + variant="outlined" + >{t(i18n)`${displayButtonMessage}`}</Button> + ) + )} + </Stack> + </Box> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceBanner/index.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceBanner/index.tsx new file mode 100644 index 000000000..75cdb09f8 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceBanner/index.tsx @@ -0,0 +1 @@ +export * from './FinanceBanner'; diff --git a/packages/sdk-react/src/components/receivables/Financing/infographics/FinanceCardStack.tsx b/packages/sdk-react/src/components/receivables/Financing/infographics/FinanceCardStack.tsx new file mode 100644 index 000000000..985956568 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/infographics/FinanceCardStack.tsx @@ -0,0 +1,28 @@ +import { createSvgIcon } from '@mui/material'; + +export const FinanceCardStack = createSvgIcon( + <svg viewBox="0 0 360 206" fill="none" xmlns="http://www.w3.org/2000/svg"> + <g opacity="0.6"> + <path + d="M22.1251 190.007C19.3398 191.595 18.1392 194.984 19.3037 197.971L146.471 524.154C147.963 527.979 152.596 529.463 156.033 527.215L494.612 305.743C497.77 303.677 498.494 299.356 496.183 296.373L297.206 39.5857C295.235 37.0412 291.691 36.3351 288.895 37.9293L22.1251 190.007Z" + fill="#CDC9FF" + /> + <path + opacity="0.5" + d="M22.1251 190.007C19.3398 191.595 18.1392 194.984 19.3037 197.971L146.471 524.154C147.963 527.979 152.596 529.463 156.033 527.215L494.612 305.743C497.77 303.677 498.494 299.356 496.183 296.373L297.206 39.5857C295.235 37.0412 291.691 36.3351 288.895 37.9293L22.1251 190.007Z" + fill="white" + /> + <path + opacity="0.6" + d="M54.3105 202.621C51.5253 204.208 50.3246 207.598 51.4891 210.585L157.649 482.884C159.141 486.709 163.775 488.193 167.211 485.945L449.95 300.999C453.108 298.933 453.833 294.612 451.521 291.629L285.418 77.2671C283.447 74.7226 279.904 74.0164 277.107 75.6106L54.3105 202.621Z" + fill="white" + /> + <path + d="M89.3098 220.355C86.5245 221.943 85.3238 225.333 86.4884 228.32L171.988 447.625C173.48 451.451 178.113 452.935 181.55 450.687L409.371 301.663C412.529 299.597 413.254 295.277 410.942 292.294L277.171 119.656C275.199 117.111 271.656 116.405 268.859 117.999L89.3098 220.355Z" + fill="white" + /> + </g> + </svg>, + // eslint-disable-next-line lingui/no-unlocalized-strings + 'Finance Card Stack' +); diff --git a/packages/sdk-react/src/components/receivables/Financing/infographics/MoneyIcon.tsx b/packages/sdk-react/src/components/receivables/Financing/infographics/MoneyIcon.tsx new file mode 100644 index 000000000..270728b22 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/infographics/MoneyIcon.tsx @@ -0,0 +1,18 @@ +import { createSvgIcon } from '@mui/material'; + +export const MoneyIcon = createSvgIcon( + <svg + width="20" + height="20" + viewBox="0 0 20 20" + fill="none" + xmlns="http://www.w3.org/2000/svg" + > + <path + d="M18.332 14.1673H1.66536C1.44435 14.1673 1.23239 14.2551 1.07611 14.4114C0.919829 14.5677 0.832031 14.7796 0.832031 15.0006C0.832031 15.2217 0.919829 15.4336 1.07611 15.5899C1.23239 15.7462 1.44435 15.834 1.66536 15.834H18.332C18.553 15.834 18.765 15.7462 18.9213 15.5899C19.0776 15.4336 19.1654 15.2217 19.1654 15.0006C19.1654 14.7796 19.0776 14.5677 18.9213 14.4114C18.765 14.2551 18.553 14.1673 18.332 14.1673ZM18.332 17.5006H1.66536C1.44435 17.5006 1.23239 17.5884 1.07611 17.7447C0.919829 17.901 0.832031 18.113 0.832031 18.334C0.832031 18.555 0.919829 18.767 1.07611 18.9232C1.23239 19.0795 1.44435 19.1673 1.66536 19.1673H18.332C18.553 19.1673 18.765 19.0795 18.9213 18.9232C19.0776 18.767 19.1654 18.555 19.1654 18.334C19.1654 18.113 19.0776 17.901 18.9213 17.7447C18.765 17.5884 18.553 17.5006 18.332 17.5006ZM4.9987 5.83398C4.83388 5.83398 4.67276 5.88286 4.53572 5.97443C4.39868 6.06599 4.29187 6.19614 4.2288 6.34841C4.16572 6.50069 4.14922 6.66824 4.18138 6.82989C4.21353 6.99154 4.2929 7.14003 4.40944 7.25657C4.52599 7.37312 4.67447 7.45248 4.83612 7.48464C4.99777 7.51679 5.16533 7.50029 5.3176 7.43722C5.46987 7.37414 5.60002 7.26733 5.69159 7.13029C5.78316 6.99325 5.83203 6.83213 5.83203 6.66732C5.83203 6.4463 5.74423 6.23434 5.58795 6.07806C5.43167 5.92178 5.21971 5.83398 4.9987 5.83398ZM16.6654 0.833984H3.33203C2.66899 0.833984 2.03311 1.09738 1.56426 1.56622C1.09542 2.03506 0.832031 2.67094 0.832031 3.33398V10.0007C0.832031 10.6637 1.09542 11.2996 1.56426 11.7684C2.03311 12.2373 2.66899 12.5006 3.33203 12.5006H16.6654C17.3284 12.5006 17.9643 12.2373 18.4331 11.7684C18.902 11.2996 19.1654 10.6637 19.1654 10.0007V3.33398C19.1654 2.67094 18.902 2.03506 18.4331 1.56622C17.9643 1.09738 17.3284 0.833984 16.6654 0.833984V0.833984ZM17.4987 10.0007C17.4987 10.2217 17.4109 10.4336 17.2546 10.5899C17.0983 10.7462 16.8864 10.834 16.6654 10.834H3.33203C3.11102 10.834 2.89906 10.7462 2.74278 10.5899C2.5865 10.4336 2.4987 10.2217 2.4987 10.0007V3.33398C2.4987 3.11297 2.5865 2.90101 2.74278 2.74473C2.89906 2.58845 3.11102 2.50065 3.33203 2.50065H16.6654C16.8864 2.50065 17.0983 2.58845 17.2546 2.74473C17.4109 2.90101 17.4987 3.11297 17.4987 3.33398V10.0007ZM9.9987 4.16732C9.50424 4.16732 9.02089 4.31394 8.60977 4.58864C8.19865 4.86335 7.87822 5.25379 7.689 5.71061C7.49978 6.16742 7.45027 6.67009 7.54673 7.15504C7.6432 7.64 7.8813 8.08545 8.23093 8.43508C8.58056 8.78472 9.02602 9.02282 9.51097 9.11928C9.99592 9.21574 10.4986 9.16624 10.9554 8.97702C11.4122 8.7878 11.8027 8.46737 12.0774 8.05624C12.3521 7.64512 12.4987 7.16177 12.4987 6.66732C12.4987 6.00428 12.2353 5.36839 11.7665 4.89955C11.2976 4.43071 10.6617 4.16732 9.9987 4.16732ZM9.9987 7.50065C9.83388 7.50065 9.67276 7.45178 9.53572 7.36021C9.39868 7.26864 9.29187 7.13849 9.2288 6.98622C9.16572 6.83395 9.14922 6.66639 9.18138 6.50474C9.21353 6.34309 9.2929 6.19461 9.40944 6.07806C9.52599 5.96152 9.67447 5.88215 9.83612 5.85C9.99777 5.81784 10.1653 5.83434 10.3176 5.89742C10.4699 5.96049 10.6 6.0673 10.6916 6.20434C10.7832 6.34138 10.832 6.5025 10.832 6.66732C10.832 6.88833 10.7442 7.10029 10.588 7.25657C10.4317 7.41285 10.2197 7.50065 9.9987 7.50065ZM14.9987 5.83398C14.8339 5.83398 14.6728 5.88286 14.5357 5.97443C14.3987 6.06599 14.2919 6.19614 14.2288 6.34841C14.1657 6.50069 14.1492 6.66824 14.1814 6.82989C14.2135 6.99154 14.2929 7.14003 14.4094 7.25657C14.526 7.37312 14.6745 7.45248 14.8361 7.48464C14.9978 7.51679 15.1653 7.50029 15.3176 7.43722C15.4699 7.37414 15.6 7.26733 15.6916 7.13029C15.7832 6.99325 15.832 6.83213 15.832 6.66732C15.832 6.4463 15.7442 6.23434 15.588 6.07806C15.4317 5.92178 15.2197 5.83398 14.9987 5.83398Z" + fill="#3737FF" + /> + </svg>, + // eslint-disable-next-line lingui/no-unlocalized-strings + 'Money Icon' +); diff --git a/packages/sdk-react/src/components/receivables/InvoicesTable/InvoicesTable.tsx b/packages/sdk-react/src/components/receivables/InvoicesTable/InvoicesTable.tsx index ce4d43a3e..13949beb7 100644 --- a/packages/sdk-react/src/components/receivables/InvoicesTable/InvoicesTable.tsx +++ b/packages/sdk-react/src/components/receivables/InvoicesTable/InvoicesTable.tsx @@ -41,6 +41,7 @@ import { GridSortModel, } from '@mui/x-data-grid'; +import { FinanceBanner } from '../Financing/FinanceBanner/FinanceBanner'; import { useReceivablesFilters } from '../ReceivableFilters/useReceivablesFilters'; import { useInvoiceRowActionMenuCell, @@ -308,6 +309,9 @@ const InvoicesTableBase = ({ pt: 2, }} > + <Box mb={2}> + <FinanceBanner /> + </Box> <ReceivableFilters filters={filters} onChange={(field, value) => { diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index 2a4af2a28..a70ade487 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -120,6 +120,10 @@ msgstr "{days_before} {day_plural} till overdue" msgid "{days, plural, one {day} two {days} few {days} many {days} zero {days} other {days}}" msgstr "{days, plural, one {day} two {days} few {days} many {days} zero {days} other {days}}" +#: src/components/receivables/Financing/FinanceBanner/FinanceBanner.tsx:118 +msgid "{displayButtonMessage}" +msgstr "{displayButtonMessage}" + #: src/ui/DueDateCell/DueDateCell.tsx:45 msgid "{overdueDays} {0} overdue" msgstr "{overdueDays} {0} overdue" @@ -520,7 +524,7 @@ msgstr "American Samoa" #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/TabPanels/PaymentTabPanel/PaymentRecordForm.tsx:76 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/TabPanels/PaymentTabPanel/schemas/manualPaymentRecordValidationSchema.ts:13 #: src/components/receivables/InvoiceDetails/InvoiceItems/InvoiceItems.tsx:35 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:234 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:235 #: src/components/receivables/QuotesTable/QuotesTable.tsx:201 msgid "Amount" msgstr "Amount" @@ -1958,8 +1962,8 @@ msgstr "Create from mail" #: src/components/receivables/InvoiceDetails/CreateReceivable/CreateReceivables.test.tsx:81 #: src/components/receivables/InvoicesTable/InvoicesTable.test.tsx:128 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:285 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:360 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:286 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:364 #: src/components/receivables/Receivables.test.tsx:35 #: src/components/receivables/Receivables.test.tsx:76 #: src/components/receivables/Receivables.test.tsx:113 @@ -2055,7 +2059,7 @@ msgid "Created by user" msgstr "Created by user" #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:150 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:220 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:221 #: src/components/receivables/QuotesTable/QuotesTable.tsx:171 #: src/components/userRoles/UserRolesTable/Filters/Filters.tsx:41 #: src/components/userRoles/UserRolesTable/UserRolesTable.tsx:175 @@ -2127,7 +2131,7 @@ msgstr "Current status" #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/CustomerSection.tsx:409 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:137 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/sections/PreviewCustomerSection.tsx:56 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:210 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:211 #: src/components/receivables/QuotesTable/QuotesTable.tsx:184 #: src/components/receivables/ReceivableFilters/ReceivableFilters.tsx:106 #: src/components/receivables/ReceivableFilters/ReceivableFilters.tsx:109 @@ -2538,7 +2542,7 @@ msgstr "Dry Cleaners" #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:235 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:420 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/reminderCardTermsHelpers.tsx:45 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:247 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:248 #: src/components/receivables/QuotesTable/QuotesTable.tsx:194 #: src/components/receivables/ReceivableFilters/ReceivableFilters.tsx:135 msgid "Due date" @@ -3206,6 +3210,10 @@ msgstr "Fulfillment date" msgid "Full name" msgstr "Full name" +#: src/components/receivables/Financing/FinanceBanner/FinanceBanner.tsx:86 +msgid "Fund your sales/purchases" +msgstr "Fund your sales/purchases" + #: src/components/onboarding/dicts/mccCodes.ts:660 msgid "Funeral Services, Crematories" msgstr "Funeral Services, Crematories" @@ -3254,6 +3262,10 @@ msgstr "Germany" #~ msgid "Germany Frankfurt am Main" #~ msgstr "Germany Frankfurt am Main" +#: src/components/receivables/Financing/FinanceBanner/FinanceBanner.tsx:90 +msgid "Get a small business loan plan to manage finances more efficiently." +msgstr "Get a small business loan plan to manage finances more efficiently." + #: src/core/utils/countries.ts:100 msgid "Ghana" msgstr "Ghana" @@ -3430,6 +3442,10 @@ msgstr "" "Kind Regards,\n" "{1}" +#: src/components/receivables/Financing/FinanceBanner/FinanceBanner.tsx:107 +msgid "Hide" +msgstr "Hide" + #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:526 msgid "History" msgstr "History" @@ -3612,7 +3628,7 @@ msgid "Intra-Company Purchases" msgstr "Intra-Company Purchases" #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:142 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:192 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:193 #: src/components/receivables/QuotesTable/QuotesTable.tsx:163 msgid "INV-auto" msgstr "INV-auto" @@ -3636,9 +3652,9 @@ msgstr "Invalid issuance" #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:284 #: src/components/receivables/InvoiceDetails/CreateReceivable/CreateReceivables.tsx:241 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/EditInvoiceDetails.tsx:254 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:286 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:288 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:361 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:287 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:289 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:365 #: src/components/receivables/QuotesTable/QuotesTable.tsx:230 #: src/components/receivables/QuotesTable/QuotesTable.tsx:232 #: src/components/receivables/QuotesTable/QuotesTable.tsx:297 @@ -3729,7 +3745,7 @@ msgstr "Invoice to “{0}” was created" msgid "Invoice total" msgstr "Invoice total" -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:359 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:363 #: src/core/utils/createThemeWithDefaults.ts:25 msgid "Invoices" msgstr "Invoices" @@ -3784,7 +3800,7 @@ msgstr "Issue at" #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:300 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:156 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:46 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:227 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:228 msgid "Issue date" msgstr "Issue date" @@ -4720,7 +4736,7 @@ msgid "No Quotes" msgstr "No Quotes" #: src/components/receivables/InvoicesTable/InvoicesTable.test.tsx:125 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:282 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:283 msgid "No Receivables" msgstr "No Receivables" @@ -4817,7 +4833,7 @@ msgid "Number of approvals required must be a number" msgstr "Number of approvals required must be a number" #: src/components/payables/PayablesTable/PayablesTable.tsx:242 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:158 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:159 #: src/components/receivables/QuotesTable/QuotesTable.tsx:149 msgid "Number, status" msgstr "Number, status" @@ -5582,6 +5598,10 @@ msgstr "Railroads" msgid "Read" msgstr "Read" +#: src/components/receivables/Financing/FinanceBanner/FinanceBanner.tsx:100 +msgid "Read more >" +msgstr "Read more >" + #: src/components/onboarding/dicts/mccCodes.ts:1140 msgid "Real Estate Agents and Managers - Rentals" msgstr "Real Estate Agents and Managers - Rentals" @@ -5657,7 +5677,7 @@ msgid "Recurrence was completed, all invoices were issued" msgstr "Recurrence was completed, all invoices were issued" #: src/components/receivables/getCommonStatusLabel.ts:21 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:186 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:187 msgid "Recurring" msgstr "Recurring" @@ -7564,7 +7584,7 @@ msgid "You can create your first credit note." msgstr "You can create your first credit note." #: src/components/receivables/InvoicesTable/InvoicesTable.test.tsx:127 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:284 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:285 msgid "You can create your first invoice." msgstr "You can create your first invoice." @@ -7617,7 +7637,7 @@ msgid "You don’t have any credit notes yet." msgstr "You don’t have any credit notes yet." #: src/components/receivables/InvoicesTable/InvoicesTable.test.tsx:126 -#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:283 +#: src/components/receivables/InvoicesTable/InvoicesTable.tsx:284 msgid "You don’t have any invoices yet." msgstr "You don’t have any invoices yet." From f57ac164e12d674613f2ad7dedf22f228a98eed3 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Fri, 6 Dec 2024 12:48:21 +0000 Subject: [PATCH 05/49] docs(changeset): feat(DEV-13301): finance an invoice --- .changeset/eighty-pandas-buy.md | 5 + .../FinanceInvoice/FinanceDetails.tsx | 194 ++++++++++++ .../FinanceInvoice/FinanceInvoice.stories.tsx | 35 +++ .../FinanceInvoice/FinanceInvoice.tsx | 174 +++++++++++ .../FinanceInvoice/FinanceOverviewCard.tsx | 73 +++++ .../Financing/FinanceInvoice/index.tsx | 1 + .../components/OverviewTabPanel.tsx | 285 +++++++++--------- .../src/core/i18n/locales/en/messages.po | 99 +++++- 8 files changed, 716 insertions(+), 150 deletions(-) create mode 100644 .changeset/eighty-pandas-buy.md create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.stories.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/index.tsx diff --git a/.changeset/eighty-pandas-buy.md b/.changeset/eighty-pandas-buy.md new file mode 100644 index 000000000..023344f81 --- /dev/null +++ b/.changeset/eighty-pandas-buy.md @@ -0,0 +1,5 @@ +--- +'@monite/sdk-react': minor +--- + +feat(DEV-13301): finance an invoice diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx new file mode 100644 index 000000000..872e0a536 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx @@ -0,0 +1,194 @@ +import { components } from '@/api'; +import { InvoiceStatusChip } from '@/components/receivables/InvoiceStatusChip'; +import { useCurrencies } from '@/core/hooks'; +import { useDateFormat } from '@/utils'; +import { t } from '@lingui/macro'; +import { useLingui } from '@lingui/react'; +import { + Box, + Divider, + List, + ListItem, + Typography, + useTheme, +} from '@mui/material'; + +import { INVOICE_DOCUMENT_AUTO_ID } from '../../consts'; + +type Props = { + invoice: components['schemas']['InvoiceResponsePayload']; +}; + +export const FinanceDetails = ({ invoice }: Props) => { + const { i18n } = useLingui(); + const { formatCurrencyToDisplay } = useCurrencies(); + const theme = useTheme(); + const dateFormat = useDateFormat(); + const issueDate = invoice?.issue_date + ? i18n.date(invoice?.issue_date, dateFormat) + : '—'; + const invoiceAmount = formatCurrencyToDisplay( + invoice.total_amount_with_credit_notes, + invoice.currency + ); + + const financePlans = [ + { + name: 'Financing plan', + items: ['100% advance rate', 'Pay in 30 days', '2% fee'], + }, + ]; + const repaymentDate = invoice?.issue_date + ? i18n.date(invoice?.issue_date, dateFormat) + : '—'; + const receivedSum = formatCurrencyToDisplay( + invoice.total_amount_with_credit_notes, + invoice.currency + ); + const serviceFee = formatCurrencyToDisplay(0, invoice.currency); + const repaymentSum = formatCurrencyToDisplay( + invoice.total_amount_with_credit_notes, + invoice.currency + ); + const paymentDate = invoice?.issue_date + ? i18n.date(invoice?.issue_date, dateFormat) + : '—'; + const paymentAmount = formatCurrencyToDisplay( + invoice.total_amount_with_credit_notes, + invoice.currency + ); + + return ( + <Box + sx={{ + p: 3, + display: 'flex', + flexDirection: 'column', + gap: 4, + }} + > + <Typography variant="h3">{t(i18n)`Funding details`}</Typography> + {/* Invoice summary */} + <Box + sx={{ + borderRadius: 3, + p: 3, + border: '1px solid', + borderColor: 'divider', + display: 'flex', + gap: 2, + justifyContent: 'space-between', + alignItems: 'center', + }} + > + <Box> + <Typography variant="body1" fontWeight={500}> + {t(i18n)`Invoice ${ + invoice.document_id || INVOICE_DOCUMENT_AUTO_ID + }`} + </Typography> + <Typography + mt={1} + color={theme.palette.text.secondary} + variant="body2" + >{t(i18n)`For ${invoiceAmount} | Issued ${issueDate}`}</Typography> + </Box> + <Box> + <InvoiceStatusChip status={invoice.status} /> + </Box> + </Box> + + {/* Amount and date */} + <Box> + <Typography variant="h2">{invoiceAmount}</Typography> + <Typography mt={1} fontWeight={500} variant="body1">{t( + i18n + )`${issueDate}`}</Typography> + </Box> + + {/* Finance plans */} + {financePlans.map((plan) => ( + <Box + key={plan.name} + sx={{ + display: 'flex', + gap: 4, + }} + > + <Box width="100%"> + <Typography variant="body1" color={theme.palette.text.secondary}>{t( + i18n + )`Financing plan 1`}</Typography> + <List> + {plan.items.map((item) => ( + <ListItem key={item} sx={{ p: 0 }}> + <Typography variant="body1">{t(i18n)`${item}`}</Typography> + </ListItem> + ))} + </List> + </Box> + <Box width="100%"> + <Typography variant="body1" color={theme.palette.text.secondary}>{t( + i18n + )`Repayment on`}</Typography> + <Typography variant="body1">{t(i18n)`${repaymentDate}`}</Typography> + </Box> + <Box width="100%"> + <Typography variant="body1" color={theme.palette.text.secondary}>{t( + i18n + )`Status`}</Typography> + <Box> + {/* TODO: Create a new status chip that allows late payment */} + <InvoiceStatusChip status={invoice.status} /> + </Box> + </Box> + </Box> + ))} + <Divider /> + {/* Payment breakdown */} + <Box> + <Box + sx={{ + display: 'grid', + gridTemplateColumns: 'minmax(140px, auto) 1fr', + flexDirection: 'column', + rowGap: 1, + columnGap: 2, + }} + > + <Typography variant="body1" color={theme.palette.text.secondary}>{t( + i18n + )`Received sum`}</Typography> + <Typography variant="body1">{receivedSum}</Typography> + <Typography variant="body1" color={theme.palette.text.secondary}>{t( + i18n + )`Service Fee`}</Typography> + <Typography variant="body1">{serviceFee}</Typography> + <Typography variant="body1" color={theme.palette.text.secondary}>{t( + i18n + )`Repayment sum`}</Typography> + <Typography variant="body1">{repaymentSum}</Typography> + </Box> + </Box> + <Divider /> + {/* Payment amount and date */} + <Box + sx={{ + display: 'flex', + gap: 4, + justifyContent: 'space-between', + }} + > + <Box> + <Typography variant="body1" fontWeight={500}>{t( + i18n + )`Payment amount`}</Typography> + <Typography variant="body1">{t(i18n)`${paymentDate}`}</Typography> + </Box> + <Box> + <Typography variant="subtitle1">{paymentAmount}</Typography> + </Box> + </Box> + </Box> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.stories.tsx new file mode 100644 index 000000000..99744a76e --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.stories.tsx @@ -0,0 +1,35 @@ +import { MemoryRouter } from 'react-router-dom'; + +import { receivableListFixture } from '@/mocks'; +import { css } from '@emotion/react'; +import { StoryObj } from '@storybook/react'; + +import { FinanceInvoice as FinanceInvoiceComponent } from './FinanceInvoice'; + +const Story = { + title: 'Financing/FinanceInvoice', + component: FinanceInvoiceComponent, +}; + +type Story = StoryObj<typeof FinanceInvoiceComponent>; + +export const FinanceInvoice: Story = { + args: {}, + render: () => ( + <div + css={css` + box-sizing: border-box; + display: flex; + flex-direction: column; + height: 100vh; + padding: 20px; + `} + > + <MemoryRouter> + <FinanceInvoiceComponent invoice={receivableListFixture.invoice[0]} /> + </MemoryRouter> + </div> + ), +}; + +export default Story; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx new file mode 100644 index 000000000..b9ec0679d --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx @@ -0,0 +1,174 @@ +// import { toast } from 'react-hot-toast'; +import { useState } from 'react'; + +import { components } from '@/api'; +import { FinanceOverviewCard } from '@/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard'; +import { FinanceCardStack } from '@/components/receivables/Financing/infographics/FinanceCardStack'; +import { + useFinanceAnInvoice, + useFinancing, + useGetFinanceOffers, +} from '@/core/queries/useFinancing'; +// import { getAPIErrorMessage } from '@/core/utils/getAPIErrorMessage'; +import { t } from '@lingui/macro'; +import { useLingui } from '@lingui/react'; +import { + Box, + Button, + CircularProgress, + Skeleton, + Tooltip, + Typography, +} from '@mui/material'; + +export const FinanceInvoice = ({ + invoice, +}: { + invoice: components['schemas']['InvoiceResponsePayload']; +}) => { + const { i18n } = useLingui(); + const [isFinancingAnInvoice, setIsFinancingAnInvoice] = useState(false); + + const { + isLoading: isLoadingFinanceSdk, + isEnabled, + isInitializing, + startFinanceSession, + } = useFinancing(); + const { isLoading: isLoadingFinanceOffers, data: financeOffersData } = + useGetFinanceOffers(); + + const isLoading = isLoadingFinanceOffers || isLoadingFinanceSdk; + const financeInvoiceMutation = useFinanceAnInvoice(); + const invoiceIsEligibleForFinance = [ + 'issued', + 'partially_paid', + 'overdue', + ].includes(invoice.status); + + const financeInvoice = async () => { + // TODO: Consider using the connect token here + try { + setIsFinancingAnInvoice(true); + financeInvoiceMutation.mutate( + { + invoices: [ + { + id: invoice.id, + type: 'receivable', + }, + ], + }, + { + onError: () => { + setIsFinancingAnInvoice(false); + // toast.error(getAPIErrorMessage(i18n, error)); + }, + onSuccess: ({ session_token }) => { + startFinanceSession({ + sessionToken: session_token, + component: 'SESSION_INVOICE_FLOW_WITH_INVOICE_FILE', + }); + setIsFinancingAnInvoice(false); + }, + } + ); + } catch (error) { + console.log('🚀 ~ financeInvoice ~ error:', error); + setIsFinancingAnInvoice(false); + } + }; + + if (isLoading) { + return <CircularProgress color="inherit" size={20} />; + } + + if (!isEnabled || !invoiceIsEligibleForFinance) { + return null; + } + + const isFinanced = financeOffersData?.business_status === 'ONBOARDED'; + + if (isFinanced) { + return ( + <Box> + <FinanceOverviewCard invoice={invoice} /> + </Box> + ); + } + + return ( + <Box + sx={{ + backgroundColor: '#CDC9FF', + borderRadius: 3, + p: 3, + position: 'relative', + overflow: 'hidden', + }} + > + <FinanceCardStack + sx={{ + position: 'absolute', + width: '360px', + height: '206px', + bottom: 0, + right: 0, + zIndex: 0, + }} + /> + <Box + sx={{ + display: 'flex', + alignItems: 'center', + gap: 2, + justifyContent: 'space-between', + position: 'relative', + zIndex: 1, + }} + > + <Box + sx={{ + flex: '1 1 0%', + }} + > + <Box sx={{ flex: '1 1 0%' }}> + <Typography variant="subtitle2">{t( + i18n + )`Don't wait for the payment`}</Typography> + <Typography variant="body1"> + {t(i18n)`This invoice can be financed`}.{' '} + <Tooltip + arrow + title={t( + i18n + )`The issue date should be less than 7 days ago. You can't fund overdue invoices. The loan sum must be within your remaining limit.`} + > + <Typography + variant="body1" + sx={{ textDecoration: 'underline' }} + component="span" + >{t(i18n)`Why?`}</Typography> + </Tooltip> + </Typography> + </Box> + </Box> + <Box> + {isInitializing ? ( + <Skeleton variant="rounded" width="140px" height="32px" /> + ) : ( + <Button + onClick={financeInvoice} + disabled={isFinancingAnInvoice} + sx={{ backgroundColor: 'black', color: 'white' }} + > + {isFinancingAnInvoice + ? t(i18n)`Loading...` + : t(i18n)`Get paid now`} + </Button> + )} + </Box> + </Box> + </Box> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard.tsx new file mode 100644 index 000000000..50de63a9b --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard.tsx @@ -0,0 +1,73 @@ +import { useState } from 'react'; + +import { components } from '@/api'; +import { Dialog } from '@/components/Dialog'; +import { useCurrencies } from '@/core/hooks'; +import { useDateFormat } from '@/utils'; +import { t } from '@lingui/macro'; +import { useLingui } from '@lingui/react'; +import { Box, Typography } from '@mui/material'; + +import { InvoiceStatusChip } from '../../InvoiceStatusChip'; +import { FinanceDetails } from './FinanceDetails'; + +type Props = { + invoice: components['schemas']['InvoiceResponsePayload']; +}; + +export const FinanceOverviewCard = ({ invoice }: Props) => { + const { i18n } = useLingui(); + const [dialogIsOpen, setDialogIsOpen] = useState(false); + + const { formatCurrencyToDisplay } = useCurrencies(); + const dateFormat = useDateFormat(); + + const invoiceAmount = formatCurrencyToDisplay( + invoice.amount_due, + invoice.currency + ); + + const repaymentDate = invoice?.issue_date + ? i18n.date(invoice?.issue_date, dateFormat) + : '—'; + + return ( + <> + <Box + onClick={() => setDialogIsOpen(true)} + sx={{ + borderRadius: 3, + p: 3, + display: 'flex', + alignItems: 'center', + gap: 2, + justifyContent: 'space-between', + border: '1px solid', + borderColor: 'divider', + cursor: 'pointer', + }} + > + <Box> + <Typography variant="subtitle2"> + {t(i18n)`Funding for ${invoiceAmount}`} + </Typography> + <Typography variant="body1"> + {t(i18n)`Repayment on ${repaymentDate}`} + </Typography> + </Box> + <Box> + <InvoiceStatusChip status={invoice.status} /> + </Box> + </Box> + + <Dialog + // className={className + '-Dialog-ProductsTable'} + open={dialogIsOpen} + onClose={() => setDialogIsOpen(false)} + alignDialog="right" + > + <FinanceDetails invoice={invoice} /> + </Dialog> + </> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/index.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/index.tsx new file mode 100644 index 000000000..b72e2fe43 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/index.tsx @@ -0,0 +1 @@ +export * from './FinanceInvoice'; diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx b/packages/sdk-react/src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx index dec7d1cd6..fe42e110c 100644 --- a/packages/sdk-react/src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx @@ -39,6 +39,8 @@ import { Typography, } from '@mui/material'; +import { FinanceInvoice } from '../../../Financing/FinanceInvoice/FinanceInvoice'; + interface OverviewTabPanelProps extends Pick<BoxProps, 'id' | 'role' | 'aria-labelledby'> { onSetView: (view: 'recurrence') => void; @@ -123,151 +125,154 @@ export const OverviewTabPanel = ({ ); return ( - <Box - sx={{ - '& > * + *': { - mt: 5, - }, - }} - {...restProps} - > - <MoniteCard - items={[ - { - label: t(i18n)`Customer`, - value: isCounterpartLoading ? ( - <Skeleton variant="text" width="50%" /> - ) : counterpartError || !counterpart ? ( - '—' - ) : ( - <Typography fontWeight={500}> - {getCounterpartName(counterpart)} - </Typography> - ), - }, - invoice.recurrence_id - ? { - label: t(i18n)`Current status`, - value: recurrence ? ( - <InvoiceRecurrenceStatusChip - status={recurrence?.status} - size="small" - /> - ) : ( - <Skeleton variant="text" width="50%" /> - ), - } - : undefined, - { - label: t(i18n)`Invoice total`, - value: ( - <Typography fontWeight={500}> - {formatCurrencyToDisplay( - invoice.total_amount_with_credit_notes, - invoice.currency - )} - </Typography> - ), + <> + <FinanceInvoice invoice={invoice} /> + <Box + sx={{ + '& > * + *': { + mt: 5, }, - ].filter((item) => !!item)} - /> - - {Boolean( - creditNoteQuery?.data || isCreditNoteLoading || creditNoteError - ) && ( - <Box sx={{ '& > * + *': { mt: 2 } }}> - {creditNoteQuery?.data && creditNoteQuery.data.length > 0 && ( - <Typography variant="subtitle2" sx={{ mb: 2 }}> - {t(i18n)`Linked documents`} - </Typography> - )} - {isCreditNoteLoading && <Skeleton variant="text" />} - {creditNoteQuery?.data && ( - <LinkedDocumentsCard creditNotes={creditNoteQuery.data} /> - )} - </Box> - )} + }} + {...restProps} + > + <MoniteCard + items={[ + { + label: t(i18n)`Customer`, + value: isCounterpartLoading ? ( + <Skeleton variant="text" width="50%" /> + ) : counterpartError || !counterpart ? ( + '—' + ) : ( + <Typography fontWeight={500}> + {getCounterpartName(counterpart)} + </Typography> + ), + }, + invoice.recurrence_id + ? { + label: t(i18n)`Current status`, + value: recurrence ? ( + <InvoiceRecurrenceStatusChip + status={recurrence?.status} + size="small" + /> + ) : ( + <Skeleton variant="text" width="50%" /> + ), + } + : undefined, + { + label: t(i18n)`Invoice total`, + value: ( + <Typography fontWeight={500}> + {formatCurrencyToDisplay( + invoice.total_amount_with_credit_notes, + invoice.currency + )} + </Typography> + ), + }, + ].filter((item) => !!item)} + /> - {(invoice.status === 'draft' || Boolean(invoice.recurrence_id)) && ( - <Box> - <InvoiceRecurrence - invoiceId={invoice.id} - viewAll={ - <Button - size="small" - variant="text" - onClick={(event) => { - event.preventDefault(); - onSetView('recurrence'); - }} - > - {t(i18n)`View all`} - </Button> - } - /> - </Box> - )} - {!!invoice.based_on && ( - <Box> - <InvoiceRecurrenceBasedOn receivableId={invoice.based_on} /> - </Box> - )} + {Boolean( + creditNoteQuery?.data || isCreditNoteLoading || creditNoteError + ) && ( + <Box sx={{ '& > * + *': { mt: 2 } }}> + {creditNoteQuery?.data && creditNoteQuery.data.length > 0 && ( + <Typography variant="subtitle2" sx={{ mb: 2 }}> + {t(i18n)`Linked documents`} + </Typography> + )} + {isCreditNoteLoading && <Skeleton variant="text" />} + {creditNoteQuery?.data && ( + <LinkedDocumentsCard creditNotes={creditNoteQuery.data} /> + )} + </Box> + )} - {Boolean( - paymentReminderQuery.data || - overdueReminderQuery.data?.terms?.length || - paymentReminderQuery.isLoading || - overdueReminderQuery.isLoading || - paymentReminderQuery.isError || - overdueReminderQuery.isError - ) && ( - <Box - sx={{ - '& > * + *': { - mt: 2, - }, - }} - > - <Typography variant="subtitle2" sx={{ mb: 2 }}>{t( - i18n - )`Reminder emails`}</Typography> - {paymentReminderQuery.isLoading && <Skeleton variant="text" />} - {!!paymentReminderQuery.data && ( - <RemindersCard - cardTitle={paymentReminderQuery.data.name} - reminderTerms={createPaymentReminderCardTerms( - i18n, - paymentReminderQuery.data - )} - status={paymentReminderQuery.data.status} + {(invoice.status === 'draft' || Boolean(invoice.recurrence_id)) && ( + <Box> + <InvoiceRecurrence + invoiceId={invoice.id} + viewAll={ + <Button + size="small" + variant="text" + onClick={(event) => { + event.preventDefault(); + onSetView('recurrence'); + }} + > + {t(i18n)`View all`} + </Button> + } /> - )} - {paymentReminderQuery.isError && ( - <Alert severity="error"> - {getAPIErrorMessage(i18n, paymentReminderQuery.error)} - </Alert> - )} + </Box> + )} + {!!invoice.based_on && ( + <Box> + <InvoiceRecurrenceBasedOn receivableId={invoice.based_on} /> + </Box> + )} - {overdueReminderQuery.isLoading && <Skeleton variant="text" />} - {!!overdueReminderQuery.data?.terms?.length && ( - <RemindersCard - cardTitle={overdueReminderQuery.data.name} - reminderTerms={createOverdueReminderCardTerms( - i18n, - overdueReminderQuery.data - )} - // overdue reminders are always active - status={'active'} - /> - )} - {overdueReminderQuery.isError && ( - <Alert severity="error"> - {getAPIErrorMessage(i18n, overdueReminderQuery.error)} - </Alert> - )} - </Box> - )} - </Box> + {Boolean( + paymentReminderQuery.data || + overdueReminderQuery.data?.terms?.length || + paymentReminderQuery.isLoading || + overdueReminderQuery.isLoading || + paymentReminderQuery.isError || + overdueReminderQuery.isError + ) && ( + <Box + sx={{ + '& > * + *': { + mt: 2, + }, + }} + > + <Typography variant="subtitle2" sx={{ mb: 2 }}>{t( + i18n + )`Reminder emails`}</Typography> + {paymentReminderQuery.isLoading && <Skeleton variant="text" />} + {!!paymentReminderQuery.data && ( + <RemindersCard + cardTitle={paymentReminderQuery.data.name} + reminderTerms={createPaymentReminderCardTerms( + i18n, + paymentReminderQuery.data + )} + status={paymentReminderQuery.data.status} + /> + )} + {paymentReminderQuery.isError && ( + <Alert severity="error"> + {getAPIErrorMessage(i18n, paymentReminderQuery.error)} + </Alert> + )} + + {overdueReminderQuery.isLoading && <Skeleton variant="text" />} + {!!overdueReminderQuery.data?.terms?.length && ( + <RemindersCard + cardTitle={overdueReminderQuery.data.name} + reminderTerms={createOverdueReminderCardTerms( + i18n, + overdueReminderQuery.data + )} + // overdue reminders are always active + status={'active'} + /> + )} + {overdueReminderQuery.isError && ( + <Alert severity="error"> + {getAPIErrorMessage(i18n, overdueReminderQuery.error)} + </Alert> + )} + </Box> + )} + </Box> + </> ); }; diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index 2a4af2a28..82b490353 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -120,10 +120,26 @@ msgstr "{days_before} {day_plural} till overdue" msgid "{days, plural, one {day} two {days} few {days} many {days} zero {days} other {days}}" msgstr "{days, plural, one {day} two {days} few {days} many {days} zero {days} other {days}}" +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:104 +msgid "{issueDate}" +msgstr "{issueDate}" + +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:125 +msgid "{item}" +msgstr "{item}" + #: src/ui/DueDateCell/DueDateCell.tsx:45 msgid "{overdueDays} {0} overdue" msgstr "{overdueDays} {0} overdue" +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:186 +msgid "{paymentDate}" +msgstr "{paymentDate}" + +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:134 +msgid "{repaymentDate}" +msgstr "{repaymentDate}" + #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/OverdueReminderForm.tsx:272 msgid "+ Add reminder" msgstr "+ Add reminder" @@ -1190,7 +1206,7 @@ msgstr "Business/Secretarial Schools" msgid "Buying/Shopping Services" msgstr "Buying/Shopping Services" -#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:377 +#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:382 msgid "by" msgstr "by" @@ -2112,7 +2128,7 @@ msgstr "Cuba" msgid "Currency" msgstr "Currency" -#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:150 +#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:154 msgid "Current status" msgstr "Current status" @@ -2125,7 +2141,7 @@ msgstr "Current status" #: src/components/counterparts/CounterpartStatusChip/CounterpartStatusChip.tsx:100 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:162 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/CustomerSection.tsx:409 -#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:137 +#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:141 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/sections/PreviewCustomerSection.tsx:56 #: src/components/receivables/InvoicesTable/InvoicesTable.tsx:210 #: src/components/receivables/QuotesTable/QuotesTable.tsx:184 @@ -2470,6 +2486,10 @@ msgstr "Dominican Peso" msgid "Dominican Republic" msgstr "Dominican Republic" +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:136 +msgid "Don't wait for the payment" +msgstr "Don't wait for the payment" + #: src/components/onboarding/hooks/useOnboardingActions.ts:140 msgid "Done, continue" msgstr "Done, continue" @@ -3066,6 +3086,10 @@ msgstr "File successfully attached" msgid "Financial Institutions" msgstr "Financial Institutions" +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:119 +msgid "Financing plan 1" +msgstr "Financing plan 1" + #: src/components/onboarding/dicts/mccCodes.ts:625 msgid "Fines - Government Administrative Entities" msgstr "Fines - Government Administrative Entities" @@ -3114,6 +3138,10 @@ msgstr "Florists Supplies, Nursery Stock, and Flowers" msgid "Flow" msgstr "Flow" +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:94 +msgid "For {invoiceAmount} | Issued {issueDate}" +msgstr "For {invoiceAmount} | Issued {issueDate}" + #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:236 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:291 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:346 @@ -3206,6 +3234,14 @@ msgstr "Fulfillment date" msgid "Full name" msgstr "Full name" +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:70 +msgid "Funding details" +msgstr "Funding details" + +#: src/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard.tsx:52 +msgid "Funding for {invoiceAmount}" +msgstr "Funding for {invoiceAmount}" + #: src/components/onboarding/dicts/mccCodes.ts:660 msgid "Funeral Services, Crematories" msgstr "Funeral Services, Crematories" @@ -3254,6 +3290,10 @@ msgstr "Germany" #~ msgid "Germany Frankfurt am Main" #~ msgstr "Germany Frankfurt am Main" +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:167 +msgid "Get paid now" +msgstr "Get paid now" + #: src/core/utils/countries.ts:100 msgid "Ghana" msgstr "Ghana" @@ -3646,6 +3686,7 @@ msgstr "Invalid issuance" msgid "Invoice" msgstr "Invoice" +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:86 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/ExistingReceivableDetails.tsx:177 msgid "Invoice {0}" msgstr "Invoice {0}" @@ -3725,7 +3766,7 @@ msgstr "Invoice Reminder type is not provided" msgid "Invoice to “{0}” was created" msgstr "Invoice to “{0}” was created" -#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:162 +#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:166 msgid "Invoice total" msgstr "Invoice total" @@ -3813,7 +3854,7 @@ msgstr "Issued" msgid "Issued documents" msgstr "Issued documents" -#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:377 +#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:382 msgid "Issued on" msgstr "Issued on" @@ -4104,7 +4145,7 @@ msgstr "Line 1" msgid "Line 2" msgstr "Line 2" -#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:181 +#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:185 msgid "Linked documents" msgstr "Linked documents" @@ -4117,6 +4158,7 @@ msgid "Loading payment page..." msgstr "Loading payment page..." #: src/components/counterparts/CounterpartDetails/CounterpartView/useCounterpartView.tsx:113 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:166 msgid "Loading..." msgstr "Loading..." @@ -5086,6 +5128,10 @@ msgstr "Payables purchase order" #~ msgid "Payment" #~ msgstr "Payment" +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:183 +msgid "Payment amount" +msgstr "Payment amount" + #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/sections/PreviewPaymentDetailsSection.tsx:15 msgid "Payment details" msgstr "Payment details" @@ -5611,6 +5657,10 @@ msgstr "Receivables tabs" msgid "Received" msgstr "Received" +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:159 +msgid "Received sum" +msgstr "Received sum" + #: src/components/userRoles/consts.ts:41 msgid "Reconciliation" msgstr "Reconciliation" @@ -5734,7 +5784,7 @@ msgstr "Remind" msgid "Reminder {0}" msgstr "Reminder {0}" -#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:231 +#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:235 msgid "Reminder emails" msgstr "Reminder emails" @@ -5743,7 +5793,7 @@ msgstr "Reminder emails" msgid "Reminder has been created" msgstr "Reminder has been created" -#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:299 +#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:304 msgid "Reminder has been deleted" msgstr "Reminder has been deleted" @@ -5783,6 +5833,18 @@ msgstr "Removing an executive role from this person is not allowed" msgid "Reopen" msgstr "Reopen" +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:131 +msgid "Repayment on" +msgstr "Repayment on" + +#: src/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard.tsx:55 +msgid "Repayment on {repaymentDate}" +msgstr "Repayment on {repaymentDate}" + +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:167 +msgid "Repayment sum" +msgstr "Repayment sum" + #: src/components/receivables/InvoiceDetails/CreateReceivable/components/ProductsTable.tsx:555 msgid "Replace items" msgstr "Replace items" @@ -6084,6 +6146,10 @@ msgstr "Serbian Dinar" msgid "Service" msgstr "Service" +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:163 +msgid "Service Fee" +msgstr "Service Fee" + #: src/components/onboarding/dicts/mccCodes.ts:1180 msgid "Service Stations" msgstr "Service Stations" @@ -6326,6 +6392,7 @@ msgstr "Stationery Stores, Office, and School Supply Stores" #: src/components/approvalRequests/ApprovalRequestsTable/ApprovalRequestsTable.tsx:222 #: src/components/payables/PayablesTable/Filters/Filters.tsx:53 #: src/components/payables/PayablesTable/Filters/Filters.tsx:56 +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:137 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/ReceivableRecurrence/InvoiceRecurrenceIterations.tsx:57 #: src/components/receivables/ReceivableFilters/ReceivableFilters.tsx:76 #: src/components/receivables/ReceivableFilters/ReceivableFilters.tsx:79 @@ -6622,6 +6689,10 @@ msgstr "The following fields are required:" msgid "The IBAN should correspond to the chosen country - {country}." msgstr "The IBAN should correspond to the chosen country - {country}." +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:143 +msgid "The issue date should be less than 7 days ago. You can't fund overdue invoices. The loan sum must be within your remaining limit." +msgstr "The issue date should be less than 7 days ago. You can't fund overdue invoices. The loan sum must be within your remaining limit." + #: src/components/onboarding/OnboardingPersonsReview/OnboardingPersonsReview.tsx:57 msgid "The review for the persons has been completed. You can proceed to the next step." msgstr "The review for the persons has been completed. You can proceed to the next step." @@ -6705,6 +6776,10 @@ msgstr "This action can't be undone." msgid "This form must be filled out by someone with significant control and management of your business. If that’s not you, make sure to ask the right person to continue." msgstr "This form must be filled out by someone with significant control and management of your business. If that’s not you, make sure to ask the right person to continue." +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:140 +msgid "This invoice can be financed" +msgstr "This invoice can be financed" + #: src/components/payables/PayableDetails/PayableDetailsAttachFile/PayableDetailsAttachFile.tsx:186 #: src/components/payables/PayableDetails/PayableDetailsNoAttachedFile/PayableDetailsNoAttachedFile.tsx:30 msgid "This invoice doesn't have a file attached." @@ -7031,7 +7106,7 @@ msgstr "Units" msgid "Unknown" msgstr "Unknown" -#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:366 +#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:371 msgid "Unknown date" msgstr "Unknown date" @@ -7442,7 +7517,7 @@ msgctxt "InvoicesTableRowActionMenu" msgid "View" msgstr "View" -#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:204 +#: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:208 msgid "View all" msgstr "View all" @@ -7494,6 +7569,10 @@ msgstr "Who needs to approve the document and how:" msgid "Wholesale Clubs" msgstr "Wholesale Clubs" +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:151 +msgid "Why?" +msgstr "Why?" + #: src/components/onboarding/dicts/mccCodes.ts:1440 msgid "Wig and Toupee Stores" msgstr "Wig and Toupee Stores" From e942b9c31fbe4a3f33d7d0c1cfe14efff45ef6a7 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Fri, 6 Dec 2024 12:52:39 +0000 Subject: [PATCH 06/49] docs(changeset): feat(DEV-13306): add financing tab --- .changeset/beige-birds-type.md | 5 + .../Financing/FinanceTab/FinanceLimit.tsx | 163 +++++++ .../Financing/FinanceTab/FinanceOffers.tsx | 95 ++++ .../Financing/FinanceTab/FinanceSummary.tsx | 36 ++ .../FinanceTab/FinanceTab.stories.tsx | 34 ++ .../Financing/FinanceTab/FinanceTab.tsx | 42 ++ .../FinanceTab/FinancedInvoicesTable.tsx | 421 ++++++++++++++++++ .../Financing/FinanceTab/index.tsx | 1 + .../ExistingInvoiceDetails.tsx | 2 +- .../ReceivablesTable/ReceivablesTable.tsx | 18 + .../src/core/i18n/locales/en/messages.po | 71 ++- .../src/core/utils/createThemeWithDefaults.ts | 4 + 12 files changed, 890 insertions(+), 2 deletions(-) create mode 100644 .changeset/beige-birds-type.md create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceLimit.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceSummary.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.stories.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/index.tsx diff --git a/.changeset/beige-birds-type.md b/.changeset/beige-birds-type.md new file mode 100644 index 000000000..4f3f32865 --- /dev/null +++ b/.changeset/beige-birds-type.md @@ -0,0 +1,5 @@ +--- +'@monite/sdk-react': minor +--- + +feat(DEV-13306): add financing tab diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceLimit.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceLimit.tsx new file mode 100644 index 000000000..05e90c77f --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceLimit.tsx @@ -0,0 +1,163 @@ +import { components } from '@/api'; +import { useCurrencies } from '@/core/hooks'; +// import { useMenuButton } from '@/core/hooks'; +import { t } from '@lingui/macro'; +import { useLingui } from '@lingui/react'; +// import CancelIcon from '@mui/icons-material/Cancel'; +// import EmailIcon from '@mui/icons-material/MailOutline'; +// import MoreHorizIcon from '@mui/icons-material/MoreHoriz'; +import { + Box, + CircularProgress, // Button, + // CircularProgress, + // List, + // ListItem, + // MenuItem, + Typography, +} from '@mui/material'; + +// import { StyledMenu } from '../../InvoiceDetails/ExistingInvoiceDetails/ExistingInvoiceDetails'; +import { FinanceCardStack } from '../infographics/FinanceCardStack'; + +// type Props = {}; + +export const FinanceLimit = ({ + isLoading, + offers, +}: { + isLoading: boolean; + offers?: components['schemas']['FinancingOffer'][]; +}) => { + const { i18n } = useLingui(); + // const { buttonProps, menuProps } = useMenuButton(); + const { formatCurrencyToDisplay } = useCurrencies(); + const totalLimit = offers?.[0]?.total_amount ?? 0; + const remainingLimit = offers?.[0]?.available_amount ?? 0; + const progress = (remainingLimit / totalLimit) * 100; + + if (isLoading) { + return <CircularProgress color="inherit" size={20} />; + } + + if (!offers || offers.length === 0) { + return null; + } + + return ( + <Box> + <Typography variant="subtitle1">{t(i18n)`My financing`}</Typography> + <Box + sx={{ + mt: 2, + borderRadius: 3, + backgroundColor: 'rgba(205, 201, 255, 1)', + p: 4, + overflow: 'hidden', + position: 'relative', + }} + > + <FinanceCardStack + sx={{ + position: 'absolute', + width: '360px', + height: '206px', + bottom: 0, + right: 0, + zIndex: 0, + }} + /> + <Box + sx={{ + gap: 4, + display: 'flex', + flexDirection: 'column', + position: 'relative', + zIndex: 1, + }} + > + <Box> + <Typography variant="body1" mt={1}> + {t(i18n)`Remaining limit`} + </Typography> + <Typography variant="h2"> + {formatCurrencyToDisplay(remainingLimit ?? 0, 'USD')}{' '} + <Typography + component="span" + variant="subtitle1" + sx={{ color: 'white' }} + > + / {formatCurrencyToDisplay(totalLimit ?? 0, 'USD')} + </Typography> + </Typography> + </Box> + {/* Progress bar */} + <Box> + <Box + sx={{ + backgroundColor: 'white', + width: '100%', + height: '6px', + borderRadius: '3px', + }} + > + <Box + sx={{ + backgroundColor: 'rgba(153, 153, 255, 1)', + width: `${progress}%`, + height: '6px', + borderRadius: '3px', + }} + ></Box> + </Box> + <Typography variant="body1" mt={4}> + {t(i18n)` + Your remaining limit is the amount available to you for financing additional invoices + `} + </Typography> + </Box> + {/* Action buttons */} + {/* <Box + sx={{ + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + }} + > + <Box sx={{ display: 'flex', gap: 1 }}> + <Button + sx={{ backgroundColor: 'black' }} + variant="contained" + >{t(i18n)`Finance invoices`}</Button> + <Button sx={{ color: 'black' }}>{t( + i18n + )`Payment schedule`}</Button> + </Box> + <Box> + <Button + {...buttonProps} + variant="text" + color="primary" + disableElevation + endIcon={<MoreHorizIcon sx={{ color: 'black' }} />} + ></Button> + <StyledMenu {...menuProps}> + <MenuItem onClick={() => {}}> + <EmailIcon fontSize="small" /> + {t(i18n)`Some action`} + </MenuItem> + <MenuItem + onClick={(event) => { + event.preventDefault(); + }} + > + <CancelIcon fontSize="small" /> + {t(i18n)`Cancel Invoice`} + </MenuItem> + </StyledMenu> + </Box> + </Box> */} + </Box> + </Box> + </Box> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx new file mode 100644 index 000000000..fc782db16 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx @@ -0,0 +1,95 @@ +import { Fragment } from 'react'; + +import { components } from '@/api'; +import { t } from '@lingui/macro'; +import { useLingui } from '@lingui/react'; +import { + Box, // Button, + CircularProgress, + List, + ListItem, // MenuItem, + Typography, +} from '@mui/material'; + +export const FinanceOffers = ({ + isLoading, + offers, +}: { + isLoading: boolean; + offers?: components['schemas']['FinancingOffer'][]; +}) => { + const { i18n } = useLingui(); + + if (isLoading) { + return <CircularProgress color="inherit" size={20} />; + } + + if (!offers || offers.length === 0) { + return null; + } + + return ( + <Box> + <Typography variant="subtitle1">{t(i18n)`Current offer`}</Typography> + <Box + mt={2} + sx={{ display: 'grid', gap: 2, gridTemplateColumns: '1fr 1fr' }} + > + {offers.map((offer, index) => ( + <Box + key={offer.total_amount} + width="100%" + p={3} + sx={{ + backgroundColor: 'rgba(0, 0, 0, 0.02)', + borderRadius: 3, + }} + > + <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}> + <Box + sx={{ + backgroundColor: 'black', + color: 'white', + borderRadius: 1, + width: '24px', + height: '24px', + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + }} + > + {index + 1} + </Box> + <Typography + variant="body1" + fontWeight={500} + sx={{ flex: '1 1 0%', width: '100%' }} + >{t(i18n)`Finance plan`}</Typography> + </Box> + <List sx={{ mt: 1 }}> + {offer.pricing_plans.map((item) => ( + <Fragment key={item.advance_rate_percentage}> + <ListItem sx={{ p: 0 }}> + <Typography variant="body1">{t( + i18n + )`${item.advance_rate_percentage}% advance rate`}</Typography> + </ListItem> + <ListItem sx={{ p: 0 }}> + <Typography variant="body1">{t( + i18n + )`Pay in ${item.repayment_duration_days}`}</Typography> + </ListItem> + <ListItem sx={{ p: 0 }}> + <Typography variant="body1">{t( + i18n + )`${item.fee_percentage}% fee`}</Typography> + </ListItem> + </Fragment> + ))} + </List> + </Box> + ))} + </Box> + </Box> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceSummary.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceSummary.tsx new file mode 100644 index 000000000..ed1b12a37 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceSummary.tsx @@ -0,0 +1,36 @@ +import { useGetFinanceOffers } from '@/core/queries/useFinancing'; +import { Box, CircularProgress } from '@mui/material'; + +import { FinanceLimit } from './FinanceLimit'; +import { FinanceOffers } from './FinanceOffers'; + +// type Props = {}; + +export const FinanceSummary = () => { + const { isLoading, data } = useGetFinanceOffers(); + + if (isLoading) { + return <CircularProgress color="inherit" size={20} />; + } + + if (!data?.offers || data.offers.length === 0) { + return null; + } + + return ( + <Box sx={{ display: 'flex', justifyContent: 'space-between', gap: 2 }}> + {/* Limit */} + <Box sx={{ flex: '1 1 0%', maxWidth: '496px', width: '100%' }}> + <FinanceLimit isLoading={isLoading} offers={data?.offers} /> + </Box> + {/* Current offer */} + <Box + sx={{ + width: '542px', + }} + > + <FinanceOffers isLoading={isLoading} offers={data?.offers} /> + </Box> + </Box> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.stories.tsx new file mode 100644 index 000000000..52a6ffdbe --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.stories.tsx @@ -0,0 +1,34 @@ +import { MemoryRouter } from 'react-router-dom'; + +import { css } from '@emotion/react'; +import { StoryObj } from '@storybook/react'; + +import { FinanceTab as FinanceTabComponent } from './FinanceTab'; + +const Story = { + title: 'Financing/FinanceTab', + component: FinanceTabComponent, +}; + +type Story = StoryObj<typeof FinanceTabComponent>; + +export const FinanceTab: Story = { + args: {}, + render: () => ( + <div + css={css` + box-sizing: border-box; + display: flex; + flex-direction: column; + height: 100vh; + padding: 20px; + `} + > + <MemoryRouter> + <FinanceTabComponent /> + </MemoryRouter> + </div> + ), +}; + +export default Story; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx new file mode 100644 index 000000000..fd5b68285 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx @@ -0,0 +1,42 @@ +import { useFinancing } from '@/core/queries/useFinancing'; +import { DataGridEmptyState } from '@/ui/DataGridEmptyState'; +import { t } from '@lingui/macro'; +import { useLingui } from '@lingui/react'; +import { CircularProgress, Stack, Typography } from '@mui/material'; + +// import { FinancedInvoicesTable } from './FinancedInvoicesTable'; +import { FinanceSummary } from './FinanceSummary'; + +export const FinanceTab = () => { + const { i18n } = useLingui(); + + const { isLoading, isEnabled } = useFinancing(); + + if (isLoading) { + return <CircularProgress color="inherit" size={20} />; + } + + if (!isEnabled) { + return ( + <Typography mt={4} variant="subtitle1">{t( + i18n + )`Currently only supported for US entities`}</Typography> + ); + } + + return ( + <Stack mt={4} gap={4}> + <FinanceSummary /> + + <DataGridEmptyState + title={t(i18n)`No financed invoices yet`} + descriptionLine1={t( + i18n + )`Select invoices you would like to finance and send them for review.`} + descriptionLine2={t(i18n)`What invoices can be financed?.`} + type="no-data" + /> + {/* <FinancedInvoicesTable /> */} + </Stack> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx new file mode 100644 index 000000000..c71dfde02 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx @@ -0,0 +1,421 @@ +import { useMemo, useState } from 'react'; + +import { components } from '@/api'; +import { ScopedCssBaselineContainerClassName } from '@/components/ContainerCssBaseline'; +import { InvoiceRecurrenceStatusChip } from '@/components/receivables/InvoiceRecurrenceStatusChip'; +import { InvoiceStatusChip } from '@/components/receivables/InvoiceStatusChip'; +import { ReceivableFilters } from '@/components/receivables/ReceivableFilters/ReceivableFilters'; +import { + ReceivableFilterType, + ReceivablesTabFilter, +} from '@/components/receivables/ReceivablesTable/types'; +import { useMoniteContext } from '@/core/context/MoniteContext'; +import { MoniteScopedProviders } from '@/core/context/MoniteScopedProviders'; +import { + defaultCounterpartColumnWidth, // useAreCounterpartsLoading, + useAutosizeGridColumns, +} from '@/core/hooks/useAutosizeGridColumns'; +import { useCurrencies } from '@/core/hooks/useCurrencies'; +import { useGetFinancedInvoices } from '@/core/queries/useFinancing'; +// import { useReceivables } from '@/core/queries/useReceivables'; +import { ReceivableCursorFields } from '@/enums/ReceivableCursorFields'; +import { CounterpartCellById } from '@/ui/CounterpartCell'; +import { DataGridEmptyState } from '@/ui/DataGridEmptyState'; +import { GetNoRowsOverlay } from '@/ui/DataGridEmptyState/GetNoRowsOverlay'; +import { DueDateCell } from '@/ui/DueDateCell'; +import { + TablePagination, + useTablePaginationThemeDefaultPageSize, +} from '@/ui/table/TablePagination'; +import { classNames } from '@/utils/css-utils'; +import { useDateFormat } from '@/utils/MoniteOptions'; +import { t } from '@lingui/macro'; +import { useLingui } from '@lingui/react'; +import { Sync } from '@mui/icons-material'; +import { Box, Skeleton, Typography } from '@mui/material'; +import { + DataGrid, + GridColDef, + GridSortDirection, + GridSortModel, +} from '@mui/x-data-grid'; + +import { + useInvoiceRowActionMenuCell, + UseInvoiceRowActionMenuCellProps, +} from '../../InvoicesTable/useInvoiceRowActionMenuCell'; +import { useReceivablesFilters } from '../../ReceivableFilters/useReceivablesFilters'; + +interface FinancedInvoicesTableBaseProps { + /** + * The event handler for a row click. + * + * @param id - The identifier of the clicked row, a string. + */ + onRowClick?: (id: string) => void; + + /** + * The event handler for the creation new invoice for no data state + * + @param {boolean} isOpen - A boolean value indicating whether the dialog should be open (true) or closed (false). + */ + setIsCreateInvoiceDialogOpen?: (isOpen: boolean) => void; + + /** + * The query to be used for the Table + */ + query?: ReceivablesTabFilter; + + /** Filters to be applied to the table */ + filters?: Array<keyof ReceivableFilterType>; +} + +export type FinancedInvoicesTableProps = + | FinancedInvoicesTableBaseProps + | (UseInvoiceRowActionMenuCellProps & FinancedInvoicesTableBaseProps); + +export interface ReceivableGridSortModel { + field: components['schemas']['ReceivableCursorFields']; + sort: NonNullable<GridSortDirection>; +} + +export const FinancedInvoicesTable = (props: FinancedInvoicesTableProps) => ( + <MoniteScopedProviders> + <FinancedInvoicesTableBase {...props} /> + </MoniteScopedProviders> +); + +const FinancedInvoicesTableBase = ({ + onRowClick, + setIsCreateInvoiceDialogOpen, + query, + filters: filtersProp, + ...restProps +}: FinancedInvoicesTableProps) => { + const { i18n } = useLingui(); + + const [paginationToken, setPaginationToken] = useState<string | undefined>( + undefined + ); + + const [pageSize, setPageSize] = useState<number>( + useTablePaginationThemeDefaultPageSize() + ); + + const [sortModel, setSortModel] = useState<ReceivableGridSortModel>({ + field: query?.sort ?? 'created_at', + sort: query?.order ?? 'desc', + }); + + const { formatCurrencyToDisplay } = useCurrencies(); + const { filtersQuery, filters, onChangeFilter } = useReceivablesFilters( + ( + [ + 'document_id__contains', + 'status', + 'counterpart_id', + 'due_date__lte', + ] as const + ).filter((filter) => filtersProp?.includes(filter) ?? true), + query + ); + + const { + data: invoices, + isLoading, + isError, + refetch, + } = useGetFinancedInvoices({ + // ...filtersQuery, + // sort: sortModel?.field, + order: sortModel?.sort, + limit: pageSize, + pagination_token: paginationToken, + // type: 'invoice', + }); + + // const { + // data: invoices, + // isLoading, + // isError, + // refetch, + // } = useReceivables({ + // ...filtersQuery, + // sort: sortModel?.field, + // order: sortModel?.sort, + // limit: pageSize, + // pagination_token: paginationToken, + // type: 'invoice', + // }); + + const collection = invoices; + const collectionData = collection?.data; + + const onChangeSort = (model: GridSortModel) => { + setSortModel(model[0] as ReceivableGridSortModel); + setPaginationToken(undefined); + }; + + const invoiceActionCell = useInvoiceRowActionMenuCell({ + rowActions: 'rowActions' in restProps ? restProps.rowActions : undefined, + onRowActionClick: + 'onRowActionClick' in restProps ? restProps.onRowActionClick : undefined, + }); + + // const areCounterpartsLoading = useAreCounterpartsLoading(collectionData); + const dateFormat = useDateFormat(); + + const columns = useMemo< + GridColDef<components['schemas']['FinancingInvoice']>[] + >(() => { + return [ + { + field: 'document_id', + headerName: t(i18n)`Number`, + sortable: false, + width: 100, + renderCell: ({ value }) => { + /* + if (row.status === 'recurring') + return ( + <Typography + className="Monite-TextOverflowContainer" + color="text.primary" + component="span" + variant="body2" + sx={{ + alignItems: 'center', + display: 'inline-flex', + verticalAlign: 'middle', + fontSize: 'inherit', + gap: 0.5, + }} + > + <Sync fontSize="small" color="inherit" /> + {t(i18n)`Recurring`} + </Typography> + ); + + */ + + if (!value) { + return ( + <span className="Monite-TextOverflowContainer"> + <Typography + color="text.secondary" + component="span" + fontSize="inherit" + >{t(i18n)`INV-auto`}</Typography> + </span> + ); + } + + return <span className="Monite-TextOverflowContainer">{value}</span>; + }, + }, + { + field: 'counterpart_name', + headerName: t(i18n)`Customer`, + sortable: ReceivableCursorFields.includes('counterpart_name'), + display: 'flex', + width: defaultCounterpartColumnWidth, + renderCell: (params) => ( + <Typography>{params.row.payer_business_name}</Typography> + // <CounterpartCellById counterpartId={params.row.} /> + ), + }, + { + field: 'status', + headerName: t(i18n)`Status`, + sortable: ReceivableCursorFields.includes('status'), + width: 80, + renderCell: ({ value: status }) => { + // if (row.type === 'invoice' && row.recurrence_id) { + // return ( + // <InvoiceRecurrenceStatusChipLoader + // recurrenceId={row.recurrence_id} + // /> + // ); + // } + + return <InvoiceStatusChip status={status} />; + }, + }, + { + field: 'total_amount', + headerName: t(i18n)`Amount due`, + headerAlign: 'right', + align: 'right', + sortable: ReceivableCursorFields.includes('amount'), + width: 120, + valueGetter: (_, row) => { + const value = row.total_amount; + + return value ? formatCurrencyToDisplay(value, row.currency) : ''; + }, + }, + // Loan sum + // Financing date + // Payment date + // Financing + { + field: 'created_at', + headerName: t(i18n)`Created on`, + sortable: false, + width: 140, + valueFormatter: (value) => (value ? i18n.date(value, dateFormat) : '—'), + }, + { + field: 'issue_date', + headerName: t(i18n)`Issue date`, + sortable: false, + width: 120, + valueFormatter: (value) => (value ? i18n.date(value, dateFormat) : '—'), + }, + { + field: 'due_date', + headerName: t(i18n)`Due date`, + sortable: false, + width: 120, + valueFormatter: (value) => (value ? i18n.date(value, dateFormat) : '—'), + // renderCell: (params) => <DueDateCell data={params.row} />, + }, + ...(invoiceActionCell ? [invoiceActionCell] : []), + ]; + }, [formatCurrencyToDisplay, i18n, invoiceActionCell, dateFormat]); + + const gridApiRef = useAutosizeGridColumns( + collectionData, + columns, + false, + // eslint-disable-next-line lingui/no-unlocalized-strings + 'FinancedInvoicesTable' + ); + + const isFiltering = Object.keys(filters).some( + (key) => + filters[key as keyof typeof filters] !== null && + filters[key as keyof typeof filters] !== undefined + ); + + const isSearching = + !!filters['document_id__contains' as keyof typeof filters]; + + if ( + !isLoading && + collectionData?.length === 0 && + !isFiltering && + !isSearching + ) { + return ( + <DataGridEmptyState + title={t(i18n)`No financed invoices yet`} + descriptionLine1={t( + i18n + )`Select invoices you would like to finance and send them for review.`} + descriptionLine2={t(i18n)`What invoices can be financed?.`} + type="no-data" + /> + ); + } + + const className = 'Monite-FinancedInvoicesTable'; + + return ( + <Box + className={classNames(ScopedCssBaselineContainerClassName, className)} + sx={{ + display: 'flex', + flexDirection: 'column', + overflow: 'hidden', + height: 'inherit', + pt: 2, + }} + > + <Typography variant="subtitle1">{t(i18n)`Financed invoices`}</Typography> + {/* <Box sx={{ mt: 2 }}> + <ReceivableFilters + filters={filters} + onChange={(field, value) => { + setPaginationToken(undefined); + onChangeFilter(field, value); + }} + /> + </Box> */} + + <DataGrid + // initialState={{ + // sorting: { + // sortModel: sortModel && [sortModel], + // }, + // }} + apiRef={gridApiRef} + rowSelection={false} + disableColumnFilter={true} + loading={isLoading} + onSortModelChange={onChangeSort} + onRowClick={(params) => onRowClick?.(params.row.id)} + slots={{ + pagination: () => ( + <TablePagination + nextPage={invoices?.next_pagination_token} + prevPage={invoices?.prev_pagination_token} + paginationModel={{ + pageSize, + page: paginationToken, + }} + onPaginationModelChange={({ page, pageSize }) => { + setPageSize(pageSize); + setPaginationToken(page ?? undefined); + }} + /> + ), + noRowsOverlay: () => ( + <GetNoRowsOverlay + isLoading={isLoading} + dataLength={collectionData?.length || 0} + isFiltering={isFiltering} + isSearching={isSearching} + isError={isError} + // onCreate={() => setIsCreateInvoiceDialogOpen?.(true)} + refetch={refetch} + entityName={t(i18n)`Invoices`} + // actionButtonLabel={t(i18n)`Create Invoice`} + actionOptions={[t(i18n)`Invoice`]} + type="no-data" + /> + ), + }} + columns={columns} + rows={collectionData ?? []} + /> + </Box> + ); +}; + +// const InvoiceRecurrenceStatusChipLoader = ({ +// recurrenceId, +// }: { +// recurrenceId: string; +// }) => { +// const { api } = useMoniteContext(); + +// const { data: recurrence, isLoading } = +// api.recurrences.getRecurrencesId.useQuery({ +// path: { recurrence_id: recurrenceId }, +// }); + +// if (isLoading) { +// return ( +// <Skeleton +// variant="rounded" +// width="100%" +// sx={{ display: 'inline-block' }} +// /> +// ); +// } + +// if (!recurrence?.status) return null; + +// return <InvoiceRecurrenceStatusChip status={recurrence.status} />; +// }; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/index.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/index.tsx new file mode 100644 index 000000000..3a377c387 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/index.tsx @@ -0,0 +1 @@ +export * from './FinanceTab'; diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/ExistingInvoiceDetails.tsx b/packages/sdk-react/src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/ExistingInvoiceDetails.tsx index 56adbb94b..f6c81593e 100644 --- a/packages/sdk-react/src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/ExistingInvoiceDetails.tsx +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/ExistingInvoiceDetails.tsx @@ -51,7 +51,7 @@ import { useExistingInvoiceDetails, } from './useExistingInvoiceDetails'; -const StyledMenu = styled((props: MenuProps) => { +export const StyledMenu = styled((props: MenuProps) => { const { root } = useRootElements(); return ( diff --git a/packages/sdk-react/src/components/receivables/ReceivablesTable/ReceivablesTable.tsx b/packages/sdk-react/src/components/receivables/ReceivablesTable/ReceivablesTable.tsx index de028d95d..891904b10 100644 --- a/packages/sdk-react/src/components/receivables/ReceivablesTable/ReceivablesTable.tsx +++ b/packages/sdk-react/src/components/receivables/ReceivablesTable/ReceivablesTable.tsx @@ -15,6 +15,8 @@ import { useLingui } from '@lingui/react'; import { Box, Tab, Tabs } from '@mui/material'; import { useThemeProps } from '@mui/material/styles'; +import { FinanceTab } from '../Financing/FinanceTab/FinanceTab'; + interface ReceivablesTableControlledProps { /** Event handler for tab change */ onTabChange: (tab: number) => void; @@ -47,6 +49,7 @@ export enum ReceivablesTableTabEnum { Invoices, Quotes, CreditNotes, + Financing, } interface ReceivablesTableBaseProps { @@ -255,6 +258,21 @@ const ReceivablesTableBase = ({ /> </Box> )} + {activeTabItem?.query?.type === 'financing' && ( + <Box + role="tabpanel" + id={`${tabsIdBase}-${activeTabIndex}-tabpanel`} + aria-labelledby={`${tabsIdBase}-${activeTabIndex}-tab`} + sx={{ + display: 'flex', + flexDirection: 'column', + height: 'inherit', + minHeight: '0', + }} + > + <FinanceTab /> + </Box> + )} </> ); }; diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index 2a4af2a28..7ba8331e5 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -100,6 +100,14 @@ msgstr "{0} has been updated" msgid "{0}/{1} issued" msgstr "{0}/{1} issued" +#: src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx:73 +msgid "{0}% advance rate" +msgstr "{0}% advance rate" + +#: src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx:83 +msgid "{0}% fee" +msgstr "{0}% fee" + #: src/core/utils/getBankAccountName.tsx:14 msgid "{bankAccountName} (Default)" msgstr "{bankAccountName} (Default)" @@ -525,6 +533,7 @@ msgstr "American Samoa" msgid "Amount" msgstr "Amount" +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:246 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/TabPanels/PaymentTabPanel/PaymentTabPanel.tsx:86 msgid "Amount due" msgstr "Amount due" @@ -2055,6 +2064,7 @@ msgid "Created by user" msgstr "Created by user" #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:150 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:263 #: src/components/receivables/InvoicesTable/InvoicesTable.tsx:220 #: src/components/receivables/QuotesTable/QuotesTable.tsx:171 #: src/components/userRoles/UserRolesTable/Filters/Filters.tsx:41 @@ -2112,10 +2122,18 @@ msgstr "Cuba" msgid "Currency" msgstr "Currency" +#: src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx:33 +msgid "Current offer" +msgstr "Current offer" + #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:150 msgid "Current status" msgstr "Current status" +#: src/components/receivables/Financing/FinanceTab/FinanceTab.tsx:21 +msgid "Currently only supported for US entities" +msgstr "Currently only supported for US entities" + #: src/components/counterparts/CounterpartDetails/CounterpartForm/CounterpartIndividualForm/CounterpartIndividualForm.tsx:272 #: src/components/counterparts/CounterpartDetails/CounterpartForm/CounterpartIndividualForm/CounterpartIndividualForm.tsx:275 #: src/components/counterparts/CounterpartDetails/CounterpartForm/CounterpartOrganizationForm/CounterpartOrganizationForm.tsx:257 @@ -2124,6 +2142,7 @@ msgstr "Current status" #: src/components/counterparts/CounterpartDetails/CounterpartView/CounterpartOrganizationView/CounterpartOrganizationView.tsx:73 #: src/components/counterparts/CounterpartStatusChip/CounterpartStatusChip.tsx:100 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:162 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:218 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/CustomerSection.tsx:409 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:137 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/sections/PreviewCustomerSection.tsx:56 @@ -2534,6 +2553,7 @@ msgstr "Dry Cleaners" #: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:590 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:319 #: src/components/payables/PayablesTable/Filters/Filters.tsx:81 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:277 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:60 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:235 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:420 @@ -3062,10 +3082,22 @@ msgstr "File size exceeds {maxFileSizeInMB}MB limit." msgid "File successfully attached" msgstr "File successfully attached" +#: src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx:67 +msgid "Finance plan" +msgstr "Finance plan" + +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:335 +msgid "Financed invoices" +msgstr "Financed invoices" + #: src/components/onboarding/dicts/mccCodes.ts:620 msgid "Financial Institutions" msgstr "Financial Institutions" +#: src/core/utils/createThemeWithDefaults.ts:37 +msgid "Financing" +msgstr "Financing" + #: src/components/onboarding/dicts/mccCodes.ts:625 msgid "Fines - Government Administrative Entities" msgstr "Fines - Government Administrative Entities" @@ -3612,6 +3644,7 @@ msgid "Intra-Company Purchases" msgstr "Intra-Company Purchases" #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:142 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:208 #: src/components/receivables/InvoicesTable/InvoicesTable.tsx:192 #: src/components/receivables/QuotesTable/QuotesTable.tsx:163 msgid "INV-auto" @@ -3634,6 +3667,7 @@ msgstr "Invalid issuance" #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:215 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:217 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:284 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:384 #: src/components/receivables/InvoiceDetails/CreateReceivable/CreateReceivables.tsx:241 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/EditInvoiceDetails.tsx:254 #: src/components/receivables/InvoicesTable/InvoicesTable.tsx:286 @@ -3729,6 +3763,7 @@ msgstr "Invoice to “{0}” was created" msgid "Invoice total" msgstr "Invoice total" +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:382 #: src/components/receivables/InvoicesTable/InvoicesTable.tsx:359 #: src/core/utils/createThemeWithDefaults.ts:25 msgid "Invoices" @@ -3783,6 +3818,7 @@ msgstr "Issue at" #: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:559 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:300 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:156 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:270 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:46 #: src/components/receivables/InvoicesTable/InvoicesTable.tsx:227 msgid "Issue date" @@ -4448,6 +4484,10 @@ msgstr "Mozambique" msgid "Music Stores-Musical Instruments, Pianos, and Sheet Music" msgstr "Music Stores-Musical Instruments, Pianos, and Sheet Music" +#: src/components/receivables/Financing/FinanceTab/FinanceLimit.tsx:48 +msgid "My financing" +msgstr "My financing" + #: src/core/utils/countries.ts:168 msgid "Myanmar" msgstr "Myanmar" @@ -4679,6 +4719,11 @@ msgstr "No default email for selected Counterpart. Reminders will not be sent." msgid "No file provided" msgstr "No file provided" +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:312 +#: src/components/receivables/Financing/FinanceTab/FinanceTab.tsx:32 +msgid "No financed invoices yet" +msgstr "No financed invoices yet" + #: src/components/receivables/InvoiceDetails/CreateReceivable/components/ProductsTable.tsx:445 msgid "No items yet" msgstr "No items yet" @@ -4803,6 +4848,7 @@ msgstr "NOT allowed" #: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:412 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:244 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:128 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:174 msgid "Number" msgstr "Number" @@ -5025,6 +5071,10 @@ msgctxt "InvoicesTableRowActionMenu" msgid "Pay" msgstr "Pay" +#: src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx:78 +msgid "Pay in {0}" +msgstr "Pay in {0}" + #: src/components/payables/PayablesTable/PayablesTable.tsx:521 #: src/components/userRoles/consts.ts:51 msgid "Payable" @@ -5603,7 +5653,7 @@ msgid "Receivable type not supported" msgstr "Receivable type not supported" #: src/components/approvalPolicies/RolesAndPolicies.tsx:159 -#: src/components/receivables/ReceivablesTable/ReceivablesTable.tsx:180 +#: src/components/receivables/ReceivablesTable/ReceivablesTable.tsx:183 msgid "Receivables tabs" msgstr "Receivables tabs" @@ -5721,6 +5771,10 @@ msgstr "Religious Organizations" msgid "Reload" msgstr "Reload" +#: src/components/receivables/Financing/FinanceTab/FinanceLimit.tsx:80 +msgid "Remaining limit" +msgstr "Remaining limit" + #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:242 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:297 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:352 @@ -6049,6 +6103,11 @@ msgstr "Select counterpart" msgid "Select invoice currency" msgstr "Select invoice currency" +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:313 +#: src/components/receivables/Financing/FinanceTab/FinanceTab.tsx:33 +msgid "Select invoices you would like to finance and send them for review." +msgstr "Select invoices you would like to finance and send them for review." + #: src/components/onboarding/OnboardingPersonList/OnboardingPersonList.tsx:122 msgid "Select someone" msgstr "Select someone" @@ -6326,6 +6385,7 @@ msgstr "Stationery Stores, Office, and School Supply Stores" #: src/components/approvalRequests/ApprovalRequestsTable/ApprovalRequestsTable.tsx:222 #: src/components/payables/PayablesTable/Filters/Filters.tsx:53 #: src/components/payables/PayablesTable/Filters/Filters.tsx:56 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:229 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/ReceivableRecurrence/InvoiceRecurrenceIterations.tsx:57 #: src/components/receivables/ReceivableFilters/ReceivableFilters.tsx:76 #: src/components/receivables/ReceivableFilters/ReceivableFilters.tsx:79 @@ -7482,6 +7542,11 @@ msgstr "West African CFA Franc" msgid "Western Sahara" msgstr "Western Sahara" +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:316 +#: src/components/receivables/Financing/FinanceTab/FinanceTab.tsx:36 +msgid "What invoices can be financed?." +msgstr "What invoices can be financed?." + #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/ReceivableRecurrence/InvoiceRecurrenceForm.tsx:260 msgid "When you set up the recurrence all future invoices will be issued based on this invoice template. After that you won’t be able to change the invoice template." msgstr "When you set up the recurrence all future invoices will be issued based on this invoice template. After that you won’t be able to change the invoice template." @@ -7645,6 +7710,10 @@ msgstr "You don't have permission to issue this document. Please, contact your s msgid "You don’t have permissions to view this page.<0/>Contact your system administrator for details." msgstr "You don’t have permissions to view this page.<0/>Contact your system administrator for details." +#: src/components/receivables/Financing/FinanceTab/FinanceLimit.tsx:113 +msgid "Your remaining limit is the amount available to you for financing additional invoices" +msgstr "Your remaining limit is the amount available to you for financing additional invoices" + #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/YourVatDetailsForm.tsx:83 msgid "Your Tax ID" msgstr "Your Tax ID" diff --git a/packages/sdk-react/src/core/utils/createThemeWithDefaults.ts b/packages/sdk-react/src/core/utils/createThemeWithDefaults.ts index 0664cdd7c..245540692 100644 --- a/packages/sdk-react/src/core/utils/createThemeWithDefaults.ts +++ b/packages/sdk-react/src/core/utils/createThemeWithDefaults.ts @@ -33,6 +33,10 @@ export const createThemeWithDefaults = ( label: t(i18n)`Credit notes`, query: { type: 'credit_note' }, }, + { + label: t(i18n)`Financing`, + query: { type: 'financing' }, + }, ], }, }, From 3a53ec05527f60ca79b40115dc3e5de7d0fec0b9 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Fri, 6 Dec 2024 12:58:53 +0000 Subject: [PATCH 07/49] docs(changeset): feat(DEV-13398): expose finance components --- .changeset/healthy-roses-travel.md | 5 +++++ .../sdk-react/src/components/receivables/Financing/index.tsx | 4 ++++ packages/sdk-react/src/components/receivables/index.tsx | 1 + 3 files changed, 10 insertions(+) create mode 100644 .changeset/healthy-roses-travel.md create mode 100644 packages/sdk-react/src/components/receivables/Financing/index.tsx diff --git a/.changeset/healthy-roses-travel.md b/.changeset/healthy-roses-travel.md new file mode 100644 index 000000000..79729d369 --- /dev/null +++ b/.changeset/healthy-roses-travel.md @@ -0,0 +1,5 @@ +--- +'@monite/sdk-react': minor +--- + +feat(DEV-13398): expose finance components diff --git a/packages/sdk-react/src/components/receivables/Financing/index.tsx b/packages/sdk-react/src/components/receivables/Financing/index.tsx new file mode 100644 index 000000000..462240fba --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/index.tsx @@ -0,0 +1,4 @@ +export * from './FinanceBanner'; +export * from './FinanceApplicationCard'; +export * from './FinanceTab'; +export * from './FinanceInvoice'; diff --git a/packages/sdk-react/src/components/receivables/index.tsx b/packages/sdk-react/src/components/receivables/index.tsx index 68ca266f4..1f0dfc23a 100644 --- a/packages/sdk-react/src/components/receivables/index.tsx +++ b/packages/sdk-react/src/components/receivables/index.tsx @@ -4,3 +4,4 @@ export * from './CreditNotesTable'; export * from './InvoiceDetails'; export * from './Receivables'; export * from './ReceivablesTable'; +export * from './Financing'; From 879e9d71a74b40c9983221603f5eb62f5e382907 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Mon, 9 Dec 2024 13:12:39 +0000 Subject: [PATCH 08/49] fix: update api schema --- packages/sdk-react/src/api/schema.json | 10947 ++++++++++++----------- 1 file changed, 5595 insertions(+), 5352 deletions(-) diff --git a/packages/sdk-react/src/api/schema.json b/packages/sdk-react/src/api/schema.json index 603335ba1..bde6b27fd 100644 --- a/packages/sdk-react/src/api/schema.json +++ b/packages/sdk-react/src/api/schema.json @@ -49,8 +49,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 500.0, - "minimum": 1.0, + "maximum": 500, + "minimum": 1, "default": 100 }, "name": "limit", @@ -59,7 +59,7 @@ { "description": "Number of results to skip before selecting items to return.", "required": false, - "schema": { "type": "integer", "minimum": 0.0, "default": 0 }, + "schema": { "type": "integer", "minimum": 0, "default": 0 }, "name": "offset", "in": "query" }, @@ -94,19 +94,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -164,19 +164,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -203,8 +203,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 500.0, - "minimum": 1.0, + "maximum": 500, + "minimum": 1, "default": 100 }, "name": "limit", @@ -213,7 +213,7 @@ { "description": "Number of results to skip before selecting items to return.", "required": false, - "schema": { "type": "integer", "minimum": 0.0, "default": 0 }, + "schema": { "type": "integer", "minimum": 0, "default": 0 }, "name": "offset", "in": "query" }, @@ -248,19 +248,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -320,19 +320,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -385,19 +385,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -458,19 +458,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -529,19 +529,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -600,19 +600,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -670,19 +670,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -725,8 +725,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -845,19 +845,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -914,19 +914,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -983,19 +983,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -1032,8 +1032,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -1088,19 +1088,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -1159,19 +1159,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -1529,43 +1529,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -1608,8 +1608,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -1752,24 +1752,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -1791,6 +1783,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -1839,32 +1839,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Possible responses: `Script validation error: {errors}.`", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Possible responses: `Script validation error: {errors}.`", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -1886,6 +1878,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -1934,32 +1934,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -1981,6 +1973,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -2018,32 +2018,24 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -2065,6 +2057,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -2119,22 +2119,6 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "400": { "description": "Possible responses: `Script validation error: {errors}.`", "content": { @@ -2159,6 +2143,14 @@ } } }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "409": { "description": "Conflict", "content": { @@ -2174,6 +2166,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -2222,32 +2222,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -2269,6 +2261,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -2321,32 +2321,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Possible responses: `Approval policy with ID {id} not found.`, `Approval policy process with ID {id} not found.`", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Possible responses: `Approval policy with ID {id} not found.`, `Approval policy process with ID {id} not found.`", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -2368,6 +2360,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -2420,32 +2420,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Possible responses: `Approval policy with ID {id} not found.`, `Approval policy process with ID {id} not found.`", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Possible responses: `Approval policy with ID {id} not found.`, `Approval policy process with ID {id} not found.`", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -2467,6 +2459,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -2521,32 +2521,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Possible responses: `Approval policy with ID {id} not found.`, `Approval policy process with ID {id} not found.`", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Possible responses: `Approval policy with ID {id} not found.`, `Approval policy process with ID {id} not found.`", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -2568,6 +2560,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -2601,8 +2601,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -2760,22 +2760,6 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "400": { "description": "Bad Request", "content": { @@ -2800,6 +2784,14 @@ } } }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "406": { "description": "Not Acceptable", "content": { @@ -2815,6 +2807,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -2864,32 +2864,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -2904,8 +2896,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -2927,6 +2919,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -2974,32 +2974,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -3014,8 +3006,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -3037,6 +3029,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -3084,32 +3084,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -3124,8 +3116,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -3147,6 +3139,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -3194,32 +3194,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -3234,8 +3226,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -3257,6 +3249,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -3304,32 +3304,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -3344,8 +3336,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -3367,6 +3359,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -3449,8 +3449,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "page_size", @@ -3458,7 +3458,7 @@ }, { "required": false, - "schema": { "type": "integer", "minimum": 1.0, "default": 1 }, + "schema": { "type": "integer", "minimum": 1, "default": 1 }, "name": "page_num", "in": "query" }, @@ -3486,19 +3486,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -3549,19 +3549,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -3609,19 +3609,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -3661,35 +3661,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -3741,14 +3741,6 @@ } } }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "409": { "description": "Business logic error", "content": { @@ -3764,6 +3756,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -3822,14 +3822,6 @@ } } }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "409": { "description": "Business logic error", "content": { @@ -3845,64 +3837,6 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } - } - }, - "security": [{ "HTTPBearer": [] }] - } - }, - "/bank_accounts/complete_verification": { - "post": { - "tags": ["Entity bank account verifications"], - "summary": "Complete entity bank account verification", - "operationId": "post_bank_accounts_complete_verification", - "parameters": [ - { - "required": true, - "schema": { "type": "string", "format": "date" }, - "example": "2024-05-25", - "name": "x-monite-version", - "in": "header" - }, - { - "description": "The ID of the entity that owns the requested resource.", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] - }, - "name": "x-monite-entity-id", - "in": "header" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompleteVerificationRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompleteVerificationResponse" - } - } - } - }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } }, "500": { "description": "Internal Server Error", @@ -3911,25 +3845,16 @@ "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } } }, "security": [{ "HTTPBearer": [] }] } }, - "/bank_accounts/start_verification": { + "/bank_accounts/complete_verification": { "post": { "tags": ["Entity bank account verifications"], - "summary": "Start entity bank account verification", - "description": "Start entity bank account verification. The flow depends on verification type.\nFor airwallex_plaid it generates Plaid Link token to init the Plaid SDK.", - "operationId": "post_bank_accounts_start_verification", + "summary": "Complete entity bank account verification", + "operationId": "post_bank_accounts_complete_verification", "parameters": [ { "required": true, @@ -3953,7 +3878,9 @@ "requestBody": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/VerificationRequest" } + "schema": { + "$ref": "#/components/schemas/CompleteVerificationRequest" + } } }, "required": true @@ -3964,7 +3891,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VerificationResponse" + "$ref": "#/components/schemas/CompleteVerificationResponse" } } } @@ -3977,6 +3904,14 @@ } } }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + }, "500": { "description": "Internal Server Error", "content": { @@ -3984,6 +3919,63 @@ "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/bank_accounts/start_verification": { + "post": { + "tags": ["Entity bank account verifications"], + "summary": "Start entity bank account verification", + "description": "Start entity bank account verification. The flow depends on verification type.\nFor airwallex_plaid it generates Plaid Link token to init the Plaid SDK.", + "operationId": "post_bank_accounts_start_verification", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/VerificationRequest" } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VerificationResponse" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } }, "422": { "description": "Validation Error", @@ -3992,6 +3984,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -4040,24 +4040,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -4079,6 +4071,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -4116,24 +4116,16 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -4155,6 +4147,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -4211,24 +4211,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -4250,6 +4242,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -4315,19 +4315,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -4378,24 +4378,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -4417,6 +4409,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -4480,19 +4480,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -4550,19 +4550,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -4624,19 +4624,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -4694,19 +4694,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -4757,8 +4757,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -4825,32 +4825,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -4872,6 +4864,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -4918,24 +4918,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -4950,8 +4942,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -4973,6 +4965,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -5019,24 +5019,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -5051,8 +5043,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -5074,6 +5066,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -5111,24 +5111,16 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -5143,8 +5135,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -5166,6 +5158,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -5218,24 +5218,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -5250,8 +5242,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -5273,6 +5265,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -5352,8 +5352,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -5529,35 +5529,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -5615,19 +5615,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -5675,35 +5675,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -5742,6 +5742,14 @@ ], "responses": { "204": { "description": "Successful Response" }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "405": { "description": "Method Not Allowed", "content": { @@ -5750,6 +5758,14 @@ } } }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + }, "500": { "description": "Internal Server Error", "content": { @@ -5757,6 +5773,58 @@ "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } + } + }, + "security": [{ "HTTPBearer": [] }] + }, + "patch": { + "tags": ["Counterparts"], + "summary": "Update a counterpart", + "operationId": "patch_counterparts_id", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "counterpart_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CounterpartUpdatePayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/CounterpartResponse" } + } + } }, "404": { "description": "Not found", @@ -5766,6 +5834,14 @@ } } }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "422": { "description": "Validation Error", "content": { @@ -5773,14 +5849,24 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] - }, - "patch": { - "tags": ["Counterparts"], - "summary": "Update a counterpart", - "operationId": "patch_counterparts_id", + } + }, + "/counterparts/{counterpart_id}/addresses": { + "get": { + "tags": ["Counterpart addresses"], + "summary": "Get a counterpart's addresses", + "operationId": "get_counterparts_id_addresses", "parameters": [ { "required": true, @@ -5807,43 +5893,27 @@ "in": "header" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CounterpartUpdatePayload" - } - } - }, - "required": true - }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/CounterpartResponse" } - } - } - }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { + "$ref": "#/components/schemas/CounterpartAddressResourceList" + } } } }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -5857,60 +5927,6 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } - } - }, - "security": [{ "HTTPBearer": [] }] - } - }, - "/counterparts/{counterpart_id}/addresses": { - "get": { - "tags": ["Counterpart addresses"], - "summary": "Get a counterpart's addresses", - "operationId": "get_counterparts_id_addresses", - "parameters": [ - { - "required": true, - "schema": { "type": "string", "format": "date" }, - "example": "2024-05-25", - "name": "x-monite-version", - "in": "header" - }, - { - "required": true, - "schema": { "type": "string", "format": "uuid" }, - "name": "counterpart_id", - "in": "path" - }, - { - "description": "The ID of the entity that owns the requested resource.", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] - }, - "name": "x-monite-entity-id", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CounterpartAddressResourceList" - } - } - } - }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } }, "500": { "description": "Internal Server Error", @@ -5919,22 +5935,6 @@ "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } } }, "security": [{ "HTTPBearer": [] }] @@ -5988,35 +5988,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -6072,35 +6072,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -6145,35 +6145,35 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -6237,35 +6237,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -6323,19 +6323,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -6393,35 +6393,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -6477,35 +6477,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -6550,35 +6550,35 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -6642,35 +6642,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -6728,19 +6728,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -6798,19 +6798,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -6868,35 +6868,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -6952,35 +6952,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -7025,35 +7025,35 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -7117,35 +7117,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -7201,35 +7201,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -7287,19 +7287,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -7363,19 +7363,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -7433,19 +7433,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -7501,35 +7501,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -7585,35 +7585,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -7658,35 +7658,35 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -7750,35 +7750,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -7814,8 +7814,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -7892,22 +7892,6 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "400": { "description": "Bad Request", "content": { @@ -7932,6 +7916,14 @@ } } }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "406": { "description": "Not Acceptable", "content": { @@ -7947,6 +7939,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -7994,32 +7994,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -8034,8 +8026,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -8057,6 +8049,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -8090,8 +8090,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -8204,43 +8204,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -8290,51 +8290,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -8382,24 +8382,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -8414,8 +8406,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -8429,6 +8421,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -8472,24 +8472,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -8504,8 +8496,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -8519,6 +8511,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -8572,32 +8572,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -8612,8 +8604,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -8627,6 +8619,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -8680,19 +8680,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -8742,32 +8742,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -8782,8 +8774,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -8797,6 +8789,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -8847,19 +8847,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -8912,19 +8912,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -8982,19 +8982,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -9052,19 +9052,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -9117,19 +9117,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -9166,8 +9166,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -9267,22 +9267,6 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "400": { "description": "Bad Request", "content": { @@ -9307,6 +9291,14 @@ } } }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "406": { "description": "Not Acceptable", "content": { @@ -9322,6 +9314,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -9357,35 +9357,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -9417,35 +9417,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -9484,35 +9484,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -9553,35 +9553,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -9627,35 +9627,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -9695,35 +9695,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -9763,35 +9763,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -9830,19 +9830,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -9896,35 +9896,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -9954,35 +9954,35 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -10021,24 +10021,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -10060,6 +10052,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -10105,24 +10105,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -10144,6 +10136,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "deprecated": true, @@ -10189,24 +10189,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -10228,6 +10220,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -10273,19 +10273,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -10334,19 +10334,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -10400,19 +10400,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -10460,19 +10460,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -10526,19 +10526,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -10578,35 +10578,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -10652,35 +10652,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -10727,19 +10727,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -10782,35 +10782,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -10853,35 +10853,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -10915,35 +10915,35 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -10992,35 +10992,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -11057,8 +11057,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -11186,22 +11186,6 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "400": { "description": "Bad Request", "content": { @@ -11226,6 +11210,14 @@ } } }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "406": { "description": "Not Acceptable", "content": { @@ -11241,6 +11233,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -11289,35 +11289,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -11349,35 +11349,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -11417,35 +11417,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -11477,35 +11477,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -11543,35 +11543,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -11611,19 +11611,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -11672,35 +11672,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -11739,35 +11739,35 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -11824,35 +11824,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -11889,8 +11889,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -11973,19 +11973,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -12032,19 +12032,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -12093,19 +12093,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -12150,19 +12150,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -12207,19 +12207,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -12255,19 +12255,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -12304,8 +12304,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -12548,19 +12548,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -12621,19 +12621,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -12686,19 +12686,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -12751,19 +12751,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -12809,19 +12809,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -12870,19 +12870,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -12930,19 +12930,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -12995,19 +12995,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -13064,19 +13064,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -13119,8 +13119,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -13187,19 +13187,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -13244,19 +13244,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -13302,19 +13302,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -13361,19 +13361,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -13420,19 +13420,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -13487,19 +13487,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -13556,19 +13556,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -13616,19 +13616,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -13675,19 +13675,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -13742,19 +13742,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -13811,19 +13811,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -13880,19 +13880,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -13937,19 +13937,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -14012,19 +14012,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -14077,19 +14077,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -14136,19 +14136,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -14193,35 +14193,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -14260,35 +14260,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -14332,24 +14332,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -14371,6 +14363,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -14414,24 +14414,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -14453,6 +14445,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -14496,35 +14496,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -14578,19 +14578,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -14661,32 +14661,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -14701,8 +14693,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -14716,6 +14708,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -14761,32 +14761,24 @@ "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -14801,8 +14793,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -14816,6 +14808,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -14855,32 +14855,24 @@ "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -14895,8 +14887,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -14910,6 +14902,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -14959,32 +14959,24 @@ "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -14999,8 +14991,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -15014,6 +15006,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -15048,8 +15048,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -15104,19 +15104,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -15175,19 +15175,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -15224,8 +15224,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -15329,19 +15329,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -15391,19 +15391,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -15466,19 +15466,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -15518,19 +15518,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -15578,19 +15578,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -15627,19 +15627,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -15695,19 +15695,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -15755,19 +15755,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -15799,43 +15799,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -15873,22 +15873,6 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "400": { "description": "Bad Request", "content": { @@ -15913,6 +15897,14 @@ } } }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "409": { "description": "Business logic error", "content": { @@ -15928,6 +15920,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -15956,24 +15956,16 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -15988,8 +15980,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -16003,6 +15995,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -16038,32 +16038,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -16078,8 +16070,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -16101,6 +16093,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -16141,43 +16141,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -16226,32 +16226,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -16273,6 +16265,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -16323,43 +16323,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -16401,24 +16401,16 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -16433,8 +16425,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -16448,6 +16440,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -16487,51 +16487,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -16579,22 +16579,6 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "400": { "description": "Bad Request", "content": { @@ -16619,58 +16603,6 @@ } } }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } - } - }, - "security": [{ "HTTPBearer": [] }] - } - }, - "/measure_units/{unit_id}": { - "get": { - "tags": ["Measure units"], - "summary": "Get a measure unit by ID", - "operationId": "get_measure_units_id", - "parameters": [ - { - "required": true, - "schema": { "type": "string", "format": "date" }, - "example": "2024-05-25", - "name": "x-monite-version", - "in": "header" - }, - { - "required": true, - "schema": { "type": "string", "format": "uuid" }, - "name": "unit_id", - "in": "path" - }, - { - "description": "The ID of the entity that owns the requested resource.", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] - }, - "name": "x-monite-entity-id", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/UnitResponse" } - } - } - }, "405": { "description": "Method Not Allowed", "content": { @@ -16679,61 +16611,31 @@ } } }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "403": { - "description": "Forbidden", + "500": { + "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } } }, "security": [{ "HTTPBearer": [] }] - }, - "delete": { + } + }, + "/measure_units/{unit_id}": { + "get": { "tags": ["Measure units"], - "summary": "Delete a measure unit", - "operationId": "delete_measure_units_id", + "summary": "Get a measure unit by ID", + "operationId": "get_measure_units_id", "parameters": [ { "required": true, @@ -16761,7 +16663,46 @@ } ], "responses": { - "204": { "description": "Successful Response" }, + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/UnitResponse" } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "405": { "description": "Method Not Allowed", "content": { @@ -16770,6 +16711,14 @@ } } }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + }, "500": { "description": "Internal Server Error", "content": { @@ -16777,7 +16726,42 @@ "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } + } + }, + "security": [{ "HTTPBearer": [] }] + }, + "delete": { + "tags": ["Measure units"], + "summary": "Delete a measure unit", + "operationId": "delete_measure_units_id", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "unit_id", + "in": "path" }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "responses": { + "204": { "description": "Successful Response" }, "400": { "description": "Bad Request", "content": { @@ -16794,6 +16778,14 @@ } } }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "404": { "description": "Not found", "content": { @@ -16802,8 +16794,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -16817,6 +16809,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -16868,32 +16868,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -16908,8 +16900,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -16923,6 +16915,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -16974,19 +16974,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -17046,19 +17046,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -17111,19 +17111,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -17167,43 +17167,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -17255,51 +17255,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -17349,24 +17349,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -17381,8 +17373,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -17396,6 +17388,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -17432,32 +17432,24 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -17472,8 +17464,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -17487,6 +17479,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -17542,32 +17542,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -17582,8 +17574,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -17597,6 +17589,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -17630,8 +17630,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -17735,49 +17735,49 @@ }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "amount__gt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "amount__lt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "amount__gte", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "amount__lte", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "subtotal__gt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "subtotal__lt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "subtotal__gte", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "subtotal__lte", "in": "query" }, @@ -17852,22 +17852,6 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "400": { "description": "Bad Request", "content": { @@ -17892,6 +17876,14 @@ } } }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "406": { "description": "Not Acceptable", "content": { @@ -17907,6 +17899,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -17954,51 +17954,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -18046,24 +18046,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -18078,8 +18070,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -18093,6 +18085,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -18129,24 +18129,16 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -18161,8 +18153,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -18184,6 +18176,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -18237,6 +18237,30 @@ } } }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "405": { "description": "Method Not Allowed", "content": { @@ -18245,6 +18269,14 @@ } } }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + }, "500": { "description": "Internal Server Error", "content": { @@ -18252,6 +18284,51 @@ "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/payable_credit_notes/{credit_note_id}/approve": { + "post": { + "tags": ["Credit Notes"], + "summary": "Approve a credit note", + "description": "Approve the credit note for appliance.", + "operationId": "post_payable_credit_notes_id_approve", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "credit_note_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/CreditNoteResponse" } + } + } }, "401": { "description": "Unauthorized", @@ -18261,6 +18338,14 @@ } } }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "404": { "description": "Not found", "content": { @@ -18269,8 +18354,16 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "409": { + "description": "Business logic error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -18284,17 +18377,25 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] } }, - "/payable_credit_notes/{credit_note_id}/approve": { + "/payable_credit_notes/{credit_note_id}/cancel": { "post": { "tags": ["Credit Notes"], - "summary": "Approve a credit note", - "description": "Approve the credit note for appliance.", - "operationId": "post_payable_credit_notes_id_approve", + "summary": "Cancel a credit note", + "description": "Cancel the credit note that was not confirmed during the review.", + "operationId": "post_payable_credit_notes_id_cancel", "parameters": [ { "required": true, @@ -18330,24 +18431,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -18362,8 +18455,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -18385,59 +18478,6 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } - } - }, - "security": [{ "HTTPBearer": [] }] - } - }, - "/payable_credit_notes/{credit_note_id}/cancel": { - "post": { - "tags": ["Credit Notes"], - "summary": "Cancel a credit note", - "description": "Cancel the credit note that was not confirmed during the review.", - "operationId": "post_payable_credit_notes_id_cancel", - "parameters": [ - { - "required": true, - "schema": { "type": "string", "format": "date" }, - "example": "2024-05-25", - "name": "x-monite-version", - "in": "header" - }, - { - "required": true, - "schema": { "type": "string", "format": "uuid" }, - "name": "credit_note_id", - "in": "path" - }, - { - "description": "The ID of the entity that owns the requested resource.", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] - }, - "name": "x-monite-entity-id", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/CreditNoteResponse" } - } - } - }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } }, "500": { "description": "Internal Server Error", @@ -18446,46 +18486,6 @@ "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "409": { - "description": "Business logic error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } } }, "security": [{ "HTTPBearer": [] }] @@ -18525,8 +18525,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -18620,145 +18620,145 @@ }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "total__gt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "total__lt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "total__gte", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "total__lte", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "subtotal__gt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "subtotal__lt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "subtotal__gte", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "subtotal__lte", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "unit_price__gt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "unit_price__lt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "unit_price__gte", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "unit_price__lte", "in": "query" }, { "required": false, - "schema": { "type": "number", "minimum": 0.0 }, + "schema": { "type": "number", "minimum": 0 }, "name": "quantity__gt", "in": "query" }, { "required": false, - "schema": { "type": "number", "minimum": 0.0 }, + "schema": { "type": "number", "minimum": 0 }, "name": "quantity__lt", "in": "query" }, { "required": false, - "schema": { "type": "number", "minimum": 0.0 }, + "schema": { "type": "number", "minimum": 0 }, "name": "quantity__gte", "in": "query" }, { "required": false, - "schema": { "type": "number", "minimum": 0.0 }, + "schema": { "type": "number", "minimum": 0 }, "name": "quantity__lte", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "tax__gt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "tax__lt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "tax__gte", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "tax__lte", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "tax_amount__gt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "tax_amount__lt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "tax_amount__gte", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "tax_amount__lte", "in": "query" }, @@ -18815,24 +18815,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -18847,8 +18839,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -18862,6 +18854,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -18917,24 +18917,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -18949,8 +18941,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -18964,6 +18956,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -19019,24 +19019,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -19051,8 +19043,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -19066,6 +19058,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -19119,24 +19119,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -19151,8 +19143,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -19166,6 +19158,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -19217,24 +19217,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -19249,8 +19241,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -19264,6 +19256,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -19325,24 +19325,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -19357,8 +19349,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -19372,6 +19364,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -19418,24 +19418,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -19450,8 +19442,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -19473,6 +19465,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -19519,24 +19519,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -19551,8 +19543,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -19574,6 +19566,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -19607,8 +19607,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -19789,43 +19789,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -19877,43 +19877,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -19945,35 +19945,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -20023,43 +20023,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -20098,43 +20098,43 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -20192,43 +20192,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -20288,32 +20288,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -20328,8 +20320,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -20343,6 +20335,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -20400,32 +20400,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -20440,8 +20432,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -20463,6 +20455,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -20497,8 +20497,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -20828,22 +20828,6 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "400": { "description": "Bad Request", "content": { @@ -20868,6 +20852,14 @@ } } }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "406": { "description": "Not Acceptable", "content": { @@ -20883,6 +20875,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -20933,51 +20933,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -21307,43 +21307,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -21397,22 +21397,6 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "400": { "description": "Bad Request", "content": { @@ -21437,6 +21421,14 @@ } } }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "409": { "description": "Error uploading the file. You can check the upload\n [limitations in the documentation](https://docs.monite.com/docs/collect-payables#about-monite-ocr).", "content": { @@ -21452,6 +21444,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -21483,51 +21483,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -21569,51 +21569,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -21647,51 +21647,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -21736,35 +21736,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -21815,24 +21815,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -21847,8 +21839,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -21870,6 +21862,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -21907,24 +21907,16 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -21939,8 +21931,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -21962,6 +21954,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -22016,24 +22016,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -22048,8 +22040,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -22071,6 +22063,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -22119,32 +22119,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -22159,8 +22151,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -22182,6 +22174,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -22238,24 +22238,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -22270,8 +22262,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -22293,6 +22285,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -22341,32 +22341,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -22381,8 +22373,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -22404,6 +22396,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -22452,32 +22452,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -22492,8 +22484,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -22515,6 +22507,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -22555,8 +22555,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -22607,6 +22607,30 @@ } } }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "405": { "description": "Method Not Allowed", "content": { @@ -22615,6 +22639,22 @@ } } }, + "406": { + "description": "Not Acceptable", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + }, "500": { "description": "Internal Server Error", "content": { @@ -22622,6 +22662,61 @@ "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } + } + }, + "security": [{ "HTTPBearer": [] }] + }, + "put": { + "tags": ["Payable line items"], + "summary": "Replaces the lines items in a payable", + "description": "Replaces the information of all line items of a specific payable.\n\nRelated guide: [Replace all line items](https://docs.monite.com/docs/manage-line-items#replace-all-line-items)\n\nSee also:\n\n[Manage line items](https://docs.monite.com/docs/manage-line-items)\n\n[Collect payables](https://docs.monite.com/docs/collect-payables)", + "operationId": "put_payables_id_line_items", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "payable_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LineItemsReplaceRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LineItemsReplaceResponse" + } + } + } }, "400": { "description": "Bad Request", @@ -22647,109 +22742,6 @@ } } }, - "406": { - "description": "Not Acceptable", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } - } - }, - "security": [{ "HTTPBearer": [] }] - }, - "put": { - "tags": ["Payable line items"], - "summary": "Replaces the lines items in a payable", - "description": "Replaces the information of all line items of a specific payable.\n\nRelated guide: [Replace all line items](https://docs.monite.com/docs/manage-line-items#replace-all-line-items)\n\nSee also:\n\n[Manage line items](https://docs.monite.com/docs/manage-line-items)\n\n[Collect payables](https://docs.monite.com/docs/collect-payables)", - "operationId": "put_payables_id_line_items", - "parameters": [ - { - "required": true, - "schema": { "type": "string", "format": "date" }, - "example": "2024-05-25", - "name": "x-monite-version", - "in": "header" - }, - { - "required": true, - "schema": { "type": "string", "format": "uuid" }, - "name": "payable_id", - "in": "path" - }, - { - "description": "The ID of the entity that owns the requested resource.", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] - }, - "name": "x-monite-entity-id", - "in": "header" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LineItemsReplaceRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LineItemsReplaceResponse" - } - } - } - }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "404": { "description": "Not found", "content": { @@ -22758,8 +22750,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -22789,6 +22781,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -22841,32 +22841,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -22881,8 +22873,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -22904,6 +22896,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -22956,32 +22956,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -22996,8 +22988,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23019,6 +23011,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -23062,24 +23062,16 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23094,8 +23086,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23117,6 +23109,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -23175,32 +23175,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23215,8 +23207,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23238,6 +23230,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -23293,32 +23293,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23333,8 +23325,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23356,6 +23348,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -23412,32 +23412,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23452,8 +23444,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23475,6 +23467,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -23523,32 +23523,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23563,8 +23555,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23586,6 +23578,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -23634,32 +23634,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23674,8 +23666,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23697,6 +23689,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -23745,32 +23745,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23785,8 +23777,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23808,6 +23800,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -23856,24 +23856,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23888,8 +23880,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -23911,6 +23903,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -23944,8 +23944,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -24007,19 +24007,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -24077,19 +24077,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -24155,19 +24155,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -24225,19 +24225,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -24299,19 +24299,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -24369,19 +24369,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -24439,19 +24439,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -24513,19 +24513,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -24561,8 +24561,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -24629,19 +24629,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -24699,19 +24699,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -24769,19 +24769,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -24825,43 +24825,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -24911,51 +24911,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -25005,24 +25005,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -25037,8 +25029,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -25052,6 +25044,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -25088,32 +25088,24 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -25128,8 +25120,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -25143,6 +25135,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -25198,32 +25198,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -25238,8 +25230,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -25253,6 +25245,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -25294,43 +25294,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -25382,51 +25382,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -25476,24 +25476,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -25508,8 +25500,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -25523,6 +25515,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -25559,32 +25559,24 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -25599,8 +25591,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -25614,6 +25606,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -25669,32 +25669,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -25709,8 +25701,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -25724,6 +25716,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -25779,14 +25779,6 @@ } } }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "409": { "description": "Business logic error", "content": { @@ -25802,6 +25794,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -25847,19 +25847,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -25907,35 +25907,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -25989,24 +25989,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -26028,6 +26020,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -26064,24 +26064,16 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -26103,6 +26095,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -26150,19 +26150,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -26224,19 +26224,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -26274,19 +26274,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -26324,19 +26324,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -26377,51 +26377,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -26458,51 +26458,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -26541,35 +26541,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -26608,51 +26608,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -26676,6 +26676,30 @@ ], "responses": { "204": { "description": "Successful Response" }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "405": { "description": "Method Not Allowed", "content": { @@ -26684,6 +26708,14 @@ } } }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + }, "500": { "description": "Internal Server Error", "content": { @@ -26691,6 +26723,37 @@ "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/portal/v1/auth/resend_invitation_email": { + "post": { + "tags": ["Auth"], + "summary": "Request Resend Invitation Email", + "operationId": "post__portal_v1_auth_resend_invitation_email", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RequestResendInvite" } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { "application/json": { "schema": {} } } }, "400": { "description": "Bad Request", @@ -26716,44 +26779,13 @@ } } }, - "422": { - "description": "Validation Error", + "404": { + "description": "Not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } - } - }, - "security": [{ "HTTPBearer": [] }] - } - }, - "/portal/v1/auth/resend_invitation_email": { - "post": { - "tags": ["Auth"], - "summary": "Request Resend Invitation Email", - "operationId": "post__portal_v1_auth_resend_invitation_email", - "parameters": [ - { - "required": true, - "schema": { "type": "string", "format": "date" }, - "example": "2024-05-25", - "name": "x-monite-version", - "in": "header" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/RequestResendInvite" } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { "application/json": { "schema": {} } } }, "405": { "description": "Method Not Allowed", @@ -26763,53 +26795,21 @@ } } }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "403": { - "description": "Forbidden", + "500": { + "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } } }, "security": [{ "HTTPBearer": [] }] @@ -26846,51 +26846,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -26929,32 +26929,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -26969,8 +26961,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -26984,6 +26976,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } } } @@ -27019,51 +27019,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -27102,51 +27102,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -27183,32 +27183,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -27223,8 +27215,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -27238,6 +27230,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -27270,32 +27270,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -27310,8 +27302,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -27325,6 +27317,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -27365,32 +27365,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -27405,8 +27397,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -27420,6 +27412,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -27462,32 +27462,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -27502,8 +27494,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -27517,6 +27509,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -27557,19 +27557,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -27612,19 +27612,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -27667,19 +27667,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -27722,19 +27722,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -27767,16 +27767,8 @@ "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -27791,8 +27783,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -27806,6 +27798,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -27836,51 +27836,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -27921,43 +27921,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -27998,43 +27998,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -28071,6 +28071,30 @@ } } }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "405": { "description": "Method Not Allowed", "content": { @@ -28079,6 +28103,14 @@ } } }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + }, "500": { "description": "Internal Server Error", "content": { @@ -28086,6 +28118,43 @@ "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } + } + }, + "security": [{ "HTTPBearer": [] }] + }, + "post": { + "tags": ["Partners Portal Projects"], + "summary": "Create Project", + "operationId": "post__portal_v1_projects", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PartnersPortalProjectsRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PartnersPortalProjectResponse" + } + } + } }, "400": { "description": "Bad Request", @@ -28111,51 +28180,6 @@ } } }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } - } - }, - "security": [{ "HTTPBearer": [] }] - }, - "post": { - "tags": ["Partners Portal Projects"], - "summary": "Create Project", - "operationId": "post__portal_v1_projects", - "parameters": [ - { - "required": true, - "schema": { "type": "string", "format": "date" }, - "example": "2024-05-25", - "name": "x-monite-version", - "in": "header" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PartnersPortalProjectsRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PartnersPortalProjectResponse" - } - } - } - }, "405": { "description": "Method Not Allowed", "content": { @@ -28164,45 +28188,21 @@ } } }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "403": { - "description": "Forbidden", + "500": { + "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } } }, "security": [{ "HTTPBearer": [] }] @@ -28239,51 +28239,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -28330,32 +28330,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -28370,8 +28362,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -28385,6 +28377,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -28421,35 +28421,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -28496,51 +28496,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -28583,51 +28583,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -28662,51 +28662,51 @@ "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -28741,51 +28741,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -28822,24 +28822,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -28854,8 +28846,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -28869,6 +28861,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -28903,51 +28903,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -28982,32 +28982,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29022,8 +29014,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29037,6 +29029,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -29077,32 +29077,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29117,8 +29109,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29132,6 +29124,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -29166,32 +29166,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29206,8 +29198,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29221,6 +29213,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -29257,32 +29257,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29297,8 +29289,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29312,6 +29304,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -29348,32 +29348,24 @@ "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29388,8 +29380,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29403,6 +29395,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -29437,6 +29437,30 @@ } } }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "405": { "description": "Method Not Allowed", "content": { @@ -29445,6 +29469,14 @@ } } }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + }, "500": { "description": "Internal Server Error", "content": { @@ -29452,6 +29484,41 @@ "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/portal/v1/users/{user_id}": { + "get": { + "tags": ["Users"], + "summary": "Get User By Id", + "operationId": "get__portal_v1_users_id", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "user_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PortalUserProfileResponseWithOptionalRole" + } + } + } }, "400": { "description": "Bad Request", @@ -29477,49 +29544,6 @@ } } }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } - } - }, - "security": [{ "HTTPBearer": [] }] - } - }, - "/portal/v1/users/{user_id}": { - "get": { - "tags": ["Users"], - "summary": "Get User By Id", - "operationId": "get__portal_v1_users_id", - "parameters": [ - { - "required": true, - "schema": { "type": "string", "format": "date" }, - "example": "2024-05-25", - "name": "x-monite-version", - "in": "header" - }, - { - "required": true, - "schema": { "type": "string", "format": "uuid" }, - "name": "user_id", - "in": "path" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PortalUserProfileResponseWithOptionalRole" - } - } - } - }, "405": { "description": "Method Not Allowed", "content": { @@ -29528,45 +29552,21 @@ } } }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "403": { - "description": "Forbidden", + "500": { + "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } } }, "security": [{ "HTTPBearer": [] }] @@ -29599,32 +29599,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29639,8 +29631,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29654,6 +29646,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -29696,32 +29696,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29736,8 +29728,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29751,6 +29743,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -29795,43 +29795,43 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -29868,32 +29868,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29908,8 +29900,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -29923,6 +29915,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -29956,8 +29956,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -30014,31 +30014,31 @@ }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "price", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "price__gt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "price__lt", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "price__gte", "in": "query" }, { "required": false, - "schema": { "type": "integer", "minimum": 0.0 }, + "schema": { "type": "integer", "minimum": 0 }, "name": "price__lte", "in": "query" }, @@ -30110,6 +30110,30 @@ } } }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "405": { "description": "Method Not Allowed", "content": { @@ -30118,6 +30142,14 @@ } } }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + }, "500": { "description": "Internal Server Error", "content": { @@ -30125,6 +30157,52 @@ "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } + } + }, + "security": [{ "HTTPBearer": [] }] + }, + "post": { + "tags": ["Products"], + "summary": "Create a product", + "operationId": "post_products", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ProductServiceRequest" } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProductServiceResponse" + } + } + } }, "400": { "description": "Bad Request", @@ -30150,60 +30228,6 @@ } } }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } - } - }, - "security": [{ "HTTPBearer": [] }] - }, - "post": { - "tags": ["Products"], - "summary": "Create a product", - "operationId": "post_products", - "parameters": [ - { - "required": true, - "schema": { "type": "string", "format": "date" }, - "example": "2024-05-25", - "name": "x-monite-version", - "in": "header" - }, - { - "description": "The ID of the entity that owns the requested resource.", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] - }, - "name": "x-monite-entity-id", - "in": "header" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ProductServiceRequest" } - } - }, - "required": true - }, - "responses": { - "201": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProductServiceResponse" - } - } - } - }, "405": { "description": "Method Not Allowed", "content": { @@ -30212,45 +30236,21 @@ } } }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "403": { - "description": "Forbidden", + "500": { + "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } } }, "security": [{ "HTTPBearer": [] }] @@ -30298,32 +30298,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -30338,8 +30330,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -30353,6 +30345,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -30389,32 +30389,24 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -30429,8 +30421,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -30444,6 +30436,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -30497,32 +30497,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -30537,8 +30529,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -30552,6 +30544,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -30586,8 +30586,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -30752,32 +30752,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -30792,8 +30784,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -30815,6 +30807,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -30861,51 +30861,51 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -30954,32 +30954,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -30994,8 +30986,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -31009,6 +31001,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -31046,32 +31046,24 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -31086,8 +31078,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -31101,6 +31093,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -31153,32 +31153,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -31193,8 +31185,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -31208,6 +31200,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -31242,8 +31242,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -31534,32 +31534,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -31589,6 +31581,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "schema_name": "ReceivablePaginationResponse", @@ -31637,32 +31637,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -31677,8 +31669,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -31700,6 +31692,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -31731,24 +31731,16 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "404": { - "description": "Not found", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -31770,6 +31762,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -31815,32 +31815,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -31855,8 +31847,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -31870,6 +31862,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -31906,32 +31906,24 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -31946,8 +31938,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -31969,6 +31961,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -32022,32 +32022,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32062,8 +32054,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32085,6 +32077,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -32137,32 +32137,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32177,8 +32169,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32200,6 +32192,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -32238,32 +32238,24 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32278,8 +32270,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32301,6 +32293,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -32346,32 +32346,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32386,8 +32378,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32409,6 +32401,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -32463,32 +32463,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32503,8 +32495,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32526,6 +32518,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -32565,8 +32565,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -32657,32 +32657,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32697,8 +32689,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32712,6 +32704,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -32765,32 +32765,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32805,8 +32797,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32820,6 +32812,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -32865,32 +32865,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32905,8 +32897,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -32928,6 +32920,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -32982,32 +32982,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -33022,8 +33014,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -33045,6 +33037,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -33084,8 +33084,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -33175,32 +33175,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -33215,8 +33207,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -33230,6 +33222,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -33283,32 +33283,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -33323,8 +33315,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -33338,6 +33330,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -33390,32 +33390,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -33430,8 +33422,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -33453,6 +33445,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -33509,32 +33509,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -33549,8 +33541,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -33572,6 +33564,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "deprecated": true, @@ -33627,32 +33627,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -33667,8 +33659,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -33690,6 +33682,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -33735,22 +33735,6 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "400": { "description": "Bad Request", "content": { @@ -33767,14 +33751,6 @@ } } }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "403": { "description": "Forbidden", "content": { @@ -33783,67 +33759,11 @@ } } }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } - } - }, - "security": [{ "HTTPBearer": [] }] - } - }, - "/receivables/{receivable_id}/preview": { - "post": { - "tags": ["Receivables"], - "summary": "Preview a receivable's email message", - "operationId": "post_receivables_id_preview", - "parameters": [ - { - "required": true, - "schema": { "type": "string", "format": "date" }, - "example": "2024-05-25", - "name": "x-monite-version", - "in": "header" - }, - { - "required": true, - "schema": { "type": "string", "format": "uuid" }, - "name": "receivable_id", - "in": "path" - }, - { - "description": "The ID of the entity that owns the requested resource.", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] - }, - "name": "x-monite-entity-id", - "in": "header" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReceivablePreviewRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "description": "Successful Response", + "404": { + "description": "Not found", "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/ReceivablePreviewResponse" - } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, @@ -33855,63 +33775,31 @@ } } }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "404": { - "description": "Not found", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "403": { - "description": "Forbidden", + "500": { + "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } } }, "security": [{ "HTTPBearer": [] }] } }, - "/receivables/{receivable_id}/send": { + "/receivables/{receivable_id}/preview": { "post": { "tags": ["Receivables"], - "summary": "Send a receivable via email", - "operationId": "post_receivables_id_send", + "summary": "Preview a receivable's email message", + "operationId": "post_receivables_id_preview", "parameters": [ { "required": true, @@ -33941,22 +33829,56 @@ "requestBody": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ReceivableSendRequest" } + "schema": { + "$ref": "#/components/schemas/ReceivablePreviewRequest" + } } }, "required": true }, "responses": { - "200": { + "201": { "description": "Successful Response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReceivableSendResponse" + "$ref": "#/components/schemas/ReceivablePreviewResponse" } } } }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "405": { "description": "Method Not Allowed", "content": { @@ -33965,6 +33887,14 @@ } } }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + } + } + }, "500": { "description": "Internal Server Error", "content": { @@ -33972,6 +33902,60 @@ "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } + } + }, + "security": [{ "HTTPBearer": [] }] + } + }, + "/receivables/{receivable_id}/send": { + "post": { + "tags": ["Receivables"], + "summary": "Send a receivable via email", + "operationId": "post_receivables_id_send", + "parameters": [ + { + "required": true, + "schema": { "type": "string", "format": "date" }, + "example": "2024-05-25", + "name": "x-monite-version", + "in": "header" + }, + { + "required": true, + "schema": { "type": "string", "format": "uuid" }, + "name": "receivable_id", + "in": "path" + }, + { + "description": "The ID of the entity that owns the requested resource.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "examples": ["9d2b4c8f-2087-4738-ba91-7359683c49a4"] + }, + "name": "x-monite-entity-id", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ReceivableSendRequest" } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReceivableSendResponse" + } + } + } }, "400": { "description": "Bad Request", @@ -33989,6 +33973,14 @@ } } }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "404": { "description": "Not found", "content": { @@ -33997,8 +33989,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34020,6 +34012,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -34077,32 +34077,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34117,8 +34109,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34140,6 +34132,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -34187,32 +34187,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34227,8 +34219,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34242,6 +34234,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -34281,32 +34281,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34321,8 +34313,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34336,6 +34328,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -34383,32 +34383,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34423,8 +34415,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34438,6 +34430,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -34483,32 +34483,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34523,8 +34515,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34538,6 +34530,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -34591,32 +34591,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34631,8 +34623,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34646,6 +34638,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -34684,32 +34684,24 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34724,8 +34716,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -34747,6 +34739,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -34795,35 +34795,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -34982,22 +34982,6 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "400": { "description": "Bad Request", "content": { @@ -35022,6 +35006,14 @@ } } }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "406": { "description": "Not Acceptable", "content": { @@ -35037,6 +35029,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -35082,35 +35082,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -35165,35 +35165,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -35227,35 +35227,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -35297,35 +35297,35 @@ } } }, - "405": { - "description": "Method Not Allowed", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "500": { - "description": "Internal Server Error", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -35362,8 +35362,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -35429,22 +35429,6 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, "400": { "description": "Bad Request", "content": { @@ -35469,6 +35453,14 @@ } } }, + "405": { + "description": "Method Not Allowed", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } + }, "406": { "description": "Not Acceptable", "content": { @@ -35484,6 +35476,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -35530,32 +35530,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -35570,8 +35562,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -35593,6 +35585,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -35639,32 +35639,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -35679,8 +35671,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -35702,6 +35694,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -35739,24 +35739,16 @@ ], "responses": { "204": { "description": "Successful Response" }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -35771,8 +35763,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -35794,6 +35786,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -35846,32 +35846,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -35886,8 +35878,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -35909,6 +35901,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -35977,19 +35977,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -36050,19 +36050,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -36121,19 +36121,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -36182,19 +36182,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -36262,19 +36262,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -36334,19 +36334,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -36418,32 +36418,24 @@ } } }, - "405": { - "description": "Method Not Allowed", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } - } - } - }, - "500": { - "description": "Internal Server Error", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -36458,8 +36450,8 @@ } } }, - "403": { - "description": "Forbidden", + "405": { + "description": "Method Not Allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } @@ -36473,6 +36465,14 @@ "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + } + } } }, "security": [{ "HTTPBearer": [] }] @@ -36507,8 +36507,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -36605,19 +36605,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -36653,8 +36653,8 @@ "required": false, "schema": { "type": "integer", - "maximum": 100.0, - "minimum": 1.0, + "maximum": 100, + "minimum": 1, "default": 100 }, "name": "limit", @@ -36730,19 +36730,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -36791,19 +36791,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -36886,19 +36886,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -36934,19 +36934,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -37001,19 +37001,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -37060,19 +37060,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -37119,19 +37119,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -37178,19 +37178,19 @@ } } }, - "500": { - "description": "Internal Server Error", + "422": { + "description": "Validation Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } + "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, - "422": { - "description": "Validation Error", + "500": { + "description": "Internal Server Error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } + "schema": { "$ref": "#/components/schemas/ErrorSchemaResponse" } } } } @@ -37608,23 +37608,26 @@ "type": "object", "required": ["id"] }, - "ActionEnum": { - "type": "string", - "enum": ["create", "read", "update", "delete"] - }, "ActionSchema": { "properties": { "action_name": { - "$ref": "#/components/schemas/ActionEnum", + "allOf": [ + { "$ref": "#/components/schemas/PortalActionEnum" }, + { "$ref": "#/components/schemas/ActionEnum" } + ], "description": "Action name", "default": "read" }, "permission": { - "$ref": "#/components/schemas/PermissionEnum", + "allOf": [ + { "$ref": "#/components/schemas/PortalPermissionEnum" }, + { "$ref": "#/components/schemas/PermissionEnum" } + ], "description": "Permission type", "default": "allowed" } }, + "additionalProperties": false, "type": "object" }, "AddCustomTemplateSchema": { @@ -38356,7 +38359,7 @@ "items": { "anyOf": [ { "type": "boolean" }, - { "type": "number", "minimum": 1.0 }, + { "type": "number", "minimum": 1 }, { "type": "string" }, { "items": {}, "type": "array" }, { "type": "object" } @@ -38411,7 +38414,7 @@ "items": { "anyOf": [ { "type": "boolean" }, - { "type": "number", "minimum": 1.0 }, + { "type": "number", "minimum": 1 }, { "type": "string" }, { "items": {}, "type": "array" }, { "type": "object" } @@ -38502,7 +38505,7 @@ "items": { "anyOf": [ { "type": "boolean" }, - { "type": "number", "minimum": 1.0 }, + { "type": "number", "minimum": 1 }, { "type": "string" }, { "items": {}, "type": "array" }, { "type": "object" } @@ -38543,7 +38546,7 @@ "ApprovalProcessStepResource": { "properties": { "object_id": { "type": "string", "format": "uuid" }, - "required_approval_count": { "type": "integer", "minimum": 1.0 }, + "required_approval_count": { "type": "integer", "minimum": 1 }, "status": { "$ref": "#/components/schemas/ApprovalProcessStepStatus" }, @@ -38599,7 +38602,7 @@ "properties": { "object_id": { "type": "string", "format": "uuid" }, "object_type": { "$ref": "#/components/schemas/ObjectType" }, - "required_approval_count": { "type": "integer", "minimum": 1.0 }, + "required_approval_count": { "type": "integer", "minimum": 1 }, "role_ids": { "items": { "type": "string", "format": "uuid" }, "type": "array" @@ -38618,7 +38621,7 @@ "properties": { "object_id": { "type": "string", "format": "uuid" }, "object_type": { "$ref": "#/components/schemas/ObjectType" }, - "required_approval_count": { "type": "integer", "minimum": 1.0 }, + "required_approval_count": { "type": "integer", "minimum": 1 }, "user_ids": { "items": { "type": "string", "format": "uuid" }, "type": "array" @@ -38683,7 +38686,7 @@ "object_id": { "type": "string", "format": "uuid" }, "object_type": { "$ref": "#/components/schemas/ObjectType" }, "rejected_by": { "type": "string", "format": "uuid" }, - "required_approval_count": { "type": "integer", "minimum": 1.0 }, + "required_approval_count": { "type": "integer", "minimum": 1 }, "role_ids": { "items": { "type": "string", "format": "uuid" }, "type": "array" @@ -40634,7 +40637,7 @@ "properties": { "amount": { "type": "integer", - "minimum": 1.0, + "minimum": 1, "description": "The payment amount in [minor units](https://docs.monite.com/docs/currencies#minor-units). Required if `object` is not specified.", "example": 120550 }, @@ -40683,12 +40686,12 @@ "properties": { "body_text": { "type": "string" }, "day_of_month": { "$ref": "#/components/schemas/DayOfMonth" }, - "end_month": { "type": "integer", "maximum": 12.0, "minimum": 1.0 }, - "end_year": { "type": "integer", "maximum": 2077.0 }, + "end_month": { "type": "integer", "maximum": 12, "minimum": 1 }, + "end_year": { "type": "integer", "maximum": 2077 }, "invoice_id": { "type": "string", "format": "uuid" }, "recipients": { "$ref": "#/components/schemas/Recipients" }, - "start_month": { "type": "integer", "maximum": 12.0, "minimum": 1.0 }, - "start_year": { "type": "integer", "maximum": 2077.0 }, + "start_month": { "type": "integer", "maximum": 12, "minimum": 1 }, + "start_year": { "type": "integer", "maximum": 2077 }, "subject_text": { "type": "string" } }, "additionalProperties": false, @@ -40713,7 +40716,7 @@ "description": "Role name" }, "permissions": { - "$ref": "#/components/schemas/BizObjectsSchema-Input", + "$ref": "#/components/schemas/BizObjectsSchema", "description": "Access permissions" } }, @@ -40751,7 +40754,7 @@ "properties": { "amount": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "The total amount including taxes", "example": 1200 }, @@ -40829,7 +40832,7 @@ }, "subtotal": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "The subtotal amount before taxes", "example": 1000 }, @@ -40841,14 +40844,14 @@ }, "tax": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The tax percentage applied to the subtotal", "example": 20 }, "tax_amount": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "The calculated tax amount", "example": 200 } @@ -40876,32 +40879,32 @@ }, "quantity": { "type": "number", - "minimum": 0.0, + "minimum": 0, "description": "Quantity of items", - "example": 2.0 + "example": 2 }, "subtotal": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Subtotal amount before tax in smallest currency unit", "example": 10000 }, "tax": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "Tax percentage", "example": 20 }, "tax_amount": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Tax amount in smallest currency unit", "example": 2000 }, "total": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Total amount including tax in smallest currency unit", "example": 12000 }, @@ -40912,7 +40915,7 @@ }, "unit_price": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Price per unit in smallest currency unit (e.g. cents)", "example": 5000 } @@ -41009,31 +41012,31 @@ }, "quantity": { "type": "number", - "minimum": 0.0, + "minimum": 0, "description": "Quantity of items", - "example": 2.0 + "example": 2 }, "subtotal": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Subtotal amount before tax", "example": 10000 }, "tax": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Tax percentage", "example": 20 }, "tax_amount": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Tax amount", "example": 2000 }, "total": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Total amount including tax", "example": 12000 }, @@ -41044,7 +41047,7 @@ }, "unit_price": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Price per unit in smallest currency unit", "example": 5000 } @@ -41068,32 +41071,32 @@ }, "quantity": { "type": "number", - "minimum": 0.0, + "minimum": 0, "description": "Quantity of items", - "example": 2.0 + "example": 2 }, "subtotal": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Subtotal amount before tax", "example": 10000 }, "tax": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "Tax percentage", "example": 20 }, "tax_amount": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Tax amount", "example": 2000 }, "total": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Total amount including tax", "example": 12000 }, @@ -41104,7 +41107,7 @@ }, "unit_price": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Price per unit in smallest currency unit", "example": 5000 } @@ -41413,8 +41416,8 @@ }, "deduction_amount": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 0.0, + "maximum": 9007199254740991, + "minimum": 0, "description": "The amount of tax deducted in minor units" }, "deduction_memo": { @@ -41427,7 +41430,7 @@ }, "discounted_subtotal": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "Total price of the receivable with discounts before taxes [minor units](https://docs.monite.com/docs/currencies#minor-units)." }, "document_id": { @@ -41508,7 +41511,7 @@ }, "subtotal": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "The subtotal (excluding VAT), in [minor units](https://docs.monite.com/docs/currencies#minor-units)." }, "tags": { @@ -41519,13 +41522,13 @@ }, "total_amount": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "Total price of the receivable in [minor units](https://docs.monite.com/docs/currencies#minor-units). Calculated as a subtotal + total_vat_amount.", "default": 0 }, "total_vat_amount": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "The total VAT of all line items, in [minor units](https://docs.monite.com/docs/currencies#minor-units)." }, "total_vat_amounts": { @@ -41562,8 +41565,8 @@ }, "withholding_tax_rate": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The amount of tax withheld in percent minor units" } }, @@ -41593,7 +41596,7 @@ "properties": { "amount": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "The total amount including taxes", "example": 1200 }, @@ -41670,7 +41673,7 @@ }, "subtotal": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "The subtotal amount before taxes", "example": 1000 }, @@ -41682,14 +41685,14 @@ }, "tax": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The tax percentage applied to the subtotal", "example": 20 }, "tax_amount": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "The calculated tax amount", "example": 200 } @@ -42020,8 +42023,8 @@ "properties": { "amount": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 0.0, + "maximum": 9007199254740991, + "minimum": 0, "description": "The actual discount of the product in [minor units](https://docs.monite.com/docs/currencies#minor-units) if type field equals amount, else in percent minor units" }, "type": { @@ -42089,8 +42092,8 @@ }, "min_digits": { "type": "integer", - "maximum": 25.0, - "minimum": 1.0, + "maximum": 25, + "minimum": 1, "description": "Minimal size of number in document ID Number will be left padded with zeros if less.", "default": 5 } @@ -42102,23 +42105,23 @@ "properties": { "quote": { "type": "integer", - "maximum": 9.223372036854776e18, - "minimum": 1.0 + "maximum": 9223372036854776000, + "minimum": 1 }, "invoice": { "type": "integer", - "maximum": 9.223372036854776e18, - "minimum": 1.0 + "maximum": 9223372036854776000, + "minimum": 1 }, "credit_note": { "type": "integer", - "maximum": 9.223372036854776e18, - "minimum": 1.0 + "maximum": 9223372036854776000, + "minimum": 1 }, "purchase_order": { "type": "integer", - "maximum": 9.223372036854776e18, - "minimum": 1.0 + "maximum": 9223372036854776000, + "minimum": 1 } }, "additionalProperties": false, @@ -42154,8 +42157,8 @@ }, "min_digits": { "type": "integer", - "maximum": 25.0, - "minimum": 1.0, + "maximum": 25, + "minimum": 1, "description": "Minimal size of number in document ID Number will be left padded with zeros if less.", "default": 5 }, @@ -42958,8 +42961,8 @@ "properties": { "amount": { "type": "integer", - "maximum": 9.223372036854776e18, - "minimum": 1.0, + "maximum": 9223372036854776000, + "minimum": 1, "description": "The amount of the monthly revenue, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250..", "example": 250 }, @@ -43212,36 +43215,79 @@ }, "FileSchema": { "properties": { - "id": { "type": "string", "format": "uuid" }, - "created_at": { "type": "string", "format": "date-time" }, - "updated_at": { "type": "string", "format": "date-time" }, - "entity_id": { "type": "string", "format": "uuid" }, - "file_type": { "type": "string" }, - "md5": { "type": "string" }, - "mimetype": { "type": "string" }, - "name": { "type": "string" }, - "region": { "type": "string" }, - "s3_bucket": { "type": "string" }, - "s3_file_path": { "type": "string" }, - "size": { "type": "integer" }, - "url": { "type": "string" } + "id": { + "type": "string", + "format": "uuid", + "description": "A unique ID of this file." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "UTC date and time when this workflow was uploaded to Monite. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format." + }, + "file_type": { + "type": "string", + "description": "The type of the business object associated with this file.", + "example": "payables" + }, + "md5": { + "type": "string", + "description": "The MD5 hash of the file.", + "example": "31d1a2dd1ad3dfc39be849d70a68dac0" + }, + "mimetype": { + "type": "string", + "description": "The file's [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types).", + "example": "application/pdf" + }, + "name": { + "type": "string", + "maxLength": 512, + "description": "The original file name (if available).", + "example": "invoice.pdf" + }, + "pages": { + "items": { "$ref": "#/components/schemas/PageSchema" }, + "type": "array", + "description": "If the file is a PDF document, this property contains individual pages extracted from the file. Otherwise, an empty array.", + "default": [] + }, + "previews": { + "items": { "$ref": "#/components/schemas/PreviewSchema" }, + "type": "array", + "description": "Preview images generated for this file. There can be multiple images with different sizes.", + "default": [] + }, + "region": { + "type": "string", + "description": "Geographical region of the data center where the file is stored.", + "example": "eu-central-1" + }, + "size": { + "type": "integer", + "minimum": 0, + "description": "The file size in bytes.", + "example": 24381 + }, + "url": { + "type": "string", + "description": "The URL to download the file.", + "example": "https://bucketname.s3.amazonaws.com/12345/67890.pdf" + } }, - "additionalProperties": false, "type": "object", "required": [ "id", "created_at", - "updated_at", "file_type", "md5", "mimetype", "name", "region", - "s3_bucket", - "s3_file_path", "size", "url" - ] + ], + "description": "Represents a file (such as a PDF invoice) that was uploaded to Monite." }, "FilesResponse": { "properties": { @@ -43285,7 +43331,7 @@ }, "total_amount": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Total amount of the invoice in minor units." }, "currency": { @@ -43702,17 +43748,17 @@ }, "amount_due": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "How much is left to be paid in [minor units](https://docs.monite.com/docs/currencies#minor-units). Equal 0 if the Invoice is fully paid." }, "amount_paid": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "How much has been paid [minor units](https://docs.monite.com/docs/currencies#minor-units)" }, "amount_to_pay": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "How much is left to be paid in in [minor units](https://docs.monite.com/docs/currencies#minor-units), including payment_term discounts." }, "based_on": { @@ -43787,8 +43833,8 @@ }, "deduction_amount": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 0.0, + "maximum": 9007199254740991, + "minimum": 0, "description": "The amount of tax deducted in minor units" }, "deduction_memo": { @@ -43801,7 +43847,7 @@ }, "discounted_subtotal": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "Total price of the receivable with discounts before taxes [minor units](https://docs.monite.com/docs/currencies#minor-units)." }, "document_id": { @@ -43911,7 +43957,7 @@ }, "subtotal": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "The subtotal (excluding VAT), in [minor units](https://docs.monite.com/docs/currencies#minor-units)." }, "tags": { @@ -43922,18 +43968,18 @@ }, "total_amount": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "Total price of the receivable in [minor units](https://docs.monite.com/docs/currencies#minor-units). Calculated as a subtotal + total_vat_amount.", "default": 0 }, "total_amount_with_credit_notes": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "The total price of the receivable in [minor units](https://docs.monite.com/docs/currencies#minor-units), including VAT and excluding all issued credit notes." }, "total_vat_amount": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "The total VAT of all line items, in [minor units](https://docs.monite.com/docs/currencies#minor-units)." }, "total_vat_amounts": { @@ -43970,8 +44016,8 @@ }, "withholding_tax_rate": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The amount of tax withheld in percent minor units" } }, @@ -44006,8 +44052,8 @@ }, "confidence": { "type": "number", - "maximum": 100.0, - "minimum": 0.0, + "maximum": 100, + "minimum": 0, "description": "OCR confidence score - the estimated accuracy percentage of character recognition of the extracted text, from 0 to 100%.", "example": 96.238 }, @@ -44320,14 +44366,14 @@ }, "quantity": { "type": "number", - "maximum": 2147483647.0, - "minimum": 0.0, + "maximum": 2147483647, + "minimum": 0, "description": "The quantity of each of the goods, materials, or services listed in the receivable." }, "tax_rate_value": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "Percent minor units. Example: 12.5% is 1250. This field is only required on invoices issued by entities in the US, Pakistan, and other unsupported countries." }, "vat_rate_id": { @@ -44376,15 +44422,15 @@ "name": { "type": "string", "description": "Name of the product." }, "quantity": { "type": "number", - "minimum": 0.0, + "minimum": 0, "description": "The quantity of each of the goods, materials, or services listed in the payable.", "example": 1.22 }, "subtotal": { "type": "integer" }, "tax": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "VAT rate in percent [minor units](https://docs.monite.com/docs/currencies#minor-units). Example: 12.5% is 1250.", "example": 1250 }, @@ -44446,8 +44492,8 @@ "price_after_vat": { "$ref": "#/components/schemas/Price" }, "smallest_amount": { "type": "number", - "maximum": 2147483647.0, - "minimum": 0.0, + "maximum": 2147483647, + "minimum": 0, "description": "The smallest amount allowed for this product." }, "type": { @@ -44480,8 +44526,8 @@ "price": { "$ref": "#/components/schemas/Price" }, "smallest_amount": { "type": "number", - "maximum": 2147483647.0, - "minimum": 0.0, + "maximum": 2147483647, + "minimum": 0, "description": "The smallest amount allowed for this product." }, "type": { @@ -44519,8 +44565,8 @@ }, "value": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "Percent minor units. Example: 12.5% is 1250." } }, @@ -44548,14 +44594,14 @@ "name": { "type": "string", "description": "Name of the product." }, "quantity": { "type": "number", - "minimum": 0.0, + "minimum": 0, "description": "The quantity of each of the goods, materials, or services listed in the payable.", "example": 1.22 }, "tax": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "VAT rate in percent [minor units](https://docs.monite.com/docs/currencies#minor-units). Example: 12.5% is 1250.", "example": 1250 }, @@ -44647,20 +44693,20 @@ }, "price": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 0.0, + "maximum": 9007199254740991, + "minimum": 0, "description": "The actual price of the product in [minor units](https://docs.monite.com/docs/currencies#minor-units)." }, "quantity": { "type": "number", - "maximum": 2147483647.0, - "minimum": 0.0, + "maximum": 2147483647, + "minimum": 0, "description": "The quantity of each of the goods, materials, or services listed in the receivable." }, "tax_rate_value": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "Percent minor units. Example: 12.5% is 1250. This field is only required on invoices issued by entities in the US, Pakistan, and other unsupported countries." }, "vat_rate_id": { @@ -45926,8 +45972,8 @@ "owner": { "type": "boolean" }, "percent_ownership": { "type": "number", - "maximum": 100.0, - "minimum": 0.0 + "maximum": 100, + "minimum": 0 }, "representative": { "type": "boolean" }, "title": { "type": "string", "minLength": 1 } @@ -46366,7 +46412,7 @@ }, "percent_ownership": { "anyOf": [ - { "type": "number", "maximum": 100.0, "minimum": 0.0 }, + { "type": "number", "maximum": 100, "minimum": 0 }, { "type": "null" } ], "description": "The percent owned by the person of the account's legal entity" @@ -46561,11 +46607,7 @@ "OverdueReminderTerm": { "properties": { "body": { "type": "string" }, - "days_after": { - "type": "integer", - "maximum": 10000.0, - "minimum": 1.0 - }, + "days_after": { "type": "integer", "maximum": 10000, "minimum": 1 }, "subject": { "type": "string" } }, "additionalProperties": false, @@ -46603,11 +46645,45 @@ "additionalProperties": false, "type": "object" }, + "PageSchema": { + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "A unique ID of the image." + }, + "mimetype": { + "type": "string", + "description": "The [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the image.", + "example": "image/png" + }, + "number": { + "type": "integer", + "minimum": 0, + "description": "The page number in the PDF document, from 0.", + "example": 0 + }, + "size": { + "type": "integer", + "minimum": 0, + "description": "Image file size, in bytes.", + "example": 21972 + }, + "url": { + "type": "string", + "description": "The URL to download the image.", + "example": "https://bucket.s3.amazonaws.com/123/456.png" + } + }, + "type": "object", + "required": ["id", "mimetype", "number", "size", "url"], + "description": "When a PDF document is uploaded to Monite, it extracts individual pages from the document\nand saves them as PNG images. This object contains the image and metadata of a single page." + }, "PartiallyPaidPayload": { "properties": { "amount_paid": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "How much was paid on the invoice (in minor units)." } }, @@ -48365,7 +48441,7 @@ }, "PaymentRecordRequest": { "properties": { - "amount": { "type": "integer", "minimum": 1.0 }, + "amount": { "type": "integer", "minimum": 1 }, "currency": { "$ref": "#/components/schemas/CurrencyEnum" }, "entity_user_id": { "type": "string", "format": "uuid" }, "object": { @@ -48387,7 +48463,7 @@ "PaymentRecordResponse": { "properties": { "id": { "type": "string", "format": "uuid" }, - "amount": { "type": "integer", "minimum": 1.0 }, + "amount": { "type": "integer", "minimum": 1 }, "currency": { "$ref": "#/components/schemas/CurrencyEnum" }, "entity_user_id": { "type": "string", "format": "uuid" }, "is_external": { "type": "boolean" }, @@ -48396,7 +48472,7 @@ }, "overpaid_amount": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Filled in a case, if payment amount is more, than total_amount", "default": 0 }, @@ -48533,8 +48609,8 @@ "properties": { "number_of_days": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The amount of days after the invoice issue date." } }, @@ -48546,14 +48622,14 @@ "properties": { "discount": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The discount percentage in minor units. E.g., 200 means 2%. 1050 means 10.5%." }, "number_of_days": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The amount of days after the invoice issue date." } }, @@ -48565,15 +48641,15 @@ "properties": { "discount": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The discount percentage in minor units. E.g., 200 means 2%. 1050 means 10.5%." }, "end_date": { "type": "string", "format": "date" }, "number_of_days": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The amount of days after the invoice issue date." } }, @@ -48750,10 +48826,6 @@ "additionalProperties": false, "type": "object" }, - "PermissionEnum": { - "type": "string", - "enum": ["allowed", "allowed_for_own", "not_allowed"] - }, "PermissionSchema": { "properties": { "actions": { @@ -48880,7 +48952,7 @@ }, "percent_ownership": { "anyOf": [ - { "type": "number", "maximum": 100.0, "minimum": 0.0 }, + { "type": "number", "maximum": 100, "minimum": 0 }, { "type": "null" } ], "description": "The percent owned by the person of the account's legal entity" @@ -48920,7 +48992,7 @@ }, "percent_ownership": { "anyOf": [ - { "type": "number", "maximum": 100.0, "minimum": 0.0 }, + { "type": "number", "maximum": 100, "minimum": 0 }, { "type": "null" } ], "description": "The percent owned by the person of the account's legal entity" @@ -49137,6 +49209,10 @@ ], "description": "Possible platform names (i.e. serviceName) from Railz:\n- https://docs.railz.ai/docs/supported-accounting-integrations\n\nPresent in webhook events from Railz e.g. Authentication Completed:\n- https://docs.railz.ai/reference/connection-webhooks#authentication-completed" }, + "PortalActionEnum": { + "type": "string", + "enum": ["create", "read", "update", "delete"] + }, "PortalBizObjectsSchema": { "properties": { "objects": { @@ -49159,6 +49235,10 @@ "role" ] }, + "PortalPermissionEnum": { + "type": "string", + "enum": ["allowed", "allowed_for_own", "not_allowed"] + }, "PortalUserProfileResponseWithOptionalRole": { "properties": { "id": { "type": "string", "format": "uuid" }, @@ -49176,6 +49256,28 @@ "type": "string", "enum": ["sent_confirmation", "active", "deleted", "archived"] }, + "PreviewSchema": { + "properties": { + "height": { + "type": "integer", + "description": "The image height in pixels.", + "example": 400 + }, + "url": { + "type": "string", + "description": "The image URL.", + "example": "https://bucketname.s3.amazonaws.com/1/2/3.png" + }, + "width": { + "type": "integer", + "description": "The image width in pixels.", + "example": 200 + } + }, + "type": "object", + "required": ["height", "url", "width"], + "description": "A preview image generated for a file." + }, "PreviewTemplateRequest": { "properties": { "body": { @@ -49218,8 +49320,8 @@ }, "value": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 0.0, + "maximum": 9007199254740991, + "minimum": 0, "description": "The actual price of the product." } }, @@ -49345,8 +49447,8 @@ "price": { "$ref": "#/components/schemas/Price" }, "smallest_amount": { "type": "number", - "maximum": 2147483647.0, - "minimum": 0.0, + "maximum": 2147483647, + "minimum": 0, "description": "The smallest amount allowed for this product." }, "type": { @@ -49394,8 +49496,8 @@ "price": { "$ref": "#/components/schemas/Price" }, "smallest_amount": { "type": "number", - "maximum": 2147483647.0, - "minimum": 0.0, + "maximum": 2147483647, + "minimum": 0, "description": "The smallest amount allowed for this product." }, "type": { @@ -49435,8 +49537,8 @@ "price": { "$ref": "#/components/schemas/Price" }, "smallest_amount": { "type": "number", - "maximum": 2147483647.0, - "minimum": 0.0, + "maximum": 2147483647, + "minimum": 0, "description": "The smallest amount allowed for this product." }, "type": { @@ -50032,8 +50134,8 @@ }, "vat_rate": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "Percent minor units. Example: 12.5% is 1250" } }, @@ -50101,7 +50203,7 @@ }, "valid_for_days": { "type": "integer", - "minimum": 1.0, + "minimum": 1, "description": "Number of days for which purchase order is valid" } }, @@ -50207,7 +50309,7 @@ }, "valid_for_days": { "type": "integer", - "minimum": 1.0, + "minimum": 1, "description": "Number of days for which purchase order is valid" } }, @@ -50339,8 +50441,8 @@ }, "deduction_amount": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 0.0, + "maximum": 9007199254740991, + "minimum": 0, "description": "The amount of tax deducted in minor units" }, "deduction_memo": { @@ -50353,7 +50455,7 @@ }, "discounted_subtotal": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "Total price of the receivable with discounts before taxes [minor units](https://docs.monite.com/docs/currencies#minor-units)." }, "document_id": { @@ -50445,7 +50547,7 @@ }, "subtotal": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "The subtotal (excluding VAT), in [minor units](https://docs.monite.com/docs/currencies#minor-units)." }, "tags": { @@ -50456,13 +50558,13 @@ }, "total_amount": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "Total price of the receivable in [minor units](https://docs.monite.com/docs/currencies#minor-units). Calculated as a subtotal + total_vat_amount.", "default": 0 }, "total_vat_amount": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "The total VAT of all line items, in [minor units](https://docs.monite.com/docs/currencies#minor-units)." }, "total_vat_amounts": { @@ -50499,8 +50601,8 @@ }, "withholding_tax_rate": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The amount of tax withheld in percent minor units" } }, @@ -50615,8 +50717,8 @@ }, "deduction_amount": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 0.0, + "maximum": 9007199254740991, + "minimum": 0, "description": "The amount of tax deducted in minor units" }, "deduction_memo": { @@ -50633,7 +50735,7 @@ }, "discounted_subtotal": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "Total price of the receivable with discounts before taxes [minor units](https://docs.monite.com/docs/currencies#minor-units)." }, "document_id": { @@ -50736,7 +50838,7 @@ }, "subtotal": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "The subtotal (excluding VAT), in [minor units](https://docs.monite.com/docs/currencies#minor-units)." }, "tags": { @@ -50747,13 +50849,13 @@ }, "total_amount": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "Total price of the receivable in [minor units](https://docs.monite.com/docs/currencies#minor-units). Calculated as a subtotal + total_vat_amount.", "default": 0 }, "total_vat_amount": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "The total VAT of all line items, in [minor units](https://docs.monite.com/docs/currencies#minor-units)." }, "total_vat_amounts": { @@ -50790,8 +50892,8 @@ }, "withholding_tax_rate": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The amount of tax withheld in percent minor units" } }, @@ -51239,8 +51341,8 @@ "currency": { "$ref": "#/components/schemas/CurrencyEnum" }, "deduction_amount": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 0.0, + "maximum": 9007199254740991, + "minimum": 0, "description": "The amount of tax deducted in minor units" }, "deduction_memo": { @@ -51336,8 +51438,8 @@ }, "withholding_tax_rate": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The amount of tax withheld in percent minor units" } }, @@ -51388,8 +51490,8 @@ "currency": { "$ref": "#/components/schemas/CurrencyEnum" }, "deduction_amount": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 0.0, + "maximum": 9007199254740991, + "minimum": 0, "description": "The amount of tax deducted in minor units" }, "deduction_memo": { @@ -51481,8 +51583,8 @@ }, "withholding_tax_rate": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The amount of tax withheld in percent minor units" } }, @@ -51737,8 +51839,8 @@ "properties": { "amount_paid": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 1.0, + "maximum": 9007199254740991, + "minimum": 1, "description": "How much has been paid on the invoice (in minor units)." }, "comment": { @@ -52132,16 +52234,16 @@ "body_text": { "type": "string" }, "current_iteration": { "type": "integer" }, "day_of_month": { "$ref": "#/components/schemas/DayOfMonth" }, - "end_month": { "type": "integer", "maximum": 12.0, "minimum": 1.0 }, - "end_year": { "type": "integer", "maximum": 2077.0 }, + "end_month": { "type": "integer", "maximum": 12, "minimum": 1 }, + "end_year": { "type": "integer", "maximum": 2077 }, "invoice_id": { "type": "string", "format": "uuid" }, "iterations": { "items": { "$ref": "#/components/schemas/RecurrenceIteration" }, "type": "array" }, "recipients": { "$ref": "#/components/schemas/Recipients" }, - "start_month": { "type": "integer", "maximum": 12.0, "minimum": 1.0 }, - "start_year": { "type": "integer", "maximum": 2077.0 }, + "start_month": { "type": "integer", "maximum": 12, "minimum": 1 }, + "start_year": { "type": "integer", "maximum": 2077 }, "status": { "$ref": "#/components/schemas/RecurrenceStatus" }, "subject_text": { "type": "string" } }, @@ -52237,11 +52339,7 @@ "Reminder": { "properties": { "body": { "type": "string" }, - "days_before": { - "type": "integer", - "maximum": 10000.0, - "minimum": 1.0 - }, + "days_before": { "type": "integer", "maximum": 10000, "minimum": 1 }, "subject": { "type": "string" } }, "additionalProperties": false, @@ -52333,13 +52431,13 @@ "product": { "$ref": "#/components/schemas/LineItemProduct" }, "quantity": { "type": "number", - "maximum": 2147483647.0, - "minimum": 0.0, + "maximum": 2147483647, + "minimum": 0, "description": "The quantity of each of the goods, materials, or services listed in the receivable." }, "total_before_vat": { "type": "integer", - "maximum": 9007199254740991.0, + "maximum": 9007199254740991, "description": "Total of line_item before VAT in [minor units](https://docs.monite.com/docs/currencies#minor-units)." } }, @@ -52393,7 +52491,7 @@ "description": "Role name" }, "permissions": { - "$ref": "#/components/schemas/BizObjectsSchema-Output", + "$ref": "#/components/schemas/BizObjectsSchema", "description": "Access permissions" }, "status": { @@ -52707,7 +52805,7 @@ "SuggestedPaymentTerm": { "properties": { "date": { "type": "string", "format": "date" }, - "discount": { "type": "integer", "maximum": 10000.0, "minimum": 0.0 } + "discount": { "type": "integer", "maximum": 10000, "minimum": 0 } }, "additionalProperties": false, "type": "object", @@ -53058,8 +53156,8 @@ "end_date": { "type": "string", "format": "date" }, "number_of_days": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The amount of days after the invoice issue date." } }, @@ -53144,14 +53242,14 @@ "id": { "type": "string", "format": "uuid" }, "amount": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 0.0, + "maximum": 9007199254740991, + "minimum": 0, "description": "The total VAT of all line items, in [minor units](https://docs.monite.com/docs/currencies#minor-units)." }, "value": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "Percent minor units. Example: 12.5% is 1250." } }, @@ -53545,8 +53643,8 @@ "currency": { "$ref": "#/components/schemas/CurrencyEnum" }, "deduction_amount": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 0.0, + "maximum": 9007199254740991, + "minimum": 0, "description": "The amount of tax deducted in minor units" }, "deduction_memo": { @@ -53624,8 +53722,8 @@ }, "withholding_tax_rate": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The amount of tax withheld in percent minor units" } }, @@ -53796,20 +53894,20 @@ "properties": { "old_price": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 1.0, + "maximum": 9007199254740991, + "minimum": 1, "description": "The old price of the line item. Used to choose for which line item new price should be applied" }, "price_diff": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 1.0, + "maximum": 9007199254740991, + "minimum": 1, "description": "The price diff of the line item, i.e. applied discount" }, "quantity": { "type": "number", - "maximum": 2147483647.0, - "minimum": 1.0, + "maximum": 2147483647, + "minimum": 1, "description": "The quantity of each of the goods, materials, or services listed in the receivable." } }, @@ -53845,7 +53943,7 @@ }, "valid_for_days": { "type": "integer", - "minimum": 1.0, + "minimum": 1, "description": "Number of days for which purchase order is valid" } }, @@ -53882,8 +53980,8 @@ "currency": { "$ref": "#/components/schemas/CurrencyEnum" }, "deduction_amount": { "type": "integer", - "maximum": 9007199254740991.0, - "minimum": 0.0, + "maximum": 9007199254740991, + "minimum": 0, "description": "The amount of tax deducted in minor units" }, "deduction_memo": { @@ -53963,8 +54061,8 @@ }, "withholding_tax_rate": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "The amount of tax withheld in percent minor units" } }, @@ -53984,8 +54082,8 @@ "properties": { "body_text": { "type": "string" }, "day_of_month": { "$ref": "#/components/schemas/DayOfMonth" }, - "end_month": { "type": "integer", "maximum": 12.0, "minimum": 1.0 }, - "end_year": { "type": "integer", "maximum": 2077.0 }, + "end_month": { "type": "integer", "maximum": 12, "minimum": 1 }, + "end_year": { "type": "integer", "maximum": 2077 }, "recipients": { "$ref": "#/components/schemas/Recipients" }, "subject_text": { "type": "string" } }, @@ -54000,13 +54098,6 @@ { "type": "null" } ], "description": "Role name" - }, - "permissions": { - "anyOf": [ - { "$ref": "#/components/schemas/BizObjectsSchema-Input" }, - { "type": "null" } - ], - "description": "Access permissions" } }, "additionalProperties": false, @@ -54236,8 +54327,8 @@ }, "value": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "Percent minor units. Example: 12.5% is 1250." } }, @@ -54273,8 +54364,8 @@ }, "value": { "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, + "maximum": 10000, + "minimum": 0, "description": "Percent minor units. Example: 12.5% is 1250." } }, @@ -54647,7 +54738,7 @@ }, "size": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "The file size in bytes.", "example": 24381 }, @@ -54685,13 +54776,13 @@ }, "number": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "The page number in the PDF document, from 0.", "example": 0 }, "size": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Image file size, in bytes.", "example": 21972 }, @@ -54772,7 +54863,7 @@ }, "size": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "The file size in bytes.", "example": 24381 }, @@ -54821,13 +54912,13 @@ }, "size": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Image file size, in bytes.", "example": 21972 }, "number": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "The page number in the PDF document, from 0.", "example": 0 }, @@ -54919,7 +55010,7 @@ }, "size": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "The file size in bytes.", "example": 24381 }, @@ -54957,13 +55048,13 @@ }, "number": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "The page number in the PDF document, from 0.", "example": 0 }, "size": { "type": "integer", - "minimum": 0.0, + "minimum": 0, "description": "Image file size, in bytes.", "example": 21972 }, @@ -55018,6 +55109,158 @@ "additionalProperties": false, "type": "object", "required": ["default_currency_code", "rate", "total"] + }, + "ActionEnum": { + "type": "string", + "enum": ["create", "read", "update", "delete"] + }, + "BizObjectsSchema": { + "properties": { + "objects": { + "items": { "$ref": "#/components/schemas/RootSchema" }, + "type": "array", + "description": "List of objects" + } + }, + "additionalProperties": false, + "type": "object" + }, + "CommonSchema": { + "properties": { + "actions": { + "items": { "$ref": "#/components/schemas/ActionSchema" }, + "type": "array", + "description": "List of actions" + }, + "object_type": { + "type": "string", + "enum": [ + "person", + "onboarding", + "comment", + "counterpart", + "entity_user", + "entity", + "entity_vat_ids", + "counterpart_vat_id", + "entity_bank_account", + "export", + "mailbox", + "payables_purchase_order", + "payment_reminder", + "overdue_reminder", + "product", + "project", + "receivable", + "reconciliation", + "role", + "tag", + "todo_task", + "todo_task_mute", + "transaction", + "workflow", + "approval_request", + "approval_policy", + "payment_record" + ], + "description": "Object type", + "default": "comment" + } + }, + "additionalProperties": false, + "type": "object" + }, + "PayableActionEnum": { + "type": "string", + "enum": [ + "create", + "read", + "update", + "delete", + "pay", + "approve", + "cancel", + "submit", + "create_from_mail", + "reopen" + ] + }, + "PayableActionSchema": { + "properties": { + "action_name": { + "allOf": [{ "$ref": "#/components/schemas/PayableActionEnum" }], + "description": "Action name", + "default": "read" + }, + "permission": { + "allOf": [{ "$ref": "#/components/schemas/PermissionEnum" }], + "description": "Permission type", + "default": "allowed" + } + }, + "additionalProperties": false, + "type": "object" + }, + "PayableSchema": { + "properties": { + "actions": { + "items": { "$ref": "#/components/schemas/PayableActionSchema" }, + "type": "array", + "description": "List of actions" + }, + "object_type": { + "type": "string", + "enum": ["payable"], + "description": "Object type", + "default": "payable" + } + }, + "additionalProperties": false, + "type": "object" + }, + "PermissionEnum": { + "type": "string", + "enum": ["allowed", "allowed_for_own", "not_allowed"] + }, + "RootSchema": { + "oneOf": [ + { "$ref": "#/components/schemas/CommonSchema" }, + { "$ref": "#/components/schemas/PayableSchema" } + ], + "additionalProperties": false, + "discriminator": { + "propertyName": "object_type", + "mapping": { + "person": "#/components/schemas/CommonSchema", + "onboarding": "#/components/schemas/CommonSchema", + "comment": "#/components/schemas/CommonSchema", + "counterpart": "#/components/schemas/CommonSchema", + "entity_user": "#/components/schemas/CommonSchema", + "entity": "#/components/schemas/CommonSchema", + "entity_vat_ids": "#/components/schemas/CommonSchema", + "counterpart_vat_id": "#/components/schemas/CommonSchema", + "entity_bank_account": "#/components/schemas/CommonSchema", + "export": "#/components/schemas/CommonSchema", + "mailbox": "#/components/schemas/CommonSchema", + "payables_purchase_order": "#/components/schemas/CommonSchema", + "payment_reminder": "#/components/schemas/CommonSchema", + "overdue_reminder": "#/components/schemas/CommonSchema", + "product": "#/components/schemas/CommonSchema", + "project": "#/components/schemas/CommonSchema", + "receivable": "#/components/schemas/CommonSchema", + "reconciliation": "#/components/schemas/CommonSchema", + "role": "#/components/schemas/CommonSchema", + "tag": "#/components/schemas/CommonSchema", + "todo_task": "#/components/schemas/CommonSchema", + "todo_task_mute": "#/components/schemas/CommonSchema", + "transaction": "#/components/schemas/CommonSchema", + "workflow": "#/components/schemas/CommonSchema", + "approval_request": "#/components/schemas/CommonSchema", + "approval_policy": "#/components/schemas/CommonSchema", + "payment_record": "#/components/schemas/CommonSchema", + "payable": "#/components/schemas/PayableSchema" + } + } } }, "securitySchemes": { "HTTPBearer": { "type": "http", "scheme": "bearer" } } From 58182299071e0ff7e123fc8888283cf924f11448 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Mon, 9 Dec 2024 14:10:09 +0000 Subject: [PATCH 09/49] fix: update mock data with types from new schema --- packages/sdk-react/src/components/userRoles/consts.ts | 1 + packages/sdk-react/src/mocks/payables/payableHandlers.ts | 1 + packages/sdk-react/src/mocks/payables/payablesFixture.ts | 1 + packages/sdk-react/src/mocks/roles/rolesHandlers.ts | 1 - 4 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/sdk-react/src/components/userRoles/consts.ts b/packages/sdk-react/src/components/userRoles/consts.ts index 9ca39b1a5..941126c0b 100644 --- a/packages/sdk-react/src/components/userRoles/consts.ts +++ b/packages/sdk-react/src/components/userRoles/consts.ts @@ -49,6 +49,7 @@ export const getPermissionToLabelMap = (i18n: I18n) => ({ approval_policy: t(i18n)`Approval policy`, payment_record: t(i18n)`Payment record`, payable: t(i18n)`Payable`, + mailbox: t(i18n)`Mailbox`, }); export const ACTION_TO_LATTER_MAP = { diff --git a/packages/sdk-react/src/mocks/payables/payableHandlers.ts b/packages/sdk-react/src/mocks/payables/payableHandlers.ts index e60b400a0..df862a085 100644 --- a/packages/sdk-react/src/mocks/payables/payableHandlers.ts +++ b/packages/sdk-react/src/mocks/payables/payableHandlers.ts @@ -115,6 +115,7 @@ export function addNewItemToPayablesList(): components['schemas']['PayableRespon document_id: (Math.random() + 1).toString(36).substring(7), subtotal: undefined, tax: undefined, + credit_notes: [], }; payableFixturePages.unshift(newItem); diff --git a/packages/sdk-react/src/mocks/payables/payablesFixture.ts b/packages/sdk-react/src/mocks/payables/payablesFixture.ts index 67d8910fb..d51399b81 100644 --- a/packages/sdk-react/src/mocks/payables/payablesFixture.ts +++ b/packages/sdk-react/src/mocks/payables/payablesFixture.ts @@ -18,6 +18,7 @@ function generatePayable( ): components['schemas']['PayableResponseSchema'] { const createdPayable: components['schemas']['PayableResponseSchema'] = { id: faker.string.uuid(), + credit_notes: [], entity_id: getRandomProperty(entityUsers).id, marked_as_paid_with_comment: undefined, marked_as_paid_by_entity_user_id: undefined, diff --git a/packages/sdk-react/src/mocks/roles/rolesHandlers.ts b/packages/sdk-react/src/mocks/roles/rolesHandlers.ts index 785fb3b3a..21927542f 100644 --- a/packages/sdk-react/src/mocks/roles/rolesHandlers.ts +++ b/packages/sdk-react/src/mocks/roles/rolesHandlers.ts @@ -98,7 +98,6 @@ export const rolesHandlers = [ const updatedRole = { ...getAllRolesFixture.data[roleIndex], name: jsonBody.name || '', - permissions: jsonBody.permissions || {}, }; return HttpResponse.json(updatedRole); From 4962ae1ba2eecdb6a49fb62ea3abfe6d0a3bba4a Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Mon, 9 Dec 2024 14:22:41 +0000 Subject: [PATCH 10/49] fix: update mock data with types from new schema --- .../components/payables/PayableDetails/PayableDetails.test.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetails.test.tsx b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetails.test.tsx index 633b32a7f..a44107d54 100644 --- a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetails.test.tsx +++ b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetails.test.tsx @@ -627,6 +627,7 @@ describe('PayableDetails', () => { due_date, payable_origin: 'upload', source_of_payable_data: 'user_specified', + credit_notes: [], }); const testCasesPayable = [ From 83a41242b46ba15b1884ba3099178e3b9057d7de Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Mon, 9 Dec 2024 14:33:26 +0000 Subject: [PATCH 11/49] fix: update translations from type update --- .../src/core/i18n/locales/en/messages.po | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index 2a4af2a28..50b038545 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -678,7 +678,7 @@ msgstr "approvals required" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:519 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:540 #: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:106 -#: src/components/userRoles/consts.ts:73 +#: src/components/userRoles/consts.ts:74 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:223 msgid "Approve" msgstr "Approve" @@ -1266,7 +1266,7 @@ msgstr "Canadian Dollar" #: src/components/tags/ConfirmDeleteModal/ConfirmDeleteModal.test.tsx:24 #: src/components/tags/ConfirmDeleteModal/ConfirmDeleteModal.tsx:102 #: src/components/tags/TagFormModal/TagFormModal.tsx:204 -#: src/components/userRoles/consts.ts:76 +#: src/components/userRoles/consts.ts:77 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:231 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:455 msgid "Cancel" @@ -1898,7 +1898,7 @@ msgstr "Court Costs, Including Alimony and Child Support - Courts of Law" #: src/components/tags/TagFormModal/TagFormModal.test.tsx:85 #: src/components/tags/TagFormModal/TagFormModal.test.tsx:117 #: src/components/tags/TagFormModal/TagFormModal.tsx:214 -#: src/components/userRoles/consts.ts:69 +#: src/components/userRoles/consts.ts:70 #: src/components/userRoles/UserRoleDetails/UserRoleDetails.test.tsx:71 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:207 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:467 @@ -1951,7 +1951,7 @@ msgstr "Create Counterpart – Company" msgid "Create Credit Note" msgstr "Create Credit Note" -#: src/components/userRoles/consts.ts:75 +#: src/components/userRoles/consts.ts:76 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:239 msgid "Create from mail" msgstr "Create from mail" @@ -2264,7 +2264,7 @@ msgstr "default" #: src/components/tags/TagsTable/TagsTable.test.tsx:412 #: src/components/tags/TagsTable/TagsTable.test.tsx:443 #: src/components/tags/TagsTable/TagsTable.tsx:190 -#: src/components/userRoles/consts.ts:71 +#: src/components/userRoles/consts.ts:72 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:215 msgid "Delete" msgstr "Delete" @@ -4152,6 +4152,10 @@ msgstr "Macedonian Denar" msgid "Madagascar" msgstr "Madagascar" +#: src/components/userRoles/consts.ts:52 +msgid "Mailbox" +msgstr "Mailbox" + #: src/components/counterparts/CounterpartDetails/CounterpartView/CounterpartContactView/CounterpartContactView.tsx:163 msgid "Make default" msgstr "Make default" @@ -5015,7 +5019,7 @@ msgstr "Pawn Shops" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:225 #: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:118 #: src/components/payables/PayablesTable/components/PayablesTableAction.tsx:55 -#: src/components/userRoles/consts.ts:74 +#: src/components/userRoles/consts.ts:75 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:227 msgid "Pay" msgstr "Pay" @@ -5577,7 +5581,7 @@ msgstr "Quotes" msgid "Railroads" msgstr "Railroads" -#: src/components/userRoles/consts.ts:68 +#: src/components/userRoles/consts.ts:69 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:203 msgid "Read" msgstr "Read" @@ -5778,7 +5782,7 @@ msgid "Removing an executive role from this person is not allowed" msgstr "Removing an executive role from this person is not allowed" #: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:101 -#: src/components/userRoles/consts.ts:77 +#: src/components/userRoles/consts.ts:78 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:235 msgid "Reopen" msgstr "Reopen" @@ -6348,7 +6352,7 @@ msgstr "Subject" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:435 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:456 #: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:89 -#: src/components/userRoles/consts.ts:72 +#: src/components/userRoles/consts.ts:73 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:219 msgid "Submit" msgstr "Submit" @@ -7069,7 +7073,7 @@ msgstr "Unsupported file type" #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/EditInvoiceDetails.tsx:177 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/TabPanels/PaymentTabPanel/UpdatePDF/UpdatePDFModal.tsx:89 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/TabPanels/PaymentTabPanel/UpdatePDF/UpdatePDFModal.tsx:148 -#: src/components/userRoles/consts.ts:70 +#: src/components/userRoles/consts.ts:71 #: src/components/userRoles/UserRoleDetails/UserRoleDetails.test.tsx:47 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:211 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:467 From 8b7723c7d9673bcafc23ed98fe3392f39bd53420 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Mon, 9 Dec 2024 17:36:37 +0000 Subject: [PATCH 12/49] feat: retrieve finance details for an invoice from api --- .../FinanceInvoice/FinanceDetails.tsx | 92 +++++++++++------- .../FinanceInvoice/FinanceInvoice.tsx | 9 +- .../FinanceInvoice/FinanceOverviewCard.tsx | 48 ++++++--- .../InvoiceStatusChip/InvoiceStatusChip.tsx | 4 +- .../src/components/receivables/consts.ts | 18 +++- .../receivables/getCommonStatusLabel.ts | 16 ++- .../src/core/i18n/locales/en/messages.po | 97 ++++++++++++------- 7 files changed, 196 insertions(+), 88 deletions(-) diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx index 872e0a536..f4cb71e6e 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx @@ -17,46 +17,71 @@ import { INVOICE_DOCUMENT_AUTO_ID } from '../../consts'; type Props = { invoice: components['schemas']['InvoiceResponsePayload']; + financedInvoice: components['schemas']['FinancingInvoice'] | null; + offers: { + offers: components['schemas']['FinancingOffer'][]; + business_status: components['schemas']['WCBusinessStatus']; + } | null; }; -export const FinanceDetails = ({ invoice }: Props) => { +export const FinanceDetails = ({ invoice, offers, financedInvoice }: Props) => { const { i18n } = useLingui(); const { formatCurrencyToDisplay } = useCurrencies(); const theme = useTheme(); const dateFormat = useDateFormat(); - const issueDate = invoice?.issue_date - ? i18n.date(invoice?.issue_date, dateFormat) + const issueDate = financedInvoice + ? i18n.date(financedInvoice.issue_date, dateFormat) : '—'; - const invoiceAmount = formatCurrencyToDisplay( - invoice.total_amount_with_credit_notes, - invoice.currency - ); + const invoiceAmount = financedInvoice + ? formatCurrencyToDisplay( + financedInvoice.total_amount, + financedInvoice.currency + ) + : '-'; + + const financePlans = offers?.offers.map((offer) => ({ + name: t(i18n)`Financing plan`, + items: offer.pricing_plans.map( + (item) => + t( + i18n + )`${item.advance_rate_percentage}% advance rate, Pay in ${item.repayment_duration_days} days, ${item.fee_percentage}% fee` + ), + })); - const financePlans = [ - { - name: 'Financing plan', - items: ['100% advance rate', 'Pay in 30 days', '2% fee'], - }, - ]; - const repaymentDate = invoice?.issue_date - ? i18n.date(invoice?.issue_date, dateFormat) + const repaymentDate = financedInvoice?.repayment_schedule?.repayment_date + ? i18n.date(financedInvoice.repayment_schedule.repayment_date, dateFormat) : '—'; - const receivedSum = formatCurrencyToDisplay( - invoice.total_amount_with_credit_notes, - invoice.currency - ); - const serviceFee = formatCurrencyToDisplay(0, invoice.currency); - const repaymentSum = formatCurrencyToDisplay( - invoice.total_amount_with_credit_notes, - invoice.currency - ); - const paymentDate = invoice?.issue_date - ? i18n.date(invoice?.issue_date, dateFormat) + + const receivedSum = financedInvoice + ? formatCurrencyToDisplay( + financedInvoice.total_amount, + financedInvoice.currency + ) + : '-'; + + const serviceFee = financedInvoice + ? formatCurrencyToDisplay( + financedInvoice.repayment_schedule?.repayment_fee_amount ?? 0, + financedInvoice.currency + ) + : '-'; + + const repaymentSum = financedInvoice + ? formatCurrencyToDisplay( + financedInvoice.repayment_schedule?.repayment_amount ?? 0, + financedInvoice.currency + ) + : '-'; + const paymentDate = financedInvoice?.repayment_schedule?.repayment_date + ? i18n.date(financedInvoice?.repayment_schedule?.repayment_date, dateFormat) : '—'; - const paymentAmount = formatCurrencyToDisplay( - invoice.total_amount_with_credit_notes, - invoice.currency - ); + const paymentAmount = financedInvoice + ? formatCurrencyToDisplay( + financedInvoice.total_amount, + financedInvoice.currency + ) + : '-'; return ( <Box @@ -107,7 +132,7 @@ export const FinanceDetails = ({ invoice }: Props) => { </Box> {/* Finance plans */} - {financePlans.map((plan) => ( + {financePlans?.map((plan) => ( <Box key={plan.name} sx={{ @@ -138,8 +163,9 @@ export const FinanceDetails = ({ invoice }: Props) => { i18n )`Status`}</Typography> <Box> - {/* TODO: Create a new status chip that allows late payment */} - <InvoiceStatusChip status={invoice.status} /> + <InvoiceStatusChip + status={financedInvoice?.status ?? 'DEFAULTED'} + /> </Box> </Box> </Box> diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx index b9ec0679d..a97ce6311 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx @@ -47,7 +47,6 @@ export const FinanceInvoice = ({ ].includes(invoice.status); const financeInvoice = async () => { - // TODO: Consider using the connect token here try { setIsFinancingAnInvoice(true); financeInvoiceMutation.mutate( @@ -73,8 +72,7 @@ export const FinanceInvoice = ({ }, } ); - } catch (error) { - console.log('🚀 ~ financeInvoice ~ error:', error); + } catch { setIsFinancingAnInvoice(false); } }; @@ -92,7 +90,10 @@ export const FinanceInvoice = ({ if (isFinanced) { return ( <Box> - <FinanceOverviewCard invoice={invoice} /> + <FinanceOverviewCard + invoice={invoice} + offers={financeOffersData ?? null} + /> </Box> ); } diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard.tsx index 50de63a9b..45ed8218c 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard.tsx @@ -3,34 +3,55 @@ import { useState } from 'react'; import { components } from '@/api'; import { Dialog } from '@/components/Dialog'; import { useCurrencies } from '@/core/hooks'; +import { useGetFinancedInvoices } from '@/core/queries/useFinancing'; import { useDateFormat } from '@/utils'; import { t } from '@lingui/macro'; import { useLingui } from '@lingui/react'; -import { Box, Typography } from '@mui/material'; +import { Box, Skeleton, Typography } from '@mui/material'; import { InvoiceStatusChip } from '../../InvoiceStatusChip'; import { FinanceDetails } from './FinanceDetails'; type Props = { invoice: components['schemas']['InvoiceResponsePayload']; + offers: { + offers: components['schemas']['FinancingOffer'][]; + business_status: components['schemas']['WCBusinessStatus']; + } | null; }; -export const FinanceOverviewCard = ({ invoice }: Props) => { +export const FinanceOverviewCard = ({ invoice, offers }: Props) => { const { i18n } = useLingui(); const [dialogIsOpen, setDialogIsOpen] = useState(false); const { formatCurrencyToDisplay } = useCurrencies(); + + const { isLoading, data } = useGetFinancedInvoices({ + invoice_id: invoice.id, + type: 'receivable', + }); + + const financedInvoice = data?.data?.[0] ?? null; + const dateFormat = useDateFormat(); - const invoiceAmount = formatCurrencyToDisplay( - invoice.amount_due, - invoice.currency - ); + const repaymentAmount = financedInvoice + ? formatCurrencyToDisplay( + financedInvoice.repayment_schedule?.repayment_amount ?? 0, + invoice.currency + ) + : '—'; - const repaymentDate = invoice?.issue_date - ? i18n.date(invoice?.issue_date, dateFormat) + const repaymentDate = financedInvoice?.repayment_schedule?.repayment_date + ? i18n.date(financedInvoice?.repayment_schedule?.repayment_date, dateFormat) : '—'; + const repaymentStatus = financedInvoice?.status; + + if (isLoading) { + return <Skeleton variant="rounded" height={80} />; + } + return ( <> <Box @@ -49,24 +70,27 @@ export const FinanceOverviewCard = ({ invoice }: Props) => { > <Box> <Typography variant="subtitle2"> - {t(i18n)`Funding for ${invoiceAmount}`} + {t(i18n)`Funding for ${repaymentAmount}`} </Typography> <Typography variant="body1"> {t(i18n)`Repayment on ${repaymentDate}`} </Typography> </Box> <Box> - <InvoiceStatusChip status={invoice.status} /> + <InvoiceStatusChip status={repaymentStatus ?? 'DEFAULTED'} /> </Box> </Box> <Dialog - // className={className + '-Dialog-ProductsTable'} open={dialogIsOpen} onClose={() => setDialogIsOpen(false)} alignDialog="right" > - <FinanceDetails invoice={invoice} /> + <FinanceDetails + invoice={invoice} + offers={offers} + financedInvoice={financedInvoice} + /> </Dialog> </> ); diff --git a/packages/sdk-react/src/components/receivables/InvoiceStatusChip/InvoiceStatusChip.tsx b/packages/sdk-react/src/components/receivables/InvoiceStatusChip/InvoiceStatusChip.tsx index 99bdce4cf..0661828ee 100644 --- a/packages/sdk-react/src/components/receivables/InvoiceStatusChip/InvoiceStatusChip.tsx +++ b/packages/sdk-react/src/components/receivables/InvoiceStatusChip/InvoiceStatusChip.tsx @@ -18,7 +18,9 @@ export interface MoniteInvoiceStatusChipProps { size?: ChipProps['size']; /** Display status icon? */ /** The status of the invoice. */ - status: components['schemas']['ReceivablesStatusEnum']; + status: + | components['schemas']['ReceivablesStatusEnum'] + | components['schemas']['WCInvoiceStatus']; /** The variant of the Chip. */ } diff --git a/packages/sdk-react/src/components/receivables/consts.ts b/packages/sdk-react/src/components/receivables/consts.ts index 7e2e90ca0..9233115fa 100644 --- a/packages/sdk-react/src/components/receivables/consts.ts +++ b/packages/sdk-react/src/components/receivables/consts.ts @@ -14,7 +14,8 @@ import StarHalfOutlinedIcon from '@mui/icons-material/StarHalfOutlined'; import { ChipTypeMap, type SvgIcon } from '@mui/material'; export const ROW_TO_TAG_STATUS_MUI_MAP: Record< - components['schemas']['ReceivablesStatusEnum'], + | components['schemas']['ReceivablesStatusEnum'] + | components['schemas']['WCInvoiceStatus'], ChipTypeMap['props']['color'] > = { draft: 'default', @@ -29,10 +30,17 @@ export const ROW_TO_TAG_STATUS_MUI_MAP: Record< declined: 'error', overdue: 'warning', deleted: 'error', + NEW: 'default', + DEFAULTED: 'default', + PAID: 'success', + FUNDED: 'success', + LATE: 'warning', + REJECTED: 'error', }; export const INVOICE_STATUS_TO_MUI_ICON_MAP: Record< - components['schemas']['ReceivablesStatusEnum'], + | components['schemas']['ReceivablesStatusEnum'] + | components['schemas']['WCInvoiceStatus'], typeof SvgIcon > = { draft: InsertDriveFileOutlinedIcon, @@ -47,6 +55,12 @@ export const INVOICE_STATUS_TO_MUI_ICON_MAP: Record< declined: DangerousOutlinedIcon, overdue: ErrorOutlineOutlinedIcon, deleted: DeleteIcon, + NEW: InsertDriveFileOutlinedIcon, + DEFAULTED: InsertDriveFileOutlinedIcon, + PAID: PaidOutlinedIcon, + FUNDED: PaidOutlinedIcon, + LATE: HourglassBottomOutlinedIcon, + REJECTED: CancelIcon, }; // eslint-disable-next-line lingui/no-unlocalized-strings diff --git a/packages/sdk-react/src/components/receivables/getCommonStatusLabel.ts b/packages/sdk-react/src/components/receivables/getCommonStatusLabel.ts index 6de5f63ff..5398e76c6 100644 --- a/packages/sdk-react/src/components/receivables/getCommonStatusLabel.ts +++ b/packages/sdk-react/src/components/receivables/getCommonStatusLabel.ts @@ -4,7 +4,9 @@ import { t } from '@lingui/macro'; export const getCommonStatusLabel = ( i18n: I18n, - status: components['schemas']['ReceivablesStatusEnum'] + status: + | components['schemas']['ReceivablesStatusEnum'] + | components['schemas']['WCInvoiceStatus'] ) => { switch (status) { case 'draft': @@ -31,6 +33,18 @@ export const getCommonStatusLabel = ( return t(i18n)`Canceled`; case 'deleted': return t(i18n)`Deleted`; + case 'NEW': + return t(i18n)`New`; + case 'DEFAULTED': + return t(i18n)`Defaulted`; + case 'PAID': + return t(i18n)`Paid`; + case 'FUNDED': + return t(i18n)`Funded`; + case 'LATE': + return t(i18n)`Late`; + case 'REJECTED': + return t(i18n)`Rejected`; default: throw new Error(`Unknown status ${JSON.stringify(status)}`); } diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index c5c493a22..7a21aceee 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -102,6 +102,10 @@ msgstr "{0} has been updated" msgid "{0}/{1} issued" msgstr "{0}/{1} issued" +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:46 +msgid "{0}% advance rate, Pay in {1} days, {2}% fee" +msgstr "{0}% advance rate, Pay in {1} days, {2}% fee" + #: src/core/utils/getBankAccountName.tsx:14 msgid "{bankAccountName} (Default)" msgstr "{bankAccountName} (Default)" @@ -122,11 +126,11 @@ msgstr "{days_before} {day_plural} till overdue" msgid "{days, plural, one {day} two {days} few {days} many {days} zero {days} other {days}}" msgstr "{days, plural, one {day} two {days} few {days} many {days} zero {days} other {days}}" -#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:104 +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:129 msgid "{issueDate}" msgstr "{issueDate}" -#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:125 +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:150 msgid "{item}" msgstr "{item}" @@ -134,11 +138,11 @@ msgstr "{item}" msgid "{overdueDays} {0} overdue" msgstr "{overdueDays} {0} overdue" -#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:186 +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:212 msgid "{paymentDate}" msgstr "{paymentDate}" -#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:134 +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:159 msgid "{repaymentDate}" msgstr "{repaymentDate}" @@ -196,7 +200,7 @@ msgstr "Accept ownership declaration" msgid "Accept Service Agreement" msgstr "Accept Service Agreement" -#: src/components/receivables/getCommonStatusLabel.ts:15 +#: src/components/receivables/getCommonStatusLabel.ts:17 msgid "Accepted" msgstr "Accepted" @@ -1346,7 +1350,7 @@ msgstr "Cancel without saving?" #: src/components/approvalRequests/helpers.ts:13 #: src/components/payables/consts.ts:39 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:167 -#: src/components/receivables/getCommonStatusLabel.ts:31 +#: src/components/receivables/getCommonStatusLabel.ts:33 #: src/components/receivables/InvoiceRecurrenceIterationStatusChip/InvoiceRecurrenceIterationStatusChip.tsx:124 #: src/components/receivables/InvoiceRecurrenceStatusChip/InvoiceRecurrenceStatusChip.tsx:132 msgid "Canceled" @@ -2242,7 +2246,7 @@ msgstr "days before due date" msgid "Dear client, as discussed, please find attached our invoice:" msgstr "Dear client, as discussed, please find attached our invoice:" -#: src/components/receivables/getCommonStatusLabel.ts:19 +#: src/components/receivables/getCommonStatusLabel.ts:21 msgid "Declined" msgstr "Declined" @@ -2250,6 +2254,10 @@ msgstr "Declined" msgid "default" msgstr "default" +#: src/components/receivables/getCommonStatusLabel.ts:39 +msgid "Defaulted" +msgstr "Defaulted" + #: src/components/approvalPolicies/ApprovalPolicyDetails/ApprovalPolicyView/ApprovalPolicyView.tsx:330 #: src/components/counterparts/ConfirmDeleteDialogue/ConfirmDeleteDialogue.test.tsx:25 #: src/components/counterparts/ConfirmDeleteDialogue/ConfirmDeleteDialogue.tsx:62 @@ -2346,7 +2354,7 @@ msgid "Delete trigger" msgstr "Delete trigger" #: src/components/approvalPolicies/consts.ts:27 -#: src/components/receivables/getCommonStatusLabel.ts:33 +#: src/components/receivables/getCommonStatusLabel.ts:35 msgid "Deleted" msgstr "Deleted" @@ -2492,7 +2500,7 @@ msgstr "Dominican Peso" msgid "Dominican Republic" msgstr "Dominican Republic" -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:136 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:137 msgid "Don't wait for the payment" msgstr "Don't wait for the payment" @@ -2511,7 +2519,7 @@ msgstr "Download PDF" #: src/components/payables/consts.ts:32 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:84 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:121 -#: src/components/receivables/getCommonStatusLabel.ts:11 +#: src/components/receivables/getCommonStatusLabel.ts:13 msgid "Draft" msgstr "Draft" @@ -2932,7 +2940,7 @@ msgstr "excl. Tax" msgid "Executive" msgstr "Executive" -#: src/components/receivables/getCommonStatusLabel.ts:17 +#: src/components/receivables/getCommonStatusLabel.ts:19 msgid "Expired" msgstr "Expired" @@ -3096,7 +3104,11 @@ msgstr "File successfully attached" msgid "Financial Institutions" msgstr "Financial Institutions" -#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:119 +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:43 +msgid "Financing plan" +msgstr "Financing plan" + +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:144 msgid "Financing plan 1" msgstr "Financing plan 1" @@ -3148,7 +3160,7 @@ msgstr "Florists Supplies, Nursery Stock, and Flowers" msgid "Flow" msgstr "Flow" -#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:94 +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:119 msgid "For {invoiceAmount} | Issued {issueDate}" msgstr "For {invoiceAmount} | Issued {issueDate}" @@ -3244,13 +3256,21 @@ msgstr "Fulfillment date" msgid "Full name" msgstr "Full name" -#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:70 +#: src/components/receivables/getCommonStatusLabel.ts:43 +msgid "Funded" +msgstr "Funded" + +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:95 msgid "Funding details" msgstr "Funding details" #: src/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard.tsx:52 -msgid "Funding for {invoiceAmount}" -msgstr "Funding for {invoiceAmount}" +#~ msgid "Funding for {invoiceAmount}" +#~ msgstr "Funding for {invoiceAmount}" + +#: src/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard.tsx:73 +msgid "Funding for {repaymentAmount}" +msgstr "Funding for {repaymentAmount}" #: src/components/onboarding/dicts/mccCodes.ts:660 msgid "Funeral Services, Crematories" @@ -3300,7 +3320,7 @@ msgstr "Germany" #~ msgid "Germany Frankfurt am Main" #~ msgstr "Germany Frankfurt am Main" -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:167 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:168 msgid "Get paid now" msgstr "Get paid now" @@ -3700,7 +3720,7 @@ msgstr "Invalid issuance" msgid "Invoice" msgstr "Invoice" -#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:86 +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:111 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/ExistingReceivableDetails.tsx:177 msgid "Invoice {0}" msgstr "Invoice {0}" @@ -3859,7 +3879,7 @@ msgstr "Issue invoice and email it to a customer" msgid "Issue only" msgstr "Issue only" -#: src/components/receivables/getCommonStatusLabel.ts:13 +#: src/components/receivables/getCommonStatusLabel.ts:15 msgid "Issued" msgstr "Issued" @@ -4074,6 +4094,10 @@ msgstr "Last update:" msgid "Last updated on" msgstr "Last updated on" +#: src/components/receivables/getCommonStatusLabel.ts:45 +msgid "Late" +msgstr "Late" + #: src/core/utils/countries.ts:139 msgid "Latvia" msgstr "Latvia" @@ -4172,7 +4196,7 @@ msgid "Loading payment page..." msgstr "Loading payment page..." #: src/components/counterparts/CounterpartDetails/CounterpartView/useCounterpartView.tsx:113 -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:166 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:167 msgid "Loading..." msgstr "Loading..." @@ -4585,6 +4609,7 @@ msgid "Netherlands Antilles" msgstr "Netherlands Antilles" #: src/components/payables/consts.ts:33 +#: src/components/receivables/getCommonStatusLabel.ts:37 msgid "New" msgstr "New" @@ -4947,7 +4972,7 @@ msgstr "Orthopedic Goods - Prosthetic Devices" msgid "Osteopaths" msgstr "Osteopaths" -#: src/components/receivables/getCommonStatusLabel.ts:27 +#: src/components/receivables/getCommonStatusLabel.ts:29 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/reminderCardTermsHelpers.tsx:18 msgid "Overdue" msgstr "Overdue" @@ -4993,7 +5018,8 @@ msgstr "Package Stores-Beer, Wine, and Liquor" #: src/components/payables/consts.ts:35 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:243 -#: src/components/receivables/getCommonStatusLabel.ts:25 +#: src/components/receivables/getCommonStatusLabel.ts:27 +#: src/components/receivables/getCommonStatusLabel.ts:41 msgid "Paid" msgstr "Paid" @@ -5051,7 +5077,7 @@ msgid "Parking Lots, Garages" msgstr "Parking Lots, Garages" #: src/components/payables/consts.ts:38 -#: src/components/receivables/getCommonStatusLabel.ts:23 +#: src/components/receivables/getCommonStatusLabel.ts:25 msgid "Partially Paid" msgstr "Partially Paid" @@ -5142,7 +5168,7 @@ msgstr "Payables purchase order" #~ msgid "Payment" #~ msgstr "Payment" -#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:183 +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:209 msgid "Payment amount" msgstr "Payment amount" @@ -5671,7 +5697,7 @@ msgstr "Receivables tabs" msgid "Received" msgstr "Received" -#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:159 +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:185 msgid "Received sum" msgstr "Received sum" @@ -5720,7 +5746,7 @@ msgstr "Recurrence was cancelled, no new invoices will be issued" msgid "Recurrence was completed, all invoices were issued" msgstr "Recurrence was completed, all invoices were issued" -#: src/components/receivables/getCommonStatusLabel.ts:21 +#: src/components/receivables/getCommonStatusLabel.ts:23 #: src/components/receivables/InvoicesTable/InvoicesTable.tsx:186 msgid "Recurring" msgstr "Recurring" @@ -5768,6 +5794,7 @@ msgstr "Reject request" #: src/components/approvalRequests/helpers.ts:14 #: src/components/payables/consts.ts:37 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:207 +#: src/components/receivables/getCommonStatusLabel.ts:47 msgid "Rejected" msgstr "Rejected" @@ -5847,15 +5874,15 @@ msgstr "Removing an executive role from this person is not allowed" msgid "Reopen" msgstr "Reopen" -#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:131 +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:156 msgid "Repayment on" msgstr "Repayment on" -#: src/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard.tsx:55 +#: src/components/receivables/Financing/FinanceInvoice/FinanceOverviewCard.tsx:76 msgid "Repayment on {repaymentDate}" msgstr "Repayment on {repaymentDate}" -#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:167 +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:193 msgid "Repayment sum" msgstr "Repayment sum" @@ -6160,7 +6187,7 @@ msgstr "Serbian Dinar" msgid "Service" msgstr "Service" -#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:163 +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:189 msgid "Service Fee" msgstr "Service Fee" @@ -6410,7 +6437,7 @@ msgstr "Stationery Stores, Office, and School Supply Stores" #: src/components/approvalRequests/ApprovalRequestsTable/ApprovalRequestsTable.tsx:222 #: src/components/payables/PayablesTable/Filters/Filters.tsx:53 #: src/components/payables/PayablesTable/Filters/Filters.tsx:56 -#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:137 +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:162 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/ReceivableRecurrence/InvoiceRecurrenceIterations.tsx:57 #: src/components/receivables/ReceivableFilters/ReceivableFilters.tsx:76 #: src/components/receivables/ReceivableFilters/ReceivableFilters.tsx:79 @@ -6707,7 +6734,7 @@ msgstr "The following fields are required:" msgid "The IBAN should correspond to the chosen country - {country}." msgstr "The IBAN should correspond to the chosen country - {country}." -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:143 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:144 msgid "The issue date should be less than 7 days ago. You can't fund overdue invoices. The loan sum must be within your remaining limit." msgstr "The issue date should be less than 7 days ago. You can't fund overdue invoices. The loan sum must be within your remaining limit." @@ -6794,7 +6821,7 @@ msgstr "This action can't be undone." msgid "This form must be filled out by someone with significant control and management of your business. If that’s not you, make sure to ask the right person to continue." msgstr "This form must be filled out by someone with significant control and management of your business. If that’s not you, make sure to ask the right person to continue." -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:140 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:141 msgid "This invoice can be financed" msgstr "This invoice can be financed" @@ -7056,7 +7083,7 @@ msgstr "Ukraine" msgid "Ukrainian Hryvnia" msgstr "Ukrainian Hryvnia" -#: src/components/receivables/getCommonStatusLabel.ts:29 +#: src/components/receivables/getCommonStatusLabel.ts:31 msgid "Uncollectible" msgstr "Uncollectible" @@ -7587,7 +7614,7 @@ msgstr "Who needs to approve the document and how:" msgid "Wholesale Clubs" msgstr "Wholesale Clubs" -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:151 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:152 msgid "Why?" msgstr "Why?" From decbe75cabdbe9d3453c6e77d6ad827885c355b4 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Mon, 9 Dec 2024 17:41:32 +0000 Subject: [PATCH 13/49] chore: update import --- .../receivables/Financing/FinanceBanner/FinanceBanner.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceBanner/FinanceBanner.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceBanner/FinanceBanner.tsx index 97cdaf0d6..633fd81ec 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceBanner/FinanceBanner.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceBanner/FinanceBanner.tsx @@ -14,7 +14,7 @@ import { Typography, } from '@mui/material'; -import { FinanceFaqWrapper } from './FinanceFaq/FinanceFaqWrapper'; +import { FinanceFaqWrapper } from '../FinanceFaq/FinanceFaqWrapper'; const LOCAL_STORAGE_KEY = 'financing_banner_hidden'; From 40d5dfcbc8c39a2a3b265253a31d01ffb534b667 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Tue, 10 Dec 2024 12:32:57 +0000 Subject: [PATCH 14/49] refactor --- .../Financing/FinanceTab/FinanceTab.tsx | 4 +- .../FinanceWidget/FinanceLimits.stories.tsx | 34 ++++++++++ .../FinanceLimits.tsx} | 67 ++----------------- .../FinanceWidget/FinanceOffers.stories.tsx | 34 ++++++++++ .../{ => FinanceWidget}/FinanceOffers.tsx | 4 +- .../FinanceWidget/FinanceWidget.stories.tsx | 34 ++++++++++ .../FinanceWidget.tsx} | 8 +-- .../FinanceTab/FinanceWidget/index.tsx | 3 + .../FinancedInvoicesTable.stories.tsx | 0 .../FinancedInvoicesTable.tsx | 4 +- .../FinancedInvoicesTable/index.tsx | 1 + .../Financing/FinanceTab/index.tsx | 2 + .../ReceivablesTable/ReceivablesTable.tsx | 2 +- 13 files changed, 123 insertions(+), 74 deletions(-) create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.stories.tsx rename packages/sdk-react/src/components/receivables/Financing/FinanceTab/{FinanceLimit.tsx => FinanceWidget/FinanceLimits.tsx} (55%) create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.stories.tsx rename packages/sdk-react/src/components/receivables/Financing/FinanceTab/{ => FinanceWidget}/FinanceOffers.tsx (98%) create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.stories.tsx rename packages/sdk-react/src/components/receivables/Financing/FinanceTab/{FinanceSummary.tsx => FinanceWidget/FinanceWidget.tsx} (81%) create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/index.tsx create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.stories.tsx rename packages/sdk-react/src/components/receivables/Financing/FinanceTab/{ => FinancedInvoicesTable}/FinancedInvoicesTable.tsx (98%) create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/index.tsx diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx index fd5b68285..7f8fe8b79 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx @@ -5,7 +5,7 @@ import { useLingui } from '@lingui/react'; import { CircularProgress, Stack, Typography } from '@mui/material'; // import { FinancedInvoicesTable } from './FinancedInvoicesTable'; -import { FinanceSummary } from './FinanceSummary'; +import { FinanceWidget } from './FinanceWidget/FinanceWidget'; export const FinanceTab = () => { const { i18n } = useLingui(); @@ -26,7 +26,7 @@ export const FinanceTab = () => { return ( <Stack mt={4} gap={4}> - <FinanceSummary /> + <FinanceWidget /> <DataGridEmptyState title={t(i18n)`No financed invoices yet`} diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.stories.tsx new file mode 100644 index 000000000..f9e1344a6 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.stories.tsx @@ -0,0 +1,34 @@ +import { MemoryRouter } from 'react-router-dom'; + +import { css } from '@emotion/react'; +import { StoryObj } from '@storybook/react'; + +import { FinanceLimits as FinanceLimitsComponent } from './FinanceLimits'; + +const Story = { + title: 'Financing/FinanceTab/FinanceLimits', + component: FinanceLimitsComponent, +}; + +type Story = StoryObj<typeof FinanceLimitsComponent>; + +export const FinanceLimits: Story = { + args: {}, + render: () => ( + <div + css={css` + box-sizing: border-box; + display: flex; + flex-direction: column; + height: 100vh; + padding: 20px; + `} + > + <MemoryRouter> + <FinanceLimitsComponent isLoading={false} /> + </MemoryRouter> + </div> + ), +}; + +export default Story; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceLimit.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx similarity index 55% rename from packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceLimit.tsx rename to packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx index 05e90c77f..a2650430c 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceLimit.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx @@ -1,27 +1,12 @@ import { components } from '@/api'; import { useCurrencies } from '@/core/hooks'; -// import { useMenuButton } from '@/core/hooks'; import { t } from '@lingui/macro'; import { useLingui } from '@lingui/react'; -// import CancelIcon from '@mui/icons-material/Cancel'; -// import EmailIcon from '@mui/icons-material/MailOutline'; -// import MoreHorizIcon from '@mui/icons-material/MoreHoriz'; -import { - Box, - CircularProgress, // Button, - // CircularProgress, - // List, - // ListItem, - // MenuItem, - Typography, -} from '@mui/material'; +import { Box, CircularProgress, Typography } from '@mui/material'; -// import { StyledMenu } from '../../InvoiceDetails/ExistingInvoiceDetails/ExistingInvoiceDetails'; -import { FinanceCardStack } from '../infographics/FinanceCardStack'; +// import { FinanceCardStack } from '../infographics/FinanceCardStack'; -// type Props = {}; - -export const FinanceLimit = ({ +export const FinanceLimits = ({ isLoading, offers, }: { @@ -29,7 +14,6 @@ export const FinanceLimit = ({ offers?: components['schemas']['FinancingOffer'][]; }) => { const { i18n } = useLingui(); - // const { buttonProps, menuProps } = useMenuButton(); const { formatCurrencyToDisplay } = useCurrencies(); const totalLimit = offers?.[0]?.total_amount ?? 0; const remainingLimit = offers?.[0]?.available_amount ?? 0; @@ -56,7 +40,7 @@ export const FinanceLimit = ({ position: 'relative', }} > - <FinanceCardStack + {/* <FinanceCardStack sx={{ position: 'absolute', width: '360px', @@ -65,7 +49,7 @@ export const FinanceLimit = ({ right: 0, zIndex: 0, }} - /> + /> */} <Box sx={{ gap: 4, @@ -115,47 +99,6 @@ export const FinanceLimit = ({ `} </Typography> </Box> - {/* Action buttons */} - {/* <Box - sx={{ - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - }} - > - <Box sx={{ display: 'flex', gap: 1 }}> - <Button - sx={{ backgroundColor: 'black' }} - variant="contained" - >{t(i18n)`Finance invoices`}</Button> - <Button sx={{ color: 'black' }}>{t( - i18n - )`Payment schedule`}</Button> - </Box> - <Box> - <Button - {...buttonProps} - variant="text" - color="primary" - disableElevation - endIcon={<MoreHorizIcon sx={{ color: 'black' }} />} - ></Button> - <StyledMenu {...menuProps}> - <MenuItem onClick={() => {}}> - <EmailIcon fontSize="small" /> - {t(i18n)`Some action`} - </MenuItem> - <MenuItem - onClick={(event) => { - event.preventDefault(); - }} - > - <CancelIcon fontSize="small" /> - {t(i18n)`Cancel Invoice`} - </MenuItem> - </StyledMenu> - </Box> - </Box> */} </Box> </Box> </Box> diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.stories.tsx new file mode 100644 index 000000000..9f658264e --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.stories.tsx @@ -0,0 +1,34 @@ +import { MemoryRouter } from 'react-router-dom'; + +import { css } from '@emotion/react'; +import { StoryObj } from '@storybook/react'; + +import { FinanceOffers as FinanceOffersComponent } from './FinanceOffers'; + +const Story = { + title: 'Financing/FinanceTab/FinanceOffers', + component: FinanceOffersComponent, +}; + +type Story = StoryObj<typeof FinanceOffersComponent>; + +export const FinanceOffers: Story = { + args: {}, + render: () => ( + <div + css={css` + box-sizing: border-box; + display: flex; + flex-direction: column; + height: 100vh; + padding: 20px; + `} + > + <MemoryRouter> + <FinanceOffersComponent isLoading={false} /> + </MemoryRouter> + </div> + ), +}; + +export default Story; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx similarity index 98% rename from packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx rename to packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx index fc782db16..bb0953ea0 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx @@ -4,10 +4,10 @@ import { components } from '@/api'; import { t } from '@lingui/macro'; import { useLingui } from '@lingui/react'; import { - Box, // Button, + Box, CircularProgress, List, - ListItem, // MenuItem, + ListItem, Typography, } from '@mui/material'; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.stories.tsx new file mode 100644 index 000000000..11257309f --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.stories.tsx @@ -0,0 +1,34 @@ +import { MemoryRouter } from 'react-router-dom'; + +import { css } from '@emotion/react'; +import { StoryObj } from '@storybook/react'; + +import { FinanceWidget as FinanceWidgetComponent } from './FinanceWidget'; + +const Story = { + title: 'Financing/FinanceTab/FinanceWidget', + component: FinanceWidgetComponent, +}; + +type Story = StoryObj<typeof FinanceWidgetComponent>; + +export const FinanceWidget: Story = { + args: {}, + render: () => ( + <div + css={css` + box-sizing: border-box; + display: flex; + flex-direction: column; + height: 100vh; + padding: 20px; + `} + > + <MemoryRouter> + <FinanceWidgetComponent /> + </MemoryRouter> + </div> + ), +}; + +export default Story; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceSummary.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.tsx similarity index 81% rename from packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceSummary.tsx rename to packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.tsx index ed1b12a37..700e2fac8 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceSummary.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.tsx @@ -1,12 +1,10 @@ import { useGetFinanceOffers } from '@/core/queries/useFinancing'; import { Box, CircularProgress } from '@mui/material'; -import { FinanceLimit } from './FinanceLimit'; +import { FinanceLimits } from './FinanceLimits'; import { FinanceOffers } from './FinanceOffers'; -// type Props = {}; - -export const FinanceSummary = () => { +export const FinanceWidget = () => { const { isLoading, data } = useGetFinanceOffers(); if (isLoading) { @@ -21,7 +19,7 @@ export const FinanceSummary = () => { <Box sx={{ display: 'flex', justifyContent: 'space-between', gap: 2 }}> {/* Limit */} <Box sx={{ flex: '1 1 0%', maxWidth: '496px', width: '100%' }}> - <FinanceLimit isLoading={isLoading} offers={data?.offers} /> + <FinanceLimits isLoading={isLoading} offers={data?.offers} /> </Box> {/* Current offer */} <Box diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/index.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/index.tsx new file mode 100644 index 000000000..fa3ab6f5d --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/index.tsx @@ -0,0 +1,3 @@ +export * from './FinanceWidget'; +export * from './FinanceOffers'; +export * from './FinanceLimits'; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.stories.tsx new file mode 100644 index 000000000..e69de29bb diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx similarity index 98% rename from packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx rename to packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx index c71dfde02..0a392be91 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx @@ -43,8 +43,8 @@ import { import { useInvoiceRowActionMenuCell, UseInvoiceRowActionMenuCellProps, -} from '../../InvoicesTable/useInvoiceRowActionMenuCell'; -import { useReceivablesFilters } from '../../ReceivableFilters/useReceivablesFilters'; +} from '../../../InvoicesTable/useInvoiceRowActionMenuCell'; +import { useReceivablesFilters } from '../../../ReceivableFilters/useReceivablesFilters'; interface FinancedInvoicesTableBaseProps { /** diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/index.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/index.tsx new file mode 100644 index 000000000..43c980dd3 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/index.tsx @@ -0,0 +1 @@ +export * from './FinancedInvoicesTable'; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/index.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/index.tsx index 3a377c387..d020b9e07 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/index.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/index.tsx @@ -1 +1,3 @@ export * from './FinanceTab'; +export * from './FinanceWidget'; +export * from './FinancedInvoicesTable'; diff --git a/packages/sdk-react/src/components/receivables/ReceivablesTable/ReceivablesTable.tsx b/packages/sdk-react/src/components/receivables/ReceivablesTable/ReceivablesTable.tsx index 891904b10..ae5e5a871 100644 --- a/packages/sdk-react/src/components/receivables/ReceivablesTable/ReceivablesTable.tsx +++ b/packages/sdk-react/src/components/receivables/ReceivablesTable/ReceivablesTable.tsx @@ -258,7 +258,7 @@ const ReceivablesTableBase = ({ /> </Box> )} - {activeTabItem?.query?.type === 'financing' && ( + {activeTabItem?.label == 'Financing' && ( <Box role="tabpanel" id={`${tabsIdBase}-${activeTabIndex}-tabpanel`} From fdf6b3422414aea840fa7a37292a93455432690c Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Tue, 10 Dec 2024 14:30:51 +0000 Subject: [PATCH 15/49] chore: update changeset type --- .changeset/hungry-snakes-provide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/hungry-snakes-provide.md b/.changeset/hungry-snakes-provide.md index 5813fe7ce..68af823db 100644 --- a/.changeset/hungry-snakes-provide.md +++ b/.changeset/hungry-snakes-provide.md @@ -1,6 +1,6 @@ --- -'@monite/sdk-react': patch -'@team-monite/sdk-demo': patch +'@monite/sdk-react': minor +'@team-monite/sdk-demo': minor --- feat(DEV-13399): add integrations page and finance application card From 66d4036c28cdac4ee4925537ef00a49253f54018 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Tue, 10 Dec 2024 15:44:47 +0000 Subject: [PATCH 16/49] feat: update financed invoices table implementation --- .../Financing/FinanceTab/FinanceTab.tsx | 14 +- .../FinancedInvoicesTable.tsx | 207 ++++-------------- .../src/core/i18n/locales/en/messages.po | 59 ++--- 3 files changed, 75 insertions(+), 205 deletions(-) diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx index 7f8fe8b79..d76e8b132 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx @@ -1,10 +1,9 @@ import { useFinancing } from '@/core/queries/useFinancing'; -import { DataGridEmptyState } from '@/ui/DataGridEmptyState'; import { t } from '@lingui/macro'; import { useLingui } from '@lingui/react'; import { CircularProgress, Stack, Typography } from '@mui/material'; -// import { FinancedInvoicesTable } from './FinancedInvoicesTable'; +import { FinancedInvoicesTable } from './FinancedInvoicesTable'; import { FinanceWidget } from './FinanceWidget/FinanceWidget'; export const FinanceTab = () => { @@ -27,16 +26,7 @@ export const FinanceTab = () => { return ( <Stack mt={4} gap={4}> <FinanceWidget /> - - <DataGridEmptyState - title={t(i18n)`No financed invoices yet`} - descriptionLine1={t( - i18n - )`Select invoices you would like to finance and send them for review.`} - descriptionLine2={t(i18n)`What invoices can be financed?.`} - type="no-data" - /> - {/* <FinancedInvoicesTable /> */} + <FinancedInvoicesTable /> </Stack> ); }; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx index 0a392be91..b5c90c01f 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx @@ -2,27 +2,21 @@ import { useMemo, useState } from 'react'; import { components } from '@/api'; import { ScopedCssBaselineContainerClassName } from '@/components/ContainerCssBaseline'; -import { InvoiceRecurrenceStatusChip } from '@/components/receivables/InvoiceRecurrenceStatusChip'; import { InvoiceStatusChip } from '@/components/receivables/InvoiceStatusChip'; -import { ReceivableFilters } from '@/components/receivables/ReceivableFilters/ReceivableFilters'; import { ReceivableFilterType, ReceivablesTabFilter, } from '@/components/receivables/ReceivablesTable/types'; -import { useMoniteContext } from '@/core/context/MoniteContext'; import { MoniteScopedProviders } from '@/core/context/MoniteScopedProviders'; import { - defaultCounterpartColumnWidth, // useAreCounterpartsLoading, + defaultCounterpartColumnWidth, useAutosizeGridColumns, } from '@/core/hooks/useAutosizeGridColumns'; import { useCurrencies } from '@/core/hooks/useCurrencies'; import { useGetFinancedInvoices } from '@/core/queries/useFinancing'; -// import { useReceivables } from '@/core/queries/useReceivables'; import { ReceivableCursorFields } from '@/enums/ReceivableCursorFields'; -import { CounterpartCellById } from '@/ui/CounterpartCell'; import { DataGridEmptyState } from '@/ui/DataGridEmptyState'; import { GetNoRowsOverlay } from '@/ui/DataGridEmptyState/GetNoRowsOverlay'; -import { DueDateCell } from '@/ui/DueDateCell'; import { TablePagination, useTablePaginationThemeDefaultPageSize, @@ -31,8 +25,7 @@ import { classNames } from '@/utils/css-utils'; import { useDateFormat } from '@/utils/MoniteOptions'; import { t } from '@lingui/macro'; import { useLingui } from '@lingui/react'; -import { Sync } from '@mui/icons-material'; -import { Box, Skeleton, Typography } from '@mui/material'; +import { Box, Typography } from '@mui/material'; import { DataGrid, GridColDef, @@ -40,11 +33,7 @@ import { GridSortModel, } from '@mui/x-data-grid'; -import { - useInvoiceRowActionMenuCell, - UseInvoiceRowActionMenuCellProps, -} from '../../../InvoicesTable/useInvoiceRowActionMenuCell'; -import { useReceivablesFilters } from '../../../ReceivableFilters/useReceivablesFilters'; +import { UseInvoiceRowActionMenuCellProps } from '../../../InvoicesTable/useInvoiceRowActionMenuCell'; interface FinancedInvoicesTableBaseProps { /** @@ -87,10 +76,7 @@ export const FinancedInvoicesTable = (props: FinancedInvoicesTableProps) => ( const FinancedInvoicesTableBase = ({ onRowClick, - setIsCreateInvoiceDialogOpen, query, - filters: filtersProp, - ...restProps }: FinancedInvoicesTableProps) => { const { i18n } = useLingui(); @@ -108,46 +94,17 @@ const FinancedInvoicesTableBase = ({ }); const { formatCurrencyToDisplay } = useCurrencies(); - const { filtersQuery, filters, onChangeFilter } = useReceivablesFilters( - ( - [ - 'document_id__contains', - 'status', - 'counterpart_id', - 'due_date__lte', - ] as const - ).filter((filter) => filtersProp?.includes(filter) ?? true), - query - ); - const { data: invoices, isLoading, isError, refetch, } = useGetFinancedInvoices({ - // ...filtersQuery, - // sort: sortModel?.field, order: sortModel?.sort, limit: pageSize, pagination_token: paginationToken, - // type: 'invoice', }); - // const { - // data: invoices, - // isLoading, - // isError, - // refetch, - // } = useReceivables({ - // ...filtersQuery, - // sort: sortModel?.field, - // order: sortModel?.sort, - // limit: pageSize, - // pagination_token: paginationToken, - // type: 'invoice', - // }); - const collection = invoices; const collectionData = collection?.data; @@ -156,13 +113,6 @@ const FinancedInvoicesTableBase = ({ setPaginationToken(undefined); }; - const invoiceActionCell = useInvoiceRowActionMenuCell({ - rowActions: 'rowActions' in restProps ? restProps.rowActions : undefined, - onRowActionClick: - 'onRowActionClick' in restProps ? restProps.onRowActionClick : undefined, - }); - - // const areCounterpartsLoading = useAreCounterpartsLoading(collectionData); const dateFormat = useDateFormat(); const columns = useMemo< @@ -175,29 +125,6 @@ const FinancedInvoicesTableBase = ({ sortable: false, width: 100, renderCell: ({ value }) => { - /* - if (row.status === 'recurring') - return ( - <Typography - className="Monite-TextOverflowContainer" - color="text.primary" - component="span" - variant="body2" - sx={{ - alignItems: 'center', - display: 'inline-flex', - verticalAlign: 'middle', - fontSize: 'inherit', - gap: 0.5, - }} - > - <Sync fontSize="small" color="inherit" /> - {t(i18n)`Recurring`} - </Typography> - ); - - */ - if (!value) { return ( <span className="Monite-TextOverflowContainer"> @@ -214,14 +141,16 @@ const FinancedInvoicesTableBase = ({ }, }, { - field: 'counterpart_name', + field: 'payer_type', headerName: t(i18n)`Customer`, - sortable: ReceivableCursorFields.includes('counterpart_name'), display: 'flex', width: defaultCounterpartColumnWidth, renderCell: (params) => ( - <Typography>{params.row.payer_business_name}</Typography> - // <CounterpartCellById counterpartId={params.row.} /> + <Typography> + {params.row.payer_type == 'BUSINESS' + ? params.row.payer_business_name + : `${params.row.payer_first_name} ${params.row.payer_last_name}`} + </Typography> ), }, { @@ -230,14 +159,6 @@ const FinancedInvoicesTableBase = ({ sortable: ReceivableCursorFields.includes('status'), width: 80, renderCell: ({ value: status }) => { - // if (row.type === 'invoice' && row.recurrence_id) { - // return ( - // <InvoiceRecurrenceStatusChipLoader - // recurrenceId={row.recurrence_id} - // /> - // ); - // } - return <InvoiceStatusChip status={status} />; }, }, @@ -246,43 +167,51 @@ const FinancedInvoicesTableBase = ({ headerName: t(i18n)`Amount due`, headerAlign: 'right', align: 'right', - sortable: ReceivableCursorFields.includes('amount'), width: 120, valueGetter: (_, row) => { - const value = row.total_amount; + const value = row.repayment_schedule?.repayment_amount; return value ? formatCurrencyToDisplay(value, row.currency) : ''; }, }, - // Loan sum - // Financing date - // Payment date - // Financing { - field: 'created_at', - headerName: t(i18n)`Created on`, - sortable: false, - width: 140, - valueFormatter: (value) => (value ? i18n.date(value, dateFormat) : '—'), + field: 'repayment_schedule', + headerName: t(i18n)`Loan sum`, + headerAlign: 'right', + align: 'right', + width: 120, + valueGetter: (_, row) => { + const value = row.repayment_schedule?.repayment_principal_amount; + + return value ? formatCurrencyToDisplay(value, row.currency) : ''; + }, }, { field: 'issue_date', - headerName: t(i18n)`Issue date`, + headerName: t(i18n)`Financing date`, sortable: false, - width: 120, + width: 140, valueFormatter: (value) => (value ? i18n.date(value, dateFormat) : '—'), }, { field: 'due_date', - headerName: t(i18n)`Due date`, + headerName: t(i18n)`Payment date`, sortable: false, width: 120, valueFormatter: (value) => (value ? i18n.date(value, dateFormat) : '—'), - // renderCell: (params) => <DueDateCell data={params.row} />, }, - ...(invoiceActionCell ? [invoiceActionCell] : []), + { + field: 'status', + headerName: t(i18n)`Financing`, + headerAlign: 'right', + align: 'right', + width: 120, + valueGetter: (_, row) => { + return row.status; + }, + }, ]; - }, [formatCurrencyToDisplay, i18n, invoiceActionCell, dateFormat]); + }, [formatCurrencyToDisplay, i18n, dateFormat]); const gridApiRef = useAutosizeGridColumns( collectionData, @@ -291,22 +220,7 @@ const FinancedInvoicesTableBase = ({ // eslint-disable-next-line lingui/no-unlocalized-strings 'FinancedInvoicesTable' ); - - const isFiltering = Object.keys(filters).some( - (key) => - filters[key as keyof typeof filters] !== null && - filters[key as keyof typeof filters] !== undefined - ); - - const isSearching = - !!filters['document_id__contains' as keyof typeof filters]; - - if ( - !isLoading && - collectionData?.length === 0 && - !isFiltering && - !isSearching - ) { + if (!isLoading && collectionData?.length === 0) { return ( <DataGridEmptyState title={t(i18n)`No financed invoices yet`} @@ -332,23 +246,11 @@ const FinancedInvoicesTableBase = ({ pt: 2, }} > - <Typography variant="subtitle1">{t(i18n)`Financed invoices`}</Typography> - {/* <Box sx={{ mt: 2 }}> - <ReceivableFilters - filters={filters} - onChange={(field, value) => { - setPaginationToken(undefined); - onChangeFilter(field, value); - }} - /> - </Box> */} + <Typography mb={2} variant="subtitle1">{t( + i18n + )`Financed invoices`}</Typography> <DataGrid - // initialState={{ - // sorting: { - // sortModel: sortModel && [sortModel], - // }, - // }} apiRef={gridApiRef} rowSelection={false} disableColumnFilter={true} @@ -374,13 +276,11 @@ const FinancedInvoicesTableBase = ({ <GetNoRowsOverlay isLoading={isLoading} dataLength={collectionData?.length || 0} - isFiltering={isFiltering} - isSearching={isSearching} + isFiltering={false} + isSearching={false} isError={isError} - // onCreate={() => setIsCreateInvoiceDialogOpen?.(true)} refetch={refetch} entityName={t(i18n)`Invoices`} - // actionButtonLabel={t(i18n)`Create Invoice`} actionOptions={[t(i18n)`Invoice`]} type="no-data" /> @@ -392,30 +292,3 @@ const FinancedInvoicesTableBase = ({ </Box> ); }; - -// const InvoiceRecurrenceStatusChipLoader = ({ -// recurrenceId, -// }: { -// recurrenceId: string; -// }) => { -// const { api } = useMoniteContext(); - -// const { data: recurrence, isLoading } = -// api.recurrences.getRecurrencesId.useQuery({ -// path: { recurrence_id: recurrenceId }, -// }); - -// if (isLoading) { -// return ( -// <Skeleton -// variant="rounded" -// width="100%" -// sx={{ display: 'inline-block' }} -// /> -// ); -// } - -// if (!recurrence?.status) return null; - -// return <InvoiceRecurrenceStatusChip status={recurrence.status} />; -// }; diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index 1bb37c0f8..ee35b5f45 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -102,11 +102,11 @@ msgstr "{0} has been updated" msgid "{0}/{1} issued" msgstr "{0}/{1} issued" -#: src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx:73 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx:73 msgid "{0}% advance rate" msgstr "{0}% advance rate" -#: src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx:83 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx:83 msgid "{0}% fee" msgstr "{0}% fee" @@ -539,7 +539,7 @@ msgstr "American Samoa" msgid "Amount" msgstr "Amount" -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:246 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:167 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/TabPanels/PaymentTabPanel/PaymentTabPanel.tsx:86 msgid "Amount due" msgstr "Amount due" @@ -2070,7 +2070,6 @@ msgid "Created by user" msgstr "Created by user" #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:150 -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:263 #: src/components/receivables/InvoicesTable/InvoicesTable.tsx:220 #: src/components/receivables/QuotesTable/QuotesTable.tsx:171 #: src/components/userRoles/UserRolesTable/Filters/Filters.tsx:41 @@ -2128,7 +2127,7 @@ msgstr "Cuba" msgid "Currency" msgstr "Currency" -#: src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx:33 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx:33 msgid "Current offer" msgstr "Current offer" @@ -2136,7 +2135,7 @@ msgstr "Current offer" msgid "Current status" msgstr "Current status" -#: src/components/receivables/Financing/FinanceTab/FinanceTab.tsx:21 +#: src/components/receivables/Financing/FinanceTab/FinanceTab.tsx:20 msgid "Currently only supported for US entities" msgstr "Currently only supported for US entities" @@ -2148,7 +2147,7 @@ msgstr "Currently only supported for US entities" #: src/components/counterparts/CounterpartDetails/CounterpartView/CounterpartOrganizationView/CounterpartOrganizationView.tsx:73 #: src/components/counterparts/CounterpartStatusChip/CounterpartStatusChip.tsx:100 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:162 -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:218 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:145 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/CustomerSection.tsx:409 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/OverviewTabPanel.tsx:137 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/sections/PreviewCustomerSection.tsx:56 @@ -2559,7 +2558,6 @@ msgstr "Dry Cleaners" #: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:590 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:319 #: src/components/payables/PayablesTable/Filters/Filters.tsx:81 -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:277 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:60 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:235 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:420 @@ -3092,11 +3090,11 @@ msgstr "File size exceeds {maxFileSizeInMB}MB limit." msgid "File successfully attached" msgstr "File successfully attached" -#: src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx:67 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx:67 msgid "Finance plan" msgstr "Finance plan" -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:335 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:249 msgid "Financed invoices" msgstr "Financed invoices" @@ -3104,10 +3102,15 @@ msgstr "Financed invoices" msgid "Financial Institutions" msgstr "Financial Institutions" +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:205 #: src/core/utils/createThemeWithDefaults.ts:37 msgid "Financing" msgstr "Financing" +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:191 +msgid "Financing date" +msgstr "Financing date" + #: src/components/onboarding/dicts/mccCodes.ts:625 msgid "Fines - Government Administrative Entities" msgstr "Fines - Government Administrative Entities" @@ -3658,7 +3661,7 @@ msgid "Intra-Company Purchases" msgstr "Intra-Company Purchases" #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:142 -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:208 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:135 #: src/components/receivables/InvoicesTable/InvoicesTable.tsx:192 #: src/components/receivables/QuotesTable/QuotesTable.tsx:163 msgid "INV-auto" @@ -3681,7 +3684,7 @@ msgstr "Invalid issuance" #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:215 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:217 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:284 -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:384 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:284 #: src/components/receivables/InvoiceDetails/CreateReceivable/CreateReceivables.tsx:241 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/EditInvoiceDetails.tsx:254 #: src/components/receivables/InvoicesTable/InvoicesTable.tsx:286 @@ -3777,7 +3780,7 @@ msgstr "Invoice to “{0}” was created" msgid "Invoice total" msgstr "Invoice total" -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:382 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:283 #: src/components/receivables/InvoicesTable/InvoicesTable.tsx:359 #: src/core/utils/createThemeWithDefaults.ts:25 msgid "Invoices" @@ -3832,7 +3835,6 @@ msgstr "Issue at" #: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:559 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:300 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:156 -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:270 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:46 #: src/components/receivables/InvoicesTable/InvoicesTable.tsx:227 msgid "Issue date" @@ -4170,6 +4172,10 @@ msgstr "Loading payment page..." msgid "Loading..." msgstr "Loading..." +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:179 +msgid "Loan sum" +msgstr "Loan sum" + #: src/components/onboarding/dicts/mccCodes.ts:817 msgid "Luggage and Leather Goods Stores" msgstr "Luggage and Leather Goods Stores" @@ -4502,7 +4508,7 @@ msgstr "Mozambique" msgid "Music Stores-Musical Instruments, Pianos, and Sheet Music" msgstr "Music Stores-Musical Instruments, Pianos, and Sheet Music" -#: src/components/receivables/Financing/FinanceTab/FinanceLimit.tsx:48 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx:32 msgid "My financing" msgstr "My financing" @@ -4737,8 +4743,7 @@ msgstr "No default email for selected Counterpart. Reminders will not be sent." msgid "No file provided" msgstr "No file provided" -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:312 -#: src/components/receivables/Financing/FinanceTab/FinanceTab.tsx:32 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:226 msgid "No financed invoices yet" msgstr "No financed invoices yet" @@ -4866,7 +4871,7 @@ msgstr "NOT allowed" #: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:412 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:244 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:128 -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:174 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:124 msgid "Number" msgstr "Number" @@ -5089,7 +5094,7 @@ msgctxt "InvoicesTableRowActionMenu" msgid "Pay" msgstr "Pay" -#: src/components/receivables/Financing/FinanceTab/FinanceOffers.tsx:78 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx:78 msgid "Pay in {0}" msgstr "Pay in {0}" @@ -5154,6 +5159,10 @@ msgstr "Payables purchase order" #~ msgid "Payment" #~ msgstr "Payment" +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:198 +msgid "Payment date" +msgstr "Payment date" + #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/sections/PreviewPaymentDetailsSection.tsx:15 msgid "Payment details" msgstr "Payment details" @@ -5789,7 +5798,7 @@ msgstr "Religious Organizations" msgid "Reload" msgstr "Reload" -#: src/components/receivables/Financing/FinanceTab/FinanceLimit.tsx:80 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx:64 msgid "Remaining limit" msgstr "Remaining limit" @@ -6121,8 +6130,7 @@ msgstr "Select counterpart" msgid "Select invoice currency" msgstr "Select invoice currency" -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:313 -#: src/components/receivables/Financing/FinanceTab/FinanceTab.tsx:33 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:227 msgid "Select invoices you would like to finance and send them for review." msgstr "Select invoices you would like to finance and send them for review." @@ -6407,7 +6415,7 @@ msgstr "Stationery Stores, Office, and School Supply Stores" #: src/components/approvalRequests/ApprovalRequestsTable/ApprovalRequestsTable.tsx:222 #: src/components/payables/PayablesTable/Filters/Filters.tsx:53 #: src/components/payables/PayablesTable/Filters/Filters.tsx:56 -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:229 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:158 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/ReceivableRecurrence/InvoiceRecurrenceIterations.tsx:57 #: src/components/receivables/ReceivableFilters/ReceivableFilters.tsx:76 #: src/components/receivables/ReceivableFilters/ReceivableFilters.tsx:79 @@ -7564,8 +7572,7 @@ msgstr "West African CFA Franc" msgid "Western Sahara" msgstr "Western Sahara" -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable.tsx:316 -#: src/components/receivables/Financing/FinanceTab/FinanceTab.tsx:36 +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:230 msgid "What invoices can be financed?." msgstr "What invoices can be financed?." @@ -7732,7 +7739,7 @@ msgstr "You don't have permission to issue this document. Please, contact your s msgid "You don’t have permissions to view this page.<0/>Contact your system administrator for details." msgstr "You don’t have permissions to view this page.<0/>Contact your system administrator for details." -#: src/components/receivables/Financing/FinanceTab/FinanceLimit.tsx:113 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx:97 msgid "Your remaining limit is the amount available to you for financing additional invoices" msgstr "Your remaining limit is the amount available to you for financing additional invoices" From d285acfeb2867fea6abdf953ee0a5c92854115cd Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Wed, 11 Dec 2024 13:49:23 +0000 Subject: [PATCH 17/49] feat: update checks for financing an invoice --- .../FinanceInvoice/FinanceDetails.tsx | 12 +++++----- .../FinanceInvoice/FinanceInvoice.stories.tsx | 6 +---- .../FinanceInvoice/FinanceInvoice.tsx | 24 ++++++++++++------- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx index f4cb71e6e..95a3af44e 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx @@ -43,9 +43,9 @@ export const FinanceDetails = ({ invoice, offers, financedInvoice }: Props) => { name: t(i18n)`Financing plan`, items: offer.pricing_plans.map( (item) => - t( - i18n - )`${item.advance_rate_percentage}% advance rate, Pay in ${item.repayment_duration_days} days, ${item.fee_percentage}% fee` + t(i18n)`${item.advance_rate_percentage / 100}% advance rate, Pay in ${ + item.repayment_duration_days + } days, ${item.fee_percentage / 100}% fee` ), })); @@ -132,7 +132,7 @@ export const FinanceDetails = ({ invoice, offers, financedInvoice }: Props) => { </Box> {/* Finance plans */} - {financePlans?.map((plan) => ( + {financePlans?.map((plan, index) => ( <Box key={plan.name} sx={{ @@ -143,10 +143,10 @@ export const FinanceDetails = ({ invoice, offers, financedInvoice }: Props) => { <Box width="100%"> <Typography variant="body1" color={theme.palette.text.secondary}>{t( i18n - )`Financing plan 1`}</Typography> + )`Financing plan ${index + 1}`}</Typography> <List> {plan.items.map((item) => ( - <ListItem key={item} sx={{ p: 0 }}> + <ListItem key={item} sx={{ p: 0, mt: 1 }}> <Typography variant="body1">{t(i18n)`${item}`}</Typography> </ListItem> ))} diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.stories.tsx index 99744a76e..280433ee3 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.stories.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.stories.tsx @@ -1,5 +1,3 @@ -import { MemoryRouter } from 'react-router-dom'; - import { receivableListFixture } from '@/mocks'; import { css } from '@emotion/react'; import { StoryObj } from '@storybook/react'; @@ -25,9 +23,7 @@ export const FinanceInvoice: Story = { padding: 20px; `} > - <MemoryRouter> - <FinanceInvoiceComponent invoice={receivableListFixture.invoice[0]} /> - </MemoryRouter> + <FinanceInvoiceComponent invoice={receivableListFixture.invoice[0]} /> </div> ), }; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx index a97ce6311..c3dd8fc75 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx @@ -7,6 +7,7 @@ import { FinanceCardStack } from '@/components/receivables/Financing/infographic import { useFinanceAnInvoice, useFinancing, + useGetFinancedInvoices, useGetFinanceOffers, } from '@/core/queries/useFinancing'; // import { getAPIErrorMessage } from '@/core/utils/getAPIErrorMessage'; @@ -29,6 +30,12 @@ export const FinanceInvoice = ({ const { i18n } = useLingui(); const [isFinancingAnInvoice, setIsFinancingAnInvoice] = useState(false); + const { isLoading: isLoadingFinancedInvoices, data: financedInvoices } = + useGetFinancedInvoices({ + invoice_id: invoice.id, + type: 'receivable', + }); + const { isLoading: isLoadingFinanceSdk, isEnabled, @@ -38,13 +45,12 @@ export const FinanceInvoice = ({ const { isLoading: isLoadingFinanceOffers, data: financeOffersData } = useGetFinanceOffers(); - const isLoading = isLoadingFinanceOffers || isLoadingFinanceSdk; + const isLoading = + isLoadingFinanceOffers || isLoadingFinanceSdk || isLoadingFinancedInvoices; const financeInvoiceMutation = useFinanceAnInvoice(); - const invoiceIsEligibleForFinance = [ - 'issued', - 'partially_paid', - 'overdue', - ].includes(invoice.status); + const invoiceIsEligibleForFinance = ['issued', 'partially_paid'].includes( + invoice.status + ); const financeInvoice = async () => { try { @@ -77,15 +83,17 @@ export const FinanceInvoice = ({ } }; + const isOnboarded = financeOffersData?.business_status === 'ONBOARDED'; + if (isLoading) { return <CircularProgress color="inherit" size={20} />; } - if (!isEnabled || !invoiceIsEligibleForFinance) { + if (!isEnabled || !invoiceIsEligibleForFinance || !isOnboarded) { return null; } - const isFinanced = financeOffersData?.business_status === 'ONBOARDED'; + const isFinanced = financedInvoices?.data?.length; if (isFinanced) { return ( From c80a48f4fde57626749bd9f8e712b2eabf53d6d8 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Wed, 11 Dec 2024 13:49:53 +0000 Subject: [PATCH 18/49] chore: update translations --- .../src/core/i18n/locales/en/messages.po | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index 8565ea69e..a8892bb13 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -2509,7 +2509,7 @@ msgstr "Dominican Peso" msgid "Dominican Republic" msgstr "Dominican Republic" -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:137 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:145 msgid "Don't wait for the payment" msgstr "Don't wait for the payment" @@ -3122,8 +3122,12 @@ msgid "Financing plan" msgstr "Financing plan" #: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:144 -msgid "Financing plan 1" -msgstr "Financing plan 1" +msgid "Financing plan {0}" +msgstr "Financing plan {0}" + +#: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:144 +#~ msgid "Financing plan 1" +#~ msgstr "Financing plan 1" #: src/components/onboarding/dicts/mccCodes.ts:625 msgid "Fines - Government Administrative Entities" @@ -3341,7 +3345,7 @@ msgstr "Germany" msgid "Get a small business loan plan to manage finances more efficiently." msgstr "Get a small business loan plan to manage finances more efficiently." -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:168 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:176 msgid "Get paid now" msgstr "Get paid now" @@ -4229,7 +4233,7 @@ msgid "Loading payment page..." msgstr "Loading payment page..." #: src/components/counterparts/CounterpartDetails/CounterpartView/useCounterpartView.tsx:113 -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:167 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:175 msgid "Loading..." msgstr "Loading..." @@ -6779,7 +6783,7 @@ msgstr "The following fields are required:" msgid "The IBAN should correspond to the chosen country - {country}." msgstr "The IBAN should correspond to the chosen country - {country}." -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:144 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:152 msgid "The issue date should be less than 7 days ago. You can't fund overdue invoices. The loan sum must be within your remaining limit." msgstr "The issue date should be less than 7 days ago. You can't fund overdue invoices. The loan sum must be within your remaining limit." @@ -6866,7 +6870,7 @@ msgstr "This action can't be undone." msgid "This form must be filled out by someone with significant control and management of your business. If that’s not you, make sure to ask the right person to continue." msgstr "This form must be filled out by someone with significant control and management of your business. If that’s not you, make sure to ask the right person to continue." -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:141 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:149 msgid "This invoice can be financed" msgstr "This invoice can be financed" @@ -7659,7 +7663,7 @@ msgstr "Who needs to approve the document and how:" msgid "Wholesale Clubs" msgstr "Wholesale Clubs" -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:152 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:160 msgid "Why?" msgstr "Why?" From 28b8c5bd9c0165287b43a9b1a6af54cb4eb7cbf0 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Wed, 11 Dec 2024 15:55:32 +0000 Subject: [PATCH 19/49] refactor --- .../FinanceWidget/FinanceLimits.tsx | 6 +- .../FinanceWidget/FinanceOffers.tsx | 84 +++++++++---------- .../FinancedInvoicesTable.tsx | 15 +--- .../src/core/i18n/locales/en/messages.po | 3 +- 4 files changed, 49 insertions(+), 59 deletions(-) diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx index a2650430c..ba2ec68d6 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx @@ -4,7 +4,7 @@ import { t } from '@lingui/macro'; import { useLingui } from '@lingui/react'; import { Box, CircularProgress, Typography } from '@mui/material'; -// import { FinanceCardStack } from '../infographics/FinanceCardStack'; +import { FinanceCardStack } from '../../infographics/FinanceCardStack'; export const FinanceLimits = ({ isLoading, @@ -40,7 +40,7 @@ export const FinanceLimits = ({ position: 'relative', }} > - {/* <FinanceCardStack + <FinanceCardStack sx={{ position: 'absolute', width: '360px', @@ -49,7 +49,7 @@ export const FinanceLimits = ({ right: 0, zIndex: 0, }} - /> */} + /> <Box sx={{ gap: 4, diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx index bb0953ea0..7cac6c5a5 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx @@ -35,44 +35,44 @@ export const FinanceOffers = ({ mt={2} sx={{ display: 'grid', gap: 2, gridTemplateColumns: '1fr 1fr' }} > - {offers.map((offer, index) => ( - <Box - key={offer.total_amount} - width="100%" - p={3} - sx={{ - backgroundColor: 'rgba(0, 0, 0, 0.02)', - borderRadius: 3, - }} - > - <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}> - <Box - sx={{ - backgroundColor: 'black', - color: 'white', - borderRadius: 1, - width: '24px', - height: '24px', - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - }} - > - {index + 1} + {offers.map((offer) => + offer.pricing_plans.map((item, index) => ( + <Box + key={offer.total_amount} + width="100%" + p={3} + sx={{ + backgroundColor: 'rgba(0, 0, 0, 0.02)', + borderRadius: 3, + }} + > + <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}> + <Box + sx={{ + backgroundColor: 'black', + color: 'white', + borderRadius: 1, + width: '24px', + height: '24px', + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + }} + > + {index + 1} + </Box> + <Typography + variant="body1" + fontWeight={500} + sx={{ flex: '1 1 0%', width: '100%' }} + >{t(i18n)`Finance plan`}</Typography> </Box> - <Typography - variant="body1" - fontWeight={500} - sx={{ flex: '1 1 0%', width: '100%' }} - >{t(i18n)`Finance plan`}</Typography> - </Box> - <List sx={{ mt: 1 }}> - {offer.pricing_plans.map((item) => ( + <List sx={{ mt: 1 }}> <Fragment key={item.advance_rate_percentage}> <ListItem sx={{ p: 0 }}> - <Typography variant="body1">{t( - i18n - )`${item.advance_rate_percentage}% advance rate`}</Typography> + <Typography variant="body1">{t(i18n)`${ + item.advance_rate_percentage / 100 + }% advance rate`}</Typography> </ListItem> <ListItem sx={{ p: 0 }}> <Typography variant="body1">{t( @@ -80,15 +80,15 @@ export const FinanceOffers = ({ )`Pay in ${item.repayment_duration_days}`}</Typography> </ListItem> <ListItem sx={{ p: 0 }}> - <Typography variant="body1">{t( - i18n - )`${item.fee_percentage}% fee`}</Typography> + <Typography variant="body1">{t(i18n)`${ + item.fee_percentage / 100 + }% fee`}</Typography> </ListItem> </Fragment> - ))} - </List> - </Box> - ))} + </List> + </Box> + )) + )} </Box> </Box> ); diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx index b5c90c01f..76028fa13 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx @@ -171,7 +171,7 @@ const FinancedInvoicesTableBase = ({ valueGetter: (_, row) => { const value = row.repayment_schedule?.repayment_amount; - return value ? formatCurrencyToDisplay(value, row.currency) : ''; + return value ? formatCurrencyToDisplay(value, row.currency) : '-'; }, }, { @@ -183,7 +183,7 @@ const FinancedInvoicesTableBase = ({ valueGetter: (_, row) => { const value = row.repayment_schedule?.repayment_principal_amount; - return value ? formatCurrencyToDisplay(value, row.currency) : ''; + return value ? formatCurrencyToDisplay(value, row.currency) : '-'; }, }, { @@ -200,16 +200,6 @@ const FinancedInvoicesTableBase = ({ width: 120, valueFormatter: (value) => (value ? i18n.date(value, dateFormat) : '—'), }, - { - field: 'status', - headerName: t(i18n)`Financing`, - headerAlign: 'right', - align: 'right', - width: 120, - valueGetter: (_, row) => { - return row.status; - }, - }, ]; }, [formatCurrencyToDisplay, i18n, dateFormat]); @@ -287,6 +277,7 @@ const FinancedInvoicesTableBase = ({ ), }} columns={columns} + getRowId={(row) => row.document_id} rows={collectionData ?? []} /> </Box> diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index 6250aa129..19b17bf00 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -3099,7 +3099,7 @@ msgstr "File size exceeds {maxFileSizeInMB}MB limit." msgid "File successfully attached" msgstr "File successfully attached" -#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx:67 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx:68 msgid "Finance plan" msgstr "Finance plan" @@ -3111,7 +3111,6 @@ msgstr "Financed invoices" msgid "Financial Institutions" msgstr "Financial Institutions" -#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:205 #: src/core/utils/createThemeWithDefaults.ts:37 msgid "Financing" msgstr "Financing" From df6d7fe3828886e4bb51bcf4ae6f5d97089eb6cb Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Wed, 11 Dec 2024 17:25:46 +0000 Subject: [PATCH 20/49] refactor: update empty value for finance details --- .../Financing/FinanceInvoice/FinanceDetails.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx index 95a3af44e..b5f5a0666 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx @@ -53,30 +53,30 @@ export const FinanceDetails = ({ invoice, offers, financedInvoice }: Props) => { ? i18n.date(financedInvoice.repayment_schedule.repayment_date, dateFormat) : '—'; - const receivedSum = financedInvoice + const receivedSum = financedInvoice?.total_amount ? formatCurrencyToDisplay( financedInvoice.total_amount, financedInvoice.currency ) : '-'; - const serviceFee = financedInvoice + const serviceFee = financedInvoice?.repayment_schedule ? formatCurrencyToDisplay( - financedInvoice.repayment_schedule?.repayment_fee_amount ?? 0, + financedInvoice.repayment_schedule.repayment_fee_amount, financedInvoice.currency ) : '-'; - const repaymentSum = financedInvoice + const repaymentSum = financedInvoice?.repayment_schedule ? formatCurrencyToDisplay( - financedInvoice.repayment_schedule?.repayment_amount ?? 0, + financedInvoice.repayment_schedule.repayment_amount, financedInvoice.currency ) : '-'; const paymentDate = financedInvoice?.repayment_schedule?.repayment_date ? i18n.date(financedInvoice?.repayment_schedule?.repayment_date, dateFormat) : '—'; - const paymentAmount = financedInvoice + const paymentAmount = financedInvoice?.total_amount ? formatCurrencyToDisplay( financedInvoice.total_amount, financedInvoice.currency From bc2b97521d0f7f458fd7ff4ff4b17e2a817287e7 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Wed, 11 Dec 2024 17:45:16 +0000 Subject: [PATCH 21/49] feat: update eligibility check for financing an invoice --- .../Financing/FinanceInvoice/FinanceInvoice.tsx | 13 ++++++++++++- .../sdk-react/src/core/i18n/locales/en/messages.po | 12 ++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx index c3dd8fc75..e73e7a4be 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx @@ -22,6 +22,8 @@ import { Typography, } from '@mui/material'; +const SIX_DAYS_IN_MILLISECONDS = 6 * 24 * 60 * 60 * 1000; + export const FinanceInvoice = ({ invoice, }: { @@ -48,10 +50,19 @@ export const FinanceInvoice = ({ const isLoading = isLoadingFinanceOffers || isLoadingFinanceSdk || isLoadingFinancedInvoices; const financeInvoiceMutation = useFinanceAnInvoice(); - const invoiceIsEligibleForFinance = ['issued', 'partially_paid'].includes( + + const invoiceStatusIsValid = ['issued', 'partially_paid'].includes( invoice.status ); + const invoiceDueDateIsValid = invoice.due_date + ? new Date(invoice.due_date).getTime() - + (new Date().getTime() + SIX_DAYS_IN_MILLISECONDS) > + 0 + : false; + const invoiceIsEligibleForFinance = + invoiceStatusIsValid && invoiceDueDateIsValid; + const financeInvoice = async () => { try { setIsFinancingAnInvoice(true); diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index a8892bb13..a7772bb4d 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -2509,7 +2509,7 @@ msgstr "Dominican Peso" msgid "Dominican Republic" msgstr "Dominican Republic" -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:145 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:156 msgid "Don't wait for the payment" msgstr "Don't wait for the payment" @@ -3345,7 +3345,7 @@ msgstr "Germany" msgid "Get a small business loan plan to manage finances more efficiently." msgstr "Get a small business loan plan to manage finances more efficiently." -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:176 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:187 msgid "Get paid now" msgstr "Get paid now" @@ -4233,7 +4233,7 @@ msgid "Loading payment page..." msgstr "Loading payment page..." #: src/components/counterparts/CounterpartDetails/CounterpartView/useCounterpartView.tsx:113 -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:175 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:186 msgid "Loading..." msgstr "Loading..." @@ -6783,7 +6783,7 @@ msgstr "The following fields are required:" msgid "The IBAN should correspond to the chosen country - {country}." msgstr "The IBAN should correspond to the chosen country - {country}." -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:152 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:163 msgid "The issue date should be less than 7 days ago. You can't fund overdue invoices. The loan sum must be within your remaining limit." msgstr "The issue date should be less than 7 days ago. You can't fund overdue invoices. The loan sum must be within your remaining limit." @@ -6870,7 +6870,7 @@ msgstr "This action can't be undone." msgid "This form must be filled out by someone with significant control and management of your business. If that’s not you, make sure to ask the right person to continue." msgstr "This form must be filled out by someone with significant control and management of your business. If that’s not you, make sure to ask the right person to continue." -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:149 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:160 msgid "This invoice can be financed" msgstr "This invoice can be financed" @@ -7663,7 +7663,7 @@ msgstr "Who needs to approve the document and how:" msgid "Wholesale Clubs" msgstr "Wholesale Clubs" -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:160 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:171 msgid "Why?" msgstr "Why?" From c06a589da282307bbac56ead4e92f88131ea0805 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Wed, 11 Dec 2024 18:34:18 +0000 Subject: [PATCH 22/49] chore --- .../FinanceTab/FinanceWidget/FinanceWidget.tsx | 10 +++------- .../FinancedInvoicesTable/FinancedInvoicesTable.tsx | 4 ++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.tsx index 700e2fac8..6ca51e19d 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.tsx @@ -16,17 +16,13 @@ export const FinanceWidget = () => { } return ( - <Box sx={{ display: 'flex', justifyContent: 'space-between', gap: 2 }}> + <Box sx={{ display: 'flex', gap: 4 }}> {/* Limit */} - <Box sx={{ flex: '1 1 0%', maxWidth: '496px', width: '100%' }}> + <Box sx={{ width: '100%' }}> <FinanceLimits isLoading={isLoading} offers={data?.offers} /> </Box> {/* Current offer */} - <Box - sx={{ - width: '542px', - }} - > + <Box sx={{ width: '100%' }}> <FinanceOffers isLoading={isLoading} offers={data?.offers} /> </Box> </Box> diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx index 76028fa13..be1f1e4ca 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx @@ -123,7 +123,7 @@ const FinancedInvoicesTableBase = ({ field: 'document_id', headerName: t(i18n)`Number`, sortable: false, - width: 100, + width: 140, renderCell: ({ value }) => { if (!value) { return ( @@ -157,7 +157,7 @@ const FinancedInvoicesTableBase = ({ field: 'status', headerName: t(i18n)`Status`, sortable: ReceivableCursorFields.includes('status'), - width: 80, + width: 160, renderCell: ({ value: status }) => { return <InvoiceStatusChip status={status} />; }, From 4237ad0811eb7c2d5bab195f863e8dacbf11d05f Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Wed, 11 Dec 2024 23:12:30 +0000 Subject: [PATCH 23/49] refactor --- .../FinanceApplicationCard.tsx | 13 +------- .../Financing/FinanceTab/FinanceTab.tsx | 29 ++++------------- .../FinanceLimits.stories.tsx | 2 +- .../{ => FinanceLimits}/FinanceLimits.tsx | 2 +- .../FinanceWidget/FinanceLimits/index.tsx | 1 + .../FinanceOffers.stories.tsx | 2 +- .../{ => FinanceOffers}/FinanceOffers.tsx | 0 .../FinanceWidget/FinanceOffers/index.tsx | 1 + .../FinanceWidget/FinanceWidget.tsx | 15 +++++++-- .../FinancedInvoicesTable.stories.tsx | 30 +++++++++++++++++ .../FinancedInvoicesTable.tsx | 6 ++-- .../ReceivablesTable/ReceivablesTable.tsx | 31 +++++++++++------- .../src/core/i18n/locales/en/messages.po | 32 +++++++++---------- .../src/core/queries/useFinancing.ts | 2 ++ .../src/core/utils/createThemeWithDefaults.ts | 4 ++- 15 files changed, 100 insertions(+), 70 deletions(-) rename packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/{ => FinanceLimits}/FinanceLimits.stories.tsx (91%) rename packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/{ => FinanceLimits}/FinanceLimits.tsx (97%) create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/index.tsx rename packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/{ => FinanceOffers}/FinanceOffers.stories.tsx (91%) rename packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/{ => FinanceOffers}/FinanceOffers.tsx (100%) create mode 100644 packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/index.tsx diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx index 400981351..8f93b0e44 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx @@ -33,18 +33,7 @@ export const FinanceApplicationCard = () => { } if (!isEnabled) { - return ( - <Stack - gap={3} - sx={{ border: '1px solid', borderColor: 'divider' }} - borderRadius={3} - p={3} - > - <Typography variant="body1"> - {t(i18n)`Financing is currently only available for US entities`} - </Typography> - </Stack> - ); + return null; } return ( diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx index d76e8b132..84b923a22 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx @@ -1,32 +1,17 @@ -import { useFinancing } from '@/core/queries/useFinancing'; -import { t } from '@lingui/macro'; -import { useLingui } from '@lingui/react'; -import { CircularProgress, Stack, Typography } from '@mui/material'; +import { Stack } from '@mui/material'; import { FinancedInvoicesTable } from './FinancedInvoicesTable'; import { FinanceWidget } from './FinanceWidget/FinanceWidget'; -export const FinanceTab = () => { - const { i18n } = useLingui(); - - const { isLoading, isEnabled } = useFinancing(); - - if (isLoading) { - return <CircularProgress color="inherit" size={20} />; - } - - if (!isEnabled) { - return ( - <Typography mt={4} variant="subtitle1">{t( - i18n - )`Currently only supported for US entities`}</Typography> - ); - } - +export const FinanceTab = ({ + onRowClick, +}: { + onRowClick?: (invoice_id: string) => void; +}) => { return ( <Stack mt={4} gap={4}> <FinanceWidget /> - <FinancedInvoicesTable /> + <FinancedInvoicesTable onRowClick={onRowClick} /> </Stack> ); }; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.stories.tsx similarity index 91% rename from packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.stories.tsx rename to packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.stories.tsx index f9e1344a6..4262e0a0f 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.stories.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.stories.tsx @@ -6,7 +6,7 @@ import { StoryObj } from '@storybook/react'; import { FinanceLimits as FinanceLimitsComponent } from './FinanceLimits'; const Story = { - title: 'Financing/FinanceTab/FinanceLimits', + title: 'Financing/FinanceTab/FinanceWidget/FinanceLimits', component: FinanceLimitsComponent, }; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.tsx similarity index 97% rename from packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx rename to packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.tsx index ba2ec68d6..12b14340d 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.tsx @@ -4,7 +4,7 @@ import { t } from '@lingui/macro'; import { useLingui } from '@lingui/react'; import { Box, CircularProgress, Typography } from '@mui/material'; -import { FinanceCardStack } from '../../infographics/FinanceCardStack'; +import { FinanceCardStack } from '../../../infographics/FinanceCardStack'; export const FinanceLimits = ({ isLoading, diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/index.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/index.tsx new file mode 100644 index 000000000..42f058bf4 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/index.tsx @@ -0,0 +1 @@ +export * from './FinanceLimits'; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.stories.tsx similarity index 91% rename from packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.stories.tsx rename to packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.stories.tsx index 9f658264e..da199a5ef 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.stories.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.stories.tsx @@ -6,7 +6,7 @@ import { StoryObj } from '@storybook/react'; import { FinanceOffers as FinanceOffersComponent } from './FinanceOffers'; const Story = { - title: 'Financing/FinanceTab/FinanceOffers', + title: 'Financing/FinanceTab/FinanceWidget/FinanceOffers', component: FinanceOffersComponent, }; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx similarity index 100% rename from packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx rename to packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/index.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/index.tsx new file mode 100644 index 000000000..59ac6d894 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/index.tsx @@ -0,0 +1 @@ +export * from './FinanceOffers'; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.tsx index 6ca51e19d..022478e3a 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.tsx @@ -1,5 +1,5 @@ import { useGetFinanceOffers } from '@/core/queries/useFinancing'; -import { Box, CircularProgress } from '@mui/material'; +import { Box, Skeleton } from '@mui/material'; import { FinanceLimits } from './FinanceLimits'; import { FinanceOffers } from './FinanceOffers'; @@ -8,7 +8,18 @@ export const FinanceWidget = () => { const { isLoading, data } = useGetFinanceOffers(); if (isLoading) { - return <CircularProgress color="inherit" size={20} />; + return ( + <Box sx={{ display: 'flex', gap: 4 }}> + {/* Limit */} + <Box sx={{ width: '100%' }}> + <Skeleton variant="rounded" height="250px" width="100%" /> + </Box> + {/* Current offer */} + <Box sx={{ width: '100%' }}> + <Skeleton variant="rounded" height="250px" width="100%" /> + </Box> + </Box> + ); } if (!data?.offers || data.offers.length === 0) { diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.stories.tsx index e69de29bb..d8c09736f 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.stories.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.stories.tsx @@ -0,0 +1,30 @@ +import { css } from '@emotion/react'; +import { StoryObj } from '@storybook/react'; + +import { FinancedInvoicesTable as FinancedInvoicesTableComponent } from './FinancedInvoicesTable'; + +const Story = { + title: 'Financing/FinanceTab/FinancedInvoicesTable', + component: FinancedInvoicesTableComponent, +}; + +type Story = StoryObj<typeof FinancedInvoicesTableComponent>; + +export const FinancedInvoicesTable: Story = { + args: {}, + render: () => ( + <div + css={css` + box-sizing: border-box; + display: flex; + flex-direction: column; + height: 100vh; + padding: 20px; + `} + > + <FinancedInvoicesTableComponent /> + </div> + ), +}; + +export default Story; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx index be1f1e4ca..4090e281b 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx @@ -39,9 +39,9 @@ interface FinancedInvoicesTableBaseProps { /** * The event handler for a row click. * - * @param id - The identifier of the clicked row, a string. + * @param invoice_id - The identifier of the clicked row, a string. */ - onRowClick?: (id: string) => void; + onRowClick?: (invoice_id: string) => void; /** * The event handler for the creation new invoice for no data state @@ -246,7 +246,7 @@ const FinancedInvoicesTableBase = ({ disableColumnFilter={true} loading={isLoading} onSortModelChange={onChangeSort} - onRowClick={(params) => onRowClick?.(params.row.id)} + onRowClick={(params) => onRowClick?.(params.row.invoice_id)} slots={{ pagination: () => ( <TablePagination diff --git a/packages/sdk-react/src/components/receivables/ReceivablesTable/ReceivablesTable.tsx b/packages/sdk-react/src/components/receivables/ReceivablesTable/ReceivablesTable.tsx index ae5e5a871..2cf31d189 100644 --- a/packages/sdk-react/src/components/receivables/ReceivablesTable/ReceivablesTable.tsx +++ b/packages/sdk-react/src/components/receivables/ReceivablesTable/ReceivablesTable.tsx @@ -9,6 +9,7 @@ import { ReceivablesTabFilter, } from '@/components/receivables/ReceivablesTable/types'; import { MoniteScopedProviders } from '@/core/context/MoniteScopedProviders'; +import { FINANCING_LABEL, useFinancing } from '@/core/queries/useFinancing'; import { classNames } from '@/utils/css-utils'; import { t } from '@lingui/macro'; import { useLingui } from '@lingui/react'; @@ -156,6 +157,7 @@ const ReceivablesTableBase = ({ ...inProps }: ReceivablesTableProps) => { const { tab, tabs } = useReceivablesTableProps(inProps); + const { isLoading, isEnabled } = useFinancing(); const { i18n } = useLingui(); const [activeTabIndex, setActiveTabIndex] = useState(tab ?? 0); @@ -183,15 +185,22 @@ const ReceivablesTableBase = ({ aria-label={t(i18n)`Receivables tabs`} onChange={(_, value) => handleTabChange(Number(value))} > - {tabs?.map(({ label }, index) => ( - <Tab - key={`${label}-${tabsIdBase}-${index}`} - id={`${tabsIdBase}-${index}-tab`} - aria-controls={`${tabsIdBase}-${index}-tabpanel`} - label={label} - value={index} - /> - ))} + {tabs?.map(({ label }, index) => { + if (label == FINANCING_LABEL && !isEnabled) { + return null; + } + + return ( + <Tab + key={`${label}-${tabsIdBase}-${index}`} + id={`${tabsIdBase}-${index}-tab`} + aria-controls={`${tabsIdBase}-${index}-tabpanel`} + label={label} + value={index} + disabled={isLoading} + /> + ); + })} </Tabs> </Box> @@ -258,7 +267,7 @@ const ReceivablesTableBase = ({ /> </Box> )} - {activeTabItem?.label == 'Financing' && ( + {activeTabItem?.label == FINANCING_LABEL && ( <Box role="tabpanel" id={`${tabsIdBase}-${activeTabIndex}-tabpanel`} @@ -270,7 +279,7 @@ const ReceivablesTableBase = ({ minHeight: '0', }} > - <FinanceTab /> + <FinanceTab onRowClick={onRowClick} /> </Box> )} </> diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index a61ca5121..dc2c2b2bb 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -102,7 +102,7 @@ msgstr "{0} has been updated" msgid "{0}/{1} issued" msgstr "{0}/{1} issued" -#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx:73 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx:73 msgid "{0}% advance rate" msgstr "{0}% advance rate" @@ -110,7 +110,7 @@ msgstr "{0}% advance rate" msgid "{0}% advance rate, Pay in {1} days, {2}% fee" msgstr "{0}% advance rate, Pay in {1} days, {2}% fee" -#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx:83 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx:83 msgid "{0}% fee" msgstr "{0}% fee" @@ -2110,7 +2110,7 @@ msgstr "Created on" msgid "Creating payment link..." msgstr "Creating payment link..." -#: src/core/utils/createThemeWithDefaults.ts:33 +#: src/core/utils/createThemeWithDefaults.ts:35 msgid "Credit notes" msgstr "Credit notes" @@ -2156,7 +2156,7 @@ msgstr "Cuba" msgid "Currency" msgstr "Currency" -#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx:33 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx:33 msgid "Current offer" msgstr "Current offer" @@ -2165,8 +2165,8 @@ msgid "Current status" msgstr "Current status" #: src/components/receivables/Financing/FinanceTab/FinanceTab.tsx:20 -msgid "Currently only supported for US entities" -msgstr "Currently only supported for US entities" +#~ msgid "Currently only supported for US entities" +#~ msgstr "Currently only supported for US entities" #: src/components/counterparts/CounterpartDetails/CounterpartForm/CounterpartIndividualForm/CounterpartIndividualForm.tsx:272 #: src/components/counterparts/CounterpartDetails/CounterpartForm/CounterpartIndividualForm/CounterpartIndividualForm.tsx:275 @@ -3127,7 +3127,7 @@ msgstr "File size exceeds {maxFileSizeInMB}MB limit." msgid "File successfully attached" msgstr "File successfully attached" -#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx:68 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx:68 msgid "Finance plan" msgstr "Finance plan" @@ -3140,8 +3140,8 @@ msgid "Financial Institutions" msgstr "Financial Institutions" #: src/core/utils/createThemeWithDefaults.ts:37 -msgid "Financing" -msgstr "Financing" +#~ msgid "Financing" +#~ msgstr "Financing" #: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:191 msgid "Financing date" @@ -3879,7 +3879,7 @@ msgstr "Invoice total" #: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:273 #: src/components/receivables/InvoicesTable/InvoicesTable.tsx:363 -#: src/core/utils/createThemeWithDefaults.ts:25 +#: src/core/utils/createThemeWithDefaults.ts:27 msgid "Invoices" msgstr "Invoices" @@ -4610,7 +4610,7 @@ msgstr "Mozambique" msgid "Music Stores-Musical Instruments, Pianos, and Sheet Music" msgstr "Music Stores-Musical Instruments, Pianos, and Sheet Music" -#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx:32 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.tsx:32 msgid "My financing" msgstr "My financing" @@ -5198,7 +5198,7 @@ msgctxt "InvoicesTableRowActionMenu" msgid "Pay" msgstr "Pay" -#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers.tsx:78 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx:78 msgid "Pay in {0}" msgstr "Pay in {0}" @@ -5754,7 +5754,7 @@ msgid "Quick Copy, Repro, and Blueprint" msgstr "Quick Copy, Repro, and Blueprint" #: src/components/receivables/QuotesTable/QuotesTable.tsx:295 -#: src/core/utils/createThemeWithDefaults.ts:29 +#: src/core/utils/createThemeWithDefaults.ts:31 msgid "Quotes" msgstr "Quotes" @@ -5796,7 +5796,7 @@ msgid "Receivable type not supported" msgstr "Receivable type not supported" #: src/components/approvalPolicies/RolesAndPolicies.tsx:159 -#: src/components/receivables/ReceivablesTable/ReceivablesTable.tsx:183 +#: src/components/receivables/ReceivablesTable/ReceivablesTable.tsx:185 msgid "Receivables tabs" msgstr "Receivables tabs" @@ -5919,7 +5919,7 @@ msgstr "Religious Organizations" msgid "Reload" msgstr "Reload" -#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx:64 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.tsx:64 msgid "Remaining limit" msgstr "Remaining limit" @@ -7889,7 +7889,7 @@ msgstr "You don't have permission to issue this document. Please, contact your s msgid "You don’t have permissions to view this page.<0/>Contact your system administrator for details." msgstr "You don’t have permissions to view this page.<0/>Contact your system administrator for details." -#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits.tsx:97 +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.tsx:97 msgid "Your remaining limit is the amount available to you for financing additional invoices" msgstr "Your remaining limit is the amount available to you for financing additional invoices" diff --git a/packages/sdk-react/src/core/queries/useFinancing.ts b/packages/sdk-react/src/core/queries/useFinancing.ts index dee9c88bd..bed62f60b 100644 --- a/packages/sdk-react/src/core/queries/useFinancing.ts +++ b/packages/sdk-react/src/core/queries/useFinancing.ts @@ -6,6 +6,8 @@ import { Services } from '@/api'; import { useMoniteContext } from '../context/MoniteContext'; import { useMyEntity } from './useMe'; +export const FINANCING_LABEL = 'Financing'; + export const useGetFinancedInvoices = ( query: Services['financingInvoices']['getFinancingInvoices']['types']['parameters']['query'], enabled = true diff --git a/packages/sdk-react/src/core/utils/createThemeWithDefaults.ts b/packages/sdk-react/src/core/utils/createThemeWithDefaults.ts index 245540692..b89700175 100644 --- a/packages/sdk-react/src/core/utils/createThemeWithDefaults.ts +++ b/packages/sdk-react/src/core/utils/createThemeWithDefaults.ts @@ -8,6 +8,8 @@ import { type Components, } from '@mui/material'; +import { FINANCING_LABEL } from '../queries/useFinancing'; + /** * Create a theme with the default component's `defaultProps` */ @@ -34,7 +36,7 @@ export const createThemeWithDefaults = ( query: { type: 'credit_note' }, }, { - label: t(i18n)`Financing`, + label: FINANCING_LABEL, query: { type: 'financing' }, }, ], From d7209eb9b2e64956ebe0b6124104fb7433beebe7 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Wed, 11 Dec 2024 23:17:33 +0000 Subject: [PATCH 24/49] chore: update translations --- .../sdk-react/src/core/i18n/locales/en/messages.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index dc2c2b2bb..f32cb3c03 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -134,7 +134,7 @@ msgstr "{days_before} {day_plural} till overdue" msgid "{days, plural, one {day} two {days} few {days} many {days} zero {days} other {days}}" msgstr "{days, plural, one {day} two {days} few {days} many {days} zero {days} other {days}}" -#: src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx:94 +#: src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx:83 #: src/components/receivables/Financing/FinanceBanner/FinanceBanner.tsx:118 msgid "{displayButtonMessage}" msgstr "{displayButtonMessage}" @@ -650,7 +650,7 @@ msgstr "Any user with role" msgid "Applied policy" msgstr "Applied policy" -#: src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx:78 +#: src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx:67 msgid "Apply for a monthly plan loans to manage your business more efficiently" msgstr "Apply for a monthly plan loans to manage your business more efficiently" @@ -3148,8 +3148,8 @@ msgid "Financing date" msgstr "Financing date" #: src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx:44 -msgid "Financing is currently only available for US entities" -msgstr "Financing is currently only available for US entities" +#~ msgid "Financing is currently only available for US entities" +#~ msgstr "Financing is currently only available for US entities" #: src/components/receivables/Financing/FinanceInvoice/FinanceDetails.tsx:43 msgid "Financing plan" @@ -3831,7 +3831,7 @@ msgstr "Invoice date" msgid "Invoice delete confirmation" msgstr "Invoice delete confirmation" -#: src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx:74 +#: src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx:63 msgid "Invoice financing" msgstr "Invoice financing" @@ -5767,7 +5767,7 @@ msgstr "Railroads" msgid "Read" msgstr "Read" -#: src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx:100 +#: src/components/receivables/Financing/FinanceApplicationCard/FinanceApplicationCard.tsx:89 msgid "Read more" msgstr "Read more" From f5494ef7f3aa662f19c7b63eb102762b2752ad0d Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Thu, 12 Dec 2024 10:48:18 +0000 Subject: [PATCH 25/49] refactor --- .../FinanceInvoice/FinanceInvoice.tsx | 6 +++++- .../FinanceOffers/FinanceOffers.tsx | 2 +- .../src/core/i18n/locales/en/messages.po | 20 +++++++++++-------- .../src/core/queries/useFinancing.ts | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx index e73e7a4be..a5b5d1e86 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx @@ -100,7 +100,7 @@ export const FinanceInvoice = ({ return <CircularProgress color="inherit" size={20} />; } - if (!isEnabled || !invoiceIsEligibleForFinance || !isOnboarded) { + if (!isEnabled || !isOnboarded) { return null; } @@ -117,6 +117,10 @@ export const FinanceInvoice = ({ ); } + if (!invoiceIsEligibleForFinance) { + return null; + } + return ( <Box sx={{ diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx index 7cac6c5a5..635bb6383 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx @@ -77,7 +77,7 @@ export const FinanceOffers = ({ <ListItem sx={{ p: 0 }}> <Typography variant="body1">{t( i18n - )`Pay in ${item.repayment_duration_days}`}</Typography> + )`Pay in ${item.repayment_duration_days} days`}</Typography> </ListItem> <ListItem sx={{ p: 0 }}> <Typography variant="body1">{t(i18n)`${ diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index f32cb3c03..c63166d2e 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -2527,7 +2527,7 @@ msgstr "Dominican Peso" msgid "Dominican Republic" msgstr "Dominican Republic" -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:156 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:160 msgid "Don't wait for the payment" msgstr "Don't wait for the payment" @@ -3379,7 +3379,7 @@ msgstr "Germany" msgid "Get a small business loan plan to manage finances more efficiently." msgstr "Get a small business loan plan to manage finances more efficiently." -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:187 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:191 msgid "Get paid now" msgstr "Get paid now" @@ -4270,7 +4270,7 @@ msgid "Loading payment page..." msgstr "Loading payment page..." #: src/components/counterparts/CounterpartDetails/CounterpartView/useCounterpartView.tsx:113 -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:186 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:190 msgid "Loading..." msgstr "Loading..." @@ -5199,8 +5199,12 @@ msgid "Pay" msgstr "Pay" #: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx:78 -msgid "Pay in {0}" -msgstr "Pay in {0}" +#~ msgid "Pay in {0}" +#~ msgstr "Pay in {0}" + +#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx:78 +msgid "Pay in {0} days" +msgstr "Pay in {0} days" #: src/components/payables/PayablesTable/PayablesTable.tsx:521 #: src/components/userRoles/consts.ts:51 @@ -6850,7 +6854,7 @@ msgstr "The following fields are required:" msgid "The IBAN should correspond to the chosen country - {country}." msgstr "The IBAN should correspond to the chosen country - {country}." -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:163 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:167 msgid "The issue date should be less than 7 days ago. You can't fund overdue invoices. The loan sum must be within your remaining limit." msgstr "The issue date should be less than 7 days ago. You can't fund overdue invoices. The loan sum must be within your remaining limit." @@ -6937,7 +6941,7 @@ msgstr "This action can't be undone." msgid "This form must be filled out by someone with significant control and management of your business. If that’s not you, make sure to ask the right person to continue." msgstr "This form must be filled out by someone with significant control and management of your business. If that’s not you, make sure to ask the right person to continue." -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:160 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:164 msgid "This invoice can be financed" msgstr "This invoice can be financed" @@ -7734,7 +7738,7 @@ msgstr "Who needs to approve the document and how:" msgid "Wholesale Clubs" msgstr "Wholesale Clubs" -#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:171 +#: src/components/receivables/Financing/FinanceInvoice/FinanceInvoice.tsx:175 msgid "Why?" msgstr "Why?" diff --git a/packages/sdk-react/src/core/queries/useFinancing.ts b/packages/sdk-react/src/core/queries/useFinancing.ts index bed62f60b..04625ef6f 100644 --- a/packages/sdk-react/src/core/queries/useFinancing.ts +++ b/packages/sdk-react/src/core/queries/useFinancing.ts @@ -6,7 +6,7 @@ import { Services } from '@/api'; import { useMoniteContext } from '../context/MoniteContext'; import { useMyEntity } from './useMe'; -export const FINANCING_LABEL = 'Financing'; +export const FINANCING_LABEL = 'My Financing'; export const useGetFinancedInvoices = ( query: Services['financingInvoices']['getFinancingInvoices']['types']['parameters']['query'], From c03bb74a38fd7f900a352bd70aabe1a525d803b4 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Thu, 12 Dec 2024 11:07:54 +0000 Subject: [PATCH 26/49] chore --- packages/sdk-react/src/core/utils/createThemeWithDefaults.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/sdk-react/src/core/utils/createThemeWithDefaults.ts b/packages/sdk-react/src/core/utils/createThemeWithDefaults.ts index b89700175..6f1bcc27b 100644 --- a/packages/sdk-react/src/core/utils/createThemeWithDefaults.ts +++ b/packages/sdk-react/src/core/utils/createThemeWithDefaults.ts @@ -37,7 +37,6 @@ export const createThemeWithDefaults = ( }, { label: FINANCING_LABEL, - query: { type: 'financing' }, }, ], }, From 39d6149ff8c8ba5501c49106f2bb2997b75fb82a Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Thu, 12 Dec 2024 11:20:12 +0000 Subject: [PATCH 27/49] feat: add enabled check to finance tab export --- .../receivables/Financing/FinanceTab/FinanceTab.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx index 84b923a22..f0486a3a9 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx @@ -1,4 +1,5 @@ -import { Stack } from '@mui/material'; +import { useFinancing } from '@/core/queries/useFinancing'; +import { CircularProgress, Stack } from '@mui/material'; import { FinancedInvoicesTable } from './FinancedInvoicesTable'; import { FinanceWidget } from './FinanceWidget/FinanceWidget'; @@ -8,6 +9,16 @@ export const FinanceTab = ({ }: { onRowClick?: (invoice_id: string) => void; }) => { + const { isLoading, isEnabled } = useFinancing(); + + if (isLoading) { + return <CircularProgress color="inherit" size={20} />; + } + + if (!isEnabled) { + return null; + } + return ( <Stack mt={4} gap={4}> <FinanceWidget /> From 0983476e803ec80ddb2644a5c7c8b26d059755ed Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Thu, 12 Dec 2024 12:47:56 +0000 Subject: [PATCH 28/49] refactor --- .../receivables/Financing/FinanceTab/FinanceTab.stories.tsx | 6 +----- .../receivables/Financing/FinanceTab/FinanceTab.tsx | 2 +- .../FinanceWidget/FinanceLimits/FinanceLimits.stories.tsx | 6 +----- .../FinanceWidget/FinanceLimits/FinanceLimits.tsx | 6 +++--- .../FinanceWidget/FinanceOffers/FinanceOffers.tsx | 2 +- .../FinanceTab/FinanceWidget/FinanceWidget.stories.tsx | 6 +----- .../components/receivables/Financing/FinanceTab/index.tsx | 2 -- 7 files changed, 8 insertions(+), 22 deletions(-) diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.stories.tsx index 52a6ffdbe..585d096df 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.stories.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.stories.tsx @@ -1,5 +1,3 @@ -import { MemoryRouter } from 'react-router-dom'; - import { css } from '@emotion/react'; import { StoryObj } from '@storybook/react'; @@ -24,9 +22,7 @@ export const FinanceTab: Story = { padding: 20px; `} > - <MemoryRouter> - <FinanceTabComponent /> - </MemoryRouter> + <FinanceTabComponent /> </div> ), }; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx index f0486a3a9..adf38b1d4 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceTab.tsx @@ -2,7 +2,7 @@ import { useFinancing } from '@/core/queries/useFinancing'; import { CircularProgress, Stack } from '@mui/material'; import { FinancedInvoicesTable } from './FinancedInvoicesTable'; -import { FinanceWidget } from './FinanceWidget/FinanceWidget'; +import { FinanceWidget } from './FinanceWidget'; export const FinanceTab = ({ onRowClick, diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.stories.tsx index 4262e0a0f..3f2812888 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.stories.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.stories.tsx @@ -1,5 +1,3 @@ -import { MemoryRouter } from 'react-router-dom'; - import { css } from '@emotion/react'; import { StoryObj } from '@storybook/react'; @@ -24,9 +22,7 @@ export const FinanceLimits: Story = { padding: 20px; `} > - <MemoryRouter> - <FinanceLimitsComponent isLoading={false} /> - </MemoryRouter> + <FinanceLimitsComponent isLoading={false} /> </div> ), }; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.tsx index 12b14340d..d93517cf4 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.tsx @@ -7,10 +7,10 @@ import { Box, CircularProgress, Typography } from '@mui/material'; import { FinanceCardStack } from '../../../infographics/FinanceCardStack'; export const FinanceLimits = ({ - isLoading, - offers, + isLoading = false, + offers = [], }: { - isLoading: boolean; + isLoading?: boolean; offers?: components['schemas']['FinancingOffer'][]; }) => { const { i18n } = useLingui(); diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx index 635bb6383..710ed64bd 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx @@ -15,7 +15,7 @@ export const FinanceOffers = ({ isLoading, offers, }: { - isLoading: boolean; + isLoading?: boolean; offers?: components['schemas']['FinancingOffer'][]; }) => { const { i18n } = useLingui(); diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.stories.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.stories.tsx index 11257309f..b53b6c5ae 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.stories.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceWidget.stories.tsx @@ -1,5 +1,3 @@ -import { MemoryRouter } from 'react-router-dom'; - import { css } from '@emotion/react'; import { StoryObj } from '@storybook/react'; @@ -24,9 +22,7 @@ export const FinanceWidget: Story = { padding: 20px; `} > - <MemoryRouter> - <FinanceWidgetComponent /> - </MemoryRouter> + <FinanceWidgetComponent /> </div> ), }; diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/index.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/index.tsx index d020b9e07..3a377c387 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/index.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/index.tsx @@ -1,3 +1 @@ export * from './FinanceTab'; -export * from './FinanceWidget'; -export * from './FinancedInvoicesTable'; From 42d30d3f65dc2469cba3fa25443a815740020329 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Thu, 12 Dec 2024 13:31:13 +0000 Subject: [PATCH 29/49] chore: temporarily reduce coverage threshold --- packages/sdk-react/jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk-react/jest.config.js b/packages/sdk-react/jest.config.js index cb5438f33..998dcb5e4 100644 --- a/packages/sdk-react/jest.config.js +++ b/packages/sdk-react/jest.config.js @@ -94,7 +94,7 @@ module.exports = { statements: 96, }, './src/components/receivables': { - branches: 35, + branches: 30, functions: 25, lines: 60, statements: 55, From 510d9556d2e213bcc8eebc13bb9fc31e8c375c90 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Thu, 12 Dec 2024 14:57:16 +0000 Subject: [PATCH 30/49] feat: update finance component exports --- .../src/components/receivables/Financing/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/sdk-react/src/components/receivables/Financing/index.tsx b/packages/sdk-react/src/components/receivables/Financing/index.tsx index 462240fba..0b698e15b 100644 --- a/packages/sdk-react/src/components/receivables/Financing/index.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/index.tsx @@ -1,4 +1,4 @@ -export * from './FinanceBanner'; -export * from './FinanceApplicationCard'; -export * from './FinanceTab'; -export * from './FinanceInvoice'; +export { FinanceBanner } from './FinanceBanner'; +export { FinanceApplicationCard } from './FinanceApplicationCard'; +export { FinanceTab } from './FinanceTab'; +export { FinanceInvoice } from './FinanceInvoice'; From 080a2c7544e243905ca6901f163fc4c4d1a53600 Mon Sep 17 00:00:00 2001 From: Precious OSSAI <theossaiprecious@gmail.com> Date: Thu, 12 Dec 2024 23:59:49 +0000 Subject: [PATCH 31/49] chore: update copy --- .../FinanceFaq/FinanceFaqDetails.tsx | 9 +++++++-- .../FinancedInvoicesTable.tsx | 2 +- .../src/core/i18n/locales/en/messages.po | 20 +++++++++++++++---- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx index c5ae9abc1..417d3f7e3 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx @@ -1,6 +1,6 @@ import { t } from '@lingui/macro'; import { useLingui } from '@lingui/react'; -import { Box, Typography } from '@mui/material'; +import { Box, Link, Typography } from '@mui/material'; const faqs = [ { @@ -68,7 +68,12 @@ export const FinanceFaqDetails = () => { <Typography variant="body2"> {t( i18n - )`All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon here.`} + )`All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon`}{' '} + <Link + target="_blank" + rel="noopener noreferrer" + href="https://kanmon.com" + >{t(i18n)`here.`}</Link> </Typography> </Box> </Box> diff --git a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx index 4090e281b..2b341ff78 100644 --- a/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx +++ b/packages/sdk-react/src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx @@ -217,7 +217,7 @@ const FinancedInvoicesTableBase = ({ descriptionLine1={t( i18n )`Select invoices you would like to finance and send them for review.`} - descriptionLine2={t(i18n)`What invoices can be financed?.`} + descriptionLine2={t(i18n)`What invoices can be financed?`} type="no-data" /> ); diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index 2a5478906..d35470c8f 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -514,8 +514,12 @@ msgid "All items" msgstr "All items" #: src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx:69 -msgid "All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon here." -msgstr "All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon here." +msgid "All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon" +msgstr "All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon" + +#: src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx:69 +#~ msgid "All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon here." +#~ msgstr "All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon here." #: src/components/receivables/ReceivableFilters/ReceivableFilters.tsx:89 msgid "All statuses" @@ -3551,6 +3555,10 @@ msgstr "Hearing Aids Sales and Supplies" msgid "Heating, Plumbing, A/C" msgstr "Heating, Plumbing, A/C" +#: src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx:76 +msgid "here." +msgstr "here." + #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/EmailInvoiceDetails.tsx:90 msgid "" "Hi {0},\n" @@ -7723,8 +7731,12 @@ msgid "Western Sahara" msgstr "Western Sahara" #: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:220 -msgid "What invoices can be financed?." -msgstr "What invoices can be financed?." +msgid "What invoices can be financed?" +msgstr "What invoices can be financed?" + +#: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:220 +#~ msgid "What invoices can be financed?." +#~ msgstr "What invoices can be financed?." #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/ReceivableRecurrence/InvoiceRecurrenceForm.tsx:260 msgid "When you set up the recurrence all future invoices will be issued based on this invoice template. After that you won’t be able to change the invoice template." From 4d97eb84b4b10513516a2e6b68c7a1617d92efe0 Mon Sep 17 00:00:00 2001 From: Andrei Tarasov <tarasov.a.dev@gmail.com> Date: Fri, 13 Dec 2024 10:58:31 +0100 Subject: [PATCH 32/49] chore(proposal): change base branch --- .changeset/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/config.json b/.changeset/config.json index 1928a6c3a..9a94bfa17 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -5,7 +5,7 @@ "fixed": [["@monite/sdk-react", "@monite/sdk-api"]], "linked": [], "access": "public", - "baseBranch": "origin/main", + "baseBranch": "origin/dev", "updateInternalDependencies": "patch", "ignore": ["sdk-demo-with-nextjs-and-clerk-auth"] } From 34e045b26e97e9c1145cac7fff03e8893c93b03e Mon Sep 17 00:00:00 2001 From: Andrea <return.santana@gmail.com> Date: Mon, 6 Jan 2025 09:11:26 +0100 Subject: [PATCH 33/49] fix(DEV-13389) default bank account automatically chosen --- .../PayableDetailsForm/PayableDetailsForm.tsx | 22 ++++++++++++++----- .../PayableDetailsForm/helpers.ts | 11 ++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx index c9472dd2f..432544b74 100644 --- a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx +++ b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx @@ -23,6 +23,7 @@ import { yupResolver } from '@hookform/resolvers/yup'; import type { I18n } from '@lingui/core'; import { t } from '@lingui/macro'; import { useLingui } from '@lingui/react'; +import { EntityBankAccountResponse } from '@monite/sdk-api'; import { Autocomplete, Box, @@ -50,6 +51,7 @@ import { PayableLineItemsForm } from '../PayableLineItemsForm'; import { calculateTotalsForPayable, counterpartsToSelect, + findDefaultBankAccount, isFieldRequired, LineItem, MonitePayableDetailsInfoProps, @@ -345,6 +347,20 @@ const PayableDetailsFormBase = forwardRef< trigger(); }, [trigger]); + useEffect(() => { + if ( + counterpartBankAccountQuery.isSuccess && + counterpartBankAccountQuery.data?.data + ) { + resetField('counterpartBankAccount', { + defaultValue: findDefaultBankAccount( + counterpartBankAccountQuery.data.data as EntityBankAccountResponse[] + ), + keepTouched: true, + }); + } + }, [counterpartBankAccountQuery.data]); + return ( <> <Box @@ -450,11 +466,7 @@ const PayableDetailsFormBase = forwardRef< label={t(i18n)`Counterpart`} MenuProps={{ container: root }} onChange={(event) => { - resetField('counterpartBankAccount', { - keepTouched: true, - }); - - return field.onChange(event); + field.onChange(event); }} > {counterpartsToSelect( diff --git a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/helpers.ts b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/helpers.ts index 678b33760..d8de25ae5 100644 --- a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/helpers.ts +++ b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/helpers.ts @@ -12,6 +12,10 @@ import { OptionalFields, } from '@/components/payables/types'; import { CounterpartResponse } from '@/core/queries'; +import { + CounterpartBankAccountResponse, + EntityBankAccountResponse, +} from '@monite/sdk-api'; import { useThemeProps } from '@mui/material'; import { format } from 'date-fns'; @@ -309,3 +313,10 @@ export const usePayableDetailsThemeProps = ( props: inProps, name: 'MonitePayableDetailsInfo', }); + +export const findDefaultBankAccount = ( + accounts: EntityBankAccountResponse[] +): string => { + const defaultAccount = accounts.find((acc) => acc.is_default_for_currency); + return defaultAccount?.id || ''; +}; From 0757c5a8d76c56b27c85dbd38dc54af414647434 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 09:00:19 +0000 Subject: [PATCH 34/49] chore(deps): bump next from 14.2.15 to 14.2.21 Bumps [next](https://github.com/vercel/next.js) from 14.2.15 to 14.2.21. - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](https://github.com/vercel/next.js/compare/v14.2.15...v14.2.21) --- updated-dependencies: - dependency-name: next dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> --- .../with-nextjs-and-clerk-auth/package.json | 2 +- yarn.lock | 92 +++++++++---------- 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/examples/with-nextjs-and-clerk-auth/package.json b/examples/with-nextjs-and-clerk-auth/package.json index 2a7d17c7b..391b8d235 100644 --- a/examples/with-nextjs-and-clerk-auth/package.json +++ b/examples/with-nextjs-and-clerk-auth/package.json @@ -42,7 +42,7 @@ "eslint": "8.57.0", "eslint-config-next": "~14.0.3", "mqtt": "~5.3.1", - "next": "~14.2.10", + "next": "~14.2.21", "openapi-fetch": "~0.8.1", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/yarn.lock b/yarn.lock index 573eddfb5..f31658aa3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5399,10 +5399,10 @@ __metadata: languageName: node linkType: hard -"@next/env@npm:14.2.15": - version: 14.2.15 - resolution: "@next/env@npm:14.2.15" - checksum: 10/76257d838aa8d6ede9240e4e8fd21847304b4d593fb758ea91c96e38818784e4f059d3b4c154e83b21983ea452fc7f4d1dc257d607ebba97c80db06ca4f9148a +"@next/env@npm:14.2.22": + version: 14.2.22 + resolution: "@next/env@npm:14.2.22" + checksum: 10/08c7c0887e049471c4c9277f4ea438716b3feb9c3ab65aba2bc900ba63698d21056929e108864c7bbb2bde89219c504898eeabd484eb9020f837b2bc481d73c4 languageName: node linkType: hard @@ -5415,65 +5415,65 @@ __metadata: languageName: node linkType: hard -"@next/swc-darwin-arm64@npm:14.2.15": - version: 14.2.15 - resolution: "@next/swc-darwin-arm64@npm:14.2.15" +"@next/swc-darwin-arm64@npm:14.2.22": + version: 14.2.22 + resolution: "@next/swc-darwin-arm64@npm:14.2.22" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@next/swc-darwin-x64@npm:14.2.15": - version: 14.2.15 - resolution: "@next/swc-darwin-x64@npm:14.2.15" +"@next/swc-darwin-x64@npm:14.2.22": + version: 14.2.22 + resolution: "@next/swc-darwin-x64@npm:14.2.22" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@next/swc-linux-arm64-gnu@npm:14.2.15": - version: 14.2.15 - resolution: "@next/swc-linux-arm64-gnu@npm:14.2.15" +"@next/swc-linux-arm64-gnu@npm:14.2.22": + version: 14.2.22 + resolution: "@next/swc-linux-arm64-gnu@npm:14.2.22" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-arm64-musl@npm:14.2.15": - version: 14.2.15 - resolution: "@next/swc-linux-arm64-musl@npm:14.2.15" +"@next/swc-linux-arm64-musl@npm:14.2.22": + version: 14.2.22 + resolution: "@next/swc-linux-arm64-musl@npm:14.2.22" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@next/swc-linux-x64-gnu@npm:14.2.15": - version: 14.2.15 - resolution: "@next/swc-linux-x64-gnu@npm:14.2.15" +"@next/swc-linux-x64-gnu@npm:14.2.22": + version: 14.2.22 + resolution: "@next/swc-linux-x64-gnu@npm:14.2.22" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-x64-musl@npm:14.2.15": - version: 14.2.15 - resolution: "@next/swc-linux-x64-musl@npm:14.2.15" +"@next/swc-linux-x64-musl@npm:14.2.22": + version: 14.2.22 + resolution: "@next/swc-linux-x64-musl@npm:14.2.22" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@next/swc-win32-arm64-msvc@npm:14.2.15": - version: 14.2.15 - resolution: "@next/swc-win32-arm64-msvc@npm:14.2.15" +"@next/swc-win32-arm64-msvc@npm:14.2.22": + version: 14.2.22 + resolution: "@next/swc-win32-arm64-msvc@npm:14.2.22" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@next/swc-win32-ia32-msvc@npm:14.2.15": - version: 14.2.15 - resolution: "@next/swc-win32-ia32-msvc@npm:14.2.15" +"@next/swc-win32-ia32-msvc@npm:14.2.22": + version: 14.2.22 + resolution: "@next/swc-win32-ia32-msvc@npm:14.2.22" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@next/swc-win32-x64-msvc@npm:14.2.15": - version: 14.2.15 - resolution: "@next/swc-win32-x64-msvc@npm:14.2.15" +"@next/swc-win32-x64-msvc@npm:14.2.22": + version: 14.2.22 + resolution: "@next/swc-win32-x64-msvc@npm:14.2.22" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -19107,20 +19107,20 @@ __metadata: languageName: node linkType: hard -"next@npm:~14.2.10": - version: 14.2.15 - resolution: "next@npm:14.2.15" +"next@npm:~14.2.21": + version: 14.2.22 + resolution: "next@npm:14.2.22" dependencies: - "@next/env": "npm:14.2.15" - "@next/swc-darwin-arm64": "npm:14.2.15" - "@next/swc-darwin-x64": "npm:14.2.15" - "@next/swc-linux-arm64-gnu": "npm:14.2.15" - "@next/swc-linux-arm64-musl": "npm:14.2.15" - "@next/swc-linux-x64-gnu": "npm:14.2.15" - "@next/swc-linux-x64-musl": "npm:14.2.15" - "@next/swc-win32-arm64-msvc": "npm:14.2.15" - "@next/swc-win32-ia32-msvc": "npm:14.2.15" - "@next/swc-win32-x64-msvc": "npm:14.2.15" + "@next/env": "npm:14.2.22" + "@next/swc-darwin-arm64": "npm:14.2.22" + "@next/swc-darwin-x64": "npm:14.2.22" + "@next/swc-linux-arm64-gnu": "npm:14.2.22" + "@next/swc-linux-arm64-musl": "npm:14.2.22" + "@next/swc-linux-x64-gnu": "npm:14.2.22" + "@next/swc-linux-x64-musl": "npm:14.2.22" + "@next/swc-win32-arm64-msvc": "npm:14.2.22" + "@next/swc-win32-ia32-msvc": "npm:14.2.22" + "@next/swc-win32-x64-msvc": "npm:14.2.22" "@swc/helpers": "npm:0.5.5" busboy: "npm:1.6.0" caniuse-lite: "npm:^1.0.30001579" @@ -19161,7 +19161,7 @@ __metadata: optional: true bin: next: dist/bin/next - checksum: 10/5c5ed27888540f3ace732c2645a84b60d9e9c572cb335c5e9ff2a78a2eba704705e92e3c3d22586fd18d1621c70a5fb7ca8c8499550734d243fdec5d2a9c8a93 + checksum: 10/56d6193d2242548e6636935b2d7e687d40166a985a1db679def315550b6348e35ed50f0810b196c050fe79114903acdf9a4602dcf186e18806e850ed9d5c5b82 languageName: node linkType: hard @@ -22530,7 +22530,7 @@ __metadata: jest: "npm:~29.7.0" jest-environment-jsdom: "npm:~29.7.0" mqtt: "npm:~5.3.1" - next: "npm:~14.2.10" + next: "npm:~14.2.21" openapi-fetch: "npm:~0.8.1" prettier: "npm:^2.8.8" react: "npm:18.2.0" From 3b0812821ab6fff0f96284614a63a2cf9c3718b7 Mon Sep 17 00:00:00 2001 From: Andrea <return.santana@gmail.com> Date: Tue, 7 Jan 2025 21:16:04 +0100 Subject: [PATCH 35/49] checking currency when selecting default bank account --- .../PayableDetailsForm/PayableDetailsForm.tsx | 6 +++--- .../PayableDetails/PayableDetailsForm/helpers.ts | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx index 432544b74..5342faeef 100644 --- a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx +++ b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx @@ -23,7 +23,6 @@ import { yupResolver } from '@hookform/resolvers/yup'; import type { I18n } from '@lingui/core'; import { t } from '@lingui/macro'; import { useLingui } from '@lingui/react'; -import { EntityBankAccountResponse } from '@monite/sdk-api'; import { Autocomplete, Box, @@ -354,12 +353,13 @@ const PayableDetailsFormBase = forwardRef< ) { resetField('counterpartBankAccount', { defaultValue: findDefaultBankAccount( - counterpartBankAccountQuery.data.data as EntityBankAccountResponse[] + counterpartBankAccountQuery.data.data, + currentCurrency ), keepTouched: true, }); } - }, [counterpartBankAccountQuery.data]); + }, [counterpartBankAccountQuery.data, currentCurrency]); return ( <> diff --git a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/helpers.ts b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/helpers.ts index d8de25ae5..1e7e6ee5f 100644 --- a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/helpers.ts +++ b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/helpers.ts @@ -12,10 +12,6 @@ import { OptionalFields, } from '@/components/payables/types'; import { CounterpartResponse } from '@/core/queries'; -import { - CounterpartBankAccountResponse, - EntityBankAccountResponse, -} from '@monite/sdk-api'; import { useThemeProps } from '@mui/material'; import { format } from 'date-fns'; @@ -315,8 +311,11 @@ export const usePayableDetailsThemeProps = ( }); export const findDefaultBankAccount = ( - accounts: EntityBankAccountResponse[] + accounts: components['schemas']['CounterpartBankAccountResponse'][], + currentCurrency: components['schemas']['CurrencyEnum'] ): string => { - const defaultAccount = accounts.find((acc) => acc.is_default_for_currency); + const defaultAccount = accounts.find( + (acc) => acc.currency === currentCurrency && acc.is_default_for_currency + ); return defaultAccount?.id || ''; }; From b78779378a0281c8a0238d71be524872762a452a Mon Sep 17 00:00:00 2001 From: Andrea <return.santana@gmail.com> Date: Tue, 7 Jan 2025 21:21:45 +0100 Subject: [PATCH 36/49] docs(changeset): "@monite/sdk-react": minor -> Default bank account is selected during counterpart and currency selection --- .changeset/flat-walls-reflect.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/flat-walls-reflect.md diff --git a/.changeset/flat-walls-reflect.md b/.changeset/flat-walls-reflect.md new file mode 100644 index 000000000..1c72a6d96 --- /dev/null +++ b/.changeset/flat-walls-reflect.md @@ -0,0 +1,5 @@ +--- +'@monite/sdk-react': minor +--- + +"@monite/sdk-react": minor -> Default bank account is selected during counterpart and currency selection From 01e7e5ea231c32dd294a57c9e6819e86f989080b Mon Sep 17 00:00:00 2001 From: Andrea <return.santana@gmail.com> Date: Wed, 8 Jan 2025 15:12:32 +0100 Subject: [PATCH 37/49] changeset modification, fix lint issue --- .changeset/flat-walls-reflect.md | 2 +- .../PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/flat-walls-reflect.md b/.changeset/flat-walls-reflect.md index 1c72a6d96..5bfabaee2 100644 --- a/.changeset/flat-walls-reflect.md +++ b/.changeset/flat-walls-reflect.md @@ -2,4 +2,4 @@ '@monite/sdk-react': minor --- -"@monite/sdk-react": minor -> Default bank account is selected during counterpart and currency selection +feat(DEV-13389): Default bank account is selected during counterpart and currency selection diff --git a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx index 5342faeef..34021456c 100644 --- a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx +++ b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx @@ -359,7 +359,7 @@ const PayableDetailsFormBase = forwardRef< keepTouched: true, }); } - }, [counterpartBankAccountQuery.data, currentCurrency]); + }, [counterpartBankAccountQuery, currentCurrency, resetField]); return ( <> From a11f3505c551ffa2d0c6bff4eae02324349656f5 Mon Sep 17 00:00:00 2001 From: vitali-federau-monite <vitali.federau@monite.com> Date: Wed, 8 Jan 2025 16:16:06 +0200 Subject: [PATCH 38/49] Test commit for cicd --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 834b6c31b..a6afa3636 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Monite SDK -Use Monite SDK to embed invoicing and payables powered by [Monite](https://monite.com/) into your products. +Use Monite SDK to embed invoicing and payables powered by [Monite](https://monite.com/) into your products The SDK provides React UI components for displaying and managing data served via the Monite API, as well as a standalone JavaScript API client for those whose prefer to build a UI from scratch. ## Packages From eab0a0e20301bfa05ed1ae52338cece5e9b472ee Mon Sep 17 00:00:00 2001 From: vitali-federau-monite <vitali.federau@monite.com> Date: Wed, 8 Jan 2025 19:21:19 +0200 Subject: [PATCH 39/49] style(DEV-13666): Enable sync from dev github to dev gitlab --- ...{gitlab-sync-dev-branch.yml.bat => gitlab-sync-dev-branch.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{gitlab-sync-dev-branch.yml.bat => gitlab-sync-dev-branch.yml} (100%) diff --git a/.github/workflows/gitlab-sync-dev-branch.yml.bat b/.github/workflows/gitlab-sync-dev-branch.yml similarity index 100% rename from .github/workflows/gitlab-sync-dev-branch.yml.bat rename to .github/workflows/gitlab-sync-dev-branch.yml From 17b914d223ead644a8297f27940d62a06adf95ab Mon Sep 17 00:00:00 2001 From: oneanotheruser <oneanotheruser@gmail.com> Date: Fri, 3 Jan 2025 14:25:15 +0100 Subject: [PATCH 40/49] feat(DEV-13346) - show confirmation modal for bill cancelation --- .../PayableDetailsCancelModal.tsx | 48 +++++++++ .../PayableDetailsCancelModal/index.ts | 1 + .../PayableDetailsHeader.tsx | 14 ++- .../src/core/i18n/locales/en/messages.po | 102 ++++++++++-------- 4 files changed, 119 insertions(+), 46 deletions(-) create mode 100644 packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx create mode 100644 packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsCancelModal/index.ts diff --git a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx new file mode 100644 index 000000000..9ab8f331b --- /dev/null +++ b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx @@ -0,0 +1,48 @@ +import { t } from '@lingui/macro'; +import { useLingui } from '@lingui/react'; +import { + Dialog, + DialogTitle, + DialogActions, + DialogContent, + DialogContentText, + Button, +} from '@mui/material'; + +export interface PayableDetailsCancelModalProps { + isOpen: boolean; + handleCloseModal: () => void; + handleConfirmation: () => void; +} + +export const PayableDetailsCancelModal = ({ + isOpen, + handleCloseModal, + handleConfirmation, +}: PayableDetailsCancelModalProps) => { + const { i18n } = useLingui(); + + return ( + <Dialog open={isOpen} onClose={handleCloseModal}> + <DialogTitle>{t(i18n)`Cancel bill?`}</DialogTitle> + <DialogContent> + <DialogContentText>{t( + i18n + )`The bill will receive the “Canceled” status and will require no payment. You can't undo this action.`}</DialogContentText> + </DialogContent> + <DialogActions> + <Button onClick={handleCloseModal}>{t(i18n)`Close`}</Button> + <Button + color="error" + variant="contained" + onClick={() => { + handleCloseModal(); + handleConfirmation(); + }} + > + {t(i18n)`Cancel bill`} + </Button> + </DialogActions> + </Dialog> + ); +}; diff --git a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsCancelModal/index.ts b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsCancelModal/index.ts new file mode 100644 index 000000000..133718664 --- /dev/null +++ b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsCancelModal/index.ts @@ -0,0 +1 @@ +export * from './PayableDetailsCancelModal'; diff --git a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx index 65c2353ae..c8f20c615 100644 --- a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx +++ b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from 'react'; +import { ReactNode, useState } from 'react'; import { components } from '@/api'; import { getCounterpartName } from '@/components/counterparts/helpers'; @@ -21,6 +21,7 @@ import { } from '@mui/material'; import { isPayableInOCRProcessing } from '../../utils/isPayableInOcr'; +import { PayableDetailsCancelModal } from '../PayableDetailsCancelModal'; import { PayableDetailsPermissions } from '../usePayableDetails'; export interface PayablesDetailsHeaderProps { @@ -60,6 +61,7 @@ export const PayableDetailsHeader = ({ const { i18n } = useLingui(); const dialogContext = useDialog(); const { data: counterpart } = useCounterpartById(payable?.counterpart_id); + const [showCancelationModal, setShowCancelationModal] = useState(false); const counterpartName = getCounterpartName(counterpart); @@ -108,7 +110,7 @@ export const PayableDetailsHeader = ({ cancel: { variant: 'text', color: 'error', - onClick: cancelInvoice, + onClick: () => setShowCancelationModal(true), children: t(i18n)`Cancel bill`, }, pay: { @@ -120,6 +122,7 @@ export const PayableDetailsHeader = ({ }; const className = 'Monite-PayableDetails-Header'; + const canCancel = permissions.includes('cancel'); return ( <DialogTitle sx={{ position: 'relative' }} className={className}> @@ -172,6 +175,13 @@ export const PayableDetailsHeader = ({ )} </Toolbar> {modalComponent} + {canCancel && ( + <PayableDetailsCancelModal + isOpen={showCancelationModal} + handleCloseModal={() => setShowCancelationModal(false)} + handleConfirmation={cancelInvoice} + /> + )} </DialogTitle> ); }; diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index d35470c8f..51585456b 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -725,7 +725,7 @@ msgstr "approvals required" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:188 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:519 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:540 -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:106 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:108 #: src/components/userRoles/consts.ts:74 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:223 msgid "Approve" @@ -944,7 +944,7 @@ msgid "Bangladeshi Taka" msgstr "Bangladeshi Taka" #: src/components/onboarding/OnboardingContent/OnboardingContent.tsx:101 -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:497 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:509 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:287 #: src/components/receivables/InvoiceDetails/CreateReceivable/validation.ts:117 #: src/components/receivables/InvoiceDetails/CreateReceivable/validation.ts:170 @@ -953,7 +953,7 @@ msgid "Bank account" msgstr "Bank account" #: src/components/counterparts/CounterpartDetails/CounterpartView/CounterpartBankView/CounterpartBankView.tsx:129 -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:503 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:515 msgid "Bank Account" msgstr "Bank Account" @@ -1051,8 +1051,8 @@ msgstr "BIC" msgid "Bicycle Shops" msgstr "Bicycle Shops" -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:143 -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:148 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:146 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:151 msgid "Bill" msgstr "Bill" @@ -1295,7 +1295,7 @@ msgstr "Canadian Dollar" #: src/components/onboarding/hooks/useOnboardingActions.ts:130 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:87 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:108 -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:84 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:86 #: src/components/products/ProductDeleteModal/ProductDeleteModal.tsx:81 #: src/components/products/ProductDetails/ProductCreate/CreateProduct.tsx:124 #: src/components/products/ProductDetails/ProductEditForm/ProductEditForm.tsx:199 @@ -1328,10 +1328,15 @@ msgstr "Cancel" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:145 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:393 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:414 -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:112 +#: src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx:43 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:114 msgid "Cancel bill" msgstr "Cancel bill" +#: src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx:27 +msgid "Cancel bill?" +msgstr "Cancel bill?" + #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/TabPanels/PaymentTabPanel/EditPaymentRecordModal.tsx:70 #~ msgid "Cancel edit" #~ msgstr "Cancel edit" @@ -1535,6 +1540,7 @@ msgstr "Civic, Social, Fraternal Associations" msgid "Cleaning and Maintenance" msgstr "Cleaning and Maintenance" +#: src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx:34 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:206 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/InvoiceCancelModal.tsx:74 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/InvoiceRecurrenceCancelModal.tsx:133 @@ -1553,8 +1559,8 @@ msgstr "Close approval policy details" msgid "Close invoice details" msgstr "Close invoice details" -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:132 -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:133 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:135 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:136 msgid "Close payable details" msgstr "Close payable details" @@ -1835,8 +1841,8 @@ msgstr "Counseling Services" #: src/components/approvalRequests/ApprovalRequestsTable/ApprovalRequestsTable.tsx:192 #: src/components/counterparts/CounterpartDetails/CounterpartView/CounterpartView.tsx:203 #: src/components/counterparts/CounterpartsTable/CounterpartsTable.tsx:447 -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:102 -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:450 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:103 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:466 #: src/components/receivables/InvoiceDetails/CreateReceivable/validation.ts:115 #: src/components/receivables/InvoiceDetails/CreateReceivable/validation.ts:168 #: src/components/userRoles/consts.ts:28 @@ -1851,7 +1857,7 @@ msgstr "Counterpart “{0}” has been created." msgid "Counterpart “{0}” has been updated." msgstr "Counterpart “{0}” has been updated." -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:110 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:111 msgid "Counterpart bank account" msgstr "Counterpart bank account" @@ -2152,7 +2158,7 @@ msgstr "Cuba" #: src/components/counterparts/CounterpartDetails/CounterpartView/CounterpartBankView/CounterpartBankView.tsx:114 #: src/components/onboarding/OnboardingBankAccount/OnboardingBankAccount.tsx:58 #: src/components/onboarding/validators/validationSchemas.ts:116 -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:136 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:137 #: src/components/products/ProductDetails/validation.ts:46 #: src/components/receivables/InvoiceDetails/CreateReceivable/validation.ts:13 #: src/components/receivables/InvoiceDetails/CreateReceivable/validation.ts:85 @@ -2425,7 +2431,7 @@ msgstr "Description is required" msgid "Description:" msgstr "Description:" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:402 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:418 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:219 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/BillToSection.tsx:37 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/Overview.tsx:43 @@ -2595,8 +2601,8 @@ msgid "Dry Cleaners" msgstr "Dry Cleaners" #: src/components/approvalRequests/ApprovalRequestsTable/ApprovalRequestsTable.tsx:213 -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:131 -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:590 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:132 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:602 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:319 #: src/components/payables/PayablesTable/Filters/Filters.tsx:81 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:60 @@ -2677,7 +2683,7 @@ msgstr "Ecuador" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:340 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:366 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:587 -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:70 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:72 #: src/components/products/ProductDetails/ExistingProductDetails.tsx:245 #: src/components/products/Products.test.tsx:174 #: src/components/products/Products.test.tsx:271 @@ -2704,7 +2710,7 @@ msgstr "Edit" msgid "Edit Approval Policy" msgstr "Edit Approval Policy" -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:147 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:150 msgid "Edit bill" msgstr "Edit bill" @@ -3253,7 +3259,7 @@ msgstr "French Southern Territories" msgid "Frequency" msgstr "Frequency" -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:143 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:146 msgid "from" msgstr "from" @@ -3767,8 +3773,8 @@ msgstr "Intra-Company Purchases" msgid "INV-auto" msgstr "INV-auto" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:121 -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:130 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:122 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:131 msgid "Invalid date" msgstr "Invalid date" @@ -3830,7 +3836,7 @@ msgstr "Invoice #" msgid "Invoice cancel confirmation" msgstr "Invoice cancel confirmation" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:122 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:123 #: src/components/payables/PayablesTable/PayablesTable.tsx:313 msgid "Invoice date" msgstr "Invoice date" @@ -3864,7 +3870,7 @@ msgstr "Invoice not found" msgid "Invoice number" msgstr "Invoice number" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:98 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:99 msgid "Invoice Number" msgstr "Invoice Number" @@ -3937,7 +3943,7 @@ msgid "Issue at" msgstr "Issue at" #: src/components/approvalRequests/ApprovalRequestsTable/ApprovalRequestsTable.tsx:203 -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:559 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:571 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:300 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:156 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:46 @@ -4007,31 +4013,31 @@ msgstr "item" msgid "Item" msgstr "Item" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:146 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:147 msgid "Item name" msgstr "Item name" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:156 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:157 msgid "Item price" msgstr "Item price" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:159 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:160 msgid "Item price must be a number" msgstr "Item price must be a number" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:150 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:151 msgid "Item quantity" msgstr "Item quantity" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:153 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:154 msgid "Item quantity must be a number" msgstr "Item quantity must be a number" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:162 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:163 msgid "Item tax" msgstr "Item tax" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:166 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:167 msgid "Item tax must be a number between 0 and 100" msgstr "Item tax must be a number between 0 and 100" @@ -4040,7 +4046,7 @@ msgstr "Item tax must be a number between 0 and 100" msgid "items" msgstr "items" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:666 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:678 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:419 #: src/components/receivables/InvoiceDetails/CreateReceivable/CreateReceivables.test.tsx:112 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/ItemsSection.tsx:226 @@ -4718,7 +4724,7 @@ msgstr "New" msgid "New Caledonia" msgstr "New Caledonia" -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:149 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:152 msgid "New incoming invoice" msgstr "New incoming invoice" @@ -4979,7 +4985,7 @@ msgstr "NOT allowed" #~ msgid "Not selected" #~ msgstr "Not selected" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:412 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:428 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:244 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:128 #: src/components/receivables/Financing/FinanceTab/FinancedInvoicesTable/FinancedInvoicesTable.tsx:124 @@ -5194,7 +5200,7 @@ msgid "Pawn Shops" msgstr "Pawn Shops" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:225 -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:118 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:120 #: src/components/payables/PayablesTable/components/PayablesTableAction.tsx:54 #: src/components/userRoles/consts.ts:75 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:227 @@ -5902,7 +5908,7 @@ msgstr "Registered Number (Japan)" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:185 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:477 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:498 -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:95 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:97 msgid "Reject" msgstr "Reject" @@ -5991,7 +5997,7 @@ msgstr "Remove person" msgid "Removing an executive role from this person is not allowed" msgstr "Removing an executive role from this person is not allowed" -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:101 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:103 #: src/components/userRoles/consts.ts:78 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:235 msgid "Reopen" @@ -6196,7 +6202,7 @@ msgstr "Saudi Riyal" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:281 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:346 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:372 -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:76 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:78 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/ReceivableRecurrence/InvoiceRecurrenceForm.tsx:352 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/TabPanels/PaymentTabPanel/PaymentRecordForm.tsx:150 #: src/components/tags/TagFormModal/TagFormModal.test.tsx:155 @@ -6587,7 +6593,7 @@ msgstr "Subject" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:148 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:435 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:456 -#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:89 +#: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:91 #: src/components/userRoles/consts.ts:73 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:219 msgid "Submit" @@ -6597,7 +6603,7 @@ msgstr "Submit" msgid "Submit invoice" msgstr "Submit invoice" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:676 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:688 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:475 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/ItemsSection.tsx:443 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/sections/PreviewItemsSection.tsx:158 @@ -6679,7 +6685,7 @@ msgstr "Tag “{0}” was deleted" #: src/components/approvalPolicies/ApprovalPolicyDetails/ApprovalPolicyForm/ApprovalPolicyForm.tsx:909 #: src/components/approvalPolicies/useApprovalPolicyTrigger.tsx:69 -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:641 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:653 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:378 #: src/components/tags/Tags.tsx:52 #: src/components/tags/TagsTable/TagsTable.tsx:268 @@ -6846,6 +6852,14 @@ msgstr "Thailand" msgid "Thank you for completing onboarding for payments services. We will now review the information submitted." msgstr "Thank you for completing onboarding for payments services. We will now review the information submitted." +#: src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx:29 +msgid "The bill will receive the “Canceled” status and will require no payment. You can't undo this action." +msgstr "The bill will receive the “Canceled” status and will require no payment. You can't undo this action." + +#: src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx:29 +#~ msgid "The bill will receive the “Canceled” status and will require no payment. You can’t undo this action." +#~ msgstr "The bill will receive the “Canceled” status and will require no payment. You can’t undo this action." + #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/InvoiceCancelModal.tsx:51 msgid "The Credit note to this invoice {0} was created earlier. Following that you can’t cancel invoice." msgstr "The Credit note to this invoice {0} was created earlier. Following that you can’t cancel invoice." @@ -7033,7 +7047,7 @@ msgstr "Tonga" msgid "Tongan Paʻanga" msgstr "Tongan Paʻanga" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:705 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:717 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:334 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:502 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/ItemsSection.tsx:456 @@ -7606,7 +7620,7 @@ msgstr "Vat IDs" msgid "VAT information" msgstr "VAT information" -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:690 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:702 msgid "VAT total" msgstr "VAT total" @@ -7638,7 +7652,7 @@ msgstr "Vat Value" #: src/components/counterparts/CounterpartDetails/CounterpartView/CounterpartIndividualView/CounterpartIndividualView.tsx:48 #: src/components/counterparts/CounterpartDetails/CounterpartView/CounterpartOrganizationView/CounterpartOrganizationView.tsx:74 #: src/components/counterparts/CounterpartStatusChip/CounterpartStatusChip.tsx:102 -#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:444 +#: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:460 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:255 #: src/components/payables/PayablesTable/PayablesTable.tsx:281 msgid "Vendor" From 069181e40633ae3d1e1467f3d16d36c2b5e31d80 Mon Sep 17 00:00:00 2001 From: oneanotheruser <oneanotheruser@gmail.com> Date: Thu, 9 Jan 2025 15:44:55 +0100 Subject: [PATCH 41/49] docs(changeset): feat(DEV-13346): show confirmation modal for bill cancelation --- .changeset/lucky-pumas-punch.md | 5 +++++ .../PayableDetailsCancelModal/PayableDetailsCancelModal.tsx | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/lucky-pumas-punch.md diff --git a/.changeset/lucky-pumas-punch.md b/.changeset/lucky-pumas-punch.md new file mode 100644 index 000000000..73d4b4ab8 --- /dev/null +++ b/.changeset/lucky-pumas-punch.md @@ -0,0 +1,5 @@ +--- +'@monite/sdk-react': minor +--- + +feat(DEV-13346): show confirmation modal for bill cancelation diff --git a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx index 9ab8f331b..e7dfa7d70 100644 --- a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx +++ b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx @@ -1,3 +1,4 @@ +import { useRootElements } from '@/core/context/RootElementsProvider'; import { t } from '@lingui/macro'; import { useLingui } from '@lingui/react'; import { @@ -21,9 +22,10 @@ export const PayableDetailsCancelModal = ({ handleConfirmation, }: PayableDetailsCancelModalProps) => { const { i18n } = useLingui(); + const { root } = useRootElements(); return ( - <Dialog open={isOpen} onClose={handleCloseModal}> + <Dialog open={isOpen} container={root} onClose={handleCloseModal}> <DialogTitle>{t(i18n)`Cancel bill?`}</DialogTitle> <DialogContent> <DialogContentText>{t( From 44f7265a0251cd6cdf6766c9c9875a3a2b5e33c7 Mon Sep 17 00:00:00 2001 From: oneanotheruser <oneanotheruser@gmail.com> Date: Thu, 9 Jan 2025 23:15:53 +0100 Subject: [PATCH 42/49] fix unit tests for PayableDetails --- .../PayableDetails/PayableDetails.test.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetails.test.tsx b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetails.test.tsx index a44107d54..ea45b0562 100644 --- a/packages/sdk-react/src/components/payables/PayableDetails/PayableDetails.test.tsx +++ b/packages/sdk-react/src/components/payables/PayableDetails/PayableDetails.test.tsx @@ -389,7 +389,14 @@ describe('PayableDetails', () => { await waitUntilTableIsLoaded(); - const cancelButton = await screen.findByRole('button', { + let cancelButton = await screen.findByRole('button', { + name: t`Cancel bill`, + }); + + await user.click(cancelButton); + + // Reset cancelButton to the one from the modal + cancelButton = await screen.findByRole('button', { name: t`Cancel bill`, }); @@ -410,7 +417,14 @@ describe('PayableDetails', () => { await waitUntilTableIsLoaded(); - const cancelButton = await screen.findByRole('button', { + let cancelButton = await screen.findByRole('button', { + name: t`Cancel bill`, + }); + + await user.click(cancelButton); + + // Reset cancelButton to the one from the modal + cancelButton = await screen.findByRole('button', { name: t`Cancel bill`, }); From d452d77a30ede2ea15bf6ebb75bfe149f484fb4c Mon Sep 17 00:00:00 2001 From: oneanotheruser <oneanotheruser@gmail.com> Date: Mon, 9 Dec 2024 13:03:26 +0100 Subject: [PATCH 43/49] DEV-12235: work on payment terms --- .changeset/chilled-schools-admire.md | 5 + .../sections/PaymentSection.tsx | 113 +++++-- .../Billing/FullfillmentSummary.tsx | 14 +- .../PaymentTerms/DeletePaymentTerms.tsx | 51 +++ .../components/PaymentTerms/DiscountForm.tsx | 106 ++++++ .../PaymentTerms/PaymentTerms.test.tsx | 314 ++++++++++++++++++ .../PaymentTerms/PaymentTermsDialog.tsx | 99 ++++++ .../PaymentTerms/PaymentTermsForm.tsx | 208 ++++++++++++ .../PaymentTerms/PaymentTermsSummary.tsx | 54 +++ .../PaymentTerms/PaymentTermsSummaryItem.tsx | 27 ++ .../sections/components/PaymentTerms/index.ts | 2 + .../PaymentTerms/paymentTermsValidation.ts | 92 +++++ .../sections/components/PaymentTerms/types.ts | 19 ++ .../PaymentTerms/usePaymentTermsApi.ts | 96 ++++++ .../src/core/i18n/locales/en/messages.po | 192 +++++++++-- .../paymentTerms/paymentTermsHandlers.ts | 91 ++++- 16 files changed, 1418 insertions(+), 65 deletions(-) create mode 100644 .changeset/chilled-schools-admire.md create mode 100644 packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DeletePaymentTerms.tsx create mode 100644 packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DiscountForm.tsx create mode 100644 packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTerms.test.tsx create mode 100644 packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsDialog.tsx create mode 100644 packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx create mode 100644 packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummary.tsx create mode 100644 packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummaryItem.tsx create mode 100644 packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/index.ts create mode 100644 packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/paymentTermsValidation.ts create mode 100644 packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/types.ts create mode 100644 packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/usePaymentTermsApi.ts diff --git a/.changeset/chilled-schools-admire.md b/.changeset/chilled-schools-admire.md new file mode 100644 index 000000000..ef67dba90 --- /dev/null +++ b/.changeset/chilled-schools-admire.md @@ -0,0 +1,5 @@ +--- +'@monite/sdk-react': minor +--- + +feat(DEV-12235): Payment terms create/update/delete diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/PaymentSection.tsx b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/PaymentSection.tsx index 7393808d4..0d920f1c6 100644 --- a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/PaymentSection.tsx +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/PaymentSection.tsx @@ -1,3 +1,4 @@ +import { useState } from 'react'; import { useFormContext } from 'react-hook-form'; import { components } from '@/api'; @@ -5,14 +6,13 @@ import { CreateReceivablesFormProps } from '@/components/receivables/InvoiceDeta import { RHFTextField } from '@/components/RHF/RHFTextField'; import { t } from '@lingui/macro'; import { useLingui } from '@lingui/react'; -import { - Box, - FormHelperText, - MenuItem, - Skeleton, - useTheme, -} from '@mui/material'; +import AddIcon from '@mui/icons-material/Add'; +import { Box, MenuItem, Skeleton, useTheme, Button } from '@mui/material'; +import { + PaymentTermsSummary, + PaymentTermsDialog, +} from './components/PaymentTerms'; import type { SectionGeneralProps } from './Section.types'; type Props = SectionGeneralProps & { @@ -22,46 +22,95 @@ type Props = SectionGeneralProps & { } | undefined; isLoading: boolean; + selectedPaymentTerm?: components['schemas']['PaymentTermsResponse']; + onPaymentTermsChange: ( + id?: components['schemas']['PaymentTermsResponse']['id'] + ) => void; }; +enum TermsDialogState { + Closed, + Create, + Update, +} + export const PaymentSection = ({ disabled, paymentTerms, isLoading, + selectedPaymentTerm, + onPaymentTermsChange, }: Props) => { const { i18n } = useLingui(); const { control } = useFormContext<CreateReceivablesFormProps>(); + const [termsDialogState, setTermsDialogState] = useState<TermsDialogState>( + TermsDialogState.Closed + ); + + const openEditDialog = () => { + setTermsDialogState(TermsDialogState.Update); + }; + + const onTermsDialogClosed = (id?: string, deleted?: boolean) => { + setTermsDialogState(TermsDialogState.Closed); + + if (id || deleted) { + onPaymentTermsChange(id); + } + }; return ( <Box> {isLoading ? ( <SelectSkeleton /> ) : ( - <RHFTextField - fullWidth - select - name="payment_terms_id" - control={control} - label={t(i18n)`Payment terms`} - disabled={disabled || !paymentTerms?.data?.length} - required - > - {!paymentTerms?.data?.length && <MenuItem value="" />} - {paymentTerms?.data?.map(({ id, name, description }) => ( - <MenuItem key={id} value={id}> - {name} - {description && ` (${description})`} - </MenuItem> - ))} - </RHFTextField> - )} - - {!isLoading && !paymentTerms?.data?.length && ( - <FormHelperText> - {t( - i18n - )`There is no payment terms available. Please create one in the settings.`} - </FormHelperText> + <> + <RHFTextField + fullWidth + select + name="payment_terms_id" + control={control} + label={t(i18n)`Payment terms`} + disabled={disabled} + required + > + <Button + variant="text" + startIcon={<AddIcon />} + fullWidth + sx={{ + justifyContent: 'flex-start', + px: 2, + }} + onClick={() => setTermsDialogState(TermsDialogState.Create)} + > + {t(i18n)`Create payment term`} + </Button> + {paymentTerms?.data?.map(({ id, name, description }) => ( + <MenuItem key={id} value={id}> + {name} + {description && ` (${description})`} + </MenuItem> + ))} + </RHFTextField> + {selectedPaymentTerm && ( + <Box sx={{ mt: 1 }}> + <PaymentTermsSummary + paymentTerm={selectedPaymentTerm} + openEditDialog={openEditDialog} + /> + </Box> + )} + <PaymentTermsDialog + show={termsDialogState !== TermsDialogState.Closed} + closeDialog={onTermsDialogClosed} + selectedTerm={ + termsDialogState === TermsDialogState.Update + ? selectedPaymentTerm + : undefined + } + /> + </> )} </Box> ); diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx index ea12f7ff1..87dfffb83 100644 --- a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx @@ -21,8 +21,11 @@ export const FullfillmentSummary = ({ disabled }: SectionGeneralProps) => { const { api } = useMoniteContext(); - const { data: paymentTerms, isLoading: isPaymentTermsLoading } = - api.paymentTerms.getPaymentTerms.useQuery(); + const { + data: paymentTerms, + isLoading: isPaymentTermsLoading, + refetch, + } = api.paymentTerms.getPaymentTerms.useQuery(); const { root } = useRootElements(); const dateTimeFormat = useDateTimeFormat(); @@ -38,6 +41,11 @@ export const FullfillmentSummary = ({ disabled }: SectionGeneralProps) => { (term) => term.id === paymentTermsId ); + const handlePaymentTermsChange = async (newId: string = '') => { + await refetch(); + setValue('payment_terms_id', newId); + }; + return ( <> <Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}> @@ -146,6 +154,8 @@ export const FullfillmentSummary = ({ disabled }: SectionGeneralProps) => { disabled={disabled} paymentTerms={paymentTerms} isLoading={isPaymentTermsLoading} + selectedPaymentTerm={selectedPaymentTerm} + onPaymentTermsChange={handlePaymentTermsChange} /> </Box> </Box> diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DeletePaymentTerms.tsx b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DeletePaymentTerms.tsx new file mode 100644 index 000000000..fc0be6085 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DeletePaymentTerms.tsx @@ -0,0 +1,51 @@ +import { components } from '@/api'; +import { Dialog } from '@/components'; +import { i18n } from '@lingui/core'; +import { t } from '@lingui/macro'; +import { + DialogTitle, + DialogContent, + DialogActions, + Button, +} from '@mui/material'; + +import { usePaymentTermsApi } from './usePaymentTermsApi'; + +export interface DeletePaymentTermsProps { + show: boolean; + closeDialog: (payload: boolean) => void; + paymentTermsId: components['schemas']['PaymentTermsResponse']['id']; +} + +export const DeletePaymentTerms = ({ + show, + closeDialog, + paymentTermsId, +}: DeletePaymentTermsProps) => { + const { deletePaymentTerm } = usePaymentTermsApi({ + onSuccessfullChange: () => closeDialog(true), + }); + + return ( + <Dialog open={show}> + <DialogTitle>{t(i18n)`Delete payment term?`}</DialogTitle> + <DialogContent> + {t( + i18n + )`You won't be able to use it to create new invoices, but it won't affect the existing invoices with this term and their future copies.`} + </DialogContent> + <DialogActions> + <Button variant="text" onClick={() => closeDialog(false)}>{t( + i18n + )`Cancel`}</Button> + <Button + variant="outlined" + color="error" + onClick={() => deletePaymentTerm(paymentTermsId)} + > + {t(i18n)`Delete`} + </Button> + </DialogActions> + </Dialog> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DiscountForm.tsx b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DiscountForm.tsx new file mode 100644 index 000000000..a2ced3a91 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DiscountForm.tsx @@ -0,0 +1,106 @@ +import { useEffect, useState } from 'react'; +import { UseFormRegister, FieldErrors, FieldError } from 'react-hook-form'; + +import { i18n } from '@lingui/core'; +import { t } from '@lingui/macro'; +import DeleteIcon from '@mui/icons-material/Delete'; +import { + Alert, + Typography, + Button, + Stack, + Card, + CardContent, + CardHeader, + TextField, +} from '@mui/material'; + +import { TermField, PaymentTermsFields } from './types'; + +export interface DiscountFormProps { + field: TermField; + index: number; + isLast: boolean; + remove: () => void; + register: UseFormRegister<PaymentTermsFields>; + errors: FieldErrors<PaymentTermsFields>; +} + +export const DiscountForm = ({ + field, + index, + isLast, + remove, + register, + errors, +}: DiscountFormProps) => { + const [error, setError] = useState<string | undefined>(''); + + useEffect(() => { + if (Object.keys(errors).length > 0) { + const flatErrors = Object.values(errors[field] || {}).map( + (error) => (error as FieldError)?.message + ); + + setError(flatErrors[0]); + } else { + setError(''); + } + }, [errors, field]); + + return ( + <> + {!!error && ( + <Alert severity="error" sx={{ my: 1 }}> + {error} + </Alert> + )} + <Card> + <CardHeader + title={t(i18n)`Discount ${index + 1}`} + titleTypographyProps={{ + variant: 'subtitle1', + }} + action={ + <Button + variant="text" + color="error" + size="small" + disabled={!isLast} + startIcon={<DeleteIcon />} + onClick={remove} + > + {t(i18n)`Delete`} + </Button> + } + /> + <CardContent> + <Stack direction="row" alignItems="center" gap={1} useFlexGap> + <Typography variant="body2" sx={{ whiteSpace: 'nowrap' }}>{t( + i18n + )`Pay in`}</Typography> + <TextField + {...register(`${field}.number_of_days`)} + type="number" + error={!!errors?.[field]?.number_of_days} + InputProps={{ + endAdornment: t(i18n)`days`, + }} + /> + <Typography variant="body2" sx={{ whiteSpace: 'nowrap' }}>{t( + i18n + )`to get discount`}</Typography> + <TextField + {...register(`${field}.discount`)} + type="number" + error={!!errors?.[field]?.discount} + InputProps={{ + endAdornment: '%', + }} + /> + </Stack> + </CardContent> + </Card> + </> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTerms.test.tsx b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTerms.test.tsx new file mode 100644 index 000000000..5d9b2a66d --- /dev/null +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTerms.test.tsx @@ -0,0 +1,314 @@ +import { renderWithClient } from '@/utils/test-utils'; +import { requestFn } from '@openapi-qraft/react'; +import { screen, fireEvent, waitFor } from '@testing-library/react'; + +import { PaymentTermsDialog } from './PaymentTermsDialog'; + +const closeDialogMock = jest.fn(); +const requestFnMock = requestFn as jest.MockedFunction<typeof requestFn>; + +describe('PaymentTerms', () => { + test('should show a dialog for payment term creation', async () => { + renderWithClient(<PaymentTermsDialog show closeDialog={closeDialogMock} />); + + expect(screen.getByText('Create payment term')).toBeInTheDocument(); + expect(screen.getByText('Settings')).toBeInTheDocument(); + expect(screen.getByText('Name')).toBeInTheDocument(); + expect(screen.getByText('Payment due')).toBeInTheDocument(); + expect(screen.getAllByText('Description')[0]).toBeInTheDocument(); + expect( + screen.getByRole('button', { name: /add discount/i }) + ).toBeInTheDocument(); + expect(screen.getByRole('button', { name: 'Create' })).toBeInTheDocument(); + + const cancelButton = screen.getByRole('button', { name: 'Cancel' }); + expect(cancelButton).toBeInTheDocument(); + + await fireEvent.click(cancelButton); + + expect(closeDialogMock).toHaveBeenCalledWith(); + }); + + describe('when user clicks `create` without filling the form', () => { + test('should show error message', async () => { + renderWithClient( + <PaymentTermsDialog show closeDialog={closeDialogMock} /> + ); + + fireEvent.click(screen.getByRole('button', { name: 'Create' })); + + await waitFor(() => + expect( + screen.getByText( + 'To create a preset you need to fill out all the required fields' + ) + ).toBeInTheDocument() + ); + }); + }); + + describe('when user fills the form', () => { + test('should send a correct request', async () => { + renderWithClient( + <PaymentTermsDialog show closeDialog={closeDialogMock} /> + ); + + const nameInput = screen.getByRole('textbox', { name: 'Name' }); + const paymentDueInput = screen.getByRole('spinbutton', { + name: 'Payment due', + }); + const descriptionInput = screen.getByRole('textbox', { + name: 'Description', + }); + + fireEvent.change(nameInput, { target: { value: 'Standard terms' } }); + fireEvent.change(paymentDueInput, { target: { value: 14 } }); + fireEvent.change(descriptionInput, { + target: { value: 'Pay in 14 days' }, + }); + fireEvent.click(screen.getByRole('button', { name: 'Create' })); + + await waitFor(() => + expect(requestFnMock.mock.lastCall?.[1].body).toEqual({ + term_final: { + number_of_days: 14, + }, + name: 'Standard terms', + description: 'Pay in 14 days', + }) + ); + }); + + describe('when user adds discounts', () => { + test('should show discount cards', async () => { + renderWithClient( + <PaymentTermsDialog show closeDialog={closeDialogMock} /> + ); + + fireEvent.click(screen.getByRole('button', { name: 'Add discount' })); + + expect(screen.getByText('Discount 1')).toBeInTheDocument(); + expect( + screen.getByRole('button', { name: 'Delete' }) + ).toBeInTheDocument(); + + fireEvent.click(screen.getByRole('button', { name: 'Add discount' })); + + const deleteButtons = screen.getAllByRole('button', { name: 'Delete' }); + + expect(screen.getByText('Discount 2')).toBeInTheDocument(); + expect(deleteButtons.length).toBe(2); + expect(deleteButtons[0]).toBeDisabled(); + + fireEvent.click(deleteButtons[1]); + + expect(screen.queryByText('Discount 2')).not.toBeInTheDocument(); + expect(deleteButtons[0]).not.toBeDisabled(); + }); + + test('should show correct validation messages', async () => { + renderWithClient( + <PaymentTermsDialog show closeDialog={closeDialogMock} /> + ); + + const createButton = screen.getByRole('button', { name: 'Create' }); + const nameInput = screen.getByRole('textbox', { name: 'Name' }); + const paymentDueInput = screen.getByRole('spinbutton', { + name: 'Payment due', + }); + const descriptionInput = screen.getByRole('textbox', { + name: 'Description', + }); + + fireEvent.change(nameInput, { target: { value: 'Standard terms' } }); + fireEvent.change(paymentDueInput, { target: { value: 14 } }); + fireEvent.change(descriptionInput, { + target: { value: 'Pay in 14 days' }, + }); + + fireEvent.click(screen.getByRole('button', { name: 'Add discount' })); + fireEvent.click(createButton); + + await waitFor(() => + expect( + screen.getByText( + 'To add a discount you need to fill out all the fields' + ) + ).toBeInTheDocument() + ); + + const discount1Days = screen.getAllByRole('spinbutton')[1]; + const discount1Amount = screen.getAllByRole('spinbutton')[2]; + + fireEvent.change(discount1Days, { target: { value: 15 } }); + fireEvent.change(discount1Amount, { target: { value: 20 } }); + + fireEvent.click(createButton); + + await waitFor(() => + expect( + screen.getByText( + 'The number of days in Discount must be less than of Due days' + ) + ).toBeInTheDocument() + ); + + fireEvent.change(discount1Days, { target: { value: 5 } }); + fireEvent.click(screen.getByRole('button', { name: 'Add discount' })); + fireEvent.click(createButton); + + await waitFor(() => + expect( + screen.getByText( + 'To add a discount you need to fill out all the fields' + ) + ).toBeInTheDocument() + ); + + const discount2Days = screen.getAllByRole('spinbutton')[3]; + const discount2Amount = screen.getAllByRole('spinbutton')[4]; + + fireEvent.change(discount2Days, { target: { value: 3 } }); + fireEvent.change(discount2Amount, { target: { value: 10 } }); + fireEvent.click(createButton); + + await waitFor(() => + expect( + screen.getByText( + 'The number of days in Discount 2 must be more than the number of Discount 1 days' + ) + ).toBeInTheDocument() + ); + }); + + test('should send correct request', async () => { + renderWithClient( + <PaymentTermsDialog show closeDialog={closeDialogMock} /> + ); + + const nameInput = screen.getByRole('textbox', { name: 'Name' }); + const paymentDueInput = screen.getByRole('spinbutton', { + name: 'Payment due', + }); + const descriptionInput = screen.getByRole('textbox', { + name: 'Description', + }); + + fireEvent.change(nameInput, { target: { value: 'Standard terms' } }); + fireEvent.change(paymentDueInput, { target: { value: 14 } }); + fireEvent.change(descriptionInput, { + target: { value: 'Pay in 14 days' }, + }); + + fireEvent.click(screen.getByRole('button', { name: 'Add discount' })); + fireEvent.click(screen.getByRole('button', { name: 'Add discount' })); + + const numberInputs = screen.getAllByRole('spinbutton'); + + // Discount 1 + fireEvent.change(numberInputs[1], { target: { value: 5 } }); + fireEvent.change(numberInputs[2], { target: { value: 10 } }); + // Discount 2 + fireEvent.change(numberInputs[3], { target: { value: 10 } }); + fireEvent.change(numberInputs[4], { target: { value: 5 } }); + + fireEvent.click(screen.getByRole('button', { name: 'Create' })); + + await waitFor(() => + expect(requestFnMock.mock.lastCall?.[1].body).toEqual({ + term_final: { + number_of_days: 14, + }, + name: 'Standard terms', + description: 'Pay in 14 days', + term_1: { + number_of_days: 5, + discount: 10, + }, + term_2: { + number_of_days: 10, + discount: 5, + }, + }) + ); + }); + }); + }); + + describe('when user edits payment terms', () => { + const selectedTerm = { + id: '123', + name: '30 term', + description: 'Pay in 30 days', + term_final: { + number_of_days: 30, + }, + term_1: { + number_of_days: 15, + discount: 10, + }, + term_2: { + number_of_days: 20, + discount: 3, + }, + }; + + test('should show prefilled form', async () => { + renderWithClient( + <PaymentTermsDialog + show + closeDialog={closeDialogMock} + selectedTerm={selectedTerm} + /> + ); + + const saveButton = screen.getByRole('button', { name: 'Save' }); + + expect(screen.getByDisplayValue(selectedTerm.name)).toBeInTheDocument(); + expect( + screen.getByDisplayValue(selectedTerm.description) + ).toBeInTheDocument(); + expect( + screen.getByDisplayValue(selectedTerm.term_final.number_of_days) + ).toBeInTheDocument(); + expect( + screen.getByDisplayValue(selectedTerm.term_1.number_of_days) + ).toBeInTheDocument(); + expect( + screen.getByDisplayValue(selectedTerm.term_1.discount) + ).toBeInTheDocument(); + expect( + screen.getByDisplayValue(selectedTerm.term_2.number_of_days) + ).toBeInTheDocument(); + expect( + screen.getByDisplayValue(selectedTerm.term_2.discount) + ).toBeInTheDocument(); + + fireEvent.change(screen.getByDisplayValue(selectedTerm.name), { + target: { value: 'New name' }, + }); + fireEvent.click(saveButton); + + await waitFor(() => { + expect(requestFnMock.mock.lastCall?.[1].body).toEqual({ + name: 'New name', + description: 'Pay in 30 days', + term_final: { + number_of_days: 30, + }, + term_1: { + number_of_days: 15, + discount: 10, + }, + term_2: { + number_of_days: 20, + discount: 3, + }, + }); + expect(requestFnMock.mock.lastCall?.[1].parameters?.path).toEqual({ + payment_terms_id: '123', + }); + }); + }); + }); +}); diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsDialog.tsx b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsDialog.tsx new file mode 100644 index 000000000..00f005a90 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsDialog.tsx @@ -0,0 +1,99 @@ +import { useId, useState } from 'react'; + +import { components } from '@/api'; +import { Dialog } from '@/components'; +import { i18n } from '@lingui/core'; +import { t } from '@lingui/macro'; +import { + Typography, + DialogTitle, + DialogContent, + Divider, + DialogActions, + Button, + Stack, +} from '@mui/material'; + +import { DeletePaymentTerms } from './DeletePaymentTerms'; +import { PaymentTermsForm } from './PaymentTermsForm'; + +export interface PaymentTermsDialogProps { + show: boolean; + closeDialog: ( + id?: components['schemas']['PaymentTermsResponse']['id'], + isDeleted?: boolean + ) => void; + selectedTerm?: components['schemas']['PaymentTermsResponse']; +} + +export const PaymentTermsDialog = ({ + show, + closeDialog, + selectedTerm, +}: PaymentTermsDialogProps) => { + const formName = `Monite-Form-paymentTerms-${useId()}`; + + const submitButtonText = selectedTerm ? t(i18n)`Save` : t(i18n)`Create`; + const titleText = selectedTerm + ? t(i18n)`Edit payment term` + : t(i18n)`Create payment term`; + + const [showDeleteDialog, setShowDeleteDialog] = useState(false); + const closeDeleteDialog = (isDeleted: boolean) => { + setShowDeleteDialog(false); + + closeDialog(undefined, isDeleted); + }; + + return ( + <> + <Dialog open={show} alignDialog="right" onClose={() => closeDialog()}> + <DialogTitle> + <Typography variant="h4">{titleText}</Typography> + </DialogTitle> + <Divider /> + <DialogContent> + <PaymentTermsForm + formName={formName} + selectedTerm={selectedTerm} + onTermsChange={closeDialog} + /> + </DialogContent> + <Divider /> + <DialogActions> + <Stack + direction="row" + sx={{ + flex: 1, + justifyContent: selectedTerm ? 'space-between' : 'flex-end', + px: 2, + }} + > + {selectedTerm && ( + <Button + variant="text" + color="error" + onClick={() => setShowDeleteDialog(true)} + >{t(i18n)`Delete`}</Button> + )} + <Stack direction="row" gap={1} useFlexGap> + <Button variant="text" onClick={() => closeDialog()}>{t( + i18n + )`Cancel`}</Button> + <Button type="submit" variant="contained" form={formName}> + {submitButtonText} + </Button> + </Stack> + </Stack> + </DialogActions> + </Dialog> + {selectedTerm && ( + <DeletePaymentTerms + show={showDeleteDialog} + paymentTermsId={selectedTerm.id} + closeDialog={closeDeleteDialog} + /> + )} + </> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx new file mode 100644 index 000000000..892d242d4 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx @@ -0,0 +1,208 @@ +import { useState, FormEvent, ReactNode, useEffect } from 'react'; +import { useForm, FormProvider } from 'react-hook-form'; + +import { components } from '@/api'; +import { yupResolver } from '@hookform/resolvers/yup'; +import { t } from '@lingui/macro'; +import { useLingui } from '@lingui/react'; +import AddIcon from '@mui/icons-material/Add'; +import { + Typography, + Button, + Stack, + Card, + CardContent, + Box, + Alert, + TextField, +} from '@mui/material'; + +import { DiscountForm } from './DiscountForm'; +import { getValidation } from './paymentTermsValidation'; +import { PaymentTermsFields, TermField } from './types'; +import { usePaymentTermsApi } from './usePaymentTermsApi'; + +const MAX_DISCOUNTS = 2; + +interface PaymentTermsFormProps { + formName: string; + selectedTerm?: components['schemas']['PaymentTermsResponse'] | null; + onTermsChange?: ( + id?: components['schemas']['PaymentTermsResponse']['id'] + ) => void; +} + +export const PaymentTermsForm = ({ + formName, + selectedTerm, + onTermsChange, +}: PaymentTermsFormProps) => { + const { id: selectedTermId, ...selectedTermsFields } = selectedTerm || {}; + const [error, setError] = useState<ReactNode>(); + const { i18n } = useLingui(); + const methods = useForm<PaymentTermsFields>({ + defaultValues: { ...selectedTermsFields }, + resolver: yupResolver(getValidation(i18n, () => methods.watch())), + }); + + const { + handleSubmit, + formState: { errors }, + register, + } = methods; + + const { createPaymentTerm, updatePaymentTerm } = usePaymentTermsApi({ + onCreationError: () => + setError( + <> + {t(i18n)`Failed to create payment term, please try again.`} + <br /> + {t(i18n)`If this error recurs, contact your admin.`} + </> + ), + onSuccessfullChange: onTermsChange, + }); + + const [discountForms, setDiscountForms] = useState<TermField[]>(() => { + if (selectedTerm) { + return [TermField.Term1, TermField.Term2].filter((term) => + Boolean(selectedTerm[term]) + ); + } + + return []; + }); + + useEffect(() => { + const sectionErrors = Object.keys(errors).filter( + (errorKey) => + ![...(Object.values(TermField) as string[])].includes(errorKey) + ); + if (sectionErrors.length > 0) { + setError( + t(i18n)`To create a preset you need to fill out all the required fields` + ); + } else { + setError(null); + } + }, [errors, i18n]); + + const addDiscountForm = () => { + if (discountForms.length === MAX_DISCOUNTS) return; + const nextDiscount = discountForms.length + ? TermField.Term2 + : TermField.Term1; + + setDiscountForms((prev) => [...prev, nextDiscount]); + methods.setValue(nextDiscount, { number_of_days: null, discount: null }); + }; + + const removeDiscountForm = () => { + if (!discountForms.length) return; + + const discountToRemove = discountForms[discountForms.length - 1]; + setDiscountForms((prev) => prev.slice(0, -1)); + methods.setValue(discountToRemove, null); + }; + + const onSubmit = (event: FormEvent) => { + event.preventDefault(); + event.stopPropagation(); + + handleSubmit((values) => { + const { term_1, term_2, ...rest } = values; + const payload = { ...rest }; + + if (term_1) { + Object.assign(payload, { term_1 }); + } + + if (term_2) { + Object.assign(payload, { term_2 }); + } + + if (selectedTermId) { + updatePaymentTerm(selectedTermId, payload); + } else { + createPaymentTerm(payload); + } + })(event); + }; + + return ( + <FormProvider {...methods}> + {!!error && ( + <Alert severity="error" sx={{ my: 2 }}> + {error} + </Alert> + )} + <form id={formName} noValidate onSubmit={onSubmit}> + <Typography variant="subtitle1">{t(i18n)`Settings`}</Typography> + <Card elevation={0} variant="outlined" sx={{ mt: 1 }}> + <CardContent> + <Stack direction="row" gap={1} useFlexGap> + <TextField + label={t(i18n)`Name`} + {...register('name')} + required + error={!!errors.name} + helperText={t(i18n)`Example: NET 30, –2%/10 days, –1%/20 days`} + sx={{ flex: 1 }} + /> + <TextField + label={t(i18n)`Payment due`} + {...register('term_final.number_of_days')} + required + type="number" + error={!!errors.term_final?.number_of_days} + sx={{ width: 180 }} + InputProps={{ + endAdornment: t(i18n)`days`, + }} + /> + </Stack> + <TextField + label={t(i18n)`Description`} + {...register('description')} + fullWidth + multiline + rows={4} + sx={{ mt: 2 }} + /> + </CardContent> + </Card> + <Box sx={{ mt: 2 }}> + <Typography variant="subtitle1">{t( + i18n + )`Early payment discounts`}</Typography> + <Typography variant="body1" sx={{ mt: 1 }}> + {t(i18n)`Offer a discount to your customer if they pay early.`} + <br /> + {t(i18n)`You can set up to 2 early payment discounts per invoice.`} + </Typography> + </Box> + <Stack gap={3} useFlexGap sx={{ mt: 3 }}> + {discountForms.map((field, index) => ( + <DiscountForm + key={field} + index={index} + field={field} + isLast={index === discountForms.length - 1} + remove={removeDiscountForm} + register={register} + errors={errors} + /> + ))} + </Stack> + {discountForms.length < MAX_DISCOUNTS && ( + <Button + sx={{ mt: 2 }} + variant="outlined" + startIcon={<AddIcon />} + onClick={addDiscountForm} + >{t(i18n)`Add discount`}</Button> + )} + </form> + </FormProvider> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummary.tsx b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummary.tsx new file mode 100644 index 000000000..37ba5e4a2 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummary.tsx @@ -0,0 +1,54 @@ +import { components } from '@/api'; +import { t } from '@lingui/macro'; +import { useLingui } from '@lingui/react'; +import { + CalendarToday as CalendarTodayIcon, + Sell as SellIcon, +} from '@mui/icons-material'; +import { Card, CardContent, Button } from '@mui/material'; + +import { PaymentTermSummaryItem } from './PaymentTermsSummaryItem'; + +export interface PaymentTermsSummaryProps { + paymentTerm: components['schemas']['PaymentTermsResponse']; + openEditDialog: () => void; +} + +export const PaymentTermsSummary = ({ + paymentTerm, + openEditDialog, +}: PaymentTermsSummaryProps) => { + const { i18n } = useLingui(); + const { term_final, term_1, term_2 } = paymentTerm; + + return ( + <Card sx={{ backgroundColor: '#fafafa' }} elevation={0}> + <CardContent sx={{ color: 'secondary.main' }}> + {term_1 && ( + <PaymentTermSummaryItem + renderIcon={(props) => <SellIcon {...props} />} + leftLine={t(i18n)`Pay in the first ${term_1.number_of_days} days`} + rightLine={t(i18n)`${term_1.discount}% discount`} + sx={{ mb: 2 }} + /> + )} + {term_2 && ( + <PaymentTermSummaryItem + renderIcon={(props) => <SellIcon {...props} />} + leftLine={t(i18n)`Pay in the first ${term_2.number_of_days} days`} + rightLine={t(i18n)`${term_2.discount}% discount`} + sx={{ mb: 2 }} + /> + )} + <PaymentTermSummaryItem + renderIcon={(props) => <CalendarTodayIcon {...props} />} + leftLine={t(i18n)`Payment due`} + rightLine={t(i18n)`${term_final?.number_of_days} days`} + /> + <Button sx={{ mt: 2 }} variant="outlined" onClick={openEditDialog}>{t( + i18n + )`Edit term`}</Button> + </CardContent> + </Card> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummaryItem.tsx b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummaryItem.tsx new file mode 100644 index 000000000..66e16a0f1 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummaryItem.tsx @@ -0,0 +1,27 @@ +import { ReactNode } from 'react'; + +import { SvgIconProps, SxProps, Stack, Typography } from '@mui/material'; + +export interface PaymentTermSummaryItemProps { + renderIcon: (props: SvgIconProps) => ReactNode; + leftLine: string; + rightLine: string; + sx?: SxProps; +} + +export const PaymentTermSummaryItem = ({ + renderIcon, + leftLine, + rightLine, + sx, +}: PaymentTermSummaryItemProps) => { + return ( + <Stack justifyContent="space-between" direction="row" sx={sx}> + <Stack direction="row" alignItems="center"> + {renderIcon({ sx: { mr: 1, fontSize: 16 } })} + <Typography variant="body1">{leftLine}</Typography> + </Stack> + <Typography variant="body1">{rightLine}</Typography> + </Stack> + ); +}; diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/index.ts b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/index.ts new file mode 100644 index 000000000..9abe933d6 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/index.ts @@ -0,0 +1,2 @@ +export * from './PaymentTermsSummary'; +export * from './PaymentTermsDialog'; diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/paymentTermsValidation.ts b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/paymentTermsValidation.ts new file mode 100644 index 000000000..6724e35a0 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/paymentTermsValidation.ts @@ -0,0 +1,92 @@ +import { type I18n } from '@lingui/core'; +import { t } from '@lingui/macro'; + +import * as yup from 'yup'; + +const lessThanDue = (value: number | undefined, getFormState: () => any) => { + const form = getFormState(); + const termFinalDays = form?.term_final?.number_of_days; + + if (!value || !termFinalDays) { + return true; + } + + return value < termFinalDays; +}; + +const largerThanPreviousDiscount = ( + value: number | undefined, + getFormState: () => any +) => { + const form = getFormState(); + const previousTermDays = form?.term_1?.number_of_days; + + if (!value || !previousTermDays) { + return true; + } + + return value > previousTermDays; +}; + +export const getValidation = (i18n: I18n, getFormState: () => any) => + yup.object({ + name: yup.string().max(100).required(), + term_final: yup.object().shape({ + number_of_days: yup.number().required(), + }), + description: yup.string().max(250).optional(), + term_1: yup + .object() + .shape({ + number_of_days: yup + .number() + .default(null) + .typeError( + t(i18n)`To add a discount you need to fill out all the fields` + ) + .test( + 'less-than-due', + t( + i18n + )`The number of days in Discount must be less than of Due days`, + (value) => lessThanDue(value, getFormState) + ), + discount: yup + .number() + .typeError( + t(i18n)`To add a discount you need to fill out all the fields` + ), + }) + .default(undefined) + .optional(), + term_2: yup + .object() + .shape({ + number_of_days: yup + .number() + .typeError( + t(i18n)`To add a discount you need to fill out all the fields` + ) + .test( + 'less-than-due', + t( + i18n + )`The number of days in Discount must be less than of Due days`, + (value) => lessThanDue(value, getFormState) + ) + .test( + 'larger-than-previous', + t( + i18n + )`The number of days in Discount 2 must be more than the number of Discount 1 days`, + (value) => largerThanPreviousDiscount(value, getFormState) + ), + discount: yup + .number() + .typeError( + t(i18n)`To add a discount you need to fill out all the fields` + ), + }) + .default(undefined) + .optional(), + }); diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/types.ts b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/types.ts new file mode 100644 index 000000000..2783c00d4 --- /dev/null +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/types.ts @@ -0,0 +1,19 @@ +export interface PaymentTermsDiscountFields { + number_of_days: number | null; + discount: number | null; +} + +export interface PaymentTermsFields { + name: string; + description?: string; + term_final: { + number_of_days: number; + }; + term_1?: PaymentTermsDiscountFields | null; + term_2?: PaymentTermsDiscountFields | null; +} + +export enum TermField { + Term1 = 'term_1', + Term2 = 'term_2', +} diff --git a/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/usePaymentTermsApi.ts b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/usePaymentTermsApi.ts new file mode 100644 index 000000000..0ccd3a34c --- /dev/null +++ b/packages/sdk-react/src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/usePaymentTermsApi.ts @@ -0,0 +1,96 @@ +import { toast } from 'react-hot-toast'; + +import { components } from '@/api'; +import { useMoniteContext } from '@/core/context/MoniteContext'; +import { i18n } from '@lingui/core'; +import { t } from '@lingui/macro'; + +interface UsePaymentTermsApiParams { + onDelete?: () => void; + onCreationError?: () => void; + onSuccessfullChange?: ( + id?: components['schemas']['PaymentTermsResponse']['id'] + ) => void; +} + +export const usePaymentTermsApi = ({ + onCreationError, + onDelete, + onSuccessfullChange, +}: UsePaymentTermsApiParams = {}) => { + const { api, queryClient } = useMoniteContext(); + + const createMutation = api.paymentTerms.postPaymentTerms.useMutation( + undefined, + { + onSuccess: (paymentTerm) => { + api.paymentTerms.getPaymentTerms.invalidateQueries(queryClient); + toast.success(t(i18n)`Payment term created`); + onSuccessfullChange?.(paymentTerm.id); + }, + onError: () => { + onCreationError?.(); + }, + } + ); + + const updateMutation = api.paymentTerms.patchPaymentTermsId.useMutation( + undefined, + { + onSuccess: (paymentTerm) => { + api.paymentTerms.getPaymentTerms.invalidateQueries(queryClient); + toast.success(t(i18n)`Payment term updated`); + onSuccessfullChange?.(paymentTerm.id); + }, + onError: () => { + toast.error(t(i18n)`Error updating payment term`); + }, + } + ); + + const deleteMutation = api.paymentTerms.deletePaymentTermsId.useMutation( + undefined, + { + onSuccess: () => { + toast.success(t(i18n)`Payment term successfully deleted`); + onDelete?.(); + onSuccessfullChange?.(); + }, + onError: () => { + toast.error(t(i18n)`Error deleting payment term`); + }, + } + ); + + const createPaymentTerm = async ( + values: components['schemas']['PaymentTermsCreatePayload'] + ) => { + await createMutation.mutateAsync({ body: values }); + }; + + const updatePaymentTerm = async ( + id: string, + values: components['schemas']['PaymentTermsUpdatePayload'] + ) => { + await updateMutation.mutateAsync({ + path: { + payment_terms_id: id, + }, + body: values, + }); + }; + + const deletePaymentTerm = async (id: string) => { + await deleteMutation.mutateAsync({ + path: { + payment_terms_id: id, + }, + }); + }; + + return { + createPaymentTerm, + updatePaymentTerm, + deletePaymentTerm, + }; +}; diff --git a/packages/sdk-react/src/core/i18n/locales/en/messages.po b/packages/sdk-react/src/core/i18n/locales/en/messages.po index 51585456b..39dc44131 100644 --- a/packages/sdk-react/src/core/i18n/locales/en/messages.po +++ b/packages/sdk-react/src/core/i18n/locales/en/messages.po @@ -69,7 +69,7 @@ msgstr "{0, select, credit_note {Credit Note has been sent} invoice {Invoice has #: src/components/onboarding/OnboardingPersonsReview/OnboardingAddressView/OnboardingAddressView.tsx:20 #: src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx:58 #: src/components/receivables/Financing/FinanceFaq/FinanceFaqDetails.tsx:62 -#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:64 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:72 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/InvoiceRecurrenceCancelModal.tsx:89 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/ReceivableRecurrence/InvoiceRecurrenceDetails.tsx:37 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/ReceivableRecurrence/InvoiceRecurrenceDetails.tsx:46 @@ -86,6 +86,10 @@ msgstr "{0} - {1}" msgid "{0} ({code})" msgstr "{0} ({code})" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummary.tsx:46 +msgid "{0} days" +msgstr "{0} days" + #: src/core/queries/useReceivables.ts:43 msgid "{0} has been created" msgstr "{0} has been created" @@ -110,6 +114,11 @@ msgstr "{0}% advance rate" msgid "{0}% advance rate, Pay in {1} days, {2}% fee" msgstr "{0}% advance rate, Pay in {1} days, {2}% fee" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummary.tsx:31 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummary.tsx:39 +msgid "{0}% discount" +msgstr "{0}% discount" + #: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx:83 msgid "{0}% fee" msgstr "{0}% fee" @@ -348,6 +357,10 @@ msgstr "Add contact" msgid "Add contact person" msgstr "Add contact person" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx:203 +msgid "Add discount" +msgstr "Add discount" + #: src/components/payables/PayableDetails/PayableLineItemsForm/PayableLineItemsForm.tsx:172 #: src/components/receivables/InvoiceDetails/CreateReceivable/components/ProductsTable.tsx:311 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/ItemsSection.tsx:400 @@ -723,8 +736,8 @@ msgid "approvals required" msgstr "approvals required" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:188 -#: src/components/payables/PayableDetails/PayableDetails.test.tsx:519 -#: src/components/payables/PayableDetails/PayableDetails.test.tsx:540 +#: src/components/payables/PayableDetails/PayableDetails.test.tsx:533 +#: src/components/payables/PayableDetails/PayableDetails.test.tsx:554 #: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:108 #: src/components/userRoles/consts.ts:74 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:223 @@ -1301,6 +1314,8 @@ msgstr "Canadian Dollar" #: src/components/products/ProductDetails/ProductEditForm/ProductEditForm.tsx:199 #: src/components/receivables/InvoiceDetails/CreateReceivable/components/ProductsTable.tsx:552 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/CreateCounterpartDialog.tsx:162 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DeletePaymentTerms.tsx:38 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsDialog.tsx:80 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:459 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/OverdueReminderForm.tsx:295 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/EditInvoiceDetails.tsx:176 @@ -1327,13 +1342,15 @@ msgstr "Cancel" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:145 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:393 -#: src/components/payables/PayableDetails/PayableDetails.test.tsx:414 -#: src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx:43 +#: src/components/payables/PayableDetails/PayableDetails.test.tsx:400 +#: src/components/payables/PayableDetails/PayableDetails.test.tsx:421 +#: src/components/payables/PayableDetails/PayableDetails.test.tsx:428 +#: src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx:45 #: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:114 msgid "Cancel bill" msgstr "Cancel bill" -#: src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx:27 +#: src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx:29 msgid "Cancel bill?" msgstr "Cancel bill?" @@ -1540,7 +1557,7 @@ msgstr "Civic, Social, Fraternal Associations" msgid "Cleaning and Maintenance" msgstr "Cleaning and Maintenance" -#: src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx:34 +#: src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx:36 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:206 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/InvoiceCancelModal.tsx:74 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/InvoiceRecurrenceCancelModal.tsx:133 @@ -1946,6 +1963,7 @@ msgstr "Court Costs, Including Alimony and Child Support - Courts of Law" #: src/components/counterparts/CounterpartDetails/CounterpartForm/CounterpartIndividualForm/CounterpartIndividualForm.tsx:395 #: src/components/counterparts/CounterpartDetails/CounterpartForm/CounterpartOrganizationForm/CounterpartOrganizationForm.tsx:403 #: src/components/products/ProductDetails/ProductCreate/CreateProduct.tsx:133 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsDialog.tsx:36 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:469 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/OverdueReminderForm.tsx:308 #: src/components/tags/TagFormModal/TagFormModal.test.tsx:21 @@ -2069,6 +2087,11 @@ msgstr "Create new tag" msgid "Create New Tag" msgstr "Create New Tag" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsDialog.tsx:39 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/PaymentSection.tsx:87 +msgid "Create payment term" +msgstr "Create payment term" + #: src/components/receivables/InvoiceDetails/CreateReceivable/components/ProductsTable.tsx:453 msgid "Create product or service" msgstr "Create product or service" @@ -2259,9 +2282,10 @@ msgstr "Dating/Escort Services" #~ msgid "day" #~ msgstr "day" -#: src/ui/DueDateCell/DueDateCell.tsx:42 -#~ msgid "days" -#~ msgstr "days" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DiscountForm.tsx:87 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx:160 +msgid "days" +msgstr "days" #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/OverdueReminderForm.tsx:232 msgid "days after due date" @@ -2318,6 +2342,9 @@ msgstr "Defaulted" #: src/components/products/Products.test.tsx:202 #: src/components/products/Products.test.tsx:234 #: src/components/products/ProductsTable/ProductsTable.test.tsx:271 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DeletePaymentTerms.tsx:46 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DiscountForm.tsx:73 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsDialog.tsx:77 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/ReminderFormLayout.tsx:38 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/InvoiceDeleteModal.tsx:75 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/ExistingInvoiceDetails.tsx:274 @@ -2369,6 +2396,10 @@ msgstr "Delete Counterpart \"{0}\"?" msgid "Delete invoice" msgstr "Delete invoice" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DeletePaymentTerms.tsx:31 +msgid "Delete payment term?" +msgstr "Delete payment term?" + #: src/components/products/ProductDeleteModal/ProductDeleteModal.tsx:71 msgid "Delete Product \"{0}\"?" msgstr "Delete Product \"{0}\"?" @@ -2419,6 +2450,7 @@ msgstr "Department Stores" #: src/components/approvalPolicies/ApprovalPolicyDetails/ExistingApprovalPolicyDetailsAdvanced/ExistingApprovalPolicyDetailsAdvanced.tsx:84 #: src/components/products/ProductDetails/components/ProductForm/ProductForm.tsx:165 #: src/components/products/ProductDetails/validation.ts:48 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx:165 msgid "Description" msgstr "Description" @@ -2495,6 +2527,10 @@ msgstr "Direct Marketing - Travel" msgid "Director" msgstr "Director" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DiscountForm.tsx:60 +msgid "Discount {0}" +msgstr "Discount {0}" + #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:290 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:429 msgid "Discount date 1" @@ -2605,7 +2641,7 @@ msgstr "Dry Cleaners" #: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:602 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:319 #: src/components/payables/PayablesTable/Filters/Filters.tsx:81 -#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:60 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:68 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:235 #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/ReminderForm/BeforeDueDateReminderForm.tsx:420 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/reminderCardTermsHelpers.tsx:45 @@ -2649,6 +2685,10 @@ msgstr "Duty Free Stores" #~ msgid "E-mail" #~ msgstr "E-mail" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx:175 +msgid "Early payment discounts" +msgstr "Early payment discounts" + #: src/core/utils/currencies.ts:143 msgid "East Caribbean Dollar" msgstr "East Caribbean Dollar" @@ -2682,7 +2722,7 @@ msgstr "Ecuador" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:269 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:340 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:366 -#: src/components/payables/PayableDetails/PayableDetails.test.tsx:587 +#: src/components/payables/PayableDetails/PayableDetails.test.tsx:601 #: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:72 #: src/components/products/ProductDetails/ExistingProductDetails.tsx:245 #: src/components/products/Products.test.tsx:174 @@ -2742,6 +2782,10 @@ msgstr "Edit invoice" #~ msgid "Edit invoice {0}" #~ msgstr "Edit invoice {0}" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsDialog.tsx:38 +msgid "Edit payment term" +msgstr "Edit payment term" + #: src/components/products/ProductDetails/ProductEditForm/ProductEditForm.tsx:96 #: src/components/products/ProductDetails/ProductEditForm/ProductEditForm.tsx:173 msgid "Edit Product" @@ -2772,6 +2816,10 @@ msgstr "Edit tag" msgid "Edit tag ”{0}”" msgstr "Edit tag ”{0}”" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummary.tsx:48 +msgid "Edit term" +msgstr "Edit term" + #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:363 msgid "Edit User Role" msgstr "Edit User Role" @@ -2936,11 +2984,19 @@ msgstr "Eritrea" msgid "Error creating approval policy" msgstr "Error creating approval policy" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/usePaymentTermsApi.ts:60 +msgid "Error deleting payment term" +msgstr "Error deleting payment term" + #: src/components/approvalPolicies/ApprovalPolicyDetails/ApprovalPolicyForm/ApprovalPolicyForm.tsx:250 #: src/components/approvalPolicies/ApprovalPolicyDetails/useApprovalPolicyDetails.tsx:71 msgid "Error updating approval policy" msgstr "Error updating approval policy" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/usePaymentTermsApi.ts:46 +msgid "Error updating payment term" +msgstr "Error updating payment term" + #: src/core/utils/countries.ts:86 msgid "Estonia" msgstr "Estonia" @@ -2965,6 +3021,10 @@ msgstr "Every first day of the month" msgid "Every last day of the month" msgstr "Every last day of the month" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx:149 +msgid "Example: NET 30, –2%/10 days, –1%/20 days" +msgstr "Example: NET 30, –2%/10 days, –1%/20 days" + #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:454 msgid "excl. Tax" msgstr "excl. Tax" @@ -3009,6 +3069,10 @@ msgstr "Failed to create payment link. Please try again." msgid "Failed to create payment record: {errorMessage}" msgstr "Failed to create payment record: {errorMessage}" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx:58 +msgid "Failed to create payment term, please try again." +msgstr "Failed to create payment term, please try again." + #: src/components/products/ProductDetails/ProductCreate/CreateProduct.tsx:62 msgid "Failed to create product." msgstr "Failed to create product." @@ -3304,7 +3368,7 @@ msgstr "Front of your identity document" msgid "Fuel Dealers (Non Automotive)" msgstr "Fuel Dealers (Non Automotive)" -#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:94 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:102 #: src/components/receivables/InvoiceDetails/CreateReceivable/validation.ts:128 #: src/components/receivables/InvoiceDetails/CreateReceivable/validation.ts:181 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/sections/PreviewDetailsSection.tsx:30 @@ -3683,6 +3747,10 @@ msgstr "If the error recurs, contact support, please." msgid "If the error recurs, contact support." msgstr "If the error recurs, contact support." +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx:60 +msgid "If this error recurs, contact your admin." +msgstr "If this error recurs, contact your admin." + #: src/components/receivables/InvoiceDetails/CreateReceivable/components/ProductsTable.tsx:357 msgid "If you switch the invoice currency and add corresponding items, it will automatically replace the previously added ones." msgstr "If you switch the invoice currency and add corresponding items, it will automatically replace the previously added ones." @@ -3946,7 +4014,7 @@ msgstr "Issue at" #: src/components/payables/PayableDetails/PayableDetailsForm/PayableDetailsForm.tsx:571 #: src/components/payables/PayableDetails/PayableDetailsInfo/PayableDetailsInfo.tsx:300 #: src/components/receivables/CreditNotesTable/CreditNotesTable.tsx:156 -#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:46 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:54 #: src/components/receivables/InvoicesTable/InvoicesTable.tsx:228 msgid "Issue date" msgstr "Issue date" @@ -4640,6 +4708,7 @@ msgstr "N/A" #: src/components/payables/PayableDetails/PayableLineItemsForm/PayableLineItemsForm.tsx:45 #: src/components/products/ProductDetails/components/ProductForm/ProductForm.tsx:73 #: src/components/receivables/InvoiceDetails/CreateReceivable/components/ProductsTable.tsx:123 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx:145 #: src/components/receivables/InvoiceDetails/CreateReceivable/validation.ts:79 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/sections/PreviewItemsSection.tsx:98 #: src/components/receivables/InvoiceDetails/InvoiceItems/InvoiceItems.tsx:29 @@ -5016,6 +5085,10 @@ msgstr "Nurseries, Lawn and Garden Supply Stores" msgid "Nursing/Personal Care" msgstr "Nursing/Personal Care" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx:179 +msgid "Offer a discount to your customer if they pay early." +msgstr "Offer a discount to your customer if they pay early." + #: src/components/onboarding/dicts/mccCodes.ts:1013 msgid "Office and Commercial Furniture" msgstr "Office and Commercial Furniture" @@ -5212,14 +5285,19 @@ msgctxt "InvoicesTableRowActionMenu" msgid "Pay" msgstr "Pay" -#: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx:78 -#~ msgid "Pay in {0}" -#~ msgstr "Pay in {0}" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DiscountForm.tsx:79 +msgid "Pay in" +msgstr "Pay in" #: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceOffers/FinanceOffers.tsx:78 msgid "Pay in {0} days" msgstr "Pay in {0} days" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummary.tsx:30 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummary.tsx:38 +msgid "Pay in the first {0} days" +msgstr "Pay in the first {0} days" + #: src/components/payables/PayablesTable/PayablesTable.tsx:521 #: src/components/userRoles/consts.ts:51 msgid "Payable" @@ -5297,6 +5375,11 @@ msgstr "Payment details" msgid "Payment Details" msgstr "Payment Details" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx:153 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsSummary.tsx:45 +msgid "Payment due" +msgstr "Payment due" + #: src/components/payables/PayablesTable/components/PayablesTableAction.tsx:57 msgid "Payment not allowed" msgstr "Payment not allowed" @@ -5331,7 +5414,19 @@ msgstr "Payment reminder error" #~ msgid "Payment term" #~ msgstr "Payment term" -#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/PaymentSection.tsx:45 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/usePaymentTermsApi.ts:28 +msgid "Payment term created" +msgstr "Payment term created" + +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/usePaymentTermsApi.ts:55 +msgid "Payment term successfully deleted" +msgstr "Payment term successfully deleted" + +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/usePaymentTermsApi.ts:42 +msgid "Payment term updated" +msgstr "Payment term updated" + +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/PaymentSection.tsx:73 #: src/components/receivables/InvoiceDetails/CreateReceivable/validation.ts:145 #: src/components/receivables/InvoiceDetails/CreateReceivable/validation.ts:198 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/sections/PreviewPaymentDetailsSection.tsx:21 @@ -5906,8 +6001,8 @@ msgid "Registered Number (Japan)" msgstr "Registered Number (Japan)" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:185 -#: src/components/payables/PayableDetails/PayableDetails.test.tsx:477 -#: src/components/payables/PayableDetails/PayableDetails.test.tsx:498 +#: src/components/payables/PayableDetails/PayableDetails.test.tsx:491 +#: src/components/payables/PayableDetails/PayableDetails.test.tsx:512 #: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:97 msgid "Reject" msgstr "Reject" @@ -6168,7 +6263,7 @@ msgstr "Sales" msgid "Sales and Service Tax (Malaysia)" msgstr "Sales and Service Tax (Malaysia)" -#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:139 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:147 msgid "Same as invoice date" msgstr "Same as invoice date" @@ -6203,6 +6298,7 @@ msgstr "Saudi Riyal" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:346 #: src/components/payables/PayableDetails/PayableDetails.test.tsx:372 #: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:78 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsDialog.tsx:36 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/ReceivableRecurrence/InvoiceRecurrenceForm.tsx:352 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/TabPanels/PaymentTabPanel/PaymentRecordForm.tsx:150 #: src/components/tags/TagFormModal/TagFormModal.test.tsx:155 @@ -6336,7 +6432,7 @@ msgstr "Services" msgid "Set a recurrence period to issue invoices automatically" msgstr "Set a recurrence period to issue invoices automatically" -#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:68 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:76 msgid "Set by payment term" msgstr "Set by payment term" @@ -6344,7 +6440,7 @@ msgstr "Set by payment term" #~ msgid "Set by payment terms" #~ msgstr "Set by payment terms" -#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:54 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/Billing/FullfillmentSummary.tsx:62 msgid "Set on issuance" msgstr "Set on issuance" @@ -6357,6 +6453,10 @@ msgstr "Set reminders" msgid "Set this counterpart as:" msgstr "Set this counterpart as:" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx:140 +msgid "Settings" +msgstr "Settings" + #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/TabPanels/PaymentTabPanel/PaymentRecordRow.tsx:44 #: src/components/receivables/InvoiceDetails/ExistingInvoiceDetails/components/TabPanels/PaymentTabPanel/PaymentRecordRow.tsx:45 msgid "Settled" @@ -6591,8 +6691,8 @@ msgid "Subject" msgstr "Subject" #: src/components/payables/PayableDetails/PayableDetails.test.tsx:148 -#: src/components/payables/PayableDetails/PayableDetails.test.tsx:435 -#: src/components/payables/PayableDetails/PayableDetails.test.tsx:456 +#: src/components/payables/PayableDetails/PayableDetails.test.tsx:449 +#: src/components/payables/PayableDetails/PayableDetails.test.tsx:470 #: src/components/payables/PayableDetails/PayableDetailsHeader/PayableDetailsHeader.tsx:91 #: src/components/userRoles/consts.ts:73 #: src/components/userRoles/UserRoleDetails/UserRoleDetailsDialog/UserRoleDetailsDialog.tsx:219 @@ -6852,7 +6952,7 @@ msgstr "Thailand" msgid "Thank you for completing onboarding for payments services. We will now review the information submitted." msgstr "Thank you for completing onboarding for payments services. We will now review the information submitted." -#: src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx:29 +#: src/components/payables/PayableDetails/PayableDetailsCancelModal/PayableDetailsCancelModal.tsx:31 msgid "The bill will receive the “Canceled” status and will require no payment. You can't undo this action." msgstr "The bill will receive the “Canceled” status and will require no payment. You can't undo this action." @@ -6880,6 +6980,15 @@ msgstr "The IBAN should correspond to the chosen country - {country}." msgid "The issue date should be less than 7 days ago. You can't fund overdue invoices. The loan sum must be within your remaining limit." msgstr "The issue date should be less than 7 days ago. You can't fund overdue invoices. The loan sum must be within your remaining limit." +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/paymentTermsValidation.ts:79 +msgid "The number of days in Discount 2 must be more than the number of Discount 1 days" +msgstr "The number of days in Discount 2 must be more than the number of Discount 1 days" + +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/paymentTermsValidation.ts:49 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/paymentTermsValidation.ts:72 +msgid "The number of days in Discount must be less than of Due days" +msgstr "The number of days in Discount must be less than of Due days" + #: src/components/onboarding/OnboardingPersonsReview/OnboardingPersonsReview.tsx:57 msgid "The review for the persons has been completed. You can proceed to the next step." msgstr "The review for the persons has been completed. You can proceed to the next step." @@ -6913,8 +7022,8 @@ msgid "There is no payable by provided id: {id}" msgstr "There is no payable by provided id: {id}" #: src/components/receivables/InvoiceDetails/CreateReceivable/sections/PaymentSection.tsx:61 -msgid "There is no payment terms available. Please create one in the settings." -msgstr "There is no payment terms available. Please create one in the settings." +#~ msgid "There is no payment terms available. Please create one in the settings." +#~ msgstr "There is no payment terms available. Please create one in the settings." #: src/components/products/ProductDetails/ExistingProductDetails.tsx:109 msgid "There is no product by provided id: {id}" @@ -7019,6 +7128,21 @@ msgstr "To" msgid "To (including)" msgstr "To (including)" +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/paymentTermsValidation.ts:45 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/paymentTermsValidation.ts:57 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/paymentTermsValidation.ts:68 +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/paymentTermsValidation.ts:87 +msgid "To add a discount you need to fill out all the fields" +msgstr "To add a discount you need to fill out all the fields" + +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx:83 +msgid "To create a preset you need to fill out all the required fields" +msgstr "To create a preset you need to fill out all the required fields" + +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DiscountForm.tsx:90 +msgid "to get discount" +msgstr "to get discount" + #: src/components/userRoles/consts.ts:44 msgid "Todo task" msgstr "Todo task" @@ -7866,6 +7990,10 @@ msgstr "You can not create receivable with a type other than \"{invoice}\"" msgid "You can set a different period length and the date of issuance. The starting date cannot be updated." msgstr "You can set a different period length and the date of issuance. The starting date cannot be updated." +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/PaymentTermsForm.tsx:181 +msgid "You can set up to 2 early payment discounts per invoice." +msgstr "You can set up to 2 early payment discounts per invoice." + #: src/ui/DataGridEmptyState/GetNoRowsOverlay.tsx:72 msgid "You don’t have any {0} yet." msgstr "You don’t have any {0} yet." @@ -7919,6 +8047,14 @@ msgstr "You don't have permission to issue this document. Please, contact your s msgid "You don’t have permissions to view this page.<0/>Contact your system administrator for details." msgstr "You don’t have permissions to view this page.<0/>Contact your system administrator for details." +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DeletePaymentTerms.tsx:33 +msgid "You won't be able to use it to create new invoices, but it won't affect the existing invoices with this term and their future copies." +msgstr "You won't be able to use it to create new invoices, but it won't affect the existing invoices with this term and their future copies." + +#: src/components/receivables/InvoiceDetails/CreateReceivable/sections/components/PaymentTerms/DeletePaymentTerms.tsx:33 +#~ msgid "You won’t be able to use it to create new invoices, but it won’t affect the existing invoices with this term and their future copies." +#~ msgstr "You won’t be able to use it to create new invoices, but it won’t affect the existing invoices with this term and their future copies." + #: src/components/receivables/Financing/FinanceTab/FinanceWidget/FinanceLimits/FinanceLimits.tsx:97 msgid "Your remaining limit is the amount available to you for financing additional invoices" msgstr "Your remaining limit is the amount available to you for financing additional invoices" diff --git a/packages/sdk-react/src/mocks/paymentTerms/paymentTermsHandlers.ts b/packages/sdk-react/src/mocks/paymentTerms/paymentTermsHandlers.ts index daac68eae..26edc68ed 100644 --- a/packages/sdk-react/src/mocks/paymentTerms/paymentTermsHandlers.ts +++ b/packages/sdk-react/src/mocks/paymentTerms/paymentTermsHandlers.ts @@ -1,13 +1,98 @@ import { components } from '@/api'; import { paymentTermsFixtures } from '@/mocks/paymentTerms/paymentTermsFixtures'; +import { faker } from '@faker-js/faker'; -import { http, HttpResponse } from 'msw'; +import { http, HttpResponse, delay } from 'msw'; + +const paymentTermsPath = `*/payment_terms`; +const paymentTermsList = paymentTermsFixtures; + +interface ErrorResponse { + error: { + message: string; + }; +} export const paymentTermsHandlers = [ http.get<{}, undefined, components['schemas']['PaymentTermsListResponse']>( - `*/payment_terms`, + paymentTermsPath, () => { - return HttpResponse.json(paymentTermsFixtures); + return HttpResponse.json(paymentTermsList); + } + ), + + http.post< + {}, + components['schemas']['PaymentTermsCreatePayload'], + components['schemas']['PaymentTermsResponse'] + >(paymentTermsPath, async ({ request }) => { + const payload = await request.json(); + const createdPaymentTerm = { + id: faker.string.uuid(), + ...payload, + }; + + await delay(); + paymentTermsList.data?.push(createdPaymentTerm); + + return HttpResponse.json(createdPaymentTerm, { + status: 200, + }); + }), + + http.patch< + { id: string }, + components['schemas']['PaymentTermsUpdatePayload'], + components['schemas']['PaymentTermsResponse'] | ErrorResponse + >(`${paymentTermsPath}/:id`, async ({ request, params }) => { + const payload = await request.json(); + + await delay(); + + const paymentTermIndex = paymentTermsList.data?.findIndex( + (paymentTerm) => paymentTerm.id === params.id + ); + + if (!paymentTermsList.data) { + paymentTermsList.data = []; + } + + if (!paymentTermIndex) { + return HttpResponse.json( + { + error: { + message: 'Wrong paymentTerm id', + }, + }, + { + status: 403, + } + ); + } + + const { name, term_final } = paymentTermsList.data[paymentTermIndex] || {}; + const updatedPaymentTerm = { + ...payload, + name: payload.name || name, + term_final: payload.term_final || term_final, + id: params.id, + }; + + paymentTermsList.data[paymentTermIndex] = updatedPaymentTerm; + + return HttpResponse.json(updatedPaymentTerm, { + status: 200, + }); + }), + + http.delete<{ id: string }, {}>( + `${paymentTermsPath}/:id`, + async ({ params }) => { + paymentTermsList.data = paymentTermsList.data?.filter( + (paymentTerm) => paymentTerm.id !== params.id + ); + + return new HttpResponse(undefined, { status: 204 }); } ), ]; From ade3a0976109b3d5111b11b5e0f78e99bd9b5007 Mon Sep 17 00:00:00 2001 From: Marc Perez <marc.perez@monite.com> Date: Tue, 14 Jan 2025 18:11:29 +0100 Subject: [PATCH 44/49] Bump nanoid version --- package.json | 1 + yarn.lock | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6c85966c0..68a156ba1 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "cookie@npm:0.5.0": "0.7.2", "cookie@npm:^0.5.0": "0.7.2", "cookie@npm:0.6.0": "0.7.2", + "nanoid@npm:^3.3.6": "3.3.8", "ws": "^8.17.1" }, "packageManager": "yarn@4.4.0" diff --git a/yarn.lock b/yarn.lock index f31658aa3..37f5133a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19059,7 +19059,16 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.3.6, nanoid@npm:^3.3.7": +"nanoid@npm:3.3.8": + version: 3.3.8 + resolution: "nanoid@npm:3.3.8" + bin: + nanoid: bin/nanoid.cjs + checksum: 10/2d1766606cf0d6f47b6f0fdab91761bb81609b2e3d367027aff45e6ee7006f660fb7e7781f4a34799fe6734f1268eeed2e37a5fdee809ade0c2d4eb11b0f9c40 + languageName: node + linkType: hard + +"nanoid@npm:^3.3.7": version: 3.3.7 resolution: "nanoid@npm:3.3.7" bin: From 24f27196324366d1523781553d4dec3b6e4e28aa Mon Sep 17 00:00:00 2001 From: Marc Perez <marc.perez@monite.com> Date: Wed, 15 Jan 2025 09:41:35 +0100 Subject: [PATCH 45/49] Update expressjs --- packages/sdk-demo/package.json | 2 +- yarn.lock | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/sdk-demo/package.json b/packages/sdk-demo/package.json index a4bb6b91b..473261a77 100644 --- a/packages/sdk-demo/package.json +++ b/packages/sdk-demo/package.json @@ -64,7 +64,7 @@ "cross-env": "^7.0.3", "deepmerge": "~4.3.1", "eslint": "~8.57.0", - "express": "^4.21.1", + "express": "~4.21.2", "lodash-es": "~4.17.21", "nanoid": "~5.0.9", "node-fetch": "~3.3.1", diff --git a/yarn.lock b/yarn.lock index f31658aa3..8fe55220e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8515,7 +8515,7 @@ __metadata: cross-env: "npm:^7.0.3" deepmerge: "npm:~4.3.1" eslint: "npm:~8.57.0" - express: "npm:^4.21.1" + express: "npm:~4.21.2" lodash-es: "npm:~4.17.21" nanoid: "npm:~5.0.9" node-fetch: "npm:~3.3.1" @@ -14622,9 +14622,9 @@ __metadata: languageName: node linkType: hard -"express@npm:^4.21.1": - version: 4.21.1 - resolution: "express@npm:4.21.1" +"express@npm:~4.21.2": + version: 4.21.2 + resolution: "express@npm:4.21.2" dependencies: accepts: "npm:~1.3.8" array-flatten: "npm:1.1.1" @@ -14645,7 +14645,7 @@ __metadata: methods: "npm:~1.1.2" on-finished: "npm:2.4.1" parseurl: "npm:~1.3.3" - path-to-regexp: "npm:0.1.10" + path-to-regexp: "npm:0.1.12" proxy-addr: "npm:~2.0.7" qs: "npm:6.13.0" range-parser: "npm:~1.2.1" @@ -14657,7 +14657,7 @@ __metadata: type-is: "npm:~1.6.18" utils-merge: "npm:1.0.1" vary: "npm:~1.1.2" - checksum: 10/5d4a36dd03c1d1cce93172e9b185b5cd13a978d29ee03adc51cd278be7b4a514ae2b63e2fdaec0c00fdc95c6cfb396d9dd1da147917ffd337d6cd0778e08c9bc + checksum: 10/34571c442fc8c9f2c4b442d2faa10ea1175cf8559237fc6a278f5ce6254a8ffdbeb9a15d99f77c1a9f2926ab183e3b7ba560e3261f1ad4149799e3412ab66bd1 languageName: node linkType: hard @@ -19974,6 +19974,13 @@ __metadata: languageName: node linkType: hard +"path-to-regexp@npm:0.1.12": + version: 0.1.12 + resolution: "path-to-regexp@npm:0.1.12" + checksum: 10/2e30f6a0144679c1f95c98e166b96e6acd1e72be9417830fefc8de7ac1992147eb9a4c7acaa59119fb1b3c34eec393b2129ef27e24b2054a3906fc4fb0d1398e + languageName: node + linkType: hard + "path-to-regexp@npm:^6.3.0": version: 6.3.0 resolution: "path-to-regexp@npm:6.3.0" From 7e88ed2963dd2948b102da358c599d1fd76ad302 Mon Sep 17 00:00:00 2001 From: Marc Perez <marc.perez@monite.com> Date: Wed, 15 Jan 2025 09:42:34 +0100 Subject: [PATCH 46/49] Add resolution for path-to-regexp --- package.json | 1 + yarn.lock | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/package.json b/package.json index 6c85966c0..d6f9fffb0 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "micromatch@npm:4.0.2": "4.0.8", "vite@npm:5.1.8/rollup": "4.22.4", "tsup@npm:8.0.2/rollup": "4.22.4", + "path-to-regexp@npm:0.1.10": "0.1.12", "cookie@npm:0.5.0": "0.7.2", "cookie@npm:^0.5.0": "0.7.2", "cookie@npm:0.6.0": "0.7.2", diff --git a/yarn.lock b/yarn.lock index 8fe55220e..2e5480d01 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19967,13 +19967,6 @@ __metadata: languageName: node linkType: hard -"path-to-regexp@npm:0.1.10": - version: 0.1.10 - resolution: "path-to-regexp@npm:0.1.10" - checksum: 10/894e31f1b20e592732a87db61fff5b95c892a3fe430f9ab18455ebe69ee88ef86f8eb49912e261f9926fc53da9f93b46521523e33aefd9cb0a7b0d85d7096006 - languageName: node - linkType: hard - "path-to-regexp@npm:0.1.12": version: 0.1.12 resolution: "path-to-regexp@npm:0.1.12" From 4990f7404fe86059951066ab5cdfe1079ae194e3 Mon Sep 17 00:00:00 2001 From: Marc Perez <marc.perez@monite.com> Date: Wed, 15 Jan 2025 17:09:31 +0100 Subject: [PATCH 47/49] Remove nanoid 3.3.7 --- yarn.lock | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/yarn.lock b/yarn.lock index 37f5133a6..2a2f3576a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19059,7 +19059,7 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:3.3.8": +"nanoid@npm:3.3.8, nanoid@npm:^3.3.7": version: 3.3.8 resolution: "nanoid@npm:3.3.8" bin: @@ -19068,15 +19068,6 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.3.7": - version: 3.3.7 - resolution: "nanoid@npm:3.3.7" - bin: - nanoid: bin/nanoid.cjs - checksum: 10/ac1eb60f615b272bccb0e2b9cd933720dad30bf9708424f691b8113826bb91aca7e9d14ef5d9415a6ba15c266b37817256f58d8ce980c82b0ba3185352565679 - languageName: node - linkType: hard - "nanoid@npm:~5.0.9": version: 5.0.9 resolution: "nanoid@npm:5.0.9" From c88cc85ce5894b6990bf7d17049b5c38c997306e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 08:25:11 +0000 Subject: [PATCH 48/49] chore(deps-dev): bump vite from 5.4.9 to 5.4.12 Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.9 to 5.4.12. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v5.4.12/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.4.12/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> --- packages/sdk-demo/package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/sdk-demo/package.json b/packages/sdk-demo/package.json index 473261a77..ee7148d92 100644 --- a/packages/sdk-demo/package.json +++ b/packages/sdk-demo/package.json @@ -78,7 +78,7 @@ "sass": "^1.52.1", "ts-node": "~10.9.1", "typescript": "~5.5.4", - "vite": "~5.4.9", + "vite": "~5.4.12", "web-vitals": "^2.1.4", "yup": "~0.32.11" }, diff --git a/yarn.lock b/yarn.lock index 3f84f26a4..61a31cd7f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8529,7 +8529,7 @@ __metadata: sass: "npm:^1.52.1" ts-node: "npm:~10.9.1" typescript: "npm:~5.5.4" - vite: "npm:~5.4.9" + vite: "npm:~5.4.12" vite-plugin-html-config: "npm:~2.0.2" web-vitals: "npm:^2.1.4" yup: "npm:~0.32.11" @@ -25111,9 +25111,9 @@ __metadata: languageName: node linkType: hard -"vite@npm:~5.4.9": - version: 5.4.9 - resolution: "vite@npm:5.4.9" +"vite@npm:~5.4.12": + version: 5.4.14 + resolution: "vite@npm:5.4.14" dependencies: esbuild: "npm:^0.21.3" fsevents: "npm:~2.3.3" @@ -25150,7 +25150,7 @@ __metadata: optional: true bin: vite: bin/vite.js - checksum: 10/60dfb3912ba6367d2d128e798d899caae3f4ec58990657b9f679c4d9de21ddec7eba5f6ad3d4fa0e8ea31771d477521b8e757a622ecc54829d73cb7f7c146bc4 + checksum: 10/ce382f4059eb6c939823b8f62163794752243755d84c71a4b73ad0f7d4d9f4c7a557a6ef4c78e0640f4bcf5ae5ec6b20c7ee4816419af3c81ba275f478b73468 languageName: node linkType: hard From 7d83ff34f989b98d2314164a3bcbcc5da4415454 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 18:49:44 +0000 Subject: [PATCH 49/49] chore(deps-dev): bump vite from 5.1.8 to 5.4.12 Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.1.8 to 5.4.12. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v5.4.12/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.4.12/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> --- packages/sdk-drop-in/package.json | 2 +- yarn.lock | 46 ++----------------------------- 2 files changed, 4 insertions(+), 44 deletions(-) diff --git a/packages/sdk-drop-in/package.json b/packages/sdk-drop-in/package.json index db0eab3b5..ac42f73cd 100644 --- a/packages/sdk-drop-in/package.json +++ b/packages/sdk-drop-in/package.json @@ -71,7 +71,7 @@ "react-use": "^17.3.2", "rimraf": "~5.0.0", "typescript": "~5.5.4", - "vite": "~5.1.8" + "vite": "~5.4.12" }, "dependencies": { "@monite/sdk-api": "workspace:~" diff --git a/yarn.lock b/yarn.lock index 61a31cd7f..d0ee6973a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4942,7 +4942,7 @@ __metadata: react-use: "npm:^17.3.2" rimraf: "npm:~5.0.0" typescript: "npm:~5.5.4" - vite: "npm:~5.1.8" + vite: "npm:~5.4.12" languageName: unknown linkType: soft @@ -13817,7 +13817,7 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.19.2, esbuild@npm:^0.19.3": +"esbuild@npm:^0.19.2": version: 0.19.12 resolution: "esbuild@npm:0.19.12" dependencies: @@ -20710,7 +20710,7 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.2.14, postcss@npm:^8.4.21, postcss@npm:^8.4.35": +"postcss@npm:^8.2.14, postcss@npm:^8.4.21": version: 8.4.35 resolution: "postcss@npm:8.4.35" dependencies: @@ -25071,46 +25071,6 @@ __metadata: languageName: node linkType: hard -"vite@npm:~5.1.8": - version: 5.1.8 - resolution: "vite@npm:5.1.8" - dependencies: - esbuild: "npm:^0.19.3" - fsevents: "npm:~2.3.3" - postcss: "npm:^8.4.35" - rollup: "npm:^4.2.0" - peerDependencies: - "@types/node": ^18.0.0 || >=20.0.0 - less: "*" - lightningcss: ^1.21.0 - sass: "*" - stylus: "*" - sugarss: "*" - terser: ^5.4.0 - dependenciesMeta: - fsevents: - optional: true - peerDependenciesMeta: - "@types/node": - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - bin: - vite: bin/vite.js - checksum: 10/94fedbcf083849eef359c785c67b4160e5a994978a13693b5cc32ddef1a2652de2adb21a77c801f09aa04ab4c22bd1335307f1b8efdd68567866407994ace0ac - languageName: node - linkType: hard - "vite@npm:~5.4.12": version: 5.4.14 resolution: "vite@npm:5.4.14"