feat(discount): admin Discount Management tab + uuid-based rule targets

Switch rule target references from int ids to uuids (frontend-friendly; the
engine compares uuids directly) via a migration. Add a Discount Management
tab to the subscription page with a full CRUD UI (DiscountTab): table + modal
form with per-type dynamic target fields (tenant tag / service cascade /
amount / visit count / specific patient / occasion + validity window),
priority and combinable/active toggles. Verified TSC + build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
hamed
2026-07-17 12:02:03 +03:30
co-authored by Claude Fable 5
parent b3b1dad832
commit 18d9cc9812
8 changed files with 451 additions and 39 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260717082805 extends AbstractMigration
{
public function getDescription(): string
{
return 'Switch discount_rules target reference columns from int id to uuid';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE discount_rules ADD target_tag_uuid VARCHAR(36) DEFAULT NULL, ADD target_record_uuid VARCHAR(36) DEFAULT NULL, ADD target_service_item_uuid VARCHAR(36) DEFAULT NULL, DROP target_tag_id, DROP target_record_id, DROP target_service_item_id');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE discount_rules ADD target_tag_id INT DEFAULT NULL, ADD target_record_id INT DEFAULT NULL, ADD target_service_item_id INT DEFAULT NULL, DROP target_tag_uuid, DROP target_record_uuid, DROP target_service_item_uuid');
}
}