Ver Fonte

feat: corrige acronimo, adiciona taxas

ebagabee há 1 mês atrás
pai
commit
e9154c34e5

+ 5 - 0
app/Models/FranchiseeContract.php

@@ -80,4 +80,9 @@ public function unit(): BelongsTo
     {
         return $this->belongsTo(Unit::class, 'unit_id');
     }
+
+    public function inhabitantClassification(): BelongsTo
+    {
+        return $this->belongsTo(InhabitantClassification::class, 'inhabitant_classification_id');
+    }
 }

+ 2 - 1
app/Services/FranchiseeContractService.php

@@ -34,7 +34,8 @@ public function findById(int $id): ?FranchiseeContract
 
     public function getByUnitId(int $unitId): Collection
     {
-        return FranchiseeContract::where('unit_id', $unitId)
+        return FranchiseeContract::with('inhabitantClassification')
+            ->where('unit_id', $unitId)
             ->orderBy('created_at', 'desc')
             ->get();
     }