Add coupon management, customer services, and update TASKS.md

Phase 5 (Admin Panel):
- Admin coupon management: full CRUD with create/edit/deactivate,
  auto-generate codes, plan restrictions multi-select, usage tracking,
  redemption history on edit page
- Add active flag migration for coupons table

Phase 4 (Customer Dashboard):
- Customer services list page with plan info and status
- Customer service detail page with network info, plan details,
  control panel links (VirtFusion/SynergyCP/Enhance), important dates
- Service status/type resolver utilities

Documentation:
- Update TASKS.md with all completed Phase 3/4/5/8 items

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude Dev
2026-02-09 10:38:12 -05:00
parent 2061b1f3e3
commit d9ec414264
18 changed files with 1639 additions and 54 deletions

View File

@@ -20,6 +20,7 @@ class Coupon extends Model
'applies_to',
'max_uses',
'times_used',
'active',
'expires_at',
];
@@ -30,6 +31,7 @@ class Coupon extends Model
'applies_to' => 'array',
'max_uses' => 'integer',
'times_used' => 'integer',
'active' => 'boolean',
'expires_at' => 'datetime',
];
}
@@ -41,6 +43,10 @@ class Coupon extends Model
public function isValid(): bool
{
if (! $this->active) {
return false;
}
if ($this->expires_at && $this->expires_at->isPast()) {
return false;
}