Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,28 @@ app/
├── services/ # Reusable business logic, helpers, and database interactions
├── tests/ # Code tests
└── transfers/ # Scripts to transfer data from NM_Aquifer to current db schema
```
```

## Model Changes

1. Revise models in the `db/` directory
2. Revise schemas in the `schemas/` directory
1. Add validators for both fields and models as necessary
1. Validations on incoming data only should be handled by Pydantic and 422 errors will be raised (default Pydantic)
2. Validations against values in the database will be handled at the endpoint with custom checks and 409 errors will be raised
3. Revise tests
1. Revise fixtures in `tests/conftest.py`
2. Revise fields in POST test payloads and asserts
3. Revise fields in PATCH test payloads and asserts
4. Revise fields in GET all and GET by ID test asserts
5. Add tests for validations as necessary

Bonus:
- Update transfer scripts by revising fields and delineating where they come from in `NM_Aquifer`

Notes:
- All `Create` schema fields are defined as `<type>` if non-nullable and `<type> | None = None` if nullable
- All `Update` schema fields are optional and default to `None`
- All `Response` schema fields are defined as `<type>` if non-nullable and `<type> | None` if nullable
- All raised exceptions should use the `PydanticStyleException` as defined in `services/exceptions_helper.py`
- Errors handled by the database should be enumerated and handled in a database_error_handler in each router's file
Loading
Loading