@@ -91,7 +91,6 @@ public static function getOffices(bool $showUnpublished = false): OfficeList
9191 }
9292
9393 $ matchingScope = $ scopeMap [$ provider ->source . '_ ' . $ provider ->id ] ?? null ;
94- $ rd = MapperService::extractReservationDuration ($ matchingScope );
9594 $ offices [] = new Office (
9695 id: (int ) $ provider ->id ,
9796 name: $ provider ->displayName ?? $ provider ->name ,
@@ -122,8 +121,9 @@ public static function getOffices(bool $showUnpublished = false): OfficeList
122121 slotsPerAppointment: ((string ) $ matchingScope ->getSlotsPerAppointment () === '' ? null : (string ) $ matchingScope ->getSlotsPerAppointment ()),
123122 appointmentsPerMail: ((string ) $ matchingScope ->getAppointmentsPerMail () === '' ? null : (string ) $ matchingScope ->getAppointmentsPerMail ()),
124123 whitelistedMails: ((string ) $ matchingScope ->getWhitelistedMails () === '' ? null : (string ) $ matchingScope ->getWhitelistedMails ()),
125- reservationDuration: $ rd ,
126- activationDuration: MapperService::extractActivationDuration ($ matchingScope )
124+ activationDuration: MapperService::extractActivationDuration ($ matchingScope ),
125+ reservationDuration: (int ) MapperService::extractReservationDuration ($ matchingScope ),
126+ hint: ($ matchingScope && trim ((string ) $ matchingScope ->getScopeHint ()) !== '' ) ? (string ) $ matchingScope ->getScopeHint () : null
127127 ) : null ,
128128 maxSlotsPerAppointment: $ matchingScope ? ((string ) $ matchingScope ->getSlotsPerAppointment () === '' ? null : (string ) $ matchingScope ->getSlotsPerAppointment ()) : null
129129 );
@@ -160,7 +160,6 @@ public static function getScopes(): ThinnedScopeList|array
160160 $ key = $ provider ->source . '_ ' . $ provider ->id ;
161161 if (isset ($ scopeMap [$ key ])) {
162162 $ matchingScope = $ scopeMap [$ key ];
163- $ rd = MapperService::extractReservationDuration ($ matchingScope );
164163 $ scopesProjectionList [] = new ThinnedScope (
165164 id: (int ) $ matchingScope ->id ,
166165 provider: MapperService::providerToThinnedProvider ($ provider ),
@@ -181,8 +180,9 @@ public static function getScopes(): ThinnedScopeList|array
181180 slotsPerAppointment: ((string ) $ matchingScope ->getSlotsPerAppointment () === '' ? null : (string ) $ matchingScope ->getSlotsPerAppointment ()),
182181 appointmentsPerMail: ((string ) $ matchingScope ->getAppointmentsPerMail () === '' ? null : (string ) $ matchingScope ->getAppointmentsPerMail ()),
183182 whitelistedMails: ((string ) $ matchingScope ->getWhitelistedMails () === '' ? null : (string ) $ matchingScope ->getWhitelistedMails ()),
184- reservationDuration: $ rd ,
185- activationDuration: MapperService::extractActivationDuration ($ matchingScope )
183+ reservationDuration: (int ) MapperService::extractReservationDuration ($ matchingScope ),
184+ activationDuration: MapperService::extractActivationDuration ($ matchingScope ),
185+ hint: ($ matchingScope && trim ((string ) $ matchingScope ->getScopeHint ()) !== '' ) ? (string ) $ matchingScope ->getScopeHint () : null
186186 );
187187 }
188188 }
@@ -277,7 +277,6 @@ public static function getScopeByOfficeId(int $officeId): ThinnedScope|array
277277 $ finalProvider = $ providerKey && isset ($ providerMap [$ providerKey ])
278278 ? $ providerMap [$ providerKey ]
279279 : $ scopeProvider ;
280- $ rd = MapperService::extractReservationDuration ($ matchingScope );
281280 $ result = [
282281 'id ' => $ matchingScope ->id ,
283282 'provider ' => MapperService::providerToThinnedProvider ($ finalProvider ) ?? null ,
@@ -298,8 +297,9 @@ public static function getScopeByOfficeId(int $officeId): ThinnedScope|array
298297 'slotsPerAppointment ' => ((string ) $ matchingScope ->getSlotsPerAppointment () === '' ? null : (string ) $ matchingScope ->getSlotsPerAppointment ()) ?? null ,
299298 'appointmentsPerMail ' => ((string ) $ matchingScope ->getAppointmentsPerMail () === '' ? null : (string ) $ matchingScope ->getAppointmentsPerMail ()) ?? null ,
300299 'whitelistedMails ' => ((string ) $ matchingScope ->getWhitelistedMails () === '' ? null : (string ) $ matchingScope ->getWhitelistedMails ()) ?? null ,
301- 'reservationDuration ' => $ rd ,
302- 'activationDuration ' => MapperService::extractActivationDuration ($ matchingScope )
300+ 'reservationDuration ' => (int ) MapperService::extractReservationDuration ($ matchingScope ),
301+ 'activationDuration ' => MapperService::extractActivationDuration ($ matchingScope ),
302+ 'hint ' => (trim ((string ) ($ matchingScope ->getScopeHint () ?? '' )) === '' ) ? null : (string ) $ matchingScope ->getScopeHint (),
303303 ];
304304 return new ThinnedScope (
305305 id: (int ) $ result ['id ' ],
@@ -322,7 +322,8 @@ public static function getScopeByOfficeId(int $officeId): ThinnedScope|array
322322 appointmentsPerMail: $ result ['appointmentsPerMail ' ],
323323 whitelistedMails: $ result ['whitelistedMails ' ],
324324 reservationDuration: $ result ['reservationDuration ' ],
325- activationDuration: $ result ['activationDuration ' ]
325+ activationDuration: $ result ['activationDuration ' ],
326+ hint: $ result ['hint ' ]
326327 );
327328 }
328329
@@ -434,7 +435,6 @@ public static function getScopeById(?int $scopeId): ThinnedScope|array
434435 $ matchingProv = ($ providerKey && isset ($ providerMap [$ providerKey ]))
435436 ? $ providerMap [$ providerKey ]
436437 : $ scopeProvider ;
437- $ rd = MapperService::extractReservationDuration ($ matchingScope );
438438 return new ThinnedScope (
439439 id: (int ) $ matchingScope ->id ,
440440 provider: MapperService::providerToThinnedProvider ($ matchingProv ),
@@ -455,8 +455,9 @@ public static function getScopeById(?int $scopeId): ThinnedScope|array
455455 slotsPerAppointment: ((string ) $ matchingScope ->getSlotsPerAppointment () === '' ? null : (string ) $ matchingScope ->getSlotsPerAppointment ()) ?? null ,
456456 appointmentsPerMail: ((string ) $ matchingScope ->getAppointmentsPerMail () === '' ? null : (string ) $ matchingScope ->getAppointmentsPerMail ()) ?? null ,
457457 whitelistedMails: ((string ) $ matchingScope ->getWhitelistedMails () === '' ? null : (string ) $ matchingScope ->getWhitelistedMails ()) ?? null ,
458- reservationDuration: $ rd ,
459- activationDuration: MapperService::extractActivationDuration ($ matchingScope )
458+ reservationDuration: (int ) MapperService::extractReservationDuration ($ matchingScope ),
459+ activationDuration: MapperService::extractActivationDuration ($ matchingScope ),
460+ hint: ((string ) $ matchingScope ->getScopeHint () === '' ? null : (string ) $ matchingScope ->getScopeHint ()) ?? null
460461 );
461462 }
462463
@@ -719,7 +720,6 @@ public static function getThinnedProcessById(?int $processId, ?string $authKey):
719720 $ providerKey = $ scopeProvider ? ($ scopeProvider ->getSource () . '_ ' . $ scopeProvider ->id ) : null ;
720721 $ matchingProvider = $ providerKey && isset ($ providerMap [$ providerKey ]) ? $ providerMap [$ providerKey ] : $ scopeProvider ;
721722 $ thinnedProvider = MapperService::providerToThinnedProvider ($ matchingProvider );
722- $ rd = MapperService::extractReservationDuration ($ process ->scope );
723723 $ thinnedScope = new ThinnedScope (
724724 id: (int ) $ process ->scope ->id ,
725725 provider: $ thinnedProvider ,
@@ -740,8 +740,9 @@ public static function getThinnedProcessById(?int $processId, ?string $authKey):
740740 slotsPerAppointment: ((string ) $ process ->scope ->getSlotsPerAppointment () === '' ? null : (string ) $ process ->scope ->getSlotsPerAppointment ()) ?? null ,
741741 appointmentsPerMail: ((string ) $ process ->scope ->getAppointmentsPerMail () === '' ? null : (string ) $ process ->scope ->getAppointmentsPerMail ()) ?? null ,
742742 whitelistedMails: ((string ) $ process ->scope ->getWhitelistedMails () === '' ? null : (string ) $ process ->scope ->getWhitelistedMails ()) ?? null ,
743- reservationDuration: $ rd ,
744- activationDuration: MapperService::extractActivationDuration ($ process ->scope )
743+ reservationDuration: (int ) MapperService::extractReservationDuration ($ process ->scope ),
744+ activationDuration: MapperService::extractActivationDuration ($ process ->scope ),
745+ hint: ((string ) $ process ->scope ->getScopeHint () === '' ? null : (string ) $ process ->scope ->getScopeHint ()) ?? null
745746 );
746747 }
747748
0 commit comments