first commit

This commit is contained in:
2025-03-27 14:47:40 -06:00
commit ca72d4492a
19 changed files with 765 additions and 0 deletions

47
Models/PriceList.php Normal file
View File

@ -0,0 +1,47 @@
<?php
namespace koneko\VuexyPos\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Koneko\VuexyStoreManager\Models\Currency;
class PriceList extends Model
{
use HasFactory;
protected $table = 'price_lists';
protected $primaryKey = 'id';
public $incrementing = false;
protected $keyType = 'smallint';
protected $fillable = [
'title',
'type',
'c_currency',
'status',
];
protected $casts = [
'type' => 'integer',
'status' => 'boolean',
];
/**
* Relación con los precios de productos.
*/
public function productPrices(): HasMany
{
return $this->hasMany(ProductPrice::class, 'pricelist_id');
}
/**
* Relación con la moneda de la lista de precios.
*/
public function currency(): BelongsTo
{
return $this->belongsTo(Currency::class, 'c_currency', 'c_currency');
}
}