user-status: добавлены методы index и set

This commit is contained in:
ruslan
2023-02-20 09:08:34 +02:00
parent 72b63356a7
commit 2d8b1de4b7
+146 -5
View File
@@ -15,13 +15,16 @@ info:
email: yuriy@hrbox.io
# host: api.hrbox.io
# basePath: /api/v1
tags:
- name: user-group
description: User groups
- name: user
description: Users
- name: user-status
description: User statuses
# schemes:
# - http
paths:
/user-group:
get:
@@ -51,7 +54,7 @@ paths:
type: object
properties:
_meta:
$ref: '#/definitions/meta'
$ref: '#/definitions/_meta'
data:
type: array
items:
@@ -249,7 +252,7 @@ paths:
type: object
properties:
_meta:
$ref: '#/definitions/meta'
$ref: '#/definitions/_meta'
data:
type: array
items:
@@ -398,6 +401,104 @@ paths:
500:
description: Server Error
/user-status:
get:
tags:
- user-status
summary: Get user statuses list.
operationId: actionIndex
consumes:
- application/json
produces:
- application/json
parameters:
- name: per-page
description: How many items return in one page.
in: query
type: integer
default: 20
- name: page
description: The current page.
in: query
type: integer
default: 1
responses:
200:
description: Returns list of available user statuses.
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/definitions/userStatus'
_links:
$ref: '#/definitions/_links'
_meta:
$ref: '#/definitions/_meta'
401:
description: Unauthorized.
403:
description: Forbidden.
500:
description: Internal Server Error.
/user-status/set:
post:
tags:
- user-status
summary: Change user status.
operationId: actionSet
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
type: object
properties:
org_employment_id:
type: string
format: uuid
description: Organization employment ID.
status_id:
type: string
description: An existing status ID or slug (send slug if it presented). The list of statuses can be obtained using the "/user-status/index" method.
is_active:
type: boolean
description: Set status activity.
expire_at:
type: string
format: date
description: Required when setting the status if the status has date-limited option enabled (is_expire = true). The expire_at date must be greater than the current date.
responses:
200:
description: Returns a success result.
schema:
type: object
properties:
data:
type: object
properties:
success:
type: boolean
status:
type: integer
example: 200
400:
description: Bad Request. Returns a message with the error details.
401:
description: Unauthorized.
403:
description: Forbidden.
404:
description: Not found. Returns a message with the error details.
500:
description: Internal Server Error.
definitions:
user:
@@ -538,7 +639,47 @@ definitions:
- 'JC'
- 'JNC'
meta:
userStatus:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
slug:
type: string
is_custom:
type: boolean
is_editable:
type: boolean
is_expire:
type: boolean
display_in_modal:
type: boolean
labelColorHEX:
type: string
_links:
type: object
properties:
self:
type: object
properties:
href:
type: string
first:
type: object
properties:
href:
type: string
last:
type: object
properties:
href:
type: string
_meta:
type: object
properties:
totalCount: