Pular para o conteúdo principal

Rotas

Para fazer e verificar vistorias, são utílizadas 4 rotas específicas:

Criar vistoria de saída

POST: /v1/inspections/departure

O objetivo dessa rota é criar uma nova vistoria de saída

    {
"createInspectionInput": {
"cpf":"097.191.979-86",
"from_date": "02/05/2023",
"till_date": "07/05/2023",
"vehicle_id":"822732d8-42e5-41eb-b25e-d14c5fb41149",
"departure": {
"baby_chair": true,
"windows": true,
"head_rest": true,
"car_document": true,
"car_jack": true,
"spare_tire": true,
"key": true,
"fire_extinguisher": true,
"windshield_wiper": true,
"seat_belt": true,
"customer_agreement": true,
"customer_signature": FileUpload,
"pictures": [
{
"title": "Foto Frontal",
"desc": "Descrição da Vistoria",
"lat": "43.90",
"long": "42.20",
"taked_at": "02/01/2023",
"raw": FileUpload,
"picture": FileUpload
},
{
"title": "Foto Traseira",
"desc": "Descrição da Vistoria",
"lat": "43.90",
"long": "42.20",
"taked_at": "02/01/2023",
"raw": FileUpload,
"picture": FileUpload
},
]
}
}
}

Atributos

  • cpf: (String)
    • Sempre obrigatório. CPF do cliente que está alugando o veículo
  • from_date: (String)
    • Sempre obrigatório. Data de saída do veículo do pátio da locadora
  • till_date: (String)
    • Sempre obrigatório. Data de retorno do veículo ao pátio da locadora
  • vehicle_id: (String)
    • ID do veículo que está sendo vistoriado.

departure

  • baby_chair (Boolean)
    • Se tem cadeira de bebe ou não
  • windows (Boolean)
    • Se os vidros estão 'ok' (true), ou se tem algum dano/anomalia (false)
  • head_rest (Boolean)
    • Se os encostos de cabeça estão 'ok' (true), ou se tem algum dano/anomalia (false)
  • car_document (Boolean)
    • Se tem todos os documentos do veículo (true), ou se tem algum faltando (false)
  • car_jack (Boolean)
    • Se tem macaco hidraúlico (true), ou se não tem (false)
  • spare_tire (Boolean)
    • Se tem o Pneu Reserva (true), ou se não tem (false)
  • key (Boolean)
    • Se a chave do veículo está 'ok' (true), ou se não tem (false)
  • fire_extinguisher (Boolean)
    • Se tem extintores (true), ou se não tem (false)
  • windshield_wiper (Boolean)
    • Se os limpadores de parabrisa estão 'ok' (true), ou se não tem (false)
  • seat_belt (Boolean)
    • Se os sintos de segurança estão 'ok' (true), ou se não (false)
  • customer_agreement (Boolean)
    • Se o cliente assinou a vistoria (true), ou não (false)
  • customer_signature (FileUpload)
    • Foto da assinatura do cliente

pictures

  • title (String)
    • O título de cada foto
  • desc (String)
    • Uma breve descrição de cada foto
  • lat (String)
    • Latitude de onde foi tirada a foto
  • long (String)
    • Longitude de onde foi tirada a foto
  • taked_at (String)
    • Data em que a foto foi tirada
  • raw (String)
    • Foto limpa
  • picture (String)
    • Foto editada. Ex: Com desenhos, pinos, círculos, etc.

Retorno 201

{
"content": {
"id": "614ff3c7-3c68-4bba-9e53-753fb4512722",
"vehicle_id": "822732d8-42e5-41eb-b25e-d14c5fb41149",
"user_id": "512e18c8-e3f0-4a31-b3cf-75e19b2a5a56",
"status": "MISSING_ARRIVEMENT",
"from_date": "02/05/2023",
"till_date": "07/05/2023",
"created_at": "2023-06-05T23:02:00.821Z",
"updated_at": "2023-06-05T23:02:00.821Z",
"departure": [
{
"id": "0f1105a9-369e-4ed2-919c-683d6d9cd98d",
"inspection_id": "614ff3c7-3c68-4bba-9e53-753fb4512722",
"customer_agreement": true,
"customer_signature": "url_da_foto",
"windows": true,
"head_rest": true,
"car_document": true,
"car_jack": true,
"spare_tire": true,
"baby_chair": true,
"key": true,
"fire_extinguisher": true,
"windshield_wiper": true,
"seat_belt": true,
"created_at": "2023-06-05T23:02:00.821Z",
"updated_at": "2023-06-05T23:02:00.821Z",
"pictures": [
{
"title": "Foto Traseira",
"desc": "Descrição da Vistoria",
"lat": "43.90",
"long": "42.20",
"taked_at": "02/01/2023",
"raw": "url_da_foto",
"picture": "url_da_foto"
},
]
}
],
"customer": {
"id": "7f848913-fe2b-424d-8467-e3cab5ea9f4c",
"cpf": "097.191.979-86",
"phone": null,
"email": null,
"created_at": "2023-06-05T22:40:09.268Z",
"updated_at": "2023-06-05T22:40:09.268Z",
"deleted": false
}
},
"message": "Inspection created successfully",
"error": null,
"statusCode": 200
}

