diff --git a/docs/openapi.yaml b/docs/openapi.yaml index dcbd082..f8ce1bf 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -85,3 +85,151 @@ paths: description: NotAcceptable - срок действия ссылки для восстановления истек или она недействительна '500': description: Внутренняя ошибка сервера – разные причины + + /promocode/create: + post: + summary: Создать новый промокод + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PromoCodeRequest' + responses: + '201': + description: Новый промокод успешно создан + content: + application/json: + schema: + $ref: '#/components/schemas/PromoCodeResponse' + '400': + description: Invalid request payload / Duplicate Codeword + content: + application/json: + schema: + type: object + properties: + error: + type: string + '500': + description: Внутренняя ошибка сервера + content: + application/json: + schema: + type: object + properties: + error: + type: string + +components: + schemas: + PromoCodeRequest: + type: object + properties: + codeword: + type: string + description: Кодовое слово, которое должен ввести пользователь + description: + type: string + description: Описание, необходимое для администратора в панели управления + greetings: + type: string + description: Текст, который будет отправлен пользователю в ответ на активацию кода + dueTo: + type: integer + format: int64 + description: Временная метка окончания активации кода + activationCount: + type: integer + format: int64 + description: Лимит активации кода + bonus: + type: object + properties: + privilege: + type: object + properties: + privilegeID: + type: string + description: Идентификатор привилегии, которую необходимо предоставить + amount: + type: integer + format: uint64 + description: Размер привилегии + discount: + type: object + properties: + layer: + type: integer + factor: + type: number + target: + type: string + threshold: + type: integer + description: Информация о бонусах + outdated: + type: boolean + offLimit: + type: boolean + delete: + type: boolean + + PromoCodeResponse: + type: object + properties: + id: + type: string + description: ID созданного промокода + codeword: + type: string + description: Кодовое слово промокода + description: + type: string + description: Описание промокода + greetings: + type: string + description: Текст, который будет отправлен пользователю в ответ на активацию кода + dueTo: + type: integer + format: int64 + description: Временная метка окончания активации кода + activationCount: + type: integer + format: int64 + description: Лимит активации кода + bonus: + type: object + properties: + privilege: + type: object + properties: + privilegeID: + type: string + description: Идентификатор привилегии, которую необходимо предоставить + amount: + type: integer + format: uint64 + description: Размер привилегии + discount: + type: object + properties: + layer: + type: integer + factor: + type: number + target: + type: string + threshold: + type: integer + description: Информация о бонусах + outdated: + type: boolean + offLimit: + type: boolean + delete: + type: boolean + createdAt: + type: string + format: date-time + description: Время создания промокода \ No newline at end of file