feat(backend): Item Transit and Movement Tracking#60
feat(backend): Item Transit and Movement Tracking#60alexlewis9 wants to merge 3 commits intomainfrom
Conversation
d24ffe2 to
794cd4c
Compare
There was a problem hiding this comment.
Pull request overview
This PR implements backend logic for item transit and movement tracking, specifically enabling boxes to be marked as arrived at a destination location. It adds a mark_as_arrived() method on the Box model that moves the box and syncs all contained items' locations and statuses, along with a corresponding API endpoint and tests. Additionally, it adds tests for the pre-existing complete-arrival movement request workflow.
Changes:
- Added
Box.mark_as_arrived()model method that updates the box's location and syncs all contained items (location,is_on_floor, transit status) while creatingItemHistoryrecords. - Added
POST /api/boxes/{id}/mark-arrived/action onBoxViewSetwith input validation (required location, non-existent location, same-location check). - Added comprehensive tests for both the box arrival endpoint (
BoxEndpointsTest) and the movement request arrival workflow (ItemMovementArrivalAPITest), plus formatting/line-length fixes across models and tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
backend/inventory/models.py |
Added Box.mark_as_arrived() method + line-length formatting fixes across model fields |
backend/inventory/views.py |
Added mark_arrived action on BoxViewSet + corrected action import + formatting fix |
backend/inventory/tests.py |
Added box arrival tests, destination location fixture, and new test items + formatting fixes |
backend/movements/tests.py |
New test class ItemMovementArrivalAPITest for the complete-arrival endpoint |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
794cd4c to
f1a4728
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
69eee3a to
7d1666b
Compare
7d1666b to
4126f64
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
3a0cd64 to
6698cd7
Compare
6698cd7 to
369d162
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Summary
The PR implements the backend logic for item transit and movement tracking.
Related Issues
Changes
How to Test
Checklist