|
|
@@ -18,19 +18,20 @@ class FranchiseeContractResource extends JsonResource
|
|
|
public function toArray(Request $request): array
|
|
|
{
|
|
|
return [
|
|
|
- 'id' => $this->id,
|
|
|
- 'name' => $this->name,
|
|
|
- 'created_at' => Carbon::parse($this->created_at)->format('Y-m-d H:i:s'),
|
|
|
- 'updated_at' => Carbon::parse($this->updated_at)->format('Y-m-d H:i:s'),
|
|
|
- // Add your fields here
|
|
|
-
|
|
|
- // Conditional fields
|
|
|
- // $this->mergeWhen($request->user()?->isAdmin(), [
|
|
|
- // 'internal_notes' => $this->internal_notes,
|
|
|
- // ]),
|
|
|
-
|
|
|
- // Relationships
|
|
|
- // 'user' => new UserResource($this->whenLoaded('user')),
|
|
|
+ 'id' => $this->id,
|
|
|
+ 'unit_id' => $this->unit_id,
|
|
|
+ 'protocol' => $this->protocol,
|
|
|
+ 'start_date' => $this->start_date?->format('Y-m-d'),
|
|
|
+ 'end_date' => $this->end_date?->format('Y-m-d'),
|
|
|
+ 'invoice_due_date' => $this->invoice_due_date?->format('Y-m-d'),
|
|
|
+ 'tbr_fixed_value' => $this->tbr_fixed_value,
|
|
|
+ 'tbr_fixed_value_percentage' => $this->tbr_fixed_value_percentage,
|
|
|
+ 'marketing_fund_percentage' => $this->marketing_fund_percentage,
|
|
|
+ 'maintance_tax_percentage' => $this->maintance_tax_percentage,
|
|
|
+ 'inhabitant_classification_id' => $this->inhabitant_classification_id,
|
|
|
+ 'validity_months' => $this->validity_months,
|
|
|
+ 'created_at' => Carbon::parse($this->created_at)->format('Y-m-d H:i:s'),
|
|
|
+ 'updated_at' => Carbon::parse($this->updated_at)->format('Y-m-d H:i:s'),
|
|
|
];
|
|
|
}
|
|
|
|