Skip to content

V2#1

Merged
komtcho merged 21 commits intomainfrom
V2
Mar 10, 2026
Merged

V2#1
komtcho merged 21 commits intomainfrom
V2

Conversation

@komtcho
Copy link
Contributor

@komtcho komtcho commented Mar 5, 2026

No description provided.

@komtcho
Copy link
Contributor Author

komtcho commented Mar 7, 2026

/oc review

@opencode-agent
Copy link
Contributor

opencode-agent bot commented Mar 7, 2026

Code Review: V2

This is a major version bump with breaking changes. Here's my analysis:

Breaking Changes

  1. PHP 8.3 required (was 8.1/8.2) - composer.json:5
  2. Laravel 11+ required (was 10/11) - composer.json:6
  3. Filament removed - No admin panel resources anymore
  4. Coupons removed - Entire coupon system deleted (src/Calculate/CouponCalculate.php, src/Contracts/ICoupon.php)
  5. Order functionality removed - src/Models/Order.php, src/Traits/HasOrder.php deleted
  6. API change: initCart()/openCart()CartManagement::make() - tests/Feature/TotalsTest.php:62

New Features

  1. Flexible totals system - applyAddition()/applyDiscount() with optional keys - src/Services/TotalService.php:96-140
  2. HasManageTotals interface - Allows products to manage their own totals - src/Contracts/HasManageTotals.php
  3. AmountsResource - New resource for managing multiple additions/discounts - src/Services/Resources/AmountsResource.php

Potential Issues

  1. README outdated - Still mentions "coupons" in line 3 despite removal
  2. Migration deleted but still referenced - 2024_08_19_142245_create_basketin_cart_orders_table.php deleted but the change isn't documented
  3. Events removed - All basketin events were stripped of content (became empty)

Test Coverage

New tests added for additions/discounts system look comprehensive (lines 72-425 in TotalsTest.php).

Recommendation

This is a solid breaking change for V2. The removal of Filament makes the package lighter for API-only use cases. The new totals system is more flexible than the old coupon system. Consider updating the README to reflect the actual feature set.

New%20session%20-%202026-03-07T10%3A34%3A01.792Z
opencode session  |  github run

@komtcho
Copy link
Contributor Author

komtcho commented Mar 7, 2026

/oc review

@opencode-agent
Copy link
Contributor

opencode-agent bot commented Mar 7, 2026

Code Review: V2

Summary

This is a solid V2 release with intentional breaking changes. The refactoring removes the Filament dependency (lighter for API-only use) and replaces the rigid coupon system with a flexible additions/discounts API.

Issues to Fix

  1. README outdated - Line 3 still mentions "coupons" but they're removed:

    - Laravel cart library for e-commerce. Provides carts, quotes (line items), totals, coupons, custom fields, and order preparation with a clean API.
    + Laravel cart library for e-commerce. Provides carts, quotes (line items), totals, additions, discounts, and order preparation with a clean API.
  2. Migration deleted - create_basketin_cart_orders_table.php removed but no upgrade guide. Consider adding a UPGRADE.md for users migrating from V1.

What's Good

  • Clean totals API (TotalService.php:102-140) - Fluent applyAddition()/applyDiscount() with optional keys
  • Type safety - PHP 8.3 requirement enables modern PHP features
  • Test coverage - New additions/discounts functionality well-tested in TotalsTest.php

Breaking Changes Summary

Feature V1 V2
PHP 8.1+ 8.3+
Laravel 10/11 11/12
Admin Filament Removed
Coupons Yes Removed
Orders Yes Removed

Verdict

Approve once README is updated. Consider documenting the migration path from V1.

New%20session%20-%202026-03-07T14%3A13%3A11.945Z
opencode session  |  github run

@komtcho
Copy link
Contributor Author

komtcho commented Mar 7, 2026

/oc review

@opencode-agent
Copy link
Contributor

opencode-agent bot commented Mar 7, 2026

Code Review: V2 (Updated)

Status

The README still has the outdated description from V1 - line 3 mentions "coupons" which were removed in this version.

Issues Still Present

  1. README not updated - Line 3 still says "coupons" but they're removed in V2:
    Laravel cart library for e-commerce. Provides carts, quotes (line items), totals, coupons, custom fields, and order preparation with a clean API.
    
    Should be updated to mention "additions, discounts" instead of "coupons".

Previous Issues Now Resolved

  • New totals API (applyAddition/applyDiscount) implemented correctly
  • HasManageTotals interface added
  • AmountsResource added
  • Test coverage for new features in place

Breaking Changes Summary

Feature V1 V2
PHP 8.1+ 8.3+
Laravel 10/11 11+
Admin Filament Removed
Coupons Yes → Additions/Discounts API
Orders Yes Removed

Verdict

Needs changes: Update README line 3 to reflect V2 feature set (replace "coupons" with "additions, discounts"). Everything else looks good.

New%20session%20-%202026-03-07T17%3A28%3A26.386Z
opencode session  |  github run

@komtcho komtcho merged commit 300f302 into main Mar 10, 2026
2 checks passed
@komtcho komtcho deleted the V2 branch March 10, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant