Add practitioners admin and staff-scoped Care UX.
Deploy Ladill Care / deploy (push) Successful in 43s
Deploy Ladill Care / deploy (push) Successful in 43s
Hospital admins can manage assignable doctors and invite team members from Ladill mailboxes; invited staff only see Care tools they need. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -32,14 +32,40 @@ class IdentityTeamClient
|
||||
return (array) $response->json('data', []);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{url: string, apps: list<string>, full_access: bool, show_hub: bool, show_billing: bool}
|
||||
*/
|
||||
public function appAccess(string $userPublicId, string $intendedUrl = ''): array
|
||||
{
|
||||
$response = $this->request('get', '/identity/team/post-auth-redirect', array_filter([
|
||||
'user' => $userPublicId,
|
||||
'redirect' => $intendedUrl !== '' ? $intendedUrl : null,
|
||||
]));
|
||||
|
||||
$data = (array) $response->json('data', []);
|
||||
|
||||
return [
|
||||
'url' => (string) ($data['url'] ?? $intendedUrl),
|
||||
'apps' => array_values(array_map('strval', (array) ($data['apps'] ?? []))),
|
||||
'full_access' => (bool) ($data['full_access'] ?? false),
|
||||
'show_hub' => (bool) ($data['show_hub'] ?? ($data['full_access'] ?? false)),
|
||||
'show_billing' => (bool) ($data['show_billing'] ?? ($data['full_access'] ?? false)),
|
||||
];
|
||||
}
|
||||
|
||||
public function postAuthRedirect(string $userPublicId, string $intendedUrl): string
|
||||
{
|
||||
$response = $this->request('get', '/identity/team/post-auth-redirect', [
|
||||
'user' => $userPublicId,
|
||||
'redirect' => $intendedUrl,
|
||||
return $this->appAccess($userPublicId, $intendedUrl)['url'];
|
||||
}
|
||||
|
||||
/** @return list<string> */
|
||||
public function mailboxOptions(string $ownerPublicId): array
|
||||
{
|
||||
$response = $this->request('get', '/identity/team/mailbox-options', [
|
||||
'owner' => $ownerPublicId,
|
||||
]);
|
||||
|
||||
return (string) $response->json('data.url', $intendedUrl);
|
||||
return array_values(array_map('strval', (array) $response->json('data', [])));
|
||||
}
|
||||
|
||||
/** @return list<array<string, mixed>> */
|
||||
|
||||
Reference in New Issue
Block a user