From 6fb94043689db4a0df1c05f7ff6e64cf06221ded Mon Sep 17 00:00:00 2001 From: Ananya Aatreya Date: Thu, 31 Jul 2025 22:22:28 -0700 Subject: [PATCH 1/9] feat: update schemas to include endpoints to store and edit sites --- openapi/v1/ccn-coverage-api.yaml | 145 +++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) diff --git a/openapi/v1/ccn-coverage-api.yaml b/openapi/v1/ccn-coverage-api.yaml index 1e6f34f..2cf1f21 100644 --- a/openapi/v1/ccn-coverage-api.yaml +++ b/openapi/v1/ccn-coverage-api.yaml @@ -911,6 +911,30 @@ paths: type: array items: $ref: '#/components/schemas/Site' + /api/public-sites: + get: + summary: Get sites list + description: Returns a list of public sites + responses: + '200': + description: List of public sites + content: + application/json: + schema: + type: object + properties: + sites: + type: array + description: List of sites + items: + $ref: '#/components/schemas/Site' + '500': + description: Server error + content: + text/plain: + schema: + type: string + example: "Internal server error" /secure/get_groups: post: summary: Get distinct group identifiers @@ -1253,6 +1277,127 @@ paths: description: Error message from cryptographic operation '503': description: Database operation error + content: + text/plain: + schema: + type: string + example: "database error" + /api/secure-site: + 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/Site' + 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 + security: + - sessionAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Site' + 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: From c8cfec7af05e4090c466f68aa5a6d2e4c6771f7f Mon Sep 17 00:00:00 2001 From: Ananya Aatreya Date: Sat, 9 Aug 2025 16:34:04 -0700 Subject: [PATCH 2/9] refactor: replace api/public-sites with api/sites and make changes to preserve backwards compatibility --- openapi/v1/ccn-coverage-api.yaml | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/openapi/v1/ccn-coverage-api.yaml b/openapi/v1/ccn-coverage-api.yaml index 2cf1f21..e87066f 100644 --- a/openapi/v1/ccn-coverage-api.yaml +++ b/openapi/v1/ccn-coverage-api.yaml @@ -897,11 +897,11 @@ paths: schema: type: string example: "database error" - /api/sites: + /api/old-sites: get: summary: Get all sites description: Returns a list of all available sites with their location and status information - operationId: getSites + operationId: getSitesOld responses: '200': description: List of sites @@ -911,30 +911,20 @@ paths: type: array items: $ref: '#/components/schemas/Site' - /api/public-sites: + /api/sites: get: - summary: Get sites list - description: Returns a list of public sites + summary: Get all sites + description: Returns a list of all available sites with their location and status information + operationId: getSites responses: '200': - description: List of public sites + description: List of sites content: application/json: schema: - type: object - properties: - sites: - type: array - description: List of sites - items: - $ref: '#/components/schemas/Site' - '500': - description: Server error - content: - text/plain: - schema: - type: string - example: "Internal server error" + type: array + items: + $ref: '#/components/schemas/Site' /secure/get_groups: post: summary: Get distinct group identifiers From 2a5809d68bbb7004efc852707cf5b12ae44befb3 Mon Sep 17 00:00:00 2001 From: Ananya Aatreya Date: Wed, 27 Aug 2025 20:28:38 -0700 Subject: [PATCH 3/9] refactor: remove old-sites --- openapi/v1/ccn-coverage-api.yaml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/openapi/v1/ccn-coverage-api.yaml b/openapi/v1/ccn-coverage-api.yaml index e87066f..e679e92 100644 --- a/openapi/v1/ccn-coverage-api.yaml +++ b/openapi/v1/ccn-coverage-api.yaml @@ -897,20 +897,6 @@ paths: schema: type: string example: "database error" - /api/old-sites: - get: - summary: Get all sites - description: Returns a list of all available sites with their location and status information - operationId: getSitesOld - responses: - '200': - description: List of sites - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Site' /api/sites: get: summary: Get all sites From d63bae7ca17d7b4351d0bb71843d77b574056e55 Mon Sep 17 00:00:00 2001 From: Ananya Aatreya Date: Thu, 28 Aug 2025 12:06:08 -0700 Subject: [PATCH 4/9] fix: put edit-sites behind secure --- openapi/v1/ccn-coverage-api.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/v1/ccn-coverage-api.yaml b/openapi/v1/ccn-coverage-api.yaml index e679e92..626bd1c 100644 --- a/openapi/v1/ccn-coverage-api.yaml +++ b/openapi/v1/ccn-coverage-api.yaml @@ -1258,7 +1258,7 @@ paths: schema: type: string example: "database error" - /api/secure-site: + /secure/edit-sites: put: summary: Update an existing site description: Updates an existing site with the provided information From f2f41b8ec5c04955cf58fd53b1ae00aaf0f2066c Mon Sep 17 00:00:00 2001 From: Ananya Aatreya Date: Mon, 20 Oct 2025 22:43:19 -0700 Subject: [PATCH 5/9] feat: add "identity" to Site schema --- openapi/v1/ccn-coverage-api.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openapi/v1/ccn-coverage-api.yaml b/openapi/v1/ccn-coverage-api.yaml index 626bd1c..c2d2c07 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 From 9160d1c50395b533f15840658037c1a51949b468 Mon Sep 17 00:00:00 2001 From: Ananya Aatreya Date: Sun, 26 Oct 2025 22:41:32 -0700 Subject: [PATCH 6/9] feat: create new types of site requests --- openapi/v1/ccn-coverage-api.yaml | 66 ++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/openapi/v1/ccn-coverage-api.yaml b/openapi/v1/ccn-coverage-api.yaml index c2d2c07..8fbfb92 100644 --- a/openapi/v1/ccn-coverage-api.yaml +++ b/openapi/v1/ccn-coverage-api.yaml @@ -298,6 +298,59 @@ components: 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_id: + 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: + 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 SitesSummary: type: object additionalProperties: @@ -1314,7 +1367,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Site' + $ref: '#/components/schemas/NewSiteRequest' responses: '201': description: Site successfully created @@ -1346,7 +1399,7 @@ paths: example: "database error" delete: summary: Delete a site - description: Removes an existing site from the system + description: Removes an existing site from the system using its unique identity security: - sessionAuth: [] requestBody: @@ -1354,7 +1407,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Site' + 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 From a93c4417d940e40feb3b857f0691203abd466f14 Mon Sep 17 00:00:00 2001 From: Ananya Aatreya Date: Wed, 29 Oct 2025 09:30:49 -0700 Subject: [PATCH 7/9] refactor: change cell-id to reflect that it's plural --- openapi/v1/ccn-coverage-api.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi/v1/ccn-coverage-api.yaml b/openapi/v1/ccn-coverage-api.yaml index 8fbfb92..3dd635e 100644 --- a/openapi/v1/ccn-coverage-api.yaml +++ b/openapi/v1/ccn-coverage-api.yaml @@ -278,7 +278,7 @@ 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: @@ -331,7 +331,7 @@ 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: From 5de4b798a428ef96d6714d3e183313b771cc1a4c Mon Sep 17 00:00:00 2001 From: Ananya Aatreya Date: Wed, 29 Oct 2025 09:31:45 -0700 Subject: [PATCH 8/9] refactor: change boundary to boundary_array to reflect that it's plural --- openapi/v1/ccn-coverage-api.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi/v1/ccn-coverage-api.yaml b/openapi/v1/ccn-coverage-api.yaml index 3dd635e..3534da8 100644 --- a/openapi/v1/ccn-coverage-api.yaml +++ b/openapi/v1/ccn-coverage-api.yaml @@ -288,7 +288,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: @@ -341,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: From 77cf82533953a65bbb76dde53250699a1b2a5b82 Mon Sep 17 00:00:00 2001 From: Ananya Aatreya Date: Mon, 10 Nov 2025 21:28:15 -0800 Subject: [PATCH 9/9] refactor: change "boundary_array" to "boundaries" and provide example of UUID --- openapi/v1/ccn-coverage-api.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openapi/v1/ccn-coverage-api.yaml b/openapi/v1/ccn-coverage-api.yaml index 3534da8..22aa1a5 100644 --- a/openapi/v1/ccn-coverage-api.yaml +++ b/openapi/v1/ccn-coverage-api.yaml @@ -253,8 +253,8 @@ components: properties: identity: type: string - description: Unique identifier of the user to update - example: "9a8b7c6d5e4f3g2h1i" + description: Unique identifier of the site + example: "123e4567-e89b-12d3-a456-426614174000" name: type: string description: Name of the site @@ -288,7 +288,7 @@ components: type: string description: Optional color identifier for the site in hex code example: "#FF5733" - boundary_array: + boundaries: type: array description: Optional geographical boundary coordinates defining the site perimeter as [latitude, longitude] pairs items: @@ -1414,7 +1414,7 @@ paths: identity: type: string description: The unique identifier of the site to delete - example: "9a8b7c6d5e4f3g2h1i" + example: "123e4567-e89b-12d3-a456-426614174000" responses: '200': description: Site successfully deleted