feat(tenant): add allow_refund and allow_partial_refund methods

This commit is contained in:
2026-09-10 17:04:34 -03:00
parent beb5d18b29
commit 210c854fee
2 changed files with 69 additions and 0 deletions

View File

@@ -112,6 +112,33 @@ class Tenant extends Model
return $this->scanner_category_validation_enabled;
}
public function allow_refund(): bool
{
return (bool) $this->allow_ticket_total_refund || $this->allow_partial_refund();
}
public function allow_partial_refund(): bool
{
return (bool) $this->allow_ticket_partial_refund
&& $this->ticket_partial_refund_percentage !== null
&& (float) $this->ticket_partial_refund_percentage > 0;
}
public function allowRefund(): bool
{
return $this->allow_refund();
}
public function allowPartialRefund(): bool
{
return $this->allow_partial_refund();
}
public function getAllowRefundAttribute(): bool
{
return $this->allow_refund();
}
/**
* Get the attributes that should be cast.
*