diff --git a/zmscitizenapi/src/Zmscitizenapi/Models/Office.php b/zmscitizenapi/src/Zmscitizenapi/Models/Office.php index 14573430c..ed4715801 100644 --- a/zmscitizenapi/src/Zmscitizenapi/Models/Office.php +++ b/zmscitizenapi/src/Zmscitizenapi/Models/Office.php @@ -30,6 +30,9 @@ class Office extends Entity implements JsonSerializable /** @var string|null */ public ?string $organizationUnit = null; + /** @var int|null */ + public ?int $slotTimeInMinutes = null; + /** @var array|null */ public ?array $geo = null; @@ -43,6 +46,7 @@ public function __construct( ?array $displayNameAlternatives = null, ?string $organization = null, ?string $organizationUnit = null, + ?int $slotTimeInMinutes = null, ?array $geo = null, ?ThinnedScope $scope = null ) { @@ -52,6 +56,7 @@ public function __construct( $this->displayNameAlternatives = $displayNameAlternatives; $this->organization = $organization; $this->organizationUnit = $organizationUnit; + $this->slotTimeInMinutes = $slotTimeInMinutes; $this->geo = $geo; $this->scope = $scope; @@ -79,6 +84,7 @@ public function toArray(): array 'displayNameAlternatives' => $this->displayNameAlternatives, 'organization' => $this->organization, 'organizationUnit' => $this->organizationUnit, + 'slotTimeInMinutes' => $this->slotTimeInMinutes, 'geo' => $this->geo, 'scope' => $this->scope?->toArray(), ]; diff --git a/zmscitizenapi/src/Zmscitizenapi/Services/Core/MapperService.php b/zmscitizenapi/src/Zmscitizenapi/Services/Core/MapperService.php index 4f778a5fe..4518c3ec1 100644 --- a/zmscitizenapi/src/Zmscitizenapi/Services/Core/MapperService.php +++ b/zmscitizenapi/src/Zmscitizenapi/Services/Core/MapperService.php @@ -66,6 +66,7 @@ public static function mapOfficesWithScope(ProviderList $providerList): OfficeLi displayNameAlternatives: $provider->data['displayNameAlternatives'] ?? [], organization: $provider->data['organization'] ?? null, organizationUnit: $provider->data['organizationUnit'] ?? null, + slotTimeInMinutes: $provider->data['slotTimeInMinutes'] ?? null, geo: isset($provider->data['geo']) ? $provider->data['geo'] : null, scope: isset($providerScope) && !isset($providerScope['errors']) ? new ThinnedScope( id: isset($providerScope->id) ? (int) $providerScope->id : 0, diff --git a/zmscitizenapi/src/Zmscitizenapi/Services/Core/ZmsApiFacadeService.php b/zmscitizenapi/src/Zmscitizenapi/Services/Core/ZmsApiFacadeService.php index ae0580a0f..f2dbb601f 100644 --- a/zmscitizenapi/src/Zmscitizenapi/Services/Core/ZmsApiFacadeService.php +++ b/zmscitizenapi/src/Zmscitizenapi/Services/Core/ZmsApiFacadeService.php @@ -64,6 +64,7 @@ public static function getOffices(): OfficeList displayNameAlternatives: $provider->data['displayNameAlternatives'] ?? [], organization: $provider->data['organization'] ?? null, organizationUnit: $provider->data['organizationUnit'] ?? null, + slotTimeInMinutes: $provider->data['slotTimeInMinutes'] ?? null, geo: $provider->data['geo'] ?? null, scope: $matchingScope ? new ThinnedScope( id: (int) $matchingScope->id, @@ -373,6 +374,7 @@ public static function getOfficesThatProvideService(int $serviceId): OfficeList| displayNameAlternatives: $provider->data['displayNameAlternatives'] ?? [], organization: $provider->data['organization'] ?? null, organizationUnit: $provider->data['organizationUnit'] ?? null, + slotTimeInMinutes: $provider->data['slotTimeInMinutes'] ?? null, geo: $provider->data['geo'] ?? null, scope: $scope instanceof ThinnedScope ? $scope : null ); diff --git a/zmscitizenapi/tests/Zmscitizenapi/Controllers/Office/OfficeListByServiceControllerTest.php b/zmscitizenapi/tests/Zmscitizenapi/Controllers/Office/OfficeListByServiceControllerTest.php index b3df84527..79ea8a267 100644 --- a/zmscitizenapi/tests/Zmscitizenapi/Controllers/Office/OfficeListByServiceControllerTest.php +++ b/zmscitizenapi/tests/Zmscitizenapi/Controllers/Office/OfficeListByServiceControllerTest.php @@ -45,6 +45,7 @@ public function testRendering() "displayNameAlternatives" => null, "organization" => null, "organizationUnit" => null, + "slotTimeInMinutes" => null, "geo" => null, "scope" => [ "id" => 2, @@ -104,6 +105,7 @@ public function testRenderingRequestRelation() "displayNameAlternatives" => null, "organization" => null, "organizationUnit" => null, + "slotTimeInMinutes" => null, "geo" => null, "scope" => [ "id" => 1, @@ -140,6 +142,7 @@ public function testRenderingRequestRelation() "displayNameAlternatives" => null, "organization" => null, "organizationUnit" => null, + "slotTimeInMinutes" => null, "geo" => null, "scope" => [ "id" => 2, diff --git a/zmscitizenapi/tests/Zmscitizenapi/Controllers/Office/OfficesListControllerTest.php b/zmscitizenapi/tests/Zmscitizenapi/Controllers/Office/OfficesListControllerTest.php index b1bac9a59..6194c2988 100644 --- a/zmscitizenapi/tests/Zmscitizenapi/Controllers/Office/OfficesListControllerTest.php +++ b/zmscitizenapi/tests/Zmscitizenapi/Controllers/Office/OfficesListControllerTest.php @@ -44,6 +44,7 @@ public function testRendering() "displayNameAlternatives" => [], "organization" => null, "organizationUnit" => null, + "slotTimeInMinutes" => null, "geo" => [ "lat" => "48.12750898398659", "lon" => "11.604317899956524" @@ -83,6 +84,7 @@ public function testRendering() "displayNameAlternatives" => [], "organization" => null, "organizationUnit" => null, + "slotTimeInMinutes" => null, "geo" => [ "lat" => "48.12750898398659", "lon" => "11.604317899956524" diff --git a/zmscitizenapi/tests/Zmscitizenapi/Controllers/Office/OfficesServicesRelationsControllerTest.php b/zmscitizenapi/tests/Zmscitizenapi/Controllers/Office/OfficesServicesRelationsControllerTest.php index e7afb6eac..dd25cf430 100644 --- a/zmscitizenapi/tests/Zmscitizenapi/Controllers/Office/OfficesServicesRelationsControllerTest.php +++ b/zmscitizenapi/tests/Zmscitizenapi/Controllers/Office/OfficesServicesRelationsControllerTest.php @@ -44,6 +44,7 @@ public function testRendering() "displayNameAlternatives" => [], "organization" => null, "organizationUnit" => null, + "slotTimeInMinutes" => null, "geo" => [ "lat" => "48.12750898398659", "lon" => "11.604317899956524" @@ -83,6 +84,7 @@ public function testRendering() "displayNameAlternatives" => [], "organization" => null, "organizationUnit" => null, + "slotTimeInMinutes" => null, "geo" => [ "lat" => "48.12750898398659", "lon" => "11.604317899956524" diff --git a/zmsentities/schema/citizenapi/collections/officeList.json b/zmsentities/schema/citizenapi/collections/officeList.json index ba494d057..b8a341588 100644 --- a/zmsentities/schema/citizenapi/collections/officeList.json +++ b/zmsentities/schema/citizenapi/collections/officeList.json @@ -70,6 +70,10 @@ "type": ["string", "null"], "description": "The name of the organization" }, + "slotTimeInMinutes": { + "type": ["integer", "null"], + "description": "Slot time in minutes" + }, "geo": { "type": [ "array", diff --git a/zmsentities/schema/citizenapi/collections/officeServiceAndRelationList.json b/zmsentities/schema/citizenapi/collections/officeServiceAndRelationList.json index bb99cf1bf..67b51dff6 100644 --- a/zmsentities/schema/citizenapi/collections/officeServiceAndRelationList.json +++ b/zmsentities/schema/citizenapi/collections/officeServiceAndRelationList.json @@ -75,6 +75,10 @@ "type": ["string", "null"], "description": "The name of the organization" }, + "slotTimeInMinutes": { + "type": ["integer", "null"], + "description": "Slot time in minutes" + }, "geo": { "type": [ "array", diff --git a/zmsentities/schema/citizenapi/office.json b/zmsentities/schema/citizenapi/office.json index 0f45cf093..b53b68462 100644 --- a/zmsentities/schema/citizenapi/office.json +++ b/zmsentities/schema/citizenapi/office.json @@ -51,6 +51,10 @@ "type": ["string", "null"], "description": "The name of the organization" }, + "slotTimeInMinutes": { + "type": ["integer", "null"], + "description": "Slot time in minutes" + }, "geo": { "type": ["array", "object", "null"], "description": "Geographical coordinates of the office",