feat: history and calculate needs for user
CI / 🧪 Tests Laravel (push) Failing after 2m18s
CI / 🐳 Build & Push Images (push) Has been skipped

This commit is contained in:
2026-08-14 12:45:37 +02:00
parent ea5a5737ec
commit 69372a49ed
51 changed files with 2226 additions and 305 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUlids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class WeightEntry extends Model
{
/** @use HasFactory<\Database\Factories\WeightEntryFactory> */
use HasFactory, HasUlids;
protected $fillable = [
'user_id',
'weight_kg',
'source',
'measured_at',
];
protected $attributes = [
'source' => 'manual',
];
protected function casts(): array
{
return [
'weight_kg' => 'float',
'measured_at' => 'immutable_datetime',
];
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}