openapi: "3.0.0" info: version: "1.0.0" title: "API de Entregas" servers: - url: "http://localhost:9000" paths: /chat/list: get: summary: "Listar todos os chats" operationId: "listChats" responses: '200': description: "Lista de chats" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/Chat" '302': description: "Redirecionamento, ocorreu um erro" /chat/{id}/messages: get: summary: "Listar todas as mensagens de um chat específico" operationId: "listMessages" parameters: - name: "id" in: "path" required: true schema: type: "string" responses: '200': description: "Lista de mensagens do chat" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/Message" '302': description: "Redirecionamento, ocorreu um erro" /motoboy/profile: get: summary: "Obter o perfil do Motoboy" operationId: "getProfile" responses: '200': description: "Perfil do Motoboy" content: application/json: schema: $ref: "#/components/schemas/Deliveryman" '302': description: "Redirecionamento, ocorreu um erro" post: summary: "Atualizar perfil do Motoboy" operationId: "updateProfile" requestBody: content: application/json: schema: $ref: "#/components/schemas/Deliveryman" responses: '200': description: "Perfil atualizado" content: application/json: schema: type: "object" properties: message: type: "string" '302': description: "Redirecionamento, ocorreu um erro" /motoboy/vehicle: post: summary: "Atualizar veículo do Motoboy" operationId: "updateVehicle" requestBody: content: application/json: schema: $ref: "#/components/schemas/Vehicle" responses: '200': description: "Veículo atualizado" content: application/json: schema: type: "object" properties: message: type: "string" '302': description: "Redirecionamento, ocorreu um erro" /order: post: summary: "Colocar um novo pedido" operationId: "placeOrder" requestBody: content: application/json: schema: $ref: "#/components/schemas/OrderPlaceRequest" responses: '200': description: "Pedido concluído" content: application/json: schema: $ref: "#/components/schemas/OrderResponse" '400': description: "Não foi possível criar o pedido" /order/store/all: get: summary: "Obter todos os pedidos da loja" operationId: "getStoreAll" responses: '200': description: "Lista de pedidos" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/Order" '400': description: "Não foi possível recuperar os pedidos" /order/deliveryman/all: get: summary: "Obter todos os pedidos do entregador" operationId: "getDeliverymanAll" responses: '200': description: "Lista de pedidos" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/Order" '400': description: "Não foi possível recuperar os pedidos" /order/{id}: get: summary: "Obter um pedido específico pelo ID" operationId: "getOrder" parameters: - name: "id" in: "path" required: true schema: type: "integer" responses: '200': description: "Detalhes do pedido" content: application/json: schema: $ref: "#/components/schemas/Order" '400': description: "Não foi possível recuperar os pedidos" /order/deliverytax: get: summary: "Obter a taxa de entrega" operationId: "getDeliveryTax" parameters: - name: "distance" in: "query" required: true schema: type: "integer" responses: '200': description: "Taxa de entrega" content: application/json: schema: $ref: "#/components/schemas/DeliveryTax" '400': description: "Não foi possível recuperar os pedidos" /order/deliveryman/complete-route: get: summary: "Completar a rota do entregador" operationId: "completeRoute" parameters: - name: "order_id" in: "query" required: true schema: type: "integer" responses: '200': description: "Rota concluída" content: application/json: schema: $ref: "#/components/schemas/CompleteRoute" '400': description: "Não foi possível recuperar o pedido" /store/profile: get: tags: - "store" summary: "Obter detalhes do perfil da loja" description: "" operationId: "getStoreProfile" responses: 200: description: "Operação bem-sucedida" content: application/json: schema: $ref: "#/components/schemas/StoreProfile" post: tags: - "store" summary: "Atualizar perfil da loja" description: "" operationId: "updateStoreProfile" requestBody: content: application/json: schema: $ref: "#/components/schemas/StoreProfileUpdate" responses: 200: description: "Operação bem-sucedida" /user: get: tags: - User summary: Retrieve the user profile operationId: getProfile responses: '200': description: User profile information content: application/json: schema: $ref: '#/components/schemas/User' '404': description: User not found /user/register: post: tags: - User summary: Register a new user operationId: registerUser requestBody: description: User and Address info for registration content: application/json: schema: $ref: '#/components/schemas/UserRegister' required: true responses: '200': description: User registration successful content: application/json: schema: $ref: '#/components/schemas/User' '400': description: User registration failed /user/login: post: tags: - User summary: Login for a user operationId: loginUser requestBody: description: User login credentials content: application/json: schema: $ref: '#/components/schemas/UserLogin' required: true responses: '200': description: Login successful content: application/json: schema: $ref: '#/components/schemas/Token' '401': description: Login failed components: schemas: Chat: type: "object" properties: id: type: "integer" createdAt: type: "string" format: "date-time" updatedAt: type: "string" format: "date-time" Order: $ref: "#/components/schemas/Order" Message: type: "object" properties: id: type: "integer" message: type: "string" read: type: "boolean" createdAt: type: "string" format: "date-time" updatedAt: type: "string" format: "date-time" Chat: $ref: "#/components/schemas/Chat" Deliveryman: type: "object" properties: id: type: "integer" name: type: "string" last_name: type: "string" cpf_cnpj: type: "string" photo: type: "string" whatsapp: type: "string" Vehicle: type: "object" properties: licencePlate: type: "string" type: type: "string" color: type: "string" manufacturer: type: "string" OrderPlaceRequest: type: "object" properties: recipient: type: "string" delivery_tax: type: "number" payment_type: type: "string" status: type: "string" comment: type: "string" qtd: type: "integer" distance: type: "integer" Address: type: "object" properties: street: type: "string" number: type: "integer" district: type: "string" city: type: "string" uf: type: "string" cep: type: "string" lat: type: "number" lng: type: "number" position: type: "integer" OrderResponse: type: "object" properties: message: type: "string" order: $ref: "#/components/schemas/Order" Order: type: "object" properties: id: type: "integer" recipient: type: "string" delivery_tax: type: "number" tax: type: "number" payment_type: type: "string" enum: ["ON_DELIVERY","DIGITAL"] status: type: "string" enum: ["CREATED","ACCEPTED", "ROUTE", "RETURNING", "COMPLETE","CANCELED"] comment: type: "string" qtd: type: "integer" distance: type: "integer" DeliveryTax: type: "object" properties: amount: type: "number" CompleteRoute: type: "object" properties: message: type: "string" StoreProfile: type: "object" properties: id: type: "integer" format: "int64" name: type: "string" last_name: type: "string" store_name: type: "string" photo: type: "string" cpf_cnpj: type: "string" email: type: "string" userId: type: "integer" format: "int64" phone: type: "string" whatsapp: type: "string" StoreProfileUpdate: type: "object" properties: name: type: "string" last_name: type: "string" store_name: type: "string" photo: type: "string" cpf_cnpj: type: "string" whatsapp: type: "string" User: type: "object" properties: id: type: "integer" format: "int64" email: type: "string" phone: type: "string" password: type: "string" type: type: "string" enum: ["MOTOBOY", "STORE"] socketId: type: "string" deliveryman: $ref: "#/components/schemas/Deliveryman" address: $ref: "#/components/schemas/Address" store: $ref: "#/components/schemas/StoreProfile" UserRegister: type: "object" properties: name: type: "string" last_name: type: "string" cpf_cnpj: type: "string" email: type: "string" type: type: "string" phone: type: "string" password: type: "string" store_name: type: "string" address: $ref: "#/components/schemas/Address" UserLogin: type: object properties: email: type: string format: email password: type: string Token: type: object properties: token: type: string