diff --git a/spec/definitions/Country.yaml b/spec/definitions/Country.yaml new file mode 100644 index 0000000..b94cb44 --- /dev/null +++ b/spec/definitions/Country.yaml @@ -0,0 +1,17 @@ +description: 'Страна' +type: object +required: + - id + - name +properties: + id: + x-rebillyMerge: + - $ref: '#/definitions/CountryCode' + name: + type: string + maxLength: 200 + tradeBlocs: + type: array + items: + description: Идентификаторы Торговых Блоков + type: string diff --git a/spec/definitions/CountryCode.yaml b/spec/definitions/CountryCode.yaml new file mode 100644 index 0000000..688320d --- /dev/null +++ b/spec/definitions/CountryCode.yaml @@ -0,0 +1,4 @@ +description: 'Alpha-3 код страны по стандарту [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1)' +type: string +pattern: '^[A-Z]{3}$' +example: "RUS" diff --git a/spec/definitions/InternationalBankDetails.yaml b/spec/definitions/InternationalBankDetails.yaml index 1c6a4bb..926bd61 100644 --- a/spec/definitions/InternationalBankDetails.yaml +++ b/spec/definitions/InternationalBankDetails.yaml @@ -29,14 +29,10 @@ properties: RAIFFEISEN BANK INTERNATIONAL AG countryCode: x-rebillyMerge: - - $ref: '#/definitions/Residence' + - $ref: '#/definitions/CountryCode' - description: | - Страна резиденции банковской организации, + Код страны резиденции банковской организации, обозначается alpha-3 код по стандарту [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) - type: string - # readOnly: true - pattern: '^[A-Z]{2}$' - example: "AT" address: description: Адрес юридического лица банковской организации type: string diff --git a/spec/definitions/InternationalLegalEntity.yaml b/spec/definitions/InternationalLegalEntity.yaml index bdee0bc..dbaa59f 100644 --- a/spec/definitions/InternationalLegalEntity.yaml +++ b/spec/definitions/InternationalLegalEntity.yaml @@ -23,3 +23,6 @@ allOf: description: Регистрационный номер type: string maxLength: 100 + country: + x-rebillyMerge: + - $ref: '#/definitions/CountryCode' diff --git a/spec/definitions/PaymentInstitution.yaml b/spec/definitions/PaymentInstitution.yaml index 12197ad..827c302 100644 --- a/spec/definitions/PaymentInstitution.yaml +++ b/spec/definitions/PaymentInstitution.yaml @@ -19,7 +19,7 @@ properties: type: array items: x-rebillyMerge: - - $ref: '#/definitions/Residence' + - $ref: '#/definitions/CountryCode' realm: x-rebillyMerge: - $ref: '#/definitions/RealmMode' diff --git a/spec/definitions/Residence.yaml b/spec/definitions/Residence.yaml deleted file mode 100644 index 87e8e04..0000000 --- a/spec/definitions/Residence.yaml +++ /dev/null @@ -1,4 +0,0 @@ -description: 'Резиденция, alpha-3 код по стандарту [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1)' -type: string -pattern: '^[A-Z]{3}$' -example: "RUS" diff --git a/spec/definitions/TradeBloc.yaml b/spec/definitions/TradeBloc.yaml new file mode 100644 index 0000000..3bc0907 --- /dev/null +++ b/spec/definitions/TradeBloc.yaml @@ -0,0 +1,14 @@ +description: Торговый Блок +type: object +required: + - id + - name +properties: + id: + type: string + name: + type: string + maxLength: 200 + description: + type: string + maxLength: 1000 diff --git a/spec/paths/processing@countries.yaml b/spec/paths/processing@countries.yaml new file mode 100644 index 0000000..42af050 --- /dev/null +++ b/spec/paths/processing@countries.yaml @@ -0,0 +1,17 @@ +get: + description: Получить список стран + tags: + - Countries + operationId: getCountries + parameters: + - $ref: '#/parameters/requestID' + - $ref: '#/parameters/deadline' + responses: + '200': + description: Список стран + schema: + type: array + items: + $ref: '#/definitions/Country' + '400': + $ref: '#/responses/DefaultLogicError' diff --git a/spec/paths/processing@countries@{countryID}.yaml b/spec/paths/processing@countries@{countryID}.yaml new file mode 100644 index 0000000..63cd781 --- /dev/null +++ b/spec/paths/processing@countries@{countryID}.yaml @@ -0,0 +1,18 @@ +get: + description: Получить данные страны по ее ID + tags: + - Countries + operationId: getCountryByID + parameters: + - $ref: '#/parameters/requestID' + - $ref: '#/parameters/deadline' + - $ref: '#/parameters/countryID' + responses: + '200': + description: Страна найдена + schema: + $ref: '#/definitions/Country' + '404': + $ref: '#/responses/NotFound' + '400': + $ref: '#/responses/DefaultLogicError' diff --git a/spec/paths/processing@tradeblocs.yaml b/spec/paths/processing@tradeblocs.yaml new file mode 100644 index 0000000..f1e2b42 --- /dev/null +++ b/spec/paths/processing@tradeblocs.yaml @@ -0,0 +1,17 @@ +get: + description: Получить список торговых блоков + tags: + - TradeBlocs + operationId: getTradeBlocs + parameters: + - $ref: '#/parameters/requestID' + - $ref: '#/parameters/deadline' + responses: + '200': + description: Список Торговых Блоков + schema: + type: array + items: + $ref: '#/definitions/TradeBloc' + '400': + $ref: '#/responses/DefaultLogicError' diff --git a/spec/paths/processing@tradeblocs@{tradeBlocID}.yaml b/spec/paths/processing@tradeblocs@{tradeBlocID}.yaml new file mode 100644 index 0000000..5cac40d --- /dev/null +++ b/spec/paths/processing@tradeblocs@{tradeBlocID}.yaml @@ -0,0 +1,18 @@ +get: + description: Получить данные торгового блока по его ID + tags: + - PaymentInstitutions + operationId: getTradeBlocByID + parameters: + - $ref: '#/parameters/requestID' + - $ref: '#/parameters/deadline' + - $ref: '#/parameters/tradeBlocID' + responses: + '200': + description: Торговый Блок найден + schema: + $ref: '#/definitions/TradeBloc' + '404': + $ref: '#/responses/NotFound' + '400': + $ref: '#/responses/DefaultLogicError' diff --git a/spec/swagger.yaml b/spec/swagger.yaml index 443c850..0936818 100644 --- a/spec/swagger.yaml +++ b/spec/swagger.yaml @@ -355,6 +355,19 @@ parameters: description: Уникальный в рамках платформы идентификатор участника. # TODO: rephrase required: true type: string + countryID: + name: countryID + in: path + required: true + description: 'Alpha-3 код страны по стандарту [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1)' + type: string + pattern: '^[A-Z]{3}$' + tradeBlocID: + name: tradeBlocID + in: path + description: Идентификатор торгового блока + required: true + type: string tags: - name: Parties x-displayName: Участники