This commit is contained in:
2026-02-03 15:31:29 +05:00
commit 326c677e8d
2800 changed files with 1489388 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<?php
namespace App\Models\Ecommerce\Product\Coupon;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Coupon extends Model
{
use HasFactory;
/**
* Discount by percentage (%)
*/
public const DISCOUNT_PERCENTAGE = 'percentage';
/**
* Discount by fixed amount (ex: -10 TMT)
*/
public const DISCOUNT_FIXED = 'fixed_amount';
/**
* @var array<int, string>
*/
protected $fillable = [
'code',
'discount_type',
'discount_value',
'notes',
'is_active',
];
/**
* Discount types
*/
public static function discountTypes(): array
{
return [
self::DISCOUNT_PERCENTAGE => __('Percentage'),
self::DISCOUNT_FIXED => __('Fixed Amount'),
];
}
/**
* Default discount type
*/
public static function defaultDiscountType(): string
{
return self::DISCOUNT_PERCENTAGE;
}
}