Files
clinicpro/migrations/Version20260610183655.php
hamed af0ae51987 feat: add clinic doctor invitation feature
- Implemented ClinicInvitationController to handle doctor invitations.
- Created ClinicDoctorInvitation entity and repository for managing invitations.
- Added ClinicInvitationService for business logic related to invitations.
- Introduced endpoints for inviting, listing, resending, changing status, and deleting invitations.
- Updated security configuration to allow public access to invitation endpoints.
- Added migration for clinic_doctor_invitations table.
- Enhanced DoctorRepository with a method to find doctors by mobile number.
- Updated ClinicDetailPage to include invitation management UI.
2026-06-10 22:13:39 +03:30

38 lines
2.2 KiB
PHP

<?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 Version20260610183655 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE clinic_doctor_invitations (id INT AUTO_INCREMENT NOT NULL, uuid VARCHAR(36) NOT NULL, mobile VARCHAR(20) NOT NULL, invited_name VARCHAR(255) DEFAULT NULL, invited_specialty VARCHAR(255) DEFAULT NULL, token VARCHAR(128) NOT NULL, token_used TINYINT NOT NULL, status VARCHAR(20) NOT NULL, invited_at INT NOT NULL, expires_at INT NOT NULL, responded_at INT DEFAULT NULL, clinic_id INT NOT NULL, invited_by_id INT NOT NULL, doctor_id INT DEFAULT NULL, UNIQUE INDEX UNIQ_26DCCFEBD17F50A6 (uuid), UNIQUE INDEX UNIQ_26DCCFEB5F37A13B (token), INDEX IDX_26DCCFEBA7B4A7E3 (invited_by_id), INDEX IDX_26DCCFEB87F4FB17 (doctor_id), INDEX idx_cdi_token (token), INDEX idx_cdi_clinic (clinic_id), INDEX idx_cdi_mobile (mobile), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4');
$this->addSql('ALTER TABLE clinic_doctor_invitations ADD CONSTRAINT FK_26DCCFEBCC22AD4 FOREIGN KEY (clinic_id) REFERENCES clinics (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE clinic_doctor_invitations ADD CONSTRAINT FK_26DCCFEBA7B4A7E3 FOREIGN KEY (invited_by_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE clinic_doctor_invitations ADD CONSTRAINT FK_26DCCFEB87F4FB17 FOREIGN KEY (doctor_id) REFERENCES doctors (id) ON DELETE SET NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE clinic_doctor_invitations DROP FOREIGN KEY FK_26DCCFEBCC22AD4');
$this->addSql('ALTER TABLE clinic_doctor_invitations DROP FOREIGN KEY FK_26DCCFEBA7B4A7E3');
$this->addSql('ALTER TABLE clinic_doctor_invitations DROP FOREIGN KEY FK_26DCCFEB87F4FB17');
$this->addSql('DROP TABLE clinic_doctor_invitations');
}
}