Criar vistoria de retorno

POST /v1/inspections/arrivement

O objetivo dessa rota é criar uma nova vistoria de retorno

  {
"inspection_id": "614ff3c7-3c68-4bba-9e53-753fb4512722",
"arrivementInspectionInput": {
"baby_chair": true,
"windows": true,
"head_rest": true,
"car_document": true,
"car_jack": true,
"spare_tire": true,
"key": true,
"fire_extinguisher": true,
"windshield_wiper": true,
"seat_belt": true,
"customer_agreement": true,
"customer_signature": FileUpload,
"pictures": [
{
"title": "Foto Frontal",
"desc": "Descrição da Vistoria",
"lat": "43.90",
"long": "42.20",
"taked_at": "02/01/2023",
"raw": FileUpload,
"picture": FileUpload
},
{
"title": "Foto Traseira",
"desc": "Descrição da Vistoria",
"lat": "43.90",
"long": "42.20",
"taked_at": "02/01/2023",
"raw": FileUpload,
"picture": FileUpload
},
]
}
}

Atributos

  • inspection_id: (String)
    • ID da vistoria de saída do veículo

arrivementInspectionInput

  • baby_chair (Boolean)
    • Se tem cadeira de bebe ou não
  • windows (Boolean)
    • Se os vidros estão 'ok' (true), ou se tem algum dano/anomalia (false)
  • head_rest (Boolean)
    • Se os encostos de cabeça estão 'ok' (true), ou se tem algum dano/anomalia (false)
  • car_document (Boolean)
    • Se tem todos os documentos do veículo (true), ou se tem algum faltando (false)
  • car_jack (Boolean)
    • Se tem macaco hidraúlico (true), ou se não tem (false)
  • spare_tire (Boolean)
    • Se tem o Pneu Reserva (true), ou se não tem (false)
  • key (Boolean)
    • Se a chave do veículo está 'ok' (true), ou se não tem (false)
  • fire_extinguisher (Boolean)
    • Se tem extintores (true), ou se não tem (false)
  • windshield_wiper (Boolean)
    • Se os limpadores de parabrisa estão 'ok' (true), ou se não tem (false)
  • seat_belt (Boolean)
    • Se os sintos de segurança estão 'ok' (true), ou se não (false)
  • customer_agreement (Boolean)
    • Se o cliente assinou a vistoria (true), ou não (false)
  • customer_signature (FileUpload)
    • Foto da assinatura do cliente

pictures

  • title (String)
    • O título de cada foto
  • desc (String)
    • Uma breve descrição de cada foto
  • lat (String)
    • Latitude de onde foi tirada a foto
  • long (String)
    • Longitude de onde foi tirada a foto
  • taked_at (String)
    • Data em que a foto foi tirada
  • raw (String)
    • Foto limpa
  • picture (String)
    • Foto editada. Ex: Com desenhos, pinos, círculos, etc.

Retorno 201

{
"content": {
"id": "614ff3c7-3c68-4bba-9e53-753fb4512722",
"vehicle_id": "822732d8-42e5-41eb-b25e-d14c5fb41149",
"user_id": "512e18c8-e3f0-4a31-b3cf-75e19b2a5a56",
"status": "FINISHED",
"from_date": "02/05/2023",
"till_date": "07/05/2023",
"created_at": "2023-06-05T23:02:00.821Z",
"updated_at": "2023-06-05T23:07:05.469Z",
"departure": [
{
"id": "0f1105a9-369e-4ed2-919c-683d6d9cd98d",
"inspection_id": "614ff3c7-3c68-4bba-9e53-753fb4512722",
"customer_agreement": true,
"customer_signature": "url_da_foto",
"windows": true,
"head_rest": true,
"car_document": true,
"car_jack": true,
"spare_tire": true,
"baby_chair": true,
"key": true,
"fire_extinguisher": true,
"windshield_wiper": true,
"seat_belt": true,
"created_at": "2023-06-05T23:02:00.821Z",
"updated_at": "2023-06-05T23:02:00.821Z",
"pictures": []
}
],
"customer": {
"id": "7f848913-fe2b-424d-8467-e3cab5ea9f4c",
"cpf": "097.191.979-86",
"phone": null,
"email": null,
"created_at": "2023-06-05T22:40:09.268Z",
"updated_at": "2023-06-05T22:40:09.268Z",
"deleted": false
}
},
"message": "Inspection created successfully",
"error": null,
"statusCode": 200
}

