|
| 1 | +paths: |
| 2 | + /api/v1/property: |
| 3 | + post: |
| 4 | + tags: |
| 5 | + - Property |
| 6 | + summary: Create a property advert |
| 7 | + security: |
| 8 | + - bearerAuth: [] |
| 9 | + produces: |
| 10 | + - application/json |
| 11 | + parameters: |
| 12 | + - in: body |
| 13 | + name: property |
| 14 | + description: It enables a user to create a property |
| 15 | + schema: |
| 16 | + $ref: '#/definitions/property' |
| 17 | + responses: |
| 18 | + 201: |
| 19 | + description: Successfully created |
| 20 | + 400: |
| 21 | + description: Please fill all the required fields |
| 22 | + 403: |
| 23 | + description: Token required. Please sign in or register as a user |
| 24 | + 500: |
| 25 | + description: Internal server error |
| 26 | + get: |
| 27 | + tags: |
| 28 | + - Property |
| 29 | + summary: Get all properties |
| 30 | + security: |
| 31 | + - bearerAuth: [] |
| 32 | + produces: |
| 33 | + - application/json |
| 34 | + responses: |
| 35 | + 200: |
| 36 | + description: Got all property adverts successfully |
| 37 | + 403: |
| 38 | + description: Token required. Please sign in or register as a user |
| 39 | + 404: |
| 40 | + description: No property found |
| 41 | + 500: |
| 42 | + description: Internal server error |
| 43 | + |
| 44 | + /api/v1/property/{property_id}: |
| 45 | + get: |
| 46 | + tags: |
| 47 | + - Property |
| 48 | + summary: View a specific property advert |
| 49 | + security: |
| 50 | + - bearerAuth: [] |
| 51 | + produces: |
| 52 | + - application/json |
| 53 | + parameters: |
| 54 | + - in: path |
| 55 | + name: property_id |
| 56 | + schema: |
| 57 | + type: integer |
| 58 | + required: true |
| 59 | + description: It enables a user to view a specific property advert |
| 60 | + responses: |
| 61 | + 200: |
| 62 | + description: Got the specific property advert successfully |
| 63 | + 403: |
| 64 | + description: Token required. Please sign in or register as a user |
| 65 | + 404: |
| 66 | + description: No property found |
| 67 | + 500: |
| 68 | + description: Internal server error |
| 69 | + |
| 70 | + patch: |
| 71 | + tags: |
| 72 | + - Property |
| 73 | + summary: Update property data |
| 74 | + security: |
| 75 | + - bearerAuth: [] |
| 76 | + produces: |
| 77 | + - application/json |
| 78 | + parameters: |
| 79 | + - in: path |
| 80 | + name: property_id |
| 81 | + schema: |
| 82 | + type: integer |
| 83 | + required: true |
| 84 | + description: property advert to modify |
| 85 | + - in: body |
| 86 | + name: property |
| 87 | + description: fields to update |
| 88 | + schema: |
| 89 | + $ref: '#/definitions/property' |
| 90 | + responses: |
| 91 | + 200: |
| 92 | + description: Updated Successfully |
| 93 | + 403: |
| 94 | + description: Token required. Please sign in or register as a user |
| 95 | + 404: |
| 96 | + description: Property not found |
| 97 | + 500: |
| 98 | + description: Internal server error |
| 99 | + |
| 100 | + delete: |
| 101 | + tags: |
| 102 | + - Property |
| 103 | + summary: Delete a property advert |
| 104 | + security: |
| 105 | + - bearerAuth: [] |
| 106 | + produces: |
| 107 | + - application/json |
| 108 | + parameters: |
| 109 | + - in: path |
| 110 | + name: property_id |
| 111 | + schema: |
| 112 | + type: integer |
| 113 | + required: true |
| 114 | + description: property advert to delete |
| 115 | + responses: |
| 116 | + 200: |
| 117 | + description: Deleted Successfully |
| 118 | + 403: |
| 119 | + description: Token required. Please sign in or register as a user |
| 120 | + 404: |
| 121 | + description: Property id not found |
| 122 | + 500: |
| 123 | + description: Internal server error |
| 124 | + |
| 125 | + /api/v1/properties: |
| 126 | + get: |
| 127 | + tags: |
| 128 | + - Property |
| 129 | + summary: Get all property advertisement offering a specific type of property |
| 130 | + security: |
| 131 | + - bearerAuth: [] |
| 132 | + produces: |
| 133 | + - application/json |
| 134 | + parameters: |
| 135 | + - in: query |
| 136 | + name: type |
| 137 | + schema: |
| 138 | + type: string |
| 139 | + required: true |
| 140 | + description: The number of specific type of property to return |
| 141 | + responses: |
| 142 | + 200: |
| 143 | + description: Got the property type successfully |
| 144 | + 400: |
| 145 | + description: No valid query detected e.g properties?type=duplex |
| 146 | + 403: |
| 147 | + description: Token required. Please sign in or register as a user |
| 148 | + 404: |
| 149 | + description: Property type not found. Check the property type query value |
| 150 | + 500: |
| 151 | + description: Internal server error |
| 152 | + |
| 153 | + /api/v1/property/{property_id}/sold: |
| 154 | + patch: |
| 155 | + tags: |
| 156 | + - Property |
| 157 | + summary: Mark a property as sold so users know it’s no longer available |
| 158 | + security: |
| 159 | + - bearerAuth: [] |
| 160 | + produces: |
| 161 | + - application/json |
| 162 | + parameters: |
| 163 | + - in: path |
| 164 | + name: property_id |
| 165 | + schema: |
| 166 | + type: integer |
| 167 | + required: true |
| 168 | + description: property advert to modify |
| 169 | + - in: body |
| 170 | + name: property status |
| 171 | + description: change status to sold |
| 172 | + schema: |
| 173 | + $ref: '#/definitions/propertyStatus' |
| 174 | + responses: |
| 175 | + 200: |
| 176 | + description: Mark as sold successfully |
| 177 | + 403: |
| 178 | + description: Token required. Please sign in or register as a user |
| 179 | + 404: |
| 180 | + description: Property not found |
| 181 | + 500: |
| 182 | + description: Internal server error |
| 183 | + |
| 184 | +definitions: |
| 185 | + property: |
| 186 | + type: object |
| 187 | + required: |
| 188 | + - price |
| 189 | + - state |
| 190 | + - city |
| 191 | + - address |
| 192 | + - type |
| 193 | + - image_url |
| 194 | + properties: |
| 195 | + price: |
| 196 | + type: real |
| 197 | + example: 24567.00 |
| 198 | + state: |
| 199 | + type: string |
| 200 | + example: Lagos |
| 201 | + city: |
| 202 | + type: string |
| 203 | + example: Oworo |
| 204 | + address: |
| 205 | + type: string |
| 206 | + example: 2, kokumo |
| 207 | + type: |
| 208 | + type: string |
| 209 | + example: duplex |
| 210 | + image_url: |
| 211 | + type: string |
| 212 | + example: https://pixabay.com/photos/portrait-woman-lady-coffee-bar-4246954/ |
| 213 | + |
| 214 | + propertyStatus: |
| 215 | + type: object |
| 216 | + required: |
| 217 | + - status |
| 218 | + properties: |
| 219 | + status: |
| 220 | + type: string |
| 221 | + example: sold |
| 222 | + readOnly: true |
0 commit comments