- Introduced `online_share_enabled` and `online_share_percent` fields in the `doctor_secretaries` table to manage secretary shares from online appointments. - Added `bank_account` field in the `profiles` table to store user-level IBANs for settlements. - Created `secretary_earnings` table to track earnings per secretary from online appointments, including a foreign key relationship with `financial_breakdowns`. - Implemented `SecretaryEarning` entity and repository for managing secretary earnings. - Developed `SecretaryShareResolver` service to determine which secretaries earn from online payments. - Added `UserIbanResolver` service to handle user IBAN retrieval and management. - Created `HasIbansTrait` for entities to manage IBANs in a JSON format. - Implemented tests for secretary earnings and API endpoints for managing secretary shares and IBANs.
31 lines
911 B
PHP
31 lines
911 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
/**
|
|
* Per-relation share a secretary earns from that doctor's/clinic's online appointments.
|
|
* Defaults keep the current behaviour: disabled, zero percent.
|
|
*/
|
|
final class Version20260725143211 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Add doctor_secretaries.online_share_enabled and online_share_percent';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$this->addSql("ALTER TABLE doctor_secretaries ADD online_share_enabled TINYINT DEFAULT 0 NOT NULL, ADD online_share_percent NUMERIC(5, 2) DEFAULT '0.00' NOT NULL");
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE doctor_secretaries DROP online_share_enabled, DROP online_share_percent');
|
|
}
|
|
}
|