Repository navigation
Mini Farm Manager: design, implementation and README - #1
Merged
Merged
Conversation
Covers domain model, business rules (capacity, movements, status), application layer, routes, frontend pages, testing strategy and the chosen additional feature (paddock capacity warning). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- Migrations for paddocks, animals, animal_movements, health_records - String-backed enums (Species, Sex, AnimalStatus, HealthRecordType, OccupancyState) with a shared HasOptions trait - Eloquent models with relationships, casts and paddock occupancy helpers - Factories with states for tests and seeding - config/farm.php with the capacity warning threshold - Farm routes are public: / redirects to /dashboard, dashboard moved out of the auth group, sidebar shows Animals/Paddocks and a Log in link for guests, Welcome page removed Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- PaddockController with index/create/store/show/edit/update - Store/Update form requests; capacity may not drop below occupancy - PaddockResource and AnimalSummaryResource for Inertia props - Vue pages under paddocks/ plus shared farm components (PaddockForm, OccupancyBar, OccupancyBadge, EmptyState) and a Textarea UI primitive - Occupancy state (ok / warning / full) drives badge and bar colours - Feature tests for CRUD, validation and occupancy thresholds Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- MoveAnimal action: transactional, locks the target paddock, enforces active-only / different-paddock / has-room rules, records history and is the sole writer of animals.current_paddock_id - ChangeAnimalStatus action: leaving the active state removes the animal from its paddock with a departure movement - AnimalController with filtered, paginated index, create with optional initial placement, show with movement history, edit/update - Store/Update form requests with enum and date validation - AnimalResource and AnimalMovementResource - Vue pages under animals/ plus AnimalForm, FormSelect and AnimalStatusBadge components; paddock page links to animals - Feature tests for CRUD, filters, placement, capacity rules and status changes Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- POST animals/{animal}/movements backed by MoveAnimal; validation
errors surface on the destination field
- POST animals/{animal}/health-records with date/type/description rules
- MoveAnimalDialog marks the current and full paddocks as unavailable
- HealthRecordForm and health history on the animal page
- Endpoint tests for movements and health records
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- DashboardController: stats, species/status breakdowns, paddock occupancy, capacity warnings and recent movements - Dashboard page replaces the starter placeholder - FarmSeeder builds a demo farm through MoveAnimal/ChangeAnimalStatus with warning and full paddocks, an unplaced animal and health records - Fix: MoveAnimal now syncs the caller's model instance with the locked row, and ChangeAnimalStatus refreshes before deciding whether to record a departure (stale instances previously skipped it) - Paddock factory names are no longer limited to 12 unique values - Dashboard tests; ExampleTest folded into DashboardTest Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- README covering how to run, assumptions, technical decisions, what was left out, production improvements, the capacity-warning feature and how AI tools were used - Prettier formatting for project-authored Vue/TS and docs - Ignore the local .claude/launch.json dev-server config Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- vp check failed on 41 files written by Laravel Boost (.agents/, .claude/, .codex/, .junie/, AGENTS.md, CLAUDE.md, boost.json, .mcp.json); they are tool-generated and rewritten by boost:update, so exclude them from formatting instead of reformatting them - PHPStan level 7: narrow findOrFail() arguments to int, type the after() hook and route parameter in UpdatePaddockRequest, add Attribute generics on Paddock::occupancy(), and build the factory enum via from() so the match is exhaustive - Give phpstan a 512M memory limit in the composer script Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete implementation of the Laravel + Vue developer exercise, built in reviewed stages on top of the
laravel new --vuestarter kit.docs/design.mdcommitted before any codeMoveAnimal(transactional, row-locked capacity enforcement) andChangeAnimalStatusMerge with a merge commit to keep the stage history.
Verification
php artisan test— 82 tests, 458 assertions, all passingvue-tsc --noEmitclean,vendor/bin/pintclean,npm run buildsucceeds🤖 Generated with Claude Code