Skip to content

andreagostinho-meli/desafio-quality

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Documentação da API

URL Base
http://localhost:8080

1. Bairros

a. Criar bairro

Método Rota
POST /districts

Request body

{
    "district_name": "Laranjeiras",
    "value_district_m2": "400"
}

Response

Success status: 201 Created

{
    "district_id": 1,
    "district_name": "Laranjeiras",
    "value_district_m2": 400
}

2. Propriedades

a. Criar propriedade

Método Rota
POST /properties

Request body

{
    "prop_name": "Fazenda Boa Vista",
    "prop_district_id": 1,
    "rooms": [
        {
            "room_name": "Sala de estar",
            "room_width": 20,
            "room_length": 20
        },
        {
            "room_name": "Cozinha",
            "room_width": 30,
            "room_length": 30
        }
    ]
}

Response

Success status: 201 Created

{
    "prop_id": 1,
    "prop_name": "Fazenda Boa Vista",
    "prop_district": "Laranjeiras",
    "value_district_m2": 400,
    "rooms": [
        {
            "room_name": "Sala de estar",
            "room_width": 20.0,
            "room_length": 20.0
        },
        {
            "room_name": "Cozinha",
            "room_width": 30.0,
            "room_length": 30.0
        }
    ]
}

b. Calcule o total de metros quadrados de uma propriedade [US 0001]

Método Rota
GET /properties/total_m2/{propertyId}

Request body

empty

Response

Success status: 200 OK

{
    "total_m2": 1300.0
}

c. Indique o valor de uma propriedade com base em seus cômodos e medidas [US 0002]

Método Rota
GET /properties/value/{propertyId}

Request body

empty

Response

Success status: 200 OK

{
    "value": 520000.0
}

d. Determine qual é o maior cômodo [US 0003]

Método Rota
GET /properties/{propertyId}/largest_room

Request body

empty

Response

Success status: 200 OK

{
    "largest_room": {
        "name": "Cozinha",
        "width": 30.0,
        "length": 30.0
    }
}

e. Determinar a quantidade de metros quadrados que tem cada cômodo de uma propriedade [US 0004]

Método Rota
GET /properties/{propertyId}/rooms_m2

Request body

empty

Response

Success status: 200 OK

{
    "rooms": [
        {
            "room_name": "Sala de estar",
            "room_width": 20.0,
            "room_length": 20.0,
            "total_m2": 400.0
        },
        {
            "room_name": "Cozinha",
            "room_width": 30.0,
            "room_length": 30.0,
            "total_m2": 900.0
        }
    ]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages