Added in email hosting, and other misc cosmetic fixes
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Models\Product;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Leenooks\Traits\ScopeActive;
|
||||
|
||||
use App\Interfaces\ProductItem;
|
||||
use App\Models\Supplier;
|
||||
@@ -11,6 +12,8 @@ use App\Models\Supplier\Broadband as SupplierBroadband;
|
||||
|
||||
final class Broadband extends Type implements ProductItem
|
||||
{
|
||||
use ScopeActive;
|
||||
|
||||
protected $table = 'product_broadband';
|
||||
|
||||
// Information required during the order process
|
||||
@@ -44,17 +47,6 @@ final class Broadband extends Type implements ProductItem
|
||||
return $this->hasOne(SupplierBroadband::class,'id','supplier_broadband_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* The supplier
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOneThrough
|
||||
*/
|
||||
// @todo To check
|
||||
public function supplier()
|
||||
{
|
||||
return $this->hasOneThrough(Supplier::class,SupplierBroadband::class,'id','id','adsl_supplier_plan_id','supplier_id');
|
||||
}
|
||||
|
||||
/* INTERFACES */
|
||||
|
||||
/**
|
||||
|
69
app/Models/Product/Email.php
Normal file
69
app/Models/Product/Email.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Product;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
use App\Interfaces\ProductItem;
|
||||
use App\Models\Service\Email as ServiceEmail;
|
||||
use App\Models\Supplier\Email as SupplierEmail;
|
||||
|
||||
final class Email extends Type implements ProductItem
|
||||
{
|
||||
protected $table = 'product_email';
|
||||
|
||||
// The model that is referenced when this product is ordered
|
||||
protected string $order_model = ServiceEmail::class;
|
||||
|
||||
/* RELATIONS */
|
||||
|
||||
/**
|
||||
* The offering supplied with this product
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function supplied()
|
||||
{
|
||||
return $this->hasOne(SupplierEmail::class,'id','supplier_email_id');
|
||||
}
|
||||
|
||||
/* INTERFACES */
|
||||
|
||||
public function allowance(): Collection
|
||||
{
|
||||
// N/A
|
||||
return collect();
|
||||
}
|
||||
|
||||
public function allowance_string(): string
|
||||
{
|
||||
// N/A
|
||||
return '';
|
||||
}
|
||||
|
||||
public function getContractTermAttribute(): int
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
|
||||
public function getCostAttribute(): float
|
||||
{
|
||||
// N/A
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getSupplierAttribute()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function getTypeAttribute()
|
||||
{
|
||||
return 'Domain Name';
|
||||
}
|
||||
|
||||
public function hasUsage(): bool
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user