<?php

namespace App\Core\Validator\PropertyWeb;

use App\Models\PropertyWeb;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Translation\Translator;

use App\Core\Validator\BaseValidator;

class PropertyWebUpdateContentValidator extends BaseValidator
{

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

    public function rules($params = null)
    {
        return
            [
                "property_web_id" => 'required|numeric',
                "property_id" => 'required|numeric',
                "action" => 'required|in:preview,publish',
                "photo_mapping" => "array",
                "photo_mapping.*" => "integer",
                "cover_photos" => 'required|array',
                "cover_photos.*" => 'integer'
            ];
    }

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

}
