Tests for Interface work orders and general fixes #133
No reviewers
Labels
No labels
CI/CD
MongoDB
PostgreSQL
api
authentication
bug
documentation
duplicate
enhancement
example issue
fix
good first issue
help wanted
high-level requirement
infrastructure
invalid
low-level requirement
medium-level requirement
question
security
test
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AndreFerreira5/starranja!133
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "db-interface-work_orders"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created tests for the work orders interface.
Made a general fix in the dependecy, we had a clash between bson and pymongo. Also corrected models after the fix.
Thanks @AndreFerreira5 for fixing the DB test problems
no problem!
i will use this opportunity to explain what was wrong and how i fixed it.
the problem: a centralized test database was being used for testing, which means two concurrent tests could conflict and error
the solution: create a random database name (using a nonce) for each test run, separating the runs with different dbs
note: the created dbs exist only during the test run, so they are short-lived
Refactor and Final Code Review
Changes
-Created custom exception hierarchy for work order operations
-Refactored repository to use decorator pattern for error handling
-Enhanced docstrings and inline documentation
-Added FastAPI exception handlers for proper HTTP responses
-Updated tests to use custom exceptions
Business Rules Enforced
ActiveWorkOrderExistsError)Breaking Changes
None - Internal refactoring only
Testing
ActiveWorkOrderExistsErrorRelated Issues
Closes #110
(#111, #112, #113, #114)
Please review @AndreFerreira5 @miguelmiranda20 @vascodias23 @duarteneves5
i reviewed your changes and almost everything is ready for the merge, except for the misplaced exception_handlers.py, which you should move to the exceptions folder and rename it as handler.py. as it is, it is a bit redundant, because you created a fodler named api.
looks good to me! you have a green light from me