- 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.
38 lines
1.2 KiB
PHP
38 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use App\Appointment\Message\ExpireAppointmentsMessage;
|
|
use App\Blog\Message\PublishScheduledBlogsMessage;
|
|
use App\Shared\Logging\Message\PruneLogsMessage;
|
|
use Symfony\Component\Scheduler\Attribute\AsSchedule;
|
|
use Symfony\Component\Scheduler\RecurringMessage;
|
|
use Symfony\Component\Scheduler\Schedule as SymfonySchedule;
|
|
use Symfony\Component\Scheduler\ScheduleProviderInterface;
|
|
use Symfony\Contracts\Cache\CacheInterface;
|
|
|
|
#[AsSchedule]
|
|
class Schedule implements ScheduleProviderInterface
|
|
{
|
|
public function __construct(
|
|
private CacheInterface $cache,
|
|
) {
|
|
}
|
|
|
|
public function getSchedule(): SymfonySchedule
|
|
{
|
|
return (new SymfonySchedule())
|
|
->stateful($this->cache) // ensure missed tasks are executed
|
|
->processOnlyLastMissedRun(true) // ensure only last missed task is run
|
|
->add(
|
|
RecurringMessage::every('1 minute', new ExpireAppointmentsMessage())
|
|
)
|
|
->add(
|
|
RecurringMessage::every('1 day', new PruneLogsMessage())
|
|
)
|
|
->add(
|
|
RecurringMessage::every('1 minute', new PublishScheduledBlogsMessage())
|
|
);
|
|
}
|
|
}
|