More product cleanup
This commit is contained in:
@@ -6,11 +6,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
use App\Models\Product;
|
||||
use App\Traits\{OrderServiceOptions,SiteID};
|
||||
use App\Traits\{OrderServiceOptions,ProductDetails,SiteID};
|
||||
|
||||
abstract class Type extends Model
|
||||
{
|
||||
use SiteID,OrderServiceOptions;
|
||||
use SiteID,ProductDetails,OrderServiceOptions;
|
||||
|
||||
/* RELATIONS */
|
||||
|
||||
@@ -36,6 +36,16 @@ abstract class Type extends Model
|
||||
|
||||
/* ATTRIBUTES */
|
||||
|
||||
/**
|
||||
* The Billing interval that the supplier normally uses for this offering
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBillingIntervalAttribute(): int
|
||||
{
|
||||
return static::DefaultBill;
|
||||
}
|
||||
|
||||
/**
|
||||
* The product contract term is the highest of our defined contract_term (in Products/*) vs the suppliers
|
||||
* contract term (defined in Supplier/*).
|
||||
@@ -46,11 +56,4 @@ abstract class Type extends Model
|
||||
{
|
||||
return max(Arr::get($this->attributes,'contract_term',0),$this->supplied->contract_term);
|
||||
}
|
||||
|
||||
/* METHODs */
|
||||
|
||||
final public function normalizeBillingInterval(): int
|
||||
{
|
||||
return static::DefaultBill;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user