From 1d773e18d9602b4ee581f10a9173816c1a7dab3f Mon Sep 17 00:00:00 2001 From: Zaptoss Date: Mon, 22 Jul 2024 19:25:59 +0300 Subject: [PATCH] Write docs --- docs/spec/components/schemas/FormStatus.yaml | 3 ++- .../paths/integrations@forms-svc@v1@form.yaml | 16 ++++++++-------- .../paths/integrations@forms-svc@v1@image.yaml | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/spec/components/schemas/FormStatus.yaml b/docs/spec/components/schemas/FormStatus.yaml index cbfd4b9..4e49699 100644 --- a/docs/spec/components/schemas/FormStatus.yaml +++ b/docs/spec/components/schemas/FormStatus.yaml @@ -14,8 +14,9 @@ allOf: properties: status: type: string - enum: [ accepted, processed ] + enum: [ created, accepted, processed ] description: | + Created - the empty form was created and now user can't use legacy submit Accepted - the data was saved by the service for further processing Processed - the data is processed and stored created_at: diff --git a/docs/spec/paths/integrations@forms-svc@v1@form.yaml b/docs/spec/paths/integrations@forms-svc@v1@form.yaml index 1fd89ca..7b290b6 100644 --- a/docs/spec/paths/integrations@forms-svc@v1@form.yaml +++ b/docs/spec/paths/integrations@forms-svc@v1@form.yaml @@ -3,13 +3,11 @@ post: - User form summary: Submit lightweight user answers description: | - Send user answers and return their current status. + Sending the filled form. Requires created empty form + linked to the name of the file with the photo. + Return form current status. - The image is a link to s3 storage - - Only a user with a confirmed passport can send the form ('verified: true' in JWT). - There is a configurable delay before the same user - can submit another form. + The image is a link to s3 storage operationId: lightweightSubmitForm security: - BearerAuth: [] @@ -34,11 +32,13 @@ post: $ref: '#/components/responses/invalidParameter' 401: $ref: '#/components/responses/invalidAuth' - 429: - description: "It is necessary to wait some time before sending the next form" + 403: + description: "Empty form absent for user, but already exists processed or accepted forms" content: application/vnd.api+json: schema: $ref: '#/components/schemas/Errors' + 404: + $ref: '#/components/responses/notFound' 500: $ref: '#/components/responses/internalError' diff --git a/docs/spec/paths/integrations@forms-svc@v1@image.yaml b/docs/spec/paths/integrations@forms-svc@v1@image.yaml index 3bacb8f..2ee6196 100644 --- a/docs/spec/paths/integrations@forms-svc@v1@image.yaml +++ b/docs/spec/paths/integrations@forms-svc@v1@image.yaml @@ -10,6 +10,7 @@ post: in S3 Storage. The name is generated on the server side. 'verified: true' must be specified in the JWT. The cooldown of this endpoint is the same as in the submit form. + This endpoint creates an empty form that can be submitted on `/form` operationId: uploadImage security: - BearerAuth: []