Auto-provision Meet workspaces for Care video visit scheduling.
Deploy Ladill Meet / deploy (push) Successful in 1m34s
Deploy Ladill Meet / deploy (push) Successful in 1m34s
Care appointments can create Meet rooms for accounts that have never opened Meet, matching the Sales Centre provisioning path. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -33,7 +33,7 @@ class ServiceRoomController extends Controller
|
||||
{
|
||||
$validated = $this->validateRoomPayload($request);
|
||||
|
||||
if (($validated['source']['app'] ?? '') === 'sales_centre') {
|
||||
if (in_array(($validated['source']['app'] ?? ''), ['sales_centre', 'care'], true)) {
|
||||
$this->salesCentreWorkspace->ensureHost($validated);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ class ServiceRoomController extends Controller
|
||||
return Organization::findOrFail($validated['organization_id']);
|
||||
}
|
||||
|
||||
if (($validated['source']['app'] ?? '') === 'sales_centre') {
|
||||
if (in_array(($validated['source']['app'] ?? ''), ['sales_centre', 'care'], true)) {
|
||||
$host = User::where('public_id', $validated['host_user_ref'])->firstOrFail();
|
||||
|
||||
return $this->salesCentreWorkspace->ensureOrganization($host);
|
||||
|
||||
@@ -23,7 +23,9 @@ class SalesCentreWorkspaceProvisioner
|
||||
return User::updateOrCreate(
|
||||
['public_id' => $publicId],
|
||||
[
|
||||
'name' => trim((string) ($validated['host_name'] ?? '')) ?: 'Sales representative',
|
||||
'name' => trim((string) ($validated['host_name'] ?? '')) ?: (
|
||||
($validated['source']['app'] ?? '') === 'care' ? 'Care practitioner' : 'Sales representative'
|
||||
),
|
||||
'email' => $this->resolveEmail($publicId, $validated['host_email'] ?? null),
|
||||
],
|
||||
);
|
||||
@@ -40,7 +42,7 @@ class SalesCentreWorkspaceProvisioner
|
||||
return $existing;
|
||||
}
|
||||
|
||||
$label = trim($host->name) !== '' ? $host->name.' workspace' : 'Sales workspace';
|
||||
$label = trim($host->name) !== '' ? $host->name.' workspace' : 'Ladill Meet workspace';
|
||||
|
||||
$organization = Organization::create([
|
||||
'owner_ref' => $ref,
|
||||
@@ -49,8 +51,8 @@ class SalesCentreWorkspaceProvisioner
|
||||
'timezone' => config('app.timezone', 'Africa/Accra'),
|
||||
'settings' => [
|
||||
'onboarded' => true,
|
||||
'org_type' => 'sales',
|
||||
'provisioned_by' => 'sales_centre',
|
||||
'org_type' => 'suite',
|
||||
'provisioned_by' => 'suite_service_api',
|
||||
],
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user