42 lines
1.0 KiB
PHP
42 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
use App\Models\Concerns\SchoolYearAutoFillTrait;
|
|
|
|
class PaymentCorrectionModel extends Model
|
|
{
|
|
use SchoolYearAutoFillTrait;
|
|
|
|
protected $table = 'payment_corrections';
|
|
protected $primaryKey = 'id';
|
|
protected $returnType = 'array';
|
|
protected $useTimestamps = false;
|
|
|
|
protected $allowedFields = [
|
|
'payment_id',
|
|
'invoice_id',
|
|
'parent_id',
|
|
'school_year',
|
|
'correction_type',
|
|
'approved_refundable_cents',
|
|
'status',
|
|
'reason',
|
|
'approved_by',
|
|
'approved_at',
|
|
'created_at',
|
|
'updated_at',
|
|
];
|
|
|
|
protected $validationRules = [
|
|
'payment_id' => 'required|integer',
|
|
'invoice_id' => 'required|integer',
|
|
'parent_id' => 'required|integer',
|
|
'school_year' => 'required|string|max_length[9]',
|
|
'correction_type' => 'required|max_length[50]',
|
|
'approved_refundable_cents' => 'required|integer|greater_than[0]',
|
|
'status' => 'required|max_length[30]',
|
|
];
|
|
}
|