Commit Graph
224 Commits
Author SHA1 Message Date
baodev0andClaude Sonnet 5.5 55a834a2f8 feat: nhắc gia hạn QR theo dịch vụ, failover server hosting, CCCD admin, log cấp phát dịch vụ
- 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>
2026-10-30 18:36:41 +07:00
baodev0 047c23beff update 2026-10-30 13:05:47 +07:00
baodev0andClaude Sonnet 5.5 62596d9063 feat(vm): hoàn tiền khi cấp VM lỗi, theo dõi job queue, uuid dịch vụ cho ticket, chuẩn hoá RAM addon
- VmProvisionException/VmProvisionRefund xử lý lỗi cấp phát VM
- QueueJobInspector + QueueMonitorController xem chi tiết job
- Thêm service uuid cho ticket, thời lượng cho activity_logs
- Migration chuẩn hoá RAM addon sang MB, trạng thái deleting cho snapshot

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 11:54:05 +07:00
baodev0andClaude Sonnet 5.5 7136bec265 feat(domain): chỉnh ngày bắt đầu/hết hạn tên miền và điền hạn từ dữ liệu cũ
PUT administrator/domains/{id}/term, LegacyDomainTerms và migration backfill hạn cho dịch vụ domain chưa có expires_at.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-28 17:26:41 +07:00
baodev0andClaude Sonnet 5.5 e37106f2dc fix(service): chỉ trả mật khẩu hosting cho admin có quyền hosting.view
GET administrator/services/{id} chỉ yêu cầu customer.view nhưng trả kèm mật khẩu
Plesk dạng rõ; giờ chỉ đính kèm khi là Full Administrator hoặc có hosting.view.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-28 16:43:43 +07:00
baodev0andClaude Sonnet 5.5 b44a88bb52 feat(service): huỷ dịch vụ, SSL, đổi mật khẩu hosting, lịch sử thanh toán theo hình thức
- Lịch sử thanh toán hoá đơn trả thêm `method` (tự động gia hạn / số dư / admin / chuyển khoản / hoàn tiền), bỏ đuôi `(method)` khỏi ghi chú
- `DnsServer::panelUrl()` = https://<domain>/ dùng cho email cấp hosting và nút Plesk của khách
- Order item trả thêm `uuid`/`type` của dịch vụ để FE dẫn tới trang quản lý
- Yêu cầu huỷ dịch vụ, chứng chỉ SSL, lịch sử gia hạn, đổi mật khẩu hosting cho khách

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-28 16:40:24 +07:00
baodev0andClaude Sonnet 5.5 a6b641015e feat(service): đổi sản phẩm của dịch vụ, 2FA bắt buộc, đính kèm campaign mail, thu hồi IP
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 14:24:13 +07:00
baodev0andClaude Sonnet 5.5 6315a392c0 feat(service): custom product, lịch sử giám sát VM và mã hoá response theo phiên
- Dịch vụ custom: bảng custom_products + services.custom_product_id; createService nhận
  custom{} thay product_id, giá = đơn giá tháng x số tháng chu kỳ (1/3/6/12/24/36),
  gia hạn tính theo cùng đơn giá, ServiceClientDetailResource trả custom_product và specs.
- Giám sát VM: GET v1/system/vm-metrics/history gom lịch sử về tối đa 240 điểm;
  lỗi lấy dung lượng đĩa không còn làm hỏng cả thẻ metrics.
- SealResponse: AES-256-GCM theo khoá phiên do proxy Next cấp qua header x-seal-key
  (HMAC của session id). Client opt-in bằng x-seal; chi tiết dịch vụ, mật khẩu VM và
  console ticket luôn được mã hoá. Body gửi lên dạng {enc} được giải mã trước validate;
  khoá lệch trả 428 để client lấy khoá mới. Đây là che mắt DevTools, không phải bảo mật
  chống chính chủ tài khoản.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 13:58:50 +07:00
