feat(resource): expose each offering's service section
The resource booking modal groups services under their section, the way the doctor's service booking does. The offering list had no section, so the list could only be flat. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -159,4 +159,26 @@ class ResourceServiceOfferingTest extends ResourceTestCase
|
||||
self::assertSame([], $repo->activeResourceIdsFor($service));
|
||||
self::assertSame(25, $repo->findOneFor($resource, $service)?->getDurationMinutes());
|
||||
}
|
||||
|
||||
/** مودال رزرو منبع سرویسها را زیر بخششان گروه میکند، پس فهرست باید بخش را بدهد. */
|
||||
public function testOfferingListCarriesTheServiceSection(): void
|
||||
{
|
||||
[$user, , $address] = $this->clinicWithAddress();
|
||||
$resource = $this->resource($address, $this->resourceType($address), 'لیزر الکساندرایت');
|
||||
$service = $this->service($address, 'لیزر زیربغل');
|
||||
|
||||
$this->authJson('PUT', "/api/v1/resource/{$resource->getUuid()}/services", $user, [
|
||||
'services' => [['service_uuid' => $service->getUuid()]],
|
||||
]);
|
||||
self::assertSame(200, $this->responseCode());
|
||||
|
||||
$body = $this->authJson('GET', "/api/v1/resource/{$resource->getUuid()}/services", $user);
|
||||
|
||||
self::assertSame(200, $this->responseCode());
|
||||
self::assertSame(
|
||||
$service->getSection()->getUuid(),
|
||||
$body['data'][0]['service_section']['uuid'],
|
||||
);
|
||||
self::assertSame('بخش لیزر زیربغل', $body['data'][0]['service_section']['name']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user