feat(subscription): implement effective plan logic and update free plan features
This commit is contained in:
@@ -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'"
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user