| name | bar-assistant-application-service |
| description | Use when implementing or refactoring Bar Assistant write-side workflows that go from Laravel controllers to application services and Eloquent-backed infrastructure repositories. Covers controller orchestration, DTO mapping, repository ports/adapters, dependency injection, and create/update/delete service conventions used in this codebase. |
Bar Assistant Application Service Workflow
Project-specific guidance for implementing write-side behavior in Bar Assistant without bypassing the application layer.
When to Use
Use this skill when you are:
- Adding a new controller action that should call a service in
src/Application
- Implementing a new create, update, or delete use case
- Introducing a new domain repository port and Eloquent repository adapter
- Refactoring legacy controller logic into application services
- Wiring a new repository binding in
InfrastructureServiceProvider
Core Rule
For write operations, controllers should authorize and validate the request, build an application DTO, call an application service, and return the HTTP response. They should not contain persistence logic or call infrastructure repositories directly.
Controller -> Application Service -> Domain Repository port -> Eloquent adapter
Best Example in This Repo
Use the Ingredient flow as the main reference:
- Controller:
app/Http/Controllers/IngredientController.php
- Application service:
src/Application/Ingredient/IngredientService.php
- Repository port:
src/Domain/Ingredient/IngredientRepository.php
- Repository adapter:
app/Infrastructure/EloquentIngredientRepository.php
- DI bindings:
app/Providers/InfrastructureServiceProvider.php