Enviar arquivos para "/"
This commit is contained in:
74
api.http
Normal file
74
api.http
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
### Login
|
||||||
|
# @name login
|
||||||
|
POST http://localhost:3333/api/auth/login
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"email": "admin@gastrobar.com",
|
||||||
|
"senha": "123456"
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
@token = {{login.response.body.token}}
|
||||||
|
|
||||||
|
### Criar Categoria
|
||||||
|
POST http://localhost:3333/api/categorias
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"nome": "Bebidas"
|
||||||
|
}
|
||||||
|
|
||||||
|
### Listar Categorias
|
||||||
|
GET http://localhost:3333/api/categorias
|
||||||
|
|
||||||
|
### Criar Produto
|
||||||
|
POST http://localhost:3333/api/produtos
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"nome": "Cerveja Artesanal",
|
||||||
|
"descricao": "IPA 500ml",
|
||||||
|
"preco": 25.50,
|
||||||
|
"itemCozinha": false,
|
||||||
|
"categoriaId": "COLOQUE_O_ID_DA_CATEGORIA_AQUI"
|
||||||
|
}
|
||||||
|
|
||||||
|
### Listar Produtos
|
||||||
|
GET http://localhost:3333/api/produtos
|
||||||
|
|
||||||
|
### Abrir Comanda
|
||||||
|
# @name comanda
|
||||||
|
POST http://localhost:3333/api/comandas
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"identificador": "Mesa 01",
|
||||||
|
"nomeCliente": "João Silva"
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
@comandaId = {{comanda.response.body.id}}
|
||||||
|
|
||||||
|
### Adicionar Item à Comanda
|
||||||
|
POST http://localhost:3333/api/comandas/{{comandaId}}/itens
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"produtoId": "COLOQUE_O_ID_DO_PRODUTO_AQUI",
|
||||||
|
"quantidade": 2,
|
||||||
|
"observacao": "Sem gelo"
|
||||||
|
}
|
||||||
|
|
||||||
|
### Painel da Cozinha / Bar (Listar Pendentes)
|
||||||
|
GET http://localhost:3333/api/painel/itens?status=PENDENTE
|
||||||
|
|
||||||
|
### Atualizar Status do Item
|
||||||
|
PATCH http://localhost:3333/api/painel/itens/COLOQUE_O_ID_DO_ITEM_AQUI/status
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"status": "PREPARANDO"
|
||||||
|
}
|
||||||
1967
package-lock.json
generated
Normal file
1967
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
35
package.json
Normal file
35
package.json
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"name": "gastrobar-backend",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Backend para o sistema de PDV e gestão do gastrobar",
|
||||||
|
"main": "dist/server.js",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "tsx watch src/server.ts",
|
||||||
|
"build": "tsc",
|
||||||
|
"start": "node dist/server.js",
|
||||||
|
"db:push": "prisma db push",
|
||||||
|
"db:seed": "tsx prisma/seed.ts"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"@fastify/cors": "^8.0.0",
|
||||||
|
"@fastify/jwt": "^8.0.1",
|
||||||
|
"@prisma/client": "^5.14.0",
|
||||||
|
"bcrypt": "^5.1.1",
|
||||||
|
"fastify": "^4.27.0",
|
||||||
|
"zod": "^3.23.8"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/bcrypt": "^5.0.2",
|
||||||
|
"@types/node": "^20.12.12",
|
||||||
|
"prisma": "^5.14.0",
|
||||||
|
"tsx": "^4.11.0",
|
||||||
|
"typescript": "^5.4.5"
|
||||||
|
},
|
||||||
|
"prisma": {
|
||||||
|
"seed": "tsx prisma/seed.ts"
|
||||||
|
},
|
||||||
|
"type": "commonjs"
|
||||||
|
}
|
||||||
15
tsconfig.json
Normal file
15
tsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es2020",
|
||||||
|
"module": "commonjs",
|
||||||
|
"rootDir": "./src",
|
||||||
|
"outDir": "./dist",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"strict": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"resolveJsonModule": true
|
||||||
|
},
|
||||||
|
"include": ["src/**/*"]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user