osb/app/Models/Product/Voip.php

59 lines
1.4 KiB
PHP
Raw Normal View History

2019-07-02 05:28:27 +00:00
<?php
namespace App\Models\Product;
2020-02-20 11:54:28 +00:00
use App\Models\Base\ProductType;
2019-07-02 05:28:27 +00:00
use App\Traits\NextKey;
use App\Traits\OrderServiceOptions;
2019-07-02 05:28:27 +00:00
2020-02-20 11:54:28 +00:00
class Voip extends ProductType
2019-07-02 05:28:27 +00:00
{
use NextKey;
const RECORD_ID = '';
use OrderServiceOptions;
protected $order_attributes = [
'options.phonenumber'=>[
'request'=>'options.phonenumber',
'key'=>'service_number',
'validation'=>'nullable|size:10|unique:ab_service__voip,service_number',
'validation_message'=>'Phone Number is a required field.',
],
'options.supplier'=>[
'request'=>'options.supplier',
'key'=>'order_info.supplier',
'validation'=>'required_with:options.phonenumber',
'validation_message'=>'Phone Supplier is a required field.',
],
'options.supplieraccnum'=>[
'request'=>'options.supplieraccnum',
'key'=>'order_info.supplieraccnum',
'validation'=>'required_with:options.phonenumber',
'validation_message'=>'Phone Supplier Account Number is a required field.',
],
'options.notes'=>[
'request'=>'options.notes',
'key'=>'order_info.notes',
'validation'=>'required_if:options.phonenumber,null',
'validation_message'=>'Special Instructions here.',
],
];
protected $order_model = \App\Models\Service\Voip::class;
public function getContractTermAttribute(): int
{
return 12;
}
public function getTypeAttribute()
{
return 'VOIP';
}
public function hasUsage(): bool
{
return TRUE;
}
2019-07-02 05:28:27 +00:00
}