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
55 lines
1.2 KiB
PHP
55 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Modules\EcommerceFinance\Models;
|
|
|
|
use App\Abstracts\Model;
|
|
use App\Models\Banking\Transaction;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class Settlement extends Model
|
|
{
|
|
protected $table = 'ec_settlements';
|
|
|
|
protected $fillable = [
|
|
'company_id',
|
|
'store_id',
|
|
'transaction_id',
|
|
'external_settlement_id',
|
|
'period_start',
|
|
'period_end',
|
|
'settled_at',
|
|
'currency_code',
|
|
'gross_amount',
|
|
'fee_amount',
|
|
'refund_amount',
|
|
'net_amount',
|
|
'status',
|
|
'payload',
|
|
'created_by',
|
|
'created_from',
|
|
];
|
|
|
|
protected $casts = [
|
|
'period_start' => 'datetime',
|
|
'period_end' => 'datetime',
|
|
'settled_at' => 'datetime',
|
|
'payload' => 'array',
|
|
];
|
|
|
|
public function store(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Store::class);
|
|
}
|
|
|
|
public function transaction(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Transaction::class);
|
|
}
|
|
|
|
public function lines(): HasMany
|
|
{
|
|
return $this->hasMany(SettlementLine::class);
|
|
}
|
|
}
|