<?php

namespace App\Classes\Modules\Announcements\Standards\Validators;

use App\Classes\General\Abstracts\AbstractValidation;
use App\Classes\Modules\Announcements\DataTransferObjects\AnnouncementObject;

class AnnouncementValidation extends AbstractValidation
{
    /**
     * @param AnnouncementObject $object
     * @return array
     */
    protected function data($object): array 
    {
        return [
            'title' => $object->getTitle(),
            'description' => $object->getDescription(),
            'starting_on' => $object->getStartingOn(),
            'ending_on' => $object->getEndingOn()
        ];
    }

    /**
     * @return array
     */
    protected function rules(): array 
    {
        return [
            'title' => 'required',
            'description' => 'required',
            'starting_on' => 'required',
            'ending_on' => 'required'
        ];
    }

    /**
     * @return array
     */
    protected function messages(): array 
    {
        return [];
    }
}