Files
hado/core/app/Providers/AppServiceProvider.php
nikita.hohlov affac4ce1a feat: tick planner, delivery job, scheduler and purge
Also: test uses disabled channels instead of deleting them (FK cascade); ChannelRegistry no longer final so tests can extend it (controller ruling).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
2026-09-04 07:38:16 -03:00

44 lines
1.4 KiB
PHP

<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
$this->app->singleton(\App\Scheduling\WindowResolver::class, fn () => new \App\Scheduling\WindowResolver(
config('hado.fallback_day_minutes'),
config('hado.fallback_hour_minutes'),
config('hado.fallback_hours'),
));
$this->app->singleton(\App\Channels\WebhookChannel::class, fn () => new \App\Channels\WebhookChannel(config('hado.presence_timeout')));
$this->app->singleton(\App\Channels\TelegramChannel::class, fn () => new \App\Channels\TelegramChannel(
config('hado.telegram.token'),
config('hado.telegram.seen_ttl'),
));
$this->app->bind(\App\Delivery\Tick::class, fn ($app) => new \App\Delivery\Tick(
$app->make(\App\Scheduling\DueResolver::class),
$app->make(\App\Scheduling\StateResolver::class),
$app->make(\App\Scheduling\WindowResolver::class),
$app->make(\App\Channels\ChannelRegistry::class),
$app->make('cache.store'),
config('hado.presence_ttl'),
));
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
}
}