-
Notifications
You must be signed in to change notification settings - Fork 0
feat: create "identity" field for Site #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ananyaa06
wants to merge
8
commits into
main
Choose a base branch
from
AnanyaDev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6fb9404
feat: update schemas to include endpoints to store and edit sites
ananyaa06 c8cfec7
refactor: replace api/public-sites with api/sites and make changes to…
ananyaa06 2a5809d
refactor: remove old-sites
ananyaa06 d63bae7
fix: put edit-sites behind secure
ananyaa06 f2f41b8
feat: add "identity" to Site schema
ananyaa06 9160d1c
feat: create new types of site requests
ananyaa06 a93c441
refactor: change cell-id to reflect that it's plural
ananyaa06 5de4b79
refactor: change boundary to boundary_array to reflect that it's plural
ananyaa06 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" | ||
| 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: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| 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: | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?