Skip to content

feat(backend): Item Transit and Movement Tracking#60

Open
alexlewis9 wants to merge 3 commits intomainfrom
feature/Item-Transit-and-Movement-Tracking-backend
Open

feat(backend): Item Transit and Movement Tracking#60
alexlewis9 wants to merge 3 commits intomainfrom
feature/Item-Transit-and-Movement-Tracking-backend

Conversation

@alexlewis9
Copy link
Contributor

@alexlewis9 alexlewis9 commented Mar 9, 2026

Summary

The PR implements the backend logic for item transit and movement tracking.

Related Issues

Changes

  • Added Box.mark_as_arrived(...) in models.py
  • Added POST /api/boxes/{id}/mark-arrived/ action in views.py

How to Test

  1. inventory/tests.py
  2. movements/tests.py
  3. POST http://localhost:8000/api/boxes//mark-arrived/

Checklist

  • Tests added or updated
  • CI passes (lint, tests, build)
  • Documentation updated (if behavior changed)
  • No secrets or credentials committed

@alexlewis9 alexlewis9 force-pushed the feature/Item-Transit-and-Movement-Tracking-backend branch from d24ffe2 to 794cd4c Compare March 9, 2026 01:51
@alexlewis9 alexlewis9 marked this pull request as ready for review March 9, 2026 02:05
Copilot AI review requested due to automatic review settings March 9, 2026 02:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 creating ItemHistory records.
  • Added POST /api/boxes/{id}/mark-arrived/ action on BoxViewSet with 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.

@vivjd vivjd linked an issue Mar 9, 2026 that may be closed by this pull request
@alexlewis9 alexlewis9 force-pushed the feature/Item-Transit-and-Movement-Tracking-backend branch from 794cd4c to f1a4728 Compare March 10, 2026 08:12
Copilot AI review requested due to automatic review settings March 17, 2026 20:41
Copy link
Contributor

@vivjd vivjd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor change please!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@alexlewis9 alexlewis9 force-pushed the feature/Item-Transit-and-Movement-Tracking-backend branch from 69eee3a to 7d1666b Compare March 17, 2026 22:27
Copilot AI review requested due to automatic review settings March 17, 2026 22:30
@alexlewis9 alexlewis9 force-pushed the feature/Item-Transit-and-Movement-Tracking-backend branch from 7d1666b to 4126f64 Compare March 17, 2026 22:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@alexlewis9 alexlewis9 force-pushed the feature/Item-Transit-and-Movement-Tracking-backend branch 2 times, most recently from 3a0cd64 to 6698cd7 Compare March 17, 2026 22:49
Copilot AI review requested due to automatic review settings March 17, 2026 22:53
@alexlewis9 alexlewis9 force-pushed the feature/Item-Transit-and-Movement-Tracking-backend branch from 6698cd7 to 369d162 Compare March 17, 2026 22:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copilot AI review requested due to automatic review settings March 17, 2026 23:16
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Item Transit & Movement Tracking

3 participants