|
|
| [Home](home) | [**Escopo**](escopo) | [Processo](processo) | [Design/Mockups](design_mockups) | [Gerência](gerencia) | [Estudos](estudos) | [Arquitetura](arquitetura) | [Contratos](contratos) | [BD](banco_dados) | [Qualidade](qualidade) | [Configuração](configuracao) | [Instalação](instalacao) | [Instruções](instrucoes) | [Utilização](utilizacao) | [Analytics](Analytics) | [Infraestrutura](infraestrutura) | [Dicas](dicas) |
|
|
|
| :-------: | :---------------------: | :---------------: | :---------------------------: | :----------------: | :-------------: | :---------------------: | :-----------------: | :------------: | :-----------------: | :-------------------------: | :---------------------: | :---------------------: | :---------------------: | :-----------------: | :---------------------------: | :---------: |
|
|
|
|
|
|
# Stock Locations - locais de estoque
|
|
|
|
|
|
fields:
|
|
|
|
|
|
```js
|
|
|
id: number;
|
|
|
description: string;
|
|
|
active: boolean;
|
|
|
```
|
|
|
|
|
|
endpoints:
|
|
|
|
|
|
## FindAll
|
|
|
|
|
|
GET http://localhost:3000/stock-locations/
|
|
|
|
|
|
response:
|
|
|
|
|
|
```json
|
|
|
[
|
|
|
{
|
|
|
"id": 1,
|
|
|
"description": "Câmara Fria A",
|
|
|
"active": true,
|
|
|
"created_at": "18/10/2024 00:09:25",
|
|
|
"updated_at": "18/10/2024 00:09:25"
|
|
|
},
|
|
|
{
|
|
|
"id": 2,
|
|
|
"description": "Depósito",
|
|
|
"active": true,
|
|
|
"created_at": "18/10/2024 00:09:25",
|
|
|
"updated_at": "18/10/2024 00:09:25"
|
|
|
},
|
|
|
{
|
|
|
"id": 3,
|
|
|
"description": "Pátio",
|
|
|
"active": true,
|
|
|
"created_at": "18/10/2024 00:09:25",
|
|
|
"updated_at": "18/10/2024 00:09:25"
|
|
|
},
|
|
|
{
|
|
|
"id": 4,
|
|
|
"description": "Câmara Fria B",
|
|
|
"active": true,
|
|
|
"created_at": "18/10/2024 00:09:25",
|
|
|
"updated_at": "18/10/2024 00:09:25"
|
|
|
}
|
|
|
]
|
|
|
```
|
|
|
|
|
|
## FindById
|
|
|
|
|
|
GET http://localhost:3000/stock-locations/3
|
|
|
|
|
|
response:
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"id": 3,
|
|
|
"description": "Pátio",
|
|
|
"active": true,
|
|
|
"created_at": "18/10/2024 00:09:25",
|
|
|
"updated_at": "18/10/2024 00:09:25"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
## Create
|
|
|
|
|
|
POST http://localhost:3000/stock-locations/
|
|
|
|
|
|
request:
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"description": "CAMINHÃO FRIGORIFICO"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
response:
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"id": 5,
|
|
|
"description": "CAMINHÃO FRIGORIFICO",
|
|
|
"active": true,
|
|
|
"created_at": "19/10/2024 03:12:44",
|
|
|
"updated_at": "19/10/2024 03:12:44"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
## Update
|
|
|
|
|
|
PATCH http://localhost:3000/stock-locations/5
|
|
|
|
|
|
request:
|
|
|
![1729318507112](image/Contratosbackefront/1729318507112.png)
|
|
|
|
|
|
response:
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"id": 5,
|
|
|
"description": "meu deposito favorito",
|
|
|
"active": true,
|
|
|
"created_at": "19/10/2024 03:12:44",
|
|
|
"updated_at": "19/10/2024 03:14:07"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
## Delete (inactivate)
|
|
|
|
|
|
DELETE http://localhost:3000/stock-locations/5
|
|
|
|
|
|
response:
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"message": "Stock Location with ID 5 deleted successfully"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
## Reactivate
|
|
|
|
|
|
POST http://localhost:3000/stock-locations/activate/5
|
|
|
|
|
|
response:
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"message": "Stock Location with ID 5 activated successfully"
|
|
|
}
|
|
|
``` |