Files
alrahma_sunday_school/app/Models/InventoryItemYearModel.php
root d906a915d6
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 47s
Tests / PHPUnit (push) Failing after 1m20s
add refund logic and fix books inventory logic
2026-08-22 13:44:25 -04:00

42 lines
1.1 KiB
PHP

<?php
namespace App\Models;
use CodeIgniter\Model;
class InventoryItemYearModel extends Model
{
protected $table = 'inventory_item_years';
protected $primaryKey = 'id';
protected $returnType = 'array';
protected $useTimestamps = true;
protected $allowedFields = [
'inventory_item_id',
'school_year_id',
'school_year',
'opening_quantity',
'charge_price_cents',
'currency',
'price_confirmed',
'system_closing_quantity',
'counted_closing_quantity',
'variance_quantity',
'status',
'source_item_year_id',
'closing_batch_id',
'created_by',
'updated_by',
];
protected $validationRules = [
'inventory_item_id' => 'required|integer',
'school_year' => 'required|string|max_length[16]',
'opening_quantity' => 'required|integer',
'charge_price_cents' => 'required|integer|greater_than_equal_to[0]',
'currency' => 'required|alpha|max_length[3]',
'price_confirmed' => 'required|in_list[0,1]',
'status' => 'required|in_list[open,reconciled,carried,closed]',
];
}