Listar todas as vistorias

GET: /v1/inspections

O objetivo dessa rota é trazer todas as vistorias já feitas

Retorno 200

{
"content": [
{
"id": "614ff3c7-3c68-4bba-9e53-753fb4512722",
"vehicle_id": "822732d8-42e5-41eb-b25e-d14c5fb41149",
"user_id": "512e18c8-e3f0-4a31-b3cf-75e19b2a5a56",
"status": "FINISHED",
"from_date": "02/05/2023",
"till_date": "07/05/2023",
"created_at": "2023-06-05T23:02:00.821Z",
"updated_at": "2023-06-05T23:07:05.469Z",
"departure": [
{
"id": "0f1105a9-369e-4ed2-919c-683d6d9cd98d",
"inspection_id": "614ff3c7-3c68-4bba-9e53-753fb4512722",
"customer_agreement": true,
"customer_signature": "",
"windows": true,
"head_rest": true,
"car_document": true,
"car_jack": true,
"spare_tire": true,
"baby_chair": true,
"key": true,
"fire_extinguisher": true,
"windshield_wiper": true,
"seat_belt": true,
"created_at": "2023-06-05T23:02:00.821Z",
"updated_at": "2023-06-05T23:02:00.821Z",
"pictures": []
}
],
"customer": {
"id": "7f848913-fe2b-424d-8467-e3cab5ea9f4c",
"cpf": "097.191.979-86",
"phone": null,
"email": null,
"created_at": "2023-06-05T22:40:09.268Z",
"updated_at": "2023-06-05T22:40:09.268Z",
"deleted": false
}
},
{
"id": "fa94428f-f9cb-4956-8cb4-eba0aa174878",
"vehicle_id": "822732d8-42e5-41eb-b25e-d14c5fb41149",
"user_id": "512e18c8-e3f0-4a31-b3cf-75e19b2a5a56",
"status": "MISSING_ARRIVEMENT",
"from_date": "02/05/2023",
"till_date": "07/05/2023",
"created_at": "2023-06-05T22:56:56.593Z",
"updated_at": "2023-06-05T22:56:56.593Z",
"departure": [
{
"id": "dcee4cb9-a32b-4579-bd12-d5569f3a0c79",
"inspection_id": "fa94428f-f9cb-4956-8cb4-eba0aa174878",
"customer_agreement": true,
"customer_signature": "",
"windows": true,
"head_rest": true,
"car_document": true,
"car_jack": true,
"spare_tire": true,
"baby_chair": true,
"key": true,
"fire_extinguisher": true,
"windshield_wiper": true,
"seat_belt": true,
"created_at": "2023-06-05T22:56:56.593Z",
"updated_at": "2023-06-05T22:56:56.593Z",
"pictures": []
}
],
"customer": {
"id": "7f848913-fe2b-424d-8467-e3cab5ea9f4c",
"cpf": "097.191.979-86",
"phone": null,
"email": null,
"created_at": "2023-06-05T22:40:09.268Z",
"updated_at": "2023-06-05T22:40:09.268Z",
"deleted": false
}
}
],
"message": "Inspections retrieved successfully",
"error": null,
"statusCode": 200
}

Encontrar consulta por ID

GET: /v1/inspections/:ID

O objetivo dessa rota é trazer uma vistoria a partir do seu ID

Retorno 200

{
"content": {
"id": "614ff3c7-3c68-4bba-9e53-753fb4512722",
"vehicle_id": "822732d8-42e5-41eb-b25e-d14c5fb41149",
"user_id": "512e18c8-e3f0-4a31-b3cf-75e19b2a5a56",
"status": "FINISHED",
"from_date": "02/05/2023",
"till_date": "07/05/2023",
"created_at": "2023-06-05T23:02:00.821Z",
"updated_at": "2023-06-05T23:07:05.469Z",
"departure": [
{
"id": "0f1105a9-369e-4ed2-919c-683d6d9cd98d",
"inspection_id": "614ff3c7-3c68-4bba-9e53-753fb4512722",
"customer_agreement": true,
"customer_signature": "",
"windows": true,
"head_rest": true,
"car_document": true,
"car_jack": true,
"spare_tire": true,
"baby_chair": true,
"key": true,
"fire_extinguisher": true,
"windshield_wiper": true,
"seat_belt": true,
"created_at": "2023-06-05T23:02:00.821Z",
"updated_at": "2023-06-05T23:02:00.821Z",
"pictures": []
}
],
"customer": {
"id": "7f848913-fe2b-424d-8467-e3cab5ea9f4c",
"cpf": "097.191.979-86",
"phone": null,
"email": null,
"created_at": "2023-06-05T22:40:09.268Z",
"updated_at": "2023-06-05T22:40:09.268Z",
"deleted": false
}
},
"message": "Inspection retrieved successfully",
"error": null,
"statusCode": 200
}