The current implementation of queries related to lost and found items is split into two separate files: lost.py and found.py. Both files contain similar queries but operate on different tables. To streamline the code and reduce redundancy, we need to merge these files into a single file, lost_found.py. Additionally, we will introduce a new parameter type to distinguish between lost and found queries.
Tasks
- Create a new file:
/backend/backend/queries/lost_found.py.
- Merge all functions from
lost.py and found.py into lost_found.py.
- Add a new parameter
type to each function. The type parameter should be:
0 for queries on the lost table.
1 for queries on the found table.
- Refactor the logic within each function to use the
type parameter to determine which table to query.
Note: Pull requests (PRs) on branches other than backend will be closed.
The current implementation of queries related to lost and found items is split into two separate files:
lost.pyandfound.py. Both files contain similar queries but operate on different tables. To streamline the code and reduce redundancy, we need to merge these files into a single file,lost_found.py. Additionally, we will introduce a new parametertypeto distinguish between lost and found queries.Tasks
/backend/backend/queries/lost_found.py.lost.pyandfound.pyintolost_found.py.typeto each function. Thetypeparameter should be:0for queries on the lost table.1for queries on the found table.typeparameter to determine which table to query.Note: Pull requests (PRs) on branches other than backend will be closed.