diff --git a/openapi/v1/ccn-coverage-api.yaml b/openapi/v1/ccn-coverage-api.yaml index 1e6f34f..3534da8 100644 --- a/openapi/v1/ccn-coverage-api.yaml +++ b/openapi/v1/ccn-coverage-api.yaml @@ -243,6 +243,7 @@ components: Site: type: object required: + - identity - name - latitude - longitude @@ -250,6 +251,10 @@ components: - address - cell_id properties: + identity: + type: string + description: Unique identifier of the user to update + example: "9a8b7c6d5e4f3g2h1i" name: type: string description: Name of the site @@ -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: @@ -283,7 +341,7 @@ components: type: string description: Optional color identifier for the site in hex code example: "#FF5733" - boundary: + boundary_array: type: array description: Optional geographical boundary coordinates defining the site perimeter as [latitude, longitude] pairs items: @@ -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: