From 46d5dc527e06964030011a9feb2e73bdded60d50 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogov Date: Tue, 30 Mar 2021 13:51:08 +0300 Subject: [PATCH] ED-81+ED-92+ED-93+ED-94/feat: Add external ids Add optional external ID to entity params. Add ExternalIDConflict responses --- spec/definitions/CustomerBindingParams.yaml | 4 ++++ spec/definitions/CustomerParams.yaml | 21 +++++++++++++++++++ spec/definitions/InvoiceParams.yaml | 1 + .../InvoiceTemplateCreateParams.yaml | 4 ++++ spec/paths/processing@customers.yaml | 4 +++- ...ssing@customers@{customerID}@bindings.yaml | 2 ++ spec/paths/processing@invoice-templates.yaml | 2 ++ 7 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 spec/definitions/CustomerParams.yaml diff --git a/spec/definitions/CustomerBindingParams.yaml b/spec/definitions/CustomerBindingParams.yaml index e46c830..b635907 100644 --- a/spec/definitions/CustomerBindingParams.yaml +++ b/spec/definitions/CustomerBindingParams.yaml @@ -2,5 +2,9 @@ type: object required: - paymentResource properties: + externalID: + x-rebillyMerge: + - $ref: '#/definitions/ExternalID' + - description: Внешний идентификатор привязки paymentResource: $ref: '#/definitions/PaymentResource' diff --git a/spec/definitions/CustomerParams.yaml b/spec/definitions/CustomerParams.yaml new file mode 100644 index 0000000..de4fbb8 --- /dev/null +++ b/spec/definitions/CustomerParams.yaml @@ -0,0 +1,21 @@ +type: object +required: + - shopID + - contactInfo + - metadata +properties: + externalID: + x-rebillyMerge: + - $ref: '#/definitions/ExternalID' + - description: Внешний идентификатор плательщика + shopID: + description: Идентификатор магазина + type: string + partyID: + x-rebillyMerge: + - $ref: '#/definitions/PartyID' + contactInfo: + $ref: '#/definitions/ContactInfo' + metadata: + description: Связанные с плательщиком метаданные + type: object diff --git a/spec/definitions/InvoiceParams.yaml b/spec/definitions/InvoiceParams.yaml index fd33cca..5045580 100644 --- a/spec/definitions/InvoiceParams.yaml +++ b/spec/definitions/InvoiceParams.yaml @@ -17,6 +17,7 @@ properties: externalID: x-rebillyMerge: - $ref: '#/definitions/ExternalID' + - description: Внешний идентификатор инвойса dueDate: description: | Дата и время окончания действия инвойса, после наступления которых его diff --git a/spec/definitions/InvoiceTemplateCreateParams.yaml b/spec/definitions/InvoiceTemplateCreateParams.yaml index 4adbaff..716b515 100644 --- a/spec/definitions/InvoiceTemplateCreateParams.yaml +++ b/spec/definitions/InvoiceTemplateCreateParams.yaml @@ -9,6 +9,10 @@ properties: type: string maxLength: 40 minLength: 1 + externalID: + x-rebillyMerge: + - $ref: '#/definitions/ExternalID' + - description: Внешний идентификатор шаблона инвойса partyID: x-rebillyMerge: - $ref: '#/definitions/PartyID' diff --git a/spec/paths/processing@customers.yaml b/spec/paths/processing@customers.yaml index c2c45f0..c9ce720 100644 --- a/spec/paths/processing@customers.yaml +++ b/spec/paths/processing@customers.yaml @@ -11,7 +11,7 @@ post: in: body required: true schema: - $ref: '#/definitions/Customer' + $ref: '#/definitions/CustomerParams' responses: '201': description: Плательщик создан @@ -44,3 +44,5 @@ post: description: Человекочитаемое описание ошибки type: string example: Operation not permitted + '409': + $ref: '#/responses/ExternalIDConflict' diff --git a/spec/paths/processing@customers@{customerID}@bindings.yaml b/spec/paths/processing@customers@{customerID}@bindings.yaml index b9ba8de..ca94cef 100644 --- a/spec/paths/processing@customers@{customerID}@bindings.yaml +++ b/spec/paths/processing@customers@{customerID}@bindings.yaml @@ -47,6 +47,8 @@ post: description: Человекочитаемое описание ошибки type: string example: Invalid payment resource + '409': + $ref: '#/responses/ExternalIDConflict' get: description: Получить все привязки к плательщику. diff --git a/spec/paths/processing@invoice-templates.yaml b/spec/paths/processing@invoice-templates.yaml index dcfdcf6..228d3ea 100644 --- a/spec/paths/processing@invoice-templates.yaml +++ b/spec/paths/processing@invoice-templates.yaml @@ -44,3 +44,5 @@ post: description: Человекочитаемое описание ошибки type: string example: Lifetime cannot be zero + '409': + $ref: '#/responses/ExternalIDConflict'