More works on products

This commit is contained in:
Deon George
2022-02-01 16:40:46 +11:00
parent 1e9f15b40f
commit b9b4416737
36 changed files with 952 additions and 312 deletions

View File

@@ -4,14 +4,30 @@ namespace App\Models\Product;
use Illuminate\Support\Collection;
use App\Interfaces\ProductSupplier;
use App\Models\Base\ProductType;
use App\Traits\NextKey;
use App\Interfaces\ProductItem;
use App\Models\Service\Domain as ServiceDomain;
use App\Models\Supplier\Domain as SupplierDomain;
class Domain extends ProductType implements ProductSupplier
final class Domain extends Type implements ProductItem
{
use NextKey;
const RECORD_ID = '';
protected $table = 'product_domain';
// The model that is referenced when this product is ordered
protected string $order_model = ServiceDomain::class;
/* RELATIONS */
/**
* The offering supplied with this product
*
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function supplied()
{
return $this->hasOne(SupplierDomain::class,'id','supplier_domain_id');
}
/* INTERFACES */
public function allowance(): Collection
{