<?php

namespace Modules\Newsletter\Services;

use Illuminate\Http\Request;
use Modules\Newsletter\Interfaces\NewsletterRepositoryInterface;
use Modules\Newsletter\Models\Newsletter;

class NewsletterService
{
    private NewsletterRepositoryInterface $newsletterRepository ;

    public function __construct(NewsletterRepositoryInterface $newsletterRepository)
    {
        $this->newsletterRepository = $newsletterRepository;
    }

    public function get(Request $request)
    {
        $categories = $this->newsletterRepository->get($request);
        return $categories;
    }
    public function getItem(Newsletter $newsletter)
    {
        $newsletter = $this->newsletterRepository->getItem($newsletter);
        return $newsletter;
    }
    public function save(Request $request, ?Newsletter $newsletter): Newsletter
    {
        $newsletter = $this->newsletterRepository->save($request,$newsletter);
        return $newsletter;
    }
    public function reply(Request $request, ?Newsletter $newsletter): void
    {
        $newsletter = $this->newsletterRepository->reply($request,$newsletter);
    }
    public function replies(Newsletter $newsletter)
    {
        $replies = $this->newsletterRepository->replies($newsletter);
        return $replies;
    }


    public function destroy(Request $request, int $id): array
    {
        $response = $this->newsletterRepository->destroy($request,$id);
        return $response;
    }
    public function destroyAll(Request $request): array
    {
        $response = $this->newsletterRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->newsletterRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->newsletterRepository->restoreAll($request);
        return $response;
    }
}
