Skip to content

feat(frontend): Item Transit and Movement Tracking#61

Open
alexlewis9 wants to merge 1 commit intomainfrom
feature/Item-Transit-and-Movement-Tracking-frontend
Open

feat(frontend): Item Transit and Movement Tracking#61
alexlewis9 wants to merge 1 commit intomainfrom
feature/Item-Transit-and-Movement-Tracking-frontend

Conversation

@alexlewis9
Copy link
Contributor

@alexlewis9 alexlewis9 commented Mar 11, 2026

Summary

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

Related Issues

Changes

  • Added In Transit status UI indicator and Mark as Arrived button on the Item Details page.
  • Added Mark as Arrived workflow in Box Management

How to Test

  1. Setup and run backend:
    cd backend
    python manage.py migrate
    python manage.py seed_database
    python manage.py runserver
  2. Setup and run frontend:
    cd frontend
    npm install
    npm run dev
  3. Item transit:
  • Login as admin.
  • Open a movement request and approve.
  • Confirm In Transit badge appears.
  • Click Mark as Arrived on Item Details.
  • Verify item location updates and transit status is cleared.
  1. Box transit:
  • Go to Box Management.
  • Select a location, then a box.
  • Choose a destination and click Mark as Arrived.
  • Verify box location updates and contained items move to the same location.

Screenshots

Screenshot (70) Screenshot (71) Screenshot (66) Screenshot (67) Screenshot (68) Screenshot (65)

Checklist

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

@alexlewis9 alexlewis9 changed the title feat(frontend): Item Transit and Movement Tracking#60 feat(frontend): Item Transit and Movement Tracking Mar 11, 2026
@alexlewis9 alexlewis9 marked this pull request as ready for review March 11, 2026 22:38
Copilot AI review requested due to automatic review settings March 11, 2026 22:39
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

Implements item/box transit “arrival” workflows end-to-end: frontend UI additions for in-transit visibility and “Mark as Arrived”, plus supporting backend endpoints and tests to update locations/statuses and record history.

Changes:

  • Add “In Transit” badge + “Mark as Arrived” action on the Item Details page (movement-request arrival completion).
  • Add Box Management “Mark as Arrived” workflow and API to move a box and sync contained items to a destination location.
  • Add/expand backend tests for movement arrival completion and box arrival behavior.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
frontend/src/pages/admin/ItemDetailsPage.tsx Adds in-transit badge, arrival action, and item refetching after workflow actions.
frontend/src/pages/admin/ItemDetailsPage.css Styles the “In Transit” badge and arrival button.
frontend/src/pages/admin/BoxManagementPage.tsx Adds box “mark arrived” UI/workflow and error handling for API failures.
frontend/src/pages/admin/BoxManagementPage.css Styles box arrival panel and adds item status badge styles.
frontend/src/components/common/Button.tsx Updates primary button classes to use CSS variable-based Tailwind arbitrary values.
frontend/src/api/requests.api.ts Adds completeArrival API method.
frontend/src/api/boxes.api.ts Adds markArrived API method and types.
frontend/src/actions/useRequests.ts Exposes completeArrival via hooks and refetches requests.
backend/movements/tests.py Adds API tests for completing arrival on movement requests.
backend/inventory/views.py Adds POST /api/boxes/{id}/mark-arrived/ endpoint.
backend/inventory/tests.py Adds/extends tests covering box arrival endpoint and item updates.
backend/inventory/models.py Adds Box.mark_as_arrived() implementation and related formatting changes.

💡 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-frontend branch from 98bdf53 to 936020a Compare March 11, 2026 23:00
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.

If you run black . in the backend directory the CI should pass, I did it for your other PR

Copilot AI review requested due to automatic review settings March 17, 2026 23:14
@alexlewis9 alexlewis9 force-pushed the feature/Item-Transit-and-Movement-Tracking-frontend branch from 936020a to 6eb2ad3 Compare March 17, 2026 23:14
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 12 out of 12 changed files in this pull request and generated 9 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.

Copilot AI review requested due to automatic review settings March 17, 2026 23:24
@alexlewis9 alexlewis9 force-pushed the feature/Item-Transit-and-Movement-Tracking-frontend branch from 64f658e to df47d6d Compare March 17, 2026 23:28
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 12 out of 12 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (2)

backend/inventory/models.py:153

  • In CollectionItem.is_complete = models.CharField(...), the keyword arguments are duplicated (e.g. max_length, choices, default, help_text repeated). This is a parse-time SyntaxError and will prevent the backend from starting. Remove the duplicated keyword argument block.
    is_complete = models.CharField(
        max_length=10,
        choices=COMPLETENESS_CHOICES,
        default="UNKNOWN",
        help_text="Whether the item is complete with all parts",

backend/inventory/tests.py:1035

  • setUp() creates self.item_c twice with the same item_code ("ITEM003"). Since CollectionItem.item_code is unique, this will raise an IntegrityError and fail the test setup. Remove the duplicate CollectionItem.objects.create(...) or use a different item_code for the second item.

    def test_list_boxes(self):
        response = self.client.get("/api/boxes/")

        assert response.status_code == status.HTTP_200_OK

💡 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-frontend branch from df47d6d to b010bb4 Compare March 17, 2026 23:38
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