baodev0andClaude Sonnet 5.5 8108e8fe53 fix: trả rows_by_host cho network trong cây vCenter
Network dùng chung giữa các host bị unique('network') giữ lại host đầu tiên.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 10:49:01 +07:00
baodev0andClaude Sonnet 5.5 e1ffbf52fe fix(customer): lưu và trả địa chỉ khách hàng
Bảng customers chỉ có cột address nên address_1/address_2 từ form admin bị bỏ khi validate.
Thêm cột address_2, fillable, rule validate và trả đủ field địa chỉ trong CustomerResource.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 08:37:57 +07:00
baodev0andClaude Opus 5.5 fc765ad007 feat(auth): lock admin login per account as well as per IP
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 22:40:44 +07:00
baodev0andClaude Opus 5.5 7f41c27958 fix(auth): successful login no longer resets IP failure counter
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 22:37:23 +07:00
baodev0andClaude Opus 5.5 e34362b9bd feat(auth): block admin login IP after 4 failures for 20 min, email login alerts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 22:35:35 +07:00
baodev0andClaude Opus 5.5 fe68171aa7 feat(services): partial/unpaid payment on admin create, payment history per invoice, zip attachments
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 22:22:09 +07:00
baodev0andClaude Opus 5.5 02daefe4c2 fix(mail-campaigns): resolve-emails returns only uuid/fullname/email
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 21:20:23 +07:00
baodev0andClaude Opus 5.5 e1efc88fd2 feat(mail-campaigns): sender info + resolve typed emails against customers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 21:18:53 +07:00
baodev0andClaude Sonnet 5.5 4f3442190e fix(products): keep category when update sends null product_categories_id
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 16:59:15 +07:00
baodev0andClaude Sonnet 5.5 a443ec3bf6 feat(portal): lead module, WHMCS sync report/contacts/mapping, service lifecycle email templates
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 16:55:19 +07:00
baodev0andClaude Sonnet 5.5 3c7710f1de fix(client-service): hide service/vm ids, mask vm password, encrypt module_vmware.password
- detail response drops id and vm.id/vmware_id, password returns *****
- GET client-service/{uuid}/vm-password returns the decrypted password to the owner
- renew accepts service uuid
- EncryptedOrLegacy cast for module_vmware.password
- vps specs: addon ram is stored in MB, convert to GB

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 15:52:56 +07:00
baodev0andClaude Sonnet 5.5 66c7c0a6c3 fix(client): return VM RAM in GB in service detail specs
ram_mb was sent as-is while the client formats specs.ram as GB, so 4096 MB showed as 4 TB.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 11:13:26 +07:00
baodev0 94b11a7f18 update 2026-10-20 09:58:38 +07:00
baodev0andClaude Sonnet 5.5 25f23d541e feat(billing): renewals, coupons, VAT numbering, billing cycles and invoice payment tracking
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 16:37:56 +07:00
baodev0 ea9a53f742 feat(admin): improve payments and server settings 2026-10-19 07:59:23 +07:00
baodev0andClaude Sonnet 5.5 9ed77a85fd feat: VM metrics via portal-monitor integration
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 13:04:35 +07:00
baodev0 0b08689ea4 feat: harden admin auth and ticket workflows
- add rotating admin refresh tokens and password gates\n- expand ticket galleries, exports, and client resources\n- improve IP allocation auditing and dashboard data\n- enforce encrypted client access tokens on public routes
2026-10-16 17:00:55 +07:00
baodev0andClaude Opus 5.5 0cdf224309 feat(admin): manual deposit recording, transaction export, ticket filters
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 21:53:41 +07:00
baodev0andClaude Opus 5.5 40bf6b54f9 feat(admin): star/tags marks, service product-type filter, campaign bulk actions, SMTP test
- Star (is_starred) and colored tags for services, customers, orders, invoices:
  Markable trait, tags/taggables tables, PATCH administrator/marks/{type}/{key},
  tag CRUD, list filters starred / tag_ids[]
- GET administrator/services accepts product_type (falls back to product type
  for legacy rows without services.type)
- Mail campaigns: bulk cancel / retry failed / delete; cancelled campaigns are
  skipped by SendMailCampaignRecipient
- POST administrator/settings/test-smtp sends a test email through the saved
  mail transport

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 21:53:41 +07:00
baodev0andClaude Opus 5.5 46aa138eec 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>
2026-10-15 19:58:36 +07:00
baodev0andClaude Opus 5.5 ea5697cb81 feat(security): argon2id password hashing and AES for SignRSA secrets
- Hash driver read from HASH_DRIVER (argon2id in production); bcrypt
  hashes still verify and are rehashed on successful admin/client login
  since the JWT guard and guard->validate() never rehash on their own.
- Client registration uses Hash::make instead of bcrypt(), which always
  forced bcrypt regardless of the configured driver.
