Seed Care demos from shared DemoWorld with staff roles.
Deploy Ladill Care / deploy (push) Successful in 1m0s

Patients, branches, and org identity now match suite continuity keys; staff Members are created for training SSO without login reseed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-17 13:27:07 +00:00
co-authored by Cursor
parent 2d548e2bbc
commit dd4efec135
6 changed files with 689 additions and 19 deletions
+6 -1
View File
@@ -3,6 +3,7 @@
namespace App\Services\Care;
use App\Models\Member;
use App\Models\Organization;
use App\Models\User;
use App\Services\Identity\IdentityTeamClient;
@@ -35,7 +36,11 @@ class TeamMemberProvisioner
}
$appMeta = (array) data_get($grant, 'metadata.care', []);
$ownerRef = (string) ($grant['account'] ?? '');
$organizationId = (int) ($appMeta['organization_id'] ?? 0);
if ($organizationId <= 0 && $ownerRef !== '') {
$organizationId = (int) Organization::query()->where('owner_ref', $ownerRef)->value('id');
}
if ($organizationId <= 0) {
continue;
}
@@ -46,7 +51,7 @@ class TeamMemberProvisioner
'user_ref' => $user->ownerRef(),
],
[
'owner_ref' => (string) ($grant['account'] ?? $user->ownerRef()),
'owner_ref' => $ownerRef !== '' ? $ownerRef : $user->ownerRef(),
'role' => (string) ($appMeta['role'] ?? 'member'),
'branch_id' => $appMeta['branch_id'] ?? null,
],