- Added `inventory_package_uuid` and `inventory_package_title` fields to the `ServiceItem` interface. - Updated API documentation to reflect new fields in service item responses. - Implemented methods in `ClinicServiceController` to handle inventory package associations. - Created `ServiceItemAuditLog` entity and repository for tracking changes to service items. - Added functionality to log changes to service items, including inventory package associations. - Implemented tests for attaching/detaching inventory packages and auditing changes. - Created database migrations for new fields and audit log table.
33 lines
923 B
PHP
33 lines
923 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
/**
|
|
* پکیج کالای مصرفی هر خدمت — ارجاع اختیاری service_items → inventory_packages.
|
|
*
|
|
* ارجاع خام int بدون FK است (همان الگوی tariffs و tenant_service_coverages) تا دامنهٔ
|
|
* ClinicService به Inventory وابسته نشود.
|
|
*/
|
|
final class Version20260718084301 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Add optional inventory_package_id to service_items';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE service_items ADD inventory_package_id INT DEFAULT NULL');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE service_items DROP inventory_package_id');
|
|
}
|
|
}
|