<?php

namespace App\Core\Validator\PropertyChannelCoupon;

use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Translation\Translator;
use Exception;
use App\Core\Validator\BaseValidator;
use App\Models\PropertyPlace;

class PropertyChannelCouponValidator extends BaseValidator
{

    public function __construct
    (
        Translator $translator,
        Container $container
    )
    {
        parent::__construct($translator, $container);
    }

    public function rules($params = null)
    {
        return
            [
                "property_id" => 'required|numeric',
                "channel_id" => 'required|numeric',
                "code" => 'required',
                "start_date" => 'required|date',
                "end_date" => 'required|date',
                'type' => 'required|in:PER,FIX',
                'value' => 'required|numeric',
                'status' => 'nullable|boolean'
            ];
    }

    public function messages()
    {
        return parent::messages();
    }


    public function validate(array $params, array $rules = [], array $messages = [], array $customAttributes = [])
    {
        return $this->make($params, $this->rules($params), $this->messages());
    }

}
