Consolida recepcoes, stock, equipamentos e identidade SGC
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Concerns\AppendOnlyInventoryRecord;
|
||||
use App\Models\Concerns\BelongsToTenant;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $tenant_id
|
||||
* @property int $purchase_order_id
|
||||
* @property int $received_by
|
||||
* @property string $payload_hash
|
||||
* @property array<string, mixed> $snapshot
|
||||
*/
|
||||
class GoodsReceipt extends Model
|
||||
{
|
||||
use AppendOnlyInventoryRecord, BelongsToTenant;
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['snapshot' => 'array', 'received_on' => 'date:Y-m-d', 'confirmed_at' => 'datetime'];
|
||||
}
|
||||
|
||||
/** @return HasMany<GoodsReceiptItem, $this> */
|
||||
public function items(): HasMany
|
||||
{
|
||||
return $this->hasMany(GoodsReceiptItem::class)->orderBy('id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user