<?php

namespace App\Core\Validator\OfferAccommodationMapping;

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

use App\Core\Validator\BaseValidator;

class OfferAccommodationMappingAddValidator extends BaseValidator
{

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

    public function rules($params = null)
    {
        return
            [
                "offer_id" => 'required|numeric',
                "accommodation_mapping" => 'required|array',
                "accommodation_mapping.*" => 'required|numeric',
            ];


    }

    public function messages()
    {
        $thisMessages = [
            'accommodation_mapping.required' => __('error-input-accommodation_mapping-required')

        ];
        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());
    }

}
