46 lines
982 B
PHP
46 lines
982 B
PHP
<?php
|
|
|
|
namespace Modules\IndustrialEngineering\Models;
|
|
|
|
use App\Contact;
|
|
use App\Transaction;
|
|
use App\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class CpqConfiguration extends Model
|
|
{
|
|
use BelongsToBusiness;
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'ie_cpq_configurations';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'selected_options' => 'array',
|
|
'bom_snapshot' => 'array',
|
|
'quoted_price' => 'decimal:4',
|
|
];
|
|
|
|
public function productPlatform()
|
|
{
|
|
return $this->belongsTo(ProductPlatform::class, 'product_platform_id');
|
|
}
|
|
|
|
public function contact()
|
|
{
|
|
return $this->belongsTo(Contact::class, 'contact_id');
|
|
}
|
|
|
|
public function sellTransaction()
|
|
{
|
|
return $this->belongsTo(Transaction::class, 'sell_transaction_id');
|
|
}
|
|
|
|
public function createdBy()
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
}
|