- SignRSA now encrypts with Crypt (AES-256-CBC + HMAC, APP_KEY) instead
  of 3DES in ECB mode without IV. Legacy 3DES values are still readable
  via RSA_KEY/RSA_PUBLIC until `secrets:reencrypt` migrates them;
  RSA_PRIVATE is no longer used.
- LegacyPortalImporter stored module_vmware.password in plaintext; it is
  now encrypted, and a migration encrypts existing plaintext rows.

Deploy: php artisan migrate, then secrets:reencrypt --dry-run and
secrets:reencrypt; remove RSA_* from env once it exits 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 19:56:38 +07:00
baodev0andClaude Opus 5.5 ecd6f20a5b feat(service): detach/attach service to customer with activity log
- Customer tab "delete" no longer deletes the service: it detaches the
  customer, discards the order/invoices and logs a `detached` activity
  with the previous customer and order.
- New POST customers/{uuid}/services/attach assigns an unassigned
  service (GET services?unassigned=1) to a customer, creating a pending
  order + unpaid invoice when missing, and logs `attached`.
- Detach/attach also sync module_vmware/module_hosting_accounts
  customer_id: ResolvesVm authorises by module_vmware.customer_id, so a
  detached customer could still control the VM.
- /services detach-customer (single + bulk) go through the same path.
- GET services/{id} returns the service activity logs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 09:39:21 +07:00
baodev0andClaude Opus 5.5 0bd15f6018 feat: bật/tắt yêu cầu hoàn tất hồ sơ, xoá dịch vụ kèm đơn/hoá đơn, sync tên VM đã gán
- setting.require_complete_profile (mặc định bật), trả qua GET v1/setting
- bulkDeleteServices xoá mềm invoice nâng cấp + order mồ côi (ServiceOrderRecorder::discardOrder)
- createService trỏ dịch vụ sang order mới thì bỏ order cũ
- SyncVirtualMachine cập nhật name + gắn virtual_machine_id cho module_vmware

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 08:04:02 +07:00
baodev0andClaude Opus 5.5 bf78f3b810 feat: hồ sơ khách (ngày sinh, tỉnh/phường theo mã), gộp menu + nút tắt, thông báo theo uuid
- PUT v1/client/update: gender theo enum ClientGender (0 Nam/1 Nữ), thêm
  birthday (cột mới), province_code/ward_code validate theo bảng provinces/wards
  (phường phải thuộc tỉnh). Migration nạp dữ liệu hành chính 2025 từ
  province_ward_import.sql (chỉ bảng trống), API GET v1/provinces[/{code}/wards].
- CustomerObserver/OrderObserver log giá trị cũ bằng getRawOriginal: getOriginal
  trả enum object, nối chuỗi gây 500 khi khách đổi giới tính.
