<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * Class Stock
 * 
 * @property int $item_stk_id
 * @property string $barcode
 * @property int $item_code
 * @property int $color_code
 * @property float $qty
 * @property float $cost_price
 * @property float $sales_price_1
 * @property float $sales_price_2
 * @property string $item_stat
 * @property string|null $exp_date
 * @property string $status
 * @property string $section_no
 * @property string|null $margine
 * @property string|null $cost_code
 * @property string|null $unit
 * @property int|null $event_id
 * @property int|null $size_id
 * @property string|null $group_item
 * @property float|null $fake_cost
 * 
 * @property Event|null $event
 *
 * @package App\Models
 */
class Stock extends Model
{
	protected $table = 'stock';
	protected $primaryKey = 'item_stk_id';
	public $timestamps = false;

	protected $casts = [
		'item_code' => 'int',
		'color_code' => 'int',
		'qty' => 'float',
		'cost_price' => 'float',
		'sales_price_1' => 'float',
		'sales_price_2' => 'float',
		'event_id' => 'int',
		'size_id' => 'int',
		'fake_cost' => 'float'
	];

	protected $fillable = [
		'barcode',
		'item_code',
		'color_code',
		'qty',
		'cost_price',
		'sales_price_1',
		'sales_price_2',
		'item_stat',
		'exp_date',
		'status',
		'section_no',
		'margine',
		'cost_code',
		'unit',
		'event_id',
		'size_id',
		'group_item',
		'fake_cost'
	];

	public function event()
	{
		return $this->belongsTo(Event::class);
	}
}
