<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use App\Services\ShjFourCService;
use App\Services\ShjMailSendService;

class AppServiceProvider extends ServiceProvider
{
    /**
     * アプリケーションサービスの登録
     */
    public function register(): void
    {
        // SHJ-4C室割当処理サービスを登録
        $this->app->singleton(ShjFourCService::class, function ($app) {
            return new ShjFourCService(
                $app->make(\App\Models\Park::class),
                $app->make(\App\Models\RegularContract::class),
                $app->make(\App\Models\Batch\BatchLog::class)
            );
        });

        // SHJメール送信処理サービスを登録
        $this->app->singleton(ShjMailSendService::class, function ($app) {
            return new ShjMailSendService(
                $app->make(\App\Models\MailTemplate::class),
                $app->make(\App\Models\Batch\BatchLog::class)
            );
        });


    }

    /**
     * アプリケーションサービスの初期化
     */
    public function boot(): void
    {
        //
    }
}
