Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Wiki Wiki
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 52
    • Issues 52
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CP - Planta
  • WikiWiki
  • Wiki
  • backend_persons

Last edited by ESKieroff Oct 19, 2024
Page history

backend_persons

Home Escopo Processo Design/Mockups Gerência Estudos Arquitetura Contratos BD Qualidade Configuração Instalação Instruções Utilização Analytics Infraestrutura Dicas

Persons - pessoas (fornecedor, cliente)

fields:

id: number;
name: string;
type: Person_Type;
active: boolean;

endpoints:

FindAll

GET http://localhost:3000/persons/ response:

[
  {
    "id": 1,
    "name": "Pedro Cabral",
    "active": true,
    "created_at": "18/10/2024 00:09:25",
    "updated_at": "18/10/2024 00:09:25"
  },
  {
    "id": 2,
    "name": "Machado Assis",
    "active": true,
    "created_at": "18/10/2024 00:09:25",
    "updated_at": "18/10/2024 00:09:25"
  },
  {
    "id": 3,
    "name": "Clarice Lispector",
    "active": true,
    "created_at": "18/10/2024 00:09:25",
    "updated_at": "18/10/2024 00:09:25"
  },
  {
    "id": 4,
    "name": "Sebastião Costa",
    "active": true,
    "created_at": "18/10/2024 00:09:25",
    "updated_at": "18/10/2024 00:09:25"
  },
  {
    "id": 5,
    "name": "Produtor Rural",
    "active": true,
    "created_at": "18/10/2024 00:09:25",
    "updated_at": "18/10/2024 00:09:25"
  },
  {
    "id": 6,
    "name": "Ecologia na Veia",
    "active": true,
    "created_at": "18/10/2024 00:09:25",
    "updated_at": "18/10/2024 00:09:25"
  }
]

FindById

GET http://localhost:3000/persons/2 response:

{
  "id": 2,
  "name": "Machado Assis",
  "active": true,
  "created_at": "18/10/2024 00:09:25",
  "updated_at": "18/10/2024 00:09:25"
}

Create

POST http://localhost:3000/persons/ request:

{
  "name": "Fruteira do Ifood"
}

response:

{
  "id": 7,
  "name": "Fruteira do Ifood",
  "active": true,
  "created_at": "19/10/2024 04:03:03",
  "updated_at": "19/10/2024 04:03:03"
}

Update

PATCH http://localhost:3000/persons/7

request:

request

response:

{
  "id": 7,
  "name": "Restaurante Nova Brécia",
  "active": true,
  "created_at": "19/10/2024 04:03:03",
  "updated_at": "19/10/2024 04:05:18"
}

Delete

DELETE http://localhost:3000/persons/7 response:

{
  "message": "Person with ID 7 deleted successfully"
}

Reactivate

POST http://localhost:3000/persons/activate/7 response:

{
  "message": "Person ID 7 activated successfully"
}
Clone repository
  • Infraestrutura
  • Utilizando a wiki
    • adicionando imagens
    • escrevendo em markdown
    • wiki no editor de texto
  • analytics
  • arquitetura
  • backend_categories
  • backend_inicio
  • backend_persons
  • backend_production_order
  • backend_products
  • backend_qualidade
  • backend_settings
  • backend_stock
  • backend_stock_locations
View All Pages