<?php

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


use App\Classes\General\Abstracts\AbstractValidation;
use App\Classes\Modules\PackingLists\DataTransferObjects\ItemObject;

class ItemValidation extends AbstractValidation
{


    /**
     * @param ItemObject $object
     * @return array
     */
    protected function data($object): array {
        return [
            'package_id' => $object->getPackageId(),
            'name' => $object->getName(),
            'reference' => $object->getReference(),
            'description' => $object->getDescription(),
            'quantity' => $object->getQuantity(),
            'uom' => $object->getUom(),
            'price' => $object->getPrice(),
            'total' => $object->getTotal(),
            'status' => $object->getStatus(),
        ];
    }

    /**
     * @return array
     */
    protected function rules(): array {
        return [
            'package_id' => 'required',
            'name' => 'required',
            'reference' =>  'required',
            'quantity' =>  'required',
            'price' =>  'required',
            'total' =>  'required',
        ];
    }

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

}
