<?php



namespace Daniv04\HaciendaPackage\Models;

use Daniv04\HaciendaPackage\Enums\ReceiptType;
use Daniv04\HaciendaPackage\Enums\ReceiptStatus;
use Daniv04\HaciendaPackage\Enums\HaciendaStatus;
use Daniv04\HaciendaPackage\Enums\ReceptionStatus;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;


class SentReceipt extends Model
{

    use HasFactory;

     /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'sent_receipts';

    protected $fillable = [
        'receipt_type',
        'ui_key', 
        'consecutive_number',
        'emission_date',
        'sent_to_hacienda_at',
        'receipt_status',
        'signed_xml',
        'hacienda_status',

        'reception_message',
        'reception_status',
        'reception_code',
        'economic_activity_code',
        'tax_condition_code',
        'tax_credited',
        'total_expense',
        'tax_amount',
        'total_voucher',

        'emissor_name',
        'emissor_number',
        'emissor_type_identification',
        'receiver_name',
        'receiver_number',
        'receiver_type_identification',
    ];

    /**
     * The attributes that should be cast.
     *
     * @var array
     */
    protected $casts = [
        'emission_date' => 'datetime',
        'sent_to_hacienda_at' => 'datetime',
        'receipt_type' => ReceiptType::class,
        'receipt_status' => ReceiptStatus::class,
        'hacienda_status' => HaciendaStatus::class,
        'reception_status' => ReceptionStatus::class,
    ];


    
}