Skip to content
190 changes: 188 additions & 2 deletions openapi/v1/ccn-coverage-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,18 @@ components:
Site:
type: object
required:
- identity
- name
- latitude
- longitude
- status
- address
- cell_id
properties:
identity:
type: string
description: Unique identifier of the user to update
example: "9a8b7c6d5e4f3g2h1i"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put a more specific uuid example?

name:
type: string
description: Name of the site
Expand All @@ -273,7 +278,60 @@ components:
type: string
description: Physical address of the site
example: "5740 Martin Luther King Jr Way S, Seattle, WA 98118"
cell_id:
cell_ids:
type: array
description: Array of cell identifiers associated with the site
items:
type: string
example: "cell-123"
color:
type: string
description: Optional color identifier for the site in hex code
example: "#FF5733"
boundary_array:
type: array
description: Optional geographical boundary coordinates defining the site perimeter as [latitude, longitude] pairs
items:
type: array
minItems: 2
maxItems: 2
items:
type: number
format: double
NewSiteRequest:
type: object
required:
- name
- latitude
- longitude
- status
- address
- cell_id
properties:
name:
type: string
description: Name of the site
example: "Filipino Community Center"
latitude:
type: number
format: double
description: Geographic latitude coordinate
example: 47.681932654395915
longitude:
type: number
format: double
description: Geographic longitude coordinate
example: -122.31829217664796
status:
type: string
description: Current status of the site
enum: [active, confirmed, in-conversation]
example: "active"
address:
type: string
description: Physical address of the site
example: "5740 Martin Luther King Jr Way S, Seattle, WA 98118"
cell_ids:
type: array
description: Array of cell identifiers associated with the site
items:
Expand All @@ -283,7 +341,7 @@ components:
type: string
description: Optional color identifier for the site in hex code
example: "#FF5733"
boundary:
boundary_array:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boundaries

type: array
description: Optional geographical boundary coordinates defining the site perimeter as [latitude, longitude] pairs
items:
Expand Down Expand Up @@ -1253,6 +1311,134 @@ paths:
description: Error message from cryptographic operation
'503':
description: Database operation error
content:
text/plain:
schema:
type: string
example: "database error"
/secure/edit-sites:
put:
summary: Update an existing site
description: Updates an existing site with the provided information
security:
- sessionAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Site'
responses:
'200':
description: Site successfully updated
content:
text/plain:
schema:
type: string
example: "updated"
'400':
description: Bad request - invalid site data
content:
text/plain:
schema:
type: string
example: "bad request"
'401':
description: Unauthorized - User not logged in
content:
text/plain:
schema:
type: string
example: "Unauthorized, please login"
'500':
description: Server error while updating site
content:
text/plain:
schema:
type: string
example: "database error"
post:
summary: Add a new site
description: Creates a new site with the provided information
security:
- sessionAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/NewSiteRequest'
responses:
'201':
description: Site successfully created
content:
text/plain:
schema:
type: string
example: "created"
'400':
description: Bad request - invalid site data
content:
text/plain:
schema:
type: string
example: "bad request"
'401':
description: Unauthorized - User not logged in
content:
text/plain:
schema:
type: string
example: "Unauthorized, please login"
'500':
description: Server error while creating site
content:
text/plain:
schema:
type: string
example: "database error"
delete:
summary: Delete a site
description: Removes an existing site from the system using its unique identity
security:
- sessionAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- identity
properties:
identity:
type: string
description: The unique identifier of the site to delete
example: "9a8b7c6d5e4f3g2h1i"
responses:
'200':
description: Site successfully deleted
content:
text/plain:
schema:
type: string
example: "deleted"
'400':
description: Bad request - invalid site data
content:
text/plain:
schema:
type: string
example: "bad request"
'401':
description: Unauthorized - User not logged in
content:
text/plain:
schema:
type: string
example: "Unauthorized, please login"
'500':
description: Server error while deleting site
content:
text/plain:
schema:
Expand Down