Implement the core logic for applying discount codes during price calculation and introduce the WalletService. This includes updating the PriceCalculatorService to validate and apply discounts, incrementing usage counts, and adding a Filament resource for managing discount codes via the admin panel. Additionally, refactor TrackingDataImport to use OnEachRow for better memory management during large Excel imports.
25 lines
417 B
PHP
25 lines
417 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class DiscountCode extends Model
|
|
{
|
|
protected $fillable = [
|
|
'code',
|
|
'type',
|
|
'value',
|
|
'min_order_amount',
|
|
'usage_limit',
|
|
'used_count',
|
|
'expires_at',
|
|
'is_active'
|
|
];
|
|
|
|
protected $casts = [
|
|
'expires_at' => 'datetime',
|
|
'is_active' => 'boolean',
|
|
];
|
|
}
|