initial: bootstrap from BukidBountyApp base

This commit is contained in:
Jonathan Sykes
2026-06-06 18:43:00 +08:00
commit eb4a5731fb
5674 changed files with 160857 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
<?php
declare(strict_types=1);
namespace App\Models\Market;
use App\Models\Model;
use App\Models\User;
class PosSession extends Model
{
protected ?string $table = 'pos_sessions';
protected array $fillable = [
'hashkey',
'access_key',
'store_id',
'created_by',
'updated_by',
'customer_name',
'total_amount',
'received_amount',
'change_amount',
'payment_method',
'payment_details',
'status',
'is_void',
'notes',
'additionaldata',
];
protected array $casts = [
'is_void' => 'boolean',
'payment_details' => 'array',
'additionaldata' => 'array',
'total_amount' => 'integer',
'received_amount' => 'integer',
'change_amount' => 'integer',
'created_by' => 'integer',
'updated_by' => 'integer',
];
public function updater()
{
return $this->belongsTo(User::class, 'updated_by');
}
/**
* Relationships
*/
public function transactions()
{
return $this->hasMany(PosTransaction::class, 'pos_session_id');
}
public function archives()
{
return $this->hasMany(PosSessionArchive::class, 'pos_session_id');
}
public function creator()
{
return $this->belongsTo(User::class, 'created_by');
}
public function store()
{
return $this->belongsTo(Store::class, 'store_id');
}
}