merch-api/docs/swagger.yaml
2026-03-20 16:13:25 +03:00

895 lines
23 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

basePath: /api/v2
definitions:
merch.DeleteZeroPrices:
properties:
id:
type: integer
merch_uuid:
type: string
type: object
merch.LabelDTO:
properties:
bg_color:
type: string
color:
type: string
name:
type: string
type: object
merch.LabelLink:
properties:
label_uuid:
type: string
merch_uuid:
type: string
type: object
merch.LabelsList:
properties:
bg_color:
type: string
color:
type: string
label_uuid:
type: string
name:
type: string
type: object
merch.OriginWithPrices:
properties:
origin:
type: string
prices:
items:
$ref: '#/definitions/merch.PriceEntry'
type: array
type: object
merch.PriceEntry:
properties:
created_at:
type: integer
value:
type: integer
type: object
merch.PricesResponse:
properties:
merch_uuid:
type: string
name:
type: string
origins:
items:
$ref: '#/definitions/merch.OriginWithPrices'
type: array
type: object
merch.ZeroPrice:
properties:
created_at:
type: string
id:
type: integer
merch_uuid:
type: string
name:
type: string
origin:
type: string
type: object
merch.deleteOriginDTO:
properties:
name:
type: string
type: object
merch.extraDataDTO:
properties:
links:
items:
$ref: '#/definitions/merch.originLink'
type: array
merch_uuid:
type: string
type: object
merch.listResponse:
properties:
labels:
items:
type: string
type: array
merch_uuid:
type: string
name:
type: string
type: object
merch.merchDTO:
properties:
created_at:
type: string
merch_uuid:
type: string
name:
type: string
updated_at:
type: string
type: object
merch.newMerchDTO:
properties:
links:
items:
$ref: '#/definitions/merch.originLink'
type: array
name:
type: string
type: object
merch.newOriginDTO:
properties:
name:
type: string
type: object
merch.originItem:
properties:
id:
type: integer
name:
type: string
type: object
merch.originLink:
properties:
origin:
type: string
origin_link:
type: string
type: object
merch.originsDTO:
properties:
origins:
items:
$ref: '#/definitions/merch.originItem'
type: array
type: object
merch.singleMerchResponse:
properties:
merch_uuid:
type: string
name:
type: string
origins:
items:
$ref: '#/definitions/merch.originLink'
type: array
type: object
merch.updateMerchDTO:
properties:
merch_uuid:
type: string
name:
type: string
type: object
responses.BadRequest:
properties:
error:
example: error
type: string
type: object
responses.InternalServerError:
properties:
error:
example: error
type: string
type: object
responses.Unauthorized:
properties:
error:
example: error
type: string
type: object
info:
contact: {}
description: Stores data about merch and prices
title: Merch API
version: "2.3"
paths:
/merch/{uuid}:
delete:
consumes:
- application/json
description: Marks merch and all its extra data as deleted by uuid.
parameters:
- description: merch uuid
in: path
name: uuid
required: true
type: string
responses:
"204":
description: No Content
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Delete merch
tags:
- Merch
get:
description: Получить всю информацию про мерч по его uuid
parameters:
- description: merch_uuid
in: path
name: uuid
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/merch.singleMerchResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Получить всю информацию про мерч
tags:
- Merch
put:
consumes:
- application/json
description: Update merch general info (except extra data)
parameters:
- description: merch uuid
in: path
name: uuid
required: true
type: string
- description: payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/merch.updateMerchDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/merch.merchDTO'
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Update merch
tags:
- Merch
/merch/create:
post:
consumes:
- application/json
description: Create new merch
parameters:
- description: merch body
in: body
name: merch
required: true
schema:
$ref: '#/definitions/merch.newMerchDTO'
responses:
"201":
description: Created
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Create new merch
tags:
- Merch
/merch/extra/{uuid}:
put:
consumes:
- application/json
description: Update ONLY merch extra data
parameters:
- description: merch uuid
in: path
name: uuid
required: true
type: string
- description: payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/merch.extraDataDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/merch.extraDataDTO'
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Update merch extra data
tags:
- Merch
/merch/labels:
get:
description: Получить все метки товаров
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/merch.LabelsList'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Получить все метки товаров
tags:
- Merch labels
post:
consumes:
- application/json
description: Создать новую метку для товара
parameters:
- description: payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/merch.LabelDTO'
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Создать новую метку для товара
tags:
- Merch labels
/merch/labels/{uuid}:
delete:
description: Пометить метку как удаленную
parameters:
- description: label uuid
in: path
name: uuid
required: true
type: string
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Пометить метку как удаленную
tags:
- Merch labels
get:
description: Получить метки товара по его uuid
parameters:
- description: label uuid
in: path
name: uuid
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Получить метки товара по его uuid
tags:
- Merch labels
put:
consumes:
- application/json
description: Изменить метку
parameters:
- description: label uuid
in: path
name: uuid
required: true
type: string
- description: payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/merch.LabelDTO'
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Изменить метку
tags:
- Merch labels
/merch/labels/attach:
post:
consumes:
- application/json
description: Прикрепить метку к товару
parameters:
- description: payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/merch.LabelLink'
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Прикрепить метку к товару
tags:
- Merch labels
/merch/labels/detach:
post:
consumes:
- application/json
description: Удалить привязку метки к товару
parameters:
- description: payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/merch.LabelLink'
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Удалить привязку метки к товару
tags:
- Merch labels
/merch/list:
get:
description: Get all merch without origins
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/merch.listResponse'
type: array
"204":
description: No Content
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Get all merch
tags:
- Merch
/merch/origins:
delete:
consumes:
- application/json
description: Marks origin as deleted by name.
parameters:
- description: origin body
in: body
name: origin
required: true
schema:
$ref: '#/definitions/merch.deleteOriginDTO'
responses:
"204":
description: No Content
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Delete origin
tags:
- Origins
get:
description: Get all origins
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/merch.originsDTO'
"204":
description: No Content
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Get all origins
tags:
- Origins
post:
consumes:
- application/json
description: Create new origin with name
parameters:
- description: origin body
in: body
name: origin
required: true
schema:
$ref: '#/definitions/merch.newOriginDTO'
responses:
"201":
description: Created
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Create new origin
tags:
- Origins
/merch/zeroprices:
delete:
consumes:
- application/json
description: Пометить нулевые цены как удаленные
parameters:
- description: payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/merch.DeleteZeroPrices'
responses:
"204":
description: No Content
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Пометить нулевые цены как удаленные
tags:
- Merch zero prices
get:
description: Получить нулевые цены
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/merch.ZeroPrice'
type: array
"204":
description: No Content
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Получить нулевые цены
tags:
- Merch zero prices
/merch/zeroprices/period:
delete:
description: Пометить нулевые цены как удаленные за указанный период
parameters:
- description: start
in: query
name: start
required: true
type: string
- description: end
in: query
name: end
required: true
type: string
responses:
"204":
description: No Content
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Пометить нулевые цены как удаленные за указанный период
tags:
- Merch zero prices
/prices:
get:
description: Получить цены мерча за период
parameters:
- description: period in days
in: query
name: days
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/merch.PricesResponse'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Получить цены мерча за период
tags:
- Merch
/prices/{uuid}:
get:
description: Получить перепады цен мерча за период по его merch_uuid
parameters:
- description: merch_uuid
in: path
name: uuid
required: true
type: string
- description: period in days
in: query
name: days
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/merch.PricesResponse'
"204":
description: No Content
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Получить перепады цен мерча за период по его merch_uuid
tags:
- Merch
/user:
delete:
consumes:
- application/json
description: Marks user as deleted by user uuid
responses:
"204":
description: No Content
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Delete user
tags:
- User
post:
consumes:
- application/json
description: Adds local user record based on user uuid from auth service
responses:
"201":
description: Created
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
summary: Create new user
tags:
- User
swagger: "2.0"