From 9dcbeeccc7137457cbc3b34e4d1b8b9df541637c Mon Sep 17 00:00:00 2001 From: znetsixe Date: Wed, 1 Apr 2026 14:38:51 +0200 Subject: [PATCH] Fix Dutch model table names and seeder status values - Add explicit $table property to all Eloquent models with Dutch names - Fix pivot table names in belongsToMany relationships - Fix seeder: use valid enum values for afhankelijkheden status Co-Authored-By: Claude Opus 4.6 (1M context) --- .env.example | 6 +++--- .../app/__pycache__/__init__.cpython-312.pyc | Bin 0 -> 117 bytes ai-service/app/__pycache__/main.cpython-312.pyc | Bin 0 -> 4873 bytes app/Models/Actie.php | 2 ++ app/Models/Afhankelijkheid.php | 2 ++ app/Models/AuditLog.php | 2 ++ app/Models/Budget.php | 2 ++ app/Models/Commitment.php | 2 ++ app/Models/Document.php | 4 +++- app/Models/Fase.php | 1 + app/Models/Project.php | 4 +++- app/Models/Risico.php | 2 ++ app/Models/RoadmapItem.php | 2 ++ app/Models/Role.php | 4 +++- app/Models/Speerpunt.php | 2 ++ app/Models/Tag.php | 4 +++- app/Models/Thema.php | 2 ++ app/Models/User.php | 6 ++++-- database/seeders/DatabaseSeeder.php | 8 ++++---- 19 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 ai-service/app/__pycache__/__init__.cpython-312.pyc create mode 100644 ai-service/app/__pycache__/main.cpython-312.pyc diff --git a/.env.example b/.env.example index 48f9ac8..76f5302 100644 --- a/.env.example +++ b/.env.example @@ -27,7 +27,7 @@ DB_DATABASE=innovatieplatform DB_USERNAME=innovatie DB_PASSWORD=secret -SESSION_DRIVER=database +SESSION_DRIVER=redis SESSION_LIFETIME=120 SESSION_ENCRYPT=false SESSION_PATH=/ @@ -35,9 +35,9 @@ SESSION_DOMAIN=null BROADCAST_CONNECTION=log FILESYSTEM_DISK=local -QUEUE_CONNECTION=database +QUEUE_CONNECTION=redis -CACHE_STORE=database +CACHE_STORE=redis # CACHE_PREFIX= MEMCACHED_HOST=127.0.0.1 diff --git a/ai-service/app/__pycache__/__init__.cpython-312.pyc b/ai-service/app/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c2972197b40e296ff65bce4d81d6d87979b1186b GIT binary patch literal 117 zcmX@j%ge<81iW9*WP<3&AOanHW&w&!XQ*V*Wb|9fP{ah}eFmxdC8D2LPyoj9@tJv< nCGqik1(mlrY;yBcN^?@}idcb)7=gGL#Q4a}$jDg43}gWS2E!LS literal 0 HcmV?d00001 diff --git a/ai-service/app/__pycache__/main.cpython-312.pyc b/ai-service/app/__pycache__/main.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ba653918764365fb88a6f2b199ed38fbc4e5e23 GIT binary patch literal 4873 zcmbtX>u(g-6~FV^x7YR>u(2^7UbYuwLlYtl0fKROn};xI+O4A1WaoN!V0LG7XVzp_ zRB?bR=1b#9mEx+6M5Rg%f~x)4|DpY`7M55|h5Gu^eA^UPYWk_?+?ic38>fMGq`7nF zch9-^p2t1s+~0R}LwW7Zjh-IYV-I0Z_+%BmQ}4sCcMAL~@4ciMvGap@HU#Fe9Lw0Nvbz z#yPqL(B2lblcRlrZf!xkINA^BKnvQ<(QSYZwx9`)ZU=Oz1?>T;lin^{TU~u9c>ns2 zyX2uil-dl`5eK+lx6ZJiJW!?u3b6xeufqu!zv^NH$Hv&>g+{B*G+m; zV-%3^NzJAgEuEV16S~X^HSG-sb`m-2ay85Q8Q3aVDnfikZZ93ulAjb(Bw%%(ays(x*WiHdSy;yV)u zl9H=9hGSAUs#80|48AQlI8T`klU5Qr$0;7!zu(lDHc!oQtyrwYe5{Z)3h!6C8WdJW zGjo>hRC?NxBa;W*&Y7vJQ{O!`lb*VACH>abnQN}FHz~UvnrT`$(-t#eGTZI;elv{f z6y(rMyFrnsPR`Pszd5Suu*FQP!}zC-JUapCr-YJ}pp%sN7NHWHG~p6~FZ7Aq$sZYZ5DXnC4WyODG{Z|Nly`>}NTy^?17Ba-bfw=ZXn;IPfulTDcT0eJ>}^6#$wU<3Zq!u+Sqti?pq$cfAFUhtM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5upuhRjHVrhhiP> zK{Wp^)$ttJ|NUq;8OB;zzV&Fs@jC(=;aLUxJVjuJNecW}+UWlNfed(;GjcvLC0G|?sKassp$tzFE z_NQdvk0kt;Ku0YyTI(`uv7WV{926I%dYlOI6OvdViJF}Fb7)&Fw51m6uZ0F{q3%WT z?UyK&@xX(jMN_dx_AqMq+}vwo?)&mXd1(K5H>i*t2wa zjlgFuA_@DJ%82jd_;R?3Z(llx`1ZA!EbK&j_^ic6p>yf`NYe?6iONU4ANDS8eJu2R zDT=~t&mVP`%$Ltw#E*V@Hwr r7>-;Ns)OT5eUVci_pm1Q;`rxrq&-v@!$M#gDB*+CPJW31uSxy`fG}&0 literal 0 HcmV?d00001 diff --git a/app/Models/Actie.php b/app/Models/Actie.php index 93470fe..904692e 100644 --- a/app/Models/Actie.php +++ b/app/Models/Actie.php @@ -9,6 +9,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; class Actie extends Model { + protected $table = 'acties'; + protected $fillable = [ 'commitment_id', 'beschrijving', diff --git a/app/Models/Afhankelijkheid.php b/app/Models/Afhankelijkheid.php index 7c3cb52..e9b3e9c 100644 --- a/app/Models/Afhankelijkheid.php +++ b/app/Models/Afhankelijkheid.php @@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; class Afhankelijkheid extends Model { + protected $table = 'afhankelijkheden'; + protected $fillable = [ 'project_id', 'afhankelijk_van_project_id', diff --git a/app/Models/AuditLog.php b/app/Models/AuditLog.php index 761ce8c..61174b1 100644 --- a/app/Models/AuditLog.php +++ b/app/Models/AuditLog.php @@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; class AuditLog extends Model { + protected $table = 'audit_logs'; + // Append-only: no updated_at const UPDATED_AT = null; diff --git a/app/Models/Budget.php b/app/Models/Budget.php index 37aeb85..0e4dc81 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -9,6 +9,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany; class Budget extends Model { + protected $table = 'budgets'; + protected $fillable = [ 'project_id', 'bedrag', diff --git a/app/Models/Commitment.php b/app/Models/Commitment.php index 5bbab6f..e93ec9e 100644 --- a/app/Models/Commitment.php +++ b/app/Models/Commitment.php @@ -9,6 +9,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany; class Commitment extends Model { + protected $table = 'commitments'; + protected $fillable = [ 'project_id', 'besluit_id', diff --git a/app/Models/Document.php b/app/Models/Document.php index b449e13..eb3f40e 100644 --- a/app/Models/Document.php +++ b/app/Models/Document.php @@ -11,6 +11,8 @@ class Document extends Model { use SoftDeletes; + protected $table = 'documents'; + protected $fillable = [ 'project_id', 'fase_id', @@ -46,6 +48,6 @@ class Document extends Model public function tags(): BelongsToMany { - return $this->belongsToMany(Tag::class); + return $this->belongsToMany(Tag::class, 'document_tag'); } } diff --git a/app/Models/Fase.php b/app/Models/Fase.php index dd1fe09..6aba929 100644 --- a/app/Models/Fase.php +++ b/app/Models/Fase.php @@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; class Fase extends Model { + protected $table = 'fases'; protected $fillable = [ 'project_id', 'type', diff --git a/app/Models/Project.php b/app/Models/Project.php index be7edc1..8ea8c07 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -15,6 +15,8 @@ class Project extends Model { use SoftDeletes; + protected $table = 'projects'; + protected $fillable = [ 'speerpunt_id', 'naam', @@ -48,7 +50,7 @@ class Project extends Model public function teamleden(): BelongsToMany { - return $this->belongsToMany(User::class) + return $this->belongsToMany(User::class, 'project_user') ->withPivot('rol') ->withTimestamps() ->using(ProjectUser::class); diff --git a/app/Models/Risico.php b/app/Models/Risico.php index a722671..121f51f 100644 --- a/app/Models/Risico.php +++ b/app/Models/Risico.php @@ -8,6 +8,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; class Risico extends Model { + protected $table = 'risicos'; + protected $fillable = [ 'project_id', 'beschrijving', diff --git a/app/Models/RoadmapItem.php b/app/Models/RoadmapItem.php index 91195dc..43449dd 100644 --- a/app/Models/RoadmapItem.php +++ b/app/Models/RoadmapItem.php @@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; class RoadmapItem extends Model { + protected $table = 'roadmap_items'; + protected $fillable = [ 'thema_id', 'titel', diff --git a/app/Models/Role.php b/app/Models/Role.php index b64f45d..7929837 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany; class Role extends Model { + protected $table = 'roles'; + protected $fillable = [ 'naam', 'beschrijving', @@ -22,6 +24,6 @@ class Role extends Model public function users(): BelongsToMany { - return $this->belongsToMany(User::class); + return $this->belongsToMany(User::class, 'role_user'); } } diff --git a/app/Models/Speerpunt.php b/app/Models/Speerpunt.php index 910c758..cd33239 100644 --- a/app/Models/Speerpunt.php +++ b/app/Models/Speerpunt.php @@ -12,6 +12,8 @@ class Speerpunt extends Model { use SoftDeletes; + protected $table = 'speerpunten'; + protected $fillable = [ 'thema_id', 'naam', diff --git a/app/Models/Tag.php b/app/Models/Tag.php index 2858484..e6c0b40 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany; class Tag extends Model { + protected $table = 'tags'; + protected $fillable = [ 'naam', 'categorie', @@ -14,7 +16,7 @@ class Tag extends Model public function documents(): BelongsToMany { - return $this->belongsToMany(Document::class); + return $this->belongsToMany(Document::class, 'document_tag'); } public function kennisArtikelen(): BelongsToMany diff --git a/app/Models/Thema.php b/app/Models/Thema.php index e6fb499..360ac34 100644 --- a/app/Models/Thema.php +++ b/app/Models/Thema.php @@ -11,6 +11,8 @@ class Thema extends Model { use SoftDeletes; + protected $table = 'themas'; + protected $fillable = [ 'naam', 'beschrijving', diff --git a/app/Models/User.php b/app/Models/User.php index 5501fe8..c7ecefc 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -16,6 +16,8 @@ class User extends Authenticatable /** @use HasFactory */ use HasApiTokens, HasFactory, Notifiable; + protected $table = 'users'; + protected $fillable = [ 'name', 'email', @@ -41,12 +43,12 @@ class User extends Authenticatable public function roles(): BelongsToMany { - return $this->belongsToMany(Role::class); + return $this->belongsToMany(Role::class, 'role_user'); } public function projects(): BelongsToMany { - return $this->belongsToMany(Project::class) + return $this->belongsToMany(Project::class, 'project_user') ->withPivot('rol') ->withTimestamps() ->using(ProjectUser::class); diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index c2c23e7..61627d7 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -491,7 +491,7 @@ class DatabaseSeeder extends Seeder 'afhankelijk_van_project_id' => $p1->id, 'type' => 'data', 'beschrijving' => 'Het AI-model heeft real-time sensordata nodig uit het LoRaWAN netwerk als input feature.', - 'status' => 'actief', + 'status' => 'open', ]); // Digitale Tweeling is afhankelijk van AI Waterstandsmodel @@ -500,7 +500,7 @@ class DatabaseSeeder extends Seeder 'afhankelijk_van_project_id' => $p8->id, 'type' => 'technisch', 'beschrijving' => 'De digitale tweeling integreert de voorspellingsmodule van het AI waterstandsmodel.', - 'status' => 'actief', + 'status' => 'open', ]); // Predictieve Gemaalbesturing is afhankelijk van AI Waterstandsmodel @@ -509,7 +509,7 @@ class DatabaseSeeder extends Seeder 'afhankelijk_van_project_id' => $p8->id, 'type' => 'technisch', 'beschrijving' => 'De predictieve besturing gebruikt de 48-uurs waterstandsvoorspellingen als stuurinput.', - 'status' => 'actief', + 'status' => 'open', ]); // Remote Monitoring Waterkeringen is afhankelijk van LoRaWAN Sensornetwerk @@ -518,7 +518,7 @@ class DatabaseSeeder extends Seeder 'afhankelijk_van_project_id' => $p1->id, 'type' => 'infrastructuur', 'beschrijving' => 'Het monitoring-project maakt gebruik van de LoRaWAN-infrastructuur voor datatransport.', - 'status' => 'gepland', + 'status' => 'open', ]); }