feat(admin): IP pool allocation, billing exports, service attachments
- IP pool: sheet import (xlsx/csv) matched by address, bulk allocate/revoke with notification email (ip_allocated/ip_revoked), ip_pool_logs history. - Orders/invoices: Excel export on branded template (BrandedReportWriter), shared billing filters, order item service info in list responses. - Web design quote Excel export; activity log export. - Service attachments with copy-to-invoice; deployment invoice attachments. - Customer email attachments stored on disk and attached by path. - Admin password change endpoint; user.fullname backfill migration; orders.user_id backfill from logs. - Disable deploy workflow until CI/CD is set up. - Ignore stored customer email and service attachment uploads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ea5697cb81
commit
46aa138eec
@@ -8,6 +8,7 @@ use App\Support\MailPlaceholders;
|
||||
use Database\Seeders\EmailTemplates\AccountTemplates;
|
||||
use Database\Seeders\EmailTemplates\AdminTemplates;
|
||||
use Database\Seeders\EmailTemplates\BillingTemplates;
|
||||
use Database\Seeders\EmailTemplates\IpTemplates;
|
||||
use Database\Seeders\EmailTemplates\LegacyTemplates;
|
||||
use Database\Seeders\EmailTemplates\MarketingTemplates;
|
||||
use Database\Seeders\EmailTemplates\ServiceTemplates;
|
||||
@@ -25,6 +26,8 @@ class TemplateSeeder extends Seeder
|
||||
foreach (MarketingTemplates::all() as $item) {
|
||||
$this->createMarketingIfMissing($item);
|
||||
}
|
||||
|
||||
$this->createMarketingIfMissing(self::ipRevocationTemplate());
|
||||
}
|
||||
|
||||
public function seedScenarioIfMissing(string $scenario): void
|
||||
@@ -40,6 +43,15 @@ class TemplateSeeder extends Seeder
|
||||
}
|
||||
}
|
||||
|
||||
public function reseedScenario(string $scenario): void
|
||||
{
|
||||
foreach (self::templates() as $item) {
|
||||
if ($item['scenario'] === $scenario) {
|
||||
$this->upsert($item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function createMarketingIfMissing(array $item): void
|
||||
{
|
||||
$template = Template::firstOrNew(['name' => $item['name']]);
|
||||
@@ -51,7 +63,7 @@ class TemplateSeeder extends Seeder
|
||||
'type_id' => 0,
|
||||
'format' => 'html',
|
||||
'subject' => $item['subject'],
|
||||
'message' => EmailTemplateShell::page($item['body']),
|
||||
'message' => $item['message'] ?? EmailTemplateShell::page($item['body']),
|
||||
'status' => 1,
|
||||
]);
|
||||
$template->syncVariables($item['variables']);
|
||||
@@ -75,6 +87,7 @@ class TemplateSeeder extends Seeder
|
||||
[
|
||||
...AccountTemplates::all(),
|
||||
...ServiceTemplates::all(),
|
||||
...IpTemplates::all(),
|
||||
...BillingTemplates::all(),
|
||||
...AdminTemplates::all(),
|
||||
],
|
||||
@@ -94,6 +107,43 @@ class TemplateSeeder extends Seeder
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Template mẫu thông báo danh sách tài nguyên IP đã thu hồi.
|
||||
*
|
||||
* @return array{name: string, subject: string, message: string, variables: array{}}
|
||||
*/
|
||||
private static function ipRevocationTemplate(): array
|
||||
{
|
||||
$subject = 'V/v: Thế Giới Số gửi thông tin Thu hồi IP — {{service_name}} — {{customer_name}}';
|
||||
|
||||
$message = <<<'HTML'
|
||||
<div style="margin:0;padding:24px 10px;background:#f2f1ef;font-family:'Times New Roman',Times,serif;color:#2b2b2b">
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" style="max-width:820px;margin:0 auto;background:#fff;border-radius:14px;border-collapse:separate;overflow:hidden">
|
||||
<tbody><tr><td><table width="100%" cellpadding="0" cellspacing="0" border="0"><tbody><tr><td width="70%" style="height:5px;background:#a8a29e;font-size:0;line-height:0"> </td><td width="30%" style="height:5px;background:#f26522;font-size:0;line-height:0"> </td></tr></tbody></table></td></tr>
|
||||
<tr><td style="padding:26px 40px 0;text-align:center"><img src="https://tgs.com.vn/wp-content/uploads/2024/11/cropped-LOGO-THE-GIOI-SO-2024-2.png" width="200" style="display:inline-block;border:0;max-width:200px;height:auto" alt="Thế Giới Số"></td></tr>
|
||||
<tr><td style="padding:14px 40px 0;text-align:center"><div style="font-size:21px;font-weight:bold;letter-spacing:1px">THÔNG BÁO THU HỒI TÀI NGUYÊN IP</div><table align="center" cellpadding="0" cellspacing="0" border="0" style="margin:10px auto 0"><tbody><tr><td style="width:30px;height:2px;background:#a8a29e;font-size:0"> </td><td style="width:4px;font-size:0"> </td><td style="width:30px;height:2px;background:#f26522;font-size:0"> </td></tr></tbody></table><div style="font-size:13px;color:#888;margin-top:10px;font-style:italic">{{notification_date}}</div></td></tr>
|
||||
<tr><td style="padding:26px 40px 6px;font-size:16px;line-height:1.85"><p style="margin:0 0 14px">Kính gửi Quý Khách hàng <b>{{customer_name}}</b>,</p><p style="margin:0 0 20px">Thế Giới Số trân trọng thông báo thông tin thu hồi tài nguyên IP theo yêu cầu vận hành/dịch vụ.</p>
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="margin:0 0 10px"><tbody><tr><td style="font-size:15px;font-weight:bold"><span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:#a8a29e;margin-right:8px"></span>Thông tin IP</td><td align="right"><span style="background:#efedea;color:#5f5b57;font:700 12px Arial,sans-serif;padding:4px 12px;border-radius:999px">● Đã thu hồi</span></td></tr></tbody></table>
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px solid #e4e1de;border-radius:10px;border-collapse:separate;overflow:hidden"><tbody><tr><td style="padding:11px 14px;color:#5f5b57;font-size:13px;font-weight:bold;border-bottom:1px solid #e4e1de;background:#f7f6f4;text-align:center;width:60px">STT</td><td style="padding:11px 14px;color:#5f5b57;font-size:13px;font-weight:bold;border-bottom:1px solid #e4e1de;background:#f7f6f4;text-align:center">IP Address</td><td style="padding:11px 14px;color:#5f5b57;font-size:13px;font-weight:bold;border-bottom:1px solid #e4e1de;background:#f7f6f4;text-align:center">Dịch vụ</td><td style="padding:11px 14px;color:#5f5b57;font-size:13px;font-weight:bold;border-bottom:1px solid #e4e1de;background:#f7f6f4;text-align:center">Ngày thu hồi</td></tr><tr><td style="padding:13px 14px;font-size:15px;text-align:center;width:60px">1</td><td style="padding:13px 14px;font-size:15px;text-align:center;font-family:Consolas,'Courier New',monospace;font-weight:bold;color:#3a3633">{{ip_address}}</td><td style="padding:13px 14px;font-size:15px;text-align:center">{{service_name}}</td><td style="padding:13px 14px;font-size:15px;text-align:center">{{revocation_date}}</td></tr></tbody></table>
|
||||
<div style="font-size:16px;line-height:1.85;margin-top:24px"><div style="margin-bottom:6px">Thế Giới Số xin chân thành cảm ơn Quý Khách hàng đã tin tưởng và đồng hành cùng chúng tôi trong thời gian qua.</div><div style="margin-bottom:6px">Khi có nhu cầu <b>sử dụng lại dịch vụ</b> hoặc <b>cấp mới tài nguyên IP</b>,<br>Quý Khách hàng vui lòng liên hệ Thế Giới Số qua các kênh hỗ trợ sau.</div><div>Rất mong tiếp tục được phục vụ Quý Khách hàng trong thời gian tới.</div></div>
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="margin:22px 0 24px"><tbody><tr><td></td><td width="300" align="center" style="font-size:15px;line-height:1.7"><div>Trân trọng,</div><div style="font-weight:bold;margin-top:4px">BỘ PHẬN KỸ THUẬT</div><div style="color:#d9480f;font-weight:bold">THẾ GIỚI SỐ</div></td></tr></tbody></table></td></tr>
|
||||
<tr><td style="border-top:1px solid #f26522;padding:18px 32px 22px;text-align:center;line-height:1.8"><div style="color:#d9480f;font-size:19px;font-weight:bold">CÔNG TY CỔ PHẦN GIẢI PHÁP CÔNG NGHỆ THẾ GIỚI SỐ</div><div style="color:#f07022;font-size:12px">✆ Tel: (028) 7309 7379 | ✉ <a href="mailto:Support@tgs.com.vn" style="color:#f07022;text-decoration:none">Support@tgs.com.vn</a></div><div style="font-size:12px">🌐 <a href="https://www.TGS.com.vn" style="color:#1a73e8;text-decoration:none">www.TGS.com.vn</a> <span style="color:#1a73e8">&</span> <a href="https://www.thegioiso.CLOUD" style="color:#1a73e8;text-decoration:none">www.thegioiso.CLOUD</a> <span style="color:#1a73e8">&</span> <a href="https://www.thegioiSERVER.com" style="color:#1a73e8;text-decoration:none">www.thegioiSERVER.com</a> <span style="color:#1a73e8">&</span> <a href="https://www.CloudEmail.vn" style="color:#1a73e8;text-decoration:none">www.CloudEmail.vn</a></div><div style="color:#f07022;font-size:12px;font-weight:bold">🥇 Thế Giới Số 🥇 - Premium HOSTING • CLOUD • SERVER & WEBSITE | 15+ năm Phụng Sự 🚀</div></td></tr></tbody></table></div>
|
||||
HTML;
|
||||
|
||||
return [
|
||||
'name' => 'Thông báo thu hồi tài nguyên IP',
|
||||
'subject' => $subject,
|
||||
'message' => $message,
|
||||
'variables' => [
|
||||
['key' => 'customer_name', 'label' => 'Tên khách hàng', 'example' => 'CÔNG TY TNHH KHÁCH HÀNG MẪU'],
|
||||
['key' => 'service_name', 'label' => 'Tên dịch vụ', 'example' => 'Dịch vụ IP'],
|
||||
['key' => 'notification_date', 'label' => 'Ngày lập thông báo', 'example' => 'TP. Hồ Chí Minh, ngày 15 tháng 10 năm 2026'],
|
||||
['key' => 'ip_address', 'label' => 'Địa chỉ IP', 'example' => '192.0.2.1'],
|
||||
['key' => 'revocation_date', 'label' => 'Ngày thu hồi', 'example' => '15/10/2026'],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function upsert(array $item): void
|
||||
{
|
||||
$scenario = $item['scenario'];
|
||||
|
||||
Reference in New Issue
Block a user