2019-07-02 05:28:27 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models\Product;
|
|
|
|
|
2020-02-19 12:37:45 +00:00
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
|
2022-02-01 05:40:46 +00:00
|
|
|
use App\Interfaces\ProductItem;
|
2023-05-04 12:17:42 +00:00
|
|
|
use App\Models\Invoice;
|
2022-02-01 05:40:46 +00:00
|
|
|
use App\Models\Service\Domain as ServiceDomain;
|
|
|
|
use App\Models\Supplier\Domain as SupplierDomain;
|
2019-07-02 05:28:27 +00:00
|
|
|
|
2022-02-01 05:40:46 +00:00
|
|
|
final class Domain extends Type implements ProductItem
|
2019-07-02 05:28:27 +00:00
|
|
|
{
|
2022-02-01 05:40:46 +00:00
|
|
|
protected $table = 'product_domain';
|
|
|
|
|
2022-10-18 03:17:50 +00:00
|
|
|
// Information required during the order process
|
|
|
|
protected array $order_attributes = [
|
|
|
|
'options.domain'=>[
|
|
|
|
'request'=>'options.domain',
|
|
|
|
'key'=>'domain_name',
|
|
|
|
'validation'=>'required|min:3',
|
|
|
|
'validation_message'=>'Domain Name is a required field.',
|
|
|
|
],
|
|
|
|
'options.tld_id'=>[
|
|
|
|
'request'=>'options.tld_id',
|
|
|
|
'key'=>'tld_id',
|
|
|
|
'validation'=>'required|exists:tlds,id',
|
|
|
|
'validation_message'=>'Domain TLD is a required field.',
|
|
|
|
],
|
|
|
|
];
|
|
|
|
|
2022-02-01 05:40:46 +00:00
|
|
|
// The model that is referenced when this product is ordered
|
|
|
|
protected string $order_model = ServiceDomain::class;
|
|
|
|
|
2023-05-04 12:17:42 +00:00
|
|
|
// When comparing billing/pricing/charging, what metric to normalise to
|
|
|
|
const DefaultBill = Invoice::BILL_YEARLY;
|
2023-05-04 00:02:25 +00:00
|
|
|
// The model that the supplier supplies
|
|
|
|
const SupplierModel = SupplierDomain::class;
|
2022-02-01 05:40:46 +00:00
|
|
|
|
|
|
|
/* INTERFACES */
|
2020-02-19 12:37:45 +00:00
|
|
|
|
|
|
|
public function allowance(): Collection
|
|
|
|
{
|
|
|
|
// N/A
|
|
|
|
return collect();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function allowance_string(): string
|
|
|
|
{
|
|
|
|
// N/A
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
2021-12-24 01:14:01 +00:00
|
|
|
public function hasUsage(): bool
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
2019-07-02 05:28:27 +00:00
|
|
|
}
|