<?php

namespace App\Http\Controllers;

use App\Services\NotificationsService;
use App\Traits\HasResponse;
use Illuminate\Http\Request;

class NotificationsController extends Controller
{
    use HasResponse;
    /** @var NotificationsService */
    private $notificationsService;
    public function __construct(NotificationsService $notificationsService)
    {
        $this->notificationsService = $notificationsService;
    }

    public function index(Request $request)
    {
        $withPagination = $this->validatePagination($request->only('perPage', 'page'));
        return $this->notificationsService->get($request->all(), $withPagination);
    }

    public function create(Request $request)
    {
        return $this->notificationsService->create($request->all());
    }

    public function changeStatusN($id)
    {
        return $this->notificationsService->changeStatusN($id);
    }

}
