diff --git a/v2/swagger.yaml b/v2/swagger.yaml index 0ee813e..1a0676c 100644 --- a/v2/swagger.yaml +++ b/v2/swagger.yaml @@ -39,6 +39,8 @@ tags: description: Methods for browsing and searching through Org Structure - name: user description: Methods for getting user and employment information + - name: employment + description: Methods for user employment - name: article description: Methods News, Categories and Articles - name: postcard @@ -397,6 +399,87 @@ paths: 500: description: Server Error. + /employment/index: + get: + tags: + - employment + summary: Get User's employments info + responses: + 200: + description: User employments data + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/fullEmployment' + _links: + $ref: '#/components/schemas/_links' + _meta: + $ref: '#/components/schemas/_meta' + + 401: + description: Unauthorized request + 403: + description: Unauthorized request + 404: + description: User not found + 500: + description: Server Error + /employment/set-main: + post: + tags: + - employment + summary: Set main employment + operationId: /calendar-event-request + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + employment_id: + type: string + format: uuid + description: User employment ID + responses: + 200: + description: User employments data + content: + application/json: + schema: + type: object + properties: + success: + description: Result status. + type: boolean + example: true + message: + description: Message displayed to user (localized). + type: string + default: null + example: { + "type": "success", + "text": "Запись установлена основной!" + } + errors: + description: Array of validation errors. + type: array + default: null + data: + type: object + default: null + 401: + description: Unauthorized request + 403: + description: Unauthorized request + 404: + description: User not found + 500: + description: Server Error + /user-group/items: get: tags: @@ -3293,6 +3376,10 @@ components: description: Office number employment: $ref: '#/components/schemas/employment' + employments: + type: array + items: + $ref: '#/components/schemas/employment' emails: type: array items: @@ -3835,6 +3922,30 @@ components: chiefUser: $ref: '#/components/schemas/userLabel' + fullEmployment: + type: object + allOf: + - $ref: '#/components/schemas/employment' + - type: object + properties: + is_main: + description: Is main employment + type: boolean + example: true + employment_date: + type: string + format: date + fired_date: + type: string + format: date + status_id: + type: integer + description: 1 - active, 2 - disabled, 3 - deleted + example: 1 + created_at: + type: string + format: date + departmentLabel: type: object properties: