Skip to content

Conversation

@anthonyzhao27
Copy link

Summary

Formalizes how ItemHistory determines an item’s current location.

Related Issues

Changes

  • Updated documentation of get_current_location to identify events that update true location (INITIAL, ARRIVED, VERIFIED, CORRECTION)
  • Added pytests that test functionality of get_current_location

How to Test

cd backend
pytest inventory/tests.py

Checklist

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

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.

Looking great! Just one minor change and it should be good to go

- No location-changing events: Returns None. This is expected for items that have
only workflow events (MOVE_REQUESTED, MOVE_APPROVED, etc.) but no actual location
changes yet. However, every item should ideally have at least an INITIAL event.
Copy link
Contributor

Choose a reason for hiding this comment

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

No location-changing events: Returns None.

This sounds like that if there are no location events regardless of there's an initial event, the function will return None (whereas in reality it will return the initial event if it's present). So maybe change it to something like "no location-changing events and initial event is not present".

Copy link
Author

Choose a reason for hiding this comment

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

Hey Vivian, just implemented some changes. Please let me know if I should revise further.

@RaymondC-tech RaymondC-tech requested a review from vivjd December 19, 2025 13:51
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.

Looks good! Thank you for the changes

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.

Define and Document Item History & Location Logic

4 participants