diff --git a/openapi-src/V2/definitions/DashboardPolygonResponse.yml b/openapi-src/V2/definitions/DashboardPolygonResponse.yml new file mode 100644 index 000000000..9c9315201 --- /dev/null +++ b/openapi-src/V2/definitions/DashboardPolygonResponse.yml @@ -0,0 +1,4 @@ +type: object +properties: + uuid: + type: string \ No newline at end of file diff --git a/openapi-src/V2/definitions/FeatureCollection.yml b/openapi-src/V2/definitions/FeatureCollection.yml new file mode 100644 index 000000000..bdd465cd7 --- /dev/null +++ b/openapi-src/V2/definitions/FeatureCollection.yml @@ -0,0 +1,4 @@ +type: object +properties: + type: + type: string \ No newline at end of file diff --git a/openapi-src/V2/definitions/_index.yml b/openapi-src/V2/definitions/_index.yml index 619262284..c96900df3 100644 --- a/openapi-src/V2/definitions/_index.yml +++ b/openapi-src/V2/definitions/_index.yml @@ -294,6 +294,12 @@ SitePolygonCreateResponse: $ref: './SitePolygonCreateResponse.yml' GeoJSONResponse: $ref: './GeoJSONResponse.yml' +FeatureCollection: + $ref: './FeatureCollection.yml' +PolygonBboxResponse: + $ref: './SitePolygonsBboxResponse.yml' +DashboardPolygonResponse: + $ref: './DashboardPolygonResponse.yml' DashboardJobsCreatedResponse: $ref: './DashboardJobsCreatedResponse.yml' DashboardJobsCreatedData: diff --git a/openapi-src/V2/paths/Terrafund/get-v2-geojson-site.yml b/openapi-src/V2/paths/Terrafund/get-v2-geojson-site.yml new file mode 100644 index 000000000..c129b8e5e --- /dev/null +++ b/openapi-src/V2/paths/Terrafund/get-v2-geojson-site.yml @@ -0,0 +1,16 @@ +summary: Get collection Feature as GeoJSON for a site +parameters: + - in: query + name: uuid + type: string + required: true + description: UUID of the aite. +responses: + '200': + description: Successful response + schema: + $ref: '../../definitions/_index.yml#/FeatureCollection' + '400': + description: Bad request + '500': + description: Internal server error \ No newline at end of file diff --git a/openapi-src/V2/paths/Terrafund/post-v2-terrafund-polygon.yml b/openapi-src/V2/paths/Terrafund/post-v2-terrafund-polygon.yml new file mode 100644 index 000000000..f97b1dfd6 --- /dev/null +++ b/openapi-src/V2/paths/Terrafund/post-v2-terrafund-polygon.yml @@ -0,0 +1,17 @@ +summary: Create a new polygon +operationId: post-v2-polygon +tags: + - V2 Terrafund +consumes: + - application/json +parameters: + - in: body + name: body + description: Polygon to create + schema: + $ref: '../../definitions/_index.yml#/GeometryString' +responses: + '200': + description: Created + schema: + $ref: '../../definitions/_index.yml#/DashboardPolygonResponse' \ No newline at end of file diff --git a/openapi-src/V2/paths/Terrafund/post-v2-terrafund-upload-geojson.yml b/openapi-src/V2/paths/Terrafund/post-v2-terrafund-upload-geojson.yml new file mode 100644 index 000000000..6b8db7fe3 --- /dev/null +++ b/openapi-src/V2/paths/Terrafund/post-v2-terrafund-upload-geojson.yml @@ -0,0 +1,29 @@ +summary: Upload GeoJSON File +description: Uploads a GeoJSON file, converts it to GeoJSON, and inserts it into the database. +consumes: + - multipart/form-data +parameters: + - name: file + in: formData + description: The GeoJSON file to upload + required: true + type: file + - name: uuid + in: formData + description: The UUID of the site associated with the GeoJSON file + required: true + type: string +responses: + '200': + description: GeoJSON file processed and inserted successfully + schema: + type: object + properties: + message: + type: string + uuid: + type: string + '400': + description: Bad request + '500': + description: Internal server error \ No newline at end of file diff --git a/openapi-src/V2/paths/Terrafund/post-v2-terrafund-upload-kml.yml b/openapi-src/V2/paths/Terrafund/post-v2-terrafund-upload-kml.yml new file mode 100644 index 000000000..e96254a09 --- /dev/null +++ b/openapi-src/V2/paths/Terrafund/post-v2-terrafund-upload-kml.yml @@ -0,0 +1,29 @@ +summary: Upload KML File +description: Uploads a KML file, converts it to GeoJSON, and inserts it into the database. +consumes: + - multipart/form-data +parameters: + - name: file + in: formData + description: The KML file to upload + required: true + type: file + - name: uuid + in: formData + description: The UUID of the site associated with the KML file + required: true + type: string +responses: + '200': + description: KML file processed and inserted successfully + schema: + type: object + properties: + message: + type: string + uuid: + type: string + '400': + description: Bad request + '500': + description: Internal server error \ No newline at end of file diff --git a/openapi-src/V2/paths/Terrafund/post-v2-terrafund-upload-shapefile.yml b/openapi-src/V2/paths/Terrafund/post-v2-terrafund-upload-shapefile.yml new file mode 100644 index 000000000..11bc63870 --- /dev/null +++ b/openapi-src/V2/paths/Terrafund/post-v2-terrafund-upload-shapefile.yml @@ -0,0 +1,29 @@ +summary: Upload Shapefile +description: Uploads a shapefile, converts it to GeoJSON, and inserts it into the database. +consumes: + - multipart/form-data +parameters: + - name: file + in: formData + description: The shapefile to upload + required: true + type: file + - name: uuid + in: formData + description: The UUID of the site associated with the shapefile + required: true + type: string +responses: + '200': + description: Shapefile processed and inserted successfully + schema: + type: object + properties: + message: + type: string + uuid: + type: string + '400': + description: Bad request + '500': + description: Internal server error \ No newline at end of file diff --git a/openapi-src/V2/paths/Terrafund/put-v2-terrafund-site-polygon-uuid.yml b/openapi-src/V2/paths/Terrafund/put-v2-terrafund-site-polygon-uuid.yml new file mode 100644 index 000000000..0a6d1b232 --- /dev/null +++ b/openapi-src/V2/paths/Terrafund/put-v2-terrafund-site-polygon-uuid.yml @@ -0,0 +1,21 @@ +summary: Update site polygon +parameters: + - in: path + name: uuid + required: true + type: string + description: The UUID of the site polygon + - in: body + name: body + required: true + schema: + $ref: '../../definitions/_index.yml#/SitePolygonResponse' +responses: + '200': + description: Successful response + schema: + $ref: '../../definitions/_index.yml#/SitePolygonResponse' + '400': + description: Bad request + '500': + description: Internal server error \ No newline at end of file diff --git a/openapi-src/V2/paths/_index.yml b/openapi-src/V2/paths/_index.yml index e2d3de649..c4d6c211a 100644 --- a/openapi-src/V2/paths/_index.yml +++ b/openapi-src/V2/paths/_index.yml @@ -2559,6 +2559,24 @@ $ref: './Terrafund/put-v2-terrafund-polygon-uuid.yml' delete: $ref: './Terrafund/delete-v2-terrafund-polygon-uuid.yml' +/v2/terrafund/geojson/site: + get: + $ref: './Terrafund/get-v2-geojson-site.yml' +/v2/terrafund/polygon: + post: + $ref: './Terrafund/post-v2-terrafund-polygon.yml' +/v2/terrafund/upload-geojson: + post: + $ref: './Terrafund/post-v2-terrafund-upload-geojson.yml' +/v2/terrafund/upload-shapefile: + post: + $ref: './Terrafund/post-v2-terrafund-upload-shapefile.yml' +/v2/terrafund/upload-kml: + post: + $ref: './Terrafund/post-v2-terrafund-upload-kml.yml' +/v2/terrafund/site-polygon/{uuid}: + put: + $ref: './Terrafund/put-v2-terrafund-site-polygon-uuid.yml' /v2/dashboard/jobs-created: get: $ref: './Dashboard/get-v2-dashboard-jobs-created.yml' diff --git a/resources/docs/swagger-v2.yml b/resources/docs/swagger-v2.yml index 9aa564506..968bbc625 100644 --- a/resources/docs/swagger-v2.yml +++ b/resources/docs/swagger-v2.yml @@ -44299,6 +44299,24 @@ definitions: type: string num_trees: type: integer + FeatureCollection: + type: object + properties: + type: + type: string + PolygonBboxResponse: + title: SitePolygonsBboxResponse + type: object + properties: + bbox: + type: array + items: + type: number + DashboardPolygonResponse: + type: object + properties: + uuid: + type: string DashboardJobsCreatedResponse: type: object properties: @@ -95113,6 +95131,220 @@ paths: responses: '204': description: No Content + /v2/terrafund/geojson/site: + get: + summary: Get collection Feature as GeoJSON for a site + parameters: + - in: query + name: uuid + type: string + required: true + description: UUID of the aite. + responses: + '200': + description: Successful response + schema: + type: object + properties: + type: + type: string + '400': + description: Bad request + '500': + description: Internal server error + /v2/terrafund/polygon: + post: + summary: Create a new polygon + operationId: post-v2-polygon + tags: + - V2 Terrafund + consumes: + - application/json + parameters: + - in: body + name: body + description: Polygon to create + schema: + type: object + properties: + geometry: + type: string + responses: + '200': + description: Created + schema: + type: object + properties: + uuid: + type: string + /v2/terrafund/upload-geojson: + post: + summary: Upload GeoJSON File + description: 'Uploads a GeoJSON file, converts it to GeoJSON, and inserts it into the database.' + consumes: + - multipart/form-data + parameters: + - name: file + in: formData + description: The GeoJSON file to upload + required: true + type: file + - name: uuid + in: formData + description: The UUID of the site associated with the GeoJSON file + required: true + type: string + responses: + '200': + description: GeoJSON file processed and inserted successfully + schema: + type: object + properties: + message: + type: string + uuid: + type: string + '400': + description: Bad request + '500': + description: Internal server error + /v2/terrafund/upload-shapefile: + post: + summary: Upload Shapefile + description: 'Uploads a shapefile, converts it to GeoJSON, and inserts it into the database.' + consumes: + - multipart/form-data + parameters: + - name: file + in: formData + description: The shapefile to upload + required: true + type: file + - name: uuid + in: formData + description: The UUID of the site associated with the shapefile + required: true + type: string + responses: + '200': + description: Shapefile processed and inserted successfully + schema: + type: object + properties: + message: + type: string + uuid: + type: string + '400': + description: Bad request + '500': + description: Internal server error + /v2/terrafund/upload-kml: + post: + summary: Upload KML File + description: 'Uploads a KML file, converts it to GeoJSON, and inserts it into the database.' + consumes: + - multipart/form-data + parameters: + - name: file + in: formData + description: The KML file to upload + required: true + type: file + - name: uuid + in: formData + description: The UUID of the site associated with the KML file + required: true + type: string + responses: + '200': + description: KML file processed and inserted successfully + schema: + type: object + properties: + message: + type: string + uuid: + type: string + '400': + description: Bad request + '500': + description: Internal server error + '/v2/terrafund/site-polygon/{uuid}': + put: + summary: Update site polygon + parameters: + - in: path + name: uuid + required: true + type: string + description: The UUID of the site polygon + - in: body + name: body + required: true + schema: + type: object + properties: + id: + type: integer + uuid: + type: string + poly_name: + type: string + plantstart: + type: string + format: date + plantend: + type: string + format: date + practice: + type: string + target_sys: + type: string + distr: + type: string + num_trees: + type: integer + calc_area: + type: number + format: float + status: + type: string + responses: + '200': + description: Successful response + schema: + type: object + properties: + id: + type: integer + uuid: + type: string + poly_name: + type: string + plantstart: + type: string + format: date + plantend: + type: string + format: date + practice: + type: string + target_sys: + type: string + distr: + type: string + num_trees: + type: integer + calc_area: + type: number + format: float + status: + type: string + '400': + description: Bad request + '500': + description: Internal server error /v2/dashboard/jobs-created: get: summary: view Jobs created for dashboard