Initial commit

This commit is contained in:
2026-09-03 12:21:17 +02:00
commit 6d40da0410
155 changed files with 21554 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* Pompa - katalog (legacy site203). Tabela seg_pumps (database-first).
* Uwaga: PUP_Q_N i krzywe PEP_X_PARAM trzymane ×60; w UI dzielimy /60 (m³/min).
*/
class Pump extends Model
{
protected $connection = 'softspm';
protected $table = 'seg_pumps';
protected $primaryKey = 'PUP_ID';
public $timestamps = false;
protected $guarded = [];
public function manufacturer(): BelongsTo
{
return $this->belongsTo(Manufacturer::class, 'PUP_MCF_ID', 'MCF_ID');
}
public function curvePoints(): HasMany
{
return $this->hasMany(PumpCurvePoint::class, 'PEP_PUP_ID', 'PUP_ID');
}
/** Tylko widoczne (PUP_STATUS='1', nieusunięte logicznie). */
public function scopeVisible(Builder $q): Builder
{
return $q->where('PUP_STATUS', '1');
}
}