Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"permissions": {
"allow": [
"Bash(git add:*)",
"Bash(git commit:*)"
]
},
"enableAllProjectMcpServers": true,
"enabledMcpjsonServers": [
"laravel-boost",
Expand All @@ -7,11 +13,5 @@
"sandbox": {
"enabled": true,
"autoAllowBashIfSandboxed": true
},
"permissions": {
"allow": [
"Bash(git add:*)",
"Bash(git commit:*)"
]
}
}
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Mission

Implement the complete shop system defined in `specs/`. Work through `specs/09-IMPLEMENTATION-ROADMAP.md` phase by phase (1-12), referencing the other spec files as needed. Do not stop until all phases are complete and verified.

## Upfront Task List

Before writing any code, read all spec files and create the full task list covering all 12 phases. For every phase, pre-define:

1. The implementation tasks (grouped by teammate role).
2. The lifecycle steps (see below) -- each phase carries the same 9-step sequence, and every step must appear as a trackable task.

This means the task list is not just "what to build" but also "how to verify it." Every lifecycle step for every phase is a first-class task from day one, so nothing gets skipped or forgotten.

Overall, the task list will have ~120-130 tasks (10*12 plus final tasks).

## Phase Lifecycle

Each phase follows this strict sequence. Do not advance to the next phase until all steps are complete.

1. **Plan** -- Break the phase into tasks, assign to teammates, agree on approach.
2. **Develop** -- Implement the phase deliverables. Parallelize aggressively -- teammates work on separate files simultaneously.
3. **Automated Tests** -- Write Pest unit/feature tests, run them, fix failures until all pass.
4. **Manual Test Plan** -- Write a comprehensive manual test plan for the phase covering every user-facing flow and edge case. Maintain this in `specs/test-plan.md`. Test cases must map to specific acceptance criteria from the specs and track: test name, what it verifies, pass/fail status, and the spec section it covers.
5. **Browser Verification** -- Walk through every manual test case using Playwright MCP (non-scripted, interactive browser navigation). Click, fill forms, and visually confirm behavior.
6. **Log & Exception Check** -- Review application logs and browser console logs for errors and exceptions. Fix all issues found.
7. **Verify Background Jobs** -- Confirm all queued jobs, scheduled tasks, and cron jobs execute correctly and without errors.
8. **Fix & Repeat** -- Fix any issues found in steps 5-7, then repeat steps 5-7 until 100% of manual test cases pass with zero exceptions.
9. **Commit** -- Run `vendor/bin/pint --dirty`, commit with a message like `Phase N: <summary>`, update `specs/progress.md`.

## Final Regression

After all 12 phases are done:

1. Run `php artisan test` -- 100% of Pest tests must pass.
2. Run `vendor/bin/pint --dirty` -- zero formatting issues.
3. Audit the test plan against every spec file and confirm full coverage. Fill any gaps.
4. Re-execute every manual test case from every phase using Playwright MCP. Fix any issues and re-run until the full regression passes with zero failures.

## Team Mode

All work uses team mode. The team lead is strictly an orchestrator -- it never writes code, runs tests, does research, or verifies results directly. Every unit of work is delegated to a teammate.

### Delegation

- Use team mode (not sub-agents) for all delegation.
- Require plan mode for complex teammate tasks. Review and approve plans before implementation starts.
- Set up each teammate with focused, well-scoped context. Include all relevant spec excerpts and file paths -- teammates do not inherit the lead's conversation history.
- Proactively split work to prevent context overflow.
- Aim for 3-5 active teammates. Split work so teammates own separate files to avoid conflicts.
- When a teammate finishes, assign the next available task immediately.

### Team Structure

Organize teammates by concern. To avoid context overflow you must use a new set of teammates per phase. Example roles:

- **Backend**: Models, migrations, middleware, services, business logic, bug fixes
- **Admin UI**: Livewire components, admin views, Flux UI integration, bug fixes
- **Storefront UI**: Customer-facing Blade templates, Livewire components, Tailwind styling, bug fixes
- **QA Engineer**: Pest feature/unit tests, test data verification, bug reports back to lead
- **QA Analyst**: Maintains the testplan for manual testing and performs the manual verification using Playwright
38 changes: 38 additions & 0 deletions app/Auth/CustomerUserProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace App\Auth;

use App\Models\Customer;
use Illuminate\Auth\EloquentUserProvider;
use Illuminate\Contracts\Hashing\Hasher;

class CustomerUserProvider extends EloquentUserProvider
{
public function __construct(Hasher $hasher)
{
parent::__construct($hasher, Customer::class);
}

/**
* @param array<string, mixed> $credentials
*/
public function retrieveByCredentials(array $credentials): ?Customer
{
$query = $this->newModelQuery();

$store = app('current_store');
if ($store) {
$query->where('store_id', $store->id);
}

foreach ($credentials as $key => $value) {
if (str_contains($key, 'password')) {
continue;
}

$query->where($key, $value);
}

return $query->first();
}
}
19 changes: 19 additions & 0 deletions app/Contracts/PaymentProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Contracts;

use App\Enums\PaymentMethod;
use App\Models\Checkout;
use App\Models\Payment;
use App\Services\Payments\PaymentResult;
use App\Services\Payments\RefundResult;

