Open
Conversation
Implements the multi-tenant foundation for the shop platform: - Migrations: organizations, stores, store_domains, store_users, store_settings, users mods - Core models: Organization, Store, StoreDomain, StoreUser (pivot), StoreSettings - Enums: StoreStatus, StoreUserRole, StoreDomainType - BelongsToStore trait + StoreScope for tenant isolation - ResolveStore middleware (hostname and admin session variants) - Admin Login Livewire component with rate limiting - CustomerUserProvider (customer guard) registered for Phase 6 - StorePolicy + ChecksStoreRole trait for authorization - Tests: TenantResolutionTest, StoreIsolationTest, AdminAuthTest (42 pass) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Migrations: products, product_options/values, product_variants, variant_option_values, inventory_items, collections, collection_products, product_media - Models + factories for all 7 catalog entities with BelongsToStore applied to Product, Collection, InventoryItem - Enums: ProductStatus, VariantStatus, CollectionStatus, CollectionType, MediaType, MediaStatus, InventoryPolicy - Services: ProductService (CRUD with transaction), VariantMatrixService (cartesian rebuild with orphan archival), InventoryService (reserve, release, commit, restock), HandleGenerator - Job: ProcessMediaUpload (stub, marks media Ready) - Exception: InsufficientInventoryException - Tests: ProductCrudTest, VariantTest, InventoryTest, CollectionTest, MediaUploadTest (21 new tests, 63 total passing) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Migrations: themes, theme_files, theme_settings, pages, navigation_menus, navigation_items - Models + factories: Theme (BelongsToStore), ThemeFile, ThemeSettings, Page (BelongsToStore), NavigationMenu (BelongsToStore), NavigationItem - Enums: ThemeStatus, PageStatus, NavigationItemType - Services: NavigationService (cached menu trees), ThemeSettingsService (cached store settings, registered as singleton) - Storefront base layout (layouts/storefront.blade.php) with announcement, header, footer, cart drawer slot - Storefront partials (announcement, header, footer) wired to NavigationService - Error pages (404, 503) using storefront layout - Storefront\Home Livewire component with hero, featured collections, recent products grid - Blade components: storefront.product-card, storefront.price - Routes: GET / and GET /storefront pointing to Home - Tests: ThemeTest, ThemeSettingsTest, PageTest, NavigationTest, Storefront\HomeTest (16 new tests, 79 total passing) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Migrations: carts, cart_lines, checkouts, shipping_zones,
shipping_rates, tax_settings, discounts
- Models + factories with BelongsToStore on Cart, Checkout,
ShippingZone, Discount; TaxSettings keyed on store_id
- Enums: CartStatus, CheckoutStatus, DiscountType, DiscountValueType,
DiscountStatus, ShippingRateType, TaxMode
- Value objects: PricingResult, TaxLine, DiscountResult
- Exception: InvalidDiscountException with reason helpers
- Services:
* TaxCalculator (addExclusive, extractInclusive, calculate)
* ShippingCalculator (zone matching, flat/weight/price/carrier rates)
* DiscountService (case-insensitive validate, proportional allocate)
* PricingEngine (subtotal, discount, shipping, tax, total pipeline)
* CartService (line CRUD, version increments, inventory checks,
guest-cart merge on login)
* CheckoutService (state machine, transitions, expire, recalculate)
- Jobs: ExpireAbandonedCheckouts (15min), CleanupAbandonedCarts
(daily 03:00) scheduled in routes/console.php
- Tests: PricingEngineTest, DiscountCalculatorTest, TaxCalculatorTest,
ShippingCalculatorTest, CartVersionTest, CartServiceTest,
CheckoutFlowTest, CheckoutStateTest (59 new, 138 total passing)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Migrations: customers, customer_addresses, customer_password_reset tokens, orders, order_lines, payments, refunds, fulfillments, fulfillment_lines (CHECK constraints via triggers) - Models + factories: Customer (Authenticatable, password_hash override), CustomerAddress, Order (BelongsToStore), OrderLine, Payment, Refund, Fulfillment, FulfillmentLine - Enums: OrderStatus, FinancialStatus, FulfillmentStatus, PaymentMethod, PaymentStatus, RefundStatus, FulfillmentShipmentStatus - PaymentProvider contract + PaymentResult/RefundResult value objects - MockPaymentProvider with magic card numbers, paypal, bank_transfer - OrderService: createFromCheckout (sequential order numbers, snapshots), cancel (releases reserved inventory), confirmBankTransferPayment - RefundService: partial/full refunds with optional restock - FulfillmentService: create with payment guard, mark shipped/delivered, rolls up order fulfillment_status - Events: OrderCreated, OrderPaid, OrderFulfilled, OrderCancelled, OrderRefunded, FulfillmentDelivered - Exceptions: FulfillmentGuardException, PaymentFailedException - CheckoutService::complete updated to charge payment and create Order - CancelUnpaidBankTransferOrders job scheduled daily 04:00 - Tests: MockPaymentProviderTest, PaymentServiceTest, BankTransferConfirmationTest, OrderCreationTest, RefundTest, FulfillmentTest, CustomerAccountTest (29 new, 167 total passing) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Storefront Livewire components: - Collections (Index, Show with filters, sort, pagination) - Products/Show (variant picker, add-to-cart, gallery) - Cart/Show (line items, qty controls, totals) - CartDrawer (Alpine slide-out) - Checkout/Show (multi-step: address, shipping, payment) - Checkout/Confirmation (order summary, totals, next steps) - Pages/Show (CMS page rendering) - Search/Index (basic LIKE search, FTS in Phase 8) Customer auth + account area: - Account/Auth/Login + Register (customer guard, per-store unique email) - Account/Dashboard (recent orders) - Account/Orders/Index, Show - Account/Addresses/Index (add, set default, delete) - /account/logout route Helpers: - Storefront\Concerns\EnsuresStore trait - Support\CartSession (session-bound cart with global scope bypass) Routes wired with auth:customer middleware for /account paths. bootstrap/app.php redirects /account guests to customer login. Tests: CollectionsTest, ProductDetailTest, CartTest, CheckoutTest, PageShowTest, AccountTest, CustomerLoginTest (25 new, 192 total). Worker also verified end-to-end purchase flow via Playwright against http://shop.test (collection -> product -> cart -> checkout -> paid order #1001). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…omers, collections, discounts)
- Admin layout: components/layouts/admin.blade.php using Flux sidebar
with grouped navigation, brand, user menu, logout
- 13 admin routes protected by auth + store.resolve:admin middleware
- bootstrap/app.php redirects /admin guests to admin.login
- Livewire admin components:
* Dashboard (KPI tiles, recent orders)
* Products (Index with search/filter/bulk, Form with single variant)
* Orders (Index, Show with fulfillment + refund modals,
bank transfer confirm, mark shipped/delivered, cancel)
* Customers (Index, Show)
* Collections (Index, Form with product picker)
* Discounts (Index, Form for code/automatic with rules)
- Pest helper loginAsAdmin() in tests/Pest.php
- Tests: DashboardTest, ProductManagementTest, OrderManagementTest,
CustomerManagementTest, CollectionManagementTest,
DiscountManagementTest (20 new, 212 total passing)
Worker also browser-verified the admin pages render with no console
errors.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase 8 - Search:
- Migrations: search_settings, search_queries, products_fts (FTS5
virtual table)
- SearchService: syncProduct, removeProduct, search (prefix tokens),
autocomplete
- ProductObserver registered to keep FTS in sync on create/update/delete
- Storefront\Search\Index updated to use SearchService
- Tests: SearchTest (7), AutocompleteTest (2)
Phase 9 - Analytics:
- Migrations: analytics_events (indexed), analytics_daily (composite PK)
- Models: AnalyticsEvent (BelongsToStore), AnalyticsDaily (composite key
via setKeysForSaveQuery override)
- AnalyticsService: track, getDailyMetrics
- AggregateAnalytics job: per-store aggregation of orders + events into
analytics_daily, scheduled daily 02:00
- Tests: EventIngestionTest, AggregationTest
Phase 10 - Apps + Webhooks:
- Installed laravel/sanctum, published config + migrations, added
HasApiTokens trait to User
- Migrations: apps, app_installations, webhook_subscriptions,
webhook_deliveries
- Models: App, AppInstallation, WebhookSubscription, WebhookDelivery
- WebhookService: dispatch, sign (HMAC SHA256), verify
- DeliverWebhook job (ShouldQueue, exponential backoff, circuit breaker
pauses subscription after 5 failures)
- DispatchOrderWebhooks listener wired to OrderCreated, OrderPaid,
OrderFulfilled events via Event::listen
- API routes: /api/admin/{user,products,orders} protected by
auth:sanctum
- Tests: WebhookSignatureTest, WebhookDeliveryTest, SanctumTokenTest
Total: 234 tests passing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… demo data Admin layout sidebar extended with Content (Pages, Navigation, Themes), Marketing (Analytics), Configuration (Settings, Apps, Developers). Admin Livewire components: - Pages (Index, Form for create/edit, soft delete) - Navigation (Index with menu + items, item type modal, reorder via up/down) - Themes (Index with publish, duplicate, delete) - Analytics (KPI tiles + daily breakdown table over date range, uses AnalyticsService::getDailyMetrics) - Settings (Index general settings, Shipping zones + rates CRUD, Taxes single-row form) - Apps (Index with install/uninstall, Marketplace + Installed sections) - Developers (Sanctum API tokens with create/revoke, webhook subscriptions CRUD) Tests: PagesTest, NavigationTest, SettingsTest, AnalyticsAdminTest, AppsTest, DevelopersTest (35 new, 247 total passing). Seeders (Phase 11): - AdminUserSeeder - admin@shop.test / password - DemoStoreSeeder - Demo Org + Demo Store, shop.test domain, owner admin, default theme, Europe shipping zone, manual VAT - CatalogSeeder - 6 products with variants + inventory, 2 collections - ContentSeeder - 3 pages, main menu with 4 items, 2 discounts - CustomersAndOrdersSeeder - 5 customers, 3 sample orders - DatabaseSeeder orchestrator, all idempotent Verified migrate:fresh --seed runs cleanly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- OrderService::generateOrderNumber now extracts numeric portion from the # prefix only, ignoring D-prefixed seeded order numbers. New orders for the demo store now correctly start at #1001. - Storefront header Account, Search, and Cart icons are now real links to /account/login (or /account dashboard if logged in), /search, and /cart instead of href="#" or button stubs. - /dashboard route now redirects to /admin (the legacy Fortify view is no longer used). - config/fortify.php home redirect points to /admin so login, registration, and email verification land on the merchant dashboard. - Updated legacy Fortify auth tests to assert the new /admin redirect target. All 247 tests passing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Final test suite: 247 passing (583 assertions). End-to-end browser review (Playwright) verified: - Storefront home with seeded products - Product detail and add-to-cart - Multi-step checkout (address, shipping, payment) - Confirmed order placement creates Order #1001 with correct totals - Customer login and account dashboard - Admin dashboard with KPIs - Admin products, orders, shipping settings - All admin sections accessible without console errors Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rCloud UI instead
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




No description provided.