| Total Complexity | 4 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class Recipient extends Model implements VeriFactuRecipient |
||
| 13 | { |
||
| 14 | use HasFactory; |
||
|
|
|||
| 15 | use SoftDeletes; |
||
| 16 | |||
| 17 | protected static function newFactory() |
||
| 20 | } |
||
| 21 | |||
| 22 | protected $table = 'recipients'; |
||
| 23 | |||
| 24 | protected $fillable = [ |
||
| 25 | 'invoice_id', |
||
| 26 | 'name', |
||
| 27 | 'tax_id', |
||
| 28 | 'country', |
||
| 29 | 'id_type', // New field from PR #8 for foreign recipients |
||
| 30 | // Otros campos relevantes |
||
| 31 | ]; |
||
| 32 | |||
| 33 | public function invoice() |
||
| 34 | { |
||
| 35 | return $this->belongsTo(Invoice::class); |
||
| 36 | } |
||
| 37 | |||
| 38 | // VeriFactuRecipient Contract Implementation |
||
| 39 | |||
| 40 | public function getName(): string |
||
| 41 | { |
||
| 42 | return $this->name; |
||
| 43 | } |
||
| 44 | |||
| 45 | public function getTaxId(): ?string |
||
| 48 | } |
||
| 49 | } |