merch-api/docs/swagger.yaml

913 lines
23 KiB
YAML
Raw Permalink Normal View History

2026-03-01 22:15:10 +03:00
basePath: /api/v2
definitions:
2026-03-11 20:17:40 +03:00
merch.DeleteZeroPrices:
properties:
id:
type: integer
merch_uuid:
type: string
type: object
2026-03-13 16:55:14 +03:00
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
2026-03-10 23:44:59 +03:00
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
2026-03-11 20:17:40 +03:00
merch.ZeroPrice:
properties:
created_at:
type: string
id:
type: integer
merch_uuid:
type: string
name:
type: string
origin:
type: string
type: object
2026-03-01 22:15:10 +03:00
merch.deleteOriginDTO:
properties:
name:
type: string
type: object
2026-03-07 15:50:05 +03:00
merch.extraDataDTO:
properties:
links:
items:
$ref: '#/definitions/merch.originLink'
type: array
merch_uuid:
type: string
type: object
2026-03-20 16:13:25 +03:00
merch.listResponse:
properties:
labels:
items:
type: string
type: array
merch_uuid:
type: string
name:
type: string
type: object
2026-03-04 17:59:55 +03:00
merch.merchDTO:
properties:
created_at:
type: string
merch_uuid:
type: string
name:
type: string
updated_at:
type: string
type: object
2026-03-04 17:02:21 +03:00
merch.newMerchDTO:
properties:
links:
items:
$ref: '#/definitions/merch.originLink'
type: array
name:
type: string
type: object
2026-03-01 22:15:10 +03:00
merch.newOriginDTO:
properties:
name:
type: string
type: object
merch.originItem:
properties:
id:
type: integer
name:
type: string
type: object
2026-03-04 17:02:21 +03:00
merch.originLink:
properties:
2026-03-07 15:50:05 +03:00
origin:
2026-03-04 17:02:21 +03:00
type: string
2026-03-07 15:50:05 +03:00
origin_link:
2026-03-04 17:02:21 +03:00
type: string
type: object
2026-03-01 22:15:10 +03:00
merch.originsDTO:
properties:
origins:
items:
$ref: '#/definitions/merch.originItem'
type: array
type: object
2026-03-20 16:13:25 +03:00
merch.singleMerchResponse:
properties:
merch_uuid:
type: string
name:
type: string
origins:
items:
$ref: '#/definitions/merch.originLink'
type: array
type: object
2026-03-07 15:50:05 +03:00
merch.updateMerchDTO:
properties:
merch_uuid:
type: string
name:
type: string
type: object
2026-03-01 22:15:10 +03:00
responses.BadRequest:
properties:
error:
example: error
type: string
type: object
responses.InternalServerError:
properties:
error:
example: error
type: string
type: object
2026-03-26 20:43:37 +03:00
responses.NotFound:
properties:
error:
example: error
type: string
type: object
2026-03-01 22:15:10 +03:00
responses.Unauthorized:
properties:
error:
example: error
type: string
type: object
2026-03-26 20:43:37 +03:00
user.MeDTO:
properties:
user_uuid:
type: string
type: object
2026-03-01 22:15:10 +03:00
info:
contact: {}
description: Stores data about merch and prices
title: Merch API
version: "2.3"
paths:
2026-03-04 17:59:55 +03:00
/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
2026-03-20 16:13:25 +03:00
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
2026-03-07 15:50:05 +03:00
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
2026-03-04 17:02:21 +03:00
/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
2026-03-07 15:50:05 +03:00
/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
2026-03-13 16:55:14 +03:00
/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
2026-03-04 17:59:55 +03:00
/merch/list:
get:
description: Get all merch without origins
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
2026-03-20 16:13:25 +03:00
$ref: '#/definitions/merch.listResponse'
2026-03-04 17:59:55 +03:00
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
2026-03-01 22:15:10 +03:00
/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
2026-03-11 20:17:40 +03:00
/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
2026-03-10 23:44:59 +03:00
/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
2026-03-20 16:13:25 +03:00
/user:
delete:
consumes:
- application/json
2026-03-26 20:43:37 +03:00
description: Returns user data
2026-03-20 16:13:25 +03:00
responses:
2026-03-26 20:43:37 +03:00
"200":
description: OK
schema:
$ref: '#/definitions/user.MeDTO'
2026-03-20 16:13:25 +03:00
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
2026-03-26 20:43:37 +03:00
"404":
description: Not Found
schema:
$ref: '#/definitions/responses.NotFound'
2026-03-20 16:13:25 +03:00
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
2026-03-26 20:43:37 +03:00
summary: Returns user data
2026-03-20 16:13:25 +03:00
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
2026-03-01 22:15:10 +03:00
swagger: "2.0"