Skip to content

Commit cd1b9bd

Browse files
CopilotlsetiawanVraj1234nikiburggraf
authored
Complete webservice namespace package with full CRUD endpoints (sustainability-software-lab#68)
* Initial plan * Add FastAPI CRUD endpoints and business logic layer - Created config.py for API configuration with CORS settings - Created dependencies.py with database session and pagination support - Created schemas/ with Pydantic models for all entities: - common.py: Health, pagination, error responses - biomass.py: Biomass CRUD schemas - experiments.py: Experiment CRUD schemas - samples.py: Field sample CRUD schemas - locations.py: Geographic location CRUD schemas - products.py: Primary product CRUD schemas - Created services/ with business logic: - biomass_service.py: Biomass operations - experiment_service.py: Experiment operations - Created v1/endpoints/ with full CRUD: - health.py: Health check endpoint - biomass.py: Biomass CRUD operations - experiments.py: Experiment CRUD operations - samples.py: Field sample CRUD operations - locations.py: Geographic location CRUD operations - products.py: Primary product CRUD operations - Updated main.py with CORS, exception handlers, and v1 router - Updated v1/router.py to include all endpoints Co-authored-by: lsetiawan <17802172+lsetiawan@users.noreply.github.com> * Add comprehensive test suite for webservice endpoints - Created test_health.py for health check endpoint tests - Created test_biomass.py with full CRUD test coverage - Created test_experiments.py with experiment endpoint tests - Created test_endpoints.py for integration testing - Updated test_main.py to reflect new root endpoint structure - All tests use mocking to avoid database dependencies - Tests cover success cases, error cases, and validation - Added tests for pagination, 404 errors, and CORS Co-authored-by: lsetiawan <17802172+lsetiawan@users.noreply.github.com> * Add comprehensive API documentation - Created API_DOCUMENTATION.md with complete endpoint reference - Documented all CRUD operations for each resource - Added examples for request/response formats - Documented pagination, error handling, and CORS - Included development setup and testing instructions - Added architecture overview and future enhancements section Co-authored-by: lsetiawan <17802172+lsetiawan@users.noreply.github.com> * style: fix trailing whitespace and end-of-file issues - Removed trailing whitespace from all Python and Markdown files - Ensured all files end with a newline character - Fixes pre-commit hook violations Co-authored-by: lsetiawan <17802172+lsetiawan@users.noreply.github.com> * api: fix webservice startup issues * merge: integrate main’s docs/cloud features into webservice pixi.toml * feat, docs: Add GCP backend and cloud documentation (sustainability-software-lab#78) * feat: configure GCS as OpenTofu backend * docs: Add cloud documentation * test: mock DB session in conftest.py to isolate CI unit tests --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lsetiawan <17802172+lsetiawan@users.noreply.github.com> Co-authored-by: Vraj Rajpura <53624234+Vraj1234@users.noreply.github.com> Co-authored-by: Niki Burggraf <nikib@uw.edu>
1 parent b9ee91e commit cd1b9bd

32 files changed

+7418
-5223
lines changed

pixi.lock

Lines changed: 4590 additions & 5201 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@ py312 = ["py312", "datamodels", "pipeline", "webservice"]
1515
py313 = ["py313", "datamodels", "pipeline", "webservice"]
1616
gis = { features = ["qgis", "raster", "vector"], solve-group = "default" }
1717
etl = { features = ["datamodels", "pipeline"], solve-group = "default" }
18-
webservice = { features = ["datamodels", "webservice"], solve-group = "default" }
19-
frontend = { features = ["frontend"], no-default-feature = true, solve-group = "default" }
18+
webservice = { features = [
19+
"datamodels",
20+
"webservice",
21+
], solve-group = "default" }
22+
frontend = { features = [
23+
"frontend",
24+
], no-default-feature = true, solve-group = "default" }
2025
docs = { features = ["docs"], no-default-feature = true, solve-group = "default" }
2126
deployment = { features = ["cloud"], solve-group = "default" }
22-
2327
[dependencies]
2428
python = "~=3.12"
2529
pre-commit = ">=4.2.0,<5"
@@ -186,6 +190,7 @@ description = "Run all tests with coverage and HTML report"
186190
cmd = "git submodule update --init frontend"
187191
description = "Initialize only the frontend submodule."
188192

193+
# GIS Dependencies
189194

190195
[feature.qgis.dependencies]
191196
qgis = "*"
@@ -248,6 +253,8 @@ depends-on = [{ task = "start-services" }]
248253
# Webservice Dependencies
249254
[feature.webservice.pypi-dependencies]
250255
ca-biositing-webservice = { path = "./src/ca_biositing/webservice" }
256+
fastapi = ">=0.111.0,<0.115.0"
257+
pydantic = ">=2.5,<3.0"
251258

252259
[feature.docs.dependencies]
253260
python = ">=3.11,<3.14"

0 commit comments

Comments
 (0)