Refactor booking system: Remove unused policies, packages, and related entities

- Removed package consumption flags and related properties from PriceQuote.
- Eliminated unused domain event publishing for policies and waitlist in Schedule.
- Cleaned up BookingEngineSeeder by removing package and policy related logic.
- Updated SeedScenariosCommand to reflect removal of policies from output.
- Dropped policy, package, treatment course, cancellation, waitlist, and domain event tables in migration.
- Removed domain event assertions from tests related to resource blocking.
This commit is contained in:
hamed
2026-08-01 20:50:47 +03:30
parent 9486721fa3
commit c4f1f25c80
27 changed files with 129 additions and 1510 deletions
-37
View File
@@ -8,8 +8,6 @@ use App\Clinic\Entity\Clinic;
use App\Doctor\Entity\DoctorAddress;
use App\Resource\Entity\ClinicResource;
use App\Resource\Entity\ResourceType;
use App\Shared\Event\DomainEvents;
use App\Shared\Event\Entity\DomainEventLog;
use App\Tests\ApiTestCase;
use Doctrine\ORM\EntityManagerInterface;
@@ -164,39 +162,4 @@ class ResourceBlockTest extends ApiTestCase
self::assertSame(404, $this->responseCode());
}
/**
* ظرفیتی که برمی‌گردد باید همان‌قدر شنیده شود که ظرفیتی که می‌رود: مصرف‌کننده‌ای که
* فقط مسدودسازی را بشنود، منبع را برای همیشه اشغال می‌بیند.
*/
public function testBlockingAndReleasingEachRecordADomainEvent(): void
{
[$user, $resource] = $this->clinicWithResource();
$start = time() + 86400;
$created = $this->authJson('POST', "/api/v1/resource/{$resource->getUuid()}/blocks", $user, [
'starts_at' => $start,
'ends_at' => $start + 3600,
]);
self::assertSame(201, $this->responseCode());
$blocked = $this->latestEvent(DomainEvents::RESOURCE_BLOCKED);
self::assertNotNull($blocked);
self::assertSame($resource->getUuid(), $blocked->getPayload()['resource_uuid']);
self::assertSame($start, $blocked->getPayload()['starts_at']);
$this->authJson('DELETE', "/api/v1/resource-block/{$created['data']['uuid']}", $user);
self::assertSame(200, $this->responseCode());
$released = $this->latestEvent(DomainEvents::RESOURCE_RELEASED);
self::assertNotNull($released);
self::assertSame($created['data']['uuid'], $released->getPayload()['block_uuid']);
}
private function latestEvent(string $name): ?DomainEventLog
{
return $this->em->getRepository(DomainEventLog::class)
->findOneBy(['name' => $name], ['id' => 'DESC']);
}
}