- Mail campaign: mẫu nhắc gia hạn thanh toán QR, chọn dịch vụ + chu kỳ từng dòng (renewal_services) - Hosting: nhiều server Plesk cho một gói (service_plan_servers), chuyển server khi server chết - Admin xem/sửa giấy tờ định danh khách, tuỳ chọn gia hạn cho khách, nhật ký cấp phát dịch vụ - Đánh dấu mẫu email dịch vụ là non-marketing Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
37 lines
1.0 KiB
PHP
37 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
use App\Models\Service;
|
|
use App\Services\ActivityLogger;
|
|
|
|
class ServiceProvisionLog
|
|
{
|
|
public const EVENTS = [
|
|
'provision_requested',
|
|
'provision_started',
|
|
'provision_step',
|
|
'provision_completed',
|
|
'provision_failed',
|
|
];
|
|
|
|
public static function record(?Service $service, string $event, string $description, array $values = []): void
|
|
{
|
|
if (! $service) {
|
|
return;
|
|
}
|
|
|
|
app(ActivityLogger::class)->log($event, 'service', $description, $service, [], $values);
|
|
}
|
|
|
|
public static function forOrderItem(int $orderItemId, string $event, string $description, array $values = []): void
|
|
{
|
|
self::record(Service::where('order_item_id', $orderItemId)->first(), $event, $description, $values);
|
|
}
|
|
|
|
public static function forVm(int $moduleVmwareId, string $event, string $description, array $values = []): void
|
|
{
|
|
self::record(Service::where('vm_id', $moduleVmwareId)->first(), $event, $description, $values);
|
|
}
|
|
}
|