Some checks failed
Tests / PHP 8.1 (push) Has been cancelled
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
52 lines
1.1 KiB
PHP
52 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Modules\EcommerceFinance\Models;
|
|
|
|
use App\Abstracts\Model;
|
|
use App\Models\Banking\Account;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class Store extends Model
|
|
{
|
|
protected $table = 'ec_stores';
|
|
|
|
protected $fillable = [
|
|
'company_id',
|
|
'channel_id',
|
|
'name',
|
|
'external_id',
|
|
'settlement_account_id',
|
|
'timezone',
|
|
'currency_code',
|
|
'enabled',
|
|
'created_by',
|
|
'created_from',
|
|
];
|
|
|
|
public function channel(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Channel::class);
|
|
}
|
|
|
|
public function settlementAccount(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Account::class, 'settlement_account_id');
|
|
}
|
|
|
|
public function importBatches(): HasMany
|
|
{
|
|
return $this->hasMany(ImportBatch::class);
|
|
}
|
|
|
|
public function orders(): HasMany
|
|
{
|
|
return $this->hasMany(Order::class);
|
|
}
|
|
|
|
public function settlements(): HasMany
|
|
{
|
|
return $this->hasMany(Settlement::class);
|
|
}
|
|
}
|