Last active
July 11, 2023 10:40
-
-
Save goququ/359839b21dfface62d9a38a79a5972db to your computer and use it in GitHub Desktop.
analytics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"openapi": "3.0.1", | |
"info": { | |
"title": "ML.Analytics", | |
"version": "v1" | |
}, | |
"paths": { | |
"/api/analytics/clients/{clientId}/instant": { | |
"get": { | |
"tags": [ | |
"Clients" | |
], | |
"summary": "Получение данных моментальной ÑтатиÑтики по клиенту. (Auth policies: read:analytics)", | |
"operationId": "GetClientInstant", | |
"parameters": [ | |
{ | |
"name": "clientId", | |
"in": "path", | |
"required": true, | |
"schema": { | |
"type": "string", | |
"description": "Идентификатор клиента.", | |
"format": "uuid" | |
} | |
}, | |
{ | |
"name": "timestamp", | |
"in": "query", | |
"schema": { | |
"type": "string", | |
"description": "Ð’Ñ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ Ð¼ÐµÑ‚ÐºÐ°.", | |
"format": "date-time" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Данные получены.", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/ClientInstantDtoSuccessResponseWrapper" | |
} | |
} | |
} | |
}, | |
"404": { | |
"description": "Данные клиента не найдены.", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/ErrorResponseWrapper" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"put": { | |
"tags": [ | |
"Clients" | |
], | |
"summary": "ОбновлÑет текущие данные ÑтатиÑтики клиента. (Auth policies: edit:analytics)", | |
"operationId": "UpdateClientInstant", | |
"parameters": [ | |
{ | |
"name": "clientId", | |
"in": "path", | |
"required": true, | |
"schema": { | |
"type": "string", | |
"description": "Идентификатор клиента.", | |
"format": "uuid" | |
} | |
} | |
], | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/UpdateClientInstantSingleDto" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"202": { | |
"description": "Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð¿Ñ€Ð¸Ð½ÑÑ‚Ñ‹.", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/MessageDtoSuccessResponseWrapper" | |
} | |
} | |
} | |
}, | |
"304": { | |
"description": "Без изменений.", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/MessageDtoSuccessResponseWrapper" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/api/analytics/clients/instant": { | |
"put": { | |
"tags": [ | |
"Clients" | |
], | |
"summary": "ОбновлÑет текущие данные ÑтатиÑтики клиентов. (Auth policies: edit:analytics)", | |
"operationId": "BatchUpdateClientInstant", | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/UpdateClientInstantBatchDto" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"202": { | |
"description": "Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð¿Ñ€Ð¸Ð½ÑÑ‚Ñ‹.", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/MessageDtoSuccessResponseWrapper" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/api/analytics/kitchens/{kitchenId}/daily": { | |
"get": { | |
"tags": [ | |
"Kitchens" | |
], | |
"summary": "Получение данных ÑтатиÑтики по кухне за определенные Ñутки. (Auth policies: read:analytics)", | |
"operationId": "GetKitchenDaily", | |
"parameters": [ | |
{ | |
"name": "kitchenId", | |
"in": "path", | |
"required": true, | |
"schema": { | |
"title": "Идентификатор кухни.", | |
"type": "integer", | |
"format": "int32" | |
} | |
}, | |
{ | |
"name": "includeShift", | |
"in": "query", | |
"description": "\n\nCurrentOnly\n\nPreviousOnly", | |
"schema": { | |
"$ref": "#/components/schemas/IncludeShift" | |
}, | |
"x-enumNames": [ | |
"CurrentOnly", | |
"PreviousOnly" | |
] | |
}, | |
{ | |
"name": "createdAt", | |
"in": "query", | |
"schema": { | |
"title": "Дата ÑÐ¾Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ Ñуточной ÑтатиÑтики.", | |
"type": "string", | |
"format": "date" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Данные получены.", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/KitchenInstantDtoSuccessResponseWrapper" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/api/analytics/kitchens/{kitchenId}/instant": { | |
"get": { | |
"tags": [ | |
"Kitchens" | |
], | |
"summary": "Получение данных моментальной ÑтатиÑтики по кухне. (Auth policies: read:analytics)", | |
"operationId": "GetKitchenInstant", | |
"parameters": [ | |
{ | |
"name": "kitchenId", | |
"in": "path", | |
"required": true, | |
"schema": { | |
"title": "Идентификатор кухни.", | |
"type": "integer", | |
"format": "int32" | |
} | |
}, | |
{ | |
"name": "includeShift", | |
"in": "query", | |
"description": "\n\nCurrentOnly\n\nPreviousOnly", | |
"schema": { | |
"$ref": "#/components/schemas/IncludeShift" | |
}, | |
"x-enumNames": [ | |
"CurrentOnly", | |
"PreviousOnly" | |
] | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Данные получены.", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/KitchenInstantDtoSuccessResponseWrapper" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"components": { | |
"schemas": { | |
"BaseInstantDto": { | |
"type": "object", | |
"additionalProperties": false | |
}, | |
"Cancelled": { | |
"required": [ | |
"count", | |
"g_m_v" | |
], | |
"type": "object", | |
"properties": { | |
"count": { | |
"title": "КоличеÑтво отмененных.", | |
"type": "integer", | |
"format": "int32" | |
}, | |
"g_m_v": { | |
"title": "GMV отмененных.", | |
"type": "number", | |
"format": "double" | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"ClientInstant": { | |
"type": "object", | |
"properties": { | |
"client_id": { | |
"title": "Идентификатор клиента", | |
"type": "string", | |
"format": "uuid" | |
}, | |
"orders": { | |
"$ref": "#/components/schemas/ClientOrders" | |
}, | |
"reviews": { | |
"$ref": "#/components/schemas/ReviewsStats" | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"ClientInstantDto": { | |
"required": [ | |
"client_id", | |
"orders", | |
"reviews" | |
], | |
"type": "object", | |
"properties": { | |
"client_id": { | |
"title": "Идентификатор клиета.", | |
"type": "string", | |
"format": "uuid" | |
}, | |
"orders": { | |
"$ref": "#/components/schemas/ClientOrders" | |
}, | |
"reviews": { | |
"$ref": "#/components/schemas/ReviewsStats" | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"ClientInstantDtoSuccessResponseWrapper": { | |
"required": [ | |
"data" | |
], | |
"type": "object", | |
"properties": { | |
"data": { | |
"$ref": "#/components/schemas/ClientInstantDto" | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"ClientOrders": { | |
"type": "object", | |
"properties": { | |
"completed_count": { | |
"title": "КоличетÑво заврешенных.", | |
"maximum": 2147483647, | |
"minimum": 0, | |
"type": "integer", | |
"format": "int32", | |
"nullable": true | |
}, | |
"l_t_v": { | |
"title": "LTV.", | |
"type": "number", | |
"description": "LTV поÑле вÑех Ñкидок.", | |
"format": "double", | |
"nullable": true | |
}, | |
"first_created_at": { | |
"title": "Дата ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ð¿ÐµÑ€Ð²Ð¾Ð³Ð¾ заказа.", | |
"type": "string", | |
"format": "date-time", | |
"nullable": true | |
}, | |
"last_created_at": { | |
"title": "Дата ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ð¿Ð¾Ñледнего заказа.", | |
"type": "string", | |
"format": "date-time", | |
"nullable": true | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"Delivery": { | |
"required": [ | |
"orders" | |
], | |
"type": "object", | |
"properties": { | |
"orders": { | |
"$ref": "#/components/schemas/KitchenOrders" | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"DeliveryByClient": { | |
"type": "object", | |
"allOf": [ | |
{ | |
"$ref": "#/components/schemas/Delivery" | |
} | |
], | |
"additionalProperties": false | |
}, | |
"DeliveryByCourier": { | |
"required": [ | |
"click_to_eat", | |
"delay_time", | |
"delays_percentage", | |
"delivery_time" | |
], | |
"type": "object", | |
"allOf": [ | |
{ | |
"$ref": "#/components/schemas/Delivery" | |
} | |
], | |
"properties": { | |
"delays_percentage": { | |
"title": "Процент опозданий.", | |
"type": "number", | |
"format": "float" | |
}, | |
"delivery_time": { | |
"title": "Среднее Ð²Ñ€ÐµÐ¼Ñ Ð´Ð¾Ñтавки.", | |
"type": "string", | |
"example": "00:00:00" | |
}, | |
"click_to_eat": { | |
"title": "Средний Click-to-eat.", | |
"type": "string", | |
"example": "00:00:00" | |
}, | |
"delay_time": { | |
"title": "Среднее Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð¿Ð¾Ð·Ð´Ð°Ð½Ð¸Ñ.", | |
"type": "string", | |
"example": "00:00:00" | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"ErrorResponseWrapper": { | |
"required": [ | |
"error" | |
], | |
"type": "object", | |
"properties": { | |
"error": { | |
"$ref": "#/components/schemas/ErrorResultDto" | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"ErrorResultDto": { | |
"type": "object", | |
"properties": { | |
"code": { | |
"type": "integer", | |
"format": "int32", | |
"nullable": true | |
}, | |
"message": { | |
"type": "string" | |
}, | |
"errors": { | |
"type": "object", | |
"additionalProperties": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
} | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"Hourly": { | |
"required": [ | |
"cancelled", | |
"deliveries", | |
"orders", | |
"ticket_time" | |
], | |
"type": "object", | |
"properties": { | |
"orders": { | |
"$ref": "#/components/schemas/KitchenOrders" | |
}, | |
"cancelled": { | |
"title": "КоличеÑтов отмененных в разрезе маркетплейÑа.", | |
"type": "object", | |
"additionalProperties": { | |
"$ref": "#/components/schemas/Cancelled" | |
} | |
}, | |
"ticket_time": { | |
"title": "Текущий тикет-тайм по чаÑу.", | |
"type": "string", | |
"example": "00:00:00" | |
}, | |
"deliveries": { | |
"title": "СтатиÑтика в разрезе типа доÑтавки.", | |
"type": "object", | |
"additionalProperties": { | |
"oneOf": [ | |
{ | |
"$ref": "#/components/schemas/DeliveryByClient" | |
}, | |
{ | |
"$ref": "#/components/schemas/DeliveryByCourier" | |
} | |
] | |
} | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"IncludeShift": { | |
"enum": [ | |
"CurrentOnly", | |
"PreviousOnly" | |
], | |
"type": "string", | |
"description": "\n\nCurrentOnly\n\nPreviousOnly", | |
"x-enumNames": [ | |
"CurrentOnly", | |
"PreviousOnly" | |
] | |
}, | |
"KitchenInstantDto": { | |
"required": [ | |
"kitchen_id", | |
"ticket_time" | |
], | |
"type": "object", | |
"properties": { | |
"kitchen_id": { | |
"title": "Идентификатор кухни.", | |
"type": "integer", | |
"format": "int32" | |
}, | |
"current_shift": { | |
"$ref": "#/components/schemas/Shift" | |
}, | |
"previous_shift": { | |
"$ref": "#/components/schemas/Shift" | |
}, | |
"ticket_time": { | |
"title": "Текущий тикет-тайм кухни.", | |
"type": "string", | |
"example": "00:00:00" | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"KitchenInstantDtoSuccessResponseWrapper": { | |
"required": [ | |
"data" | |
], | |
"type": "object", | |
"properties": { | |
"data": { | |
"$ref": "#/components/schemas/KitchenInstantDto" | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"KitchenOrders": { | |
"required": [ | |
"count", | |
"g_m_v" | |
], | |
"type": "object", | |
"properties": { | |
"count": { | |
"title": "Текущее количеÑтво заказов в Ñмене.", | |
"type": "integer", | |
"format": "int32" | |
}, | |
"g_m_v": { | |
"title": "Текущий GMV.", | |
"type": "number", | |
"format": "double" | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"MessageDto": { | |
"type": "object", | |
"properties": { | |
"message": { | |
"type": "string" | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"MessageDtoSuccessResponseWrapper": { | |
"required": [ | |
"data" | |
], | |
"type": "object", | |
"properties": { | |
"data": { | |
"$ref": "#/components/schemas/MessageDto" | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"PartOfDay": { | |
"enum": [ | |
"Day", | |
"Night" | |
], | |
"type": "string", | |
"description": "\n\nDay\n\nNight", | |
"x-enumNames": [ | |
"Day", | |
"Night" | |
] | |
}, | |
"ReviewsStats": { | |
"type": "object", | |
"properties": { | |
"negative_count": { | |
"title": "КоличетÑво негативных отзывов.", | |
"maximum": 2147483647, | |
"minimum": 0, | |
"type": "integer", | |
"format": "int32", | |
"nullable": true | |
}, | |
"positive_count": { | |
"title": "КоличетÑво позитивных отзывов.", | |
"maximum": 2147483647, | |
"minimum": 0, | |
"type": "integer", | |
"format": "int32", | |
"nullable": true | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"Shift": { | |
"required": [ | |
"begin_at", | |
"cancelled", | |
"deliveries", | |
"end_at", | |
"hours", | |
"orders", | |
"part_of_day", | |
"ticket_time" | |
], | |
"type": "object", | |
"properties": { | |
"part_of_day": { | |
"$ref": "#/components/schemas/PartOfDay" | |
}, | |
"begin_at": { | |
"title": "Дата и Ð²Ñ€ÐµÐ¼Ñ Ð½Ð°Ñ‡Ð°Ð»Ð° Ñмены.", | |
"type": "string", | |
"format": "date-time" | |
}, | |
"end_at": { | |
"title": "Дата и Ð²Ñ€ÐµÐ¼Ñ Ð¾ÐºÐ¾Ð½Ñ‡Ð°Ð½Ð¸Ñ Ñмены.", | |
"type": "string", | |
"format": "date-time" | |
}, | |
"orders": { | |
"$ref": "#/components/schemas/KitchenOrders" | |
}, | |
"cancelled": { | |
"title": "КоличеÑтов отмененных в разрезе маркетплейÑа за Ñмену.", | |
"type": "object", | |
"additionalProperties": { | |
"$ref": "#/components/schemas/Cancelled" | |
} | |
}, | |
"ticket_time": { | |
"title": "Текущий тикет-тайм Ñмены.", | |
"type": "string", | |
"example": "00:00:00" | |
}, | |
"hours": { | |
"title": "Данные Ñмены по чаÑам.", | |
"type": "object", | |
"additionalProperties": { | |
"$ref": "#/components/schemas/Hourly" | |
} | |
}, | |
"deliveries": { | |
"title": "СтатиÑтика в разрезе типа доÑтавки по Ñмене.", | |
"type": "object", | |
"additionalProperties": { | |
"oneOf": [ | |
{ | |
"$ref": "#/components/schemas/DeliveryByClient" | |
}, | |
{ | |
"$ref": "#/components/schemas/DeliveryByCourier" | |
} | |
] | |
} | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"UpdateClientInstantBatchDto": { | |
"required": [ | |
"client_instants" | |
], | |
"type": "object", | |
"properties": { | |
"client_instants": { | |
"type": "array", | |
"items": { | |
"$ref": "#/components/schemas/ClientInstant" | |
} | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"UpdateClientInstantSingleDto": { | |
"type": "object", | |
"properties": { | |
"orders": { | |
"$ref": "#/components/schemas/ClientOrders" | |
}, | |
"reviews": { | |
"$ref": "#/components/schemas/ReviewsStats" | |
} | |
}, | |
"additionalProperties": false | |
} | |
}, | |
"securitySchemes": { | |
"Bearer": { | |
"type": "oauth2", | |
"flows": { | |
"password": { | |
"tokenUrl": "https://keycloak.mlkitchen.ai/auth/realms/MnogoLososya/protocol/openid-connect/token?audience=https://platform.mlkitchen.ai", | |
"scopes": { | |
"read:analytics": "Provides read access to analytics", | |
"edit:analytics": "Provides edit access to analytics" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"security": [ | |
{ | |
"Bearer": [] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment