More works on products
This commit is contained in:
@@ -2,10 +2,33 @@
|
||||
|
||||
namespace App\Models\Product;
|
||||
|
||||
use App\Models\Base\ProductType;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class Generic extends ProductType
|
||||
use App\Interfaces\ProductItem;
|
||||
use App\Models\Service\Generic as ServiceGeneric;
|
||||
use App\Models\Supplier\Generic as SupplierGeneric;
|
||||
|
||||
final class Generic extends Type implements ProductItem
|
||||
{
|
||||
protected $table = 'product_generic';
|
||||
|
||||
// The model that is referenced when this product is ordered
|
||||
protected string $order_model = ServiceGeneric::class;
|
||||
|
||||
/* RELATIONS */
|
||||
|
||||
/**
|
||||
* The offering supplied with this product
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function supplied()
|
||||
{
|
||||
return $this->hasOne(SupplierGeneric::class,'id','supplier_generic_id');
|
||||
}
|
||||
|
||||
/* INTERFACES */
|
||||
|
||||
public function getContractTermAttribute(): int
|
||||
{
|
||||
return 0;
|
||||
@@ -20,4 +43,24 @@ class Generic extends ProductType
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
public function allowance(): Collection
|
||||
{
|
||||
// TODO: Implement allowance() method.
|
||||
}
|
||||
|
||||
public function allowance_string(): string
|
||||
{
|
||||
// TODO: Implement allowance_string() method.
|
||||
}
|
||||
|
||||
public function getCostAttribute(): float
|
||||
{
|
||||
// TODO: Implement getCostAttribute() method.
|
||||
}
|
||||
|
||||
public function getSupplierAttribute()
|
||||
{
|
||||
// TODO: Implement getSupplierAttribute() method.
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user