feat(tenant): add allow_refund and allow_partial_refund methods
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user