Start work on updating services

This commit is contained in:
Deon George
2022-04-19 17:07:39 +10:00
parent ebf08ea414
commit 621a132e35
63 changed files with 1038 additions and 612 deletions

View File

@@ -8,6 +8,7 @@ use Illuminate\Support\Collection;
use App\Interfaces\SupplierItem;
use App\Models\Product\Broadband as ProductBroadband;
// @todo does this need to extend Type? Perhaps have a SupplierType consistent with ServiceType.
class Broadband extends Type implements SupplierItem
{
protected $casts = [
@@ -37,7 +38,7 @@ class Broadband extends Type implements SupplierItem
public function types()
{
return $this->belongsToMany(ProductBroadband::class,$this->table,'id','id','id',$this->table.'_id');
return $this->belongsToMany(ProductBroadband::class,$this->table,'id','id','id','supplier_item_id');
}
public function getBillingIntervalAttribute(): int

View File

@@ -24,7 +24,7 @@ final class Domain extends Type implements SupplierItem
public function types()
{
return $this->belongsToMany(ProductDomain::class,$this->table,'id','id','id',$this->table.'_id');
return $this->belongsToMany(ProductDomain::class,$this->table,'id','id','id','supplier_item_id');
}
/* RELATIONS */

View File

@@ -18,6 +18,6 @@ final class Email extends Type implements SupplierItem
public function types()
{
return $this->belongsToMany(ProductEmail::class,$this->table,'id','id','id',$this->table.'_id');
return $this->belongsToMany(ProductEmail::class,$this->table,'id','id','id','supplier_item_id');
}
}

View File

@@ -13,7 +13,7 @@ final class Generic extends Type implements SupplierItem
public function types()
{
return $this->belongsToMany(ProductGeneric::class,$this->table,'id','id','id',$this->table.'_id');
return $this->belongsToMany(ProductGeneric::class,$this->table,'id','id','id','supplier_item_id');
}
public function getBillingIntervalAttribute(): int

View File

@@ -13,7 +13,7 @@ final class Host extends Type implements SupplierItem
public function types()
{
return $this->belongsToMany(ProductHost::class,$this->table,'id','id','id',$this->table.'_id');
return $this->belongsToMany(ProductHost::class,$this->table,'id','id','id','supplier_item_id');
}
public function getBillingIntervalAttribute(): int

View File

@@ -3,17 +3,17 @@
namespace App\Models\Supplier;
use App\Interfaces\SupplierItem;
use App\Models\Product\Voip as ProductVoip;
use App\Models\Product\Phone as ProductVoip;
final class Voip extends Type implements SupplierItem
final class Phone extends Type implements SupplierItem
{
protected $table = 'supplier_voip';
protected $table = 'supplier_phone';
/* INTERFACES */
public function types()
{
return $this->belongsToMany(ProductVoip::class,$this->table,'id','id','id',$this->table.'_id');
return $this->belongsToMany(ProductVoip::class,$this->table,'id','id','id','supplier_item_id');
}
public function getBillingIntervalAttribute(): int

View File

@@ -13,7 +13,7 @@ final class SSL extends Type implements SupplierItem
public function types()
{
return $this->belongsToMany(ProductSSL::class,$this->table,'id','id','id',$this->table.'_id');
return $this->belongsToMany(ProductSSL::class,$this->table,'id','id','id','supplier_item_id');
}
public function getBillingIntervalAttribute(): int