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
@@ -0,0 +1,51 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
private const STARRABLE_TABLES = ['services', 'customers', 'orders', 'invoices'];
public function up(): void
{
foreach (self::STARRABLE_TABLES as $table) {
if (! Schema::hasColumn($table, 'is_starred')) {
Schema::table($table, function (Blueprint $blueprint) {
$blueprint->boolean('is_starred')->default(false)->index();
});
}
}
Schema::create('tags', function (Blueprint $table) {
$table->id();
$table->string('title', 50)->unique();
$table->string('color', 20);
$table->timestamps();
});
Schema::create('taggables', function (Blueprint $table) {
$table->foreignId('tag_id')->constrained('tags')->cascadeOnDelete();
$table->string('taggable_type', 100);
$table->unsignedBigInteger('taggable_id');
$table->primary(['tag_id', 'taggable_type', 'taggable_id']);
$table->index(['taggable_type', 'taggable_id']);
});
}
public function down(): void
{
Schema::dropIfExists('taggables');
Schema::dropIfExists('tags');
foreach (self::STARRABLE_TABLES as $table) {
if (Schema::hasColumn($table, 'is_starred')) {
Schema::table($table, function (Blueprint $blueprint) {
$blueprint->dropIndex(['is_starred']);
$blueprint->dropColumn('is_starred');
});
}
}
}
};