From ff83ae45dc2015c3445dd041c25072269d098a8b Mon Sep 17 00:00:00 2001 From: DenisEzhov Date: Mon, 24 Jun 2019 15:51:53 +0300 Subject: [PATCH] models --- gulpfile.js | 2 +- spec/definitions/ClaimChangeset.yaml | 4 ++++ spec/definitions/ClaimModification.yaml | 8 ++++++++ spec/definitions/CommentCreated.yaml | 1 + spec/definitions/CommentModification.yaml | 4 ++++ spec/definitions/CommentModificationUnit.yaml | 12 ++++++++++++ spec/definitions/ContractModification.yaml | 4 ++++ spec/definitions/ContractModificationUnit.yaml | 12 ++++++++++++ spec/definitions/ContractParams.yaml | 8 ++++++++ spec/definitions/ContractTemplateRef.yaml | 6 ++++++ spec/definitions/DocumentCreated.yaml | 1 + spec/definitions/DocumentModification.yaml | 4 ++++ spec/definitions/DocumentModificationUnit.yaml | 12 ++++++++++++ spec/definitions/FileCreated.yaml | 1 + spec/definitions/FileModification.yaml | 4 ++++ spec/definitions/FileModificationUnit.yaml | 12 ++++++++++++ spec/definitions/InvalidChangeset.yaml | 14 ++++++++++++++ spec/definitions/Modification.yaml | 7 +++++++ spec/definitions/ModificationUnit.yaml | 16 ++++++++++++++++ spec/definitions/PartyModification.yaml | 8 ++++++++ spec/definitions/PaymentInstitutionRef.yaml | 6 ++++++ spec/swagger.yaml | 2 +- web/index.html | 2 +- 23 files changed, 147 insertions(+), 3 deletions(-) create mode 100644 spec/definitions/ClaimChangeset.yaml create mode 100644 spec/definitions/ClaimModification.yaml create mode 100644 spec/definitions/CommentCreated.yaml create mode 100644 spec/definitions/CommentModification.yaml create mode 100644 spec/definitions/CommentModificationUnit.yaml create mode 100644 spec/definitions/ContractModification.yaml create mode 100644 spec/definitions/ContractModificationUnit.yaml create mode 100644 spec/definitions/ContractParams.yaml create mode 100644 spec/definitions/ContractTemplateRef.yaml create mode 100644 spec/definitions/DocumentCreated.yaml create mode 100644 spec/definitions/DocumentModification.yaml create mode 100644 spec/definitions/DocumentModificationUnit.yaml create mode 100644 spec/definitions/FileCreated.yaml create mode 100644 spec/definitions/FileModification.yaml create mode 100644 spec/definitions/FileModificationUnit.yaml create mode 100644 spec/definitions/InvalidChangeset.yaml create mode 100644 spec/definitions/Modification.yaml create mode 100644 spec/definitions/ModificationUnit.yaml create mode 100644 spec/definitions/PartyModification.yaml create mode 100644 spec/definitions/PaymentInstitutionRef.yaml diff --git a/gulpfile.js b/gulpfile.js index 13b5ba7..aa061c1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,5 +1,5 @@ var gulp = require('gulp'); -var util = require('gulp-util') +var util = require('gulp-util'); var gulpConnect = require('gulp-connect'); var connect = require('connect'); var cors = require('cors'); diff --git a/spec/definitions/ClaimChangeset.yaml b/spec/definitions/ClaimChangeset.yaml new file mode 100644 index 0000000..c28e900 --- /dev/null +++ b/spec/definitions/ClaimChangeset.yaml @@ -0,0 +1,4 @@ +description: Набор изменений +type: array +items: + $ref: '#/definitions/ModificationUnit' diff --git a/spec/definitions/ClaimModification.yaml b/spec/definitions/ClaimModification.yaml new file mode 100644 index 0000000..253669b --- /dev/null +++ b/spec/definitions/ClaimModification.yaml @@ -0,0 +1,8 @@ +type: object +properties: + documentModification: + $ref: '#/definitions/DocumentModificationUnit' + fileModification: + $ref: '#/definitions/FileModificationUnit' + commentModification: + $ref: '#/definitions/CommentModificationUnit' diff --git a/spec/definitions/CommentCreated.yaml b/spec/definitions/CommentCreated.yaml new file mode 100644 index 0000000..91bf309 --- /dev/null +++ b/spec/definitions/CommentCreated.yaml @@ -0,0 +1 @@ +type: object diff --git a/spec/definitions/CommentModification.yaml b/spec/definitions/CommentModification.yaml new file mode 100644 index 0000000..bce4e81 --- /dev/null +++ b/spec/definitions/CommentModification.yaml @@ -0,0 +1,4 @@ +type: object +properties: + creation: + $ref: '#/definitions/CommentCreated' diff --git a/spec/definitions/CommentModificationUnit.yaml b/spec/definitions/CommentModificationUnit.yaml new file mode 100644 index 0000000..a4173f7 --- /dev/null +++ b/spec/definitions/CommentModificationUnit.yaml @@ -0,0 +1,12 @@ +type: object +required: + - id + - modification +properties: + id: + description: Идентификатор комментария + type: string + maxLength: 40 + minLength: 1 + modification: + $ref: '#/definitions/CommentModification' diff --git a/spec/definitions/ContractModification.yaml b/spec/definitions/ContractModification.yaml new file mode 100644 index 0000000..f78b523 --- /dev/null +++ b/spec/definitions/ContractModification.yaml @@ -0,0 +1,4 @@ +type: object +properties: + creation: + $ref: '#/definitions/ContractParams' diff --git a/spec/definitions/ContractModificationUnit.yaml b/spec/definitions/ContractModificationUnit.yaml new file mode 100644 index 0000000..0dd665c --- /dev/null +++ b/spec/definitions/ContractModificationUnit.yaml @@ -0,0 +1,12 @@ +type: object +required: + - id + - modification +properties: + id: + description: Идентификатор договора + type: string + maxLength: 40 + minLength: 1 + modification: + $ref: '#/definitions/ContractModification' diff --git a/spec/definitions/ContractParams.yaml b/spec/definitions/ContractParams.yaml new file mode 100644 index 0000000..e3b9d04 --- /dev/null +++ b/spec/definitions/ContractParams.yaml @@ -0,0 +1,8 @@ +type: object +properties: + contractorID: + type: string + template: + $ref: '#/definitions/ContractTemplateRef' + paymentInstitution: + $ref: '#/definitions/PaymentInstitutionRef' diff --git a/spec/definitions/ContractTemplateRef.yaml b/spec/definitions/ContractTemplateRef.yaml new file mode 100644 index 0000000..862a9c4 --- /dev/null +++ b/spec/definitions/ContractTemplateRef.yaml @@ -0,0 +1,6 @@ +type: object +required: + - id +properties: + id: + type: i32 diff --git a/spec/definitions/DocumentCreated.yaml b/spec/definitions/DocumentCreated.yaml new file mode 100644 index 0000000..91bf309 --- /dev/null +++ b/spec/definitions/DocumentCreated.yaml @@ -0,0 +1 @@ +type: object diff --git a/spec/definitions/DocumentModification.yaml b/spec/definitions/DocumentModification.yaml new file mode 100644 index 0000000..a25adfd --- /dev/null +++ b/spec/definitions/DocumentModification.yaml @@ -0,0 +1,4 @@ +type: object +properties: + creation: + $ref: '#/definitions/DocumentCreated' diff --git a/spec/definitions/DocumentModificationUnit.yaml b/spec/definitions/DocumentModificationUnit.yaml new file mode 100644 index 0000000..0cd5cd7 --- /dev/null +++ b/spec/definitions/DocumentModificationUnit.yaml @@ -0,0 +1,12 @@ +type: object +required: + - id + - modification +properties: + id: + description: Идентификатор документа + type: string + maxLength: 40 + minLength: 1 + modification: + $ref: '#/definitions/DocumentModification' diff --git a/spec/definitions/FileCreated.yaml b/spec/definitions/FileCreated.yaml new file mode 100644 index 0000000..91bf309 --- /dev/null +++ b/spec/definitions/FileCreated.yaml @@ -0,0 +1 @@ +type: object diff --git a/spec/definitions/FileModification.yaml b/spec/definitions/FileModification.yaml new file mode 100644 index 0000000..1f208d9 --- /dev/null +++ b/spec/definitions/FileModification.yaml @@ -0,0 +1,4 @@ +type: object +properties: + creation: + $ref: '#/definitions/FileCreated' diff --git a/spec/definitions/FileModificationUnit.yaml b/spec/definitions/FileModificationUnit.yaml new file mode 100644 index 0000000..83b0ab5 --- /dev/null +++ b/spec/definitions/FileModificationUnit.yaml @@ -0,0 +1,12 @@ +type: object +required: + - id + - modification +properties: + id: + description: Идентификатор файла + type: string + maxLength: 40 + minLength: 1 + modification: + $ref: '#/definitions/FileModification' diff --git a/spec/definitions/InvalidChangeset.yaml b/spec/definitions/InvalidChangeset.yaml new file mode 100644 index 0000000..0857d8b --- /dev/null +++ b/spec/definitions/InvalidChangeset.yaml @@ -0,0 +1,14 @@ +description: Невалидный набор изменений +type: object +required: + - reason + - invalid_changesets +properties: + reason: + description: Причина + type: string + invalid_changesets: + description: Список невалидных наборов изменений + type: array + items: + $ref: '#/definitions/ClaimChangeset' diff --git a/spec/definitions/Modification.yaml b/spec/definitions/Modification.yaml new file mode 100644 index 0000000..0db8aec --- /dev/null +++ b/spec/definitions/Modification.yaml @@ -0,0 +1,7 @@ +description: Изменение +type: object +properties: + partyModification: + $ref: '#/definitions/PartyModification' + claimModification: + $ref: '#/definitions/ClaimModification' diff --git a/spec/definitions/ModificationUnit.yaml b/spec/definitions/ModificationUnit.yaml new file mode 100644 index 0000000..0859781 --- /dev/null +++ b/spec/definitions/ModificationUnit.yaml @@ -0,0 +1,16 @@ +description: ModificationUnit +type: object +required: + - modificationID + - createdAt + - modification +properties: + modificationID: + description: Идентификатор изменения + type: i64 + createdAt: + description: Дата и время создания + type: string + format: date-time + modification: + $ref: '#/definitions/Modification' diff --git a/spec/definitions/PartyModification.yaml b/spec/definitions/PartyModification.yaml new file mode 100644 index 0000000..39baf5b --- /dev/null +++ b/spec/definitions/PartyModification.yaml @@ -0,0 +1,8 @@ +type: object +properties: + contractorModification: + $ref: '#/definitions/ContractorModificationUnit' + contractModification: + $ref: '#/definitions/ContractModificationUnit' + shopModification: + $ref: '#/definitions/ShopModificationUnit' diff --git a/spec/definitions/PaymentInstitutionRef.yaml b/spec/definitions/PaymentInstitutionRef.yaml new file mode 100644 index 0000000..862a9c4 --- /dev/null +++ b/spec/definitions/PaymentInstitutionRef.yaml @@ -0,0 +1,6 @@ +type: object +required: + - id +properties: + id: + type: i32 diff --git a/spec/swagger.yaml b/spec/swagger.yaml index 546a8c0..c1d3ed1 100644 --- a/spec/swagger.yaml +++ b/spec/swagger.yaml @@ -147,4 +147,4 @@ tags: - name: Questionary x-displayName: Управление анкетами - description: "" \ No newline at end of file + description: "" diff --git a/web/index.html b/web/index.html index 3e9cbba..0f88180 100644 --- a/web/index.html +++ b/web/index.html @@ -27,7 +27,7 @@ // simple way to redirect user to one or another var spec = window.location.search.substring(1); if (spec.length == 0) { - spec = "api/swag-dark-api/spec/swagger.json"; + spec = "./swagger.json"; } Redoc.init( spec,