<?php

namespace App\Core\Validator\PropertyNonrefundable;

use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Translation\Translator;

use App\Core\Validator\BaseValidator;


class PropertyNonrefundableAddValidator extends BaseValidator
{


    public function __construct
    (

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

    }

    public function rules($params = null)
    {
        return
            [
                "property_id" => 'required|numeric',
                "channels" => 'required|array',
                "channels.*" => 'required|integer',
                "room_rate_mapping" => 'required|array',
                "room_rate_mapping.*.room_rate_mapping_id" => 'required|numeric',
                "room_rate_mapping.*.action_type" => 'required|in:DEC,INC',
                "room_rate_mapping.*.value_type" => 'required|in:PER,FIX',
                "room_rate_mapping.*.value" => 'required|numeric',

            ];


    }

    public function messages()
    {
        $thisMessages = [];
        return array_merge(parent::messages() , $thisMessages);
    }


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

}
