48 lines
1.3 KiB
PHP
48 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
class RefundPayoutModel extends Model
|
|
{
|
|
protected $table = 'refund_payouts';
|
|
protected $primaryKey = 'id';
|
|
protected $returnType = 'array';
|
|
protected $useTimestamps = false;
|
|
|
|
protected $allowedFields = [
|
|
'refund_id',
|
|
'amount_cents',
|
|
'currency',
|
|
'payout_type',
|
|
'payment_method',
|
|
'status',
|
|
'external_reference',
|
|
'check_number',
|
|
'check_date',
|
|
'evidence_path',
|
|
'idempotency_key',
|
|
'operation_type',
|
|
'request_fingerprint_hash',
|
|
'processed_by',
|
|
'processed_at',
|
|
'reversed_payout_id',
|
|
'failure_code',
|
|
'failure_message',
|
|
'created_at',
|
|
'updated_at',
|
|
];
|
|
|
|
protected $validationRules = [
|
|
'refund_id' => 'required|integer',
|
|
'amount_cents' => 'required|integer|greater_than[0]',
|
|
'currency' => 'required|exact_length[3]',
|
|
'payout_type' => 'required|in_list[cash_out,account_credit,reversal]',
|
|
'status' => 'required|max_length[30]',
|
|
'idempotency_key' => 'required|max_length[100]',
|
|
'operation_type' => 'permit_empty|max_length[50]',
|
|
'request_fingerprint_hash' => 'permit_empty|exact_length[64]',
|
|
];
|
|
}
|