- ClientResource: các cờ trả boolean, CCCD chỉ trả cccd_updated (không lộ ảnh/số).
- GET v1/setting/menu trả cả items + quick_links, bỏ v1/setting/quick-links.
- Thông báo admin/khách tra theo uuid thay vì id tự tăng.
- Chặn gửi template marketing cho khách đã tắt nhận email marketing.
- Xoá ProvinceWardSeeder và Customer::$updatable không dùng.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 16:03:18 +07:00
baodev0andClaude Sonnet 5 12d5b4951c feat: popup quảng cáo, đặt lại mật khẩu bằng token 80 ký tự, 2FA email, vá lỗ hổng bảo mật
- Popup/banner quảng cáo cấu hình từ admin (loại, link, lịch hiển thị)
- Đặt lại mật khẩu: token 80 ký tự kèm check digit Luhn thay cho token+email lộ trong URL, chỉ lưu bản băm, một lần dùng, hết hạn 60 phút
- Xác thực 2 lớp qua email khi đăng nhập (mã 6 số, ghi nhớ thiết bị 90 ngày)
- ApiAuthCheck chặn ngay tài khoản bị khoá dù JWT còn hạn (trước đây dùng được tới hết TTL)
- Handler trả 404 thay vì 500 khi ModelNotFoundException không bọc HttpException
- Test ClientTamperingTest: xác nhận IDOR/giả mạo dữ liệu từ client đều bị chặn

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-13 13:23:33 +07:00
baodev0andClaude Opus 5.5 e888a6ed5d feat: Turnstile captcha, menu khách + nút tắt topbar cấu hình từ admin, ẩn setting nhạy cảm
- Turnstile (App\Support\Turnstile, middleware turnstile) cho login admin và login/register/forgot/reset của khách; cấu hình ở setting key=turnstile, secret mã hoá SignRSA.
- Menu sidebar khách (setting client_menu) và nút tắt topbar (setting client_quick_links) do admin sửa qua administrator/client-menu[/quick-links], khách đọc v1/setting/menu, v1/setting/quick-links.
- v1/setting và settings/public chỉ trả whitelist PublicSetting::FIELDS (trước đây lộ bot_token, inet_api_key).
- Cài đặt tài khoản khách (preferences), rate limit theo IP cho register/resend-verify.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:53:43 +07:00
baodev0andClaude Opus 5.5 c5115b52dd feat: nạp tiền thủ công mã 30 phút, gia hạn trừ số dư, đồng bộ domain từ Plesk
- 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>
2026-10-11 23:07:51 +07:00
baodev0andClaude Opus 5.5 94614d9cb3 feat: khởi tạo/huỷ domain Plesk qua job, gửi mail hoá đơn qua queue, đính kèm triển khai
- ProvisionDnsDomainJob/SuspendDnsDomainJob: tạo domain admin lên Plesk, huỷ = suspend (is_created=3)
- Khách xem zone DNS được gán ở /dich-vu/domain, quản lý bản ghi A/AAAA/CNAME/TXT/MX/SRV
- send-mail hoá đơn đẩy SendInvoiceMailJob, preview + sửa nội dung, ghi mail.order_id
- invoice_attachments.type (payment_proof/deployment)
- CacheService xoá theo SCAN pattern, Redis không persistent mặc định
- Backfill transactions.public_code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 09:56:18 +07:00
baodev0andClaude Opus 5.5 30898ea46f feat: email gửi tay/nhắc gia hạn, gói hosting, sửa dữ liệu sản phẩm
- Gửi email theo template cho 1 khách, tab lịch sử email, nhắc gia hạn dịch vụ hàng loạt
- Mail lưu from/bcc/sent_by; mẫu MARKETING và mẫu cũ trong TemplateSeeder
- Gói hosting: giới hạn, trạng thái, lấy plan Plesk qua CLI gateway
- Backfill payment_method và ngày đơn hàng còn thiếu
- Bổ sung field CPU/RAM/Disk/Băng thông cho loại sản phẩm vps và cloud

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:32:05 +07:00
baodev0 8651dde6b1 update 2026-10-08 11:25:28 +07:00
baodev0 1544629a1f update 2026-10-05 09:30:24 +07:00
baodev0 ab2f9ad702 update 2026-09-29 11:18:34 +07:00
baodev0 b057d23d71 update 2026-09-28 16:39:22 +07:00
baodev0 82080b5b84 update fix deadcode, security 2026-09-28 08:26:29 +07:00
baodev0 3af59bd9c5 update rm deadcode 2026-09-27 11:42:40 +07:00
baodev0 82a71244ca update 2026-09-23 15:17:18 +07:00
baodev0 cd38c5d6d0 dev update 2026-09-10 16:32:48 +07:00
baodev0 2365ef72e9 update email template 2026-09-09 16:56:22 +07:00
baodev0 d3d9f76ba0 update 2026-08-28 16:40:40 +07:00
baodev0 c917e3bf5e feat: Add IT Support catalog and related migrations, seeders, and email templates
- Created migration to add 'group_label' to 'product_type_fields' table.
- Implemented ItSupportCatalogSeeder to populate IT Support features and tiers.
- Added ProductCategorySeeder for initial product categories.
- Developed ProductMockupSeeder for mockup products in various categories.
- Introduced ProductTypeFieldSeeder to define fields for different product types.
- Created email templates for VPS service information and service renewal reminders.
2026-08-26 16:19:38 +07:00
baodev0 c377c7e195 feat: add domain registration form and email notifications
- Create a new Blade view for domain registration (`registrant-tochuc.blade.php`) to capture organization and manager details.
- Implement email templates for new domain orders for both admin (`domain-order-new.blade.php`) and customers (`domain-order-received.blade.php`).
- Add CSV exports for client and domain data.
- Introduce tests for customer mass assignment, password reset, login throttling, and permission gating.
- Ensure service renewals use current pricing and validate ownership for virtual machines.
- Validate mass assignment behavior in service model.
2026-08-22 17:30:55 +07:00
baodev0 eec2c5906e feat: Implement mail campaign feature with CRUD operations and email sending capabilities 2026-08-21 16:57:32 +07:00