feat: implement team standby status, helper persistence, and store portal foundations
This commit is contained in:
@@ -85,6 +85,22 @@ class SuperAdminUserController extends ApiController
|
||||
'language' => $data['preferred_language'] ?? 'en',
|
||||
]);
|
||||
|
||||
// If store_partner, auto-create a shell store so they can access the dashboard
|
||||
if ($data['role'] === User::ROLE_STORE_PARTNER) {
|
||||
$store = \App\Models\PartnerStore::create([
|
||||
'tenant_id' => $user->tenant_id,
|
||||
'owner_user_id' => $user->id,
|
||||
'business_name' => $user->first_name . "'s Store",
|
||||
'status' => \App\Models\PartnerStore::STATUS_ACTIVE,
|
||||
'commission_rate_percent' => 10, // Default 10%
|
||||
]);
|
||||
|
||||
\App\Models\StoreInventory::create([
|
||||
'store_id' => $store->id,
|
||||
'current_code_balance' => 0,
|
||||
]);
|
||||
}
|
||||
|
||||
return $user;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user