feat: implement team standby status, helper persistence, and store portal foundations

This commit is contained in:
Developer
2026-07-02 12:02:13 +08:00
parent a9a1df93bd
commit a1470eb85e
32 changed files with 1371 additions and 82 deletions

View File

@@ -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;
});