Files
clinicpro/migrations/Version20260713110856.php
T
hamedandClaude Opus 4.8 15c6f5dce7 feat(patients): phase A — records list + create/edit form (Figma)
Rebuild the patient records (پرونده‌ها) area, phase A of the Figma redesign:

- BE: add a clinic-scoped `record_number` and a TenantTag `tags` M2M to
  PatientRecord (migration + EAGER-hydrated collection). POST /patient and
  PATCH /patient/{uuid} now accept `record_number` and tenant-scoped `tags`
  (foreign tag → 422); demographic fields (gender, date_of_birth,
  referral_source, description) continue to live on UserProfile via PATCH.
- FE: new PatientsListPage (table + card views, search, pagination, tags
  column, "تشکیل پرونده") at /admin/patients, and PatientRecordFormPage
  (create/edit) that POSTs the record then PATCHes the demographics. Point
  the sidebar "پرونده" entry to the new list.

Phases B–E (tabbed patient file, service stepper, invoice, payments/wallet,
call-center) follow. Backend covered by PHPUnit, FE by Vitest.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 14:54:38 +03:30

38 lines
1.6 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 Version20260713110856 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 patient_record_tags (patient_record_id INT NOT NULL, tenant_tag_id INT NOT NULL, INDEX IDX_BA083ABDEB76A733 (patient_record_id), INDEX IDX_BA083ABD9B790748 (tenant_tag_id), PRIMARY KEY (patient_record_id, tenant_tag_id)) DEFAULT CHARACTER SET utf8mb4');
$this->addSql('ALTER TABLE patient_record_tags ADD CONSTRAINT FK_BA083ABDEB76A733 FOREIGN KEY (patient_record_id) REFERENCES patient_records (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE patient_record_tags ADD CONSTRAINT FK_BA083ABD9B790748 FOREIGN KEY (tenant_tag_id) REFERENCES tenant_tags (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE patient_records ADD record_number VARCHAR(40) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE patient_record_tags DROP FOREIGN KEY FK_BA083ABDEB76A733');
$this->addSql('ALTER TABLE patient_record_tags DROP FOREIGN KEY FK_BA083ABD9B790748');
$this->addSql('DROP TABLE patient_record_tags');
$this->addSql('ALTER TABLE patient_records DROP record_number');
}
}