feat: Implement order and invoice management, enhance addon features, and remove the 'Type' module.
This commit is contained in:
@@ -20,13 +20,13 @@ class ClientResource extends JsonResource
|
||||
|
||||
return [
|
||||
'customer' => [
|
||||
'name' => $this->fullname,
|
||||
'fullname' => $this->fullname,
|
||||
'email' => $this->email,
|
||||
'phone' => $this->phone,
|
||||
'address' => $this->address,
|
||||
'city' => $this->city,
|
||||
'ward' => $this->ward->name,
|
||||
'province' => $this->province->name,
|
||||
'ward' => $this->ward->name ?? '',
|
||||
'province' => $this->province->name ?? '',
|
||||
'gender' => $this->gender_label,
|
||||
'date' => $this->created_at ? $this->created_at->format('Y-m-d H:i:s') : null,
|
||||
'company' => $this->company ?? '',
|
||||
|
||||
@@ -39,17 +39,11 @@ class ServiceListResource extends JsonResource
|
||||
return [$pricing->billing_cycle => $pricing->price_sale];
|
||||
}),
|
||||
'group' => $this->category->name,
|
||||
'os' => $this->osVersions->groupBy('os_group_id')->map(function ($versions) {
|
||||
$group = $versions->first()->osGroup;
|
||||
'os' => $this->osVersions->map(function ($os) {
|
||||
return [
|
||||
'name' => $group?->name,
|
||||
'thumbnail' => $group?->thumbnail,
|
||||
'versions' => $versions->map(fn($os) => [
|
||||
'version' => $os->version,
|
||||
'name' => $os->name,
|
||||
])->values(),
|
||||
'group' => $os->osGroup->name ?? null,
|
||||
];
|
||||
})->values(),
|
||||
})->unique('group')->values(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user