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:
baodev0
2026-10-15 19:58:36 +07:00
co-authored by Claude Opus 5.5
parent ea5697cb81
commit 46aa138eec
95 changed files with 4247 additions and 454 deletions
@@ -40,6 +40,39 @@ final class MarketingTemplates
. T::button('https://tgs.com.vn/premium-hosting/', 'Xem bảng giá'),
'variables' => [],
],
[
'name' => 'Thông báo bổ sung hồ sơ bản khai tên miền',
'subject' => 'V/v: Thế Giới Số thông báo bổ sung hồ sơ bản khai tên miền của Quý Công ty - {{customer_name}}',
'body' => self::domainProfileSupplementBody(),
'variables' => [
['key' => 'customer_name', 'label' => 'Tên công ty', 'example' => 'CÔNG TY TNHH KHÁCH HÀNG MẪU'],
['key' => 'domain_count', 'label' => 'Số lượng tên miền', 'example' => '1'],
['key' => 'domain_name', 'label' => 'Tên miền cần bổ sung hồ sơ', 'example' => 'example.vn'],
['key' => 'declaration_form_url', 'label' => 'Link tải mẫu bản khai', 'example' => 'https://example.com/mau-ban-khai'],
['key' => 'digital_signature_url', 'label' => 'Link xác thực chữ ký số', 'example' => 'https://example.com/xac-thuc-chu-ky-so'],
['key' => 'supplement_deadline', 'label' => 'Hạn bổ sung hồ sơ', 'example' => '31/12/2026'],
],
],
];
}
private static function domainProfileSupplementBody(): string
{
return <<<'HTML'
<p style="box-sizing:border-box;margin:0 0 16px;font-size:15px;color:#1f2937">Kính gửi Quý Công ty <strong>{{customer_name}}</strong>,</p>
<p style="box-sizing:border-box;margin:0 0 16px;color:#4b5563;line-height:1.6">Thế Giới Số trân trọng cảm ơn Quý Công ty đã tin tưởng sử dụng dịch vụ của chúng tôi.</p>
<p style="box-sizing:border-box;margin:0 0 12px;color:#4b5563;line-height:1.6">Với mục đích giúp Quý Công ty xác định quyền sở hữu hợp pháp đối với tên miền và hạn chế rủi ro vi phạm quy định pháp luật về quản lý tài nguyên Internet, quy định cụ thể tại:</p>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="box-sizing:border-box;background:#fff7ed;border-left:3px solid #f97316;border-radius:4px;margin-bottom:20px"><tbody><tr><td style="padding:14px 16px"><p style="margin:0 0 8px;font-size:13px;color:#374151;line-height:1.6">- Nghị định 147/2024/NĐ-CP ngày 09/11/2024 của Chính phủ về quản lý, cung cấp, sử dụng dịch vụ Internet và thông tin trên mạng.</p><p style="margin:0;font-size:13px;color:#374151;line-height:1.6">- Thông tư 48/2025/TT-BKHCN ngày 25/12/2025 của Bộ Khoa học và Công nghệ hướng dẫn về quản lý và sử dụng tài nguyên Internet.</p></td></tr></tbody></table>
<p style="box-sizing:border-box;margin:0 0 16px;color:#1f2937;line-height:1.6">Hệ thống Thế Giới Số ghi nhận Quý Công ty hiện có <strong>{{domain_count}} tên miền</strong> chưa đủ hồ sơ để xác định quyền sở hữu hợp pháp theo quy định, cụ thể như sau:</p>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="box-sizing:border-box;border:1px solid #e5e7eb;border-radius:6px;overflow:hidden;margin-bottom:20px;font-size:13px"><tbody><tr style="background:#fed7aa"><td style="padding:9px 12px;color:#9a3412;font-weight:bold;width:15%;text-align:center">STT</td><td style="padding:9px 12px;color:#9a3412;font-weight:bold;text-align:center">Dịch vụ</td></tr><tr><td style="padding:9px 12px;color:#111827;text-align:center">1</td><td style="padding:9px 12px;color:#111827;font-weight:bold;text-align:center">{{domain_name}}</td></tr></tbody></table>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="box-sizing:border-box;background:#f8fafc;border:1px solid #cbd5e1;border-radius:8px;margin-bottom:24px"><tbody><tr><td style="padding:18px"><p style="margin:0 0 12px;color:#1e3a8a;font-weight:bold">📎 Hoàn tất xác thực Tổ chức – chọn 1 trong 2 cách sau</p>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="box-sizing:border-box;background:#fff;border:1px solid #bfdbfe;border-left:4px solid #1e40af;border-radius:6px"><tbody><tr><td style="padding:14px 16px"><p style="margin:0 0 10px;color:#1e3a8a;font-weight:bold">CÁCH 1 &nbsp;|&nbsp; Hoàn thiện Bản khai (bản giấy)</p><p style="margin:0 0 10px;font-size:13px;color:#374151;line-height:1.6">Tải mẫu <strong>Bản khai</strong>, in, ký tên, đóng dấu (và đóng dấu giáp lai nếu có nhiều trang), sau đó chụp ảnh hoặc scan và phản hồi email này.</p><a href="{{declaration_form_url}}" style="display:inline-block;color:#fff;background:#1e40af;padding:7px 16px;border-radius:4px;text-decoration:none;font-size:12px;font-weight:bold" target="_blank" rel="noopener">Tải mẫu Bản khai →</a><p style="margin:16px 0 0;font-size:13px;color:#374151;line-height:1.7"><strong>Gửi bản gốc đã ký, đóng dấu về:</strong><br>CÔNG TY CỔ PHẦN GIẢI PHÁP CÔNG NGHỆ THẾ GIỚI SỐ<br>128/38 Tân Hương, Phường Phú Thọ Hòa, TP. Hồ Chí Minh<br>Người nhận: Ms. Vân Anh – 0818 006 119 (P. HCNS)</p></td></tr></tbody></table>
<div style="padding:8px 0;text-align:center"><span style="display:inline-block;font-size:11.5px;color:#6b7280;font-weight:bold;letter-spacing:1px;background:#f1f5f9;border-radius:10px;padding:2px 14px">HOẶC</span></div>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="box-sizing:border-box;background:#fff;border:1px solid #a7f3d0;border-left:4px solid #059669;border-radius:6px"><tbody><tr><td style="padding:14px 16px"><p style="margin:0 0 8px;color:#065f46;font-weight:bold">CÁCH 2 &nbsp;|&nbsp; Xác thực Tổ chức bằng chữ ký số</p><p style="margin:0 0 10px;font-size:13px;color:#374151">Xác thực Tổ chức trực tuyến bằng chữ ký số.</p><a href="{{digital_signature_url}}" style="display:inline-block;color:#fff;background:#059669;padding:9px 20px;border-radius:4px;text-decoration:none;font-size:12.5px;font-weight:bold" target="_blank" rel="noopener">Xác thực Tổ chức bằng chữ ký số →</a></td></tr></tbody></table>
</td></tr></tbody></table>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="box-sizing:border-box;background:#fef2f2;border:1px solid #fca5a5;border-radius:6px;margin-bottom:20px"><tbody><tr><td style="padding:16px"><p style="margin:0 0 10px;color:#991b1b;font-weight:bold">Lưu ý:</p><p style="margin:0 0 10px;font-size:13px;color:#7f1d1d;line-height:1.7">Quý Công ty vui lòng hoàn tất trước ngày <strong>{{supplement_deadline}}</strong> để chúng tôi cập nhật quyền sở hữu hợp pháp đối với tên miền tới hệ thống Trung tâm Internet Việt Nam, tránh ảnh hưởng đến quyền lợi của chủ thể sử dụng tên miền.</p><p style="margin:0 0 4px 20px;font-size:13px;color:#7f1d1d">- Gián đoạn sử dụng tên miền.</p><p style="margin:0 0 4px 20px;font-size:13px;color:#7f1d1d">- Ảnh hưởng đến các nghiệp vụ duy trì tên miền.</p><p style="margin:0 0 12px 20px;font-size:13px;color:#7f1d1d">- Bất lợi khi xảy ra tranh chấp hoặc có thể bị thu hồi tên miền.</p><p style="margin:0;font-size:13px;color:#7f1d1d;font-style:italic">Nếu Quý Công ty đã hoàn tất việc bổ sung hồ sơ, xin vui lòng bỏ qua email này.</p></td></tr></tbody></table>
<p style="box-sizing:border-box;margin:0 0 20px;color:#4b5563;line-height:1.6">Trong suốt quá trình thực hiện, nếu cần hỗ trợ, đội ngũ chuyên viên Thế Giới Số luôn sẵn sàng đồng hành cùng Quý Công ty.</p>
<p style="box-sizing:border-box;margin:0;color:#1f2937">Trân trọng,</p>
HTML;
}
}