feat(subscription): implement effective plan logic and update free plan features

This commit is contained in:
hamed
2026-07-05 10:46:31 +03:30
parent f3ca6d844f
commit 828e3552c0
10 changed files with 148 additions and 30 deletions
+43
View File
@@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Free plan: enable all features (patient_records, services, sms_panel, insurance).
* Free plan's only limitation is the number of secretaries (max_secretaries).
*/
final class Version20260705070546 extends AbstractMigration
{
public function getDescription(): string
{
return 'Free plan gets all features enabled; only secretary count is limited';
}
public function up(Schema $schema): void
{
$now = time();
$this->addSql(
"UPDATE subscription_plans
SET features = '{\"patient_records\":true,\"services\":true,\"sms_panel\":true,\"insurance\":true}',
active = 1,
updated_at = {$now}
WHERE name = 'free'"
);
}
public function down(Schema $schema): void
{
$now = time();
$this->addSql(
"UPDATE subscription_plans
SET features = '{\"patient_records\":false,\"services\":false,\"sms_panel\":false}',
updated_at = {$now}
WHERE name = 'free'"
);
}
}