| 12345678910111213141516171819 |
- <?php
-
- namespace App\Commerce;
-
- use App\Models\DiscountCode;
-
- /**
- * The discount code in a cart and what it is worth right now. Amounts are in sen.
- */
- final readonly class AppliedDiscount
- {
- public function __construct(
- public DiscountCode $code,
- /** What comes off the products. Zero while the code cannot be used. */
- public int $amount,
- /** Why the code cannot be used yet (a StorefrontText key), or null when it works. */
- public ?string $problem,
- ) {}
- }
|