interface PaymentProvider
{
/**
* @param array<string, mixed> $details
*/
public function charge(Checkout $checkout, PaymentMethod $method, array $details): PaymentResult;

public function refund(Payment $payment, int $amount): RefundResult;
}
10 changes: 10 additions & 0 deletions app/Enums/CartStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Enums;

enum CartStatus: string
{
case Active = 'active';
case Converted = 'converted';
case Abandoned = 'abandoned';
}
13 changes: 13 additions & 0 deletions app/Enums/CheckoutStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Enums;

enum CheckoutStatus: string
{
case Started = 'started';
case Addressed = 'addressed';
case ShippingSelected = 'shipping_selected';
case PaymentSelected = 'payment_selected';
case Completed = 'completed';
case Expired = 'expired';
}
10 changes: 10 additions & 0 deletions app/Enums/CollectionStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Enums;

enum CollectionStatus: string
{
case Draft = 'draft';
case Active = 'active';
case Archived = 'archived';
}
11 changes: 11 additions & 0 deletions app/Enums/DiscountStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Enums;

enum DiscountStatus: string
{
case Draft = 'draft';
case Active = 'active';
case Expired = 'expired';
case Disabled = 'disabled';
}
9 changes: 9 additions & 0 deletions app/Enums/DiscountType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace App\Enums;

enum DiscountType: string
{
case Code = 'code';
case Automatic = 'automatic';
}
10 changes: 10 additions & 0 deletions app/Enums/DiscountValueType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Enums;

enum DiscountValueType: string
{
case Percent = 'percent';
case Fixed = 'fixed';
case FreeShipping = 'free_shipping';
}
13 changes: 13 additions & 0 deletions app/Enums/FinancialStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Enums;

enum FinancialStatus: string
{
case Pending = 'pending';
case Authorized = 'authorized';
case Paid = 'paid';
case PartiallyRefunded = 'partially_refunded';
case Refunded = 'refunded';
case Voided = 'voided';
}
10 changes: 10 additions & 0 deletions app/Enums/FulfillmentShipmentStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Enums;

enum FulfillmentShipmentStatus: string
{
case Pending = 'pending';
case Shipped = 'shipped';
case Delivered = 'delivered';
}
10 changes: 10 additions & 0 deletions app/Enums/FulfillmentStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Enums;

enum FulfillmentStatus: string
{
case Unfulfilled = 'unfulfilled';
case Partial = 'partial';
case Fulfilled = 'fulfilled';
}
9 changes: 9 additions & 0 deletions app/Enums/InventoryPolicy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace App\Enums;

enum InventoryPolicy: string
{
case Deny = 'deny';
case Continue = 'continue';
}
10 changes: 10 additions & 0 deletions app/Enums/MediaStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Enums;

enum MediaStatus: string
{
case Processing = 'processing';
case Ready = 'ready';
case Failed = 'failed';
}
9 changes: 9 additions & 0 deletions app/Enums/MediaType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace App\Enums;

enum MediaType: string
{
case Image = 'image';
case Video = 'video';
}
11 changes: 11 additions & 0 deletions app/Enums/NavigationItemType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Enums;

enum NavigationItemType: string
{
case Link = 'link';
case Page = 'page';
case Collection = 'collection';
case Product = 'product';
}
12 changes: 12 additions & 0 deletions app/Enums/OrderStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace App\Enums;

enum OrderStatus: string
{
case Pending = 'pending';
case Paid = 'paid';
case Fulfilled = 'fulfilled';
case Cancelled = 'cancelled';
case Refunded = 'refunded';
}
10 changes: 10 additions & 0 deletions app/Enums/PageStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Enums;

enum PageStatus: string
{
case Draft = 'draft';
case Published = 'published';
case Archived = 'archived';
}
10 changes: 10 additions & 0 deletions app/Enums/PaymentMethod.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Enums;

enum PaymentMethod: string
{
case CreditCard = 'credit_card';
case Paypal = 'paypal';
case BankTransfer = 'bank_transfer';
}
11 changes: 11 additions & 0 deletions app/Enums/PaymentStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Enums;

enum PaymentStatus: string
{
case Pending = 'pending';
case Captured = 'captured';
case Failed = 'failed';
case Refunded = 'refunded';
}
10 changes: 10 additions & 0 deletions app/Enums/ProductStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Enums;

enum ProductStatus: string
{
case Draft = 'draft';
case Active = 'active';
case Archived = 'archived';
}
10 changes: 10 additions & 0 deletions app/Enums/RefundStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Enums;

enum RefundStatus: string
{
case Pending = 'pending';
case Processed = 'processed';
case Failed = 'failed';
}
11 changes: 11 additions & 0 deletions app/Enums/ShippingRateType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Enums;

enum ShippingRateType: string
{
case Flat = 'flat';
case Weight = 'weight';
case Price = 'price';
case Carrier = 'carrier';
}
10 changes: 10 additions & 0 deletions app/Enums/StoreDomainType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Enums;

enum StoreDomainType: string
{
case Storefront = 'storefront';
case Admin = 'admin';
case Api = 'api';
}
9 changes: 9 additions & 0 deletions app/Enums/StoreStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace App\Enums;

enum StoreStatus: string
{
case Active = 'active';
case Suspended = 'suspended';
}
Loading
Loading