Skip to content

Commit 6ce68bb

Browse files
authored
Merge pull request #126 from DataIntegrationGroup/jab-lexicon-updates
BDMS 122: lexicon updates & other updates
2 parents f75dae9 + 4ea1d66 commit 6ce68bb

4 files changed

Lines changed: 340 additions & 9 deletions

File tree

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,28 @@ app/
171171
├── services/ # Reusable business logic, helpers, and database interactions
172172
├── tests/ # Code tests
173173
└── transfers/ # Scripts to transfer data from NM_Aquifer to current db schema
174-
```
174+
```
175+
176+
## Model Changes
177+
178+
1. Revise models in the `db/` directory
179+
2. Revise schemas in the `schemas/` directory
180+
1. Add validators for both fields and models as necessary
181+
1. Validations on incoming data only should be handled by Pydantic and 422 errors will be raised (default Pydantic)
182+
2. Validations against values in the database will be handled at the endpoint with custom checks and 409 errors will be raised
183+
3. Revise tests
184+
1. Revise fixtures in `tests/conftest.py`
185+
2. Revise fields in POST test payloads and asserts
186+
3. Revise fields in PATCH test payloads and asserts
187+
4. Revise fields in GET all and GET by ID test asserts
188+
5. Add tests for validations as necessary
189+
190+
Bonus:
191+
- Update transfer scripts by revising fields and delineating where they come from in `NM_Aquifer`
192+
193+
Notes:
194+
- All `Create` schema fields are defined as `<type>` if non-nullable and `<type> | None = None` if nullable
195+
- All `Update` schema fields are optional and default to `None`
196+
- All `Response` schema fields are defined as `<type>` if non-nullable and `<type> | None` if nullable
197+
- All raised exceptions should use the `PydanticStyleException` as defined in `services/exceptions_helper.py`
198+
- Errors handled by the database should be enumerated and handled in a database_error_handler in each router's file

0 commit comments

Comments
 (0)