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>
This commit is contained in:
baodev0
2026-10-15 21:53:41 +07:00
co-authored by Claude Opus 5.5
parent 46aa138eec
commit 40bf6b54f9
33 changed files with 780 additions and 11 deletions
+2 -2
View File
@@ -32,7 +32,7 @@ class SendMailCampaignRecipient implements ShouldQueue
public function handle(MailCampaignRenderer $renderer): void
{
$campaign = MailCampaign::with('template')->find($this->campaignId);
if (!$campaign) {
if (!$campaign || $campaign->status === MailCampaign::STATUS_CANCELLED) {
return;
}
@@ -93,7 +93,7 @@ class SendMailCampaignRecipient implements ShouldQueue
$campaign->increment($failed ? 'failed_count' : 'sent_count');
$finished = MailCampaign::whereKey($campaign->id)
->whereIn('status', ['queued', 'sending'])
->whereIn('status', MailCampaign::ACTIVE_STATUSES)
->whereRaw('sent_count + failed_count >= total_recipients')
->update([
'status' => DB::raw("CASE WHEN sent_count = 0 THEN 'failed' ELSE 'completed' END"),