Commit cd1b9bd
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
File tree
32 files changed
+7418
-5223
lines changed- src/ca_biositing/webservice
- ca_biositing/webservice
- schemas
- services
- v1
- endpoints
- tests
32 files changed
+7418
-5223
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | | - | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
186 | 190 | | |
187 | 191 | | |
188 | 192 | | |
| 193 | + | |
189 | 194 | | |
190 | 195 | | |
191 | 196 | | |
| |||
248 | 253 | | |
249 | 254 | | |
250 | 255 | | |
| 256 | + | |
| 257 | + | |
251 | 258 | | |
252 | 259 | | |
253 | 260 | | |
| |||
0 commit comments