# Streetlity Maintenance
Documentation about streetlity maintenance
## History
This is empty
## Order
Include methods for working with maintenance service, include Create, Accept, Deny and Complete.
### Request
Create a new order by specified common user and maintenance users, server will send the information of the user to the maintenance users via notification.
When an order is created, the client could connect to the server via the address that server return.
**Path**: `/order/request`
**Method**: `POST`
**Param**:
<pre>
- common_user: username of the common user
- maintenance_users (array): username of the maintenance users
- reason: reason for the order
- note (optional): take note for the maintenance user who accept the request
</pre>
**Return**:
<pre>
- Order: information of the created order
</pre>
### Accept
Accept a specified order
**Path**: `/order/accept`
**Method**: `POST`
**Param**:
<pre>
- maintenance_user: username of the maintenance user who accept the request
- order_id: id of the order. Only the users who received the notification in Request step could has the order id.
</pre>
### Deny
Mark the order as denied and clsoe the order
**Path**: `/order/deny`
**Method**: `POST`
**Param**:
<pre>
- order_id: id of the order
- deny_type: type of the deny, include there values:
- 1: deny by the common user
- 2: deny by the maintenance user
- 3: deny by the system
- reason (optional): the reason why deny
</pre>
### Complete
Mark the order as completed and close the order
**Path**: `/order/complete`
**Method**: `POST`
**Param**:
<pre>
- order_id: id of the order
</pre>
## Emergency
### Get a specified emergency maintenance
Return a specified emergency by id
**Path**: `/emergency/`
**Method**: `GET`
**Param**:
<pre>
- id: username of the emergency maintenance
</pre>
**Return**:
<pre>
- Emergency
</pre>
### Create emergency maintenance
**Path**: `/emergency/`
**Method**: `POST`
**Param**:
<pre>
- id: username of the user
- lat: latitude of the user
- lon: longitude of the user
</pre>
### Remove emergency maintenance
**Path**: `/emergency/`
**Method**: `DELETE`
**Param**:
<pre>
- id: username of the user
</pre>
### Update location
Update location of a specific emergency maintenance
**Path**: `/emergency/location`
**Method**: `POST`
**Param**:
<pre>
- id: username of the user
- lat: latitude of the user
- lon: longitude of the user
</pre>
### Get emergency maintenance in range
Get emergency maintenances that are in a specific radius.
**Path**: `/emergency/range`
**Method**: `GET`
**Param**:
<pre>
- lat: latidude
- lon: longitude
- range: radius to find
</pre>
**Return**:
<pre>
- Emergencies
</pre>