2020-12-02 10:36:36 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models\Product;
|
|
|
|
|
2022-02-01 05:40:46 +00:00
|
|
|
use Illuminate\Support\Collection;
|
2020-12-02 10:36:36 +00:00
|
|
|
|
2022-02-01 05:40:46 +00:00
|
|
|
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
|
2020-12-02 10:36:36 +00:00
|
|
|
{
|
2022-02-01 05:40:46 +00:00
|
|
|
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()
|
|
|
|
{
|
2022-04-19 07:07:39 +00:00
|
|
|
return $this->hasOne(SupplierGeneric::class,'id','supplier_item_id');
|
2022-02-01 05:40:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* INTERFACES */
|
|
|
|
|
2021-12-24 01:14:01 +00:00
|
|
|
public function getContractTermAttribute(): int
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hasUsage(): bool
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
2022-02-01 05:40:46 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
}
|
2020-12-02 10:36:36 +00:00
|
|
|
}
|