LIST RENTALS - GET /rentals/{cid}?page={page}&sort={sortColumn}&order={sortOrder}

Request:

/rentals/{cid}?page=1&sort=price&order=ASC

Response:

{
    "status": "ok",
    "rentals": [...]
}

ADD/REMOVE FAVORITE RENTAL - POST /favorite/{id}

If rental exists in favorite it will be deleted, if not - it will be added

Request:

/favorite/3

Response:

{
    "status": "ok"
}

SHOW RENTAL - GET /rental/{id}

Request:

/rental/4

Response:

{
    "status": "ok",
    "rental": {
        "id": 4,
        "blocked": false,
        "status": 1,
        "created": "2021-02-19T12:58:48.000+01:00",
        "user": {
            "id": 4,
            "created": "2020-12-16T00:00:00.000+01:00",
            "email": "example@test.com",
            "first_name": null,
            "last_name": null,
            "phone": null,
            "billing_data": {
                "first_name": null,
                "last_name": null,
                "address": null,
                "postcode": null,
                "country": null,
                "NIP": null,
                "birth_day": null
            },
            "is_blocked": false,
        },
        "description": "qweqweqwe",
        "address": {
            "country": null,
            "city": null,
            "street": null,
            "postcode": null,
            "building_number": null,
            "lat": 26.0160711,
            "lng": -80.4308266
        },
        "rental_data": {
            "name": "vsda",
            "address": "vs",
            "postcode": "vsa",
            "country": "AF",
            "NIP": "1232"
        },
        "images": [],
        "certificates": [],
        "availabilities": [
            {
                "start": "2020-02-14T00:00:00.000+01:00",
                "end": "2021-12-20T00:00:00.000+01:00"
            }
        ],
        "working_hours": [
            {
                "day": 1,
                "start": "1970-01-01T09:00:00.000+01:00",
                "end": "1970-01-01T17:00:00.000+01:00",
                "closed": false
            },
            {
                "day": 2,
                "start": "1970-01-01T09:00:00.000+01:00",
                "end": "1970-01-01T17:00:00.000+01:00",
                "closed": false
            },
            {
                "day": 3,
                "start": "1970-01-01T09:00:00.000+01:00",
                "end": "1970-01-01T17:00:00.000+01:00",
                "closed": false
            },
            {
                "day": 4,
                "start": "1970-01-01T09:00:00.000+01:00",
                "end": "1970-01-01T17:00:00.000+01:00",
                "closed": false
            },
            {
                "day": 5,
                "start": "1970-01-01T09:00:00.000+01:00",
                "end": "1970-01-01T17:00:00.000+01:00",
                "closed": false
            },
            {
                "day": 6,
                "start": "1970-01-01T09:00:00.000+01:00",
                "end": "1970-01-01T17:00:00.000+01:00",
                "closed": false
            },
            {
                "day": 7,
                "start": "1970-01-01T09:00:00.000+01:00",
                "end": "1970-01-01T17:00:00.000+01:00",
                "closed": false
            }
        ],
        "price": 12,
        "size": 12,
        "link": https://example.com,
        "type": 1
    },
    "is_favorite": false
}

CHECK RENTAL AVAILABILITY - POST /rental/{id}/availability

Check if rental is available in period of time.

Request:

/rental/1/availability

body:

{
    "start": "2021-09-03",
    "end": "2021-09-05"
}

Response:

{
    "status": "ok",
    "available" : true
}

ADD RENTAL OFFER - POST /company/{id}/offer/create

Request:

/company/2/offer/create

body:

{
   "name":"rental name",
   "description": "description",
   "instructions": "instructions",
   "terms": "terms",
   "country": "PL",
   "city": "city",
   "buildingNumber": "3",
   "postcode": "10-900",
   "size": "123",
   "price": "33",
   "street": "Test Street",
   "rentalName": "John Doe",
   "rentalAddress": "Testowa 1/2",
   "rentalCountry": "PL",
   "rentalNIP": "123123123",
   "rentalAccountNumber": "1234356433250000342412",
   "rentalPhone": "512345678",
   "rentalEmail": "test@example.com"

}

Response:

{
    "status": "ok",
    "offer" : [...]
}

EDIT RENTAL OFFER - POST /company/{id}/offer/edit/{pid}

id - company id
pid - offer id

Request:

/company/2/offer/edit/15

body:

{
   "name":"rental name",
   "description": "description",
   "instructions": "instructions",
   "terms": "terms",
   "country": "PL",
   "city": "city",
   "buildingNumber": "3",
   "postcode": "10-900",
   "size": "123",
   "price": "33",
   "street": "Test Street",
   "rentalName": "John Doe",
   "rentalAddress": "Testowa 1/2",
   "rentalCountry": "PL",
   "rentalNIP": "123123123",
   "rentalAccountNumber": "1234356433250000342412",
   "rentalPhone": "512345678",
   "rentalEmail": "test@example.com"

}

Response:

{
    "status": "ok",
    "offer" : [...]
}

REMOVE RENTAL OFFER - POST /company/{id}/offer/remove/{pid}

id - company id
pid - offer id

Request:

/company/2/offer/remove/15

Response:

{
    "status": "ok"
}

ADD BUSINESS CARD - POST /company/{id}/bc/create

Request:

/company/2/bc/create

body:

{
   "name":"buisness card name",
   "description": "description",
   "link": "https://example.com",
   "country": "PL",
   "city": "city",
   "buildingNumber": "3",
   "postcode": "10-900",
   "size": "123",
   "street": "Test street"
}

Response:

{
    "status": "ok",
    "offer" : [...]
}