Scaffold full project: Vue 3/Inertia frontend, Docker infra, domain model
- Frontend: Vue 3 + Inertia.js + Pinia + Tailwind CSS with layout and dashboard page - Infrastructure: Docker Compose with nginx, PHP-FPM, PostgreSQL+pgvector, Redis, Python AI service - Database: 22 migrations covering all domain entities (projects, phases, commitments, decisions, documents, handover, audit) - Models: 23 Eloquent models with relationships, casts, and 14 string-backed enums - AI service: FastAPI scaffold with health, chat, summarize, and search endpoints Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
106
app/Models/Project.php
Normal file
106
app/Models/Project.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\Prioriteit;
|
||||
use App\Enums\ProjectRol;
|
||||
use App\Enums\ProjectStatus;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Project extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'speerpunt_id',
|
||||
'naam',
|
||||
'beschrijving',
|
||||
'eigenaar_id',
|
||||
'status',
|
||||
'prioriteit',
|
||||
'startdatum',
|
||||
'streef_einddatum',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'status' => ProjectStatus::class,
|
||||
'prioriteit' => Prioriteit::class,
|
||||
'startdatum' => 'date',
|
||||
'streef_einddatum' => 'date',
|
||||
];
|
||||
}
|
||||
|
||||
public function speerpunt(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Speerpunt::class);
|
||||
}
|
||||
|
||||
public function eigenaar(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'eigenaar_id');
|
||||
}
|
||||
|
||||
public function teamleden(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class)
|
||||
->withPivot('rol')
|
||||
->withTimestamps()
|
||||
->using(ProjectUser::class);
|
||||
}
|
||||
|
||||
public function fases(): HasMany
|
||||
{
|
||||
return $this->hasMany(Fase::class);
|
||||
}
|
||||
|
||||
public function risicos(): HasMany
|
||||
{
|
||||
return $this->hasMany(Risico::class);
|
||||
}
|
||||
|
||||
public function afhankelijkheden(): HasMany
|
||||
{
|
||||
return $this->hasMany(Afhankelijkheid::class);
|
||||
}
|
||||
|
||||
public function afhankelijkVanMij(): HasMany
|
||||
{
|
||||
return $this->hasMany(Afhankelijkheid::class, 'afhankelijk_van_project_id');
|
||||
}
|
||||
|
||||
public function besluiten(): HasMany
|
||||
{
|
||||
return $this->hasMany(Besluit::class);
|
||||
}
|
||||
|
||||
public function commitments(): HasMany
|
||||
{
|
||||
return $this->hasMany(Commitment::class);
|
||||
}
|
||||
|
||||
public function budgets(): HasMany
|
||||
{
|
||||
return $this->hasMany(Budget::class);
|
||||
}
|
||||
|
||||
public function documents(): HasMany
|
||||
{
|
||||
return $this->hasMany(Document::class);
|
||||
}
|
||||
|
||||
public function lessonsLearned(): HasMany
|
||||
{
|
||||
return $this->hasMany(LessonLearned::class);
|
||||
}
|
||||
|
||||
public function overdrachtsplannen(): HasMany
|
||||
{
|
||||
return $this->hasMany(Overdrachtsplan::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user