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

@@ -15,8 +15,6 @@ final class Broadband extends Type implements ProductItem
protected $table = 'product_broadband';
protected const category_name = 'Broadband';
// Information required during the order process
protected array $order_attributes = [
'options.address'=>[

View File

@@ -12,8 +12,6 @@ final class Domain extends Type implements ProductItem
{
protected $table = 'product_domain';
protected const category_name = 'Domain Name';
// The model that is referenced when this product is ordered
protected string $order_model = ServiceDomain::class;

View File

@@ -12,8 +12,6 @@ final class Email extends Type implements ProductItem
{
protected $table = 'product_email';
protected const category_name = 'Email Hosting';
// The model that is referenced when this product is ordered
protected string $order_model = ServiceEmail::class;

View File

@@ -12,8 +12,6 @@ final class Generic extends Type implements ProductItem
{
protected $table = 'product_generic';
protected const category_name = 'Generic';
// The model that is referenced when this product is ordered
protected string $order_model = ServiceGeneric::class;

View File

@@ -12,8 +12,6 @@ final class Host extends Type implements ProductItem
{
protected $table = 'product_host';
protected const category_name = 'Web Hosting';
// The model that is referenced when this product is ordered
protected string $order_model = ServiceHost::class;

View File

@@ -12,8 +12,6 @@ final class Phone extends Type implements ProductItem
{
protected $table = 'product_phone';
protected const category_name = 'Telephone';
protected array $order_attributes = [
'options.phonenumber'=>[
'request'=>'options.phonenumber',

View File

@@ -12,8 +12,6 @@ final class SSL extends Type implements ProductItem
{
protected $table = 'product_ssl';
protected const category_name = 'SSL Certificate';
// The model that is referenced when this product is ordered
protected string $order_model = ServiceSSL::class;

View File

@@ -32,9 +32,11 @@ abstract class Type extends Model
* other logic of these types.
*
* @return string
* @deprecated - can this be replaced with product->supplied->category?
*/
final public function getCategoryAttribute(): string
{
abort(500,'use product->supplied->category_name');
return strtolower((new \ReflectionClass($this))->getShortName());
}
@@ -42,9 +44,11 @@ abstract class Type extends Model
* Return a friendly name for this product, used for display
*
* @return string
* @deprecated - can this be replaced with product->supplied->category_name
*/
final public function getCategoryNameAttribute(): string
{
abort(500,'use product->supplied->category_name');
return static::category_name;
}
}