Enable editing of supplier products and listing services connected to them

This commit is contained in:
Deon George
2022-06-30 23:51:20 +10:00
parent fb416306e7
commit 5297ae8a62
33 changed files with 963 additions and 182 deletions

View File

@@ -10,6 +10,8 @@ use App\Models\Product\Broadband as ProductBroadband;
class Broadband extends Type implements SupplierItem
{
protected const category_name = 'Broadband';
protected $casts = [
'offpeak_start' => 'datetime:H:i',
'offpeak_end' => 'datetime:H:i',
@@ -35,16 +37,16 @@ class Broadband extends Type implements SupplierItem
/* INTERFACES */
public function types()
{
return $this->belongsToMany(ProductBroadband::class,$this->table,'id','id','id','supplier_item_id');
}
public function getBillingIntervalAttribute(): int
{
return 1; // Monthly
}
public function products()
{
return $this->hasMany(ProductBroadband::class,'supplier_item_id','id');
}
/* METHODS */
/**
@@ -156,14 +158,4 @@ class Broadband extends Type implements SupplierItem
return $result;
}
/**
* Return the Broadband Speed
*
* @return string
*/
public function speed(): string
{
return $this->speed;
}
}