@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class InvoiceLineModel extends Model
|
||||
{
|
||||
protected $table = 'invoice_lines';
|
||||
protected $primaryKey = 'id';
|
||||
protected $returnType = 'array';
|
||||
protected $useTimestamps = false;
|
||||
|
||||
protected $allowedFields = [
|
||||
'invoice_id',
|
||||
'line_type',
|
||||
'source_type',
|
||||
'source_id',
|
||||
'active_source_key',
|
||||
'description',
|
||||
'quantity',
|
||||
'unit_amount_cents',
|
||||
'line_amount_cents',
|
||||
'discount_eligible',
|
||||
'calculation_version',
|
||||
'metadata_json',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'voided_at',
|
||||
];
|
||||
|
||||
protected $validationRules = [
|
||||
'invoice_id' => 'required|integer',
|
||||
'line_type' => 'required|max_length[50]',
|
||||
'description' => 'required|max_length[255]',
|
||||
'quantity' => 'required|decimal',
|
||||
'unit_amount_cents' => 'required|integer',
|
||||
'line_amount_cents' => 'required|integer',
|
||||
'discount_eligible' => 'required|in_list[0,1]',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user