Wire Frontdesk demo seeder to shared DemoWorld
Deploy Ladill Frontdesk / deploy (push) Successful in 1m10s
Deploy Ladill Frontdesk / deploy (push) Successful in 1m10s
Org name, branches, and visitors now come from DemoWorld so continuity matches Care/Queue across the suite, plus Members for DemoWorld staff with a frontdesk role. Also resolve organization by owner_ref when metadata.frontdesk.organization_id is missing, and skip reseed-on-login for DemoWorld staff emails. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Services\Frontdesk;
|
||||
|
||||
use App\Models\Member;
|
||||
use App\Models\Organization;
|
||||
use App\Models\User;
|
||||
use App\Services\Identity\IdentityTeamClient;
|
||||
|
||||
@@ -35,7 +36,11 @@ class TeamMemberProvisioner
|
||||
}
|
||||
|
||||
$meta = (array) data_get($grant, 'metadata.frontdesk', []);
|
||||
$ownerRef = (string) ($grant['account'] ?? '');
|
||||
$organizationId = (int) ($meta['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) ($meta['role'] ?? 'member'),
|
||||
'branch_id' => $meta['branch_id'] ?? null,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user