Skip to content

feat(pallets): finish changing location of pallet#209

Open
JanKolo04 wants to merge 2 commits into
developfrom
feature/101-pallet-status
Open

feat(pallets): finish changing location of pallet#209
JanKolo04 wants to merge 2 commits into
developfrom
feature/101-pallet-status

Conversation

@JanKolo04

Copy link
Copy Markdown
Collaborator

Summary

Adds a destination to pallets alongside the existing status and location, so logistics can see where each pallet
is and where it should go. Destination is cleared on arrival (arrived_at stamped), so transit state is a property
of the row rather than a string comparison in the UI. Destination changes ride the existing append-only
pallet_movements ledger (new from_destination / to_destination), giving one timeline for both "who moved it" and
"who redirected it".

New Pallet Logistics view (/logistics/pallets, Operator/Supervisor/Admin) lists pallets live with status,
location, destination, transit state and arrival — filterable by status and location/destination — plus a card to
re-route a pallet without moving it. The Move Pallet terminal gains an optional destination field.

Existing pallets are unaffected: both new columns are nullable and default to unset.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation
  • Other:

Related issue

Closes #101

Testing

New tests/Feature/Web/Logistics/PalletDestinationTest.php — 18 cases: destination assign/keep/clear, arrival
stamping, stale-arrival clearing, re-route without an operator, validation 422 (length, shipped pallet, soft-deleted),
guest + wrong-role authorization, view render, shape allowlists, and a full pallet journey asserted across the whole
ledger.

  • Tested manually in browser
  • php artisan test passes — 1988 tests, 0 failures (run as php -d memory_limit=2G vendor/bin/phpunit; the
    artisan test wrapper OOMs locally at the default 128M memory_limit, unrelated to this change — the suite peaks at
    ~329MB)
  • Tested as Operator / Supervisor / Admin role — covered by feature tests (guest redirect, role-less 403, Operator
    write paths, Admin CRUD), not manually in a browser

Checklist

  • No .env secrets committed
  • Migration added if schema changed — pallets.destination + arrived_at, pallet_movements.from_destination +
    to_destination
  • $fillable updated if new model columns added — Pallet and PalletMovement
  • No raw SQL with user input (use Eloquent / Query Builder)
  • CSRF protection in place for any new forms — Inertia useForm over the standard web middleware
  • composer audit clean — 37 pre-existing advisories across 11 packages; no dependencies added or changed by this
    PR

Notes for reviewers

  • New columns were added to the pallets and pallet_movements Electric shapes — without that the UI never sees them
    (there's a test guarding it).
  • Admin pallet CRUD writes destination without a ledger entry, matching how it already treats location. Logged
    paths are the move terminal and the logistics view.
  • Clearing an already-empty destination still appends a ledger row; happy to suppress that if reviewers prefer a
    ?PalletMovement return.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d6990bb7-fe76-4f24-b2f1-7500486dee3c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/101-pallet-status

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Auth error and status messages were hardcoded English literals rather than
translation calls, so they stayed English on a Polish UI no matter what
lang/pl.json contained — there was no key for them to match.

Wraps all 29 user-facing strings in AuthController, AuthService,
TwoFactorController, TwoFactorChallengeController, RegisterController and
RegisterRequest in __(), and adds the 24 resulting keys to lang/en.json and
lang/pl.json (parity kept). The login screen resolves the locale because
SetLocale runs in the web middleware group, so guest requests are covered.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YbLa6GeJZACX3tFCE7iNJq
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.

1 participant