- Nạp tiền: mã thanh toán sống 30 phút (ManualDepositDraft), khôi phục/huỷ mã, lệnh dọn mã hết hạn; total_pending chỉ tính giao dịch đã nộp chứng từ, admin duyệt/từ chối/xoá giao dịch - Gia hạn dịch vụ: phát hành invoice gia hạn trên order gốc và trừ số dư ngay - Đồng bộ domain từ Plesk theo server, ServiceOrderRecorder tạo order/invoice cho dịch vụ admin dựng - Danh sách dịch vụ trả field theo loại (service_plan, dns_records_count), đếm dịch vụ theo loại Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
82 lines
2.4 KiB
PHP
82 lines
2.4 KiB
PHP
<?php
|
|
|
|
namespace App\Console;
|
|
|
|
use App\Jobs\VirtualMachine\Sync\SyncAllPackage;
|
|
use Illuminate\Console\Scheduling\Schedule;
|
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
|
|
|
class Kernel extends ConsoleKernel
|
|
{
|
|
/**
|
|
* Define the application's command schedule.
|
|
*
|
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
|
* @return void
|
|
*/
|
|
protected function schedule(Schedule $schedule)
|
|
{
|
|
/* Remove Session sanctum */
|
|
$schedule->command('sanctum:prune-expired --hours=24')->daily();
|
|
|
|
/* Check Daily Suspend Hosting */
|
|
$schedule->command('hosting:expiry')
|
|
->timezone("Asia/Ho_Chi_Minh")
|
|
->dailyAt("00:00");
|
|
|
|
/* Check Daily Mail Hosting Expiry */
|
|
$schedule->command('hosting:mail')
|
|
->timezone("Asia/Ho_Chi_Minh")
|
|
->dailyAt("00:00");
|
|
|
|
/* Check Daily Mail VPS Expiry */
|
|
$schedule->command('vps:mail')
|
|
->timezone("Asia/Ho_Chi_Minh")
|
|
->dailyAt("00:00");
|
|
|
|
/* Check Daily Suspend Hosting */
|
|
$schedule->command('vps:expiry')
|
|
->timezone("Asia/Ho_Chi_Minh")
|
|
->dailyAt("09:54");
|
|
|
|
/* Service lifecycle: suspend VM, renew invoice, terminate after 30 days */
|
|
$schedule->command('service:expiry')
|
|
->timezone("Asia/Ho_Chi_Minh")
|
|
->everyFiveMinutes()
|
|
->withoutOverlapping();
|
|
|
|
$schedule->command('deposits:purge-expired-drafts')
|
|
->everyFiveMinutes()
|
|
->withoutOverlapping();
|
|
|
|
/* Sync all VM packages */
|
|
$schedule->job(new SyncAllPackage())
|
|
->everyThreeHours()
|
|
->withoutOverlapping();
|
|
|
|
/* Mark overdue unpaid invoices */
|
|
$schedule->command('invoices:check-overdue')
|
|
->timezone("Asia/Ho_Chi_Minh")
|
|
->dailyAt("00:10")
|
|
->withoutOverlapping();
|
|
|
|
/* Nhắc thanh toán trước/đúng/sau hạn theo billing.reminder_offsets */
|
|
$schedule->command('invoices:send-reminders')
|
|
->timezone("Asia/Ho_Chi_Minh")
|
|
->dailyAt("08:00")
|
|
->withoutOverlapping();
|
|
}
|
|
|
|
/**
|
|
* Register the commands for the application.
|
|
*
|
|
* @return void
|
|
*/
|
|
protected function commands()
|
|
{
|
|
$this->load(__DIR__.'/Commands');
|
|
|
|
require base_path('routes/console.php');
|
|
}
|
|
}
|