chore: initial commit of existing codebase

This commit is contained in:
ghassan committed 2026-05-19 12:40:08 +03:00
commit 11e94889b2
292 files changed
+38586

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Item extends Model
{
use HasFactory;
protected $fillable = ['item_code', 'item_name', 'category', 'unit_of_measure', 'minimum_stock_level', 'cost_price', 'description', 'is_active'];
protected $casts = [
'minimum_stock_level' => 'decimal:2',
'cost_price' => 'decimal:2',
'is_active' => 'boolean',
];
public function stockLevels()
{
return $this->hasMany(StockLevel::class);
}
public function stockMovements()
{
return $this->hasMany(StockMovement::class);
}
public function billOfMaterials()
{
return $this->hasMany(BillOfMaterial::class, 'product_id');
}
public function bomComponents()
{
return $this->hasMany(BillOfMaterial::class, 'raw_material_id');
}
}