<?php

namespace Daniv04\HaciendaPackage\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Exceptions\HttpResponseException;
use Daniv04\HaciendaPackage\Services\Validators\ElectronicPurchaseInvoiceValidatorService;




class ElectronicPurchaseInvoiceRequest extends BaseReceiptRequest
{


    public function rules(): array
    {
        return ElectronicPurchaseInvoiceValidatorService::rules($this->all());
    }

    
    public function withValidator($validator)
    {
        parent::withValidator($validator);
        $validator->after(function ($validator) {
            ElectronicPurchaseInvoiceValidatorService::validateIdentificacionTipoEmisor($validator, $this->all());
        });
    }
}

        
