Add gold credit feature gated by SuperAdmin enable_gold_credit.
Port tables, APIs, and overdue cron from goldali, default the flag off, and keep customer routes behind auth. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Services\GoldCreditService;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class ProcessGoldCreditOverdue extends Command
|
||||
{
|
||||
protected $signature = 'gold-credit:process-overdue';
|
||||
|
||||
protected $description = 'SMS هشدار سررسید اقساط اعتبار طلایی و اعمال جریمه روزانه پس از مهلت';
|
||||
|
||||
public function handle(GoldCreditService $service): int
|
||||
{
|
||||
$result = $service->processOverdueInstallments();
|
||||
$this->info(sprintf(
|
||||
'warnings=%d penalties=%d reminders=%d',
|
||||
$result['warnings'] ?? 0,
|
||||
$result['penalties'] ?? 0,
|
||||
$result['reminders'] ?? 0
|
||||
));
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,11 @@ class Kernel extends ConsoleKernel
|
||||
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
$schedule->command('gold-credit:process-overdue')
|
||||
->everyFiveMinutes()
|
||||
->name('gold_credit_process_overdue')
|
||||
->withoutOverlapping();
|
||||
|
||||
// تیک قیمت — ۶ بار در دقیقه با فاصله ۱۰ ثانیه (montzar + zaarbox + محصولات)
|
||||
// نیاز: * * * * * php artisan schedule:run
|
||||
// یا یکبار: php artisan schedule:bootstrap
|
||||
|
||||
Reference in New Issue
Block a user