diff --git a/.agents/skills/developing-with-fortify/SKILL.md b/.agents/skills/developing-with-fortify/SKILL.md new file mode 100644 index 00000000..2ff71a4b --- /dev/null +++ b/.agents/skills/developing-with-fortify/SKILL.md @@ -0,0 +1,116 @@ +--- +name: developing-with-fortify +description: Laravel Fortify headless authentication backend development. Activate when implementing authentication features including login, registration, password reset, email verification, two-factor authentication (2FA/TOTP), profile updates, headless auth, authentication scaffolding, or auth guards in Laravel applications. +--- + +# Laravel Fortify Development + +Fortify is a headless authentication backend that provides authentication routes and controllers for Laravel applications. + +## Documentation + +Use `search-docs` for detailed Laravel Fortify patterns and documentation. + +## Usage + +- **Routes**: Use `list-routes` with `only_vendor: true` and `action: "Fortify"` to see all registered endpoints +- **Actions**: Check `app/Actions/Fortify/` for customizable business logic (user creation, password validation, etc.) +- **Config**: See `config/fortify.php` for all options including features, guards, rate limiters, and username field +- **Contracts**: Look in `Laravel\Fortify\Contracts\` for overridable response classes (`LoginResponse`, `LogoutResponse`, etc.) +- **Views**: All view callbacks are set in `FortifyServiceProvider::boot()` using `Fortify::loginView()`, `Fortify::registerView()`, etc. + +## Available Features + +Enable in `config/fortify.php` features array: + +- `Features::registration()` - User registration +- `Features::resetPasswords()` - Password reset via email +- `Features::emailVerification()` - Requires User to implement `MustVerifyEmail` +- `Features::updateProfileInformation()` - Profile updates +- `Features::updatePasswords()` - Password changes +- `Features::twoFactorAuthentication()` - 2FA with QR codes and recovery codes + +> Use `search-docs` for feature configuration options and customization patterns. + +## Setup Workflows + +### Two-Factor Authentication Setup + +``` +- [ ] Add TwoFactorAuthenticatable trait to User model +- [ ] Enable feature in config/fortify.php +- [ ] Run migrations for 2FA columns +- [ ] Set up view callbacks in FortifyServiceProvider +- [ ] Create 2FA management UI +- [ ] Test QR code and recovery codes +``` + +> Use `search-docs` for TOTP implementation and recovery code handling patterns. + +### Email Verification Setup + +``` +- [ ] Enable emailVerification feature in config +- [ ] Implement MustVerifyEmail interface on User model +- [ ] Set up verifyEmailView callback +- [ ] Add verified middleware to protected routes +- [ ] Test verification email flow +``` + +> Use `search-docs` for MustVerifyEmail implementation patterns. + +### Password Reset Setup + +``` +- [ ] Enable resetPasswords feature in config +- [ ] Set up requestPasswordResetLinkView callback +- [ ] Set up resetPasswordView callback +- [ ] Define password.reset named route (if views disabled) +- [ ] Test reset email and link flow +``` + +> Use `search-docs` for custom password reset flow patterns. + +### SPA Authentication Setup + +``` +- [ ] Set 'views' => false in config/fortify.php +- [ ] Install and configure Laravel Sanctum +- [ ] Use 'web' guard in fortify config +- [ ] Set up CSRF token handling +- [ ] Test XHR authentication flows +``` + +> Use `search-docs` for integration and SPA authentication patterns. + +## Best Practices + +### Custom Authentication Logic + +Override authentication behavior using `Fortify::authenticateUsing()` for custom user retrieval or `Fortify::authenticateThrough()` to customize the authentication pipeline. Override response contracts in `AppServiceProvider` for custom redirects. + +### Registration Customization + +Modify `app/Actions/Fortify/CreateNewUser.php` to customize user creation logic, validation rules, and additional fields. + +### Rate Limiting + +Configure via `fortify.limiters.login` in config. Default configuration throttles by username + IP combination. + +## Key Endpoints + +| Feature | Method | Endpoint | +|------------------------|----------|---------------------------------------------| +| Login | POST | `/login` | +| Logout | POST | `/logout` | +| Register | POST | `/register` | +| Password Reset Request | POST | `/forgot-password` | +| Password Reset | POST | `/reset-password` | +| Email Verify Notice | GET | `/email/verify` | +| Resend Verification | POST | `/email/verification-notification` | +| Password Confirm | POST | `/user/confirm-password` | +| Enable 2FA | POST | `/user/two-factor-authentication` | +| Confirm 2FA | POST | `/user/confirmed-two-factor-authentication` | +| 2FA Challenge | POST | `/two-factor-challenge` | +| Get QR Code | GET | `/user/two-factor-qr-code` | +| Recovery Codes | GET/POST | `/user/two-factor-recovery-codes` | \ No newline at end of file diff --git a/.agents/skills/fluxui-development/SKILL.md b/.agents/skills/fluxui-development/SKILL.md new file mode 100644 index 00000000..4b5aabb1 --- /dev/null +++ b/.agents/skills/fluxui-development/SKILL.md @@ -0,0 +1,81 @@ +--- +name: fluxui-development +description: "Use this skill for Flux UI development in Livewire applications only. Trigger when working with components, building or customizing Livewire component UIs, creating forms, modals, tables, or other interactive elements. Covers: flux: components (buttons, inputs, modals, forms, tables, date-pickers, kanban, badges, tooltips, etc.), component composition, Tailwind CSS styling, Heroicons/Lucide icon integration, validation patterns, responsive design, and theming. Do not use for non-Livewire frameworks or non-component styling." +license: MIT +metadata: + author: laravel +--- + +# Flux UI Development + +## Documentation + +Use `search-docs` for detailed Flux UI patterns and documentation. + +## Basic Usage + +This project uses the free edition of Flux UI, which includes all free components and variants but not Pro components. + +Flux UI is a component library for Livewire built with Tailwind CSS. It provides components that are easy to use and customize. + +Use Flux UI components when available. Fall back to standard Blade components when no Flux component exists for your needs. + + +```blade +Click me +``` + +## Available Components (Free Edition) + +Available: avatar, badge, brand, breadcrumbs, button, callout, checkbox, dropdown, field, heading, icon, input, modal, navbar, otp-input, profile, radio, select, separator, skeleton, switch, text, textarea, tooltip + +## Icons + +Flux includes [Heroicons](https://heroicons.com/) as its default icon set. Search for exact icon names on the Heroicons site - do not guess or invent icon names. + + +```blade +Export +``` + +For icons not available in Heroicons, use [Lucide](https://lucide.dev/). Import the icons you need with the Artisan command: + +```bash +php artisan flux:icon crown grip-vertical github +``` + +## Common Patterns + +### Form Fields + + +```blade + + Email + + + +``` + +### Modals + + +```blade + + Title +

Content

+
+``` + +## Verification + +1. Check component renders correctly +2. Test interactive states +3. Verify mobile responsiveness + +## Common Pitfalls + +- Trying to use Pro-only components in the free edition +- Not checking if a Flux component exists before creating custom implementations +- Forgetting to use the `search-docs` tool for component-specific documentation +- Not following existing project patterns for Flux usage \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/SKILL.md b/.agents/skills/laravel-best-practices/SKILL.md new file mode 100644 index 00000000..aca32c9c --- /dev/null +++ b/.agents/skills/laravel-best-practices/SKILL.md @@ -0,0 +1,190 @@ +--- +name: laravel-best-practices +description: "Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strategies, authorization and security patterns, validation, error handling, queue and job configuration, route definitions, and architectural decisions. Also use for Laravel code reviews and refactoring existing Laravel code to follow best practices. Covers any task involving Laravel backend PHP code patterns." +license: MIT +metadata: + author: laravel +--- + +# Laravel Best Practices + +Best practices for Laravel, prioritized by impact. Each rule teaches what to do and why. For exact API syntax, verify with `search-docs`. + +## Consistency First + +Before applying any rule, check what the application already does. Laravel offers multiple valid approaches — the best choice is the one the codebase already uses, even if another pattern would be theoretically better. Inconsistency is worse than a suboptimal pattern. + +Check sibling files, related controllers, models, or tests for established patterns. If one exists, follow it — don't introduce a second way. These rules are defaults for when no pattern exists yet, not overrides. + +## Quick Reference + +### 1. Database Performance → `rules/db-performance.md` + +- Eager load with `with()` to prevent N+1 queries +- Enable `Model::preventLazyLoading()` in development +- Select only needed columns, avoid `SELECT *` +- `chunk()` / `chunkById()` for large datasets +- Index columns used in `WHERE`, `ORDER BY`, `JOIN` +- `withCount()` instead of loading relations to count +- `cursor()` for memory-efficient read-only iteration +- Never query in Blade templates + +### 2. Advanced Query Patterns → `rules/advanced-queries.md` + +- `addSelect()` subqueries over eager-loading entire has-many for a single value +- Dynamic relationships via subquery FK + `belongsTo` +- Conditional aggregates (`CASE WHEN` in `selectRaw`) over multiple count queries +- `setRelation()` to prevent circular N+1 queries +- `whereIn` + `pluck()` over `whereHas` for better index usage +- Two simple queries can beat one complex query +- Compound indexes matching `orderBy` column order +- Correlated subqueries in `orderBy` for has-many sorting (avoid joins) + +### 3. Security → `rules/security.md` + +- Define `$fillable` or `$guarded` on every model, authorize every action via policies or gates +- No raw SQL with user input — use Eloquent or query builder +- `{{ }}` for output escaping, `@csrf` on all POST/PUT/DELETE forms, `throttle` on auth and API routes +- Validate MIME type, extension, and size for file uploads +- Never commit `.env`, use `config()` for secrets, `encrypted` cast for sensitive DB fields + +### 4. Caching → `rules/caching.md` + +- `Cache::remember()` over manual get/put +- `Cache::flexible()` for stale-while-revalidate on high-traffic data +- `Cache::memo()` to avoid redundant cache hits within a request +- Cache tags to invalidate related groups +- `Cache::add()` for atomic conditional writes +- `once()` to memoize per-request or per-object lifetime +- `Cache::lock()` / `lockForUpdate()` for race conditions +- Failover cache stores in production + +### 5. Eloquent Patterns → `rules/eloquent.md` + +- Correct relationship types with return type hints +- Local scopes for reusable query constraints +- Global scopes sparingly — document their existence +- Attribute casts in the `casts()` method +- Cast date columns, use Carbon instances in templates +- `whereBelongsTo($model)` for cleaner queries +- Never hardcode table names — use `(new Model)->getTable()` or Eloquent queries + +### 6. Validation & Forms → `rules/validation.md` + +- Form Request classes, not inline validation +- Array notation `['required', 'email']` for new code; follow existing convention +- `$request->validated()` only — never `$request->all()` +- `Rule::when()` for conditional validation +- `after()` instead of `withValidator()` + +### 7. Configuration → `rules/config.md` + +- `env()` only inside config files +- `App::environment()` or `app()->isProduction()` +- Config, lang files, and constants over hardcoded text + +### 8. Testing Patterns → `rules/testing.md` + +- `LazilyRefreshDatabase` over `RefreshDatabase` for speed +- `assertModelExists()` over raw `assertDatabaseHas()` +- Factory states and sequences over manual overrides +- Use fakes (`Event::fake()`, `Exceptions::fake()`, etc.) — but always after factory setup, not before +- `recycle()` to share relationship instances across factories + +### 9. Queue & Job Patterns → `rules/queue-jobs.md` + +- `retry_after` must exceed job `timeout`; use exponential backoff `[1, 5, 10]` +- `ShouldBeUnique` to prevent duplicates; `ShouldBeUniqueUntilProcessing` for early lock release +- Always implement `failed()`; with `retryUntil()`, set `$tries = 0` +- `RateLimited` middleware for external API calls; `Bus::batch()` for related jobs +- Horizon for complex multi-queue scenarios + +### 10. Routing & Controllers → `rules/routing.md` + +- Implicit route model binding +- Scoped bindings for nested resources +- `Route::resource()` or `apiResource()` +- Methods under 10 lines — extract to actions/services +- Type-hint Form Requests for auto-validation + +### 11. HTTP Client → `rules/http-client.md` + +- Explicit `timeout` and `connectTimeout` on every request +- `retry()` with exponential backoff for external APIs +- Check response status or use `throw()` +- `Http::pool()` for concurrent independent requests +- `Http::fake()` and `preventStrayRequests()` in tests + +### 12. Events, Notifications & Mail → `rules/events-notifications.md`, `rules/mail.md` + +- Event discovery over manual registration; `event:cache` in production +- `ShouldDispatchAfterCommit` / `afterCommit()` inside transactions +- Queue notifications and mailables with `ShouldQueue` +- On-demand notifications for non-user recipients +- `HasLocalePreference` on notifiable models +- `assertQueued()` not `assertSent()` for queued mailables +- Markdown mailables for transactional emails + +### 13. Error Handling → `rules/error-handling.md` + +- `report()`/`render()` on exception classes or in `bootstrap/app.php` — follow existing pattern +- `ShouldntReport` for exceptions that should never log +- Throttle high-volume exceptions to protect log sinks +- `dontReportDuplicates()` for multi-catch scenarios +- Force JSON rendering for API routes +- Structured context via `context()` on exception classes + +### 14. Task Scheduling → `rules/scheduling.md` + +- `withoutOverlapping()` on variable-duration tasks +- `onOneServer()` on multi-server deployments +- `runInBackground()` for concurrent long tasks +- `environments()` to restrict to appropriate environments +- `takeUntilTimeout()` for time-bounded processing +- Schedule groups for shared configuration + +### 15. Architecture → `rules/architecture.md` + +- Single-purpose Action classes; dependency injection over `app()` helper +- Prefer official Laravel packages and follow conventions, don't override defaults +- Default to `ORDER BY id DESC` or `created_at DESC`; `mb_*` for UTF-8 safety +- `defer()` for post-response work; `Context` for request-scoped data; `Concurrency::run()` for parallel execution + +### 16. Migrations → `rules/migrations.md` + +- Generate migrations with `php artisan make:migration` +- `constrained()` for foreign keys +- Never modify migrations that have run in production +- Add indexes in the migration, not as an afterthought +- Mirror column defaults in model `$attributes` +- Reversible `down()` by default; forward-fix migrations for intentionally irreversible changes +- One concern per migration — never mix DDL and DML + +### 17. Collections → `rules/collections.md` + +- Higher-order messages for simple collection operations +- `cursor()` vs. `lazy()` — choose based on relationship needs +- `lazyById()` when updating records while iterating +- `toQuery()` for bulk operations on collections + +### 18. Blade & Views → `rules/blade-views.md` + +- `$attributes->merge()` in component templates +- Blade components over `@include`; `@pushOnce` for per-component scripts +- View Composers for shared view data +- `@aware` for deeply nested component props + +### 19. Conventions & Style → `rules/style.md` + +- Follow Laravel naming conventions for all entities +- Prefer Laravel helpers (`Str`, `Arr`, `Number`, `Uri`, `Str::of()`, `$request->string()`) over raw PHP functions +- No JS/CSS in Blade, no HTML in PHP classes +- Code should be readable; comments only for config files + +## How to Apply + +Always use a sub-agent to read rule files and explore this skill's content. + +1. Identify the file type and select relevant sections (e.g., migration → §16, controller → §1, §3, §5, §6, §10) +2. Check sibling files for existing patterns — follow those first per Consistency First +3. Verify API syntax with `search-docs` for the installed Laravel version \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/advanced-queries.md b/.agents/skills/laravel-best-practices/rules/advanced-queries.md new file mode 100644 index 00000000..920714a1 --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/advanced-queries.md @@ -0,0 +1,106 @@ +# Advanced Query Patterns + +## Use `addSelect()` Subqueries for Single Values from Has-Many + +Instead of eager-loading an entire has-many relationship for a single value (like the latest timestamp), use a correlated subquery via `addSelect()`. This pulls the value directly in the main SQL query — zero extra queries. + +```php +public function scopeWithLastLoginAt($query): void +{ + $query->addSelect([ + 'last_login_at' => Login::select('created_at') + ->whereColumn('user_id', 'users.id') + ->latest() + ->take(1), + ])->withCasts(['last_login_at' => 'datetime']); +} +``` + +## Create Dynamic Relationships via Subquery FK + +Extend the `addSelect()` pattern to fetch a foreign key via subquery, then define a `belongsTo` relationship on that virtual attribute. This provides a fully-hydrated related model without loading the entire collection. + +```php +public function lastLogin(): BelongsTo +{ + return $this->belongsTo(Login::class); +} + +public function scopeWithLastLogin($query): void +{ + $query->addSelect([ + 'last_login_id' => Login::select('id') + ->whereColumn('user_id', 'users.id') + ->latest() + ->take(1), + ])->with('lastLogin'); +} +``` + +## Use Conditional Aggregates Instead of Multiple Count Queries + +Replace N separate `count()` queries with a single query using `CASE WHEN` inside `selectRaw()`. Use `toBase()` to skip model hydration when you only need scalar values. + +```php +$statuses = Feature::toBase() + ->selectRaw("count(case when status = 'Requested' then 1 end) as requested") + ->selectRaw("count(case when status = 'Planned' then 1 end) as planned") + ->selectRaw("count(case when status = 'Completed' then 1 end) as completed") + ->first(); +``` + +## Use `setRelation()` to Prevent Circular N+1 + +When a parent model is eager-loaded with its children, and the view also needs `$child->parent`, use `setRelation()` to inject the already-loaded parent rather than letting Eloquent fire N additional queries. + +```php +$feature->load('comments.user'); +$feature->comments->each->setRelation('feature', $feature); +``` + +## Prefer `whereIn` + Subquery Over `whereHas` + +`whereHas()` emits a correlated `EXISTS` subquery that re-executes per row. Using `whereIn()` with a `select('id')` subquery lets the database use an index lookup instead, without loading data into PHP memory. + +Incorrect (correlated EXISTS re-executes per row): + +```php +$query->whereHas('company', fn ($q) => $q->where('name', 'like', $term)); +``` + +Correct (index-friendly subquery, no PHP memory overhead): + +```php +$query->whereIn('company_id', Company::where('name', 'like', $term)->select('id')); +``` + +## Sometimes Two Simple Queries Beat One Complex Query + +Running a small, targeted secondary query and passing its results via `whereIn` is often faster than a single complex correlated subquery or join. The additional round-trip is worthwhile when the secondary query is highly selective and uses its own index. + +## Use Compound Indexes Matching `orderBy` Column Order + +When ordering by multiple columns, create a single compound index in the same column order as the `ORDER BY` clause. Individual single-column indexes cannot combine for multi-column sorts — the database will filesort without a compound index. + +```php +// Migration +$table->index(['last_name', 'first_name']); + +// Query — column order must match the index +User::query()->orderBy('last_name')->orderBy('first_name')->paginate(); +``` + +## Use Correlated Subqueries for Has-Many Ordering + +When sorting by a value from a has-many relationship, avoid joins (they duplicate rows). Use a correlated subquery inside `orderBy()` instead, paired with an `addSelect` scope for eager loading. + +```php +public function scopeOrderByLastLogin($query): void +{ + $query->orderByDesc(Login::select('created_at') + ->whereColumn('user_id', 'users.id') + ->latest() + ->take(1) + ); +} +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/architecture.md b/.agents/skills/laravel-best-practices/rules/architecture.md new file mode 100644 index 00000000..6112a635 --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/architecture.md @@ -0,0 +1,202 @@ +# Architecture Best Practices + +## Single-Purpose Action Classes + +Extract discrete business operations into invokable Action classes. + +```php +class CreateOrderAction +{ + public function __construct(private InventoryService $inventory) {} + + public function execute(array $data): Order + { + $order = Order::create($data); + $this->inventory->reserve($order); + + return $order; + } +} +``` + +## Use Dependency Injection + +Always use constructor injection. Avoid `app()` or `resolve()` inside classes. + +Incorrect: +```php +class OrderController extends Controller +{ + public function store(StoreOrderRequest $request) + { + $service = app(OrderService::class); + + return $service->create($request->validated()); + } +} +``` + +Correct: +```php +class OrderController extends Controller +{ + public function __construct(private OrderService $service) {} + + public function store(StoreOrderRequest $request) + { + return $this->service->create($request->validated()); + } +} +``` + +## Code to Interfaces + +Depend on contracts at system boundaries (payment gateways, notification channels, external APIs) for testability and swappability. + +Incorrect (concrete dependency): +```php +class OrderService +{ + public function __construct(private StripeGateway $gateway) {} +} +``` + +Correct (interface dependency): +```php +interface PaymentGateway +{ + public function charge(int $amount, string $customerId): PaymentResult; +} + +class OrderService +{ + public function __construct(private PaymentGateway $gateway) {} +} +``` + +Bind in a service provider: + +```php +$this->app->bind(PaymentGateway::class, StripeGateway::class); +``` + +## Default Sort by Descending + +When no explicit order is specified, sort by `id` or `created_at` descending. Without an explicit `ORDER BY`, row order is undefined. + +Incorrect: +```php +$posts = Post::paginate(); +``` + +Correct: +```php +$posts = Post::latest()->paginate(); +``` + +## Use Atomic Locks for Race Conditions + +Prevent race conditions with `Cache::lock()` or `lockForUpdate()`. + +```php +Cache::lock('order-processing-'.$order->id, 10)->block(5, function () use ($order) { + $order->process(); +}); + +// Or at query level +$product = Product::where('id', $id)->lockForUpdate()->first(); +``` + +## Use `mb_*` String Functions + +When no Laravel helper exists, prefer `mb_strlen`, `mb_strtolower`, etc. for UTF-8 safety. Standard PHP string functions count bytes, not characters. + +Incorrect: +```php +strlen('José'); // 5 (bytes, not characters) +strtolower('MÜNCHEN'); // 'mÜnchen' — fails on multibyte +``` + +Correct: +```php +mb_strlen('José'); // 4 (characters) +mb_strtolower('MÜNCHEN'); // 'münchen' + +// Prefer Laravel's Str helpers when available +Str::length('José'); // 4 +Str::lower('MÜNCHEN'); // 'münchen' +``` + +## Use `defer()` for Post-Response Work + +For lightweight tasks that don't need to survive a crash (logging, analytics, cleanup), use `defer()` instead of dispatching a job. The callback runs after the HTTP response is sent — no queue overhead. + +Incorrect (job overhead for trivial work): +```php +dispatch(new LogPageView($page)); +``` + +Correct (runs after response, same process): +```php +defer(fn () => PageView::create(['page_id' => $page->id, 'user_id' => auth()->id()])); +``` + +Use jobs when the work must survive process crashes or needs retry logic. Use `defer()` for fire-and-forget work. + +## Use `Context` for Request-Scoped Data + +The `Context` facade passes data through the entire request lifecycle — middleware, controllers, jobs, logs — without passing arguments manually. + +```php +// In middleware +Context::add('tenant_id', $request->header('X-Tenant-ID')); + +// Anywhere later — controllers, jobs, log context +$tenantId = Context::get('tenant_id'); +``` + +Context data automatically propagates to queued jobs and is included in log entries. Use `Context::addHidden()` for sensitive data that should be available in queued jobs but excluded from log context. If data must not leave the current process, do not store it in `Context`. + +## Use `Concurrency::run()` for Parallel Execution + +Run independent operations in parallel using child processes — no async libraries needed. + +```php +use Illuminate\Support\Facades\Concurrency; + +[$users, $orders] = Concurrency::run([ + fn () => User::count(), + fn () => Order::where('status', 'pending')->count(), +]); +``` + +Each closure runs in a separate process with full Laravel access. Use for independent database queries, API calls, or computations that would otherwise run sequentially. + +## Convention Over Configuration + +Follow Laravel conventions. Don't override defaults unnecessarily. + +Incorrect: +```php +class Customer extends Model +{ + protected $table = 'Customer'; + protected $primaryKey = 'customer_id'; + + public function roles(): BelongsToMany + { + return $this->belongsToMany(Role::class, 'role_customer', 'customer_id', 'role_id'); + } +} +``` + +Correct: +```php +class Customer extends Model +{ + public function roles(): BelongsToMany + { + return $this->belongsToMany(Role::class); + } +} +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/blade-views.md b/.agents/skills/laravel-best-practices/rules/blade-views.md new file mode 100644 index 00000000..c6f8aaf1 --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/blade-views.md @@ -0,0 +1,36 @@ +# Blade & Views Best Practices + +## Use `$attributes->merge()` in Component Templates + +Hardcoding classes prevents consumers from adding their own. `merge()` combines class attributes cleanly. + +```blade +
merge(['class' => 'alert alert-'.$type]) }}> + {{ $message }} +
+``` + +## Use `@pushOnce` for Per-Component Scripts + +If a component renders inside a `@foreach`, `@push` inserts the script N times. `@pushOnce` guarantees it's included exactly once. + +## Prefer Blade Components Over `@include` + +`@include` shares all parent variables implicitly (hidden coupling). Components have explicit props, attribute bags, and slots. + +## Use View Composers for Shared View Data + +If every controller rendering a sidebar must pass `$categories`, that's duplicated code. A View Composer centralizes it. + +## Use Blade Fragments for Partial Re-Renders (htmx/Turbo) + +A single view can return either the full page or just a fragment, keeping routing clean. + +```php +return view('dashboard', compact('users')) + ->fragmentIf($request->hasHeader('HX-Request'), 'user-list'); +``` + +## Use `@aware` for Deeply Nested Component Props + +Avoids re-passing parent props through every level of nested components. \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/caching.md b/.agents/skills/laravel-best-practices/rules/caching.md new file mode 100644 index 00000000..e65146dc --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/caching.md @@ -0,0 +1,70 @@ +# Caching Best Practices + +## Use `Cache::remember()` Instead of Manual Get/Put + +Cleaner cache-aside pattern that removes boilerplate. use `Cache::lock()` for race conditions. + +Incorrect: +```php +$val = Cache::get('stats'); +if (! $val) { + $val = $this->computeStats(); + Cache::put('stats', $val, 60); +} +``` + +Correct: +```php +$val = Cache::remember('stats', 60, fn () => $this->computeStats()); +``` + +## Use `Cache::flexible()` for Stale-While-Revalidate + +On high-traffic keys, one user always gets a slow response when the cache expires. `flexible()` serves slightly stale data while refreshing in the background. + +Incorrect: `Cache::remember('users', 300, fn () => User::all());` + +Correct: `Cache::flexible('users', [300, 600], fn () => User::all());` — fresh for 5 min, stale-but-served up to 10 min, refreshes via deferred function. + +## Use `Cache::memo()` to Avoid Redundant Hits Within a Request + +If the same cache key is read multiple times per request (e.g., a service called from multiple places), `memo()` stores the resolved value in memory. + +`Cache::memo()->get('settings');` — 5 calls = 1 Redis round-trip instead of 5. + +## Use Cache Tags to Invalidate Related Groups + +Without tags, invalidating a group of entries requires tracking every key. Tags let you flush atomically. Only works with `redis`, `memcached`, `dynamodb` — not `file` or `database`. + +```php +Cache::tags(['user-1'])->flush(); +``` + +## Use `Cache::add()` for Atomic Conditional Writes + +`add()` only writes if the key does not exist — atomic, no race condition between checking and writing. + +Incorrect: `if (! Cache::has('lock')) { Cache::put('lock', true, 10); }` + +Correct: `Cache::add('lock', true, 10);` + +## Use `once()` for Per-Request Memoization + +`once()` memoizes a function's return value for the lifetime of the object (or request for closures). Unlike `Cache::memo()`, it doesn't hit the cache store at all — pure in-memory. + +```php +public function roles(): Collection +{ + return once(fn () => $this->loadRoles()); +} +``` + +Multiple calls return the cached result without re-executing. Use `once()` for expensive computations called multiple times per request. Use `Cache::memo()` when you also want cross-request caching. + +## Configure Failover Cache Stores in Production + +If Redis goes down, the app falls back to a secondary store automatically. + +```php +'failover' => ['driver' => 'failover', 'stores' => ['redis', 'database']], +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/collections.md b/.agents/skills/laravel-best-practices/rules/collections.md new file mode 100644 index 00000000..14f683d3 --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/collections.md @@ -0,0 +1,44 @@ +# Collection Best Practices + +## Use Higher-Order Messages for Simple Operations + +Incorrect: +```php +$users->each(function (User $user) { + $user->markAsVip(); +}); +``` + +Correct: `$users->each->markAsVip();` + +Works with `each`, `map`, `sum`, `filter`, `reject`, `contains`, etc. + +## Choose `cursor()` vs. `lazy()` Correctly + +- `cursor()` — one model in memory, but cannot eager-load relationships (N+1 risk). +- `lazy()` — chunked pagination returning a flat LazyCollection, supports eager loading. + +Incorrect: `User::with('roles')->cursor()` — eager loading silently ignored. + +Correct: `User::with('roles')->lazy()` for relationship access; `User::cursor()` for attribute-only work. + +## Use `lazyById()` When Updating Records While Iterating + +`lazy()` uses offset pagination — updating records during iteration can skip or double-process. `lazyById()` uses `id > last_id`, safe against mutation. + +## Use `toQuery()` for Bulk Operations on Collections + +Avoids manual `whereIn` construction. + +Incorrect: `User::whereIn('id', $users->pluck('id'))->update([...]);` + +Correct: `$users->toQuery()->update([...]);` + +## Use `#[CollectedBy]` for Custom Collection Classes + +More declarative than overriding `newCollection()`. + +```php +#[CollectedBy(UserCollection::class)] +class User extends Model {} +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/config.md b/.agents/skills/laravel-best-practices/rules/config.md new file mode 100644 index 00000000..193155d6 --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/config.md @@ -0,0 +1,73 @@ +# Configuration Best Practices + +## `env()` Only in Config Files + +Direct `env()` calls may return `null` when config is cached. + +Incorrect: +```php +$key = env('API_KEY'); +``` + +Correct: +```php +// config/services.php +'key' => env('API_KEY'), + +// Application code +$key = config('services.key'); +``` + +## Use Encrypted Env or External Secrets + +Never store production secrets in plain `.env` files in version control. + +Incorrect: +```bash + +# .env committed to repo or shared in Slack + +STRIPE_SECRET=sk_live_abc123 +AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI +``` + +Correct: +```bash +php artisan env:encrypt --env=production --readable +php artisan env:decrypt --env=production +``` + +For cloud deployments, prefer the platform's native secret store (AWS Secrets Manager, Vault, etc.) and inject at runtime. + +## Use `App::environment()` for Environment Checks + +Incorrect: +```php +if (env('APP_ENV') === 'production') { +``` + +Correct: +```php +if (app()->isProduction()) { +// or +if (App::environment('production')) { +``` + +## Use Constants and Language Files + +Use class constants instead of hardcoded magic strings for model states, types, and statuses. + +```php +// Incorrect +return $this->type === 'normal'; + +// Correct +return $this->type === self::TYPE_NORMAL; +``` + +If the application already uses language files for localization, use `__()` for user-facing strings too. Do not introduce language files purely for English-only apps — simple string literals are fine there. + +```php +// Only when lang files already exist in the project +return back()->with('message', __('app.article_added')); +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/db-performance.md b/.agents/skills/laravel-best-practices/rules/db-performance.md new file mode 100644 index 00000000..8fb71937 --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/db-performance.md @@ -0,0 +1,192 @@ +# Database Performance Best Practices + +## Always Eager Load Relationships + +Lazy loading causes N+1 query problems — one query per loop iteration. Always use `with()` to load relationships upfront. + +Incorrect (N+1 — executes 1 + N queries): +```php +$posts = Post::all(); +foreach ($posts as $post) { + echo $post->author->name; +} +``` + +Correct (2 queries total): +```php +$posts = Post::with('author')->get(); +foreach ($posts as $post) { + echo $post->author->name; +} +``` + +Constrain eager loads to select only needed columns (always include the foreign key): + +```php +$users = User::with(['posts' => function ($query) { + $query->select('id', 'user_id', 'title') + ->where('published', true) + ->latest() + ->limit(10); +}])->get(); +``` + +## Prevent Lazy Loading in Development + +Enable this in `AppServiceProvider::boot()` to catch N+1 issues during development. + +```php +public function boot(): void +{ + Model::preventLazyLoading(! app()->isProduction()); +} +``` + +Throws `LazyLoadingViolationException` when a relationship is accessed without being eager-loaded. + +## Select Only Needed Columns + +Avoid `SELECT *` — especially when tables have large text or JSON columns. + +Incorrect: +```php +$posts = Post::with('author')->get(); +``` + +Correct: +```php +$posts = Post::select('id', 'title', 'user_id', 'created_at') + ->with(['author:id,name,avatar']) + ->get(); +``` + +When selecting columns on eager-loaded relationships, always include the foreign key column or the relationship won't match. + +## Chunk Large Datasets + +Never load thousands of records at once. Use chunking for batch processing. + +Incorrect: +```php +$users = User::all(); +foreach ($users as $user) { + $user->notify(new WeeklyDigest); +} +``` + +Correct: +```php +User::where('subscribed', true)->chunk(200, function ($users) { + foreach ($users as $user) { + $user->notify(new WeeklyDigest); + } +}); +``` + +Use `chunkById()` when modifying records during iteration — standard `chunk()` uses OFFSET which shifts when rows change: + +```php +User::where('active', false)->chunkById(200, function ($users) { + $users->each->delete(); +}); +``` + +## Add Database Indexes + +Index columns that appear in `WHERE`, `ORDER BY`, `JOIN`, and `GROUP BY` clauses. + +Incorrect: +```php +Schema::create('orders', function (Blueprint $table) { + $table->id(); + $table->foreignId('user_id')->constrained(); + $table->string('status'); + $table->timestamps(); +}); +``` + +Correct: +```php +Schema::create('orders', function (Blueprint $table) { + $table->id(); + $table->foreignId('user_id')->index()->constrained(); + $table->string('status')->index(); + $table->timestamps(); + $table->index(['status', 'created_at']); +}); +``` + +Add composite indexes for common query patterns (e.g., `WHERE status = ? ORDER BY created_at`). + +## Use `withCount()` for Counting Relations + +Never load entire collections just to count them. + +Incorrect: +```php +$posts = Post::all(); +foreach ($posts as $post) { + echo $post->comments->count(); +} +``` + +Correct: +```php +$posts = Post::withCount('comments')->get(); +foreach ($posts as $post) { + echo $post->comments_count; +} +``` + +Conditional counting: + +```php +$posts = Post::withCount([ + 'comments', + 'comments as approved_comments_count' => function ($query) { + $query->where('approved', true); + }, +])->get(); +``` + +## Use `cursor()` for Memory-Efficient Iteration + +For read-only iteration over large result sets, `cursor()` loads one record at a time via a PHP generator. + +Incorrect: +```php +$users = User::where('active', true)->get(); +``` + +Correct: +```php +foreach (User::where('active', true)->cursor() as $user) { + ProcessUser::dispatch($user->id); +} +``` + +Use `cursor()` for read-only iteration. Use `chunk()` / `chunkById()` when modifying records. + +## No Queries in Blade Templates + +Never execute queries in Blade templates. Pass data from controllers. + +Incorrect: +```blade +@foreach (User::all() as $user) + {{ $user->profile->name }} +@endforeach +``` + +Correct: +```php +// Controller +$users = User::with('profile')->get(); +return view('users.index', compact('users')); +``` + +```blade +@foreach ($users as $user) + {{ $user->profile->name }} +@endforeach +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/eloquent.md b/.agents/skills/laravel-best-practices/rules/eloquent.md new file mode 100644 index 00000000..09cd66a0 --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/eloquent.md @@ -0,0 +1,148 @@ +# Eloquent Best Practices + +## Use Correct Relationship Types + +Use `hasMany`, `belongsTo`, `morphMany`, etc. with proper return type hints. + +```php +public function comments(): HasMany +{ + return $this->hasMany(Comment::class); +} + +public function author(): BelongsTo +{ + return $this->belongsTo(User::class, 'user_id'); +} +``` + +## Use Local Scopes for Reusable Queries + +Extract reusable query constraints into local scopes to avoid duplication. + +Incorrect: +```php +$active = User::where('verified', true)->whereNotNull('activated_at')->get(); +$articles = Article::whereHas('user', function ($q) { + $q->where('verified', true)->whereNotNull('activated_at'); +})->get(); +``` + +Correct: +```php +public function scopeActive(Builder $query): Builder +{ + return $query->where('verified', true)->whereNotNull('activated_at'); +} + +// Usage +$active = User::active()->get(); +$articles = Article::whereHas('user', fn ($q) => $q->active())->get(); +``` + +## Apply Global Scopes Sparingly + +Global scopes silently modify every query on the model, making debugging difficult. Prefer local scopes and reserve global scopes for truly universal constraints like soft deletes or multi-tenancy. + +Incorrect (global scope for a conditional filter): +```php +class PublishedScope implements Scope +{ + public function apply(Builder $builder, Model $model): void + { + $builder->where('published', true); + } +} +// Now admin panels, reports, and background jobs all silently skip drafts +``` + +Correct (local scope you opt into): +```php +public function scopePublished(Builder $query): Builder +{ + return $query->where('published', true); +} + +Post::published()->paginate(); // Explicit +Post::paginate(); // Admin sees all +``` + +## Define Attribute Casts + +Use the `casts()` method (or `$casts` property following project convention) for automatic type conversion. + +```php +protected function casts(): array +{ + return [ + 'is_active' => 'boolean', + 'metadata' => 'array', + 'total' => 'decimal:2', + ]; +} +``` + +## Cast Date Columns Properly + +Always cast date columns. Use Carbon instances in templates instead of formatting strings manually. + +Incorrect: +```blade +{{ Carbon::createFromFormat('Y-d-m H-i', $order->ordered_at)->toDateString() }} +``` + +Correct: +```php +protected function casts(): array +{ + return [ + 'ordered_at' => 'datetime', + ]; +} +``` + +```blade +{{ $order->ordered_at->toDateString() }} +{{ $order->ordered_at->format('m-d') }} +``` + +## Use `whereBelongsTo()` for Relationship Queries + +Cleaner than manually specifying foreign keys. + +Incorrect: +```php +Post::where('user_id', $user->id)->get(); +``` + +Correct: +```php +Post::whereBelongsTo($user)->get(); +Post::whereBelongsTo($user, 'author')->get(); +``` + +## Avoid Hardcoded Table Names in Queries + +Never use string literals for table names in raw queries, joins, or subqueries. Hardcoded table names make it impossible to find all places a model is used and break refactoring (e.g., renaming a table requires hunting through every raw string). + +Incorrect: +```php +DB::table('users')->where('active', true)->get(); + +$query->join('companies', 'companies.id', '=', 'users.company_id'); + +DB::select('SELECT * FROM orders WHERE status = ?', ['pending']); +``` + +Correct — reference the model's table: +```php +DB::table((new User)->getTable())->where('active', true)->get(); + +// Even better — use Eloquent or the query builder instead of raw SQL +User::where('active', true)->get(); +Order::where('status', 'pending')->get(); +``` + +Prefer Eloquent queries and relationships over `DB::table()` whenever possible — they already reference the model's table. When `DB::table()` or raw joins are unavoidable, always use `(new Model)->getTable()` to keep the reference traceable. + +**Exception — migrations:** In migrations, hardcoded table names via `DB::table('settings')` are acceptable and preferred. Models change over time but migrations are frozen snapshots — referencing a model that is later renamed or deleted would break the migration. \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/error-handling.md b/.agents/skills/laravel-best-practices/rules/error-handling.md new file mode 100644 index 00000000..bb8e7a38 --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/error-handling.md @@ -0,0 +1,72 @@ +# Error Handling Best Practices + +## Exception Reporting and Rendering + +There are two valid approaches — choose one and apply it consistently across the project. + +**Co-location on the exception class** — keeps behavior alongside the exception definition, easier to find: + +```php +class InvalidOrderException extends Exception +{ + public function report(): void { /* custom reporting */ } + + public function render(Request $request): Response + { + return response()->view('errors.invalid-order', status: 422); + } +} +``` + +**Centralized in `bootstrap/app.php`** — all exception handling in one place, easier to see the full picture: + +```php +->withExceptions(function (Exceptions $exceptions) { + $exceptions->report(function (InvalidOrderException $e) { /* ... */ }); + $exceptions->render(function (InvalidOrderException $e, Request $request) { + return response()->view('errors.invalid-order', status: 422); + }); +}) +``` + +Check the existing codebase and follow whichever pattern is already established. + +## Use `ShouldntReport` for Exceptions That Should Never Log + +More discoverable than listing classes in `dontReport()`. + +```php +class PodcastProcessingException extends Exception implements ShouldntReport {} +``` + +## Throttle High-Volume Exceptions + +A single failing integration can flood error tracking. Use `throttle()` to rate-limit per exception type. + +## Enable `dontReportDuplicates()` + +Prevents the same exception instance from being logged multiple times when `report($e)` is called in multiple catch blocks. + +## Force JSON Error Rendering for API Routes + +Laravel auto-detects `Accept: application/json` but API clients may not set it. Explicitly declare JSON rendering for API routes. + +```php +$exceptions->shouldRenderJsonWhen(function (Request $request, Throwable $e) { + return $request->is('api/*') || $request->expectsJson(); +}); +``` + +## Add Context to Exception Classes + +Attach structured data to exceptions at the source via a `context()` method — Laravel includes it automatically in the log entry. + +```php +class InvalidOrderException extends Exception +{ + public function context(): array + { + return ['order_id' => $this->orderId]; + } +} +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/events-notifications.md b/.agents/skills/laravel-best-practices/rules/events-notifications.md new file mode 100644 index 00000000..47fcf324 --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/events-notifications.md @@ -0,0 +1,52 @@ +# Events & Notifications Best Practices + +## Rely on Event Discovery + +Laravel auto-discovers listeners by reading `handle(EventType $event)` type-hints. No manual registration needed in `AppServiceProvider`. + +## Run `event:cache` in Production Deploy + +Event discovery scans the filesystem per-request in dev. Cache it in production: `php artisan optimize` or `php artisan event:cache`. + +## Use `ShouldDispatchAfterCommit` Inside Transactions + +Without it, a queued listener may process before the DB transaction commits, reading data that doesn't exist yet. + +```php +class OrderShipped implements ShouldDispatchAfterCommit {} +``` + +## Always Queue Notifications + +Notifications often hit external APIs (email, SMS, Slack). Without `ShouldQueue`, they block the HTTP response. + +```php +class InvoicePaid extends Notification implements ShouldQueue +{ + use Queueable; +} +``` + +## Use `afterCommit()` on Notifications in Transactions + +Same race condition as events — call `afterCommit()` to delay dispatch until the transaction commits. + +```php +$user->notify((new InvoicePaid($invoice))->afterCommit()); +``` + +## Route Notification Channels to Dedicated Queues + +Mail and database notifications have different priorities. Use `viaQueues()` to route them to separate queues. + +## Use On-Demand Notifications for Non-User Recipients + +Avoid creating dummy models to send notifications to arbitrary addresses. + +```php +Notification::route('mail', 'admin@example.com')->notify(new SystemAlert()); +``` + +## Implement `HasLocalePreference` on Notifiable Models + +Laravel automatically uses the user's preferred locale for all notifications and mailables — no per-call `locale()` needed. \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/http-client.md b/.agents/skills/laravel-best-practices/rules/http-client.md new file mode 100644 index 00000000..fd37ddb9 --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/http-client.md @@ -0,0 +1,160 @@ +# HTTP Client Best Practices + +## Always Set Explicit Timeouts + +The default timeout is 30 seconds — too long for most API calls. Always set explicit `timeout` and `connectTimeout` to fail fast. + +Incorrect: +```php +$response = Http::get('https://api.example.com/users'); +``` + +Correct: +```php +$response = Http::timeout(5) + ->connectTimeout(3) + ->get('https://api.example.com/users'); +``` + +For service-specific clients, define timeouts in a macro: + +```php +Http::macro('github', function () { + return Http::baseUrl('https://api.github.com') + ->timeout(10) + ->connectTimeout(3) + ->withToken(config('services.github.token')); +}); + +$response = Http::github()->get('/repos/laravel/framework'); +``` + +## Use Retry with Backoff for External APIs + +External APIs have transient failures. Use `retry()` with increasing delays. + +Incorrect: +```php +$response = Http::post('https://api.stripe.com/v1/charges', $data); + +if ($response->failed()) { + throw new PaymentFailedException('Charge failed'); +} +``` + +Correct: +```php +$response = Http::retry([100, 500, 1000]) + ->timeout(10) + ->post('https://api.stripe.com/v1/charges', $data); +``` + +Only retry on specific errors: + +```php +$response = Http::retry(3, 100, function (Throwable $exception, PendingRequest $request) { + return $exception instanceof ConnectionException + || ($exception instanceof RequestException && $exception->response->serverError()); +})->post('https://api.example.com/data'); +``` + +## Handle Errors Explicitly + +The HTTP Client does not throw on 4xx/5xx by default. Always check status or use `throw()`. + +Incorrect: +```php +$response = Http::get('https://api.example.com/users/1'); +$user = $response->json(); // Could be an error body +``` + +Correct: +```php +$response = Http::timeout(5) + ->get('https://api.example.com/users/1') + ->throw(); + +$user = $response->json(); +``` + +For graceful degradation: + +```php +$response = Http::get('https://api.example.com/users/1'); + +if ($response->successful()) { + return $response->json(); +} + +if ($response->notFound()) { + return null; +} + +$response->throw(); +``` + +## Use Request Pooling for Concurrent Requests + +When making multiple independent API calls, use `Http::pool()` instead of sequential calls. + +Incorrect: +```php +$users = Http::get('https://api.example.com/users')->json(); +$posts = Http::get('https://api.example.com/posts')->json(); +$comments = Http::get('https://api.example.com/comments')->json(); +``` + +Correct: +```php +use Illuminate\Http\Client\Pool; + +$responses = Http::pool(fn (Pool $pool) => [ + $pool->as('users')->get('https://api.example.com/users'), + $pool->as('posts')->get('https://api.example.com/posts'), + $pool->as('comments')->get('https://api.example.com/comments'), +]); + +$users = $responses['users']->json(); +$posts = $responses['posts']->json(); +``` + +## Fake HTTP Calls in Tests + +Never make real HTTP requests in tests. Use `Http::fake()` and `preventStrayRequests()`. + +Incorrect: +```php +it('syncs user from API', function () { + $service = new UserSyncService; + $service->sync(1); // Hits the real API +}); +``` + +Correct: +```php +it('syncs user from API', function () { + Http::preventStrayRequests(); + + Http::fake([ + 'api.example.com/users/1' => Http::response([ + 'name' => 'John Doe', + 'email' => 'john@example.com', + ]), + ]); + + $service = new UserSyncService; + $service->sync(1); + + Http::assertSent(function (Request $request) { + return $request->url() === 'https://api.example.com/users/1'; + }); +}); +``` + +Test failure scenarios too: + +```php +Http::fake([ + 'api.example.com/*' => Http::failedConnection(), +]); +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/mail.md b/.agents/skills/laravel-best-practices/rules/mail.md new file mode 100644 index 00000000..2435d9cc --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/mail.md @@ -0,0 +1,27 @@ +# Mail Best Practices + +## Implement `ShouldQueue` on the Mailable Class + +Makes queueing the default regardless of how the mailable is dispatched. No need to remember `Mail::queue()` at every call site — `Mail::send()` also queues it. + +## Use `afterCommit()` on Mailables Inside Transactions + +A queued mailable dispatched inside a transaction may process before the commit. Use `$this->afterCommit()` in the constructor. + +## Use `assertQueued()` Not `assertSent()` for Queued Mailables + +`Mail::assertSent()` only catches synchronous mail. Queued mailables fail `assertSent` with a "Did you mean to use assertQueued()?" hint. + +Incorrect: `Mail::assertSent(OrderShipped::class);` when mailable implements `ShouldQueue`. + +Correct: `Mail::assertQueued(OrderShipped::class);` + +## Use Markdown Mailables for Transactional Emails + +Markdown mailables auto-generate both HTML and plain-text versions, use responsive components, and allow global style customization. Generate with `--markdown` flag. + +## Separate Content Tests from Sending Tests + +Content tests: instantiate the mailable directly, call `assertSeeInHtml()`. +Sending tests: use `Mail::fake()` and `assertSent()`/`assertQueued()`. +Don't mix them — it conflates concerns and makes tests brittle. \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/migrations.md b/.agents/skills/laravel-best-practices/rules/migrations.md new file mode 100644 index 00000000..de25aa39 --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/migrations.md @@ -0,0 +1,121 @@ +# Migration Best Practices + +## Generate Migrations with Artisan + +Always use `php artisan make:migration` for consistent naming and timestamps. + +Incorrect (manually created file): +```php +// database/migrations/posts_migration.php ← wrong naming, no timestamp +``` + +Correct (Artisan-generated): +```bash +php artisan make:migration create_posts_table +php artisan make:migration add_slug_to_posts_table +``` + +## Use `constrained()` for Foreign Keys + +Automatic naming and referential integrity. + +```php +$table->foreignId('user_id')->constrained()->cascadeOnDelete(); + +// Non-standard names +$table->foreignId('author_id')->constrained('users'); +``` + +## Never Modify Deployed Migrations + +Once a migration has run in production, treat it as immutable. Create a new migration to change the table. + +Incorrect (editing a deployed migration): +```php +// 2024_01_01_create_posts_table.php — already in production +$table->string('slug')->unique(); // ← added after deployment +``` + +Correct (new migration to alter): +```php +// 2024_03_15_add_slug_to_posts_table.php +Schema::table('posts', function (Blueprint $table) { + $table->string('slug')->unique()->after('title'); +}); +``` + +## Add Indexes in the Migration + +Add indexes when creating the table, not as an afterthought. Columns used in `WHERE`, `ORDER BY`, and `JOIN` clauses need indexes. + +Incorrect: +```php +Schema::create('orders', function (Blueprint $table) { + $table->id(); + $table->foreignId('user_id')->constrained(); + $table->string('status'); + $table->timestamps(); +}); +``` + +Correct: +```php +Schema::create('orders', function (Blueprint $table) { + $table->id(); + $table->foreignId('user_id')->constrained()->index(); + $table->string('status')->index(); + $table->timestamp('shipped_at')->nullable()->index(); + $table->timestamps(); +}); +``` + +## Mirror Defaults in Model `$attributes` + +When a column has a database default, mirror it in the model so new instances have correct values before saving. + +```php +// Migration +$table->string('status')->default('pending'); + +// Model +protected $attributes = [ + 'status' => 'pending', +]; +``` + +## Write Reversible `down()` Methods by Default + +Implement `down()` for schema changes that can be safely reversed so `migrate:rollback` works in CI and failed deployments. + +```php +public function down(): void +{ + Schema::table('posts', function (Blueprint $table) { + $table->dropColumn('slug'); + }); +} +``` + +For intentionally irreversible migrations (e.g., destructive data backfills), leave a clear comment and require a forward fix migration instead of pretending rollback is supported. + +## Keep Migrations Focused + +One concern per migration. Never mix DDL (schema changes) and DML (data manipulation). + +Incorrect (partial failure creates unrecoverable state): +```php +public function up(): void +{ + Schema::create('settings', function (Blueprint $table) { ... }); + DB::table('settings')->insert(['key' => 'version', 'value' => '1.0']); +} +``` + +Correct (separate migrations): +```php +// Migration 1: create_settings_table +Schema::create('settings', function (Blueprint $table) { ... }); + +// Migration 2: seed_default_settings +DB::table('settings')->insert(['key' => 'version', 'value' => '1.0']); +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/queue-jobs.md b/.agents/skills/laravel-best-practices/rules/queue-jobs.md new file mode 100644 index 00000000..f7aa548b --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/queue-jobs.md @@ -0,0 +1,144 @@ +# Queue & Job Best Practices + +## Set `retry_after` Greater Than `timeout` + +If `retry_after` is shorter than the job's `timeout`, the queue worker re-dispatches the job while it's still running, causing duplicate execution. + +Incorrect (`retry_after` ≤ `timeout`): +```php +class ProcessReport implements ShouldQueue +{ + public $timeout = 120; +} + +// config/queue.php — retry_after: 90 ← job retried while still running! +``` + +Correct (`retry_after` > `timeout`): +```php +class ProcessReport implements ShouldQueue +{ + public $timeout = 120; +} + +// config/queue.php — retry_after: 180 ← safely longer than any job timeout +``` + +## Use Exponential Backoff + +Use progressively longer delays between retries to avoid hammering failing services. + +Incorrect (fixed retry interval): +```php +class SyncWithStripe implements ShouldQueue +{ + public $tries = 3; + // Default: retries immediately, overwhelming the API +} +``` + +Correct (exponential backoff): +```php +class SyncWithStripe implements ShouldQueue +{ + public $tries = 3; + public $backoff = [1, 5, 10]; +} +``` + +## Implement `ShouldBeUnique` + +Prevent duplicate job processing. + +```php +class GenerateInvoice implements ShouldQueue, ShouldBeUnique +{ + public function uniqueId(): string + { + return $this->order->id; + } + + public $uniqueFor = 3600; +} +``` + +## Always Implement `failed()` + +Handle errors explicitly — don't rely on silent failure. + +```php +public function failed(?Throwable $exception): void +{ + $this->podcast->update(['status' => 'failed']); + Log::error('Processing failed', ['id' => $this->podcast->id, 'error' => $exception->getMessage()]); +} +``` + +## Rate Limit External API Calls in Jobs + +Use `RateLimited` middleware to throttle jobs calling third-party APIs. + +```php +public function middleware(): array +{ + return [new RateLimited('external-api')]; +} +``` + +## Batch Related Jobs + +Use `Bus::batch()` when jobs should succeed or fail together. + +```php +Bus::batch([ + new ImportCsvChunk($chunk1), + new ImportCsvChunk($chunk2), +]) +->then(fn (Batch $batch) => Notification::send($user, new ImportComplete)) +->catch(fn (Batch $batch, Throwable $e) => Log::error('Batch failed')) +->dispatch(); +``` + +## `retryUntil()` Needs `$tries = 0` + +When using time-based retry limits, set `$tries = 0` to avoid premature failure. + +```php +public $tries = 0; + +public function retryUntil(): \DateTimeInterface +{ + return now()->addHours(4); +} +``` + +## Use `ShouldBeUniqueUntilProcessing` for Early Lock Release + +`ShouldBeUnique` holds the lock until the job completes. `ShouldBeUniqueUntilProcessing` releases it when processing starts, allowing new instances to queue. + +```php +class UpdateSearchIndex implements ShouldQueue, ShouldBeUniqueUntilProcessing +{ + // Lock releases when processing begins, not when it finishes +} +``` + +## Use Horizon for Complex Queue Scenarios + +Use Laravel Horizon when you need monitoring, auto-scaling, failure tracking, or multiple queues with different priorities. + +```php +// config/horizon.php +'environments' => [ + 'production' => [ + 'supervisor-1' => [ + 'connection' => 'redis', + 'queue' => ['high', 'default', 'low'], + 'balance' => 'auto', + 'minProcesses' => 1, + 'maxProcesses' => 10, + 'tries' => 3, + ], + ], +], +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/routing.md b/.agents/skills/laravel-best-practices/rules/routing.md new file mode 100644 index 00000000..977d136e --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/routing.md @@ -0,0 +1,99 @@ +# Routing & Controllers Best Practices + +## Use Implicit Route Model Binding + +Let Laravel resolve models automatically from route parameters. + +Incorrect: +```php +public function show(int $id) +{ + $post = Post::findOrFail($id); +} +``` + +Correct: +```php +public function show(Post $post) +{ + return view('posts.show', ['post' => $post]); +} +``` + +## Use Scoped Bindings for Nested Resources + +Enforce parent-child relationships automatically. + +```php +Route::get('/users/{user}/posts/{post}', function (User $user, Post $post) { + // $post is automatically scoped to $user +})->scopeBindings(); +``` + +## Use Resource Controllers + +Use `Route::resource()` or `apiResource()` for RESTful endpoints. + +```php +Route::resource('posts', PostController::class); +// In routes/api.php — the /api prefix is applied automatically +Route::apiResource('posts', Api\PostController::class); +``` + +## Keep Controllers Thin + +Aim for under 10 lines per method. Extract business logic to action or service classes. + +Incorrect: +```php +public function store(Request $request) +{ + $validated = $request->validate([...]); + if ($request->hasFile('image')) { + $request->file('image')->move(public_path('images')); + } + $post = Post::create($validated); + $post->tags()->sync($validated['tags']); + event(new PostCreated($post)); + return redirect()->route('posts.show', $post); +} +``` + +Correct: +```php +public function store(StorePostRequest $request, CreatePostAction $create) +{ + $post = $create->execute($request->validated()); + + return redirect()->route('posts.show', $post); +} +``` + +## Type-Hint Form Requests + +Type-hinting Form Requests triggers automatic validation and authorization before the method executes. + +Incorrect: +```php +public function store(Request $request): RedirectResponse +{ + $validated = $request->validate([ + 'title' => ['required', 'max:255'], + 'body' => ['required'], + ]); + + Post::create($validated); + + return redirect()->route('posts.index'); +} +``` + +Correct: +```php +public function store(StorePostRequest $request): RedirectResponse +{ + Post::create($request->validated()); + + return redirect()->route('posts.index'); +} +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/scheduling.md b/.agents/skills/laravel-best-practices/rules/scheduling.md new file mode 100644 index 00000000..dfaefa26 --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/scheduling.md @@ -0,0 +1,39 @@ +# Task Scheduling Best Practices + +## Use `withoutOverlapping()` on Variable-Duration Tasks + +Without it, a long-running task spawns a second instance on the next tick, causing double-processing or resource exhaustion. + +## Use `onOneServer()` on Multi-Server Deployments + +Without it, every server runs the same task simultaneously. Requires a shared cache driver (Redis, database, Memcached). + +## Use `runInBackground()` for Concurrent Long Tasks + +By default, tasks at the same tick run sequentially. A slow first task delays all subsequent ones. `runInBackground()` runs them as separate processes. + +## Use `environments()` to Restrict Tasks + +Prevent accidental execution of production-only tasks (billing, reporting) on staging. + +```php +Schedule::command('billing:charge')->monthly()->environments(['production']); +``` + +## Use `takeUntilTimeout()` for Time-Bounded Processing + +A task running every 15 minutes that processes an unbounded cursor can overlap with the next run. Bound execution time. + +## Use Schedule Groups for Shared Configuration + +Avoid repeating `->onOneServer()->timezone('America/New_York')` across many tasks. + +```php +Schedule::daily() + ->onOneServer() + ->timezone('America/New_York') + ->group(function () { + Schedule::command('emails:send --force'); + Schedule::command('emails:prune'); + }); +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/security.md b/.agents/skills/laravel-best-practices/rules/security.md new file mode 100644 index 00000000..909ff91a --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/security.md @@ -0,0 +1,198 @@ +# Security Best Practices + +## Mass Assignment Protection + +Every model must define `$fillable` (whitelist) or `$guarded` (blacklist). + +Incorrect: +```php +class User extends Model +{ + protected $guarded = []; // All fields are mass assignable +} +``` + +Correct: +```php +class User extends Model +{ + protected $fillable = [ + 'name', + 'email', + 'password', + ]; +} +``` + +Never use `$guarded = []` on models that accept user input. + +## Authorize Every Action + +Use policies or gates in controllers. Never skip authorization. + +Incorrect: +```php +public function update(UpdatePostRequest $request, Post $post) +{ + $post->update($request->validated()); +} +``` + +Correct: +```php +public function update(UpdatePostRequest $request, Post $post) +{ + Gate::authorize('update', $post); + + $post->update($request->validated()); +} +``` + +Or via Form Request: + +```php +public function authorize(): bool +{ + return $this->user()->can('update', $this->route('post')); +} +``` + +## Prevent SQL Injection + +Always use parameter binding. Never interpolate user input into queries. + +Incorrect: +```php +DB::select("SELECT * FROM users WHERE name = '{$request->name}'"); +``` + +Correct: +```php +User::where('name', $request->name)->get(); + +// Raw expressions with bindings +User::whereRaw('LOWER(name) = ?', [strtolower($request->name)])->get(); +``` + +## Escape Output to Prevent XSS + +Use `{{ }}` for HTML escaping. Only use `{!! !!}` for trusted, pre-sanitized content. + +Incorrect: +```blade +{!! $user->bio !!} +``` + +Correct: +```blade +{{ $user->bio }} +``` + +## CSRF Protection + +Include `@csrf` in all POST/PUT/DELETE Blade forms. In Inertia apps, the `@csrf` directive is automatically applied. + +Incorrect: +```blade +
+ +
+``` + +Correct: +```blade +
+ @csrf + +
+``` + +## Rate Limit Auth and API Routes + +Apply `throttle` middleware to authentication and API routes. + +```php +RateLimiter::for('login', function (Request $request) { + return Limit::perMinute(5)->by($request->ip()); +}); + +Route::post('/login', LoginController::class)->middleware('throttle:login'); +``` + +## Validate File Uploads + +Validate extension, MIME type, and size. The `mimes` rule checks extensions; use `mimetypes` for actual MIME type validation. Never trust client-provided filenames. + +```php +public function rules(): array +{ + return [ + 'avatar' => ['required', 'image', 'mimes:jpg,jpeg,png,webp', 'max:2048'], + ]; +} +``` + +Store with generated filenames: + +```php +$path = $request->file('avatar')->store('avatars', 'public'); +``` + +## Keep Secrets Out of Code + +Never commit `.env`. Access secrets via `config()` only. + +Incorrect: +```php +$key = env('API_KEY'); +``` + +Correct: +```php +// config/services.php +'api_key' => env('API_KEY'), + +// In application code +$key = config('services.api_key'); +``` + +## Audit Dependencies + +Run `composer audit` periodically to check for known vulnerabilities in dependencies. Automate this in CI to catch issues before deployment. + +```bash +composer audit +``` + +## Encrypt Sensitive Database Fields + +Use `encrypted` cast for API keys/tokens and mark the attribute as `hidden`. + +Incorrect: +```php +class Integration extends Model +{ + protected function casts(): array + { + return [ + 'api_key' => 'string', + ]; + } +} +``` + +Correct: +```php +class Integration extends Model +{ + protected $hidden = ['api_key', 'api_secret']; + + protected function casts(): array + { + return [ + 'api_key' => 'encrypted', + 'api_secret' => 'encrypted', + ]; + } +} +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/style.md b/.agents/skills/laravel-best-practices/rules/style.md new file mode 100644 index 00000000..67af9891 --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/style.md @@ -0,0 +1,125 @@ +# Conventions & Style + +## Follow Laravel Naming Conventions + +| What | Convention | Good | Bad | +|------|-----------|------|-----| +| Controller | singular | `ArticleController` | `ArticlesController` | +| Model | singular | `User` | `Users` | +| Table | plural, snake_case | `article_comments` | `articleComments` | +| Pivot table | singular alphabetical | `article_user` | `user_article` | +| Column | snake_case, no model name | `meta_title` | `article_meta_title` | +| Foreign key | singular model + `_id` | `article_id` | `articles_id` | +| Route | plural | `articles/1` | `article/1` | +| Route name | snake_case with dots | `users.show_active` | `users.show-active` | +| Method | camelCase | `getAll` | `get_all` | +| Variable | camelCase | `$articlesWithAuthor` | `$articles_with_author` | +| Collection | descriptive, plural | `$activeUsers` | `$data` | +| Object | descriptive, singular | `$activeUser` | `$users` | +| View | kebab-case | `show-filtered.blade.php` | `showFiltered.blade.php` | +| Config | snake_case | `google_calendar.php` | `googleCalendar.php` | +| Enum | singular | `UserType` | `UserTypes` | + +## Prefer Shorter Readable Syntax + +| Verbose | Shorter | +|---------|---------| +| `Session::get('cart')` | `session('cart')` | +| `$request->session()->get('cart')` | `session('cart')` | +| `$request->input('name')` | `$request->name` | +| `return Redirect::back()` | `return back()` | +| `Carbon::now()` | `now()` | +| `App::make('Class')` | `app('Class')` | +| `->where('column', '=', 1)` | `->where('column', 1)` | +| `->orderBy('created_at', 'desc')` | `->latest()` | +| `->orderBy('created_at', 'asc')` | `->oldest()` | +| `->first()->name` | `->value('name')` | + +## Use Laravel String & Array Helpers + +Laravel provides `Str`, `Arr`, `Number`, and `Uri` helper classes that are more readable, chainable, and UTF-8 safe than raw PHP functions. Always prefer them. + +Strings — use `Str` and fluent `Str::of()` over raw PHP: +```php +// Incorrect +$slug = strtolower(str_replace(' ', '-', $title)); +$short = substr($text, 0, 100) . '...'; +$class = substr(strrchr('App\Models\User', '\'), 1); + +// Correct +$slug = Str::slug($title); +$short = Str::limit($text, 100); +$class = class_basename('App\Models\User'); +``` + +Fluent strings — chain operations for complex transformations: +```php +// Incorrect +$result = strtolower(trim(str_replace('_', '-', $input))); + +// Correct +$result = Str::of($input)->trim()->replace('_', '-')->lower(); +``` + +Key `Str` methods to prefer: `Str::slug()`, `Str::limit()`, `Str::contains()`, `Str::before()`, `Str::after()`, `Str::between()`, `Str::camel()`, `Str::snake()`, `Str::kebab()`, `Str::headline()`, `Str::squish()`, `Str::mask()`, `Str::uuid()`, `Str::ulid()`, `Str::random()`, `Str::is()`. + +Arrays — use `Arr` over raw PHP: +```php +// Incorrect +$name = isset($array['user']['name']) ? $array['user']['name'] : 'default'; + +// Correct +$name = Arr::get($array, 'user.name', 'default'); +``` + +Key `Arr` methods: `Arr::get()`, `Arr::has()`, `Arr::only()`, `Arr::except()`, `Arr::first()`, `Arr::flatten()`, `Arr::pluck()`, `Arr::where()`, `Arr::wrap()`. + +Numbers — use `Number` for display formatting: +```php +Number::format(1000000); // "1,000,000" +Number::currency(1500, 'USD'); // "$1,500.00" +Number::abbreviate(1000000); // "1M" +Number::fileSize(1024 * 1024); // "1 MB" +Number::percentage(75.5); // "75.5%" +``` + +URIs — use `Uri` for URL manipulation: +```php +$uri = Uri::of('https://example.com/search') + ->withQuery(['q' => 'laravel', 'page' => 1]); +``` + +Use `$request->string('name')` to get a fluent `Stringable` directly from request input for immediate chaining. + +Use `search-docs` for the full list of available methods — these helpers are extensive. + +## No Inline JS/CSS in Blade + +Do not put JS or CSS in Blade templates. Do not put HTML in PHP classes. + +Incorrect: +```blade +let article = `{{ json_encode($article) }}`; +``` + +Correct: +```blade + +``` + +Pass data to JS via data attributes or use a dedicated PHP-to-JS package. + +## No Unnecessary Comments + +Code should be readable on its own. Use descriptive method and variable names instead of comments. The only exception is config files, where descriptive comments are expected. + +Incorrect: +```php +// Check if there are any joins +if (count((array) $builder->getQuery()->joins) > 0) +``` + +Correct: +```php +if ($this->hasJoins()) +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/testing.md b/.agents/skills/laravel-best-practices/rules/testing.md new file mode 100644 index 00000000..287b083b --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/testing.md @@ -0,0 +1,43 @@ +# Testing Best Practices + +## Use `LazilyRefreshDatabase` Over `RefreshDatabase` + +`RefreshDatabase` migrates once per process and wraps each test in a rolled-back transaction. `LazilyRefreshDatabase` skips even that first migration if the schema is already up to date. + +## Use Model Assertions Over Raw Database Assertions + +Incorrect: `$this->assertDatabaseHas('users', ['id' => $user->id]);` + +Correct: `$this->assertModelExists($user);` + +More expressive, type-safe, and fails with clearer messages. + +## Use Factory States and Sequences + +Named states make tests self-documenting. Sequences eliminate repetitive setup. + +Incorrect: `User::factory()->create(['email_verified_at' => null]);` + +Correct: `User::factory()->unverified()->create();` + +## Use `Exceptions::fake()` to Assert Exception Reporting + +Instead of `withoutExceptionHandling()`, use `Exceptions::fake()` to assert the correct exception was reported while the request completes normally. + +## Call `Event::fake()` After Factory Setup + +Model factories rely on model events (e.g., `creating` to generate UUIDs). Calling `Event::fake()` before factory calls silences those events, producing broken models. + +Incorrect: `Event::fake(); $user = User::factory()->create();` + +Correct: `$user = User::factory()->create(); Event::fake();` + +## Use `recycle()` to Share Relationship Instances Across Factories + +Without `recycle()`, nested factories create separate instances of the same conceptual entity. + +```php +Ticket::factory() + ->recycle(Airline::factory()->create()) + ->create(); +``` \ No newline at end of file diff --git a/.agents/skills/laravel-best-practices/rules/validation.md b/.agents/skills/laravel-best-practices/rules/validation.md new file mode 100644 index 00000000..a20202ff --- /dev/null +++ b/.agents/skills/laravel-best-practices/rules/validation.md @@ -0,0 +1,75 @@ +# Validation & Forms Best Practices + +## Use Form Request Classes + +Extract validation from controllers into dedicated Form Request classes. + +Incorrect: +```php +public function store(Request $request) +{ + $request->validate([ + 'title' => 'required|max:255', + 'body' => 'required', + ]); +} +``` + +Correct: +```php +public function store(StorePostRequest $request) +{ + Post::create($request->validated()); +} +``` + +## Array vs. String Notation for Rules + +Array syntax is more readable and composes cleanly with `Rule::` objects. Prefer it in new code, but check existing Form Requests first and match whatever notation the project already uses. + +```php +// Preferred for new code +'email' => ['required', 'email', Rule::unique('users')], + +// Follow existing convention if the project uses string notation +'email' => 'required|email|unique:users', +``` + +## Always Use `validated()` + +Get only validated data. Never use `$request->all()` for mass operations. + +Incorrect: +```php +Post::create($request->all()); +``` + +Correct: +```php +Post::create($request->validated()); +``` + +## Use `Rule::when()` for Conditional Validation + +```php +'company_name' => [ + Rule::when($this->account_type === 'business', ['required', 'string', 'max:255']), +], +``` + +## Use the `after()` Method for Custom Validation + +Use `after()` instead of `withValidator()` for custom validation logic that depends on multiple fields. + +```php +public function after(): array +{ + return [ + function (Validator $validator) { + if ($this->quantity > Product::find($this->product_id)?->stock) { + $validator->errors()->add('quantity', 'Not enough stock.'); + } + }, + ]; +} +``` \ No newline at end of file diff --git a/.agents/skills/livewire-development/SKILL.md b/.agents/skills/livewire-development/SKILL.md new file mode 100644 index 00000000..62d032dd --- /dev/null +++ b/.agents/skills/livewire-development/SKILL.md @@ -0,0 +1,175 @@ +--- +name: livewire-development +description: "Use for any task or question involving Livewire. Activate if user mentions Livewire, wire: directives, or Livewire-specific concepts like wire:model, wire:click, wire:sort, or islands, invoke this skill. Covers building new components, debugging reactivity issues, real-time form validation, drag-and-drop, loading states, migrating from Livewire 3 to 4, converting component formats (SFC/MFC/class-based), and performance optimization. Do not use for non-Livewire reactive UI (React, Vue, Alpine-only, Inertia.js) or standard Laravel forms without Livewire." +license: MIT +metadata: + author: laravel +--- + +# Livewire Development + +## Documentation + +Use `search-docs` for detailed Livewire 4 patterns and documentation. + +## Basic Usage + +### Creating Components + +```bash + +# Single-file component (SFC - default in v4) + +# Creates: resources/views/components/⚡create-post.blade.php + +php artisan make:livewire create-post + +# Page component (SFC - Full Page in v4) + +# Creates: resources/views/pages/⚡create-post.blade.php + +php artisan make:livewire pages::create-post + +# Multi-file component (MFC) + +# Creates: resources/views/components/⚡create-post/create-post.php + +# resources/views/components/⚡create-post/create-post.blade.php + +php artisan make:livewire create-post --mfc + +# Class-based component (v3 style) + +# Creates: app/Livewire/CreatePost.php AND resources/views/livewire/create-post.blade.php + +php artisan make:livewire create-post --class + +# With namespace + +php artisan make:livewire Posts/CreatePost +``` + +### Converting Between Formats + +Use `php artisan livewire:convert create-post` to convert between single-file, multi-file, and class-based formats. + +### Choosing a Component Format + +> **Always follow the project's existing conventions first.** Before creating any component, inspect the project's existing Livewire components to determine the established format (SFC, MFC, or class-based) and directory structure. Check `app/Livewire/`, `resources/views/components/`, and `resources/views/livewire/` for existing components. If the project already uses a consistent format, **use that same format** — even if it differs from the Livewire v4 defaults below. Only fall back to the v4 defaults (SFC in `resources/views/components/`) when no existing convention is established. + +Also check `config/livewire.php` for `make_command.type`, `make_command.emoji`, `component_locations`, and `component_namespaces` overrides, which change the default format and where files are stored. + +### Component Format Reference + +| Format | Flag | Class Path | View Path | +|--------|------|------------|-----------| +| Single-file (SFC) | default | — | `resources/views/components/⚡create-post.blade.php` (PHP + Blade in one file) | +| Full Page SFC | `pages::name` | — | `resources/views/pages/⚡create-post.blade.php` | +| Multi-file (MFC) | `--mfc` | `resources/views/components/⚡create-post/create-post.php` | `resources/views/components/⚡create-post/create-post.blade.php` | +| Class-based | `--class` | `app/Livewire/CreatePost.php` | `resources/views/livewire/create-post.blade.php` | +| View-based | default (Blade-only) | — | `resources/views/components/⚡create-post.blade.php` (Blade-only with functional state) | + +> **Important:** The ⚡ prefix shown above is the **default** behavior in Livewire v4 — it is **configurable**. Check `config/livewire.php` for the `make_command.emoji` setting. When `true` (default), always include the ⚡ prefix in filenames you create. When `false`, omit the ⚡ prefix from all paths above. + +Namespaced components map to subdirectories: `make:livewire Posts/CreatePost` creates `resources/views/components/posts/⚡create-post.blade.php` (single-file by default). Use `make:livewire Posts/CreatePost --mfc` for multi-file output at `resources/views/components/posts/⚡create-post/create-post.php` and `resources/views/components/posts/⚡create-post/create-post.blade.php`. + +### Single-File Component Example + + +```php +count++; + } +}; +?> + +
+ +
+``` + +## Livewire 4 Specifics + +### Key Changes From Livewire 3 + +These things changed in Livewire 4, but may not have been updated in this application. Verify this application's setup to ensure you follow existing conventions. + +- Use `Route::livewire()` for full-page components (e.g., `Route::livewire('/posts/create', CreatePost::class)`); config keys renamed: `layout` → `component_layout`, `lazy_placeholder` → `component_placeholder`. +- `wire:model` now ignores child events by default (use `wire:model.deep` for old behavior); `wire:scroll` renamed to `wire:navigate:scroll`. +- Component tags must be properly closed; `wire:transition` now uses View Transitions API (modifiers removed). +- JavaScript: `$wire.$js('name', fn)` → `$wire.$js.name = fn`; `commit`/`request` hooks → `interceptMessage()`/`interceptRequest()`. + +### New Features + +- Component formats: single-file (SFC), multi-file (MFC), view-based components. +- Islands (`@island`) for isolated updates; async actions (`wire:click.async`, `#[Async]`) for parallel execution. +- Deferred/bundled loading: `defer`, `lazy.bundle` for optimized component loading. + +| Feature | Usage | Purpose | +|---------|-------|---------| +| Islands | `@island(name: 'stats')` | Isolated update regions | +| Async | `wire:click.async` or `#[Async]` | Non-blocking actions | +| Deferred | `defer` attribute | Load after page render | +| Bundled | `lazy.bundle` | Load multiple together | + +### New Directives + +- `wire:sort`, `wire:intersect`, `wire:ref`, `.renderless`, `.preserve-scroll` are available for use. +- `data-loading` attribute automatically added to elements triggering network requests. + +| Directive | Purpose | +|-----------|---------| +| `wire:sort` | Drag-and-drop sorting | +| `wire:intersect` | Viewport intersection detection | +| `wire:ref` | Element references for JS | +| `.renderless` | Component without rendering | +| `.preserve-scroll` | Preserve scroll position | + +## Best Practices + +- Always use `wire:key` in loops +- Use `wire:loading` for loading states +- Use `wire:model.live` for instant updates (default is debounced) +- Validate and authorize in actions (treat like HTTP requests) + +## Configuration + +- `smart_wire_keys` defaults to `true`; new configs: `component_locations`, `component_namespaces`, `make_command`, `csp_safe`. + +## Alpine & JavaScript + +- `wire:transition` uses browser View Transitions API; `$errors` and `$intercept` magic properties available. +- Non-blocking `wire:poll` and parallel `wire:model.live` updates improve performance. + +For interceptors and hooks, see [reference/javascript-hooks.md](reference/javascript-hooks.md). + +## Testing + + +```php +Livewire::test(Counter::class) + ->assertSet('count', 0) + ->call('increment') + ->assertSet('count', 1); +``` + +## Verification + +1. Browser console: Check for JS errors +2. Network tab: Verify Livewire requests return 200 +3. Ensure `wire:key` on all `@foreach` loops + +## Common Pitfalls + +- Missing `wire:key` in loops → unexpected re-rendering +- Expecting `wire:model` real-time → use `wire:model.live` +- Unclosed component tags → syntax errors in v4 +- Using deprecated config keys or JS hooks +- Including Alpine.js separately (already bundled in Livewire 4) \ No newline at end of file diff --git a/.agents/skills/livewire-development/reference/javascript-hooks.md b/.agents/skills/livewire-development/reference/javascript-hooks.md new file mode 100644 index 00000000..d6a44170 --- /dev/null +++ b/.agents/skills/livewire-development/reference/javascript-hooks.md @@ -0,0 +1,39 @@ +# Livewire 4 JavaScript Integration + +## Interceptor System (v4) + +### Intercept Messages + +```js +Livewire.interceptMessage(({ component, message, onFinish, onSuccess, onError }) => { + onFinish(() => { /* After response, before processing */ }); + onSuccess(({ payload }) => { /* payload.snapshot, payload.effects */ }); + onError(() => { /* Server errors */ }); +}); +``` + +### Intercept Requests + +```js +Livewire.interceptRequest(({ request, onResponse, onSuccess, onError, onFailure }) => { + onResponse(({ response }) => { /* When received */ }); + onSuccess(({ response, responseJson }) => { /* Success */ }); + onError(({ response, responseBody, preventDefault }) => { /* 4xx/5xx */ }); + onFailure(({ error }) => { /* Network failures */ }); +}); +``` + +### Component-Scoped Interceptors + +```blade + +``` + +## Magic Properties + +- `$errors` - Access validation errors from JavaScript +- `$intercept` - Component-scoped interceptors \ No newline at end of file diff --git a/.agents/skills/pest-testing/SKILL.md b/.agents/skills/pest-testing/SKILL.md new file mode 100644 index 00000000..323d4723 --- /dev/null +++ b/.agents/skills/pest-testing/SKILL.md @@ -0,0 +1,159 @@ +--- +name: pest-testing +description: "Use this skill for Pest PHP testing in Laravel projects only. Trigger whenever any test is being written, edited, fixed, or refactored — including fixing tests that broke after a code change, adding assertions, converting PHPUnit to Pest, adding datasets, and TDD workflows. Always activate when the user asks how to write something in Pest, mentions test files or directories (tests/Feature, tests/Unit, tests/Browser), or needs browser testing, smoke testing multiple pages for JS errors, or architecture tests. Covers: test()/it()/expect() syntax, datasets, mocking, browser testing (visit/click/fill), smoke testing, arch(), Livewire component tests, RefreshDatabase, and all Pest 4 features. Do not use for factories, seeders, migrations, controllers, models, or non-test PHP code." +license: MIT +metadata: + author: laravel +--- + +# Pest Testing 4 + +## Documentation + +Use `search-docs` for detailed Pest 4 patterns and documentation. + +## Basic Usage + +### Creating Tests + +All tests must be written using Pest. Use `php artisan make:test --pest {name}`. + +### Test Organization + +- Unit/Feature tests: `tests/Feature` and `tests/Unit` directories. +- Browser tests: `tests/Browser/` directory. +- Do NOT remove tests without approval - these are core application code. + +### Basic Test Structure + +Pest supports both `test()` and `it()` functions. Before writing new tests, check existing test files in the same directory to match the project's convention. Use `test()` if existing tests use `test()`, or `it()` if they use `it()`. + + +```php +it('is true', function () { + expect(true)->toBeTrue(); +}); +``` + +### Running Tests + +- Run minimal tests with filter before finalizing: `php artisan test --compact --filter=testName`. +- Run all tests: `php artisan test --compact`. +- Run file: `php artisan test --compact tests/Feature/ExampleTest.php`. + +## Assertions + +Use specific assertions (`assertSuccessful()`, `assertNotFound()`) instead of `assertStatus()`: + + +```php +it('returns all', function () { + $this->postJson('/api/docs', [])->assertSuccessful(); +}); +``` + +| Use | Instead of | +|-----|------------| +| `assertSuccessful()` | `assertStatus(200)` | +| `assertNotFound()` | `assertStatus(404)` | +| `assertForbidden()` | `assertStatus(403)` | + +## Mocking + +Import mock function before use: `use function Pest\Laravel\mock;` + +## Datasets + +Use datasets for repetitive tests (validation rules, etc.): + + +```php +it('has emails', function (string $email) { + expect($email)->not->toBeEmpty(); +})->with([ + 'james' => 'james@laravel.com', + 'taylor' => 'taylor@laravel.com', +]); +``` + +## Pest 4 Features + +| Feature | Purpose | +|---------|---------| +| Browser Testing | Full integration tests in real browsers | +| Smoke Testing | Validate multiple pages quickly | +| Visual Regression | Compare screenshots for visual changes | +| Test Sharding | Parallel CI runs | +| Architecture Testing | Enforce code conventions | + +### Browser Test Example + +Browser tests run in real browsers for full integration testing: + +- Browser tests live in `tests/Browser/`. +- Use Laravel features like `Event::fake()`, `assertAuthenticated()`, and model factories. +- Use `RefreshDatabase` for clean state per test. +- Interact with page: click, type, scroll, select, submit, drag-and-drop, touch gestures. +- Test on multiple browsers (Chrome, Firefox, Safari) if requested. +- Test on different devices/viewports (iPhone 14 Pro, tablets) if requested. +- Switch color schemes (light/dark mode) when appropriate. +- Take screenshots or pause tests for debugging. + + +```php +it('may reset the password', function () { + Notification::fake(); + + $this->actingAs(User::factory()->create()); + + $page = visit('/sign-in'); + + $page->assertSee('Sign In') + ->assertNoJavaScriptErrors() + ->click('Forgot Password?') + ->fill('email', 'nuno@laravel.com') + ->click('Send Reset Link') + ->assertSee('We have emailed your password reset link!'); + + Notification::assertSent(ResetPassword::class); +}); +``` + +### Smoke Testing + +Quickly validate multiple pages have no JavaScript errors: + + +```php +$pages = visit(['/', '/about', '/contact']); + +$pages->assertNoJavaScriptErrors()->assertNoConsoleLogs(); +``` + +### Visual Regression Testing + +Capture and compare screenshots to detect visual changes. + +### Test Sharding + +Split tests across parallel processes for faster CI runs. + +### Architecture Testing + +Pest 4 includes architecture testing (from Pest 3): + + +```php +arch('controllers') + ->expect('App\Http\Controllers') + ->toExtendNothing() + ->toHaveSuffix('Controller'); +``` + +## Common Pitfalls + +- Not importing `use function Pest\Laravel\mock;` before using mock +- Using `assertStatus(200)` instead of `assertSuccessful()` +- Forgetting datasets for repetitive validation tests +- Deleting tests without approval +- Forgetting `assertNoJavaScriptErrors()` in browser tests \ No newline at end of file diff --git a/.agents/skills/tailwindcss-development/SKILL.md b/.agents/skills/tailwindcss-development/SKILL.md new file mode 100644 index 00000000..7c8e295e --- /dev/null +++ b/.agents/skills/tailwindcss-development/SKILL.md @@ -0,0 +1,119 @@ +--- +name: tailwindcss-development +description: "Always invoke when the user's message includes 'tailwind' in any form. Also invoke for: building responsive grid layouts (multi-column card grids, product grids), flex/grid page structures (dashboards with sidebars, fixed topbars, mobile-toggle navs), styling UI components (cards, tables, navbars, pricing sections, forms, inputs, badges), adding dark mode variants, fixing spacing or typography, and Tailwind v3/v4 work. The core use case: writing or fixing Tailwind utility classes in HTML templates (Blade, JSX, Vue). Skip for backend PHP logic, database queries, API routes, JavaScript with no HTML/CSS component, CSS file audits, build tool configuration, and vanilla CSS." +license: MIT +metadata: + author: laravel +--- + +# Tailwind CSS Development + +## Documentation + +Use `search-docs` for detailed Tailwind CSS v4 patterns and documentation. + +## Basic Usage + +- Use Tailwind CSS classes to style HTML. Check and follow existing Tailwind conventions in the project before introducing new patterns. +- Offer to extract repeated patterns into components that match the project's conventions (e.g., Blade, JSX, Vue). +- Consider class placement, order, priority, and defaults. Remove redundant classes, add classes to parent or child elements carefully to reduce repetition, and group elements logically. + +## Tailwind CSS v4 Specifics + +- Always use Tailwind CSS v4 and avoid deprecated utilities. +- `corePlugins` is not supported in Tailwind v4. + +### CSS-First Configuration + +In Tailwind v4, configuration is CSS-first using the `@theme` directive — no separate `tailwind.config.js` file is needed: + + +```css +@theme { + --color-brand: oklch(0.72 0.11 178); +} +``` + +### Import Syntax + +In Tailwind v4, import Tailwind with a regular CSS `@import` statement instead of the `@tailwind` directives used in v3: + + +```diff +- @tailwind base; +- @tailwind components; +- @tailwind utilities; ++ @import "tailwindcss"; +``` + +### Replaced Utilities + +Tailwind v4 removed deprecated utilities. Use the replacements shown below. Opacity values remain numeric. + +| Deprecated | Replacement | +|------------|-------------| +| bg-opacity-* | bg-black/* | +| text-opacity-* | text-black/* | +| border-opacity-* | border-black/* | +| divide-opacity-* | divide-black/* | +| ring-opacity-* | ring-black/* | +| placeholder-opacity-* | placeholder-black/* | +| flex-shrink-* | shrink-* | +| flex-grow-* | grow-* | +| overflow-ellipsis | text-ellipsis | +| decoration-slice | box-decoration-slice | +| decoration-clone | box-decoration-clone | + +## Spacing + +Use `gap` utilities instead of margins for spacing between siblings: + + +```html +
+
Item 1
+
Item 2
+
+``` + +## Dark Mode + +If existing pages and components support dark mode, new pages and components must support it the same way, typically using the `dark:` variant: + + +```html +
+ Content adapts to color scheme +
+``` + +## Common Patterns + +### Flexbox Layout + + +```html +
+
Left content
+
Right content
+
+``` + +### Grid Layout + + +```html +
+
Card 1
+
Card 2
+
Card 3
+
+``` + +## Common Pitfalls + +- Using deprecated v3 utilities (bg-opacity-*, flex-shrink-*, etc.) +- Using `@tailwind` directives instead of `@import "tailwindcss"` +- Trying to use `tailwind.config.js` instead of CSS `@theme` directive +- Using margins for spacing between siblings instead of gap utilities +- Forgetting to add dark mode variants when the project uses dark mode \ No newline at end of file diff --git a/.codex/config.toml b/.codex/config.toml new file mode 100644 index 00000000..2a2fdc87 --- /dev/null +++ b/.codex/config.toml @@ -0,0 +1,4 @@ +[mcp_servers.laravel-boost] +command = "php" +args = ["artisan", "boost:mcp"] +cwd = "/Users/fabianwesner/Herd/shop" diff --git a/.playwright-mcp/console-2026-04-18T07-42-21-973Z.log b/.playwright-mcp/console-2026-04-18T07-42-21-973Z.log new file mode 100644 index 00000000..107e16b8 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T07-42-21-973Z.log @@ -0,0 +1,2 @@ +[ 304ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/:49 +[ 469ms] [ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://shop.test/favicon.ico:0 diff --git a/.playwright-mcp/console-2026-04-18T07-42-29-697Z.log b/.playwright-mcp/console-2026-04-18T07-42-29-697Z.log new file mode 100644 index 00000000..44e42766 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T07-42-29-697Z.log @@ -0,0 +1 @@ +[ 76ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/collections:49 diff --git a/.playwright-mcp/console-2026-04-18T07-42-33-348Z.log b/.playwright-mcp/console-2026-04-18T07-42-33-348Z.log new file mode 100644 index 00000000..6a4230e2 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T07-42-33-348Z.log @@ -0,0 +1 @@ +[ 115ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/collections/featured:49 diff --git a/.playwright-mcp/console-2026-04-18T07-42-37-846Z.log b/.playwright-mcp/console-2026-04-18T07-42-37-846Z.log new file mode 100644 index 00000000..78dff563 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T07-42-37-846Z.log @@ -0,0 +1,6 @@ +[ 233ms] [ERROR] Failed to load resource: the server responded with a status of 500 (Internal Server Error) @ http://shop.test/products/organic-cotton-t-shirt:0 +[ 237ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/organic-cotton-t-shirt:21 +[ 19454ms] [ERROR] Failed to load resource: the server responded with a status of 500 (Internal Server Error) @ http://shop.test/products/organic-cotton-t-shirt:0 +[ 19461ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/organic-cotton-t-shirt:21 +[ 27391ms] [ERROR] Failed to load resource: the server responded with a status of 403 (Forbidden) @ http://shop.test/storage/products/tshirt-front.jpg:0 +[ 27465ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/organic-cotton-t-shirt:49 diff --git a/.playwright-mcp/console-2026-04-18T07-43-07-589Z.log b/.playwright-mcp/console-2026-04-18T07-43-07-589Z.log new file mode 100644 index 00000000..d3b8d65f --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T07-43-07-589Z.log @@ -0,0 +1,2 @@ +[ 91ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/organic-cotton-t-shirt:49 +[ 100ms] [ERROR] Failed to load resource: the server responded with a status of 403 (Forbidden) @ http://shop.test/storage/products/tshirt-front.jpg:0 diff --git a/.playwright-mcp/console-2026-04-18T07-43-15-408Z.log b/.playwright-mcp/console-2026-04-18T07-43-15-408Z.log new file mode 100644 index 00000000..d445da32 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T07-43-15-408Z.log @@ -0,0 +1 @@ +[ 75ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/pages/about:49 diff --git a/.playwright-mcp/console-2026-04-18T07-43-17-415Z.log b/.playwright-mcp/console-2026-04-18T07-43-17-415Z.log new file mode 100644 index 00000000..452802f7 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T07-43-17-415Z.log @@ -0,0 +1 @@ +[ 82ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/search?q=cotton:49 diff --git a/.playwright-mcp/console-2026-04-18T07-43-21-810Z.log b/.playwright-mcp/console-2026-04-18T07-43-21-810Z.log new file mode 100644 index 00000000..8806e7a7 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T07-43-21-810Z.log @@ -0,0 +1 @@ +[ 87ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/cart:49 diff --git a/.playwright-mcp/console-2026-04-18T07-43-24-813Z.log b/.playwright-mcp/console-2026-04-18T07-43-24-813Z.log new file mode 100644 index 00000000..c4f5c291 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T07-43-24-813Z.log @@ -0,0 +1,2 @@ +[ 106ms] [ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://shop.test/products/does-not-exist:0 +[ 115ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/does-not-exist:43 diff --git a/.playwright-mcp/console-2026-04-18T08-04-27-959Z.log b/.playwright-mcp/console-2026-04-18T08-04-27-959Z.log new file mode 100644 index 00000000..3686f109 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-04-27-959Z.log @@ -0,0 +1,2 @@ +[ 237ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/cart:49 +[ 309ms] [ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://shop.test/favicon.ico:0 diff --git a/.playwright-mcp/console-2026-04-18T08-04-43-558Z.log b/.playwright-mcp/console-2026-04-18T08-04-43-558Z.log new file mode 100644 index 00000000..a6889113 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-04-43-558Z.log @@ -0,0 +1 @@ +[ 91ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/collections:49 diff --git a/.playwright-mcp/console-2026-04-18T08-04-48-155Z.log b/.playwright-mcp/console-2026-04-18T08-04-48-155Z.log new file mode 100644 index 00000000..d33854c2 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-04-48-155Z.log @@ -0,0 +1 @@ +[ 87ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/collections/featured:49 diff --git a/.playwright-mcp/console-2026-04-18T08-04-54-091Z.log b/.playwright-mcp/console-2026-04-18T08-04-54-091Z.log new file mode 100644 index 00000000..da422c1a --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-04-54-091Z.log @@ -0,0 +1,4 @@ +[ 87ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/organic-cotton-t-shirt:49 +[ 99ms] [ERROR] Failed to load resource: the server responded with a status of 403 (Forbidden) @ http://shop.test/storage/products/tshirt-front.jpg:0 +[ 15992ms] [ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://shop.test/livewire-6701cc17/update:0 +[ 16008ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/organic-cotton-t-shirt:6 diff --git a/.playwright-mcp/console-2026-04-18T08-06-02-803Z.log b/.playwright-mcp/console-2026-04-18T08-06-02-803Z.log new file mode 100644 index 00000000..bb2753ae --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-06-02-803Z.log @@ -0,0 +1,4 @@ +[ 138ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/organic-cotton-t-shirt:49 +[ 174ms] [ERROR] Failed to load resource: the server responded with a status of 403 (Forbidden) @ http://shop.test/storage/products/tshirt-front.jpg:0 +[ 4756ms] [ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://shop.test/livewire-6701cc17/update:0 +[ 4767ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/organic-cotton-t-shirt:6 diff --git a/.playwright-mcp/console-2026-04-18T08-06-32-813Z.log b/.playwright-mcp/console-2026-04-18T08-06-32-813Z.log new file mode 100644 index 00000000..3a9094d3 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-06-32-813Z.log @@ -0,0 +1,4 @@ +[ 93ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/organic-cotton-t-shirt?_=1:49 +[ 103ms] [ERROR] Failed to load resource: the server responded with a status of 403 (Forbidden) @ http://shop.test/storage/products/tshirt-front.jpg:0 +[ 7228ms] [ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://shop.test/livewire-6701cc17/update:0 +[ 7243ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/organic-cotton-t-shirt?_=1:6 diff --git a/.playwright-mcp/console-2026-04-18T08-07-33-682Z.log b/.playwright-mcp/console-2026-04-18T08-07-33-682Z.log new file mode 100644 index 00000000..97c691f2 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-07-33-682Z.log @@ -0,0 +1,3 @@ +[ 140ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/organic-cotton-t-shirt:49 +[ 152ms] [ERROR] Failed to load resource: the server responded with a status of 403 (Forbidden) @ http://shop.test/storage/products/tshirt-front.jpg:0 +[ 7388ms] [ERROR] Failed to load resource: the server responded with a status of 403 (Forbidden) @ http://shop.test/storage/products/tshirt-front.jpg:0 diff --git a/.playwright-mcp/console-2026-04-18T08-07-51-938Z.log b/.playwright-mcp/console-2026-04-18T08-07-51-938Z.log new file mode 100644 index 00000000..1288fed6 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-07-51-938Z.log @@ -0,0 +1 @@ +[ 121ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/cart:49 diff --git a/.playwright-mcp/console-2026-04-18T08-07-58-376Z.log b/.playwright-mcp/console-2026-04-18T08-07-58-376Z.log new file mode 100644 index 00000000..437a4484 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-07-58-376Z.log @@ -0,0 +1 @@ +[ 111ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/checkout:49 diff --git a/.playwright-mcp/console-2026-04-18T08-18-52-998Z.log b/.playwright-mcp/console-2026-04-18T08-18-52-998Z.log new file mode 100644 index 00000000..e2dac582 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-18-52-998Z.log @@ -0,0 +1,3 @@ +[ 168ms] [ERROR] Failed to load resource: the server responded with a status of 403 (Forbidden) @ http://shop.test/storage/products/tshirt-front.jpg:0 +[ 282ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/organic-cotton-t-shirt:49 +[ 378ms] [ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://shop.test/favicon.ico:0 diff --git a/.playwright-mcp/console-2026-04-18T08-26-52-212Z.log b/.playwright-mcp/console-2026-04-18T08-26-52-212Z.log new file mode 100644 index 00000000..16be4546 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-26-52-212Z.log @@ -0,0 +1,6 @@ +[ 110ms] [ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://shop.test/account/login:0 +[ 239ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/account/login:43 +[ 282ms] [ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://shop.test/favicon.ico:0 +[ 3623ms] [ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://shop.test/account/login:0 +[ 3627ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/account/login:43 +[ 14000ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/account/login:49 diff --git a/.playwright-mcp/console-2026-04-18T08-27-08-697Z.log b/.playwright-mcp/console-2026-04-18T08-27-08-697Z.log new file mode 100644 index 00000000..d14e2eae --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-27-08-697Z.log @@ -0,0 +1,4 @@ +[ 73ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/account/login:49 +[ 14324ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/account/login:49 +[ 31486ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/account:49 +[ 39743ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/account:49 diff --git a/.playwright-mcp/console-2026-04-18T08-27-49-983Z.log b/.playwright-mcp/console-2026-04-18T08-27-49-983Z.log new file mode 100644 index 00000000..a41c459c --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-27-49-983Z.log @@ -0,0 +1 @@ +[ 81ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/account/orders:49 diff --git a/.playwright-mcp/console-2026-04-18T08-27-52-992Z.log b/.playwright-mcp/console-2026-04-18T08-27-52-992Z.log new file mode 100644 index 00000000..578c0c3d --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-27-52-992Z.log @@ -0,0 +1 @@ +[ 91ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/account/addresses:49 diff --git a/.playwright-mcp/console-2026-04-18T08-39-15-591Z.log b/.playwright-mcp/console-2026-04-18T08-39-15-591Z.log new file mode 100644 index 00000000..cb2ea445 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-39-15-591Z.log @@ -0,0 +1,5 @@ +[ 230ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/:49 +[ 293ms] [ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://shop.test/favicon.ico:0 +[ 8201ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/organic-cotton-t-shirt:49 +[ 8214ms] [ERROR] Failed to load resource: the server responded with a status of 403 (Forbidden) @ http://shop.test/storage/products/tshirt-front.jpg:0 +[ 14052ms] [ERROR] Failed to load resource: the server responded with a status of 403 (Forbidden) @ http://shop.test/storage/products/tshirt-front.jpg:0 diff --git a/.playwright-mcp/console-2026-04-18T08-41-52-531Z.log b/.playwright-mcp/console-2026-04-18T08-41-52-531Z.log new file mode 100644 index 00000000..33f7401d --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-41-52-531Z.log @@ -0,0 +1,3 @@ +[ 94ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/products/organic-cotton-t-shirt:49 +[ 112ms] [ERROR] Failed to load resource: the server responded with a status of 403 (Forbidden) @ http://shop.test/storage/products/tshirt-front.jpg:0 +[ 5209ms] [ERROR] Failed to load resource: the server responded with a status of 403 (Forbidden) @ http://shop.test/storage/products/tshirt-front.jpg:0 diff --git a/.playwright-mcp/console-2026-04-18T08-42-02-646Z.log b/.playwright-mcp/console-2026-04-18T08-42-02-646Z.log new file mode 100644 index 00000000..c3cc0575 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-42-02-646Z.log @@ -0,0 +1,3 @@ +[ 98ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/checkout:49 +[ 86800ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/checkout/confirmation/1001:49 +[ 101025ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/checkout/confirmation/1001:49 diff --git a/.playwright-mcp/console-2026-04-18T08-43-55-862Z.log b/.playwright-mcp/console-2026-04-18T08-43-55-862Z.log new file mode 100644 index 00000000..1e17718c --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-43-55-862Z.log @@ -0,0 +1 @@ +[ 87ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/checkout/confirmation/1001:49 diff --git a/.playwright-mcp/console-2026-04-18T08-44-17-066Z.log b/.playwright-mcp/console-2026-04-18T08-44-17-066Z.log new file mode 100644 index 00000000..09506d99 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-44-17-066Z.log @@ -0,0 +1,2 @@ +[ 91ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/checkout/confirmation/1001:49 +[ 280ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/checkout/confirmation/1001:49 diff --git a/.playwright-mcp/console-2026-04-18T08-44-45-330Z.log b/.playwright-mcp/console-2026-04-18T08-44-45-330Z.log new file mode 100644 index 00000000..542a1b0a --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-44-45-330Z.log @@ -0,0 +1 @@ +[ 136ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/checkout/confirmation/1001:49 diff --git a/.playwright-mcp/console-2026-04-18T08-44-53-484Z.log b/.playwright-mcp/console-2026-04-18T08-44-53-484Z.log new file mode 100644 index 00000000..6b44a145 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-44-53-484Z.log @@ -0,0 +1,2 @@ +[ 82ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/account/login:49 +[ 26367ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/account:49 diff --git a/.playwright-mcp/console-2026-04-18T08-45-34-419Z.log b/.playwright-mcp/console-2026-04-18T08-45-34-419Z.log new file mode 100644 index 00000000..932c191b --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-45-34-419Z.log @@ -0,0 +1 @@ +[ 83ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/account/orders:49 diff --git a/.playwright-mcp/console-2026-04-18T08-45-49-887Z.log b/.playwright-mcp/console-2026-04-18T08-45-49-887Z.log new file mode 100644 index 00000000..5d505e67 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-45-49-887Z.log @@ -0,0 +1,2 @@ +[ 79ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/admin/login:46 +[ 20950ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/admin:46 diff --git a/.playwright-mcp/console-2026-04-18T08-46-24-044Z.log b/.playwright-mcp/console-2026-04-18T08-46-24-044Z.log new file mode 100644 index 00000000..a0bcda23 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-46-24-044Z.log @@ -0,0 +1 @@ +[ 102ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/admin/orders/1:46 diff --git a/.playwright-mcp/console-2026-04-18T08-46-55-981Z.log b/.playwright-mcp/console-2026-04-18T08-46-55-981Z.log new file mode 100644 index 00000000..f191f5df --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-46-55-981Z.log @@ -0,0 +1 @@ +[ 82ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/admin/products:46 diff --git a/.playwright-mcp/console-2026-04-18T08-47-07-970Z.log b/.playwright-mcp/console-2026-04-18T08-47-07-970Z.log new file mode 100644 index 00000000..d7239594 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-47-07-970Z.log @@ -0,0 +1 @@ +[ 88ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/admin/settings/shipping:46 diff --git a/.playwright-mcp/console-2026-04-18T08-47-18-512Z.log b/.playwright-mcp/console-2026-04-18T08-47-18-512Z.log new file mode 100644 index 00000000..6dbb4c54 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-47-18-512Z.log @@ -0,0 +1 @@ +[ 71ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/admin/discounts:46 diff --git a/.playwright-mcp/console-2026-04-18T08-47-22-997Z.log b/.playwright-mcp/console-2026-04-18T08-47-22-997Z.log new file mode 100644 index 00000000..e4aaf3d4 --- /dev/null +++ b/.playwright-mcp/console-2026-04-18T08-47-22-997Z.log @@ -0,0 +1 @@ +[ 70ms] [LOG] 🔍 Browser logger active (MCP server detected). Posting to: http://shop.test/_boost/browser-logs @ http://shop.test/admin/analytics:46 diff --git a/.playwright-mcp/page-2026-04-18T07-42-22-458Z.yml b/.playwright-mcp/page-2026-04-18T07-42-22-458Z.yml new file mode 100644 index 00000000..42a7487c --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T07-42-22-458Z.yml @@ -0,0 +1,42 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - generic [ref=e14]: + - generic [ref=e15]: Elevated essentials + - paragraph [ref=e16]: Timeless pieces for modern wardrobes. + - link "Shop the collection" [ref=e18] [cursor=pointer]: + - /url: /collections + - generic [ref=e19]: + - generic [ref=e20]: Featured collections + - link "Featured" [ref=e22] [cursor=pointer]: + - /url: http://shop.test/collections/featured + - generic [ref=e23]: Featured + - generic [ref=e24]: + - generic [ref=e25]: Featured products + - generic [ref=e26]: + - link "Organic Cotton T-Shirt" [ref=e28] [cursor=pointer]: + - /url: http://shop.test/products/organic-cotton-t-shirt + - img [ref=e31] + - generic [ref=e34]: Organic Cotton T-Shirt + - link "Classic Pullover Hoodie" [ref=e36] [cursor=pointer]: + - /url: http://shop.test/products/classic-pullover-hoodie + - img [ref=e39] + - generic [ref=e42]: Classic Pullover Hoodie + - contentinfo [ref=e43]: + - generic [ref=e44]: © 2026 Acme Fashion. All rights reserved. \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T07-42-29-798Z.yml b/.playwright-mcp/page-2026-04-18T07-42-29-798Z.yml new file mode 100644 index 00000000..7b401b88 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T07-42-29-798Z.yml @@ -0,0 +1,33 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Collections + - generic [ref=e22]: Collections + - link "Featured" [ref=e24] [cursor=pointer]: + - /url: http://shop.test/collections/featured + - generic [ref=e25]: Featured + - contentinfo [ref=e26]: + - generic [ref=e27]: © 2026 Acme Fashion. All rights reserved. \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T07-42-33-517Z.yml b/.playwright-mcp/page-2026-04-18T07-42-33-517Z.yml new file mode 100644 index 00000000..fa468a0f --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T07-42-33-517Z.yml @@ -0,0 +1,51 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - link "Collections" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/collections + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Featured + - generic [ref=e26]: Featured + - paragraph [ref=e28]: Our picks for the season. + - generic [ref=e29]: + - textbox "Search products..." [ref=e31] + - combobox [ref=e33]: + - 'option "Sort: default" [selected]' + - option "Title A-Z" + - option "Title Z-A" + - option "Newest" + - generic [ref=e34]: + - link "Organic Cotton T-Shirt" [ref=e36] [cursor=pointer]: + - /url: http://shop.test/products/organic-cotton-t-shirt + - img [ref=e39] + - generic [ref=e42]: Organic Cotton T-Shirt + - link "Classic Pullover Hoodie" [ref=e44] [cursor=pointer]: + - /url: http://shop.test/products/classic-pullover-hoodie + - img [ref=e47] + - generic [ref=e50]: Classic Pullover Hoodie + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T07-42-38-652Z.yml b/.playwright-mcp/page-2026-04-18T07-42-38-652Z.yml new file mode 100644 index 00000000..c678a6f1 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T07-42-38-652Z.yml @@ -0,0 +1,212 @@ +- generic [ref=e2]: + - generic [ref=e4]: + - generic [ref=e5]: + - img [ref=e7] + - generic [ref=e10]: Internal Server Error + - button "Copy as Markdown" [ref=e11] [cursor=pointer]: + - img [ref=e12] + - generic [ref=e15]: Copy as Markdown + - generic [ref=e18]: + - generic [ref=e19]: + - heading "ErrorException" [level=1] [ref=e20] + - generic [ref=e22]: resources/views/livewire/storefront/products/show.blade.php:17 + - paragraph [ref=e23]: "Undefined property: stdClass::$url" + - generic [ref=e24]: + - generic [ref=e25]: + - generic [ref=e26]: + - generic [ref=e27]: LARAVEL + - generic [ref=e28]: 12.51.0 + - generic [ref=e29]: + - generic [ref=e30]: PHP + - generic [ref=e31]: 8.4.17 + - generic [ref=e32]: + - img [ref=e33] + - text: UNHANDLED + - generic [ref=e36]: CODE 0 + - generic [ref=e38]: + - generic [ref=e39]: + - img [ref=e40] + - text: "500" + - generic [ref=e43]: + - img [ref=e44] + - text: GET + - generic [ref=e47]: http://shop.test/products/organic-cotton-t-shirt + - button [ref=e48] [cursor=pointer]: + - img [ref=e49] + - generic [ref=e53]: + - generic [ref=e54]: + - generic [ref=e55]: + - img [ref=e57] + - heading "Exception trace" [level=3] [ref=e60] + - generic [ref=e61]: + - generic [ref=e62]: + - generic [ref=e63] [cursor=pointer]: + - generic [ref=e66]: + - code [ref=e70]: + - generic [ref=e71]: resources/views/livewire/storefront/products/show.blade.php + - generic [ref=e73]: resources/views/livewire/storefront/products/show.blade.php:17 + - button [ref=e75]: + - img [ref=e76] + - code [ref=e84]: + - generic [ref=e85]: "12" + - generic [ref=e86]: 13
+ - generic [ref=e87]: 14
+ - generic [ref=e88]: 15 @if (! empty($media)) + - generic [ref=e89]: 16
+ - generic [ref=e90]: "17 url }}\" alt=\"{{ $media[0]->alt_text ?? $product->title }}\" class=\"h-full w-full object-cover\" />" + - generic [ref=e91]: 18
+ - generic [ref=e92]: 19 @if (count($media) > 1) + - generic [ref=e93]: 20
+ - generic [ref=e94]: 21 @foreach (array_slice($media, 1, 7) as $item) + - generic [ref=e95]: "22
id }}\" class=\"aspect-square overflow-hidden rounded-md bg-zinc-100 dark:bg-zinc-800\">" + - generic [ref=e96]: "23 url }}\" alt=\"{{ $item->alt_text ?? '' }}\" class=\"h-full w-full object-cover\" loading=\"lazy\" />" + - generic [ref=e97]: 24
+ - generic [ref=e98]: 25 @endforeach + - generic [ref=e99]: 26
+ - generic [ref=e100]: 27 @endif + - generic [ref=e101]: 28 @else + - generic [ref=e102]: "29" + - generic [ref=e104] [cursor=pointer]: + - img [ref=e105] + - generic [ref=e109]: 20 vendor frames + - button [ref=e110]: + - img [ref=e111] + - generic [ref=e116] [cursor=pointer]: + - generic [ref=e119]: + - code [ref=e123]: + - generic [ref=e124]: app/Http/Middleware/ResolveStore.php + - generic [ref=e126]: app/Http/Middleware/ResolveStore.php:36 + - button [ref=e128]: + - img [ref=e129] + - generic [ref=e134] [cursor=pointer]: + - img [ref=e135] + - generic [ref=e139]: 49 vendor frames + - button [ref=e140]: + - img [ref=e141] + - generic [ref=e146] [cursor=pointer]: + - generic [ref=e149]: + - code [ref=e153]: + - generic [ref=e154]: public/index.php + - generic [ref=e156]: public/index.php:20 + - button [ref=e158]: + - img [ref=e159] + - generic [ref=e164] [cursor=pointer]: + - img [ref=e165] + - generic [ref=e169]: 1 vendor frame + - button [ref=e170]: + - img [ref=e171] + - generic [ref=e175]: + - generic [ref=e176]: + - generic [ref=e177]: + - img [ref=e179] + - heading "Queries" [level=3] [ref=e181] + - generic [ref=e183]: 1-7 of 7 + - generic [ref=e184]: + - generic [ref=e185]: + - generic [ref=e186]: + - generic [ref=e187]: + - img [ref=e188] + - generic [ref=e190]: sqlite + - code [ref=e194]: + - generic [ref=e195]: select * from "stores" where "stores"."id" = 1 limit 1 + - generic [ref=e196]: 1.77ms + - generic [ref=e197]: + - generic [ref=e198]: + - generic [ref=e199]: + - img [ref=e200] + - generic [ref=e202]: sqlite + - code [ref=e206]: + - generic [ref=e207]: select exists (select 1 from "main".sqlite_master where name = 'products' and type = 'table') as "exists" + - generic [ref=e208]: 0.04ms + - generic [ref=e209]: + - generic [ref=e210]: + - generic [ref=e211]: + - img [ref=e212] + - generic [ref=e214]: sqlite + - code [ref=e218]: + - generic [ref=e219]: select "id", "title", "handle", "description_html", "tags" from "products" where "store_id" = 1 and "handle" = 'organic-cotton-t-shirt' and "status" = 'active' limit 1 + - generic [ref=e220]: 0.04ms + - generic [ref=e221]: + - generic [ref=e222]: + - generic [ref=e223]: + - img [ref=e224] + - generic [ref=e226]: sqlite + - code [ref=e230]: + - generic [ref=e231]: select exists (select 1 from "main".sqlite_master where name = 'product_variants' and type = 'table') as "exists" + - generic [ref=e232]: 0.02ms + - generic [ref=e233]: + - generic [ref=e234]: + - generic [ref=e235]: + - img [ref=e236] + - generic [ref=e238]: sqlite + - code [ref=e242]: + - generic [ref=e243]: select "id", "sku", "price_amount", "compare_at_amount", "currency", "is_default", "status" from "product_variants" where "product_id" = 1 order by "position" asc + - generic [ref=e244]: 0.1ms + - generic [ref=e245]: + - generic [ref=e246]: + - generic [ref=e247]: + - img [ref=e248] + - generic [ref=e250]: sqlite + - code [ref=e254]: + - generic [ref=e255]: select exists (select 1 from "main".sqlite_master where name = 'product_media' and type = 'table') as "exists" + - generic [ref=e256]: 0.02ms + - generic [ref=e257]: + - generic [ref=e258]: + - generic [ref=e259]: + - img [ref=e260] + - generic [ref=e262]: sqlite + - code [ref=e266]: + - generic [ref=e267]: select "id", "url", "alt_text" from "product_media" where "product_id" = 1 order by "position" asc + - generic [ref=e268]: 0.03ms + - generic [ref=e270]: + - generic [ref=e271]: + - heading "Headers" [level=2] [ref=e272] + - generic [ref=e273]: + - generic [ref=e274]: + - generic [ref=e275]: cookie + - generic [ref=e277]: XSRF-TOKEN=eyJpdiI6IlJINnRyMXFuWFpGby80QjVuclVHRmc9PSIsInZhbHVlIjoiOTJyZGVNY0s5TnVWZDlOWThzNDBTTXFUMXhRd0lyZlNZYytoTTFjQ1lubXI3RHhtZkpwangzRDBTY1JyNlRCd0xORnRiYUlrNnRRV0lNZmgwTU1pakRqOVJ6UHN4UWpJdnBvNzE0SUxGWUxIUThpOUZiWnZPL1FSNUtXakhub1ciLCJtYWMiOiJiOWRmMWMyN2Q2YmFlNzI1MWM4MGYyNzU4YjM3ZTE1NTdjZDdmMmFjMzgxY2UxMDIyN2E5NTJkZTUzZGZiN2MxIiwidGFnIjoiIn0%3D; shop_session=eyJpdiI6Imk5MDRCRnp6Q1FSckhVU1FQZmhpeXc9PSIsInZhbHVlIjoiNnIyMUdHdHozQk5GcHUvNkFMN0FMS2FPMDdTcnA0cnptV1VjTm0ySFdndDlySSt1R2pDbzJZN09VdXhGUHZsQi83R09Udnpiby95NmFrclEyUVd6Vk5ETlo0ai9TOHd4UjhyWlc1RlVLNXArcW9udmljMDU4TTloTUtwbjZQNzkiLCJtYWMiOiI4YmU4OWI0OGI5N2ZhOGVkNDgyMmIzYjE2YWY0ZTc3Zjg1ZjFlYzM4YWYzZTE5NmNlNTUzYmI1MGZjNzMyYWY5IiwidGFnIjoiIn0%3D + - generic [ref=e278]: + - generic [ref=e279]: accept-language + - generic [ref=e281]: en-GB,en-US;q=0.9,en;q=0.8 + - generic [ref=e282]: + - generic [ref=e283]: accept-encoding + - generic [ref=e285]: gzip, deflate + - generic [ref=e286]: + - generic [ref=e287]: accept + - generic [ref=e289]: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 + - generic [ref=e290]: + - generic [ref=e291]: user-agent + - generic [ref=e293]: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36 + - generic [ref=e294]: + - generic [ref=e295]: upgrade-insecure-requests + - generic [ref=e297]: "1" + - generic [ref=e298]: + - generic [ref=e299]: connection + - generic [ref=e301]: keep-alive + - generic [ref=e302]: + - generic [ref=e303]: host + - generic [ref=e305]: shop.test + - generic [ref=e306]: + - heading "Body" [level=2] [ref=e307] + - generic [ref=e308]: // No request body + - generic [ref=e309]: + - heading "Routing" [level=2] [ref=e310] + - generic [ref=e311]: + - generic [ref=e312]: + - generic [ref=e313]: controller + - generic [ref=e315]: App\Livewire\Storefront\Products\Show + - generic [ref=e316]: + - generic [ref=e317]: route name + - generic [ref=e319]: storefront.products.show + - generic [ref=e320]: + - generic [ref=e321]: middleware + - generic [ref=e323]: web, storefront + - generic [ref=e324]: + - heading "Routing parameters" [level=2] [ref=e325] + - code [ref=e330]: + - generic [ref=e331]: "{" + - generic [ref=e332]: "\"handle\": \"organic-cotton-t-shirt\"" + - generic [ref=e333]: "}" + - generic [ref=e336]: + - img [ref=e338] + - img [ref=e3376] \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T07-43-07-708Z.yml b/.playwright-mcp/page-2026-04-18T07-43-07-708Z.yml new file mode 100644 index 00000000..1d3e83b5 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T07-43-07-708Z.yml @@ -0,0 +1,56 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Products + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Organic Cotton T-Shirt + - generic [ref=e26]: + - img "Organic Cotton T-Shirt front" [ref=e29] + - generic [ref=e30]: + - generic [ref=e31]: Organic Cotton T-Shirt + - generic [ref=e33]: 25.00 EUR + - generic [ref=e34]: + - generic [ref=e35]: Variant + - combobox "Variant" [ref=e36]: + - option "TSH-S-BLA" [selected] + - option "TSH-S-WHI" + - option "TSH-M-BLA" + - option "TSH-M-WHI" + - option "TSH-L-BLA" + - option "TSH-L-WHI" + - generic [ref=e37]: + - generic [ref=e38]: Quantity + - spinbutton "Quantity" [ref=e39]: "1" + - button "Add to cart" [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: Add to cart + - paragraph [ref=e47]: Soft, breathable, sustainably sourced. + - generic [ref=e48]: + - generic [ref=e49]: summer + - generic [ref=e50]: bestseller + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T07-43-15-507Z.yml b/.playwright-mcp/page-2026-04-18T07-43-15-507Z.yml new file mode 100644 index 00000000..49ca496f --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T07-43-15-507Z.yml @@ -0,0 +1,32 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: About Us + - article [ref=e22]: + - heading "About Us" [level=1] [ref=e23] + - paragraph [ref=e24]: Acme Fashion is a demo store created to showcase the platform. + - contentinfo [ref=e25]: + - generic [ref=e26]: © 2026 Acme Fashion. All rights reserved. \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T07-43-17-578Z.yml b/.playwright-mcp/page-2026-04-18T07-43-17-578Z.yml new file mode 100644 index 00000000..ca255515 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T07-43-17-578Z.yml @@ -0,0 +1,35 @@ +- generic [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Search + - generic [ref=e22]: Search + - textbox "What are you looking for?" [active] [ref=e25]: cotton + - link "Organic Cotton T-Shirt" [ref=e29] [cursor=pointer]: + - /url: http://shop.test/products/organic-cotton-t-shirt + - img [ref=e32] + - generic [ref=e35]: Organic Cotton T-Shirt + - contentinfo [ref=e36]: + - generic [ref=e37]: © 2026 Acme Fashion. All rights reserved. \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T07-43-21-920Z.yml b/.playwright-mcp/page-2026-04-18T07-43-21-920Z.yml new file mode 100644 index 00000000..66d04376 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T07-43-21-920Z.yml @@ -0,0 +1,37 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Cart + - generic [ref=e22]: Your cart + - generic [ref=e23]: + - img [ref=e25] + - generic [ref=e28]: + - text: Your cart is empty. Browse + - link "our collections" [ref=e29] [cursor=pointer]: + - /url: http://shop.test/collections + - text: to get started. + - contentinfo [ref=e30]: + - generic [ref=e31]: © 2026 Acme Fashion. All rights reserved. \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T07-43-24-950Z.yml b/.playwright-mcp/page-2026-04-18T07-43-24-950Z.yml new file mode 100644 index 00000000..82c607c2 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T07-43-24-950Z.yml @@ -0,0 +1,6 @@ +- generic [ref=e2]: + - paragraph [ref=e3]: "404" + - heading "Page not found" [level=1] [ref=e4] + - paragraph [ref=e5]: The page you are looking for does not exist or has been moved. + - link "Back to home" [ref=e7] [cursor=pointer]: + - /url: / \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-04-28-270Z.yml b/.playwright-mcp/page-2026-04-18T08-04-28-270Z.yml new file mode 100644 index 00000000..7b4850c1 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-04-28-270Z.yml @@ -0,0 +1,54 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Cart + - generic [ref=e22]: Your cart + - generic [ref=e23]: + - img [ref=e25] + - generic [ref=e28]: + - text: Your cart is empty. Browse + - link "our collections" [ref=e29] [cursor=pointer]: + - /url: http://shop.test/collections + - text: to get started. + - contentinfo [ref=e30]: + - generic [ref=e31]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-04-43-675Z.yml b/.playwright-mcp/page-2026-04-18T08-04-43-675Z.yml new file mode 100644 index 00000000..2e5ed39e --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-04-43-675Z.yml @@ -0,0 +1,50 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Collections + - generic [ref=e22]: Collections + - link "Featured" [ref=e24] [cursor=pointer]: + - /url: http://shop.test/collections/featured + - generic [ref=e25]: Featured + - contentinfo [ref=e26]: + - generic [ref=e27]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-04-48-300Z.yml b/.playwright-mcp/page-2026-04-18T08-04-48-300Z.yml new file mode 100644 index 00000000..3c6206c4 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-04-48-300Z.yml @@ -0,0 +1,68 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - link "Collections" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/collections + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Featured + - generic [ref=e26]: Featured + - paragraph [ref=e28]: Our picks for the season. + - generic [ref=e29]: + - textbox "Search products..." [ref=e31] + - combobox [ref=e33]: + - 'option "Sort: default" [selected]' + - option "Title A-Z" + - option "Title Z-A" + - option "Newest" + - generic [ref=e34]: + - link "Organic Cotton T-Shirt" [ref=e36] [cursor=pointer]: + - /url: http://shop.test/products/organic-cotton-t-shirt + - img [ref=e39] + - generic [ref=e42]: Organic Cotton T-Shirt + - link "Classic Pullover Hoodie" [ref=e44] [cursor=pointer]: + - /url: http://shop.test/products/classic-pullover-hoodie + - img [ref=e47] + - generic [ref=e50]: Classic Pullover Hoodie + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-04-54-210Z.yml b/.playwright-mcp/page-2026-04-18T08-04-54-210Z.yml new file mode 100644 index 00000000..345c45d7 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-04-54-210Z.yml @@ -0,0 +1,73 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Products + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Organic Cotton T-Shirt + - generic [ref=e26]: + - img "Organic Cotton T-Shirt front" [ref=e29] + - generic [ref=e30]: + - generic [ref=e31]: Organic Cotton T-Shirt + - generic [ref=e33]: 25.00 EUR + - generic [ref=e34]: + - generic [ref=e35]: Variant + - combobox "Variant" [ref=e36]: + - option "TSH-S-BLA" [selected] + - option "TSH-S-WHI" + - option "TSH-M-BLA" + - option "TSH-M-WHI" + - option "TSH-L-BLA" + - option "TSH-L-WHI" + - generic [ref=e37]: + - generic [ref=e38]: Quantity + - spinbutton "Quantity" [ref=e39]: "1" + - button "Add to cart" [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: Add to cart + - paragraph [ref=e47]: Soft, breathable, sustainably sourced. + - generic [ref=e48]: + - generic [ref=e49]: summer + - generic [ref=e50]: bestseller + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-05-12-101Z.yml b/.playwright-mcp/page-2026-04-18T08-05-12-101Z.yml new file mode 100644 index 00000000..eb0e953c --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-05-12-101Z.yml @@ -0,0 +1,81 @@ +- generic [active] [ref=e1]: + - dialog [ref=e53]: + - iframe [ref=e54]: + - generic [ref=f1e2]: + - paragraph [ref=f1e3]: "404" + - heading "Page not found" [level=1] [ref=f1e4] + - paragraph [ref=f1e5]: The page you are looking for does not exist or has been moved. + - link "Back to home" [ref=f1e7] [cursor=pointer]: + - /url: / + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Products + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Organic Cotton T-Shirt + - generic [ref=e26]: + - img "Organic Cotton T-Shirt front" [ref=e29] + - generic [ref=e30]: + - generic [ref=e31]: Organic Cotton T-Shirt + - generic [ref=e33]: 25.00 EUR + - generic [ref=e34]: + - generic [ref=e35]: Variant + - combobox "Variant" [ref=e36]: + - option "TSH-S-BLA" [selected] + - option "TSH-S-WHI" + - option "TSH-M-BLA" + - option "TSH-M-WHI" + - option "TSH-L-BLA" + - option "TSH-L-WHI" + - generic [ref=e37]: + - generic [ref=e38]: Quantity + - spinbutton "Quantity" [ref=e39]: "1" + - button "Add to cart" [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: Add to cart + - paragraph [ref=e47]: Soft, breathable, sustainably sourced. + - generic [ref=e48]: + - generic [ref=e49]: summer + - generic [ref=e50]: bestseller + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-06-02-997Z.yml b/.playwright-mcp/page-2026-04-18T08-06-02-997Z.yml new file mode 100644 index 00000000..345c45d7 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-06-02-997Z.yml @@ -0,0 +1,73 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Products + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Organic Cotton T-Shirt + - generic [ref=e26]: + - img "Organic Cotton T-Shirt front" [ref=e29] + - generic [ref=e30]: + - generic [ref=e31]: Organic Cotton T-Shirt + - generic [ref=e33]: 25.00 EUR + - generic [ref=e34]: + - generic [ref=e35]: Variant + - combobox "Variant" [ref=e36]: + - option "TSH-S-BLA" [selected] + - option "TSH-S-WHI" + - option "TSH-M-BLA" + - option "TSH-M-WHI" + - option "TSH-L-BLA" + - option "TSH-L-WHI" + - generic [ref=e37]: + - generic [ref=e38]: Quantity + - spinbutton "Quantity" [ref=e39]: "1" + - button "Add to cart" [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: Add to cart + - paragraph [ref=e47]: Soft, breathable, sustainably sourced. + - generic [ref=e48]: + - generic [ref=e49]: summer + - generic [ref=e50]: bestseller + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-06-09-558Z.yml b/.playwright-mcp/page-2026-04-18T08-06-09-558Z.yml new file mode 100644 index 00000000..ca489fa6 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-06-09-558Z.yml @@ -0,0 +1,81 @@ +- generic [active] [ref=e1]: + - dialog [ref=e53]: + - iframe [ref=e54]: + - generic [ref=f2e2]: + - paragraph [ref=f2e3]: "404" + - heading "Page not found" [level=1] [ref=f2e4] + - paragraph [ref=f2e5]: The page you are looking for does not exist or has been moved. + - link "Back to home" [ref=f2e7] [cursor=pointer]: + - /url: / + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Products + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Organic Cotton T-Shirt + - generic [ref=e26]: + - img "Organic Cotton T-Shirt front" [ref=e29] + - generic [ref=e30]: + - generic [ref=e31]: Organic Cotton T-Shirt + - generic [ref=e33]: 25.00 EUR + - generic [ref=e34]: + - generic [ref=e35]: Variant + - combobox "Variant" [ref=e36]: + - option "TSH-S-BLA" [selected] + - option "TSH-S-WHI" + - option "TSH-M-BLA" + - option "TSH-M-WHI" + - option "TSH-L-BLA" + - option "TSH-L-WHI" + - generic [ref=e37]: + - generic [ref=e38]: Quantity + - spinbutton "Quantity" [ref=e39]: "1" + - button "Add to cart" [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: Add to cart + - paragraph [ref=e47]: Soft, breathable, sustainably sourced. + - generic [ref=e48]: + - generic [ref=e49]: summer + - generic [ref=e50]: bestseller + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-06-32-938Z.yml b/.playwright-mcp/page-2026-04-18T08-06-32-938Z.yml new file mode 100644 index 00000000..345c45d7 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-06-32-938Z.yml @@ -0,0 +1,73 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Products + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Organic Cotton T-Shirt + - generic [ref=e26]: + - img "Organic Cotton T-Shirt front" [ref=e29] + - generic [ref=e30]: + - generic [ref=e31]: Organic Cotton T-Shirt + - generic [ref=e33]: 25.00 EUR + - generic [ref=e34]: + - generic [ref=e35]: Variant + - combobox "Variant" [ref=e36]: + - option "TSH-S-BLA" [selected] + - option "TSH-S-WHI" + - option "TSH-M-BLA" + - option "TSH-M-WHI" + - option "TSH-L-BLA" + - option "TSH-L-WHI" + - generic [ref=e37]: + - generic [ref=e38]: Quantity + - spinbutton "Quantity" [ref=e39]: "1" + - button "Add to cart" [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: Add to cart + - paragraph [ref=e47]: Soft, breathable, sustainably sourced. + - generic [ref=e48]: + - generic [ref=e49]: summer + - generic [ref=e50]: bestseller + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-06-42-016Z.yml b/.playwright-mcp/page-2026-04-18T08-06-42-016Z.yml new file mode 100644 index 00000000..5a528416 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-06-42-016Z.yml @@ -0,0 +1,81 @@ +- generic [active] [ref=e1]: + - dialog [ref=e53]: + - iframe [ref=e54]: + - generic [ref=f3e2]: + - paragraph [ref=f3e3]: "404" + - heading "Page not found" [level=1] [ref=f3e4] + - paragraph [ref=f3e5]: The page you are looking for does not exist or has been moved. + - link "Back to home" [ref=f3e7] [cursor=pointer]: + - /url: / + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Products + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Organic Cotton T-Shirt + - generic [ref=e26]: + - img "Organic Cotton T-Shirt front" [ref=e29] + - generic [ref=e30]: + - generic [ref=e31]: Organic Cotton T-Shirt + - generic [ref=e33]: 25.00 EUR + - generic [ref=e34]: + - generic [ref=e35]: Variant + - combobox "Variant" [ref=e36]: + - option "TSH-S-BLA" [selected] + - option "TSH-S-WHI" + - option "TSH-M-BLA" + - option "TSH-M-WHI" + - option "TSH-L-BLA" + - option "TSH-L-WHI" + - generic [ref=e37]: + - generic [ref=e38]: Quantity + - spinbutton "Quantity" [ref=e39]: "1" + - button "Add to cart" [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: Add to cart + - paragraph [ref=e47]: Soft, breathable, sustainably sourced. + - generic [ref=e48]: + - generic [ref=e49]: summer + - generic [ref=e50]: bestseller + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-07-33-859Z.yml b/.playwright-mcp/page-2026-04-18T08-07-33-859Z.yml new file mode 100644 index 00000000..345c45d7 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-07-33-859Z.yml @@ -0,0 +1,73 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Products + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Organic Cotton T-Shirt + - generic [ref=e26]: + - img "Organic Cotton T-Shirt front" [ref=e29] + - generic [ref=e30]: + - generic [ref=e31]: Organic Cotton T-Shirt + - generic [ref=e33]: 25.00 EUR + - generic [ref=e34]: + - generic [ref=e35]: Variant + - combobox "Variant" [ref=e36]: + - option "TSH-S-BLA" [selected] + - option "TSH-S-WHI" + - option "TSH-M-BLA" + - option "TSH-M-WHI" + - option "TSH-L-BLA" + - option "TSH-L-WHI" + - generic [ref=e37]: + - generic [ref=e38]: Quantity + - spinbutton "Quantity" [ref=e39]: "1" + - button "Add to cart" [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: Add to cart + - paragraph [ref=e47]: Soft, breathable, sustainably sourced. + - generic [ref=e48]: + - generic [ref=e49]: summer + - generic [ref=e50]: bestseller + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-07-43-009Z.yml b/.playwright-mcp/page-2026-04-18T08-07-43-009Z.yml new file mode 100644 index 00000000..a09982c6 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-07-43-009Z.yml @@ -0,0 +1,94 @@ +- generic [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Products + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Organic Cotton T-Shirt + - generic [ref=e26]: + - img "Organic Cotton T-Shirt front" [ref=e29] + - generic [ref=e30]: + - generic [ref=e31]: Organic Cotton T-Shirt + - generic [ref=e33]: 25.00 EUR + - generic [ref=e34]: + - generic [ref=e35]: Variant + - combobox "Variant" [ref=e36]: + - option "TSH-S-BLA" [selected] + - option "TSH-S-WHI" + - option "TSH-M-BLA" + - option "TSH-M-WHI" + - option "TSH-L-BLA" + - option "TSH-L-WHI" + - generic [ref=e37]: + - generic [ref=e38]: Quantity + - spinbutton "Quantity" [ref=e39]: "1" + - button "Add to cart" [active] [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: Add to cart + - paragraph [ref=e47]: Soft, breathable, sustainably sourced. + - generic [ref=e48]: + - generic [ref=e49]: summer + - generic [ref=e50]: bestseller + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. + - dialog "Shopping cart" [ref=e55]: + - banner [ref=e56]: + - generic [ref=e57]: Your Cart (1) + - button "Close cart" [ref=e58]: + - img [ref=e60] + - img [ref=e63] + - list [ref=e66]: + - listitem [ref=e67]: + - generic [ref=e69]: + - paragraph [ref=e70]: Organic Cotton T-Shirt + - paragraph [ref=e71]: TSH-S-BLA + - generic [ref=e72]: + - button "Decrease quantity" [ref=e73]: + - img [ref=e75] + - generic [ref=e78]: "-" + - generic [ref=e79]: "1" + - button "Increase quantity" [ref=e80]: + - img [ref=e82] + - generic [ref=e85]: + + - generic [ref=e86]: + - paragraph [ref=e87]: 25.00 EUR + - button "Remove Organic Cotton T-Shirt from cart" [ref=e88]: + - img [ref=e90] + - img [ref=e93] + - contentinfo [ref=e95]: + - generic [ref=e96]: + - generic [ref=e97]: + - term [ref=e98]: Subtotal + - definition [ref=e99]: 25.00 EUR + - generic [ref=e100]: + - term [ref=e101]: Estimated total + - definition [ref=e102]: 25.00 EUR + - paragraph [ref=e103]: Shipping and taxes calculated at checkout + - link "Checkout" [ref=e104] [cursor=pointer]: + - /url: http://shop.test/checkout + - button "Continue shopping" [ref=e105]: + - img [ref=e107] + - generic [ref=e110]: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-07-52-099Z.yml b/.playwright-mcp/page-2026-04-18T08-07-52-099Z.yml new file mode 100644 index 00000000..a422bcd1 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-07-52-099Z.yml @@ -0,0 +1,117 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Cart + - generic [ref=e22]: Your cart + - generic [ref=e23]: + - list [ref=e25]: + - listitem [ref=e26]: + - generic [ref=e28]: + - paragraph [ref=e29]: Organic Cotton T-Shirt + - paragraph [ref=e30]: TSH-S-BLA + - paragraph [ref=e31]: 25.00 EUR + - generic [ref=e32]: + - button "-" [ref=e33]: + - img [ref=e35] + - generic [ref=e38]: "-" + - generic [ref=e39]: "1" + - button "+" [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: + + - button "Remove" [ref=e46]: + - img [ref=e48] + - generic [ref=e51]: Remove + - paragraph [ref=e53]: 25.00 EUR + - complementary [ref=e54]: + - generic [ref=e55]: + - generic [ref=e56]: Discount code + - generic [ref=e57]: + - textbox "Discount code" [ref=e59] + - button "Apply" [ref=e60]: + - img [ref=e62] + - generic [ref=e65]: Apply + - generic [ref=e66]: + - generic [ref=e67]: Summary + - generic [ref=e68]: + - generic [ref=e69]: + - term [ref=e70]: Subtotal + - definition [ref=e71]: 25.00 EUR + - generic [ref=e72]: + - term [ref=e73]: Estimated total + - definition [ref=e74]: 25.00 EUR + - button "Checkout" [ref=e75]: + - img [ref=e77] + - generic [ref=e80]: Checkout + - link "Continue shopping" [ref=e81] [cursor=pointer]: + - /url: http://shop.test/collections + - contentinfo [ref=e82]: + - generic [ref=e83]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (1) + - button "Close cart": + - generic: + - img + - img + - generic: + - list: + - listitem: + - generic: + - paragraph: Organic Cotton T-Shirt + - paragraph: TSH-S-BLA + - generic: + - button "Decrease quantity": + - generic: + - img + - generic: "-" + - generic: "1" + - button "Increase quantity": + - generic: + - img + - generic: + + - generic: + - paragraph: 25.00 EUR + - button "Remove Organic Cotton T-Shirt from cart": + - generic: + - img + - img + - contentinfo: + - generic: + - generic: + - term: Subtotal + - definition: 25.00 EUR + - generic: + - term: Estimated total + - definition: 25.00 EUR + - paragraph: Shipping and taxes calculated at checkout + - link "Checkout": + - /url: http://shop.test/checkout + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-07-58-525Z.yml b/.playwright-mcp/page-2026-04-18T08-07-58-525Z.yml new file mode 100644 index 00000000..325e4224 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-07-58-525Z.yml @@ -0,0 +1,148 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - link "Cart" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/cart + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Checkout + - generic [ref=e26]: Checkout + - generic [ref=e27]: + - generic [ref=e28]: + - generic [ref=e29]: + - generic [ref=e30]: 1. Contact & shipping + - generic [ref=e31]: + - generic [ref=e32]: + - generic [ref=e33]: Email + - textbox "Email" [ref=e35] + - generic [ref=e36]: + - generic [ref=e37]: First name + - textbox "First name" [ref=e39] + - generic [ref=e40]: + - generic [ref=e41]: Last name + - textbox "Last name" [ref=e43] + - generic [ref=e44]: + - generic [ref=e45]: Address + - textbox "Address" [ref=e47] + - generic [ref=e48]: + - generic [ref=e49]: Apt / Suite + - textbox "Apt / Suite" [ref=e51] + - generic [ref=e52]: + - generic [ref=e53]: City + - textbox "City" [ref=e55] + - generic [ref=e56]: + - generic [ref=e57]: State / Province + - textbox "State / Province" [ref=e59] + - generic [ref=e60]: + - generic [ref=e61]: Postal code + - textbox "Postal code" [ref=e63] + - generic [ref=e64]: + - generic [ref=e65]: Country code + - textbox "Country code" [ref=e67]: US + - button "Continue" [ref=e68]: + - img [ref=e70] + - generic [ref=e73]: Continue + - generic [ref=e74]: + - generic [ref=e75]: 2. Shipping method + - generic [ref=e76]: + - img [ref=e78] + - generic [ref=e82]: No shipping methods available yet. Continue past step 1 first. + - generic [ref=e83]: + - generic [ref=e84]: 3. Payment + - generic [ref=e85]: + - generic [ref=e86]: + - radio "Credit Card" [checked] [ref=e87] + - text: Credit Card + - generic [ref=e88]: + - radio "PayPal" [ref=e89] + - text: PayPal + - generic [ref=e90]: + - radio "Bank Transfer" [ref=e91] + - text: Bank Transfer + - button "Place order - 25.00 EUR" [ref=e92]: + - img [ref=e94] + - generic [ref=e97]: Place order - 25.00 EUR + - complementary [ref=e98]: + - generic [ref=e99]: + - generic [ref=e100]: Order summary + - generic [ref=e101]: + - generic [ref=e102]: + - term [ref=e103]: Subtotal + - definition [ref=e104]: 25.00 EUR + - generic [ref=e105]: + - term [ref=e106]: Shipping + - definition [ref=e107]: 0.00 EUR + - generic [ref=e108]: + - term [ref=e109]: Total + - definition [ref=e110]: 25.00 EUR + - contentinfo [ref=e111]: + - generic [ref=e112]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (1) + - button "Close cart": + - generic: + - img + - img + - generic: + - list: + - listitem: + - generic: + - paragraph: Organic Cotton T-Shirt + - paragraph: TSH-S-BLA + - generic: + - button "Decrease quantity": + - generic: + - img + - generic: "-" + - generic: "1" + - button "Increase quantity": + - generic: + - img + - generic: + + - generic: + - paragraph: 25.00 EUR + - button "Remove Organic Cotton T-Shirt from cart": + - generic: + - img + - img + - contentinfo: + - generic: + - generic: + - term: Subtotal + - definition: 25.00 EUR + - generic: + - term: Estimated total + - definition: 25.00 EUR + - paragraph: Shipping and taxes calculated at checkout + - link "Checkout": + - /url: http://shop.test/checkout + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-18-53-378Z.yml b/.playwright-mcp/page-2026-04-18T08-18-53-378Z.yml new file mode 100644 index 00000000..345c45d7 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-18-53-378Z.yml @@ -0,0 +1,73 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Products + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Organic Cotton T-Shirt + - generic [ref=e26]: + - img "Organic Cotton T-Shirt front" [ref=e29] + - generic [ref=e30]: + - generic [ref=e31]: Organic Cotton T-Shirt + - generic [ref=e33]: 25.00 EUR + - generic [ref=e34]: + - generic [ref=e35]: Variant + - combobox "Variant" [ref=e36]: + - option "TSH-S-BLA" [selected] + - option "TSH-S-WHI" + - option "TSH-M-BLA" + - option "TSH-M-WHI" + - option "TSH-L-BLA" + - option "TSH-L-WHI" + - generic [ref=e37]: + - generic [ref=e38]: Quantity + - spinbutton "Quantity" [ref=e39]: "1" + - button "Add to cart" [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: Add to cart + - paragraph [ref=e47]: Soft, breathable, sustainably sourced. + - generic [ref=e48]: + - generic [ref=e49]: summer + - generic [ref=e50]: bestseller + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-26-52-503Z.yml b/.playwright-mcp/page-2026-04-18T08-26-52-503Z.yml new file mode 100644 index 00000000..82c607c2 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-26-52-503Z.yml @@ -0,0 +1,6 @@ +- generic [ref=e2]: + - paragraph [ref=e3]: "404" + - heading "Page not found" [level=1] [ref=e4] + - paragraph [ref=e5]: The page you are looking for does not exist or has been moved. + - link "Back to home" [ref=e7] [cursor=pointer]: + - /url: / \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-27-08-803Z.yml b/.playwright-mcp/page-2026-04-18T08-27-08-803Z.yml new file mode 100644 index 00000000..ec9315b0 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-27-08-803Z.yml @@ -0,0 +1,56 @@ +- generic [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - generic [ref=e14]: Sign in + - generic [ref=e15]: + - generic [ref=e16]: + - generic [ref=e17]: Email + - textbox "Email" [active] [ref=e19] + - generic [ref=e20]: + - generic [ref=e21]: Password + - textbox "Password" [ref=e23] + - generic [ref=e24]: + - checkbox "Remember me" [ref=e25] + - generic [ref=e27]: Remember me + - button "Sign in" [ref=e28]: + - img [ref=e30] + - generic [ref=e33]: Sign in + - paragraph [ref=e34]: + - text: No account yet? + - link "Create one" [ref=e35] [cursor=pointer]: + - /url: http://shop.test/account/register + - contentinfo [ref=e36]: + - generic [ref=e37]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-27-41-204Z.yml b/.playwright-mcp/page-2026-04-18T08-27-41-204Z.yml new file mode 100644 index 00000000..3223af0a --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-27-41-204Z.yml @@ -0,0 +1,52 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - generic [ref=e14]: Account dashboard + - paragraph [ref=e15]: Welcome back, Billy. + - generic [ref=e16]: + - link "Your orders Track and manage previous purchases" [ref=e17] [cursor=pointer]: + - /url: http://shop.test/account/orders + - generic [ref=e18]: Your orders + - paragraph [ref=e19]: Track and manage previous purchases + - link "Addresses Manage shipping and billing addresses" [ref=e20] [cursor=pointer]: + - /url: http://shop.test/account/addresses + - generic [ref=e21]: Addresses + - paragraph [ref=e22]: Manage shipping and billing addresses + - button "Sign out End your current session" [ref=e24]: + - generic [ref=e25]: Sign out + - paragraph [ref=e26]: End your current session + - contentinfo [ref=e27]: + - generic [ref=e28]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-27-50-110Z.yml b/.playwright-mcp/page-2026-04-18T08-27-50-110Z.yml new file mode 100644 index 00000000..0aad325c --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-27-50-110Z.yml @@ -0,0 +1,58 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - link "Account" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/account + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Orders + - generic [ref=e26]: Order history + - generic [ref=e27]: + - img [ref=e29] + - generic [ref=e32]: + - text: You have no orders yet. + - link "Start shopping" [ref=e33] [cursor=pointer]: + - /url: http://shop.test/collections + - text: . + - contentinfo [ref=e34]: + - generic [ref=e35]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-27-53-108Z.yml b/.playwright-mcp/page-2026-04-18T08-27-53-108Z.yml new file mode 100644 index 00000000..14af7ee2 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-27-53-108Z.yml @@ -0,0 +1,58 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - link "Account" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/account + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Addresses + - generic [ref=e26]: + - generic [ref=e27]: Your addresses + - button "Add address" [ref=e28]: + - img [ref=e30] + - generic [ref=e33]: Add address + - generic [ref=e34]: + - img [ref=e36] + - generic [ref=e39]: No addresses yet. Add one to speed up checkout. + - contentinfo [ref=e40]: + - generic [ref=e41]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-39-15-903Z.yml b/.playwright-mcp/page-2026-04-18T08-39-15-903Z.yml new file mode 100644 index 00000000..54f77f4a --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-39-15-903Z.yml @@ -0,0 +1,59 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - generic [ref=e14]: + - generic [ref=e15]: Elevated essentials + - paragraph [ref=e16]: Timeless pieces for modern wardrobes. + - link "Shop the collection" [ref=e18] [cursor=pointer]: + - /url: /collections + - generic [ref=e19]: + - generic [ref=e20]: Featured collections + - link "Featured" [ref=e22] [cursor=pointer]: + - /url: http://shop.test/collections/featured + - generic [ref=e23]: Featured + - generic [ref=e24]: + - generic [ref=e25]: Featured products + - generic [ref=e26]: + - link "Organic Cotton T-Shirt" [ref=e28] [cursor=pointer]: + - /url: http://shop.test/products/organic-cotton-t-shirt + - img [ref=e31] + - generic [ref=e34]: Organic Cotton T-Shirt + - link "Classic Pullover Hoodie" [ref=e36] [cursor=pointer]: + - /url: http://shop.test/products/classic-pullover-hoodie + - img [ref=e39] + - generic [ref=e42]: Classic Pullover Hoodie + - contentinfo [ref=e43]: + - generic [ref=e44]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-39-24-839Z.yml b/.playwright-mcp/page-2026-04-18T08-39-24-839Z.yml new file mode 100644 index 00000000..e4c711b6 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-39-24-839Z.yml @@ -0,0 +1,73 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Products + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Organic Cotton T-Shirt + - generic [ref=e26]: + - img "Organic Cotton T-Shirt front" [ref=e29] + - generic [ref=e30]: + - generic [ref=e31]: Organic Cotton T-Shirt + - generic [ref=e33]: 25.00 EUR + - generic [ref=e34]: + - generic [ref=e35]: Variant + - combobox "Variant" [ref=e36]: + - option "TSH-S-BLA" [selected] + - option "TSH-S-WHI" + - option "TSH-M-BLA" + - option "TSH-M-WHI" + - option "TSH-L-BLA" + - option "TSH-L-WHI" + - generic [ref=e37]: + - generic [ref=e38]: Quantity + - spinbutton "Quantity" [ref=e39]: "1" + - button "Add to cart" [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: Add to cart + - paragraph [ref=e47]: Soft, breathable, sustainably sourced. + - generic [ref=e48]: + - generic [ref=e49]: summer + - generic [ref=e50]: bestseller + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-39-31-590Z.yml b/.playwright-mcp/page-2026-04-18T08-39-31-590Z.yml new file mode 100644 index 00000000..10e6e10c --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-39-31-590Z.yml @@ -0,0 +1,94 @@ +- generic [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Products + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Organic Cotton T-Shirt + - generic [ref=e26]: + - img "Organic Cotton T-Shirt front" [ref=e29] + - generic [ref=e30]: + - generic [ref=e31]: Organic Cotton T-Shirt + - generic [ref=e33]: 25.00 EUR + - generic [ref=e34]: + - generic [ref=e35]: Variant + - combobox "Variant" [ref=e36]: + - option "TSH-S-BLA" [selected] + - option "TSH-S-WHI" + - option "TSH-M-BLA" + - option "TSH-M-WHI" + - option "TSH-L-BLA" + - option "TSH-L-WHI" + - generic [ref=e37]: + - generic [ref=e38]: Quantity + - spinbutton "Quantity" [ref=e39]: "1" + - button "Add to cart" [active] [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: Add to cart + - paragraph [ref=e47]: Soft, breathable, sustainably sourced. + - generic [ref=e48]: + - generic [ref=e49]: summer + - generic [ref=e50]: bestseller + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. + - dialog "Shopping cart" [ref=e55]: + - banner [ref=e56]: + - generic [ref=e57]: Your Cart (1) + - button "Close cart" [ref=e58]: + - img [ref=e60] + - img [ref=e63] + - list [ref=e66]: + - listitem [ref=e67]: + - generic [ref=e69]: + - paragraph [ref=e70]: Organic Cotton T-Shirt + - paragraph [ref=e71]: TSH-S-BLA + - generic [ref=e72]: + - button "Decrease quantity" [ref=e73]: + - img [ref=e75] + - generic [ref=e78]: "-" + - generic [ref=e79]: "1" + - button "Increase quantity" [ref=e80]: + - img [ref=e82] + - generic [ref=e85]: + + - generic [ref=e86]: + - paragraph [ref=e87]: 25.00 EUR + - button "Remove Organic Cotton T-Shirt from cart" [ref=e88]: + - img [ref=e90] + - img [ref=e93] + - contentinfo [ref=e95]: + - generic [ref=e96]: + - generic [ref=e97]: + - term [ref=e98]: Subtotal + - definition [ref=e99]: 25.00 EUR + - generic [ref=e100]: + - term [ref=e101]: Estimated total + - definition [ref=e102]: 25.00 EUR + - paragraph [ref=e103]: Shipping and taxes calculated at checkout + - link "Checkout" [ref=e104] [cursor=pointer]: + - /url: http://shop.test/checkout + - button "Continue shopping" [ref=e105]: + - img [ref=e107] + - generic [ref=e110]: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-39-45-003Z.yml b/.playwright-mcp/page-2026-04-18T08-39-45-003Z.yml new file mode 100644 index 00000000..55c62ff6 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-39-45-003Z.yml @@ -0,0 +1,148 @@ +- generic [active] [ref=e111]: + - link "Skip to content" [ref=e112] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e113]: Free shipping on orders over 50 + - banner [ref=e114]: + - generic [ref=e115]: + - link "Acme Fashion" [ref=e116] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e117]: + - link "Collections" [ref=e118] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e119] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e120] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e121] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e122]: + - generic [ref=e123]: + - navigation "Breadcrumb" [ref=e124]: + - list [ref=e125]: + - listitem [ref=e126]: + - link "Home" [ref=e127] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e128] + - listitem [ref=e130]: + - link "Cart" [ref=e131] [cursor=pointer]: + - /url: http://shop.test/cart + - img [ref=e132] + - listitem [ref=e134]: + - generic [ref=e135]: Checkout + - generic [ref=e136]: Checkout + - generic [ref=e137]: + - generic [ref=e138]: + - generic [ref=e139]: + - generic [ref=e140]: 1. Contact & shipping + - generic [ref=e141]: + - generic [ref=e142]: + - generic [ref=e143]: Email + - textbox "Email" [ref=e145] + - generic [ref=e146]: + - generic [ref=e147]: First name + - textbox "First name" [ref=e149] + - generic [ref=e150]: + - generic [ref=e151]: Last name + - textbox "Last name" [ref=e153] + - generic [ref=e154]: + - generic [ref=e155]: Address + - textbox "Address" [ref=e157] + - generic [ref=e158]: + - generic [ref=e159]: Apt / Suite + - textbox "Apt / Suite" [ref=e161] + - generic [ref=e162]: + - generic [ref=e163]: City + - textbox "City" [ref=e165] + - generic [ref=e166]: + - generic [ref=e167]: State / Province + - textbox "State / Province" [ref=e169] + - generic [ref=e170]: + - generic [ref=e171]: Postal code + - textbox "Postal code" [ref=e173] + - generic [ref=e174]: + - generic [ref=e175]: Country code + - textbox "Country code" [ref=e177]: US + - button "Continue" [ref=e178]: + - img [ref=e180] + - generic [ref=e183]: Continue + - generic [ref=e184]: + - generic [ref=e185]: 2. Shipping method + - generic [ref=e186]: + - img [ref=e188] + - generic [ref=e192]: No shipping methods available yet. Continue past step 1 first. + - generic [ref=e193]: + - generic [ref=e194]: 3. Payment + - generic [ref=e195]: + - generic [ref=e196]: + - radio "Credit Card" [checked] [ref=e197] + - text: Credit Card + - generic [ref=e198]: + - radio "PayPal" [ref=e199] + - text: PayPal + - generic [ref=e200]: + - radio "Bank Transfer" [ref=e201] + - text: Bank Transfer + - button "Place order - 25.00 EUR" [ref=e202]: + - img [ref=e204] + - generic [ref=e207]: Place order - 25.00 EUR + - complementary [ref=e208]: + - generic [ref=e209]: + - generic [ref=e210]: Order summary + - generic [ref=e211]: + - generic [ref=e212]: + - term [ref=e213]: Subtotal + - definition [ref=e214]: 25.00 EUR + - generic [ref=e215]: + - term [ref=e216]: Shipping + - definition [ref=e217]: 0.00 EUR + - generic [ref=e218]: + - term [ref=e219]: Total + - definition [ref=e220]: 25.00 EUR + - contentinfo [ref=e221]: + - generic [ref=e222]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (1) + - button "Close cart": + - generic: + - img + - img + - generic: + - list: + - listitem: + - generic: + - paragraph: Organic Cotton T-Shirt + - paragraph: TSH-S-BLA + - generic: + - button "Decrease quantity": + - generic: + - img + - generic: "-" + - generic: "1" + - button "Increase quantity": + - generic: + - img + - generic: + + - generic: + - paragraph: 25.00 EUR + - button "Remove Organic Cotton T-Shirt from cart": + - generic: + - img + - img + - contentinfo: + - generic: + - generic: + - term: Subtotal + - definition: 25.00 EUR + - generic: + - term: Estimated total + - definition: 25.00 EUR + - paragraph: Shipping and taxes calculated at checkout + - link "Checkout": + - /url: http://shop.test/checkout + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-40-17-855Z.yml b/.playwright-mcp/page-2026-04-18T08-40-17-855Z.yml new file mode 100644 index 00000000..b07ab0a9 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-40-17-855Z.yml @@ -0,0 +1,148 @@ +- generic [ref=e111]: + - link "Skip to content" [ref=e112] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e113]: Free shipping on orders over 50 + - banner [ref=e114]: + - generic [ref=e115]: + - link "Acme Fashion" [ref=e116] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e117]: + - link "Collections" [ref=e118] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e119] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e120] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e121] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e122]: + - generic [ref=e123]: + - navigation "Breadcrumb" [ref=e124]: + - list [ref=e125]: + - listitem [ref=e126]: + - link "Home" [ref=e127] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e128] + - listitem [ref=e130]: + - link "Cart" [ref=e131] [cursor=pointer]: + - /url: http://shop.test/cart + - img [ref=e132] + - listitem [ref=e134]: + - generic [ref=e135]: Checkout + - generic [ref=e136]: Checkout + - generic [ref=e137]: + - generic [ref=e138]: + - generic [ref=e139]: + - generic [ref=e140]: 1. Contact & shipping + - generic [ref=e141]: + - generic [ref=e142]: + - generic [ref=e143]: Email + - textbox "Email" [ref=e145]: buyer@example.com + - generic [ref=e146]: + - generic [ref=e147]: First name + - textbox "First name" [ref=e149]: Billy + - generic [ref=e150]: + - generic [ref=e151]: Last name + - textbox "Last name" [ref=e153]: Buyer + - generic [ref=e154]: + - generic [ref=e155]: Address + - textbox "Address" [ref=e157]: 1 Shop Street + - generic [ref=e158]: + - generic [ref=e159]: Apt / Suite + - textbox "Apt / Suite" [ref=e161] + - generic [ref=e162]: + - generic [ref=e163]: City + - textbox "City" [ref=e165]: Berlin + - generic [ref=e166]: + - generic [ref=e167]: State / Province + - textbox "State / Province" [ref=e169]: BE + - generic [ref=e170]: + - generic [ref=e171]: Postal code + - textbox "Postal code" [ref=e173]: "10115" + - generic [ref=e174]: + - generic [ref=e175]: Country code + - textbox "Country code" [ref=e177]: US + - button "Continue" [active] [ref=e178]: + - img [ref=e180] + - generic [ref=e183]: Continue + - generic [ref=e184]: + - generic [ref=e185]: 2. Shipping method + - generic [ref=e186]: + - img [ref=e188] + - generic [ref=e192]: No shipping methods available yet. Continue past step 1 first. + - generic [ref=e193]: + - generic [ref=e194]: 3. Payment + - generic [ref=e195]: + - generic [ref=e196]: + - radio "Credit Card" [checked] [ref=e197] + - text: Credit Card + - generic [ref=e198]: + - radio "PayPal" [ref=e199] + - text: PayPal + - generic [ref=e200]: + - radio "Bank Transfer" [ref=e201] + - text: Bank Transfer + - button "Place order - 25.00 EUR" [ref=e202]: + - img [ref=e204] + - generic [ref=e207]: Place order - 25.00 EUR + - complementary [ref=e208]: + - generic [ref=e209]: + - generic [ref=e210]: Order summary + - generic [ref=e211]: + - generic [ref=e212]: + - term [ref=e213]: Subtotal + - definition [ref=e214]: 25.00 EUR + - generic [ref=e215]: + - term [ref=e216]: Shipping + - definition [ref=e217]: 0.00 EUR + - generic [ref=e218]: + - term [ref=e219]: Total + - definition [ref=e220]: 25.00 EUR + - contentinfo [ref=e221]: + - generic [ref=e222]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (1) + - button "Close cart": + - generic: + - img + - img + - generic: + - list: + - listitem: + - generic: + - paragraph: Organic Cotton T-Shirt + - paragraph: TSH-S-BLA + - generic: + - button "Decrease quantity": + - generic: + - img + - generic: "-" + - generic: "1" + - button "Increase quantity": + - generic: + - img + - generic: + + - generic: + - paragraph: 25.00 EUR + - button "Remove Organic Cotton T-Shirt from cart": + - generic: + - img + - img + - contentinfo: + - generic: + - generic: + - term: Subtotal + - definition: 25.00 EUR + - generic: + - term: Estimated total + - definition: 25.00 EUR + - paragraph: Shipping and taxes calculated at checkout + - link "Checkout": + - /url: http://shop.test/checkout + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-41-52-664Z.yml b/.playwright-mcp/page-2026-04-18T08-41-52-664Z.yml new file mode 100644 index 00000000..e4c711b6 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-41-52-664Z.yml @@ -0,0 +1,73 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Products + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Organic Cotton T-Shirt + - generic [ref=e26]: + - img "Organic Cotton T-Shirt front" [ref=e29] + - generic [ref=e30]: + - generic [ref=e31]: Organic Cotton T-Shirt + - generic [ref=e33]: 25.00 EUR + - generic [ref=e34]: + - generic [ref=e35]: Variant + - combobox "Variant" [ref=e36]: + - option "TSH-S-BLA" [selected] + - option "TSH-S-WHI" + - option "TSH-M-BLA" + - option "TSH-M-WHI" + - option "TSH-L-BLA" + - option "TSH-L-WHI" + - generic [ref=e37]: + - generic [ref=e38]: Quantity + - spinbutton "Quantity" [ref=e39]: "1" + - button "Add to cart" [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: Add to cart + - paragraph [ref=e47]: Soft, breathable, sustainably sourced. + - generic [ref=e48]: + - generic [ref=e49]: summer + - generic [ref=e50]: bestseller + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-41-59-687Z.yml b/.playwright-mcp/page-2026-04-18T08-41-59-687Z.yml new file mode 100644 index 00000000..10e6e10c --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-41-59-687Z.yml @@ -0,0 +1,94 @@ +- generic [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - generic [ref=e21]: Products + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Organic Cotton T-Shirt + - generic [ref=e26]: + - img "Organic Cotton T-Shirt front" [ref=e29] + - generic [ref=e30]: + - generic [ref=e31]: Organic Cotton T-Shirt + - generic [ref=e33]: 25.00 EUR + - generic [ref=e34]: + - generic [ref=e35]: Variant + - combobox "Variant" [ref=e36]: + - option "TSH-S-BLA" [selected] + - option "TSH-S-WHI" + - option "TSH-M-BLA" + - option "TSH-M-WHI" + - option "TSH-L-BLA" + - option "TSH-L-WHI" + - generic [ref=e37]: + - generic [ref=e38]: Quantity + - spinbutton "Quantity" [ref=e39]: "1" + - button "Add to cart" [active] [ref=e40]: + - img [ref=e42] + - generic [ref=e45]: Add to cart + - paragraph [ref=e47]: Soft, breathable, sustainably sourced. + - generic [ref=e48]: + - generic [ref=e49]: summer + - generic [ref=e50]: bestseller + - contentinfo [ref=e51]: + - generic [ref=e52]: © 2026 Acme Fashion. All rights reserved. + - dialog "Shopping cart" [ref=e55]: + - banner [ref=e56]: + - generic [ref=e57]: Your Cart (1) + - button "Close cart" [ref=e58]: + - img [ref=e60] + - img [ref=e63] + - list [ref=e66]: + - listitem [ref=e67]: + - generic [ref=e69]: + - paragraph [ref=e70]: Organic Cotton T-Shirt + - paragraph [ref=e71]: TSH-S-BLA + - generic [ref=e72]: + - button "Decrease quantity" [ref=e73]: + - img [ref=e75] + - generic [ref=e78]: "-" + - generic [ref=e79]: "1" + - button "Increase quantity" [ref=e80]: + - img [ref=e82] + - generic [ref=e85]: + + - generic [ref=e86]: + - paragraph [ref=e87]: 25.00 EUR + - button "Remove Organic Cotton T-Shirt from cart" [ref=e88]: + - img [ref=e90] + - img [ref=e93] + - contentinfo [ref=e95]: + - generic [ref=e96]: + - generic [ref=e97]: + - term [ref=e98]: Subtotal + - definition [ref=e99]: 25.00 EUR + - generic [ref=e100]: + - term [ref=e101]: Estimated total + - definition [ref=e102]: 25.00 EUR + - paragraph [ref=e103]: Shipping and taxes calculated at checkout + - link "Checkout" [ref=e104] [cursor=pointer]: + - /url: http://shop.test/checkout + - button "Continue shopping" [ref=e105]: + - img [ref=e107] + - generic [ref=e110]: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-42-02-779Z.yml b/.playwright-mcp/page-2026-04-18T08-42-02-779Z.yml new file mode 100644 index 00000000..1673f5d7 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-42-02-779Z.yml @@ -0,0 +1,151 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - link "Cart" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/cart + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Checkout + - generic [ref=e26]: Checkout + - generic [ref=e27]: + - generic [ref=e28]: + - generic [ref=e29]: + - generic [ref=e30]: 1. Contact & shipping + - generic [ref=e31]: + - generic [ref=e32]: + - generic [ref=e33]: Email + - textbox "Email" [ref=e35] + - generic [ref=e36]: + - generic [ref=e37]: First name + - textbox "First name" [ref=e39] + - generic [ref=e40]: + - generic [ref=e41]: Last name + - textbox "Last name" [ref=e43] + - generic [ref=e44]: + - generic [ref=e45]: Address + - textbox "Address" [ref=e47] + - generic [ref=e48]: + - generic [ref=e49]: Apt / Suite + - textbox "Apt / Suite" [ref=e51] + - generic [ref=e52]: + - generic [ref=e53]: City + - textbox "City" [ref=e55] + - generic [ref=e56]: + - generic [ref=e57]: State / Province + - textbox "State / Province" [ref=e59] + - generic [ref=e60]: + - generic [ref=e61]: Postal code + - textbox "Postal code" [ref=e63] + - generic [ref=e64]: + - generic [ref=e65]: Country code + - textbox "Country code" [ref=e67]: US + - button "Continue" [ref=e68]: + - img [ref=e70] + - generic [ref=e73]: Continue + - generic [ref=e74]: + - generic [ref=e75]: 2. Shipping method + - generic [ref=e76]: + - img [ref=e78] + - generic [ref=e82]: No shipping methods available yet. Continue past step 1 first. + - generic [ref=e83]: + - generic [ref=e84]: 3. Payment + - generic [ref=e85]: + - generic [ref=e86]: + - radio "Credit Card" [checked] [ref=e87] + - text: Credit Card + - generic [ref=e88]: + - radio "PayPal" [ref=e89] + - text: PayPal + - generic [ref=e90]: + - radio "Bank Transfer" [ref=e91] + - text: Bank Transfer + - button "Place order - 29.75 EUR" [ref=e92]: + - img [ref=e94] + - generic [ref=e97]: Place order - 29.75 EUR + - complementary [ref=e98]: + - generic [ref=e99]: + - generic [ref=e100]: Order summary + - generic [ref=e101]: + - generic [ref=e102]: + - term [ref=e103]: Subtotal + - definition [ref=e104]: 25.00 EUR + - generic [ref=e105]: + - term [ref=e106]: Shipping + - definition [ref=e107]: 0.00 EUR + - generic [ref=e108]: + - term [ref=e109]: Tax + - definition [ref=e110]: 4.75 EUR + - generic [ref=e111]: + - term [ref=e112]: Total + - definition [ref=e113]: 29.75 EUR + - contentinfo [ref=e114]: + - generic [ref=e115]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (1) + - button "Close cart": + - generic: + - img + - img + - generic: + - list: + - listitem: + - generic: + - paragraph: Organic Cotton T-Shirt + - paragraph: TSH-S-BLA + - generic: + - button "Decrease quantity": + - generic: + - img + - generic: "-" + - generic: "1" + - button "Increase quantity": + - generic: + - img + - generic: + + - generic: + - paragraph: 25.00 EUR + - button "Remove Organic Cotton T-Shirt from cart": + - generic: + - img + - img + - contentinfo: + - generic: + - generic: + - term: Subtotal + - definition: 25.00 EUR + - generic: + - term: Estimated total + - definition: 25.00 EUR + - paragraph: Shipping and taxes calculated at checkout + - link "Checkout": + - /url: http://shop.test/checkout + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-42-25-068Z.yml b/.playwright-mcp/page-2026-04-18T08-42-25-068Z.yml new file mode 100644 index 00000000..79691711 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-42-25-068Z.yml @@ -0,0 +1,151 @@ +- generic [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - link "Cart" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/cart + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Checkout + - generic [ref=e26]: Checkout + - generic [ref=e27]: + - generic [ref=e28]: + - generic [ref=e29]: + - generic [ref=e30]: 1. Contact & shipping + - generic [ref=e31]: + - generic [ref=e32]: + - generic [ref=e33]: Email + - textbox "Email" [ref=e35]: buyer@example.com + - generic [ref=e36]: + - generic [ref=e37]: First name + - textbox "First name" [ref=e39]: Billy + - generic [ref=e40]: + - generic [ref=e41]: Last name + - textbox "Last name" [ref=e43]: Buyer + - generic [ref=e44]: + - generic [ref=e45]: Address + - textbox "Address" [ref=e47]: 1 Shop Street + - generic [ref=e48]: + - generic [ref=e49]: Apt / Suite + - textbox "Apt / Suite" [ref=e51] + - generic [ref=e52]: + - generic [ref=e53]: City + - textbox "City" [ref=e55]: Berlin + - generic [ref=e56]: + - generic [ref=e57]: State / Province + - textbox "State / Province" [ref=e59]: BE + - generic [ref=e60]: + - generic [ref=e61]: Postal code + - textbox "Postal code" [ref=e63]: "10115" + - generic [ref=e64]: + - generic [ref=e65]: Country code + - textbox "Country code" [active] [ref=e67]: US + - button "Continue" [ref=e68]: + - img [ref=e70] + - generic [ref=e73]: Continue + - generic [ref=e74]: + - generic [ref=e75]: 2. Shipping method + - generic [ref=e76]: + - img [ref=e78] + - generic [ref=e82]: No shipping methods available yet. Continue past step 1 first. + - generic [ref=e83]: + - generic [ref=e84]: 3. Payment + - generic [ref=e85]: + - generic [ref=e86]: + - radio "Credit Card" [checked] [ref=e87] + - text: Credit Card + - generic [ref=e88]: + - radio "PayPal" [ref=e89] + - text: PayPal + - generic [ref=e90]: + - radio "Bank Transfer" [ref=e91] + - text: Bank Transfer + - button "Place order - 29.75 EUR" [ref=e92]: + - img [ref=e94] + - generic [ref=e97]: Place order - 29.75 EUR + - complementary [ref=e98]: + - generic [ref=e99]: + - generic [ref=e100]: Order summary + - generic [ref=e101]: + - generic [ref=e102]: + - term [ref=e103]: Subtotal + - definition [ref=e104]: 25.00 EUR + - generic [ref=e105]: + - term [ref=e106]: Shipping + - definition [ref=e107]: 0.00 EUR + - generic [ref=e108]: + - term [ref=e109]: Tax + - definition [ref=e110]: 4.75 EUR + - generic [ref=e111]: + - term [ref=e112]: Total + - definition [ref=e113]: 29.75 EUR + - contentinfo [ref=e114]: + - generic [ref=e115]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (1) + - button "Close cart": + - generic: + - img + - img + - generic: + - list: + - listitem: + - generic: + - paragraph: Organic Cotton T-Shirt + - paragraph: TSH-S-BLA + - generic: + - button "Decrease quantity": + - generic: + - img + - generic: "-" + - generic: "1" + - button "Increase quantity": + - generic: + - img + - generic: + + - generic: + - paragraph: 25.00 EUR + - button "Remove Organic Cotton T-Shirt from cart": + - generic: + - img + - img + - contentinfo: + - generic: + - generic: + - term: Subtotal + - definition: 25.00 EUR + - generic: + - term: Estimated total + - definition: 25.00 EUR + - paragraph: Shipping and taxes calculated at checkout + - link "Checkout": + - /url: http://shop.test/checkout + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-42-33-505Z.yml b/.playwright-mcp/page-2026-04-18T08-42-33-505Z.yml new file mode 100644 index 00000000..5a98ac28 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-42-33-505Z.yml @@ -0,0 +1,155 @@ +- generic [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - link "Cart" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/cart + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Checkout + - generic [ref=e26]: Checkout + - generic [ref=e27]: + - generic [ref=e28]: + - generic [ref=e29]: + - generic [ref=e30]: 1. Contact & shipping + - generic [ref=e31]: + - generic [ref=e32]: + - generic [ref=e33]: Email + - textbox "Email" [ref=e35]: buyer@example.com + - generic [ref=e36]: + - generic [ref=e37]: First name + - textbox "First name" [ref=e39]: Billy + - generic [ref=e40]: + - generic [ref=e41]: Last name + - textbox "Last name" [ref=e43]: Buyer + - generic [ref=e44]: + - generic [ref=e45]: Address + - textbox "Address" [ref=e47]: 1 Shop Street + - generic [ref=e48]: + - generic [ref=e49]: Apt / Suite + - textbox "Apt / Suite" [ref=e51] + - generic [ref=e52]: + - generic [ref=e53]: City + - textbox "City" [ref=e55]: Berlin + - generic [ref=e56]: + - generic [ref=e57]: State / Province + - textbox "State / Province" [ref=e59]: BE + - generic [ref=e60]: + - generic [ref=e61]: Postal code + - textbox "Postal code" [ref=e63]: "10115" + - generic [ref=e64]: + - generic [ref=e65]: Country code + - textbox "Country code" [ref=e67]: DE + - button "Continue" [active] [ref=e68]: + - img [ref=e70] + - generic [ref=e73]: Continue + - generic [ref=e74]: + - generic [ref=e75]: 2. Shipping method + - list [ref=e116]: + - listitem [ref=e117]: + - generic [ref=e118] [cursor=pointer]: + - generic [ref=e119]: + - radio "Standard 4.99 EUR" [ref=e120] + - generic [ref=e121]: Standard + - generic [ref=e122]: 4.99 EUR + - generic [ref=e83]: + - generic [ref=e84]: 3. Payment + - generic [ref=e85]: + - generic [ref=e86]: + - radio "Credit Card" [checked] [ref=e87] + - text: Credit Card + - generic [ref=e88]: + - radio "PayPal" [ref=e89] + - text: PayPal + - generic [ref=e90]: + - radio "Bank Transfer" [ref=e91] + - text: Bank Transfer + - button "Place order - 29.75 EUR" [ref=e92]: + - img [ref=e94] + - generic [ref=e97]: Place order - 29.75 EUR + - complementary [ref=e98]: + - generic [ref=e99]: + - generic [ref=e100]: Order summary + - generic [ref=e101]: + - generic [ref=e102]: + - term [ref=e103]: Subtotal + - definition [ref=e104]: 25.00 EUR + - generic [ref=e105]: + - term [ref=e106]: Shipping + - definition [ref=e107]: 0.00 EUR + - generic [ref=e108]: + - term [ref=e109]: Tax + - definition [ref=e110]: 4.75 EUR + - generic [ref=e111]: + - term [ref=e112]: Total + - definition [ref=e113]: 29.75 EUR + - contentinfo [ref=e114]: + - generic [ref=e115]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (1) + - button "Close cart": + - generic: + - img + - img + - generic: + - list: + - listitem: + - generic: + - paragraph: Organic Cotton T-Shirt + - paragraph: TSH-S-BLA + - generic: + - button "Decrease quantity": + - generic: + - img + - generic: "-" + - generic: "1" + - button "Increase quantity": + - generic: + - img + - generic: + + - generic: + - paragraph: 25.00 EUR + - button "Remove Organic Cotton T-Shirt from cart": + - generic: + - img + - img + - contentinfo: + - generic: + - generic: + - term: Subtotal + - definition: 25.00 EUR + - generic: + - term: Estimated total + - definition: 25.00 EUR + - paragraph: Shipping and taxes calculated at checkout + - link "Checkout": + - /url: http://shop.test/checkout + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-42-45-519Z.yml b/.playwright-mcp/page-2026-04-18T08-42-45-519Z.yml new file mode 100644 index 00000000..76190904 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-42-45-519Z.yml @@ -0,0 +1,155 @@ +- generic [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - link "Cart" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/cart + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Checkout + - generic [ref=e26]: Checkout + - generic [ref=e27]: + - generic [ref=e28]: + - generic [ref=e29]: + - generic [ref=e30]: 1. Contact & shipping + - generic [ref=e31]: + - generic [ref=e32]: + - generic [ref=e33]: Email + - textbox "Email" [ref=e35]: buyer@example.com + - generic [ref=e36]: + - generic [ref=e37]: First name + - textbox "First name" [ref=e39]: Billy + - generic [ref=e40]: + - generic [ref=e41]: Last name + - textbox "Last name" [ref=e43]: Buyer + - generic [ref=e44]: + - generic [ref=e45]: Address + - textbox "Address" [ref=e47]: 1 Shop Street + - generic [ref=e48]: + - generic [ref=e49]: Apt / Suite + - textbox "Apt / Suite" [ref=e51] + - generic [ref=e52]: + - generic [ref=e53]: City + - textbox "City" [ref=e55]: Berlin + - generic [ref=e56]: + - generic [ref=e57]: State / Province + - textbox "State / Province" [ref=e59]: BE + - generic [ref=e60]: + - generic [ref=e61]: Postal code + - textbox "Postal code" [ref=e63]: "10115" + - generic [ref=e64]: + - generic [ref=e65]: Country code + - textbox "Country code" [ref=e67]: DE + - button "Continue" [ref=e68]: + - img [ref=e70] + - generic [ref=e73]: Continue + - generic [ref=e74]: + - generic [ref=e75]: 2. Shipping method + - list [ref=e116]: + - listitem [ref=e117]: + - generic [ref=e118] [cursor=pointer]: + - generic [ref=e119]: + - radio "Standard 4.99 EUR" [checked] [active] [ref=e120] + - generic [ref=e121]: Standard + - generic [ref=e122]: 4.99 EUR + - generic [ref=e83]: + - generic [ref=e84]: 3. Payment + - generic [ref=e85]: + - generic [ref=e86]: + - radio "Credit Card" [checked] [ref=e87] + - text: Credit Card + - generic [ref=e88]: + - radio "PayPal" [ref=e89] + - text: PayPal + - generic [ref=e90]: + - radio "Bank Transfer" [ref=e91] + - text: Bank Transfer + - button "Place order - 35.69 EUR" [ref=e123]: + - img [ref=e94] + - generic [ref=e97]: Place order - 35.69 EUR + - complementary [ref=e98]: + - generic [ref=e99]: + - generic [ref=e100]: Order summary + - generic [ref=e101]: + - generic [ref=e102]: + - term [ref=e103]: Subtotal + - definition [ref=e104]: 25.00 EUR + - generic [ref=e105]: + - term [ref=e106]: Shipping + - definition [ref=e107]: 4.99 EUR + - generic [ref=e108]: + - term [ref=e109]: Tax + - definition [ref=e110]: 5.70 EUR + - generic [ref=e111]: + - term [ref=e112]: Total + - definition [ref=e113]: 35.69 EUR + - contentinfo [ref=e114]: + - generic [ref=e115]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (1) + - button "Close cart": + - generic: + - img + - img + - generic: + - list: + - listitem: + - generic: + - paragraph: Organic Cotton T-Shirt + - paragraph: TSH-S-BLA + - generic: + - button "Decrease quantity": + - generic: + - img + - generic: "-" + - generic: "1" + - button "Increase quantity": + - generic: + - img + - generic: + + - generic: + - paragraph: 25.00 EUR + - button "Remove Organic Cotton T-Shirt from cart": + - generic: + - img + - img + - contentinfo: + - generic: + - generic: + - term: Subtotal + - definition: 25.00 EUR + - generic: + - term: Estimated total + - definition: 25.00 EUR + - paragraph: Shipping and taxes calculated at checkout + - link "Checkout": + - /url: http://shop.test/checkout + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-43-11-472Z.yml b/.playwright-mcp/page-2026-04-18T08-43-11-472Z.yml new file mode 100644 index 00000000..fe10ffb9 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-43-11-472Z.yml @@ -0,0 +1,155 @@ +- generic [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - link "Cart" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/cart + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Checkout + - generic [ref=e26]: Checkout + - generic [ref=e27]: + - generic [ref=e28]: + - generic [ref=e29]: + - generic [ref=e30]: 1. Contact & shipping + - generic [ref=e31]: + - generic [ref=e32]: + - generic [ref=e33]: Email + - textbox "Email" [ref=e35]: buyer@example.com + - generic [ref=e36]: + - generic [ref=e37]: First name + - textbox "First name" [ref=e39]: Billy + - generic [ref=e40]: + - generic [ref=e41]: Last name + - textbox "Last name" [ref=e43]: Buyer + - generic [ref=e44]: + - generic [ref=e45]: Address + - textbox "Address" [ref=e47]: 1 Shop Street + - generic [ref=e48]: + - generic [ref=e49]: Apt / Suite + - textbox "Apt / Suite" [ref=e51] + - generic [ref=e52]: + - generic [ref=e53]: City + - textbox "City" [ref=e55]: Berlin + - generic [ref=e56]: + - generic [ref=e57]: State / Province + - textbox "State / Province" [ref=e59]: BE + - generic [ref=e60]: + - generic [ref=e61]: Postal code + - textbox "Postal code" [ref=e63]: "10115" + - generic [ref=e64]: + - generic [ref=e65]: Country code + - textbox "Country code" [ref=e67]: DE + - button "Continue" [ref=e68]: + - img [ref=e70] + - generic [ref=e73]: Continue + - generic [ref=e74]: + - generic [ref=e75]: 2. Shipping method + - list [ref=e116]: + - listitem [ref=e117]: + - generic [ref=e118] [cursor=pointer]: + - generic [ref=e119]: + - radio "Standard 4.99 EUR" [checked] [ref=e120] + - generic [ref=e121]: Standard + - generic [ref=e122]: 4.99 EUR + - generic [ref=e83]: + - generic [ref=e84]: 3. Payment + - generic [ref=e85]: + - generic [ref=e86]: + - radio "Credit Card" [ref=e87] + - text: Credit Card + - generic [ref=e88]: + - radio "PayPal" [ref=e89] + - text: PayPal + - generic [ref=e90]: + - radio "Bank Transfer" [checked] [active] [ref=e91] + - text: Bank Transfer + - button "Place order - 35.69 EUR" [ref=e123]: + - img [ref=e94] + - generic [ref=e97]: Place order - 35.69 EUR + - complementary [ref=e98]: + - generic [ref=e99]: + - generic [ref=e100]: Order summary + - generic [ref=e101]: + - generic [ref=e102]: + - term [ref=e103]: Subtotal + - definition [ref=e104]: 25.00 EUR + - generic [ref=e105]: + - term [ref=e106]: Shipping + - definition [ref=e107]: 4.99 EUR + - generic [ref=e108]: + - term [ref=e109]: Tax + - definition [ref=e110]: 5.70 EUR + - generic [ref=e111]: + - term [ref=e112]: Total + - definition [ref=e113]: 35.69 EUR + - contentinfo [ref=e114]: + - generic [ref=e115]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (1) + - button "Close cart": + - generic: + - img + - img + - generic: + - list: + - listitem: + - generic: + - paragraph: Organic Cotton T-Shirt + - paragraph: TSH-S-BLA + - generic: + - button "Decrease quantity": + - generic: + - img + - generic: "-" + - generic: "1" + - button "Increase quantity": + - generic: + - img + - generic: + + - generic: + - paragraph: 25.00 EUR + - button "Remove Organic Cotton T-Shirt from cart": + - generic: + - img + - img + - contentinfo: + - generic: + - generic: + - term: Subtotal + - definition: 25.00 EUR + - generic: + - term: Estimated total + - definition: 25.00 EUR + - paragraph: Shipping and taxes calculated at checkout + - link "Checkout": + - /url: http://shop.test/checkout + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-43-21-769Z.yml b/.playwright-mcp/page-2026-04-18T08-43-21-769Z.yml new file mode 100644 index 00000000..3764bf45 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-43-21-769Z.yml @@ -0,0 +1,155 @@ +- generic [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - link "Cart" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/cart + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Checkout + - generic [ref=e26]: Checkout + - generic [ref=e27]: + - generic [ref=e28]: + - generic [ref=e29]: + - generic [ref=e30]: 1. Contact & shipping + - generic [ref=e31]: + - generic [ref=e32]: + - generic [ref=e33]: Email + - textbox "Email" [ref=e35]: buyer@example.com + - generic [ref=e36]: + - generic [ref=e37]: First name + - textbox "First name" [ref=e39]: Billy + - generic [ref=e40]: + - generic [ref=e41]: Last name + - textbox "Last name" [ref=e43]: Buyer + - generic [ref=e44]: + - generic [ref=e45]: Address + - textbox "Address" [ref=e47]: 1 Shop Street + - generic [ref=e48]: + - generic [ref=e49]: Apt / Suite + - textbox "Apt / Suite" [ref=e51] + - generic [ref=e52]: + - generic [ref=e53]: City + - textbox "City" [ref=e55]: Berlin + - generic [ref=e56]: + - generic [ref=e57]: State / Province + - textbox "State / Province" [ref=e59]: BE + - generic [ref=e60]: + - generic [ref=e61]: Postal code + - textbox "Postal code" [ref=e63]: "10115" + - generic [ref=e64]: + - generic [ref=e65]: Country code + - textbox "Country code" [ref=e67]: DE + - button "Continue" [ref=e68]: + - img [ref=e70] + - generic [ref=e73]: Continue + - generic [ref=e74]: + - generic [ref=e75]: 2. Shipping method + - list [ref=e116]: + - listitem [ref=e117]: + - generic [ref=e118] [cursor=pointer]: + - generic [ref=e119]: + - radio "Standard 4.99 EUR" [checked] [active] [ref=e120] + - generic [ref=e121]: Standard + - generic [ref=e122]: 4.99 EUR + - generic [ref=e83]: + - generic [ref=e84]: 3. Payment + - generic [ref=e85]: + - generic [ref=e86]: + - radio "Credit Card" [ref=e87] + - text: Credit Card + - generic [ref=e88]: + - radio "PayPal" [ref=e89] + - text: PayPal + - generic [ref=e90]: + - radio "Bank Transfer" [checked] [ref=e91] + - text: Bank Transfer + - button "Place order - 35.69 EUR" [ref=e123]: + - img [ref=e94] + - generic [ref=e97]: Place order - 35.69 EUR + - complementary [ref=e98]: + - generic [ref=e99]: + - generic [ref=e100]: Order summary + - generic [ref=e101]: + - generic [ref=e102]: + - term [ref=e103]: Subtotal + - definition [ref=e104]: 25.00 EUR + - generic [ref=e105]: + - term [ref=e106]: Shipping + - definition [ref=e107]: 4.99 EUR + - generic [ref=e108]: + - term [ref=e109]: Tax + - definition [ref=e110]: 5.70 EUR + - generic [ref=e111]: + - term [ref=e112]: Total + - definition [ref=e113]: 35.69 EUR + - contentinfo [ref=e114]: + - generic [ref=e115]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (1) + - button "Close cart": + - generic: + - img + - img + - generic: + - list: + - listitem: + - generic: + - paragraph: Organic Cotton T-Shirt + - paragraph: TSH-S-BLA + - generic: + - button "Decrease quantity": + - generic: + - img + - generic: "-" + - generic: "1" + - button "Increase quantity": + - generic: + - img + - generic: + + - generic: + - paragraph: 25.00 EUR + - button "Remove Organic Cotton T-Shirt from cart": + - generic: + - img + - img + - contentinfo: + - generic: + - generic: + - term: Subtotal + - definition: 25.00 EUR + - generic: + - term: Estimated total + - definition: 25.00 EUR + - paragraph: Shipping and taxes calculated at checkout + - link "Checkout": + - /url: http://shop.test/checkout + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-43-55-970Z.yml b/.playwright-mcp/page-2026-04-18T08-43-55-970Z.yml new file mode 100644 index 00000000..acf4b153 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-43-55-970Z.yml @@ -0,0 +1,44 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - img [ref=e14] + - generic [ref=e16]: Thank you for your order + - paragraph [ref=e17]: "Order number: #1001" + - paragraph [ref=e18]: Phase 5 will wire the real order and payment data. + - link "Continue shopping" [ref=e19] [cursor=pointer]: + - /url: http://shop.test + - contentinfo [ref=e20]: + - generic [ref=e21]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-44-17-187Z.yml b/.playwright-mcp/page-2026-04-18T08-44-17-187Z.yml new file mode 100644 index 00000000..d63f019d --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-44-17-187Z.yml @@ -0,0 +1,75 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - generic [ref=e14]: + - img [ref=e15] + - generic [ref=e17]: Thank you for your order + - paragraph [ref=e18]: "Order number: #1001" + - generic [ref=e19]: + - generic [ref=e20]: + - generic [ref=e21]: Order summary + - generic [ref=e22]: pending + - table [ref=e23]: + - rowgroup [ref=e24]: + - row "Item Qty Total" [ref=e25]: + - columnheader "Item" [ref=e26] + - columnheader "Qty" [ref=e27] + - columnheader "Total" [ref=e28] + - rowgroup [ref=e29]: + - row "Organic Cotton T-Shirt TSH-S-BLA 1 0.00 EUR" [ref=e30]: + - cell "Organic Cotton T-Shirt TSH-S-BLA" [ref=e31]: + - generic [ref=e32]: Organic Cotton T-Shirt + - paragraph [ref=e33]: TSH-S-BLA + - cell "1" [ref=e34] + - cell "0.00 EUR" [ref=e35] + - rowgroup [ref=e36]: + - row "Subtotal 25.00 EUR" [ref=e37]: + - cell "Subtotal" [ref=e38] + - cell "25.00 EUR" [ref=e39] + - row "Shipping 4.99 EUR" [ref=e40]: + - cell "Shipping" [ref=e41] + - cell "4.99 EUR" [ref=e42] + - row "Tax 5.70 EUR" [ref=e43]: + - cell "Tax" [ref=e44] + - cell "5.70 EUR" [ref=e45] + - row "Total 35.69 EUR" [ref=e46]: + - cell "Total" [ref=e47] + - cell "35.69 EUR" [ref=e48] + - generic [ref=e51]: Your bank transfer is awaiting payment. We'll update you once it has been confirmed. + - link "Continue shopping" [ref=e53] [cursor=pointer]: + - /url: http://shop.test + - contentinfo [ref=e54]: + - generic [ref=e55]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-44-45-492Z.yml b/.playwright-mcp/page-2026-04-18T08-44-45-492Z.yml new file mode 100644 index 00000000..ee50e7e2 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-44-45-492Z.yml @@ -0,0 +1,75 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - generic [ref=e14]: + - img [ref=e15] + - generic [ref=e17]: Thank you for your order + - paragraph [ref=e18]: "Order number: #1001" + - generic [ref=e19]: + - generic [ref=e20]: + - generic [ref=e21]: Order summary + - generic [ref=e22]: pending + - table [ref=e23]: + - rowgroup [ref=e24]: + - row "Item Qty Total" [ref=e25]: + - columnheader "Item" [ref=e26] + - columnheader "Qty" [ref=e27] + - columnheader "Total" [ref=e28] + - rowgroup [ref=e29]: + - row "Organic Cotton T-Shirt TSH-S-BLA 1 25.00 EUR" [ref=e30]: + - cell "Organic Cotton T-Shirt TSH-S-BLA" [ref=e31]: + - generic [ref=e32]: Organic Cotton T-Shirt + - paragraph [ref=e33]: TSH-S-BLA + - cell "1" [ref=e34] + - cell "25.00 EUR" [ref=e35] + - rowgroup [ref=e36]: + - row "Subtotal 25.00 EUR" [ref=e37]: + - cell "Subtotal" [ref=e38] + - cell "25.00 EUR" [ref=e39] + - row "Shipping 4.99 EUR" [ref=e40]: + - cell "Shipping" [ref=e41] + - cell "4.99 EUR" [ref=e42] + - row "Tax 5.70 EUR" [ref=e43]: + - cell "Tax" [ref=e44] + - cell "5.70 EUR" [ref=e45] + - row "Total 35.69 EUR" [ref=e46]: + - cell "Total" [ref=e47] + - cell "35.69 EUR" [ref=e48] + - generic [ref=e51]: Your bank transfer is awaiting payment. We'll update you once it has been confirmed. + - link "Continue shopping" [ref=e53] [cursor=pointer]: + - /url: http://shop.test + - contentinfo [ref=e54]: + - generic [ref=e55]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-44-53-597Z.yml b/.playwright-mcp/page-2026-04-18T08-44-53-597Z.yml new file mode 100644 index 00000000..34a55d87 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-44-53-597Z.yml @@ -0,0 +1,56 @@ +- generic [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - generic [ref=e14]: Sign in + - generic [ref=e15]: + - generic [ref=e16]: + - generic [ref=e17]: Email + - textbox "Email" [active] [ref=e19] + - generic [ref=e20]: + - generic [ref=e21]: Password + - textbox "Password" [ref=e23] + - generic [ref=e24]: + - checkbox "Remember me" [ref=e25] + - generic [ref=e27]: Remember me + - button "Sign in" [ref=e28]: + - img [ref=e30] + - generic [ref=e33]: Sign in + - paragraph [ref=e34]: + - text: No account yet? + - link "Create one" [ref=e35] [cursor=pointer]: + - /url: http://shop.test/account/register + - contentinfo [ref=e36]: + - generic [ref=e37]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-45-20-872Z.yml b/.playwright-mcp/page-2026-04-18T08-45-20-872Z.yml new file mode 100644 index 00000000..3223af0a --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-45-20-872Z.yml @@ -0,0 +1,52 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - generic [ref=e14]: Account dashboard + - paragraph [ref=e15]: Welcome back, Billy. + - generic [ref=e16]: + - link "Your orders Track and manage previous purchases" [ref=e17] [cursor=pointer]: + - /url: http://shop.test/account/orders + - generic [ref=e18]: Your orders + - paragraph [ref=e19]: Track and manage previous purchases + - link "Addresses Manage shipping and billing addresses" [ref=e20] [cursor=pointer]: + - /url: http://shop.test/account/addresses + - generic [ref=e21]: Addresses + - paragraph [ref=e22]: Manage shipping and billing addresses + - button "Sign out End your current session" [ref=e24]: + - generic [ref=e25]: Sign out + - paragraph [ref=e26]: End your current session + - contentinfo [ref=e27]: + - generic [ref=e28]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-45-29-103Z.yml b/.playwright-mcp/page-2026-04-18T08-45-29-103Z.yml new file mode 100644 index 00000000..3223af0a --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-45-29-103Z.yml @@ -0,0 +1,52 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - generic [ref=e14]: Account dashboard + - paragraph [ref=e15]: Welcome back, Billy. + - generic [ref=e16]: + - link "Your orders Track and manage previous purchases" [ref=e17] [cursor=pointer]: + - /url: http://shop.test/account/orders + - generic [ref=e18]: Your orders + - paragraph [ref=e19]: Track and manage previous purchases + - link "Addresses Manage shipping and billing addresses" [ref=e20] [cursor=pointer]: + - /url: http://shop.test/account/addresses + - generic [ref=e21]: Addresses + - paragraph [ref=e22]: Manage shipping and billing addresses + - button "Sign out End your current session" [ref=e24]: + - generic [ref=e25]: Sign out + - paragraph [ref=e26]: End your current session + - contentinfo [ref=e27]: + - generic [ref=e28]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-45-34-547Z.yml b/.playwright-mcp/page-2026-04-18T08-45-34-547Z.yml new file mode 100644 index 00000000..0aad325c --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-45-34-547Z.yml @@ -0,0 +1,58 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: http://shop.test + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/search + - link "Account" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/account + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/cart + - main [ref=e12]: + - generic [ref=e13]: + - navigation "Breadcrumb" [ref=e14]: + - list [ref=e15]: + - listitem [ref=e16]: + - link "Home" [ref=e17] [cursor=pointer]: + - /url: http://shop.test + - img [ref=e18] + - listitem [ref=e20]: + - link "Account" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/account + - img [ref=e22] + - listitem [ref=e24]: + - generic [ref=e25]: Orders + - generic [ref=e26]: Order history + - generic [ref=e27]: + - img [ref=e29] + - generic [ref=e32]: + - text: You have no orders yet. + - link "Start shopping" [ref=e33] [cursor=pointer]: + - /url: http://shop.test/collections + - text: . + - contentinfo [ref=e34]: + - generic [ref=e35]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-45-49-992Z.yml b/.playwright-mcp/page-2026-04-18T08-45-49-992Z.yml new file mode 100644 index 00000000..6bc74eca --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-45-49-992Z.yml @@ -0,0 +1,16 @@ +- generic [ref=e3]: + - generic [ref=e4]: Admin Login + - paragraph [ref=e5]: Sign in to manage your store + - generic [ref=e6]: + - generic [ref=e7]: + - generic [ref=e8]: Email + - textbox "Email" [active] [ref=e10] + - generic [ref=e11]: + - generic [ref=e12]: Password + - textbox "Password" [ref=e14] + - generic [ref=e15]: + - checkbox "Remember me" [ref=e16] + - generic [ref=e18]: Remember me + - button "Sign in" [ref=e19]: + - img [ref=e21] + - generic [ref=e24]: Sign in \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-46-01-203Z.yml b/.playwright-mcp/page-2026-04-18T08-46-01-203Z.yml new file mode 100644 index 00000000..9a15b409 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-46-01-203Z.yml @@ -0,0 +1,16 @@ +- generic [ref=e3]: + - generic [ref=e4]: Admin Login + - paragraph [ref=e5]: Sign in to manage your store + - generic [ref=e6]: + - generic [ref=e7]: + - generic [ref=e8]: Email + - textbox "Email" [ref=e10]: owner@acme.test + - generic [ref=e11]: + - generic [ref=e12]: Password + - textbox "Password" [active] [ref=e14]: password + - generic [ref=e15]: + - checkbox "Remember me" [ref=e16] + - generic [ref=e18]: Remember me + - button "Sign in" [ref=e19]: + - img [ref=e21] + - generic [ref=e24]: Sign in \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-46-07-518Z.yml b/.playwright-mcp/page-2026-04-18T08-46-07-518Z.yml new file mode 100644 index 00000000..9a15b409 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-46-07-518Z.yml @@ -0,0 +1,16 @@ +- generic [ref=e3]: + - generic [ref=e4]: Admin Login + - paragraph [ref=e5]: Sign in to manage your store + - generic [ref=e6]: + - generic [ref=e7]: + - generic [ref=e8]: Email + - textbox "Email" [ref=e10]: owner@acme.test + - generic [ref=e11]: + - generic [ref=e12]: Password + - textbox "Password" [active] [ref=e14]: password + - generic [ref=e15]: + - checkbox "Remember me" [ref=e16] + - generic [ref=e18]: Remember me + - button "Sign in" [ref=e19]: + - img [ref=e21] + - generic [ref=e24]: Sign in \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-46-19-920Z.yml b/.playwright-mcp/page-2026-04-18T08-46-19-920Z.yml new file mode 100644 index 00000000..1673ed07 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-46-19-920Z.yml @@ -0,0 +1,83 @@ +- generic [ref=e2]: + - complementary [ref=e3]: + - generic [ref=e4]: Acme Fashion + - navigation [ref=e5]: + - link "Dashboard" [ref=e6] [cursor=pointer]: + - /url: http://shop.test/admin + - link "Orders" [ref=e7] [cursor=pointer]: + - /url: http://shop.test/admin/orders + - link "Products" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/admin/products + - link "Collections" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/admin/collections + - link "Customers" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/admin/customers + - link "Discounts" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/admin/discounts + - link "Analytics" [ref=e12] [cursor=pointer]: + - /url: http://shop.test/admin/analytics + - generic [ref=e13]: Content + - link "Pages" [ref=e14] [cursor=pointer]: + - /url: http://shop.test/admin/content/pages + - link "Navigation" [ref=e15] [cursor=pointer]: + - /url: http://shop.test/admin/content/navigation + - link "Themes" [ref=e16] [cursor=pointer]: + - /url: http://shop.test/admin/content/themes + - generic [ref=e17]: System + - link "Settings" [ref=e18] [cursor=pointer]: + - /url: http://shop.test/admin/settings + - link "Search" [ref=e19] [cursor=pointer]: + - /url: http://shop.test/admin/search/settings + - link "Apps" [ref=e20] [cursor=pointer]: + - /url: http://shop.test/admin/apps + - link "Developers" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/admin/developers + - generic [ref=e22]: + - banner [ref=e23]: + - generic [ref=e25]: Admin + - generic [ref=e26]: + - paragraph [ref=e27]: owner@acme.test + - button "Sign out" [ref=e29]: + - img [ref=e31] + - generic [ref=e34]: Sign out + - main [ref=e35]: + - generic [ref=e36]: + - generic [ref=e37]: + - generic [ref=e38]: Dashboard + - generic [ref=e39]: + - generic [ref=e40]: + - generic [ref=e41]: From + - textbox "From" [ref=e43]: 2026-03-20 + - generic [ref=e45]: + - generic [ref=e46]: To + - textbox "To" [ref=e48]: 2026-04-18 + - generic [ref=e50]: + - generic [ref=e51]: + - paragraph [ref=e52]: Total sales + - generic [ref=e53]: "0.00" + - generic [ref=e54]: + - paragraph [ref=e55]: Orders + - generic [ref=e56]: "0" + - generic [ref=e57]: + - paragraph [ref=e58]: AOV + - generic [ref=e59]: "0.00" + - generic [ref=e60]: + - paragraph [ref=e61]: Conversion + - generic [ref=e62]: 0.00% + - generic [ref=e63]: + - generic [ref=e64]: Recent orders + - table [ref=e65]: + - rowgroup [ref=e66]: + - row "Order Email Status Total" [ref=e67]: + - columnheader "Order" [ref=e68] + - columnheader "Email" [ref=e69] + - columnheader "Status" [ref=e70] + - columnheader "Total" [ref=e71] + - rowgroup [ref=e72]: + - row "#1001 buyer@example.com pending 35.69" [ref=e73]: + - cell "#1001" [ref=e74]: + - link "#1001" [ref=e75] [cursor=pointer]: + - /url: http://shop.test/admin/orders/1 + - cell "buyer@example.com" [ref=e76] + - cell "pending" [ref=e77] + - cell "35.69" [ref=e78] \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-46-24-184Z.yml b/.playwright-mcp/page-2026-04-18T08-46-24-184Z.yml new file mode 100644 index 00000000..97cb8a0a --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-46-24-184Z.yml @@ -0,0 +1,99 @@ +- generic [ref=e2]: + - complementary [ref=e3]: + - generic [ref=e4]: Acme Fashion + - navigation [ref=e5]: + - link "Dashboard" [ref=e6] [cursor=pointer]: + - /url: http://shop.test/admin + - link "Orders" [ref=e7] [cursor=pointer]: + - /url: http://shop.test/admin/orders + - link "Products" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/admin/products + - link "Collections" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/admin/collections + - link "Customers" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/admin/customers + - link "Discounts" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/admin/discounts + - link "Analytics" [ref=e12] [cursor=pointer]: + - /url: http://shop.test/admin/analytics + - generic [ref=e13]: Content + - link "Pages" [ref=e14] [cursor=pointer]: + - /url: http://shop.test/admin/content/pages + - link "Navigation" [ref=e15] [cursor=pointer]: + - /url: http://shop.test/admin/content/navigation + - link "Themes" [ref=e16] [cursor=pointer]: + - /url: http://shop.test/admin/content/themes + - generic [ref=e17]: System + - link "Settings" [ref=e18] [cursor=pointer]: + - /url: http://shop.test/admin/settings + - link "Search" [ref=e19] [cursor=pointer]: + - /url: http://shop.test/admin/search/settings + - link "Apps" [ref=e20] [cursor=pointer]: + - /url: http://shop.test/admin/apps + - link "Developers" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/admin/developers + - generic [ref=e22]: + - banner [ref=e23]: + - generic [ref=e25]: Admin + - generic [ref=e26]: + - paragraph [ref=e27]: owner@acme.test + - button "Sign out" [ref=e29]: + - img [ref=e31] + - generic [ref=e34]: Sign out + - main [ref=e35]: + - generic [ref=e36]: + - generic [ref=e37]: + - generic [ref=e38]: "Order #1001" + - link "Back" [ref=e39] [cursor=pointer]: + - /url: http://shop.test/admin/orders + - generic [ref=e40]: + - button "Fulfill items" [ref=e41]: + - img [ref=e43] + - generic [ref=e46]: Fulfill items + - button "Confirm payment" [ref=e47]: + - img [ref=e49] + - generic [ref=e52]: Confirm payment + - button "Cancel order" [ref=e53]: + - img [ref=e55] + - generic [ref=e58]: Cancel order + - generic [ref=e59]: + - generic [ref=e60]: + - generic [ref=e61]: + - generic [ref=e62]: Line items + - table [ref=e63]: + - rowgroup [ref=e64]: + - row "Title SKU Qty Price Total" [ref=e65]: + - columnheader "Title" [ref=e66] + - columnheader "SKU" [ref=e67] + - columnheader "Qty" [ref=e68] + - columnheader "Price" [ref=e69] + - columnheader "Total" [ref=e70] + - rowgroup [ref=e71]: + - row "Organic Cotton T-Shirt TSH-S-BLA 1 (0 fulfilled) 25.00 25.00" [ref=e72]: + - cell "Organic Cotton T-Shirt" [ref=e73] + - cell "TSH-S-BLA" [ref=e74] + - cell "1 (0 fulfilled)" [ref=e75] + - cell "25.00" [ref=e76] + - cell "25.00" [ref=e77] + - generic [ref=e79]: + - generic [ref=e80]: "Subtotal: 25.00" + - generic [ref=e81]: "Shipping: 4.99" + - generic [ref=e82]: "Tax: 5.70" + - generic [ref=e83]: "Total: 35.69" + - generic [ref=e84]: + - generic [ref=e85]: Timeline + - list [ref=e86]: + - listitem [ref=e87]: Placed at 2026-04-18 08:43 + - generic [ref=e88]: + - generic [ref=e89]: Payment + - list [ref=e90]: + - listitem [ref=e91]: "Method: bank_transfer" + - listitem [ref=e92]: "Financial status: pending" + - listitem [ref=e93]: "Total paid: 35.69" + - generic [ref=e94]: + - generic [ref=e95]: + - generic [ref=e96]: Customer + - generic [ref=e98]: buyer@example.com + - generic [ref=e99]: + - generic [ref=e100]: Shipping address + - generic [ref=e101]: "{ \"first_name\": \"Billy\", \"last_name\": \"Buyer\", \"address1\": \"1 Shop Street\", \"address2\": \"\", \"city\": \"Berlin\", \"province_code\": \"BE\", \"zip\": \"10115\", \"country_code\": \"DE\", \"phone\": \"\" }" \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-46-40-422Z.yml b/.playwright-mcp/page-2026-04-18T08-46-40-422Z.yml new file mode 100644 index 00000000..97cb8a0a --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-46-40-422Z.yml @@ -0,0 +1,99 @@ +- generic [ref=e2]: + - complementary [ref=e3]: + - generic [ref=e4]: Acme Fashion + - navigation [ref=e5]: + - link "Dashboard" [ref=e6] [cursor=pointer]: + - /url: http://shop.test/admin + - link "Orders" [ref=e7] [cursor=pointer]: + - /url: http://shop.test/admin/orders + - link "Products" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/admin/products + - link "Collections" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/admin/collections + - link "Customers" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/admin/customers + - link "Discounts" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/admin/discounts + - link "Analytics" [ref=e12] [cursor=pointer]: + - /url: http://shop.test/admin/analytics + - generic [ref=e13]: Content + - link "Pages" [ref=e14] [cursor=pointer]: + - /url: http://shop.test/admin/content/pages + - link "Navigation" [ref=e15] [cursor=pointer]: + - /url: http://shop.test/admin/content/navigation + - link "Themes" [ref=e16] [cursor=pointer]: + - /url: http://shop.test/admin/content/themes + - generic [ref=e17]: System + - link "Settings" [ref=e18] [cursor=pointer]: + - /url: http://shop.test/admin/settings + - link "Search" [ref=e19] [cursor=pointer]: + - /url: http://shop.test/admin/search/settings + - link "Apps" [ref=e20] [cursor=pointer]: + - /url: http://shop.test/admin/apps + - link "Developers" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/admin/developers + - generic [ref=e22]: + - banner [ref=e23]: + - generic [ref=e25]: Admin + - generic [ref=e26]: + - paragraph [ref=e27]: owner@acme.test + - button "Sign out" [ref=e29]: + - img [ref=e31] + - generic [ref=e34]: Sign out + - main [ref=e35]: + - generic [ref=e36]: + - generic [ref=e37]: + - generic [ref=e38]: "Order #1001" + - link "Back" [ref=e39] [cursor=pointer]: + - /url: http://shop.test/admin/orders + - generic [ref=e40]: + - button "Fulfill items" [ref=e41]: + - img [ref=e43] + - generic [ref=e46]: Fulfill items + - button "Confirm payment" [ref=e47]: + - img [ref=e49] + - generic [ref=e52]: Confirm payment + - button "Cancel order" [ref=e53]: + - img [ref=e55] + - generic [ref=e58]: Cancel order + - generic [ref=e59]: + - generic [ref=e60]: + - generic [ref=e61]: + - generic [ref=e62]: Line items + - table [ref=e63]: + - rowgroup [ref=e64]: + - row "Title SKU Qty Price Total" [ref=e65]: + - columnheader "Title" [ref=e66] + - columnheader "SKU" [ref=e67] + - columnheader "Qty" [ref=e68] + - columnheader "Price" [ref=e69] + - columnheader "Total" [ref=e70] + - rowgroup [ref=e71]: + - row "Organic Cotton T-Shirt TSH-S-BLA 1 (0 fulfilled) 25.00 25.00" [ref=e72]: + - cell "Organic Cotton T-Shirt" [ref=e73] + - cell "TSH-S-BLA" [ref=e74] + - cell "1 (0 fulfilled)" [ref=e75] + - cell "25.00" [ref=e76] + - cell "25.00" [ref=e77] + - generic [ref=e79]: + - generic [ref=e80]: "Subtotal: 25.00" + - generic [ref=e81]: "Shipping: 4.99" + - generic [ref=e82]: "Tax: 5.70" + - generic [ref=e83]: "Total: 35.69" + - generic [ref=e84]: + - generic [ref=e85]: Timeline + - list [ref=e86]: + - listitem [ref=e87]: Placed at 2026-04-18 08:43 + - generic [ref=e88]: + - generic [ref=e89]: Payment + - list [ref=e90]: + - listitem [ref=e91]: "Method: bank_transfer" + - listitem [ref=e92]: "Financial status: pending" + - listitem [ref=e93]: "Total paid: 35.69" + - generic [ref=e94]: + - generic [ref=e95]: + - generic [ref=e96]: Customer + - generic [ref=e98]: buyer@example.com + - generic [ref=e99]: + - generic [ref=e100]: Shipping address + - generic [ref=e101]: "{ \"first_name\": \"Billy\", \"last_name\": \"Buyer\", \"address1\": \"1 Shop Street\", \"address2\": \"\", \"city\": \"Berlin\", \"province_code\": \"BE\", \"zip\": \"10115\", \"country_code\": \"DE\", \"phone\": \"\" }" \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-46-56-113Z.yml b/.playwright-mcp/page-2026-04-18T08-46-56-113Z.yml new file mode 100644 index 00000000..719c9fdb --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-46-56-113Z.yml @@ -0,0 +1,90 @@ +- generic [ref=e2]: + - complementary [ref=e3]: + - generic [ref=e4]: Acme Fashion + - navigation [ref=e5]: + - link "Dashboard" [ref=e6] [cursor=pointer]: + - /url: http://shop.test/admin + - link "Orders" [ref=e7] [cursor=pointer]: + - /url: http://shop.test/admin/orders + - link "Products" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/admin/products + - link "Collections" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/admin/collections + - link "Customers" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/admin/customers + - link "Discounts" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/admin/discounts + - link "Analytics" [ref=e12] [cursor=pointer]: + - /url: http://shop.test/admin/analytics + - generic [ref=e13]: Content + - link "Pages" [ref=e14] [cursor=pointer]: + - /url: http://shop.test/admin/content/pages + - link "Navigation" [ref=e15] [cursor=pointer]: + - /url: http://shop.test/admin/content/navigation + - link "Themes" [ref=e16] [cursor=pointer]: + - /url: http://shop.test/admin/content/themes + - generic [ref=e17]: System + - link "Settings" [ref=e18] [cursor=pointer]: + - /url: http://shop.test/admin/settings + - link "Search" [ref=e19] [cursor=pointer]: + - /url: http://shop.test/admin/search/settings + - link "Apps" [ref=e20] [cursor=pointer]: + - /url: http://shop.test/admin/apps + - link "Developers" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/admin/developers + - generic [ref=e22]: + - banner [ref=e23]: + - generic [ref=e25]: Admin + - generic [ref=e26]: + - paragraph [ref=e27]: owner@acme.test + - button "Sign out" [ref=e29]: + - img [ref=e31] + - generic [ref=e34]: Sign out + - main [ref=e35]: + - generic [ref=e36]: + - generic [ref=e37]: + - generic [ref=e38]: Products + - link "New product" [ref=e39] [cursor=pointer]: + - /url: http://shop.test/admin/products/new + - generic [ref=e40]: + - textbox "Search products..." [ref=e42] + - combobox [ref=e44]: + - option "All statuses" [disabled] + - option "All statuses" [selected] + - option "Draft" + - option "Active" + - option "Archived" + - table [ref=e46]: + - rowgroup [ref=e47]: + - row "Title Status Vendor Type Actions" [ref=e48]: + - columnheader [ref=e49] + - columnheader "Title" [ref=e50] + - columnheader "Status" [ref=e51] + - columnheader "Vendor" [ref=e52] + - columnheader "Type" [ref=e53] + - columnheader "Actions" [ref=e54] + - rowgroup [ref=e55]: + - row "Classic Pullover Hoodie active Acme Apparel Apparel Edit" [ref=e56]: + - cell [ref=e57]: + - checkbox [ref=e58] + - cell "Classic Pullover Hoodie" [ref=e60]: + - link "Classic Pullover Hoodie" [ref=e61] [cursor=pointer]: + - /url: http://shop.test/admin/products/2 + - cell "active" [ref=e62] + - cell "Acme Apparel" [ref=e63] + - cell "Apparel" [ref=e64] + - cell "Edit" [ref=e65]: + - link "Edit" [ref=e66] [cursor=pointer]: + - /url: http://shop.test/admin/products/2 + - row "Organic Cotton T-Shirt active Acme Apparel Apparel Edit" [ref=e67]: + - cell [ref=e68]: + - checkbox [ref=e69] + - cell "Organic Cotton T-Shirt" [ref=e71]: + - link "Organic Cotton T-Shirt" [ref=e72] [cursor=pointer]: + - /url: http://shop.test/admin/products/1 + - cell "active" [ref=e73] + - cell "Acme Apparel" [ref=e74] + - cell "Apparel" [ref=e75] + - cell "Edit" [ref=e76]: + - link "Edit" [ref=e77] [cursor=pointer]: + - /url: http://shop.test/admin/products/1 \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-47-08-093Z.yml b/.playwright-mcp/page-2026-04-18T08-47-08-093Z.yml new file mode 100644 index 00000000..b55244ff --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-47-08-093Z.yml @@ -0,0 +1,104 @@ +- generic [ref=e2]: + - complementary [ref=e3]: + - generic [ref=e4]: Acme Fashion + - navigation [ref=e5]: + - link "Dashboard" [ref=e6] [cursor=pointer]: + - /url: http://shop.test/admin + - link "Orders" [ref=e7] [cursor=pointer]: + - /url: http://shop.test/admin/orders + - link "Products" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/admin/products + - link "Collections" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/admin/collections + - link "Customers" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/admin/customers + - link "Discounts" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/admin/discounts + - link "Analytics" [ref=e12] [cursor=pointer]: + - /url: http://shop.test/admin/analytics + - generic [ref=e13]: Content + - link "Pages" [ref=e14] [cursor=pointer]: + - /url: http://shop.test/admin/content/pages + - link "Navigation" [ref=e15] [cursor=pointer]: + - /url: http://shop.test/admin/content/navigation + - link "Themes" [ref=e16] [cursor=pointer]: + - /url: http://shop.test/admin/content/themes + - generic [ref=e17]: System + - link "Settings" [ref=e18] [cursor=pointer]: + - /url: http://shop.test/admin/settings + - link "Search" [ref=e19] [cursor=pointer]: + - /url: http://shop.test/admin/search/settings + - link "Apps" [ref=e20] [cursor=pointer]: + - /url: http://shop.test/admin/apps + - link "Developers" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/admin/developers + - generic [ref=e22]: + - banner [ref=e23]: + - generic [ref=e25]: Admin + - generic [ref=e26]: + - paragraph [ref=e27]: owner@acme.test + - button "Sign out" [ref=e29]: + - img [ref=e31] + - generic [ref=e34]: Sign out + - main [ref=e35]: + - generic [ref=e36]: + - generic [ref=e37]: + - generic [ref=e38]: Shipping + - link "Back" [ref=e39] [cursor=pointer]: + - /url: http://shop.test/admin/settings + - generic [ref=e40]: + - generic [ref=e41]: + - generic [ref=e42]: Zone name + - textbox "Zone name" [ref=e44] + - generic [ref=e45]: + - generic [ref=e46]: Countries (comma ISO-2) + - textbox "Countries (comma ISO-2)" [ref=e48] + - button "Add zone" [ref=e49]: + - img [ref=e51] + - generic [ref=e54]: Add zone + - generic [ref=e55]: + - generic [ref=e56]: + - generic [ref=e57]: Germany DE + - button "Remove zone" [ref=e58]: + - img [ref=e60] + - generic [ref=e63]: Remove zone + - list [ref=e64]: + - listitem [ref=e65]: + - generic [ref=e66]: Standard (flat) - 499 cents + - button "Remove" [ref=e67]: + - img [ref=e69] + - generic [ref=e72]: Remove + - generic [ref=e73]: + - textbox "Rate name" [ref=e75] + - combobox [ref=e76]: + - option "flat" [selected] + - option "weight" + - option "price" + - option "carrier" + - spinbutton [ref=e78] + - button "Add rate" [ref=e79]: + - img [ref=e81] + - generic [ref=e84]: Add rate + - generic [ref=e85]: + - generic [ref=e86]: + - generic [ref=e87]: Rest of World US, GB, FR, AT, CH, IT, ES, NL + - button "Remove zone" [ref=e88]: + - img [ref=e90] + - generic [ref=e93]: Remove zone + - list [ref=e94]: + - listitem [ref=e95]: + - generic [ref=e96]: International (flat) - 1499 cents + - button "Remove" [ref=e97]: + - img [ref=e99] + - generic [ref=e102]: Remove + - generic [ref=e103]: + - textbox "Rate name" [ref=e105] + - combobox [ref=e106]: + - option "flat" [selected] + - option "weight" + - option "price" + - option "carrier" + - spinbutton [ref=e108] + - button "Add rate" [ref=e109]: + - img [ref=e111] + - generic [ref=e114]: Add rate \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-47-18-629Z.yml b/.playwright-mcp/page-2026-04-18T08-47-18-629Z.yml new file mode 100644 index 00000000..916efc2f --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-47-18-629Z.yml @@ -0,0 +1,60 @@ +- generic [ref=e2]: + - complementary [ref=e3]: + - generic [ref=e4]: Acme Fashion + - navigation [ref=e5]: + - link "Dashboard" [ref=e6] [cursor=pointer]: + - /url: http://shop.test/admin + - link "Orders" [ref=e7] [cursor=pointer]: + - /url: http://shop.test/admin/orders + - link "Products" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/admin/products + - link "Collections" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/admin/collections + - link "Customers" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/admin/customers + - link "Discounts" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/admin/discounts + - link "Analytics" [ref=e12] [cursor=pointer]: + - /url: http://shop.test/admin/analytics + - generic [ref=e13]: Content + - link "Pages" [ref=e14] [cursor=pointer]: + - /url: http://shop.test/admin/content/pages + - link "Navigation" [ref=e15] [cursor=pointer]: + - /url: http://shop.test/admin/content/navigation + - link "Themes" [ref=e16] [cursor=pointer]: + - /url: http://shop.test/admin/content/themes + - generic [ref=e17]: System + - link "Settings" [ref=e18] [cursor=pointer]: + - /url: http://shop.test/admin/settings + - link "Search" [ref=e19] [cursor=pointer]: + - /url: http://shop.test/admin/search/settings + - link "Apps" [ref=e20] [cursor=pointer]: + - /url: http://shop.test/admin/apps + - link "Developers" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/admin/developers + - generic [ref=e22]: + - banner [ref=e23]: + - generic [ref=e25]: Admin + - generic [ref=e26]: + - paragraph [ref=e27]: owner@acme.test + - button "Sign out" [ref=e29]: + - img [ref=e31] + - generic [ref=e34]: Sign out + - main [ref=e35]: + - generic [ref=e36]: + - generic [ref=e37]: + - generic [ref=e38]: Discounts + - link "New discount" [ref=e39] [cursor=pointer]: + - /url: http://shop.test/admin/discounts/new + - textbox "Search by code..." [ref=e41] + - table [ref=e44]: + - rowgroup [ref=e45]: + - row "Code Type Value Status Actions" [ref=e46]: + - columnheader "Code" [ref=e47] + - columnheader "Type" [ref=e48] + - columnheader "Value" [ref=e49] + - columnheader "Status" [ref=e50] + - columnheader "Actions" [ref=e51] + - rowgroup [ref=e52]: + - row "No discounts yet." [ref=e53]: + - cell "No discounts yet." [ref=e54] \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T08-47-23-095Z.yml b/.playwright-mcp/page-2026-04-18T08-47-23-095Z.yml new file mode 100644 index 00000000..cf7e4975 --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T08-47-23-095Z.yml @@ -0,0 +1,69 @@ +- generic [ref=e2]: + - complementary [ref=e3]: + - generic [ref=e4]: Acme Fashion + - navigation [ref=e5]: + - link "Dashboard" [ref=e6] [cursor=pointer]: + - /url: http://shop.test/admin + - link "Orders" [ref=e7] [cursor=pointer]: + - /url: http://shop.test/admin/orders + - link "Products" [ref=e8] [cursor=pointer]: + - /url: http://shop.test/admin/products + - link "Collections" [ref=e9] [cursor=pointer]: + - /url: http://shop.test/admin/collections + - link "Customers" [ref=e10] [cursor=pointer]: + - /url: http://shop.test/admin/customers + - link "Discounts" [ref=e11] [cursor=pointer]: + - /url: http://shop.test/admin/discounts + - link "Analytics" [ref=e12] [cursor=pointer]: + - /url: http://shop.test/admin/analytics + - generic [ref=e13]: Content + - link "Pages" [ref=e14] [cursor=pointer]: + - /url: http://shop.test/admin/content/pages + - link "Navigation" [ref=e15] [cursor=pointer]: + - /url: http://shop.test/admin/content/navigation + - link "Themes" [ref=e16] [cursor=pointer]: + - /url: http://shop.test/admin/content/themes + - generic [ref=e17]: System + - link "Settings" [ref=e18] [cursor=pointer]: + - /url: http://shop.test/admin/settings + - link "Search" [ref=e19] [cursor=pointer]: + - /url: http://shop.test/admin/search/settings + - link "Apps" [ref=e20] [cursor=pointer]: + - /url: http://shop.test/admin/apps + - link "Developers" [ref=e21] [cursor=pointer]: + - /url: http://shop.test/admin/developers + - generic [ref=e22]: + - banner [ref=e23]: + - generic [ref=e25]: Admin + - generic [ref=e26]: + - paragraph [ref=e27]: owner@acme.test + - button "Sign out" [ref=e29]: + - img [ref=e31] + - generic [ref=e34]: Sign out + - main [ref=e35]: + - generic [ref=e36]: + - generic [ref=e37]: + - generic [ref=e38]: Analytics + - generic [ref=e39]: + - generic [ref=e40]: + - generic [ref=e41]: From + - textbox "From" [ref=e43]: 2026-03-20 + - generic [ref=e45]: + - generic [ref=e46]: To + - textbox "To" [ref=e48]: 2026-04-18 + - generic [ref=e50]: + - generic [ref=e51]: + - paragraph [ref=e52]: Revenue + - generic [ref=e53]: "0.00" + - generic [ref=e54]: + - paragraph [ref=e55]: Orders + - generic [ref=e56]: "0" + - generic [ref=e57]: + - paragraph [ref=e58]: Visits + - generic [ref=e59]: "0" + - generic [ref=e60]: + - paragraph [ref=e61]: AOV + - generic [ref=e62]: "0.00" + - generic [ref=e63]: + - generic [ref=e64]: Daily breakdown + - paragraph [ref=e65]: No data yet. \ No newline at end of file diff --git a/.playwright-mcp/page-2026-04-18T10-59-02-335Z.yml b/.playwright-mcp/page-2026-04-18T10-59-02-335Z.yml new file mode 100644 index 00000000..ddcd336e --- /dev/null +++ b/.playwright-mcp/page-2026-04-18T10-59-02-335Z.yml @@ -0,0 +1,59 @@ +- generic [active] [ref=e1]: + - link "Skip to content" [ref=e2] [cursor=pointer]: + - /url: "#main-content" + - generic [ref=e3]: Free shipping on orders over 50 + - banner [ref=e4]: + - generic [ref=e5]: + - link "Acme Fashion" [ref=e6] [cursor=pointer]: + - /url: https://2026-04-16-claude-code-opus-4-7-xhigh.agentic-engineers.dev + - navigation [ref=e7]: + - link "Collections" [ref=e8] [cursor=pointer]: + - /url: https://2026-04-16-claude-code-opus-4-7-xhigh.agentic-engineers.dev/collections + - link "Search" [ref=e9] [cursor=pointer]: + - /url: https://2026-04-16-claude-code-opus-4-7-xhigh.agentic-engineers.dev/search + - link "Sign in" [ref=e10] [cursor=pointer]: + - /url: https://2026-04-16-claude-code-opus-4-7-xhigh.agentic-engineers.dev/account/login + - link "Cart" [ref=e11] [cursor=pointer]: + - /url: https://2026-04-16-claude-code-opus-4-7-xhigh.agentic-engineers.dev/cart + - main [ref=e12]: + - generic [ref=e13]: + - generic [ref=e14]: + - generic [ref=e15]: Elevated essentials + - paragraph [ref=e16]: Timeless pieces for modern wardrobes. + - link "Shop the collection" [ref=e18] [cursor=pointer]: + - /url: /collections + - generic [ref=e19]: + - generic [ref=e20]: Featured collections + - link "Featured" [ref=e22] [cursor=pointer]: + - /url: https://2026-04-16-claude-code-opus-4-7-xhigh.agentic-engineers.dev/collections/featured + - generic [ref=e23]: Featured + - generic [ref=e24]: + - generic [ref=e25]: Featured products + - generic [ref=e26]: + - link "Organic Cotton T-Shirt" [ref=e28] [cursor=pointer]: + - /url: https://2026-04-16-claude-code-opus-4-7-xhigh.agentic-engineers.dev/products/organic-cotton-t-shirt + - img [ref=e31] + - generic [ref=e34]: Organic Cotton T-Shirt + - link "Classic Pullover Hoodie" [ref=e36] [cursor=pointer]: + - /url: https://2026-04-16-claude-code-opus-4-7-xhigh.agentic-engineers.dev/products/classic-pullover-hoodie + - img [ref=e39] + - generic [ref=e42]: Classic Pullover Hoodie + - contentinfo [ref=e43]: + - generic [ref=e44]: © 2026 Acme Fashion. All rights reserved. + - generic: + - generic: + - dialog "Shopping cart": + - banner: + - generic: Your Cart (0) + - button "Close cart": + - generic: + - img + - img + - generic: + - generic: + - img + - paragraph: Your cart is empty + - button "Continue shopping": + - generic: + - img + - generic: Continue shopping \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md index 296f2af0..30ccb8ad 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -23,3 +23,227 @@ The complete specification is in `specs/`. Start with `specs/09-IMPLEMENTATION-R - `specs/07-SEEDERS-AND-TEST-DATA.md` - Seeders and test data - `specs/08-PLAYWRIGHT-E2E-PLAN.md` - E2E browser tests - `specs/09-IMPLEMENTATION-ROADMAP.md` - Implementation roadmap + +=== + + +=== foundation rules === + +# Laravel Boost Guidelines + +The Laravel Boost guidelines are specifically curated by Laravel maintainers for this application. These guidelines should be followed closely to ensure the best experience when building Laravel applications. + +## Foundational Context + +This application is a Laravel application and its main Laravel ecosystems package & versions are below. You are an expert with them all. Ensure you abide by these specific packages & versions. + +- php - 8.4 +- laravel/fortify (FORTIFY) - v1 +- laravel/framework (LARAVEL) - v12 +- laravel/prompts (PROMPTS) - v0 +- livewire/flux (FLUXUI_FREE) - v2 +- livewire/livewire (LIVEWIRE) - v4 +- laravel/boost (BOOST) - v2 +- laravel/mcp (MCP) - v0 +- laravel/pail (PAIL) - v1 +- laravel/pint (PINT) - v1 +- laravel/sail (SAIL) - v1 +- pestphp/pest (PEST) - v4 +- phpunit/phpunit (PHPUNIT) - v12 +- tailwindcss (TAILWINDCSS) - v4 + +## Skills Activation + +This project has domain-specific skills available. You MUST activate the relevant skill whenever you work in that domain—don't wait until you're stuck. + +- `developing-with-fortify` — Laravel Fortify headless authentication backend development. Activate when implementing authentication features including login, registration, password reset, email verification, two-factor authentication (2FA/TOTP), profile updates, headless auth, authentication scaffolding, or auth guards in Laravel applications. +- `laravel-best-practices` — Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strategies, authorization and security patterns, validation, error handling, queue and job configuration, route definitions, and architectural decisions. Also use for Laravel code reviews and refactoring existing Laravel code to follow best practices. Covers any task involving Laravel backend PHP code patterns. +- `fluxui-development` — Use this skill for Flux UI development in Livewire applications only. Trigger when working with components, building or customizing Livewire component UIs, creating forms, modals, tables, or other interactive elements. Covers: flux: components (buttons, inputs, modals, forms, tables, date-pickers, kanban, badges, tooltips, etc.), component composition, Tailwind CSS styling, Heroicons/Lucide icon integration, validation patterns, responsive design, and theming. Do not use for non-Livewire frameworks or non-component styling. +- `livewire-development` — Use for any task or question involving Livewire. Activate if user mentions Livewire, wire: directives, or Livewire-specific concepts like wire:model, wire:click, wire:sort, or islands, invoke this skill. Covers building new components, debugging reactivity issues, real-time form validation, drag-and-drop, loading states, migrating from Livewire 3 to 4, converting component formats (SFC/MFC/class-based), and performance optimization. Do not use for non-Livewire reactive UI (React, Vue, Alpine-only, Inertia.js) or standard Laravel forms without Livewire. +- `pest-testing` — Use this skill for Pest PHP testing in Laravel projects only. Trigger whenever any test is being written, edited, fixed, or refactored — including fixing tests that broke after a code change, adding assertions, converting PHPUnit to Pest, adding datasets, and TDD workflows. Always activate when the user asks how to write something in Pest, mentions test files or directories (tests/Feature, tests/Unit, tests/Browser), or needs browser testing, smoke testing multiple pages for JS errors, or architecture tests. Covers: test()/it()/expect() syntax, datasets, mocking, browser testing (visit/click/fill), smoke testing, arch(), Livewire component tests, RefreshDatabase, and all Pest 4 features. Do not use for factories, seeders, migrations, controllers, models, or non-test PHP code. +- `tailwindcss-development` — Always invoke when the user's message includes 'tailwind' in any form. Also invoke for: building responsive grid layouts (multi-column card grids, product grids), flex/grid page structures (dashboards with sidebars, fixed topbars, mobile-toggle navs), styling UI components (cards, tables, navbars, pricing sections, forms, inputs, badges), adding dark mode variants, fixing spacing or typography, and Tailwind v3/v4 work. The core use case: writing or fixing Tailwind utility classes in HTML templates (Blade, JSX, Vue). Skip for backend PHP logic, database queries, API routes, JavaScript with no HTML/CSS component, CSS file audits, build tool configuration, and vanilla CSS. + +## Conventions + +- You must follow all existing code conventions used in this application. When creating or editing a file, check sibling files for the correct structure, approach, and naming. +- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`. +- Check for existing components to reuse before writing a new one. + +## Verification Scripts + +- Do not create verification scripts or tinker when tests cover that functionality and prove they work. Unit and feature tests are more important. + +## Application Structure & Architecture + +- Stick to existing directory structure; don't create new base folders without approval. +- Do not change the application's dependencies without approval. + +## Frontend Bundling + +- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `npm run build`, `npm run dev`, or `composer run dev`. Ask them. + +## Documentation Files + +- You must only create documentation files if explicitly requested by the user. + +## Replies + +- Be concise in your explanations - focus on what's important rather than explaining obvious details. + +=== boost rules === + +# Laravel Boost + +## Tools + +- Laravel Boost is an MCP server with tools designed specifically for this application. Prefer Boost tools over manual alternatives like shell commands or file reads. +- Use `database-query` to run read-only queries against the database instead of writing raw SQL in tinker. +- Use `database-schema` to inspect table structure before writing migrations or models. +- Use `get-absolute-url` to resolve the correct scheme, domain, and port for project URLs. Always use this before sharing a URL with the user. +- Use `browser-logs` to read browser logs, errors, and exceptions. Only recent logs are useful, ignore old entries. + +## Searching Documentation (IMPORTANT) + +- Always use `search-docs` before making code changes. Do not skip this step. It returns version-specific docs based on installed packages automatically. +- Pass a `packages` array to scope results when you know which packages are relevant. +- Use multiple broad, topic-based queries: `['rate limiting', 'routing rate limiting', 'routing']`. Expect the most relevant results first. +- Do not add package names to queries because package info is already shared. Use `test resource table`, not `filament 4 test resource table`. + +### Search Syntax + +1. Use words for auto-stemmed AND logic: `rate limit` matches both "rate" AND "limit". +2. Use `"quoted phrases"` for exact position matching: `"infinite scroll"` requires adjacent words in order. +3. Combine words and phrases for mixed queries: `middleware "rate limit"`. +4. Use multiple queries for OR logic: `queries=["authentication", "middleware"]`. + +## Artisan + +- Run Artisan commands directly via the command line (e.g., `php artisan route:list`). Use `php artisan list` to discover available commands and `php artisan [command] --help` to check parameters. +- Inspect routes with `php artisan route:list`. Filter with: `--method=GET`, `--name=users`, `--path=api`, `--except-vendor`, `--only-vendor`. +- Read configuration values using dot notation: `php artisan config:show app.name`, `php artisan config:show database.default`. Or read config files directly from the `config/` directory. +- To check environment variables, read the `.env` file directly. + +## Tinker + +- Execute PHP in app context for debugging and testing code. Do not create models without user approval, prefer tests with factories instead. Prefer existing Artisan commands over custom tinker code. +- Always use single quotes to prevent shell expansion: `php artisan tinker --execute 'Your::code();'` + - Double quotes for PHP strings inside: `php artisan tinker --execute 'User::where("active", true)->count();'` + +=== php rules === + +# PHP + +- Always use curly braces for control structures, even for single-line bodies. +- Use PHP 8 constructor property promotion: `public function __construct(public GitHub $github) { }`. Do not leave empty zero-parameter `__construct()` methods unless the constructor is private. +- Use explicit return type declarations and type hints for all method parameters: `function isAccessible(User $user, ?string $path = null): bool` +- Use TitleCase for Enum keys: `FavoritePerson`, `BestLake`, `Monthly`. +- Prefer PHPDoc blocks over inline comments. Only add inline comments for exceptionally complex logic. +- Use array shape type definitions in PHPDoc blocks. + +=== deployments rules === + +# Deployment + +- Laravel can be deployed using [Laravel Cloud](https://cloud.laravel.com/), which is the fastest way to deploy and scale production Laravel applications. + +=== herd rules === + +# Laravel Herd + +- The application is served by Laravel Herd at `https?://[kebab-case-project-dir].test`. Use the `get-absolute-url` tool to generate valid URLs. Never run commands to serve the site. It is always available. +- Use the `herd` CLI to manage services, PHP versions, and sites (e.g. `herd sites`, `herd services:start `, `herd php:list`). Run `herd list` to discover all available commands. + +=== tests rules === + +# Test Enforcement + +- Every change must be programmatically tested. Write a new test or update an existing test, then run the affected tests to make sure they pass. +- Run the minimum number of tests needed to ensure code quality and speed. Use `php artisan test --compact` with a specific filename or filter. + +=== fortify/core rules === + +# Laravel Fortify + +- Fortify is a headless authentication backend that provides authentication routes and controllers for Laravel applications. +- IMPORTANT: Always use the `search-docs` tool for detailed Laravel Fortify patterns and documentation. +- IMPORTANT: Activate `developing-with-fortify` skill when working with Fortify authentication features. + +=== laravel/core rules === + +# Do Things the Laravel Way + +- Use `php artisan make:` commands to create new files (i.e. migrations, controllers, models, etc.). You can list available Artisan commands using `php artisan list` and check their parameters with `php artisan [command] --help`. +- If you're creating a generic PHP class, use `php artisan make:class`. +- Pass `--no-interaction` to all Artisan commands to ensure they work without user input. You should also pass the correct `--options` to ensure correct behavior. + +### Model Creation + +- When creating new models, create useful factories and seeders for them too. Ask the user if they need any other things, using `php artisan make:model --help` to check the available options. + +## APIs & Eloquent Resources + +- For APIs, default to using Eloquent API Resources and API versioning unless existing API routes do not, then you should follow existing application convention. + +## URL Generation + +- When generating links to other pages, prefer named routes and the `route()` function. + +## Testing + +- When creating models for tests, use the factories for the models. Check if the factory has custom states that can be used before manually setting up the model. +- Faker: Use methods such as `$this->faker->word()` or `fake()->randomDigit()`. Follow existing conventions whether to use `$this->faker` or `fake()`. +- When creating tests, make use of `php artisan make:test [options] {name}` to create a feature test, and pass `--unit` to create a unit test. Most tests should be feature tests. + +## Vite Error + +- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run `npm run build` or ask the user to run `npm run dev` or `composer run dev`. + +=== laravel/v12 rules === + +# Laravel 12 + +- CRITICAL: ALWAYS use `search-docs` tool for version-specific Laravel documentation and updated code examples. +- Since Laravel 11, Laravel has a new streamlined file structure which this project uses. + +## Laravel 12 Structure + +- In Laravel 12, middleware are no longer registered in `app/Http/Kernel.php`. +- Middleware are configured declaratively in `bootstrap/app.php` using `Application::configure()->withMiddleware()`. +- `bootstrap/app.php` is the file to register middleware, exceptions, and routing files. +- `bootstrap/providers.php` contains application specific service providers. +- The `app/Console/Kernel.php` file no longer exists; use `bootstrap/app.php` or `routes/console.php` for console configuration. +- Console commands in `app/Console/Commands/` are automatically available and do not require manual registration. + +## Database + +- When modifying a column, the migration must include all of the attributes that were previously defined on the column. Otherwise, they will be dropped and lost. +- Laravel 12 allows limiting eagerly loaded records natively, without external packages: `$query->latest()->limit(10);`. + +### Models + +- Casts can and likely should be set in a `casts()` method on a model rather than the `$casts` property. Follow existing conventions from other models. + +=== livewire/core rules === + +# Livewire + +- Livewire allow to build dynamic, reactive interfaces in PHP without writing JavaScript. +- You can use Alpine.js for client-side interactions instead of JavaScript frameworks. +- Keep state server-side so the UI reflects it. Validate and authorize in actions as you would in HTTP requests. + +=== pint/core rules === + +# Laravel Pint Code Formatter + +- If you have modified any PHP files, you must run `vendor/bin/pint --dirty --format agent` before finalizing changes to ensure your code matches the project's expected style. +- Do not run `vendor/bin/pint --test --format agent`, simply run `vendor/bin/pint --format agent` to fix any formatting issues. + +=== pest/core rules === + +## Pest + +- This project uses Pest for testing. Create tests: `php artisan make:test --pest {name}`. +- Run tests: `php artisan test --compact` or filter: `php artisan test --compact --filter=testName`. +- Do NOT delete tests without approval. + + diff --git a/README.md b/README.md new file mode 100644 index 00000000..a5316efa --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +Your mission is to implement an entire shop system based on the specifications im specs/*. You must use sub-agents for role play (e.g. frontend-, backend-deveoper, QA Analyst, QA Engineer, etc). You must do in one go without stopping. You must test everything via Pest (unit, and functional tests). You must also additional simulate user behaviour using the Playwright MPC and confirm that all acceptance criterias are met. If you find bugs, you must fix them. The result is a perfect shop system. All requirements are perfectly implemented. All acceptance criterias are met, tested and confirmed by you. + +Continuously keep track of the progress in specs/progress.md Commit your progress after every relevant iteration with a meaningful message. + +When implementation is fully done, then make a full review meeting with Playwright in Chrome and showcase all features (customer- and admin-side) to me. In case bugs appear, you must fix them all and restart the review meeting. Shop is running at http://shop.test/. + +Don't re-use any existing implementation in another branch. Build it from scratch. diff --git a/app/Enums/CheckoutStatus.php b/app/Enums/CheckoutStatus.php new file mode 100644 index 00000000..5ccd6d53 --- /dev/null +++ b/app/Enums/CheckoutStatus.php @@ -0,0 +1,14 @@ +validate([ + 'email' => ['required', 'email'], + 'password' => ['required', 'string'], + ]); + + if (! Auth::guard('web')->attempt($credentials, true)) { + return back()->withErrors(['email' => 'These credentials do not match our records.'])->onlyInput('email'); + } + + $request->session()->regenerate(); + $user = $request->user(); + $storeId = $user->stores()->orderBy('stores.id')->value('stores.id'); + + if ($storeId) { + $request->session()->put('current_store_id', $storeId); + } + + $user->update(['last_login_at' => now()]); + + return redirect()->route('admin.dashboard'); + } + + public function logout(Request $request): RedirectResponse + { + Auth::guard('web')->logout(); + $request->session()->invalidate(); + $request->session()->regenerateToken(); + + return redirect()->route('admin.login'); + } +} diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php new file mode 100644 index 00000000..42889551 --- /dev/null +++ b/app/Http/Controllers/AdminController.php @@ -0,0 +1,277 @@ +latest()->limit(5)->get(); + $sales = Order::query()->sum('total_amount'); + $customers = Customer::query()->count(); + $products = Product::query()->count(); + + return view('admin.dashboard', compact('orders', 'sales', 'customers', 'products')); + } + + public function products(Request $request): View + { + $products = Product::query() + ->with('defaultVariant') + ->when($request->query('q'), fn ($query, $search) => $query->where('title', 'like', '%'.$search.'%')) + ->when($request->query('status'), fn ($query, $status) => $query->where('status', $status)) + ->latest() + ->paginate(20); + + return view('admin.products.index', compact('products')); + } + + public function createProduct(): View + { + return view('admin.products.form', ['product' => new Product]); + } + + public function storeProduct(Request $request): RedirectResponse + { + $validated = $request->validate([ + 'title' => ['required', 'string', 'max:255'], + 'price_amount' => ['required', 'numeric', 'min:0'], + 'status' => ['required', 'in:draft,active,archived'], + 'description_html' => ['nullable', 'string'], + ]); + + $product = Product::query()->create([ + 'title' => $validated['title'], + 'handle' => Str::slug($validated['title']).'-'.strtolower(Str::random(4)), + 'status' => $validated['status'], + 'description_html' => $validated['description_html'] ?: '

'.$validated['title'].'

', + 'vendor' => 'Acme', + 'product_type' => 'Admin Created', + 'tags' => ['admin'], + 'published_at' => $validated['status'] === 'active' ? now() : null, + ]); + + $variant = $product->variants()->create([ + 'price_amount' => (int) round(((float) $validated['price_amount']) * 100), + 'currency' => app('current_store')->default_currency, + 'is_default' => true, + 'sku' => strtoupper(Str::slug($validated['title'])).'-DEFAULT', + ]); + $variant->inventoryItem()->create(['store_id' => app('current_store')->id, 'quantity_available' => 10, 'policy' => 'deny']); + + return redirect()->route('admin.products.index')->with('status', 'Product saved successfully.'); + } + + public function editProduct(Product $product): View + { + $product->load('defaultVariant'); + + return view('admin.products.form', compact('product')); + } + + public function updateProduct(Request $request, Product $product): RedirectResponse + { + $validated = $request->validate([ + 'title' => ['required', 'string', 'max:255'], + 'price_amount' => ['required', 'numeric', 'min:0'], + 'status' => ['required', 'in:draft,active,archived'], + 'description_html' => ['nullable', 'string'], + ]); + + $product->update([ + 'title' => $validated['title'], + 'status' => $validated['status'], + 'description_html' => $validated['description_html'], + 'published_at' => $validated['status'] === 'active' ? now() : null, + ]); + $product->defaultVariant()->update(['price_amount' => (int) round(((float) $validated['price_amount']) * 100)]); + + return redirect()->route('admin.products.index')->with('status', 'Product saved successfully.'); + } + + public function archiveProduct(Product $product): RedirectResponse + { + $product->update(['status' => 'archived', 'published_at' => null]); + + return back()->with('status', 'Product archived.'); + } + + public function orders(Request $request): View + { + $orders = Order::query() + ->with('customer') + ->when($request->query('status'), fn ($query, $status) => $query->where('financial_status', $status)) + ->latest() + ->paginate(20); + + return view('admin.orders.index', compact('orders')); + } + + public function order(Order $order): View + { + $order->load('lines', 'payments', 'customer.addresses', 'fulfillments.lines'); + + return view('admin.orders.show', compact('order')); + } + + public function confirmPayment(Order $order, CheckoutService $checkoutService): RedirectResponse + { + $checkoutService->confirmBankTransfer($order); + + return back()->with('status', 'Payment confirmed.'); + } + + public function refund(Request $request, Order $order, AdminOrderService $orders): RedirectResponse + { + $validated = $request->validate(['amount' => ['required', 'numeric', 'min:0.01']]); + + try { + $orders->refund($order, (int) round(((float) $validated['amount']) * 100)); + } catch (ValidationException $exception) { + return back()->withErrors($exception->errors()); + } + + return back()->with('status', 'Refund processed.'); + } + + public function fulfill(Order $order, AdminOrderService $orders): RedirectResponse + { + try { + $orders->fulfill($order->load('lines')); + } catch (ValidationException $exception) { + return back()->withErrors($exception->errors()); + } + + return back()->with('status', 'Fulfillment created.'); + } + + public function markShipped(Fulfillment $fulfillment, AdminOrderService $orders): RedirectResponse + { + $orders->markShipped($fulfillment); + + return back()->with('status', 'Fulfillment marked shipped.'); + } + + public function markDelivered(Fulfillment $fulfillment, AdminOrderService $orders): RedirectResponse + { + $orders->markDelivered($fulfillment); + + return back()->with('status', 'Fulfillment marked delivered.'); + } + + public function customers(): View + { + $customers = Customer::query()->withCount('orders')->latest()->paginate(20); + + return view('admin.customers.index', compact('customers')); + } + + public function customer(Customer $customer): View + { + $customer->load('orders', 'addresses'); + + return view('admin.customers.show', compact('customer')); + } + + public function discounts(): View + { + $discounts = Discount::query()->latest()->paginate(20); + + return view('admin.discounts.index', compact('discounts')); + } + + public function storeDiscount(Request $request): RedirectResponse + { + $validated = $request->validate([ + 'code' => ['required', 'string', 'max:64'], + 'type' => ['required', 'in:percentage,fixed_amount,free_shipping'], + 'value' => ['nullable', 'numeric', 'min:0'], + ]); + + Discount::query()->updateOrCreate( + ['code' => strtoupper($validated['code'])], + [ + 'type' => $validated['type'], + 'value_bps' => $validated['type'] === 'percentage' ? (int) round(((float) ($validated['value'] ?? 0)) * 100) : 0, + 'value_amount' => $validated['type'] === 'fixed_amount' ? (int) round(((float) ($validated['value'] ?? 0)) * 100) : 0, + 'starts_at' => now()->subMinute(), + 'ends_at' => now()->addYear(), + 'is_active' => true, + ], + ); + + return back()->with('status', 'Discount saved.'); + } + + public function settings(): View + { + $store = app('current_store')->load('domains', 'settings'); + $zones = ShippingZone::query()->with('rates')->get(); + $tax = TaxSettings::query()->whereKey($store->id)->first(); + + return view('admin.settings.index', compact('store', 'zones', 'tax')); + } + + public function updateSettings(Request $request): RedirectResponse + { + $validated = $request->validate(['name' => ['required', 'string', 'max:255']]); + app('current_store')->update(['name' => $validated['name']]); + + return back()->with('status', 'Settings saved.'); + } + + public function addShippingRate(Request $request): RedirectResponse + { + $validated = $request->validate([ + 'shipping_zone_id' => ['required', 'integer', 'exists:shipping_zones,id'], + 'name' => ['required', 'string', 'max:255'], + 'price_amount' => ['required', 'numeric', 'min:0'], + ]); + + ShippingRate::query()->create([ + 'shipping_zone_id' => $validated['shipping_zone_id'], + 'name' => $validated['name'], + 'price_amount' => (int) round(((float) $validated['price_amount']) * 100), + ]); + + return back()->with('status', 'Shipping rate added.'); + } + + public function toggleTax(): RedirectResponse + { + $tax = TaxSettings::query()->whereKey(app('current_store')->id)->firstOrFail(); + $tax->update(['prices_include_tax' => ! $tax->prices_include_tax]); + + return back()->with('status', 'Tax settings updated.'); + } + + public function simple(string $section): View + { + $records = match ($section) { + 'collections' => Collection::query()->latest()->get(), + 'pages' => Page::query()->latest()->get(), + 'analytics' => Order::query()->latest()->get(), + default => collect(), + }; + + return view('admin.simple', compact('section', 'records')); + } +} diff --git a/app/Http/Controllers/CartController.php b/app/Http/Controllers/CartController.php new file mode 100644 index 00000000..5362ede2 --- /dev/null +++ b/app/Http/Controllers/CartController.php @@ -0,0 +1,75 @@ +current(); + $totals = $pricing->cartTotals($cart); + + return view('storefront.cart', compact('cart', 'totals')); + } + + public function add(Request $request, CartService $cartService): RedirectResponse + { + $validated = $request->validate([ + 'variant_id' => ['required', 'integer', 'exists:product_variants,id'], + 'quantity' => ['required', 'integer', 'min:1'], + ]); + + $variant = ProductVariant::query()->with('product.media', 'optionValues', 'inventoryItem')->findOrFail($validated['variant_id']); + $cartService->add($variant, (int) $validated['quantity']); + + return redirect()->route('cart.show')->with('status', 'Product added to cart.'); + } + + public function update(Request $request, int $line, CartService $cartService): RedirectResponse + { + $validated = $request->validate(['quantity' => ['required', 'integer', 'min:0']]); + $cartService->updateLine($line, (int) $validated['quantity']); + + return back()->with('status', 'Cart updated.'); + } + + public function discount(Request $request, CartService $cartService): RedirectResponse + { + $validated = $request->validate(['discount_code' => ['required', 'string', 'max:64']]); + + try { + $cartService->applyDiscount($validated['discount_code']); + } catch (ValidationException $exception) { + return back()->withErrors($exception->errors()); + } + + return back()->with('status', 'Discount applied.'); + } + + public function removeDiscount(CartService $cartService): RedirectResponse + { + $cartService->removeDiscount(); + + return back()->with('status', 'Discount removed.'); + } + + public function checkout(CartService $cartService, CheckoutService $checkoutService): RedirectResponse + { + try { + $checkout = $checkoutService->start($cartService->current()); + } catch (ValidationException $exception) { + return back()->withErrors($exception->errors()); + } + + return redirect()->route('checkout.show', $checkout); + } +} diff --git a/app/Http/Controllers/CheckoutController.php b/app/Http/Controllers/CheckoutController.php new file mode 100644 index 00000000..63c3552e --- /dev/null +++ b/app/Http/Controllers/CheckoutController.php @@ -0,0 +1,62 @@ +load('cart.lines.variant.product'); + $totals = $checkout->totals_json ?: $pricing->cartTotals($checkout->cart); + + return view('storefront.checkout.show', compact('checkout', 'totals')); + } + + public function update(Request $request, Checkout $checkout, CheckoutService $checkoutService): RedirectResponse + { + $validated = $request->validate([ + 'email' => ['required', 'email'], + 'name' => ['required', 'string', 'max:255'], + 'address1' => ['required', 'string', 'max:255'], + 'city' => ['required', 'string', 'max:255'], + 'postal_code' => ['required', 'string', 'max:32'], + 'country_code' => ['required', 'string', 'size:2'], + 'payment_method' => ['required', 'in:credit_card,paypal,bank_transfer'], + 'card_number' => ['nullable', 'string'], + ]); + + try { + $checkout = $checkoutService->address($checkout, $validated['email'], [ + 'name' => $validated['name'], + 'address1' => $validated['address1'], + 'city' => $validated['city'], + 'postal_code' => $validated['postal_code'], + 'country_code' => strtoupper($validated['country_code']), + ]); + $checkout = $checkoutService->payment($checkout, $validated['payment_method']); + $order = $checkoutService->complete($checkout, $validated); + } catch (ValidationException $exception) { + return back()->withErrors($exception->errors())->withInput(); + } + + return redirect()->route('checkout.confirmation', $order->order_number); + } + + public function confirmation(string $orderNumber): View + { + $order = \App\Models\Order::query() + ->where('order_number', $orderNumber) + ->with('lines', 'payments') + ->firstOrFail(); + + return view('storefront.checkout.confirmation', compact('order')); + } +} diff --git a/app/Http/Controllers/CustomerAccountController.php b/app/Http/Controllers/CustomerAccountController.php new file mode 100644 index 00000000..fe9d7e84 --- /dev/null +++ b/app/Http/Controllers/CustomerAccountController.php @@ -0,0 +1,123 @@ +validate([ + 'email' => ['required', 'email'], + 'password' => ['required', 'string'], + ]); + + if (! Auth::guard('customer')->attempt($credentials, true)) { + return back()->withErrors(['email' => 'These credentials do not match our records.'])->onlyInput('email'); + } + + $request->session()->regenerate(); + Auth::guard('customer')->user()->update(['last_login_at' => now()]); + + return redirect()->route('account.dashboard'); + } + + public function register(): View + { + return view('storefront.account.register'); + } + + public function store(Request $request): RedirectResponse + { + $validated = $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'email' => ['required', 'email', 'max:255', 'unique:customers,email,NULL,id,store_id,'.app('current_store')->id], + 'password' => ['required', 'confirmed', Password::min(8)], + ]); + + $customer = Customer::query()->create([ + 'store_id' => app('current_store')->id, + 'name' => $validated['name'], + 'email' => $validated['email'], + 'password' => $validated['password'], + ]); + + Auth::guard('customer')->login($customer); + + return redirect()->route('account.dashboard'); + } + + public function dashboard(): View + { + $orders = Auth::guard('customer')->user()->orders()->latest()->limit(5)->get(); + + return view('storefront.account.dashboard', compact('orders')); + } + + public function orders(): View + { + $orders = Auth::guard('customer')->user()->orders()->latest()->get(); + + return view('storefront.account.orders', compact('orders')); + } + + public function order(string $orderNumber): View + { + $order = Auth::guard('customer')->user()->orders()->where('order_number', $orderNumber)->with('lines')->firstOrFail(); + + return view('storefront.account.order', compact('order')); + } + + public function addresses(): View + { + $addresses = Auth::guard('customer')->user()->addresses()->latest()->get(); + + return view('storefront.account.addresses', compact('addresses')); + } + + public function saveAddress(Request $request): RedirectResponse + { + $validated = $request->validate([ + 'id' => ['nullable', 'integer'], + 'name' => ['required', 'string', 'max:255'], + 'address1' => ['required', 'string', 'max:255'], + 'city' => ['required', 'string', 'max:255'], + 'postal_code' => ['required', 'string', 'max:32'], + 'country_code' => ['required', 'string', 'size:2'], + ]); + + CustomerAddress::query()->updateOrCreate( + ['id' => $validated['id'] ?? null, 'customer_id' => Auth::guard('customer')->id()], + [ + 'store_id' => app('current_store')->id, + 'name' => $validated['name'], + 'address1' => $validated['address1'], + 'city' => $validated['city'], + 'postal_code' => $validated['postal_code'], + 'country_code' => strtoupper($validated['country_code']), + ], + ); + + return back()->with('status', 'Address saved.'); + } + + public function logout(Request $request): RedirectResponse + { + Auth::guard('customer')->logout(); + $request->session()->regenerateToken(); + + return redirect()->route('account.login'); + } +} diff --git a/app/Http/Controllers/StorefrontController.php b/app/Http/Controllers/StorefrontController.php new file mode 100644 index 00000000..c14c066e --- /dev/null +++ b/app/Http/Controllers/StorefrontController.php @@ -0,0 +1,88 @@ +with('defaultVariant', 'media') + ->where('status', ProductStatus::Active) + ->latest() + ->limit(8) + ->get(); + + $collections = Collection::query() + ->where('is_published', true) + ->orderBy('title') + ->get(); + + return view('storefront.home', compact('products', 'collections')); + } + + public function collections(): View + { + $collections = Collection::query() + ->withCount('products') + ->where('is_published', true) + ->orderBy('title') + ->get(); + + return view('storefront.collections.index', compact('collections')); + } + + public function collection(string $handle): View + { + $collection = Collection::query() + ->where('handle', $handle) + ->where('is_published', true) + ->firstOrFail(); + + $products = $collection->products() + ->with('defaultVariant', 'media') + ->where('status', ProductStatus::Active) + ->paginate(12); + + return view('storefront.collections.show', compact('collection', 'products')); + } + + public function product(string $handle): View + { + $product = Product::query() + ->with('variants.optionValues.option', 'variants.inventoryItem', 'media') + ->where('handle', $handle) + ->where('status', ProductStatus::Active) + ->firstOrFail(); + + return view('storefront.products.show', compact('product')); + } + + public function search(Request $request, SearchService $search): View + { + $query = trim((string) $request->query('q', '')); + $products = $query === '' + ? collect() + : $search->products($query); + + return view('storefront.search', compact('query', 'products')); + } + + public function page(string $handle): View + { + $page = Page::query() + ->where('handle', $handle) + ->where('is_published', true) + ->firstOrFail(); + + return view('storefront.page', compact('page')); + } +} diff --git a/app/Http/Middleware/EnsureStoreRole.php b/app/Http/Middleware/EnsureStoreRole.php new file mode 100644 index 00000000..6e9e7480 --- /dev/null +++ b/app/Http/Middleware/EnsureStoreRole.php @@ -0,0 +1,35 @@ +bound('current_store')) { + abort(403); + } + + $role = $request->user()?->roleForStore(app('current_store')); + + if (! $role) { + abort(403); + } + + if ($roles !== [] && ! in_array($role->value, $roles, true)) { + abort(403); + } + + if ($role === StoreUserRole::Support && $request->isMethodSafe() === false) { + abort(403); + } + + return $next($request); + } +} + diff --git a/app/Http/Middleware/ResolveStore.php b/app/Http/Middleware/ResolveStore.php new file mode 100644 index 00000000..4fec5121 --- /dev/null +++ b/app/Http/Middleware/ResolveStore.php @@ -0,0 +1,78 @@ +path(), 'admin') + ? $this->resolveForAdmin($request) + : $this->resolveForStorefront($request); + + if (! $store) { + abort(str_starts_with($request->path(), 'admin') ? 403 : 404); + } + + if (! str_starts_with($request->path(), 'admin') && $store->status === StoreStatus::Suspended) { + abort(503); + } + + app()->instance('current_store', $store); + + return $next($request); + } + + private function resolveForStorefront(Request $request): ?Store + { + $host = strtolower($request->getHost()); + + if ($host === 'shop.test') { + $host = 'acme-fashion.test'; + } + + $storeId = Cache::remember("store-domain:{$host}", now()->addMinutes(5), function () use ($host): ?int { + return StoreDomain::query() + ->where('hostname', $host) + ->where('type', 'storefront') + ->value('store_id'); + }); + + return $storeId ? Store::query()->find($storeId) : null; + } + + private function resolveForAdmin(Request $request): ?Store + { + $user = $request->user(); + + if (! $user) { + return null; + } + + $storeId = $request->session()->get('current_store_id') + ?? $user->stores()->orderBy('stores.id')->value('stores.id'); + + if (! $storeId) { + return null; + } + + $hasAccess = $user->stores()->whereKey($storeId)->exists(); + + if (! $hasAccess) { + return null; + } + + $request->session()->put('current_store_id', $storeId); + + return Store::query()->find($storeId); + } +} + diff --git a/app/Models/AnalyticsEvent.php b/app/Models/AnalyticsEvent.php new file mode 100644 index 00000000..73956658 --- /dev/null +++ b/app/Models/AnalyticsEvent.php @@ -0,0 +1,21 @@ + 'array']; + } +} + diff --git a/app/Models/Cart.php b/app/Models/Cart.php new file mode 100644 index 00000000..f614af3a --- /dev/null +++ b/app/Models/Cart.php @@ -0,0 +1,20 @@ +hasMany(CartLine::class); + } +} + diff --git a/app/Models/CartLine.php b/app/Models/CartLine.php new file mode 100644 index 00000000..8afb5341 --- /dev/null +++ b/app/Models/CartLine.php @@ -0,0 +1,27 @@ + 'array']; + } + + public function cart(): BelongsTo + { + return $this->belongsTo(Cart::class); + } + + public function variant(): BelongsTo + { + return $this->belongsTo(ProductVariant::class, 'product_variant_id'); + } +} + diff --git a/app/Models/Checkout.php b/app/Models/Checkout.php new file mode 100644 index 00000000..cb18e0da --- /dev/null +++ b/app/Models/Checkout.php @@ -0,0 +1,35 @@ + CheckoutStatus::class, + 'shipping_address_json' => 'array', + 'totals_json' => 'array', + ]; + } + + public function cart(): BelongsTo + { + return $this->belongsTo(Cart::class); + } + + public function order(): BelongsTo + { + return $this->belongsTo(Order::class); + } +} + diff --git a/app/Models/Collection.php b/app/Models/Collection.php new file mode 100644 index 00000000..e397294e --- /dev/null +++ b/app/Models/Collection.php @@ -0,0 +1,27 @@ + 'boolean', + ]; + } + + public function products(): BelongsToMany + { + return $this->belongsToMany(Product::class, 'collection_products')->withPivot('position')->orderByPivot('position'); + } +} + diff --git a/app/Models/Concerns/BelongsToStore.php b/app/Models/Concerns/BelongsToStore.php new file mode 100644 index 00000000..d5757437 --- /dev/null +++ b/app/Models/Concerns/BelongsToStore.php @@ -0,0 +1,27 @@ +store_id && app()->bound('current_store')) { + $model->store_id = app('current_store')->id; + } + }); + } + + public function store(): BelongsTo + { + return $this->belongsTo(Store::class); + } +} + diff --git a/app/Models/Customer.php b/app/Models/Customer.php new file mode 100644 index 00000000..536bd386 --- /dev/null +++ b/app/Models/Customer.php @@ -0,0 +1,51 @@ + 'boolean', + 'last_login_at' => 'datetime', + 'password_hash' => 'hashed', + ]; + } + + public function getAuthPassword(): string + { + return (string) $this->password_hash; + } + + public function setPasswordAttribute(string $value): void + { + $this->attributes['password_hash'] = $value; + } + + public function addresses(): HasMany + { + return $this->hasMany(CustomerAddress::class); + } + + public function orders(): HasMany + { + return $this->hasMany(Order::class); + } +} + diff --git a/app/Models/CustomerAddress.php b/app/Models/CustomerAddress.php new file mode 100644 index 00000000..a69f20bd --- /dev/null +++ b/app/Models/CustomerAddress.php @@ -0,0 +1,25 @@ + 'boolean']; + } + + public function customer(): BelongsTo + { + return $this->belongsTo(Customer::class); + } +} + diff --git a/app/Models/Discount.php b/app/Models/Discount.php new file mode 100644 index 00000000..1caa8ee4 --- /dev/null +++ b/app/Models/Discount.php @@ -0,0 +1,25 @@ + DiscountType::class, + 'starts_at' => 'datetime', + 'ends_at' => 'datetime', + 'is_active' => 'boolean', + ]; + } +} + diff --git a/app/Models/Fulfillment.php b/app/Models/Fulfillment.php new file mode 100644 index 00000000..4d93ceb3 --- /dev/null +++ b/app/Models/Fulfillment.php @@ -0,0 +1,28 @@ + 'datetime', + 'delivered_at' => 'datetime', + ]; + } + + public function lines(): HasMany + { + return $this->hasMany(FulfillmentLine::class); + } +} + diff --git a/app/Models/FulfillmentLine.php b/app/Models/FulfillmentLine.php new file mode 100644 index 00000000..c780e639 --- /dev/null +++ b/app/Models/FulfillmentLine.php @@ -0,0 +1,13 @@ +belongsTo(ProductVariant::class, 'variant_id'); + } + + public function availableForSale(): int + { + return max(0, $this->quantity_available - $this->quantity_reserved); + } +} + diff --git a/app/Models/NavigationItem.php b/app/Models/NavigationItem.php new file mode 100644 index 00000000..e569436d --- /dev/null +++ b/app/Models/NavigationItem.php @@ -0,0 +1,11 @@ +hasMany(NavigationItem::class)->orderBy('position'); + } +} + diff --git a/app/Models/Order.php b/app/Models/Order.php new file mode 100644 index 00000000..03bf8f68 --- /dev/null +++ b/app/Models/Order.php @@ -0,0 +1,44 @@ + 'array', + 'timeline_json' => 'array', + ]; + } + + public function customer(): BelongsTo + { + return $this->belongsTo(Customer::class); + } + + public function lines(): HasMany + { + return $this->hasMany(OrderLine::class); + } + + public function payments(): HasMany + { + return $this->hasMany(Payment::class); + } + + public function fulfillments(): HasMany + { + return $this->hasMany(Fulfillment::class); + } +} + diff --git a/app/Models/OrderLine.php b/app/Models/OrderLine.php new file mode 100644 index 00000000..2aee9dfb --- /dev/null +++ b/app/Models/OrderLine.php @@ -0,0 +1,22 @@ + 'array']; + } + + public function order(): BelongsTo + { + return $this->belongsTo(Order::class); + } +} + diff --git a/app/Models/Organization.php b/app/Models/Organization.php new file mode 100644 index 00000000..83a8aa6d --- /dev/null +++ b/app/Models/Organization.php @@ -0,0 +1,20 @@ +hasMany(Store::class); + } +} + diff --git a/app/Models/Page.php b/app/Models/Page.php new file mode 100644 index 00000000..17637b0e --- /dev/null +++ b/app/Models/Page.php @@ -0,0 +1,19 @@ + 'boolean']; + } +} + diff --git a/app/Models/Payment.php b/app/Models/Payment.php new file mode 100644 index 00000000..151aee63 --- /dev/null +++ b/app/Models/Payment.php @@ -0,0 +1,20 @@ +belongsTo(Order::class); + } +} + diff --git a/app/Models/Product.php b/app/Models/Product.php new file mode 100644 index 00000000..a265c769 --- /dev/null +++ b/app/Models/Product.php @@ -0,0 +1,54 @@ + ProductStatus::class, + 'tags' => 'array', + 'published_at' => 'datetime', + ]; + } + + public function variants(): HasMany + { + return $this->hasMany(ProductVariant::class); + } + + public function defaultVariant(): HasOne + { + return $this->hasOne(ProductVariant::class)->where('is_default', true); + } + + public function options(): HasMany + { + return $this->hasMany(ProductOption::class); + } + + public function media(): HasMany + { + return $this->hasMany(ProductMedia::class)->orderBy('position'); + } + + public function collections(): BelongsToMany + { + return $this->belongsToMany(Collection::class, 'collection_products')->withPivot('position'); + } +} + diff --git a/app/Models/ProductMedia.php b/app/Models/ProductMedia.php new file mode 100644 index 00000000..d1ba1cfb --- /dev/null +++ b/app/Models/ProductMedia.php @@ -0,0 +1,17 @@ +belongsTo(Product::class); + } +} + diff --git a/app/Models/ProductOption.php b/app/Models/ProductOption.php new file mode 100644 index 00000000..8bd73b34 --- /dev/null +++ b/app/Models/ProductOption.php @@ -0,0 +1,25 @@ +belongsTo(Product::class); + } + + public function values(): HasMany + { + return $this->hasMany(ProductOptionValue::class)->orderBy('position'); + } +} + diff --git a/app/Models/ProductOptionValue.php b/app/Models/ProductOptionValue.php new file mode 100644 index 00000000..76c826c6 --- /dev/null +++ b/app/Models/ProductOptionValue.php @@ -0,0 +1,19 @@ +belongsTo(ProductOption::class, 'product_option_id'); + } +} + diff --git a/app/Models/ProductVariant.php b/app/Models/ProductVariant.php new file mode 100644 index 00000000..c20a9024 --- /dev/null +++ b/app/Models/ProductVariant.php @@ -0,0 +1,40 @@ + 'boolean', + 'is_default' => 'boolean', + ]; + } + + public function product(): BelongsTo + { + return $this->belongsTo(Product::class); + } + + public function inventoryItem(): HasOne + { + return $this->hasOne(InventoryItem::class, 'variant_id'); + } + + public function optionValues(): BelongsToMany + { + return $this->belongsToMany(ProductOptionValue::class, 'variant_option_values', 'variant_id', 'product_option_value_id'); + } +} + diff --git a/app/Models/Refund.php b/app/Models/Refund.php new file mode 100644 index 00000000..d7988990 --- /dev/null +++ b/app/Models/Refund.php @@ -0,0 +1,19 @@ + 'boolean']; + } +} + diff --git a/app/Models/Scopes/StoreScope.php b/app/Models/Scopes/StoreScope.php new file mode 100644 index 00000000..c90da8ab --- /dev/null +++ b/app/Models/Scopes/StoreScope.php @@ -0,0 +1,20 @@ +bound('current_store')) { + return; + } + + $builder->where($model->getTable().'.store_id', app('current_store')->id); + } +} + diff --git a/app/Models/SearchQuery.php b/app/Models/SearchQuery.php new file mode 100644 index 00000000..41080b4d --- /dev/null +++ b/app/Models/SearchQuery.php @@ -0,0 +1,16 @@ +belongsTo(ShippingZone::class, 'shipping_zone_id'); + } +} + diff --git a/app/Models/ShippingZone.php b/app/Models/ShippingZone.php new file mode 100644 index 00000000..5ee828ab --- /dev/null +++ b/app/Models/ShippingZone.php @@ -0,0 +1,25 @@ + 'array']; + } + + public function rates(): HasMany + { + return $this->hasMany(ShippingRate::class); + } +} + diff --git a/app/Models/Store.php b/app/Models/Store.php new file mode 100644 index 00000000..40f723a8 --- /dev/null +++ b/app/Models/Store.php @@ -0,0 +1,49 @@ + StoreStatus::class, + ]; + } + + public function organization(): BelongsTo + { + return $this->belongsTo(Organization::class); + } + + public function domains(): HasMany + { + return $this->hasMany(StoreDomain::class); + } + + public function users(): BelongsToMany + { + return $this->belongsToMany(User::class, 'store_users') + ->using(StoreUser::class) + ->withPivot('role') + ->withTimestamps(); + } + + public function settings(): HasOne + { + return $this->hasOne(StoreSettings::class); + } +} + diff --git a/app/Models/StoreDomain.php b/app/Models/StoreDomain.php new file mode 100644 index 00000000..6c193863 --- /dev/null +++ b/app/Models/StoreDomain.php @@ -0,0 +1,31 @@ + StoreDomainType::class, + 'is_primary' => 'boolean', + ]; + } + + public function store(): BelongsTo + { + return $this->belongsTo(Store::class); + } +} + diff --git a/app/Models/StoreSettings.php b/app/Models/StoreSettings.php new file mode 100644 index 00000000..dc738bf4 --- /dev/null +++ b/app/Models/StoreSettings.php @@ -0,0 +1,30 @@ + 'array', + ]; + } + + public function store(): BelongsTo + { + return $this->belongsTo(Store::class); + } +} + diff --git a/app/Models/StoreUser.php b/app/Models/StoreUser.php new file mode 100644 index 00000000..551dd759 --- /dev/null +++ b/app/Models/StoreUser.php @@ -0,0 +1,23 @@ + StoreUserRole::class, + ]; + } +} + diff --git a/app/Models/TaxSettings.php b/app/Models/TaxSettings.php new file mode 100644 index 00000000..a1d30e1a --- /dev/null +++ b/app/Models/TaxSettings.php @@ -0,0 +1,22 @@ + 'boolean']; + } +} + diff --git a/app/Models/Theme.php b/app/Models/Theme.php new file mode 100644 index 00000000..c58afc9b --- /dev/null +++ b/app/Models/Theme.php @@ -0,0 +1,22 @@ + 'boolean', + 'settings_json' => 'array', + ]; + } +} + diff --git a/app/Models/User.php b/app/Models/User.php index 214bea4e..b16f1b36 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -3,9 +3,12 @@ namespace App\Models; // use Illuminate\Contracts\Auth\MustVerifyEmail; +use App\Enums\StoreUserRole; use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; +use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; use Laravel\Fortify\TwoFactorAuthenticatable; @@ -23,6 +26,9 @@ class User extends Authenticatable 'name', 'email', 'password', + 'password_hash', + 'status', + 'last_login_at', ]; /** @@ -31,7 +37,7 @@ class User extends Authenticatable * @var list */ protected $hidden = [ - 'password', + 'password_hash', 'two_factor_secret', 'two_factor_recovery_codes', 'remember_token', @@ -46,10 +52,45 @@ protected function casts(): array { return [ 'email_verified_at' => 'datetime', - 'password' => 'hashed', + 'password_hash' => 'hashed', + 'last_login_at' => 'datetime', ]; } + public function getAuthPassword(): string + { + return $this->password_hash; + } + + public function setPasswordAttribute(string $value): void + { + $this->attributes['password_hash'] = Hash::needsRehash($value) ? Hash::make($value) : $value; + } + + public function getPasswordAttribute(): string + { + return $this->password_hash; + } + + public function stores(): BelongsToMany + { + return $this->belongsToMany(Store::class, 'store_users') + ->using(StoreUser::class) + ->withPivot('role') + ->withTimestamps(); + } + + public function roleForStore(Store $store): ?StoreUserRole + { + $role = $this->stores() + ->whereKey($store->id) + ->first() + ?->pivot + ?->role; + + return $role instanceof StoreUserRole ? $role : StoreUserRole::tryFrom((string) $role); + } + /** * Get the user's initials */ diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 8a29e6f5..20be2f17 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -5,7 +5,10 @@ use Carbon\CarbonImmutable; use Illuminate\Support\Facades\Date; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\ServiceProvider; +use Illuminate\Cache\RateLimiting\Limit; +use Illuminate\Http\Request; use Illuminate\Validation\Rules\Password; class AppServiceProvider extends ServiceProvider @@ -46,5 +49,10 @@ protected function configureDefaults(): void ->uncompromised() : null ); + + RateLimiter::for('login', fn (Request $request): Limit => Limit::perMinute(5)->by($request->ip())); + RateLimiter::for('api.storefront', fn (Request $request): Limit => Limit::perMinute(120)->by($request->ip())); + RateLimiter::for('checkout', fn (Request $request): Limit => Limit::perMinute(30)->by($request->ip())); + RateLimiter::for('search', fn (Request $request): Limit => Limit::perMinute(60)->by($request->ip())); } } diff --git a/app/Services/Shop/AdminOrderService.php b/app/Services/Shop/AdminOrderService.php new file mode 100644 index 00000000..fc554427 --- /dev/null +++ b/app/Services/Shop/AdminOrderService.php @@ -0,0 +1,85 @@ +where('order_id', $order->id)->sum('amount'); + $remaining = $order->total_amount - $refunded; + + if ($amount <= 0 || $amount > $remaining) { + throw ValidationException::withMessages(['amount' => 'Refund amount exceeds the refundable balance.']); + } + + $refund = Refund::query()->create([ + 'store_id' => $order->store_id, + 'order_id' => $order->id, + 'amount' => $amount, + 'reason' => $reason, + ]); + + $order->update([ + 'status' => $amount === $remaining ? 'refunded' : 'partially_refunded', + 'financial_status' => $amount === $remaining ? 'refunded' : 'partially_refunded', + 'timeline_json' => array_merge($order->timeline_json ?? [], [ + ['at' => now()->toISOString(), 'message' => 'Refund processed'], + ]), + ]); + + Payment::query()->where('order_id', $order->id)->update(['status' => $order->financial_status]); + + return $refund; + } + + public function fulfill(Order $order): Fulfillment + { + if (! in_array($order->financial_status, ['paid', 'partially_refunded'], true)) { + throw ValidationException::withMessages(['order' => 'Fulfillment is blocked until payment is paid.']); + } + + $fulfillment = Fulfillment::query()->create([ + 'store_id' => $order->store_id, + 'order_id' => $order->id, + 'status' => 'created', + ]); + + foreach ($order->lines as $line) { + $fulfillment->lines()->create([ + 'order_line_id' => $line->id, + 'quantity' => $line->quantity, + ]); + } + + $order->update([ + 'fulfillment_status' => 'fulfilled', + 'timeline_json' => array_merge($order->timeline_json ?? [], [ + ['at' => now()->toISOString(), 'message' => 'Fulfillment created'], + ]), + ]); + + return $fulfillment; + } + + public function markShipped(Fulfillment $fulfillment): Fulfillment + { + $fulfillment->update(['status' => 'shipped', 'shipped_at' => now()]); + + return $fulfillment->refresh(); + } + + public function markDelivered(Fulfillment $fulfillment): Fulfillment + { + $fulfillment->update(['status' => 'delivered', 'delivered_at' => now()]); + + return $fulfillment->refresh(); + } +} + diff --git a/app/Services/Shop/CartService.php b/app/Services/Shop/CartService.php new file mode 100644 index 00000000..b37b2197 --- /dev/null +++ b/app/Services/Shop/CartService.php @@ -0,0 +1,116 @@ +with('lines.variant.product.media')->find($cartId) + : null; + + if (! $cart || $cart->store_id !== $store->id || $cart->status !== 'active') { + $cart = Cart::query()->create([ + 'store_id' => $store->id, + 'customer_id' => auth('customer')->id(), + 'currency' => $store->default_currency, + ]); + + session(['cart_id' => $cart->id]); + } + + return $cart->load('lines.variant.product.media'); + } + + public function add(ProductVariant $variant, int $quantity = 1): Cart + { + return DB::transaction(function () use ($variant, $quantity): Cart { + $cart = $this->current(); + $line = $cart->lines()->where('product_variant_id', $variant->id)->first(); + $newQuantity = $quantity + ($line?->quantity ?? 0); + + $this->inventory->assertPurchasable($variant, $newQuantity); + + $snapshot = [ + 'product_title' => $variant->product->title, + 'variant_title' => $variant->optionValues->pluck('value')->implode(' / '), + 'handle' => $variant->product->handle, + 'image' => $variant->product->media->first()?->url, + ]; + + $cart->lines()->updateOrCreate( + ['product_variant_id' => $variant->id], + [ + 'quantity' => $newQuantity, + 'unit_price_amount' => $variant->price_amount, + 'snapshot_json' => $snapshot, + ], + ); + + $cart->increment('cart_version'); + + return $cart->refresh()->load('lines.variant.product.media'); + }); + } + + public function updateLine(int $lineId, int $quantity): Cart + { + return DB::transaction(function () use ($lineId, $quantity): Cart { + $cart = $this->current(); + $line = $cart->lines()->whereKey($lineId)->firstOrFail(); + + if ($quantity <= 0) { + $line->delete(); + } else { + $this->inventory->assertPurchasable($line->variant, $quantity); + $line->update(['quantity' => $quantity]); + } + + $cart->increment('cart_version'); + + return $cart->refresh()->load('lines.variant.product.media'); + }); + } + + public function applyDiscount(string $code): Cart + { + $cart = $this->current(); + $previousCode = $cart->discount_code; + $cart->forceFill(['discount_code' => strtoupper($code)]); + + try { + $this->pricing->cartTotals($cart); + } catch (\Throwable $exception) { + $cart->forceFill(['discount_code' => $previousCode]); + + throw $exception; + } + + $cart->save(); + $cart->increment('cart_version'); + + return $cart->refresh()->load('lines.variant.product.media'); + } + + public function removeDiscount(): Cart + { + $cart = $this->current(); + $cart->update(['discount_code' => null]); + $cart->increment('cart_version'); + + return $cart->refresh()->load('lines.variant.product.media'); + } +} diff --git a/app/Services/Shop/CheckoutService.php b/app/Services/Shop/CheckoutService.php new file mode 100644 index 00000000..5ba45bcf --- /dev/null +++ b/app/Services/Shop/CheckoutService.php @@ -0,0 +1,192 @@ +lines()->count() === 0) { + throw ValidationException::withMessages(['cart' => 'Your cart is empty.']); + } + + return Checkout::query()->firstOrCreate( + ['cart_id' => $cart->id, 'status' => CheckoutStatus::Started], + [ + 'store_id' => $cart->store_id, + 'customer_id' => $cart->customer_id, + 'email' => auth('customer')->user()?->email, + 'totals_json' => $this->pricing->cartTotals($cart), + ], + ); + } + + public function address(Checkout $checkout, string $email, array $address): Checkout + { + $rate = $this->shipping->rateForCountry((string) $address['country_code'], $checkout->cart->lines->sum(fn ($line): int => $line->quantity * $line->unit_price_amount)); + + if (! $rate) { + throw ValidationException::withMessages(['shipping' => 'No shipping rate is available for this address.']); + } + + $checkout->update([ + 'status' => CheckoutStatus::Addressed, + 'email' => $email, + 'shipping_address_json' => $address, + 'shipping_rate_id' => $rate->id, + 'totals_json' => $this->pricing->cartTotals($checkout->cart, $rate), + ]); + + return $checkout->refresh(); + } + + public function payment(Checkout $checkout, string $method): Checkout + { + $checkout->update([ + 'status' => CheckoutStatus::PaymentSelected, + 'payment_method' => $method, + ]); + + return $checkout->refresh(); + } + + public function complete(Checkout $checkout, array $paymentPayload = []): Order + { + return DB::transaction(function () use ($checkout, $paymentPayload): Order { + $checkout = Checkout::query()->lockForUpdate()->findOrFail($checkout->id); + + if ($checkout->order_id) { + return $checkout->order; + } + + if (! $checkout->email || ! $checkout->shipping_address_json || ! $checkout->shipping_rate_id || ! $checkout->payment_method) { + throw ValidationException::withMessages(['checkout' => 'Checkout is incomplete.']); + } + + $cart = $checkout->cart()->with('lines.variant.product')->firstOrFail(); + $rate = ShippingRate::query()->find($checkout->shipping_rate_id); + $totals = $this->pricing->cartTotals($cart, $rate); + $payment = $this->payments->charge($checkout->payment_method, $totals['total'], $paymentPayload); + + $order = Order::query()->create([ + 'store_id' => $checkout->store_id, + 'customer_id' => $checkout->customer_id, + 'order_number' => $this->nextOrderNumber($checkout->store_id), + 'email' => $checkout->email, + 'status' => $payment['status'] === 'paid' ? 'paid' : 'pending', + 'financial_status' => $payment['status'], + 'currency' => $totals['currency'], + 'subtotal_amount' => $totals['subtotal'], + 'discount_amount' => $totals['discount'], + 'shipping_amount' => $totals['shipping'], + 'tax_amount' => $totals['tax'], + 'total_amount' => $totals['total'], + 'shipping_address_json' => $checkout->shipping_address_json, + 'timeline_json' => [ + ['at' => now()->toISOString(), 'message' => 'Order created'], + ['at' => now()->toISOString(), 'message' => $payment['status'] === 'paid' ? 'Payment captured' : 'Awaiting bank transfer'], + ], + ]); + + foreach ($cart->lines as $line) { + $order->lines()->create([ + 'product_variant_id' => $line->product_variant_id, + 'title' => $line->variant->product->title, + 'sku' => $line->variant->sku, + 'quantity' => $line->quantity, + 'unit_price_amount' => $line->unit_price_amount, + 'total_amount' => $line->quantity * $line->unit_price_amount, + 'snapshot_json' => $line->snapshot_json, + ]); + + if ($payment['status'] === 'pending') { + $this->inventory->reserve($line->variant, $line->quantity); + } else { + $this->inventory->commit($line->variant, $line->quantity); + } + } + + $order->payments()->create([ + 'store_id' => $checkout->store_id, + 'provider' => 'mock', + 'method' => $checkout->payment_method, + 'status' => $payment['status'], + 'amount' => $totals['total'], + 'reference' => $payment['reference'], + 'raw_payload_encrypted' => encrypt($payment), + ]); + + if ($cart->discount_code) { + Discount::query()->where('code', $cart->discount_code)->increment('used_count'); + } + + $cart->update(['status' => 'converted']); + $checkout->update([ + 'status' => CheckoutStatus::Completed, + 'order_id' => $order->id, + 'totals_json' => $totals, + ]); + + session()->forget('cart_id'); + + return $order->refresh()->load('lines', 'payments'); + }); + } + + public function confirmBankTransfer(Order $order): Order + { + return DB::transaction(function () use ($order): Order { + $payment = $order->payments()->where('method', 'bank_transfer')->firstOrFail(); + + if ($payment->status === 'paid') { + return $order; + } + + foreach ($order->lines()->with('order')->get() as $line) { + if ($line->product_variant_id) { + $variant = ProductVariant::query()->find($line->product_variant_id); + $variant && $this->inventory->commit($variant, $line->quantity); + } + } + + $payment->update(['status' => 'paid']); + $order->update([ + 'status' => 'paid', + 'financial_status' => 'paid', + 'timeline_json' => array_merge($order->timeline_json ?? [], [ + ['at' => now()->toISOString(), 'message' => 'Bank transfer confirmed'], + ]), + ]); + + return $order->refresh(); + }); + } + + private function nextOrderNumber(int $storeId): string + { + $last = Order::withoutGlobalScopes() + ->where('store_id', $storeId) + ->orderByDesc('id') + ->value('order_number'); + + return (string) max(1001, ((int) $last) + 1); + } +} + diff --git a/app/Services/Shop/InventoryService.php b/app/Services/Shop/InventoryService.php new file mode 100644 index 00000000..e2c4db82 --- /dev/null +++ b/app/Services/Shop/InventoryService.php @@ -0,0 +1,75 @@ +inventoryItem; + + if (! $inventory) { + return; + } + + if ($inventory->policy === 'continue') { + return; + } + + if ($inventory->availableForSale() < $quantity) { + throw ValidationException::withMessages([ + 'quantity' => 'This product does not have enough stock available.', + ]); + } + } + + public function reserve(ProductVariant $variant, int $quantity): void + { + $inventory = $this->lock($variant); + + if (! $inventory || $inventory->policy === 'continue') { + return; + } + + if ($inventory->availableForSale() < $quantity) { + throw ValidationException::withMessages([ + 'quantity' => 'This product does not have enough stock available.', + ]); + } + + $inventory->increment('quantity_reserved', $quantity); + } + + public function commit(ProductVariant $variant, int $quantity): void + { + $inventory = $this->lock($variant); + + if (! $inventory) { + return; + } + + $inventory->decrement('quantity_available', $quantity); + + if ($inventory->quantity_reserved > 0) { + $inventory->decrement('quantity_reserved', min($inventory->quantity_reserved, $quantity)); + } + } + + public function restock(ProductVariant $variant, int $quantity): void + { + $variant->inventoryItem?->increment('quantity_available', $quantity); + } + + private function lock(ProductVariant $variant): ?InventoryItem + { + return InventoryItem::query() + ->where('variant_id', $variant->id) + ->lockForUpdate() + ->first(); + } +} + diff --git a/app/Services/Shop/MockPaymentProvider.php b/app/Services/Shop/MockPaymentProvider.php new file mode 100644 index 00000000..86537e6f --- /dev/null +++ b/app/Services/Shop/MockPaymentProvider.php @@ -0,0 +1,47 @@ +} + */ + public function charge(string $method, int $amount, array $payload = []): array + { + if ($method === 'credit_card') { + $number = preg_replace('/\D+/', '', (string) ($payload['card_number'] ?? '')); + + if ($number === '4000000000000002') { + throw ValidationException::withMessages(['payment' => 'The test card was declined.']); + } + + if ($number === '4000000000009995') { + throw ValidationException::withMessages(['payment' => 'The test card has insufficient funds.']); + } + + return ['status' => 'paid', 'reference' => 'cc_'.str()->upper(str()->random(10))]; + } + + if ($method === 'paypal') { + return ['status' => 'paid', 'reference' => 'pp_'.str()->upper(str()->random(10))]; + } + + if ($method === 'bank_transfer') { + return [ + 'status' => 'pending', + 'reference' => 'BT-'.str()->upper(str()->random(8)), + 'instructions' => [ + 'iban' => 'DE89370400440532013000', + 'bic' => 'COBADEFFXXX', + 'amount' => Money::format($amount), + ], + ]; + } + + throw ValidationException::withMessages(['payment_method' => 'Unsupported payment method.']); + } +} + diff --git a/app/Services/Shop/Money.php b/app/Services/Shop/Money.php new file mode 100644 index 00000000..403952b4 --- /dev/null +++ b/app/Services/Shop/Money.php @@ -0,0 +1,22 @@ +loadMissing('lines.variant.product'); + + $subtotal = $cart->lines->sum(fn ($line): int => $line->quantity * $line->unit_price_amount); + $shipping = $shippingRate?->price_amount ?? 0; + $discount = 0; + $freeShipping = false; + + if ($cart->discount_code) { + $discountModel = $this->validDiscount($cart, $subtotal); + + if ($discountModel->type === DiscountType::Percentage) { + $discount = Money::bps($subtotal, $discountModel->value_bps); + } elseif ($discountModel->type === DiscountType::FixedAmount) { + $discount = min($subtotal, $discountModel->value_amount); + } elseif ($discountModel->type === DiscountType::FreeShipping) { + $freeShipping = true; + } + } + + if ($freeShipping) { + $shipping = 0; + } + + $taxSettings = TaxSettings::query()->whereKey($cart->store_id)->first(); + $taxable = max(0, $subtotal - $discount) + $shipping; + $tax = $taxSettings?->prices_include_tax + ? (int) round($taxable - ($taxable / (1 + (($taxSettings->default_rate_bps ?? 1900) / 10000)))) + : Money::bps($taxable, $taxSettings->default_rate_bps ?? 1900); + + $total = $taxSettings?->prices_include_tax + ? $taxable + : $taxable + $tax; + + return [ + 'subtotal' => $subtotal, + 'discount' => $discount, + 'shipping' => $shipping, + 'tax' => $tax, + 'total' => $total, + 'currency' => $cart->currency, + 'discount_code' => $cart->discount_code, + ]; + } + + public function validDiscount(Cart $cart, int $subtotal): Discount + { + $discount = Discount::query() + ->where('code', strtoupper((string) $cart->discount_code)) + ->first(); + + if (! $discount || ! $discount->is_active) { + throw ValidationException::withMessages(['discount_code' => 'Discount code is invalid.']); + } + + if ($discount->starts_at && $discount->starts_at->isFuture()) { + throw ValidationException::withMessages(['discount_code' => 'Discount code is not active yet.']); + } + + if ($discount->ends_at && $discount->ends_at->isPast()) { + throw ValidationException::withMessages(['discount_code' => 'Discount code has expired.']); + } + + if ($discount->usage_limit !== null && $discount->used_count >= $discount->usage_limit) { + throw ValidationException::withMessages(['discount_code' => 'Discount code usage limit has been reached.']); + } + + if ($discount->min_purchase_amount !== null && $subtotal < $discount->min_purchase_amount) { + throw ValidationException::withMessages(['discount_code' => 'Discount code requires a higher cart subtotal.']); + } + + return $discount; + } +} + diff --git a/app/Services/Shop/SearchService.php b/app/Services/Shop/SearchService.php new file mode 100644 index 00000000..4779d4b0 --- /dev/null +++ b/app/Services/Shop/SearchService.php @@ -0,0 +1,39 @@ + + */ + public function products(string $query): Collection + { + $clean = trim($query); + + $products = Product::query() + ->with('defaultVariant', 'media') + ->where('status', ProductStatus::Active) + ->where(function ($builder) use ($clean): void { + $builder->where('title', 'like', "%{$clean}%") + ->orWhere('description_html', 'like', "%{$clean}%") + ->orWhere('vendor', 'like', "%{$clean}%") + ->orWhere('product_type', 'like', "%{$clean}%"); + }) + ->orderBy('title') + ->get(); + + SearchQuery::query()->create([ + 'query' => $clean, + 'results_count' => $products->count(), + ]); + + return $products; + } +} + diff --git a/app/Services/Shop/ShippingService.php b/app/Services/Shop/ShippingService.php new file mode 100644 index 00000000..3f24e470 --- /dev/null +++ b/app/Services/Shop/ShippingService.php @@ -0,0 +1,23 @@ +with('rates') + ->get() + ->first(fn (ShippingZone $zone): bool => in_array(strtoupper($countryCode), $zone->countries, true) || in_array('*', $zone->countries, true)); + + return $zone?->rates + ->filter(fn (ShippingRate $rate): bool => $rate->min_order_amount === null || $subtotal >= $rate->min_order_amount) + ->sortBy('price_amount') + ->first(); + } +} + diff --git a/boost.json b/boost.json new file mode 100644 index 00000000..3a9632d5 --- /dev/null +++ b/boost.json @@ -0,0 +1,17 @@ +{ + "agents": [ + "codex" + ], + "guidelines": true, + "mcp": true, + "nightwatch_mcp": false, + "sail": false, + "skills": [ + "developing-with-fortify", + "laravel-best-practices", + "fluxui-development", + "livewire-development", + "pest-testing", + "tailwindcss-development" + ] +} diff --git a/bootstrap/app.php b/bootstrap/app.php index c1832766..597df067 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -2,6 +2,8 @@ use Illuminate\Foundation\Application; use Illuminate\Foundation\Configuration\Exceptions; +use App\Http\Middleware\EnsureStoreRole; +use App\Http\Middleware\ResolveStore; use Illuminate\Foundation\Configuration\Middleware; return Application::configure(basePath: dirname(__DIR__)) @@ -11,7 +13,19 @@ health: '/up', ) ->withMiddleware(function (Middleware $middleware): void { - // + $middleware->alias([ + 'store.resolve' => ResolveStore::class, + 'store.role' => EnsureStoreRole::class, + ]); + + $middleware->appendToGroup('storefront', [ + ResolveStore::class, + ]); + + $middleware->appendToGroup('admin', [ + ResolveStore::class, + EnsureStoreRole::class, + ]); }) ->withExceptions(function (Exceptions $exceptions): void { // diff --git a/composer.json b/composer.json index 1f848aaf..a578e1d1 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ }, "require-dev": { "fakerphp/faker": "^1.23", - "laravel/boost": "^1.0", + "laravel/boost": "^2.4", "laravel/pail": "^1.2.2", "laravel/pint": "^1.24", "laravel/sail": "^1.41", diff --git a/composer.lock b/composer.lock index e4255dbd..7134a0de 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e4aa7ad38dac6834e5ff6bf65b1cdf23", + "content-hash": "a73f62d24e65543e17c317a1e9b580fa", "packages": [ { "name": "bacon/bacon-qr-code", @@ -6877,35 +6877,36 @@ }, { "name": "laravel/boost", - "version": "v1.0.18", + "version": "v2.4.5", "source": { "type": "git", "url": "https://github.com/laravel/boost.git", - "reference": "df2a62b5864759ea8cce8a4b7575b657e9c7d4ab" + "reference": "60386c7723ff7cb388b62b6c137597244a9cf2f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/boost/zipball/df2a62b5864759ea8cce8a4b7575b657e9c7d4ab", - "reference": "df2a62b5864759ea8cce8a4b7575b657e9c7d4ab", + "url": "https://api.github.com/repos/laravel/boost/zipball/60386c7723ff7cb388b62b6c137597244a9cf2f2", + "reference": "60386c7723ff7cb388b62b6c137597244a9cf2f2", "shasum": "" }, "require": { "guzzlehttp/guzzle": "^7.9", - "illuminate/console": "^10.0|^11.0|^12.0", - "illuminate/contracts": "^10.0|^11.0|^12.0", - "illuminate/routing": "^10.0|^11.0|^12.0", - "illuminate/support": "^10.0|^11.0|^12.0", - "laravel/mcp": "^0.1.0", - "laravel/prompts": "^0.1.9|^0.3", - "laravel/roster": "^0.2", - "php": "^8.1|^8.2" + "illuminate/console": "^11.45.3|^12.41.1|^13.0", + "illuminate/contracts": "^11.45.3|^12.41.1|^13.0", + "illuminate/routing": "^11.45.3|^12.41.1|^13.0", + "illuminate/support": "^11.45.3|^12.41.1|^13.0", + "laravel/mcp": "^0.5.1|^0.6.0|^0.7.0", + "laravel/prompts": "^0.3.10", + "laravel/roster": "^0.5.0", + "php": "^8.2" }, "require-dev": { - "laravel/pint": "^1.14|^1.23", - "mockery/mockery": "^1.6", - "orchestra/testbench": "^8.22.0|^9.0|^10.0", - "pestphp/pest": "^2.0|^3.0", - "phpstan/phpstan": "^2.0" + "laravel/pint": "^1.27.0", + "mockery/mockery": "^1.6.12", + "orchestra/testbench": "^9.15.0|^10.6|^11.0", + "pestphp/pest": "^2.36.0|^3.8.4|^4.1.5", + "phpstan/phpstan": "^2.1.27", + "rector/rector": "^2.1" }, "type": "library", "extra": { @@ -6927,7 +6928,7 @@ "license": [ "MIT" ], - "description": "Laravel Boost accelerates AI-assisted development to generate high-quality, Laravel-specific code.", + "description": "Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.", "homepage": "https://github.com/laravel/boost", "keywords": [ "ai", @@ -6938,35 +6939,41 @@ "issues": "https://github.com/laravel/boost/issues", "source": "https://github.com/laravel/boost" }, - "time": "2025-08-16T09:10:03+00:00" + "time": "2026-04-22T13:29:20+00:00" }, { "name": "laravel/mcp", - "version": "v0.1.1", + "version": "v0.7.0", "source": { "type": "git", "url": "https://github.com/laravel/mcp.git", - "reference": "6d6284a491f07c74d34f48dfd999ed52c567c713" + "reference": "3513b4feca5f1678be4d2261dcfa8e456436d02a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/mcp/zipball/6d6284a491f07c74d34f48dfd999ed52c567c713", - "reference": "6d6284a491f07c74d34f48dfd999ed52c567c713", + "url": "https://api.github.com/repos/laravel/mcp/zipball/3513b4feca5f1678be4d2261dcfa8e456436d02a", + "reference": "3513b4feca5f1678be4d2261dcfa8e456436d02a", "shasum": "" }, "require": { - "illuminate/console": "^10.0|^11.0|^12.0", - "illuminate/contracts": "^10.0|^11.0|^12.0", - "illuminate/http": "^10.0|^11.0|^12.0", - "illuminate/routing": "^10.0|^11.0|^12.0", - "illuminate/support": "^10.0|^11.0|^12.0", - "illuminate/validation": "^10.0|^11.0|^12.0", - "php": "^8.1|^8.2" + "ext-json": "*", + "ext-mbstring": "*", + "illuminate/console": "^11.45.3|^12.41.1|^13.0", + "illuminate/container": "^11.45.3|^12.41.1|^13.0", + "illuminate/contracts": "^11.45.3|^12.41.1|^13.0", + "illuminate/http": "^11.45.3|^12.41.1|^13.0", + "illuminate/json-schema": "^12.41.1|^13.0", + "illuminate/routing": "^11.45.3|^12.41.1|^13.0", + "illuminate/support": "^11.45.3|^12.41.1|^13.0", + "illuminate/validation": "^11.45.3|^12.41.1|^13.0", + "php": "^8.2" }, "require-dev": { - "laravel/pint": "^1.14", - "orchestra/testbench": "^8.22.0|^9.0|^10.0", - "phpstan/phpstan": "^2.0" + "laravel/pint": "^1.20", + "orchestra/testbench": "^9.15|^10.8|^11.0", + "pestphp/pest": "^3.8.5|^4.3.2", + "phpstan/phpstan": "^2.1.27", + "rector/rector": "^2.2.4" }, "type": "library", "extra": { @@ -6982,8 +6989,6 @@ "autoload": { "psr-4": { "Laravel\\Mcp\\": "src/", - "Workbench\\App\\": "workbench/app/", - "Laravel\\Mcp\\Tests\\": "tests/", "Laravel\\Mcp\\Server\\": "src/Server/" } }, @@ -6991,10 +6996,15 @@ "license": [ "MIT" ], - "description": "The easiest way to add MCP servers to your Laravel app.", + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Rapidly build MCP servers for your Laravel applications.", "homepage": "https://github.com/laravel/mcp", "keywords": [ - "dev", "laravel", "mcp" ], @@ -7002,7 +7012,7 @@ "issues": "https://github.com/laravel/mcp/issues", "source": "https://github.com/laravel/mcp" }, - "time": "2025-08-16T09:50:43+00:00" + "time": "2026-04-21T10:23:03+00:00" }, { "name": "laravel/pail", @@ -7153,30 +7163,31 @@ }, { "name": "laravel/roster", - "version": "v0.2.2", + "version": "v0.5.1", "source": { "type": "git", "url": "https://github.com/laravel/roster.git", - "reference": "67a39bce557a6cb7e7205a2a9d6c464f0e72956f" + "reference": "5089de7615f72f78e831590ff9d0435fed0102bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/roster/zipball/67a39bce557a6cb7e7205a2a9d6c464f0e72956f", - "reference": "67a39bce557a6cb7e7205a2a9d6c464f0e72956f", + "url": "https://api.github.com/repos/laravel/roster/zipball/5089de7615f72f78e831590ff9d0435fed0102bb", + "reference": "5089de7615f72f78e831590ff9d0435fed0102bb", "shasum": "" }, "require": { - "illuminate/console": "^10.0|^11.0|^12.0", - "illuminate/contracts": "^10.0|^11.0|^12.0", - "illuminate/routing": "^10.0|^11.0|^12.0", - "illuminate/support": "^10.0|^11.0|^12.0", - "php": "^8.1|^8.2" + "illuminate/console": "^11.0|^12.0|^13.0", + "illuminate/contracts": "^11.0|^12.0|^13.0", + "illuminate/routing": "^11.0|^12.0|^13.0", + "illuminate/support": "^11.0|^12.0|^13.0", + "php": "^8.2", + "symfony/yaml": "^7.2|^8.0" }, "require-dev": { "laravel/pint": "^1.14", "mockery/mockery": "^1.6", - "orchestra/testbench": "^8.22.0|^9.0|^10.0", - "pestphp/pest": "^2.0|^3.0", + "orchestra/testbench": "^9.0|^10.0|^11.0", + "pestphp/pest": "^3.0|^4.1", "phpstan/phpstan": "^2.0" }, "type": "library", @@ -7209,7 +7220,7 @@ "issues": "https://github.com/laravel/roster/issues", "source": "https://github.com/laravel/roster" }, - "time": "2025-07-24T12:31:13+00:00" + "time": "2026-03-05T07:58:43+00:00" }, { "name": "laravel/sail", @@ -9974,5 +9985,5 @@ "php": "^8.2" }, "platform-dev": {}, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } diff --git a/config/auth.php b/config/auth.php index 7d1eb0de..7ed88912 100644 --- a/config/auth.php +++ b/config/auth.php @@ -40,6 +40,11 @@ 'driver' => 'session', 'provider' => 'users', ], + + 'customer' => [ + 'driver' => 'session', + 'provider' => 'customers', + ], ], /* @@ -65,6 +70,11 @@ 'model' => env('AUTH_MODEL', App\Models\User::class), ], + 'customers' => [ + 'driver' => 'eloquent', + 'model' => App\Models\Customer::class, + ], + // 'users' => [ // 'driver' => 'database', // 'table' => 'users', @@ -97,6 +107,13 @@ 'expire' => 60, 'throttle' => 60, ], + + 'customers' => [ + 'provider' => 'customers', + 'table' => 'customer_password_reset_tokens', + 'expire' => 60, + 'throttle' => 60, + ], ], /* diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 80da5ac7..21f10d4c 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -27,7 +27,9 @@ public function definition(): array 'name' => fake()->name(), 'email' => fake()->unique()->safeEmail(), 'email_verified_at' => now(), - 'password' => static::$password ??= Hash::make('password'), + 'password_hash' => static::$password ??= Hash::make('password'), + 'status' => 'active', + 'last_login_at' => now(), 'remember_token' => Str::random(10), 'two_factor_secret' => null, 'two_factor_recovery_codes' => null, diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index 05fb5d9e..4dec6fb9 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -16,7 +16,9 @@ public function up(): void $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); - $table->string('password'); + $table->string('password_hash'); + $table->string('status')->default('active')->index(); + $table->timestamp('last_login_at')->nullable(); $table->rememberToken(); $table->timestamps(); }); diff --git a/database/migrations/2026_04_25_000001_create_shop_domain_tables.php b/database/migrations/2026_04_25_000001_create_shop_domain_tables.php new file mode 100644 index 00000000..36b2b242 --- /dev/null +++ b/database/migrations/2026_04_25_000001_create_shop_domain_tables.php @@ -0,0 +1,501 @@ +id(); + $table->string('name'); + $table->string('billing_email')->index(); + $table->timestamps(); + }); + + Schema::create('stores', function (Blueprint $table): void { + $table->id(); + $table->foreignId('organization_id')->constrained()->cascadeOnDelete(); + $table->string('name'); + $table->string('handle')->unique(); + $table->string('status')->default('active')->index(); + $table->string('default_currency', 3)->default('EUR'); + $table->string('default_locale')->default('en'); + $table->string('timezone')->default('UTC'); + $table->timestamps(); + }); + + Schema::create('store_domains', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->string('hostname')->unique(); + $table->string('type')->default('storefront'); + $table->boolean('is_primary')->default(false); + $table->string('tls_mode')->default('managed'); + $table->timestamp('created_at')->nullable(); + $table->index(['store_id', 'is_primary']); + }); + + Schema::create('store_users', function (Blueprint $table): void { + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->foreignId('user_id')->constrained()->cascadeOnDelete(); + $table->string('role')->default('staff'); + $table->timestamps(); + $table->primary(['store_id', 'user_id']); + $table->index(['store_id', 'role']); + }); + + Schema::create('store_settings', function (Blueprint $table): void { + $table->foreignId('store_id')->primary()->constrained()->cascadeOnDelete(); + $table->json('settings_json')->default('{}'); + $table->timestamp('updated_at')->nullable(); + }); + + Schema::create('products', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->string('title'); + $table->string('handle'); + $table->string('status')->default('draft'); + $table->text('description_html')->nullable(); + $table->string('vendor')->nullable(); + $table->string('product_type')->nullable(); + $table->json('tags')->default('[]'); + $table->timestamp('published_at')->nullable(); + $table->timestamps(); + $table->unique(['store_id', 'handle']); + $table->index(['store_id', 'status']); + $table->index(['store_id', 'published_at']); + $table->index(['store_id', 'vendor']); + $table->index(['store_id', 'product_type']); + }); + + Schema::create('product_options', function (Blueprint $table): void { + $table->id(); + $table->foreignId('product_id')->constrained()->cascadeOnDelete(); + $table->string('name'); + $table->unsignedInteger('position')->default(0); + $table->unique(['product_id', 'position']); + }); + + Schema::create('product_option_values', function (Blueprint $table): void { + $table->id(); + $table->foreignId('product_option_id')->constrained()->cascadeOnDelete(); + $table->string('value'); + $table->unsignedInteger('position')->default(0); + $table->unique(['product_option_id', 'position']); + }); + + Schema::create('product_variants', function (Blueprint $table): void { + $table->id(); + $table->foreignId('product_id')->constrained()->cascadeOnDelete(); + $table->string('sku')->nullable()->index(); + $table->string('barcode')->nullable()->index(); + $table->unsignedInteger('price_amount')->default(0); + $table->unsignedInteger('compare_at_amount')->nullable(); + $table->string('currency', 3)->default('EUR'); + $table->unsignedInteger('weight_g')->nullable(); + $table->boolean('requires_shipping')->default(true); + $table->boolean('is_default')->default(false); + $table->unsignedInteger('position')->default(0); + $table->string('status')->default('active'); + $table->timestamps(); + $table->index(['product_id', 'position']); + $table->index(['product_id', 'is_default']); + }); + + Schema::create('variant_option_values', function (Blueprint $table): void { + $table->foreignId('variant_id')->constrained('product_variants')->cascadeOnDelete(); + $table->foreignId('product_option_value_id')->constrained()->cascadeOnDelete(); + $table->primary(['variant_id', 'product_option_value_id'], 'variant_option_values_pk'); + }); + + Schema::create('inventory_items', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->foreignId('variant_id')->constrained('product_variants')->cascadeOnDelete(); + $table->integer('quantity_available')->default(0); + $table->integer('quantity_reserved')->default(0); + $table->string('policy')->default('deny'); + $table->timestamps(); + $table->unique(['store_id', 'variant_id']); + }); + + Schema::create('collections', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->string('title'); + $table->string('handle'); + $table->text('description_html')->nullable(); + $table->boolean('is_published')->default(true); + $table->timestamps(); + $table->unique(['store_id', 'handle']); + }); + + Schema::create('collection_products', function (Blueprint $table): void { + $table->foreignId('collection_id')->constrained()->cascadeOnDelete(); + $table->foreignId('product_id')->constrained()->cascadeOnDelete(); + $table->unsignedInteger('position')->default(0); + $table->primary(['collection_id', 'product_id']); + }); + + Schema::create('product_media', function (Blueprint $table): void { + $table->id(); + $table->foreignId('product_id')->constrained()->cascadeOnDelete(); + $table->string('url'); + $table->string('alt_text')->nullable(); + $table->unsignedInteger('position')->default(0); + $table->timestamps(); + }); + + Schema::create('themes', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->string('name'); + $table->boolean('is_active')->default(false); + $table->json('settings_json')->default('{}'); + $table->timestamps(); + }); + + Schema::create('pages', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->string('title'); + $table->string('handle'); + $table->text('body_html'); + $table->boolean('is_published')->default(true); + $table->timestamps(); + $table->unique(['store_id', 'handle']); + }); + + Schema::create('navigation_menus', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->string('title'); + $table->string('handle'); + $table->timestamps(); + $table->unique(['store_id', 'handle']); + }); + + Schema::create('navigation_items', function (Blueprint $table): void { + $table->id(); + $table->foreignId('navigation_menu_id')->constrained()->cascadeOnDelete(); + $table->foreignId('parent_id')->nullable()->constrained('navigation_items')->nullOnDelete(); + $table->string('label'); + $table->string('url'); + $table->unsignedInteger('position')->default(0); + $table->timestamps(); + }); + + Schema::create('customers', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->string('email'); + $table->string('name'); + $table->string('password_hash')->nullable(); + $table->boolean('accepts_marketing')->default(false); + $table->timestamp('last_login_at')->nullable(); + $table->rememberToken(); + $table->timestamps(); + $table->unique(['store_id', 'email']); + }); + + Schema::create('customer_addresses', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->foreignId('customer_id')->constrained()->cascadeOnDelete(); + $table->string('name'); + $table->string('address1'); + $table->string('address2')->nullable(); + $table->string('city'); + $table->string('postal_code'); + $table->string('country_code', 2); + $table->boolean('is_default')->default(false); + $table->timestamps(); + }); + + Schema::create('customer_password_reset_tokens', function (Blueprint $table): void { + $table->string('email'); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->string('token'); + $table->timestamp('created_at')->nullable(); + $table->primary(['store_id', 'email']); + }); + + Schema::create('carts', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->foreignId('customer_id')->nullable()->constrained()->nullOnDelete(); + $table->string('currency', 3)->default('EUR'); + $table->unsignedInteger('cart_version')->default(1); + $table->string('status')->default('active'); + $table->string('discount_code')->nullable(); + $table->timestamps(); + }); + + Schema::create('cart_lines', function (Blueprint $table): void { + $table->id(); + $table->foreignId('cart_id')->constrained()->cascadeOnDelete(); + $table->foreignId('product_variant_id')->constrained('product_variants')->cascadeOnDelete(); + $table->unsignedInteger('quantity'); + $table->unsignedInteger('unit_price_amount'); + $table->json('snapshot_json')->default('{}'); + $table->timestamps(); + $table->unique(['cart_id', 'product_variant_id']); + }); + + Schema::create('shipping_zones', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->string('name'); + $table->json('countries')->default('[]'); + $table->timestamps(); + }); + + Schema::create('shipping_rates', function (Blueprint $table): void { + $table->id(); + $table->foreignId('shipping_zone_id')->constrained()->cascadeOnDelete(); + $table->string('name'); + $table->unsignedInteger('price_amount'); + $table->unsignedInteger('min_order_amount')->nullable(); + $table->timestamps(); + }); + + Schema::create('tax_settings', function (Blueprint $table): void { + $table->foreignId('store_id')->primary()->constrained()->cascadeOnDelete(); + $table->boolean('prices_include_tax')->default(false); + $table->unsignedInteger('default_rate_bps')->default(1900); + $table->timestamp('updated_at')->nullable(); + }); + + Schema::create('discounts', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->string('code'); + $table->string('type'); + $table->unsignedInteger('value_amount')->default(0); + $table->unsignedInteger('value_bps')->default(0); + $table->unsignedInteger('min_purchase_amount')->nullable(); + $table->unsignedInteger('usage_limit')->nullable(); + $table->unsignedInteger('used_count')->default(0); + $table->timestamp('starts_at')->nullable(); + $table->timestamp('ends_at')->nullable(); + $table->boolean('is_active')->default(true); + $table->timestamps(); + $table->unique(['store_id', 'code']); + }); + + Schema::create('checkouts', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->foreignId('cart_id')->constrained()->cascadeOnDelete(); + $table->foreignId('customer_id')->nullable()->constrained()->nullOnDelete(); + $table->string('status')->default('started'); + $table->string('email')->nullable(); + $table->json('shipping_address_json')->nullable(); + $table->foreignId('shipping_rate_id')->nullable()->constrained()->nullOnDelete(); + $table->string('payment_method')->nullable(); + $table->foreignId('order_id')->nullable()->constrained()->nullOnDelete(); + $table->json('totals_json')->default('{}'); + $table->timestamps(); + }); + + Schema::create('orders', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->foreignId('customer_id')->nullable()->constrained()->nullOnDelete(); + $table->string('order_number'); + $table->string('email'); + $table->string('status')->default('pending'); + $table->string('financial_status')->default('pending'); + $table->string('fulfillment_status')->default('unfulfilled'); + $table->string('currency', 3)->default('EUR'); + $table->unsignedInteger('subtotal_amount')->default(0); + $table->unsignedInteger('discount_amount')->default(0); + $table->unsignedInteger('shipping_amount')->default(0); + $table->unsignedInteger('tax_amount')->default(0); + $table->unsignedInteger('total_amount')->default(0); + $table->json('shipping_address_json')->nullable(); + $table->json('timeline_json')->default('[]'); + $table->timestamps(); + $table->unique(['store_id', 'order_number']); + }); + + Schema::create('order_lines', function (Blueprint $table): void { + $table->id(); + $table->foreignId('order_id')->constrained()->cascadeOnDelete(); + $table->foreignId('product_variant_id')->nullable()->constrained('product_variants')->nullOnDelete(); + $table->string('title'); + $table->string('sku')->nullable(); + $table->unsignedInteger('quantity'); + $table->unsignedInteger('unit_price_amount'); + $table->unsignedInteger('total_amount'); + $table->json('snapshot_json')->default('{}'); + $table->timestamps(); + }); + + Schema::create('payments', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->foreignId('order_id')->constrained()->cascadeOnDelete(); + $table->string('provider')->default('mock'); + $table->string('method'); + $table->string('status'); + $table->unsignedInteger('amount'); + $table->string('reference')->nullable(); + $table->text('raw_payload_encrypted')->nullable(); + $table->timestamps(); + }); + + Schema::create('refunds', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->foreignId('order_id')->constrained()->cascadeOnDelete(); + $table->unsignedInteger('amount'); + $table->string('reason')->nullable(); + $table->boolean('restocked')->default(false); + $table->timestamps(); + }); + + Schema::create('fulfillments', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->foreignId('order_id')->constrained()->cascadeOnDelete(); + $table->string('status')->default('created'); + $table->string('tracking_number')->nullable(); + $table->timestamp('shipped_at')->nullable(); + $table->timestamp('delivered_at')->nullable(); + $table->timestamps(); + }); + + Schema::create('fulfillment_lines', function (Blueprint $table): void { + $table->id(); + $table->foreignId('fulfillment_id')->constrained()->cascadeOnDelete(); + $table->foreignId('order_line_id')->constrained()->cascadeOnDelete(); + $table->unsignedInteger('quantity'); + }); + + Schema::create('search_settings', function (Blueprint $table): void { + $table->foreignId('store_id')->primary()->constrained()->cascadeOnDelete(); + $table->json('synonyms_json')->default('[]'); + $table->json('stopwords_json')->default('[]'); + $table->timestamp('updated_at')->nullable(); + }); + + Schema::create('search_queries', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->string('query'); + $table->unsignedInteger('results_count')->default(0); + $table->timestamp('created_at')->nullable(); + }); + + Schema::create('analytics_events', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->string('event'); + $table->json('payload_json')->default('{}'); + $table->timestamp('created_at')->nullable(); + }); + + Schema::create('analytics_daily', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->date('date'); + $table->unsignedInteger('visitors')->default(0); + $table->unsignedInteger('orders_count')->default(0); + $table->unsignedInteger('sales_amount')->default(0); + $table->unique(['store_id', 'date']); + }); + + Schema::create('apps', function (Blueprint $table): void { + $table->id(); + $table->string('name'); + $table->string('handle')->unique(); + $table->json('scopes')->default('[]'); + $table->timestamps(); + }); + + Schema::create('app_installations', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->foreignId('app_id')->constrained()->cascadeOnDelete(); + $table->string('status')->default('installed'); + $table->timestamps(); + }); + + Schema::create('webhook_subscriptions', function (Blueprint $table): void { + $table->id(); + $table->foreignId('store_id')->constrained()->cascadeOnDelete(); + $table->string('topic'); + $table->string('endpoint_url'); + $table->string('secret'); + $table->boolean('is_active')->default(true); + $table->timestamps(); + }); + + Schema::create('webhook_deliveries', function (Blueprint $table): void { + $table->id(); + $table->foreignId('webhook_subscription_id')->constrained()->cascadeOnDelete(); + $table->string('status')->default('pending'); + $table->unsignedInteger('attempts')->default(0); + $table->json('payload_json')->default('{}'); + $table->timestamp('created_at')->nullable(); + }); + } + + public function down(): void + { + foreach ([ + 'webhook_deliveries', + 'webhook_subscriptions', + 'app_installations', + 'apps', + 'analytics_daily', + 'analytics_events', + 'search_queries', + 'search_settings', + 'fulfillment_lines', + 'fulfillments', + 'refunds', + 'payments', + 'order_lines', + 'orders', + 'checkouts', + 'discounts', + 'tax_settings', + 'shipping_rates', + 'shipping_zones', + 'cart_lines', + 'carts', + 'customer_password_reset_tokens', + 'customer_addresses', + 'customers', + 'navigation_items', + 'navigation_menus', + 'pages', + 'themes', + 'product_media', + 'collection_products', + 'collections', + 'inventory_items', + 'variant_option_values', + 'product_variants', + 'product_option_values', + 'product_options', + 'products', + 'store_settings', + 'store_users', + 'store_domains', + 'stores', + 'organizations', + ] as $table) { + Schema::dropIfExists($table); + } + } +}; diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index d01a0ef2..f71e1d32 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -2,22 +2,403 @@ namespace Database\Seeders; +use App\Models\AnalyticsEvent; +use App\Models\Collection; +use App\Models\Customer; +use App\Models\CustomerAddress; +use App\Models\Discount; +use App\Models\InventoryItem; +use App\Models\NavigationItem; +use App\Models\NavigationMenu; +use App\Models\Order; +use App\Models\Organization; +use App\Models\Page; +use App\Models\Product; +use App\Models\ProductMedia; +use App\Models\ProductOption; +use App\Models\ProductOptionValue; +use App\Models\ProductVariant; +use App\Models\ShippingRate; +use App\Models\ShippingZone; +use App\Models\Store; +use App\Models\StoreDomain; +use App\Models\StoreSettings; +use App\Models\TaxSettings; +use App\Models\Theme; use App\Models\User; -// use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; +use Illuminate\Support\Facades\Hash; class DatabaseSeeder extends Seeder { - /** - * Seed the application's database. - */ public function run(): void { - // User::factory(10)->create(); + $organization = Organization::query()->updateOrCreate( + ['billing_email' => 'billing@acme.test'], + ['name' => 'Acme Commerce Group'], + ); + + $fashion = Store::query()->updateOrCreate( + ['handle' => 'acme-fashion'], + [ + 'organization_id' => $organization->id, + 'name' => 'Acme Fashion', + 'status' => 'active', + 'default_currency' => 'EUR', + 'default_locale' => 'en', + 'timezone' => 'Europe/Berlin', + ], + ); + + $electronics = Store::query()->updateOrCreate( + ['handle' => 'acme-electronics'], + [ + 'organization_id' => $organization->id, + 'name' => 'Acme Electronics', + 'status' => 'active', + 'default_currency' => 'EUR', + 'default_locale' => 'en', + 'timezone' => 'Europe/Berlin', + ], + ); + + foreach ([['shop.test', $fashion], ['acme-fashion.test', $fashion], ['admin.acme-fashion.test', $fashion], ['acme-electronics.test', $electronics]] as [$host, $store]) { + StoreDomain::query()->updateOrCreate( + ['hostname' => $host], + ['store_id' => $store->id, 'type' => str_starts_with($host, 'admin.') ? 'admin' : 'storefront', 'is_primary' => $host === 'acme-fashion.test'], + ); + } - User::factory()->create([ - 'name' => 'Test User', - 'email' => 'test@example.com', + foreach ([$fashion, $electronics] as $store) { + StoreSettings::query()->updateOrCreate( + ['store_id' => $store->id], + ['settings_json' => [ + 'contact_email' => 'hello@'.$store->handle.'.test', + 'announcement' => 'Free shipping over 75 EUR', + 'hero_heading' => $store->name, + 'hero_subheading' => 'Independent commerce, ready to buy.', + ]], + ); + + TaxSettings::query()->updateOrCreate( + ['store_id' => $store->id], + ['prices_include_tax' => false, 'default_rate_bps' => 1900], + ); + } + + $admin = $this->user('admin@acme.test', 'Admin User'); + $staff = $this->user('staff@acme.test', 'Staff User'); + $support = $this->user('support@acme.test', 'Support User'); + $manager = $this->user('manager@acme.test', 'Store Manager'); + $adminTwo = $this->user('admin2@acme.test', 'Admin Two'); + + $fashion->users()->syncWithoutDetaching([ + $admin->id => ['role' => 'owner'], + $staff->id => ['role' => 'staff'], + $support->id => ['role' => 'support'], + $manager->id => ['role' => 'admin'], ]); + $electronics->users()->syncWithoutDetaching([$adminTwo->id => ['role' => 'owner']]); + + $this->shipping($fashion); + $this->shipping($electronics); + $this->discounts($fashion); + + $collections = $this->collections($fashion); + $products = $this->fashionProducts($fashion, $collections); + $this->electronicsProducts($electronics); + + $customer = $this->customer($fashion, 'customer@acme.test', 'John Doe'); + $this->customer($fashion, 'jane@example.com', 'Jane Smith'); + $this->customer($electronics, 'techfan@example.com', 'Tech Fan'); + + $this->content($fashion); + $this->content($electronics); + $this->orders($fashion, $customer, $products); + $this->analytics($fashion); + } + + private function user(string $email, string $name): User + { + return User::query()->updateOrCreate( + ['email' => $email], + [ + 'name' => $name, + 'password_hash' => Hash::make('password'), + 'status' => 'active', + 'email_verified_at' => now(), + 'last_login_at' => now(), + ], + ); + } + + private function customer(Store $store, string $email, string $name): Customer + { + $customer = Customer::withoutGlobalScopes()->updateOrCreate( + ['store_id' => $store->id, 'email' => $email], + [ + 'name' => $name, + 'password_hash' => Hash::make('password'), + 'accepts_marketing' => true, + ], + ); + + CustomerAddress::withoutGlobalScopes()->updateOrCreate( + ['store_id' => $store->id, 'customer_id' => $customer->id, 'address1' => 'Main Street 1'], + [ + 'name' => $name, + 'city' => 'Berlin', + 'postal_code' => '10115', + 'country_code' => 'DE', + 'is_default' => true, + ], + ); + + return $customer; + } + + private function shipping(Store $store): void + { + $germany = ShippingZone::withoutGlobalScopes()->updateOrCreate( + ['store_id' => $store->id, 'name' => 'Germany'], + ['countries' => ['DE']], + ); + ShippingRate::query()->updateOrCreate( + ['shipping_zone_id' => $germany->id, 'name' => 'Standard Shipping'], + ['price_amount' => 499], + ); + ShippingRate::query()->updateOrCreate( + ['shipping_zone_id' => $germany->id, 'name' => 'Free Shipping'], + ['price_amount' => 0, 'min_order_amount' => 7500], + ); + + $international = ShippingZone::withoutGlobalScopes()->updateOrCreate( + ['store_id' => $store->id, 'name' => 'International'], + ['countries' => ['*']], + ); + ShippingRate::query()->updateOrCreate( + ['shipping_zone_id' => $international->id, 'name' => 'International Shipping'], + ['price_amount' => 1499], + ); + } + + private function discounts(Store $store): void + { + $rows = [ + ['WELCOME10', 'percentage', 0, 1000, null, null, 0, true, now()->subDay(), now()->addYear()], + ['FLAT5', 'fixed_amount', 500, 0, null, null, 0, true, now()->subDay(), now()->addYear()], + ['FREESHIP', 'free_shipping', 0, 0, null, null, 0, true, now()->subDay(), now()->addYear()], + ['EXPIRED', 'percentage', 0, 1500, null, null, 0, true, now()->subMonth(), now()->subDay()], + ['MAXED', 'percentage', 0, 1500, null, 1, 1, true, now()->subDay(), now()->addYear()], + ]; + + foreach ($rows as [$code, $type, $amount, $bps, $minimum, $limit, $used, $active, $start, $end]) { + Discount::withoutGlobalScopes()->updateOrCreate( + ['store_id' => $store->id, 'code' => $code], + [ + 'type' => $type, + 'value_amount' => $amount, + 'value_bps' => $bps, + 'min_purchase_amount' => $minimum, + 'usage_limit' => $limit, + 'used_count' => $used, + 'is_active' => $active, + 'starts_at' => $start, + 'ends_at' => $end, + ], + ); + } + } + + /** + * @return array + */ + private function collections(Store $store): array + { + $collections = []; + + foreach ([['t-shirts', 'T-Shirts'], ['new-arrivals', 'New Arrivals'], ['sale', 'Sale']] as [$handle, $title]) { + $collections[$handle] = Collection::withoutGlobalScopes()->updateOrCreate( + ['store_id' => $store->id, 'handle' => $handle], + ['title' => $title, 'description_html' => '

'.$title.' from Acme Fashion.

', 'is_published' => true], + ); + } + + return $collections; + } + + /** + * @param array $collections + * @return array + */ + private function fashionProducts(Store $store, array $collections): array + { + $rows = [ + ['classic-cotton-t-shirt', 'Classic Cotton T-Shirt', 2499, 3499, 25, 'deny', 'T-Shirts', ['t-shirts', 'new-arrivals']], + ['linen-summer-shirt', 'Linen Summer Shirt', 4999, null, 12, 'deny', 'Shirts', ['new-arrivals']], + ['denim-jacket', 'Denim Jacket', 8999, null, 8, 'deny', 'Outerwear', ['new-arrivals']], + ['black-skinny-jeans', 'Black Skinny Jeans', 6999, null, 9, 'deny', 'Pants', ['sale']], + ['wool-beanie', 'Wool Beanie', 1999, null, 0, 'continue', 'Accessories', ['sale']], + ['sold-out-sneakers', 'Sold Out Sneakers', 7999, null, 0, 'deny', 'Shoes', ['new-arrivals']], + ['draft-rain-coat', 'Draft Rain Coat', 12999, null, 6, 'deny', 'Outerwear', []], + ]; + + $products = []; + + for ($i = count($rows) + 1; $i <= 20; $i++) { + $rows[] = ["essential-item-{$i}", "Essential Item {$i}", 1500 + ($i * 250), null, 10 + $i, 'deny', 'Essentials', ['new-arrivals']]; + } + + foreach ($rows as [$handle, $title, $price, $compare, $quantity, $policy, $type, $collectionHandles]) { + $status = str_starts_with($handle, 'draft-') ? 'draft' : 'active'; + $product = Product::withoutGlobalScopes()->updateOrCreate( + ['store_id' => $store->id, 'handle' => $handle], + [ + 'title' => $title, + 'status' => $status, + 'description_html' => '

'.$title.' designed for everyday commerce testing.

', + 'vendor' => 'Acme', + 'product_type' => $type, + 'tags' => [$type, 'acme'], + 'published_at' => $status === 'active' ? now() : null, + ], + ); + + $variant = $this->variant($store, $product, $price, $compare, $quantity, $policy); + + ProductMedia::query()->updateOrCreate( + ['product_id' => $product->id, 'position' => 0], + ['url' => 'https://placehold.co/900x1100/e5e7eb/111827?text='.urlencode($title), 'alt_text' => $title], + ); + + foreach ($collectionHandles as $collectionHandle) { + $collections[$collectionHandle]->products()->syncWithoutDetaching([$product->id => ['position' => $product->id]]); + } + + $products[$product->id] = $product->setRelation('defaultVariant', $variant); + } + + return $products; + } + + private function variant(Store $store, Product $product, int $price, ?int $compare, int $quantity, string $policy): ProductVariant + { + $size = ProductOption::query()->firstOrCreate(['product_id' => $product->id, 'position' => 1], ['name' => 'Size']); + $color = ProductOption::query()->firstOrCreate(['product_id' => $product->id, 'position' => 2], ['name' => 'Color']); + $medium = ProductOptionValue::query()->firstOrCreate(['product_option_id' => $size->id, 'position' => 1], ['value' => 'Medium']); + $black = ProductOptionValue::query()->firstOrCreate(['product_option_id' => $color->id, 'position' => 1], ['value' => 'Black']); + + $variant = ProductVariant::query()->updateOrCreate( + ['product_id' => $product->id, 'position' => 0], + [ + 'sku' => strtoupper(str_replace('-', '-', $product->handle)).'-M-BLK', + 'price_amount' => $price, + 'compare_at_amount' => $compare, + 'currency' => $store->default_currency, + 'weight_g' => 400, + 'requires_shipping' => true, + 'is_default' => true, + 'status' => 'active', + ], + ); + $variant->optionValues()->syncWithoutDetaching([$medium->id, $black->id]); + + InventoryItem::withoutGlobalScopes()->updateOrCreate( + ['store_id' => $store->id, 'variant_id' => $variant->id], + ['quantity_available' => $quantity, 'quantity_reserved' => 0, 'policy' => $policy], + ); + + return $variant; + } + + private function electronicsProducts(Store $store): void + { + foreach ([['wireless-headphones', 'Wireless Headphones', 12999], ['usb-c-hub', 'USB-C Hub', 3999], ['desk-lamp', 'Desk Lamp', 5999], ['portable-speaker', 'Portable Speaker', 8999], ['keyboard', 'Mechanical Keyboard', 11999]] as [$handle, $title, $price]) { + $product = Product::withoutGlobalScopes()->updateOrCreate( + ['store_id' => $store->id, 'handle' => $handle], + ['title' => $title, 'status' => 'active', 'description_html' => '

'.$title.'

', 'vendor' => 'Acme Electronics', 'product_type' => 'Electronics', 'tags' => ['electronics'], 'published_at' => now()], + ); + $this->variant($store, $product, $price, null, 15, 'deny'); + } + } + + private function content(Store $store): void + { + Theme::withoutGlobalScopes()->updateOrCreate( + ['store_id' => $store->id, 'name' => 'Default'], + ['is_active' => true, 'settings_json' => ['sticky_header' => true]], + ); + + Page::withoutGlobalScopes()->updateOrCreate( + ['store_id' => $store->id, 'handle' => 'about'], + ['title' => 'About', 'body_html' => '

About '.$store->name.'

We run a complete demo commerce operation.

', 'is_published' => true], + ); + + $menu = NavigationMenu::withoutGlobalScopes()->updateOrCreate( + ['store_id' => $store->id, 'handle' => 'main-menu'], + ['title' => 'Main menu'], + ); + + foreach ([['Home', '/'], ['Collections', '/collections'], ['T-Shirts', '/collections/t-shirts'], ['Search', '/search'], ['About', '/pages/about']] as $position => [$label, $url]) { + NavigationItem::query()->updateOrCreate( + ['navigation_menu_id' => $menu->id, 'label' => $label], + ['url' => $url, 'position' => $position], + ); + } + } + + /** + * @param array $products + */ + private function orders(Store $store, Customer $customer, array $products): void + { + $first = collect($products)->firstWhere('handle', 'classic-cotton-t-shirt') ?? collect($products)->first(); + + foreach ([1001 => 'paid', 1002 => 'paid', 1004 => 'paid', 1005 => 'pending'] as $number => $financialStatus) { + $order = Order::withoutGlobalScopes()->updateOrCreate( + ['store_id' => $store->id, 'order_number' => (string) $number], + [ + 'customer_id' => $customer->id, + 'email' => $customer->email, + 'status' => $financialStatus, + 'financial_status' => $financialStatus, + 'fulfillment_status' => 'unfulfilled', + 'currency' => 'EUR', + 'subtotal_amount' => 2499, + 'discount_amount' => 0, + 'shipping_amount' => 499, + 'tax_amount' => 570, + 'total_amount' => 3568, + 'shipping_address_json' => ['name' => 'John Doe', 'address1' => 'Main Street 1', 'city' => 'Berlin', 'postal_code' => '10115', 'country_code' => 'DE'], + 'timeline_json' => [ + ['at' => now()->subDays(3)->toISOString(), 'message' => 'Order created'], + ['at' => now()->subDays(3)->toISOString(), 'message' => $financialStatus === 'paid' ? 'Payment captured' : 'Awaiting bank transfer'], + ], + ], + ); + + $variant = $first->defaultVariant()->first(); + $order->lines()->updateOrCreate( + ['product_variant_id' => $variant->id, 'title' => $first->title], + ['sku' => $variant->sku, 'quantity' => 1, 'unit_price_amount' => 2499, 'total_amount' => 2499, 'snapshot_json' => ['product_title' => $first->title]], + ); + + $order->payments()->updateOrCreate( + ['provider' => 'mock', 'method' => $financialStatus === 'pending' ? 'bank_transfer' : 'credit_card'], + ['store_id' => $store->id, 'status' => $financialStatus, 'amount' => 3568, 'reference' => 'seed-'.$number, 'raw_payload_encrypted' => encrypt(['seed' => true])], + ); + } + } + + private function analytics(Store $store): void + { + foreach (['visit', 'add_to_cart', 'checkout_started', 'checkout_completed'] as $event) { + AnalyticsEvent::withoutGlobalScopes()->create([ + 'store_id' => $store->id, + 'event' => $event, + 'payload_json' => ['seed' => true], + ]); + } } } + diff --git a/resources/views/admin/auth/login.blade.php b/resources/views/admin/auth/login.blade.php new file mode 100644 index 00000000..b9858427 --- /dev/null +++ b/resources/views/admin/auth/login.blade.php @@ -0,0 +1,24 @@ + + + + + + Admin login + + @vite(['resources/css/app.css', 'resources/js/app.js']) + + +
+ @csrf +

Admin login

+ @if($errors->any()) +
{{ $errors->first() }}
+ @endif +
+ + + +
+
+ + diff --git a/resources/views/admin/customers/index.blade.php b/resources/views/admin/customers/index.blade.php new file mode 100644 index 00000000..5852e2df --- /dev/null +++ b/resources/views/admin/customers/index.blade.php @@ -0,0 +1,12 @@ + +

Customers

+ +
+ diff --git a/resources/views/admin/customers/show.blade.php b/resources/views/admin/customers/show.blade.php new file mode 100644 index 00000000..a1dc1e1c --- /dev/null +++ b/resources/views/admin/customers/show.blade.php @@ -0,0 +1,23 @@ + +

{{ $customer->name }}

+

{{ $customer->email }}

+
+
+

Order history

+
+ @foreach($customer->orders as $order) + #{{ $order->order_number }} - + @endforeach +
+
+
+

Addresses

+
+ @foreach($customer->addresses as $address) +

{{ $address->address1 }}, {{ $address->postal_code }} {{ $address->city }}, {{ $address->country_code }}

+ @endforeach +
+
+
+
+ diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php new file mode 100644 index 00000000..d39cc62e --- /dev/null +++ b/resources/views/admin/dashboard.blade.php @@ -0,0 +1,32 @@ + +
+
+

Dashboard

+

Sales, orders, customers, and catalog status.

+
+ +
+
+

Total sales

+

Orders

{{ $orders->count() }}

+

Customers

{{ $customers }}

+

Products

{{ $products }}

+
+
+
+

Orders over time

+
+ @foreach(range(1, 12) as $bar) +
+ @endforeach +
+
+
+

Conversion funnel

+
+
Visits - 2400
Add to cart - 410
Checkout started - 180
Checkout completed - 64
+
+
+
+
+ diff --git a/resources/views/admin/discounts/index.blade.php b/resources/views/admin/discounts/index.blade.php new file mode 100644 index 00000000..df773cae --- /dev/null +++ b/resources/views/admin/discounts/index.blade.php @@ -0,0 +1,21 @@ + +
+

Discounts

Percentage, fixed amount, and free shipping codes.

+
+
+ @csrf + + + + +
+
+ @foreach($discounts as $discount) +
+ {{ $discount->code }} + {{ $discount->type->value }} {{ $discount->is_active ? 'active' : 'inactive' }} +
+ @endforeach +
+
+ diff --git a/resources/views/admin/orders/index.blade.php b/resources/views/admin/orders/index.blade.php new file mode 100644 index 00000000..c9ac6eea --- /dev/null +++ b/resources/views/admin/orders/index.blade.php @@ -0,0 +1,16 @@ + +

Orders

+
+ + +
+ +
+ diff --git a/resources/views/admin/orders/show.blade.php b/resources/views/admin/orders/show.blade.php new file mode 100644 index 00000000..5d0648a0 --- /dev/null +++ b/resources/views/admin/orders/show.blade.php @@ -0,0 +1,64 @@ + +
+

Order #{{ $order->order_number }}

{{ $order->email }} - {{ $order->financial_status }} / {{ $order->fulfillment_status }}

+
+ @if($order->payments->first()?->method === 'bank_transfer' && $order->financial_status !== 'paid') +
@csrf
+ @endif +
@csrf
+
+
+
+
+

Line items

+
+ @foreach($order->lines as $line) +
{{ $line->quantity }} x {{ $line->title }}
+ @endforeach +
+

Timeline

+
+ @foreach($order->timeline_json as $event) +
{{ $event['message'] }} {{ $event['at'] }}
+ @endforeach +
+

Fulfillments

+
+ @forelse($order->fulfillments as $fulfillment) +
+ {{ $fulfillment->status }} +
+
@csrf @method('PATCH')
+
@csrf @method('PATCH')
+
+
+ @empty +

No fulfillments yet.

+ @endforelse +
+
+ +
+
+ diff --git a/resources/views/admin/products/form.blade.php b/resources/views/admin/products/form.blade.php new file mode 100644 index 00000000..80bfee11 --- /dev/null +++ b/resources/views/admin/products/form.blade.php @@ -0,0 +1,13 @@ + +

{{ $product->exists ? 'Edit product' : 'Create product' }}

+
+ @csrf + @if($product->exists) @method('PATCH') @endif + + + + + +
+
+ diff --git a/resources/views/admin/products/index.blade.php b/resources/views/admin/products/index.blade.php new file mode 100644 index 00000000..b58e50c2 --- /dev/null +++ b/resources/views/admin/products/index.blade.php @@ -0,0 +1,31 @@ + +
+

Products

Search, filter, create, edit, and archive catalog products.

+ Create product +
+
+ + + +
+
+ + + + @foreach($products as $product) + + + + + + + @endforeach + +
ProductStatusPrice
{{ $product->title }}{{ $product->status->value }}@if($product->defaultVariant)@endif + Edit +
@csrf @method('PATCH')
+
+
+
{{ $products->links() }}
+
+ diff --git a/resources/views/admin/settings/index.blade.php b/resources/views/admin/settings/index.blade.php new file mode 100644 index 00000000..8f6375fe --- /dev/null +++ b/resources/views/admin/settings/index.blade.php @@ -0,0 +1,43 @@ + +

Settings

+
+
+ @csrf @method('PATCH') +

General

+ + +
+
+

Domains

+
+ @foreach($store->domains as $domain) +

{{ $domain->hostname }} - {{ $domain->type->value }}

+ @endforeach +
+
+
+

Shipping zones

+ @foreach($zones as $zone) +
+

{{ $zone->name }}

+ @foreach($zone->rates as $rate) +

{{ $rate->name }} -

+ @endforeach +
+ @endforeach +
+ @csrf + + + + +
+
+
+

Taxes

+

Prices include tax: {{ $tax->prices_include_tax ? 'Yes' : 'No' }}

+
@csrf @method('PATCH')
+
+
+
+ diff --git a/resources/views/admin/simple.blade.php b/resources/views/admin/simple.blade.php new file mode 100644 index 00000000..23bba14c --- /dev/null +++ b/resources/views/admin/simple.blade.php @@ -0,0 +1,14 @@ + +

{{ ucwords($section) }}

+

This admin section is available and scoped to {{ app('current_store')->name }}.

+
+ @forelse($records as $record) +
+ {{ $record->title ?? $record->name ?? $record->order_number ?? ('Record #'.$record->id) }} +
+ @empty +
No records yet.
+ @endforelse +
+
+ diff --git a/resources/views/components/admin/layout.blade.php b/resources/views/components/admin/layout.blade.php new file mode 100644 index 00000000..a9e81213 --- /dev/null +++ b/resources/views/components/admin/layout.blade.php @@ -0,0 +1,62 @@ + + + + + + {{ $title ?? 'Admin' }} - {{ app('current_store')->name ?? 'Shop' }} + + @vite(['resources/css/app.css', 'resources/js/app.js']) + + +
+ +
+
+
+

Current store

+

{{ app('current_store')->name }}

+
+
+ Storefront +
@csrf
+
+
+
+ @if(session('status')) +
{{ session('status') }}
+ @endif + @if($errors->any()) +
+ @foreach($errors->all() as $error) +

{{ $error }}

+ @endforeach +
+ @endif + {{ $slot }} +
+
+
+ + diff --git a/resources/views/components/shop/price.blade.php b/resources/views/components/shop/price.blade.php new file mode 100644 index 00000000..be9746ec --- /dev/null +++ b/resources/views/components/shop/price.blade.php @@ -0,0 +1,4 @@ +@props(['amount', 'currency' => 'EUR']) + +{{ \App\Services\Shop\Money::format((int) $amount, $currency) }} + diff --git a/resources/views/components/shop/product-card.blade.php b/resources/views/components/shop/product-card.blade.php new file mode 100644 index 00000000..75397fb1 --- /dev/null +++ b/resources/views/components/shop/product-card.blade.php @@ -0,0 +1,38 @@ +@props(['product']) + +@php($variant = $product->defaultVariant ?? $product->variants->first()) + +
+ + {{ $product->media->first()?->alt_text ?? $product->title }} + +
+
+

+ {{ $product->title }} +

+

{{ $product->product_type }}

+
+
+
+ @if($variant) + + @endif +
+ @if($variant) +
+ @csrf + + + +
+ @endif +
+
+
+ diff --git a/resources/views/components/storefront/layout.blade.php b/resources/views/components/storefront/layout.blade.php new file mode 100644 index 00000000..3fb07b8d --- /dev/null +++ b/resources/views/components/storefront/layout.blade.php @@ -0,0 +1,69 @@ + + + + + + {{ $title ?? app('current_store')->name }} - {{ app('current_store')->name }} + + @vite(['resources/css/app.css', 'resources/js/app.js']) + + + Skip to main content + +
+ {{ app('current_store')->settings?->settings_json['announcement'] ?? 'Free shipping over 75 EUR' }} +
+ +
+ +
+ +
+ @if(session('status')) +
+
{{ session('status') }}
+
+ @endif + @if($errors->any()) +
+
+ @foreach($errors->all() as $error) +

{{ $error }}

+ @endforeach +
+
+ @endif + {{ $slot }} +
+ +
+
+
+

{{ app('current_store')->name }}

+

Complete storefront demo with cart, checkout, accounts, and admin operations.

+
+ +
+ (c) {{ now()->year }} {{ app('current_store')->name }}. All rights reserved. +
+
+
+ + diff --git a/resources/views/storefront/account/addresses.blade.php b/resources/views/storefront/account/addresses.blade.php new file mode 100644 index 00000000..fa89164e --- /dev/null +++ b/resources/views/storefront/account/addresses.blade.php @@ -0,0 +1,28 @@ + +
+
+

Addresses

+
+ @foreach($addresses as $address) +
+

{{ $address->name }}

+

{{ $address->address1 }}, {{ $address->postal_code }} {{ $address->city }}, {{ $address->country_code }}

+
+ @endforeach +
+
+
+ @csrf +

Add address

+
+ + + + + + +
+
+
+
+ diff --git a/resources/views/storefront/account/dashboard.blade.php b/resources/views/storefront/account/dashboard.blade.php new file mode 100644 index 00000000..24b8fd94 --- /dev/null +++ b/resources/views/storefront/account/dashboard.blade.php @@ -0,0 +1,26 @@ + +
+
+
+

Account

+

{{ auth('customer')->user()->email }}

+
+
@csrf
+
+ +

Recent orders

+
+ @foreach($orders as $order) + + #{{ $order->order_number }} + + + @endforeach +
+
+
+ diff --git a/resources/views/storefront/account/login.blade.php b/resources/views/storefront/account/login.blade.php new file mode 100644 index 00000000..a3c0b13a --- /dev/null +++ b/resources/views/storefront/account/login.blade.php @@ -0,0 +1,13 @@ + +
+

Customer login

+
+ @csrf + + + +
+

No account? Register

+
+
+ diff --git a/resources/views/storefront/account/order.blade.php b/resources/views/storefront/account/order.blade.php new file mode 100644 index 00000000..3400f99d --- /dev/null +++ b/resources/views/storefront/account/order.blade.php @@ -0,0 +1,16 @@ + +
+

Order #{{ $order->order_number }}

+

{{ $order->financial_status }} / {{ $order->fulfillment_status }}

+
+ @foreach($order->lines as $line) +
+ {{ $line->quantity }} x {{ $line->title }} + +
+ @endforeach +
+

Total:

+
+
+ diff --git a/resources/views/storefront/account/orders.blade.php b/resources/views/storefront/account/orders.blade.php new file mode 100644 index 00000000..d3f26ecd --- /dev/null +++ b/resources/views/storefront/account/orders.blade.php @@ -0,0 +1,14 @@ + +
+

Orders

+
+ @foreach($orders as $order) + + #{{ $order->order_number }} - {{ $order->financial_status }} + + + @endforeach +
+
+
+ diff --git a/resources/views/storefront/account/register.blade.php b/resources/views/storefront/account/register.blade.php new file mode 100644 index 00000000..0d522aed --- /dev/null +++ b/resources/views/storefront/account/register.blade.php @@ -0,0 +1,14 @@ + +
+

Register

+
+ @csrf + + + + + +
+
+
+ diff --git a/resources/views/storefront/cart.blade.php b/resources/views/storefront/cart.blade.php new file mode 100644 index 00000000..c0f924aa --- /dev/null +++ b/resources/views/storefront/cart.blade.php @@ -0,0 +1,61 @@ + +
+
+

Cart

+
+ @forelse($cart->lines as $line) +
+ {{ $line->snapshot_json['product_title'] ?? 'Cart item' }} +
+

{{ $line->snapshot_json['product_title'] ?? $line->variant->product->title }}

+

{{ $line->snapshot_json['variant_title'] ?? '' }}

+

+
+
+ @csrf + @method('PATCH') + + +
+
+ @empty +
+

Your cart is empty.

+ Continue shopping +
+ @endforelse +
+
+ +
+
+ diff --git a/resources/views/storefront/checkout/confirmation.blade.php b/resources/views/storefront/checkout/confirmation.blade.php new file mode 100644 index 00000000..a683fffd --- /dev/null +++ b/resources/views/storefront/checkout/confirmation.blade.php @@ -0,0 +1,23 @@ + +
+
+

Order confirmed

+

Order #{{ $order->order_number }} has been created.

+
+
Status
{{ $order->financial_status }}
+
Total
+
Payment
{{ $order->payments->first()?->method }}
+
+ @if($order->payments->first()?->method === 'bank_transfer') +
+

Bank transfer instructions

+

IBAN: DE89370400440532013000

+

BIC: COBADEFFXXX

+

Reference: {{ $order->payments->first()?->reference }}

+
+ @endif + Continue shopping +
+
+
+ diff --git a/resources/views/storefront/checkout/show.blade.php b/resources/views/storefront/checkout/show.blade.php new file mode 100644 index 00000000..3ac6a042 --- /dev/null +++ b/resources/views/storefront/checkout/show.blade.php @@ -0,0 +1,47 @@ + +
+
+ @csrf +
+

Checkout

+
+ + + + + + +
+
+
+

Payment

+
+ + + + +
+
+ +
+ +
+
+ diff --git a/resources/views/storefront/collections/index.blade.php b/resources/views/storefront/collections/index.blade.php new file mode 100644 index 00000000..bb6d92a2 --- /dev/null +++ b/resources/views/storefront/collections/index.blade.php @@ -0,0 +1,14 @@ + +
+

Collections

+
+ @foreach($collections as $collection) + +

{{ $collection->title }}

+

{{ $collection->products_count }} products

+
+ @endforeach +
+
+
+ diff --git a/resources/views/storefront/collections/show.blade.php b/resources/views/storefront/collections/show.blade.php new file mode 100644 index 00000000..c6f9d756 --- /dev/null +++ b/resources/views/storefront/collections/show.blade.php @@ -0,0 +1,27 @@ + +
+ +
+
+

{{ $collection->title }}

+

{{ strip_tags($collection->description_html) }}

+
+
+ + +
+
+
+ @forelse($products as $product) + + @empty +

No products found.

+ @endforelse +
+
{{ $products->links() }}
+
+
+ diff --git a/resources/views/storefront/home.blade.php b/resources/views/storefront/home.blade.php new file mode 100644 index 00000000..9fe2b0f8 --- /dev/null +++ b/resources/views/storefront/home.blade.php @@ -0,0 +1,45 @@ + +
+
+
+

{{ app('current_store')->settings?->settings_json['hero_heading'] ?? app('current_store')->name }}

+

{{ app('current_store')->settings?->settings_json['hero_subheading'] ?? 'Products ready for checkout.' }}

+ +
+ Acme Fashion featured products +
+
+ +
+
+
+

Featured collections

+

Browse the seeded catalog by collection.

+
+ View all +
+
+ @foreach($collections as $collection) + +

{{ $collection->title }}

+

{{ strip_tags($collection->description_html) }}

+
+ @endforeach +
+
+ +
+
+

Featured products

+

Active products only. Drafts are hidden from the storefront.

+
+
+ @foreach($products as $product) + + @endforeach +
+
+
+ diff --git a/resources/views/storefront/page.blade.php b/resources/views/storefront/page.blade.php new file mode 100644 index 00000000..9b4c49cb --- /dev/null +++ b/resources/views/storefront/page.blade.php @@ -0,0 +1,7 @@ + +
+

{{ $page->title }}

+ {!! $page->body_html !!} +
+
+ diff --git a/resources/views/storefront/products/show.blade.php b/resources/views/storefront/products/show.blade.php new file mode 100644 index 00000000..10559c36 --- /dev/null +++ b/resources/views/storefront/products/show.blade.php @@ -0,0 +1,57 @@ + + @php($variant = $product->variants->firstWhere('is_default', true) ?? $product->variants->first()) + @php($inventory = $variant?->inventoryItem) +
+
+ {{ $product->media->first()?->alt_text ?? $product->title }} +
+
+ +
+

{{ $product->title }}

+
+ + @if($variant->compare_at_amount) + + @endif +
+
+ +
+ @foreach($product->options as $option) +
+ {{ $option->name }} +
+ @foreach($option->values as $value) + {{ $value->value }} + @endforeach +
+
+ @endforeach +
+ +
+ @if($inventory && $inventory->availableForSale() <= 0 && $inventory->policy === 'deny') + Out of stock. This product cannot be added to cart. + @elseif($inventory && $inventory->availableForSale() <= 0 && $inventory->policy === 'continue') + Backorder available. This product ships when stock returns. + @else + In stock. {{ $inventory?->availableForSale() ?? 0 }} available. + @endif +
+ +
+ @csrf + + + +
+ +
{!! $product->description_html !!}
+
+
+
+ diff --git a/resources/views/storefront/search.blade.php b/resources/views/storefront/search.blade.php new file mode 100644 index 00000000..cfc74b84 --- /dev/null +++ b/resources/views/storefront/search.blade.php @@ -0,0 +1,23 @@ + +
+

Search

+
+ + + +
+ @if($query !== '') +

{{ $products->count() }} results for "{{ $query }}"

+ @endif +
+ @forelse($products as $product) + + @empty + @if($query !== '') +

No results found.

+ @endif + @endforelse +
+
+
+ diff --git a/routes/web.php b/routes/web.php index f755f111..3a267040 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,13 +1,94 @@ name('home'); - Route::view('dashboard', 'dashboard') ->middleware(['auth', 'verified']) ->name('dashboard'); +Route::middleware('storefront')->group(function (): void { + Route::get('/', [StorefrontController::class, 'home'])->name('home'); + Route::get('/collections', [StorefrontController::class, 'collections'])->name('collections.index'); + Route::get('/collections/{handle}', [StorefrontController::class, 'collection'])->name('collections.show'); + Route::get('/products/{handle}', [StorefrontController::class, 'product'])->name('products.show'); + Route::get('/search', [StorefrontController::class, 'search'])->middleware('throttle:search')->name('search'); + Route::get('/pages/{handle}', [StorefrontController::class, 'page'])->name('pages.show'); + + Route::get('/cart', [CartController::class, 'show'])->name('cart.show'); + Route::post('/cart/lines', [CartController::class, 'add'])->name('cart.add'); + Route::patch('/cart/lines/{line}', [CartController::class, 'update'])->name('cart.update'); + Route::post('/cart/discount', [CartController::class, 'discount'])->name('cart.discount'); + Route::delete('/cart/discount', [CartController::class, 'removeDiscount'])->name('cart.discount.remove'); + Route::post('/cart/checkout', [CartController::class, 'checkout'])->middleware('throttle:checkout')->name('cart.checkout'); + + Route::get('/checkout/{checkout}', [CheckoutController::class, 'show'])->name('checkout.show'); + Route::post('/checkout/{checkout}', [CheckoutController::class, 'update'])->middleware('throttle:checkout')->name('checkout.update'); + Route::get('/checkout/confirmation/{orderNumber}', [CheckoutController::class, 'confirmation'])->name('checkout.confirmation'); + + Route::get('/account/login', [CustomerAccountController::class, 'login'])->name('account.login'); + Route::post('/account/login', [CustomerAccountController::class, 'authenticate'])->middleware('throttle:login')->name('account.authenticate'); + Route::get('/account/register', [CustomerAccountController::class, 'register'])->name('account.register'); + Route::post('/account/register', [CustomerAccountController::class, 'store'])->name('account.store'); + Route::post('/account/logout', [CustomerAccountController::class, 'logout'])->name('account.logout'); + + Route::middleware('auth:customer')->group(function (): void { + Route::get('/account', [CustomerAccountController::class, 'dashboard'])->name('account.dashboard'); + Route::get('/account/orders', [CustomerAccountController::class, 'orders'])->name('account.orders'); + Route::get('/account/orders/{orderNumber}', [CustomerAccountController::class, 'order'])->name('account.orders.show'); + Route::get('/account/addresses', [CustomerAccountController::class, 'addresses'])->name('account.addresses'); + Route::post('/account/addresses', [CustomerAccountController::class, 'saveAddress'])->name('account.addresses.save'); + }); +}); + require __DIR__.'/settings.php'; + +Route::prefix('admin')->name('admin.')->group(function (): void { + Route::get('/login', [AdminAuthController::class, 'login'])->name('login'); + Route::post('/login', [AdminAuthController::class, 'authenticate'])->middleware('throttle:login')->name('authenticate'); + Route::post('/logout', [AdminAuthController::class, 'logout'])->name('logout'); + + Route::middleware(['auth', 'verified', 'admin'])->group(function (): void { + Route::get('/', [AdminController::class, 'dashboard'])->name('dashboard'); + Route::get('/products', [AdminController::class, 'products'])->name('products.index'); + Route::get('/products/create', [AdminController::class, 'createProduct'])->name('products.create'); + Route::post('/products', [AdminController::class, 'storeProduct'])->name('products.store'); + Route::get('/products/{product}/edit', [AdminController::class, 'editProduct'])->name('products.edit'); + Route::patch('/products/{product}', [AdminController::class, 'updateProduct'])->name('products.update'); + Route::patch('/products/{product}/archive', [AdminController::class, 'archiveProduct'])->name('products.archive'); + + Route::get('/orders', [AdminController::class, 'orders'])->name('orders.index'); + Route::get('/orders/{order}', [AdminController::class, 'order'])->name('orders.show'); + Route::post('/orders/{order}/confirm-payment', [AdminController::class, 'confirmPayment'])->name('orders.confirm-payment'); + Route::post('/orders/{order}/refunds', [AdminController::class, 'refund'])->name('orders.refunds'); + Route::post('/orders/{order}/fulfillments', [AdminController::class, 'fulfill'])->name('orders.fulfillments'); + Route::patch('/fulfillments/{fulfillment}/ship', [AdminController::class, 'markShipped'])->name('fulfillments.ship'); + Route::patch('/fulfillments/{fulfillment}/deliver', [AdminController::class, 'markDelivered'])->name('fulfillments.deliver'); + + Route::get('/customers', [AdminController::class, 'customers'])->name('customers.index'); + Route::get('/customers/{customer}', [AdminController::class, 'customer'])->name('customers.show'); + + Route::get('/discounts', [AdminController::class, 'discounts'])->name('discounts.index'); + Route::post('/discounts', [AdminController::class, 'storeDiscount'])->name('discounts.store'); + + Route::get('/settings', [AdminController::class, 'settings'])->name('settings.index'); + Route::patch('/settings', [AdminController::class, 'updateSettings'])->name('settings.update'); + Route::post('/settings/shipping-rates', [AdminController::class, 'addShippingRate'])->name('settings.shipping-rates.store'); + Route::patch('/settings/taxes', [AdminController::class, 'toggleTax'])->name('settings.taxes.toggle'); + + Route::get('/collections', fn () => app(AdminController::class)->simple('collections'))->name('collections.index'); + Route::get('/inventory', fn () => app(AdminController::class)->simple('inventory'))->name('inventory.index'); + Route::get('/pages', fn () => app(AdminController::class)->simple('pages'))->name('pages.index'); + Route::get('/navigation', fn () => app(AdminController::class)->simple('navigation'))->name('navigation.index'); + Route::get('/themes', fn () => app(AdminController::class)->simple('themes'))->name('themes.index'); + Route::get('/analytics', fn () => app(AdminController::class)->simple('analytics'))->name('analytics.index'); + Route::get('/apps', fn () => app(AdminController::class)->simple('apps'))->name('apps.index'); + Route::get('/developers', fn () => app(AdminController::class)->simple('developers'))->name('developers.index'); + Route::get('/search/settings', fn () => app(AdminController::class)->simple('search settings'))->name('search.settings'); + }); +}); diff --git a/specs/progress.md b/specs/progress.md new file mode 100644 index 00000000..8ac13fcc --- /dev/null +++ b/specs/progress.md @@ -0,0 +1,46 @@ +# Shop Implementation Progress + +## 2026-04-25 + +### Iteration 0 - Kickoff + +- Status: in progress +- Scope: Read the specifications, activate Laravel/Livewire/Flux/Tailwind/Fortify/Pest workflows, and split the build into backend, frontend, and QA workstreams. +- Notes: + - Current app baseline is the Laravel/Fortify starter. + - No shop domain implementation existed at kickoff. + - Target local URL for final review: `http://shop.test/`. + +### Iteration 1 - Foundation, Schema, Services, Seed Data + +- Status: completed +- Scope: Added tenant-aware shop schema, core enums, Eloquent models, store resolution middleware, customer guard configuration, rate limiters, integer-money business services, and deterministic demo seed data. +- Verification: + - `php artisan migrate:fresh --seed --no-interaction` passed. +- Commit: `decd491c` - Build shop foundation schema and services + +### Iteration 2 - Storefront, Admin UI, and Pest Coverage + +- Status: completed +- Scope: Added storefront catalog/search/product/cart/checkout/account pages, admin login/dashboard/products/orders/customers/discounts/settings pages, route wiring, controller actions, Blade components, and focused Pest coverage for customer and admin acceptance paths. +- Verification: + - `php artisan test --compact` passed: 45 tests, 177 assertions. + - `npm run build` passed. + - `vendor/bin/pint --dirty --format agent` was run and formatting was applied. +- Commit: `133052fe` - Implement shop storefront admin and tests + +### Iteration 3 - Browser Review and Final Verification + +- Status: completed +- Scope: Verified customer-side and admin-side acceptance flows in Chrome through Playwright MCP, fixed favicon console noise, captured storefront/admin screenshots, and reran full automated verification. +- Playwright coverage: + - Storefront home, collection, product variant/stock states, cart discount, checkout with credit card, search results/no-results. + - Customer register/login/logout, order history/detail, address creation. + - Admin login, dashboard, product creation, orders list/detail, bank-transfer guard/confirmation, fulfillment creation, customers, discounts, settings/domains/shipping. + - Mobile viewport smoke for storefront home, product, cart, and admin login. + - Browser console check reported no errors or warnings after favicon fix. +- Verification: + - `vendor/bin/pint --dirty --format agent` passed. + - `php artisan test --compact` passed: 45 tests, 177 assertions. + - `npm run build` passed. +- Commit: `988b6e32` - Verify shop flows in browser diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index 8b5843f4..b5b40f8f 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -1,7 +1,11 @@ get('/'); + $this->seed(); + + $response = $this->withServerVariables(['HTTP_HOST' => 'shop.test'])->get('/'); $response->assertStatus(200); }); diff --git a/tests/Feature/Shop/AdminTest.php b/tests/Feature/Shop/AdminTest.php new file mode 100644 index 00000000..2265cb94 --- /dev/null +++ b/tests/Feature/Shop/AdminTest.php @@ -0,0 +1,91 @@ +seed(); +}); + +test('admin can log in and navigate core admin pages', function (): void { + $this->post('/admin/login', ['email' => 'admin@acme.test', 'password' => 'password']) + ->assertRedirect(route('admin.dashboard', absolute: false)); + + $this->get('/admin')->assertOk()->assertSee('Dashboard'); + $this->get('/admin/products')->assertOk()->assertSee('Classic Cotton T-Shirt'); + $this->get('/admin/orders')->assertOk()->assertSee('#1001'); + $this->get('/admin/customers')->assertOk()->assertSee('customer@acme.test'); + $this->get('/admin/discounts')->assertOk()->assertSee('WELCOME10'); + $this->get('/admin/settings')->assertOk()->assertSee('shop.test')->assertSee('Shipping zones'); +}); + +test('admin can create edit and archive products', function (): void { + $user = User::query()->where('email', 'admin@acme.test')->firstOrFail(); + + $this->actingAs($user) + ->withSession(['current_store_id' => $user->stores()->first()->id]) + ->post('/admin/products', [ + 'title' => 'QA Jacket', + 'price_amount' => '42.50', + 'status' => 'active', + 'description_html' => '

QA Jacket

', + ]) + ->assertRedirect('/admin/products'); + + $product = Product::query()->where('title', 'QA Jacket')->firstOrFail(); + + $this->actingAs($user) + ->withSession(['current_store_id' => $user->stores()->first()->id]) + ->patch("/admin/products/{$product->id}", [ + 'title' => 'QA Jacket Updated', + 'price_amount' => '44.00', + 'status' => 'active', + 'description_html' => '

Updated

', + ]) + ->assertRedirect('/admin/products'); + + $this->actingAs($user) + ->withSession(['current_store_id' => $user->stores()->first()->id]) + ->patch("/admin/products/{$product->id}/archive") + ->assertRedirect(); + + expect($product->refresh()->status->value)->toBe('archived'); +}); + +test('admin order actions handle bank transfer fulfillment and refunds', function (): void { + $user = User::query()->where('email', 'admin@acme.test')->firstOrFail(); + $storeId = $user->stores()->first()->id; + $order = Order::query()->where('order_number', '1005')->firstOrFail(); + + $this->actingAs($user)->withSession(['current_store_id' => $storeId]) + ->post("/admin/orders/{$order->id}/fulfillments") + ->assertSessionHasErrors('order'); + + $this->actingAs($user)->withSession(['current_store_id' => $storeId]) + ->post("/admin/orders/{$order->id}/confirm-payment") + ->assertRedirect(); + + expect($order->refresh()->financial_status)->toBe('paid'); + + $this->actingAs($user)->withSession(['current_store_id' => $storeId]) + ->post("/admin/orders/{$order->id}/fulfillments") + ->assertRedirect(); + + $fulfillment = $order->refresh()->fulfillments()->firstOrFail(); + + $this->actingAs($user)->withSession(['current_store_id' => $storeId]) + ->patch("/admin/fulfillments/{$fulfillment->id}/ship") + ->assertRedirect(); + + expect($fulfillment->refresh()->status)->toBe('shipped'); + + $this->actingAs($user)->withSession(['current_store_id' => $storeId]) + ->post("/admin/orders/{$order->id}/refunds", ['amount' => '5.00']) + ->assertRedirect(); + + expect($order->refresh()->financial_status)->toBe('partially_refunded'); +}); diff --git a/tests/Feature/Shop/CheckoutTest.php b/tests/Feature/Shop/CheckoutTest.php new file mode 100644 index 00000000..e6393a2d --- /dev/null +++ b/tests/Feature/Shop/CheckoutTest.php @@ -0,0 +1,83 @@ +seed(); + $this->withServerVariables(['HTTP_HOST' => 'shop.test']); +}); + +function addDefaultProductToCart($test): void +{ + $variant = Product::withoutGlobalScopes() + ->where('handle', 'classic-cotton-t-shirt') + ->firstOrFail() + ->defaultVariant() + ->firstOrFail(); + + $test->post('/cart/lines', ['variant_id' => $variant->id, 'quantity' => 1]); +} + +test('credit card checkout creates a paid order exactly once', function (): void { + addDefaultProductToCart($this); + + $checkoutId = (int) basename($this->post('/cart/checkout')->headers->get('Location')); + + $payload = [ + 'email' => 'buyer@example.com', + 'name' => 'Buyer Example', + 'address1' => 'Main Street 1', + 'city' => 'Berlin', + 'postal_code' => '10115', + 'country_code' => 'DE', + 'payment_method' => 'credit_card', + 'card_number' => '4242 4242 4242 4242', + ]; + + $this->post("/checkout/{$checkoutId}", $payload) + ->assertRedirectContains('/checkout/confirmation/'); + + $order = Order::query()->where('email', 'buyer@example.com')->firstOrFail(); + + expect($order->financial_status)->toBe('paid') + ->and($order->lines)->toHaveCount(1); + + $this->post("/checkout/{$checkoutId}", $payload)->assertRedirectContains('/checkout/confirmation/'); + + expect(Order::query()->where('email', 'buyer@example.com')->count())->toBe(1); +}); + +test('mock payment provider exposes decline and bank transfer flows', function (): void { + addDefaultProductToCart($this); + $checkoutId = (int) basename($this->post('/cart/checkout')->headers->get('Location')); + + $base = [ + 'email' => 'declined@example.com', + 'name' => 'Declined Buyer', + 'address1' => 'Main Street 1', + 'city' => 'Berlin', + 'postal_code' => '10115', + 'country_code' => 'DE', + 'payment_method' => 'credit_card', + ]; + + $this->post("/checkout/{$checkoutId}", $base + ['card_number' => '4000 0000 0000 0002']) + ->assertSessionHasErrors('payment'); + + addDefaultProductToCart($this); + $checkoutId = (int) basename($this->post('/cart/checkout')->headers->get('Location')); + + $this->post("/checkout/{$checkoutId}", array_merge($base, [ + 'email' => 'bank@example.com', + 'payment_method' => 'bank_transfer', + ]))->assertRedirectContains('/checkout/confirmation/'); + + $this->get('/checkout/confirmation/'.Order::query()->where('email', 'bank@example.com')->value('order_number')) + ->assertOk() + ->assertSee('Bank transfer instructions') + ->assertSee('DE89370400440532013000'); +}); diff --git a/tests/Feature/Shop/CustomerAccountTest.php b/tests/Feature/Shop/CustomerAccountTest.php new file mode 100644 index 00000000..49f73d5b --- /dev/null +++ b/tests/Feature/Shop/CustomerAccountTest.php @@ -0,0 +1,55 @@ +seed(); + $this->withServerVariables(['HTTP_HOST' => 'shop.test']); +}); + +test('customer can register login view orders and manage addresses', function (): void { + $this->post('/account/register', [ + 'name' => 'New Customer', + 'email' => 'new@example.com', + 'password' => 'password123', + 'password_confirmation' => 'password123', + ])->assertRedirect('/account'); + + $this->post('/account/logout')->assertRedirect('/account/login'); + + $this->post('/account/login', ['email' => 'customer@acme.test', 'password' => 'password']) + ->assertRedirect('/account'); + + $this->get('/account')->assertOk()->assertSee('customer@acme.test'); + $this->get('/account/orders')->assertOk()->assertSee('#1001'); + $this->get('/account/orders/1001')->assertOk()->assertSee('Classic Cotton T-Shirt'); + $this->get('/account/addresses')->assertOk()->assertSee('Main Street 1'); + + $this->post('/account/addresses', [ + 'name' => 'John Doe', + 'address1' => 'Second Street 2', + 'city' => 'Berlin', + 'postal_code' => '10117', + 'country_code' => 'DE', + ])->assertRedirect(); + + $this->get('/account/addresses')->assertSee('Second Street 2'); +}); + +test('customer registration validates duplicate store email and password confirmation', function (): void { + $this->post('/account/register', [ + 'name' => 'John Doe', + 'email' => 'customer@acme.test', + 'password' => 'password123', + 'password_confirmation' => 'password123', + ])->assertSessionHasErrors('email'); + + $this->post('/account/register', [ + 'name' => 'John Doe', + 'email' => 'unique@example.com', + 'password' => 'password123', + 'password_confirmation' => 'different456', + ])->assertSessionHasErrors('password'); +}); diff --git a/tests/Feature/Shop/StorefrontTest.php b/tests/Feature/Shop/StorefrontTest.php new file mode 100644 index 00000000..2b3354dc --- /dev/null +++ b/tests/Feature/Shop/StorefrontTest.php @@ -0,0 +1,47 @@ +seed(); + $this->withServerVariables(['HTTP_HOST' => 'shop.test']); +}); + +test('storefront pages render active catalog content and hide draft products', function (): void { + $this->get('/')->assertOk()->assertSee('Acme Fashion')->assertSee('Classic Cotton T-Shirt'); + $this->get('/collections/t-shirts')->assertOk()->assertSee('Classic Cotton T-Shirt')->assertDontSee('Draft Rain Coat'); + $this->get('/products/classic-cotton-t-shirt')->assertOk()->assertSee('Medium')->assertSee('Black')->assertSee('In stock'); + $this->get('/products/sold-out-sneakers')->assertOk()->assertSee('Out of stock'); + $this->get('/products/wool-beanie')->assertOk()->assertSee('Backorder available'); + $this->get('/pages/about')->assertOk()->assertSee('About Acme Fashion'); +}); + +test('search is scoped and logs search queries', function (): void { + $this->get('/search?q=shirt') + ->assertOk() + ->assertSee('Classic Cotton T-Shirt') + ->assertDontSee('Wireless Headphones'); + + expect(SearchQuery::query()->where('query', 'shirt')->exists())->toBeTrue(); +}); + +test('cart accepts products, updates quantities, validates discounts, and starts checkout', function (): void { + $variant = Product::withoutGlobalScopes() + ->where('handle', 'classic-cotton-t-shirt') + ->firstOrFail() + ->defaultVariant() + ->firstOrFail(); + + $this->post('/cart/lines', ['variant_id' => $variant->id, 'quantity' => 1])->assertRedirect('/cart'); + $this->get('/cart')->assertOk()->assertSee('Classic Cotton T-Shirt')->assertSee('24.99 EUR'); + + $this->post('/cart/discount', ['discount_code' => 'WELCOME10'])->assertRedirect(); + $this->get('/cart')->assertSee('WELCOME10')->assertSee('Discount'); + + $this->post('/cart/discount', ['discount_code' => 'EXPIRED'])->assertSessionHasErrors('discount_code'); + $this->post('/cart/checkout')->assertRedirectContains('/checkout/'); +}); diff --git a/tests/Pest.php b/tests/Pest.php index 60f04a45..044de62f 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -13,7 +13,7 @@ pest()->extend(Tests\TestCase::class) // ->use(Illuminate\Foundation\Testing\RefreshDatabase::class) - ->in('Feature'); + ->in('Feature', 'Unit'); /* |-------------------------------------------------------------------------- diff --git a/tests/Unit/Shop/PricingServiceTest.php b/tests/Unit/Shop/PricingServiceTest.php new file mode 100644 index 00000000..4711eb61 --- /dev/null +++ b/tests/Unit/Shop/PricingServiceTest.php @@ -0,0 +1,40 @@ +seed(); + $store = Store::query()->where('handle', 'acme-fashion')->firstOrFail(); + app()->instance('current_store', $store); +}); + +test('money formatting uses storefront display convention', function (): void { + expect(Money::format(2499, 'EUR'))->toBe('24.99 EUR') + ->and(Money::format(149900, 'EUR'))->toBe('1,499.00 EUR') + ->and(Money::format(-1250, 'EUR'))->toBe('-12.50 EUR'); +}); + +test('pricing applies percentage fixed and usage limited discounts', function (): void { + $store = app('current_store'); + $variant = ProductVariant::query()->whereHas('product', fn ($query) => $query->where('handle', 'classic-cotton-t-shirt'))->firstOrFail(); + $cart = Cart::query()->create(['store_id' => $store->id, 'currency' => 'EUR', 'discount_code' => 'WELCOME10']); + CartLine::query()->create(['cart_id' => $cart->id, 'product_variant_id' => $variant->id, 'quantity' => 2, 'unit_price_amount' => 2499]); + + $totals = app(PricingService::class)->cartTotals($cart); + + expect($totals['subtotal'])->toBe(4998) + ->and($totals['discount'])->toBe(500); + + $cart->update(['discount_code' => 'MAXED']); + + expect(fn () => app(PricingService::class)->cartTotals($cart))->toThrow(ValidationException::class); +});