{"openapi":"3.0.0","info":{"version":"1.0.0","title":"5BOX","description":"Backend API для мобильного приложения сотрудников"},"paths":{"/authorize/":{"post":{"summary":"Авторизация","description":"Авторизация по номеру телефона и паролю сотрудника","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone","password"],"properties":{"phone":{"type":"string","example":"+79112345687"},"password":{"type":"string","example":"password1234"}}}}}},"responses":{"200":{"description":"Успешная авторизация","content":{"application/json":{"schema":{"type":"object","properties":{"access":{"type":"string"},"refresh":{"type":"string"}},"example":{"access":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNTUxNzA0NjU1LCJqdGkiOiI5ZWI5MDA4MDJmMDg0ZjgxOGY3N2JkZWM1NDQ0NWJjYyIsInVzZXJfaWQiOjN9.XV3fXXLVrjbaQQjxp2DccLfW-rCEzQNoZWkEQXMRlA0","refresh":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTU1MTc5MDc1NSwianRpIjoiOWNlODdjNzYzYTZmNDA2ZThmYWUzZmU3NmVhZGQ2ZjEiLCJ1c2VyX2lkIjozfQ.Qu-C_MhwEI8ovfYVPeg9gyqmZbV_O4xs8YbyMZorr84"}}}}},"422":{"description":"Ошибка при попытке войти","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["error","warning","info"]},"message":{"type":"string"}}}}},"example":{"errors":[{"level":"error","message":"Неверный формат номера телефона"}]}}}}},"401":{"description":"Отказано в доступе","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["error","warning","info"]},"message":{"type":"string"}}}}},"example":{"errors":[{"level":"error","message":"Неверный номер телефона или пароль"}]}}}}}}}},"/token/refresh/":{"post":{"summary":"Обновление токена","requestBody":{"description":"Отдается Refresh Token для получения нового Access Token и нового Refresh Token","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"refresh":{"type":"string"}},"example":{"refresh":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTU1MTc5MDc1NSwianRpIjoiOWNlODdjNzYzYTZmNDA2ZThmYWUzZmU3NmVhZGQ2ZjEiLCJ1c2VyX2lkIjozfQ.Qu-C_MhwEI8ovfYVPeg9gyqmZbV_O4xs8YbyMZorr84"}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"access":{"type":"string"},"refresh":{"type":"string"}},"example":{"access":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNTUxNzA0NjU1LCJqdGkiOiI5ZWI5MDA4MDJmMDg0ZjgxOGY3N2JkZWM1NDQ0NWJjYyIsInVzZXJfaWQiOjN9.XV3fXXLVrjbaQQjxp2DccLfW-rCEzQNoZWkEQXMRlA0","refresh":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTU1MTc5MDc1NSwianRpIjoiOWNlODdjNzYzYTZmNDA2ZThmYWUzZmU3NmVhZGQ2ZjEiLCJ1c2VyX2lkIjozfQ.Qu-C_MhwEI8ovfYVPeg9gyqmZbV_O4xs8YbyMZorr84"}}}}},"400":{"description":"Некорректный запрос","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["error","warning","info"]},"message":{"type":"string"}}}}},"example":{"errors":[{"level":"error","message":"Некорректный формат запроса"}]}}}}},"401":{"description":"Отказано в доступе","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["error","warning","info"]},"message":{"type":"string"}}}}},"example":{"errors":[{"level":"error","message":"Неверный номер телефона или пароль"}]}}}}}}}},"/logout/":{"post":{"summary":"Выход","description":"Выход (окончание сессии)","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Authorization","description":"Authorization: Bearer {token}","schema":{"type":"string"}}],"responses":{"200":{"description":"Выход выполнен","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Отказано в доступе","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["error","warning","info"]},"message":{"type":"string"}}}}},"example":{"errors":[{"level":"error","message":"Токен доступа невалидный"}]}}}}}}}},"/user/":{"get":{"summary":"Получение пользователя","description":"Возвращает данные профиля пользователя.","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Authorization","description":"Authorization: Bearer {token}","schema":{"type":"string"}}],"responses":{"200":{"description":"Информация о пользователе","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"Иванов Иван Иванович"},"phone":{"type":"string","example":"79112345687"},"role":{"type":"string","enum":["slave","master"],"example":"slave"},"position":{"type":"string","enum":["repairer","cleaner"],"example":"cleaner"},"picture":{"type":"string","example":"{url}/pictures/053.png"},"status":{"type":"object","properties":{"inside":{"type":"boolean","example":true}}}}}}}},"401":{"description":"Отказано в доступе","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["error","warning","info"]},"message":{"type":"string"}}}}},"example":{"errors":[{"level":"error","message":"Токен доступа невалидный"}]}}}}}}}},"/scan/":{"post":{"summary":"Контроллер принимает QR коды от входной двери","description":"Авторизация по номеру телефона и паролю сотрудника","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","example":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9"}}}}}},"responses":{"200":{"description":"Успешная авторизация","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"node":{"type":"object"},"status":{"type":"object","properties":{"inside":{"type":"boolean"},"commitment":{"type":"boolean"}}}},"example":{"type":"product","node":{},"status":{"inside":true,"commitment":true}}}}}},"400":{"description":"Ошибка при попытке войти","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["error","warning","info"]},"message":{"type":"string"}}}}},"example":{"errors":[{"level":"error","message":"Неверный код"}]}}}}}}}},"/has-perm/":{"post":{"summary":"Проверка прав","description":"Имеет ли пользователь права доступа.","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Authorization","description":"Authorization: Bearer {token}","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["permission"],"properties":{"permission":{"type":"string","example":"open_service_door"}}}}}},"responses":{"200":{"description":"Права есть.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Отказано в доступе.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["error","warning","info"]},"message":{"type":"string"}}}}},"example":{"errors":[{"level":"error","message":"Токен доступа невалидный"}]}}}}}}}},"/shops/":{"get":{"summary":"Получение списка магазинов","description":"Для получения списка магазинов.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Магазины.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"coordinates":{"type":"object","properties":{"longitude":{"type":"number"},"lattiude":{"type":"number"}}},"name":{"type":"string"},"addres":{"type":"string"}}}}}}},"400":{"description":"Ошибка.","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["error","warning","info"]},"message":{"type":"string"}}}}},"example":{"errors":[{"level":"error","message":"Токен доступа невалидный"}]}}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/Axeta/auth-backend/1.0"}]}