<?php

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


use App\Classes\General\Abstracts\AbstractValidation;
use App\Classes\Modules\Vouchers\DataTransferObjects\CreateVoucherObject;

class VoucherValidation extends AbstractValidation
{
    /**
     * @param CreateVoucherObject $object
     * @return array
     */
    protected function data($object): array {

        $data = [
            'user'=> $object->getUser(),
            'voucherCode' => $object->getVoucherCode(),
        ];

        return $data;
    }

    /**
     * @param null|string $type
     * @return array
     */
    protected function rules(): array {
        return [
            'user' => [
                'required',
            ],
            'voucherCode' => [
                'required',
            ]
        ];
    }

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

}
