feat: initialize agentic development kit with workflow, skill, and agent definitions and add foundational module controllers and components
This commit is contained in:
@@ -102,7 +102,7 @@ class UserController extends Controller
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||
'user_type' => ['required', Rule::in($allowedRoles)],
|
||||
'status' => ['required', Rule::in(['active', 'inactive', 'suspended'])],
|
||||
'invite_method' => ['required', Rule::in(['direct', 'email'])],
|
||||
'invite_method' => ['nullable', Rule::in(['direct', 'email'])],
|
||||
'auto_password' => ['nullable', 'boolean'],
|
||||
'password' => ['nullable', 'string', 'min:8', 'confirmed', 'required_if:auto_password,false'],
|
||||
// Platform admin only: pick the contractor for this user
|
||||
@@ -121,6 +121,8 @@ class UserController extends Controller
|
||||
'spatie_role' => ['nullable', 'string', Rule::in(['Super Admin', 'admin', 'Main Contractor Admin', 'Project Manager', 'Site Technical', 'Construction Supervisor'])],
|
||||
]);
|
||||
|
||||
$inviteMethod = $validated['invite_method'] ?? 'direct';
|
||||
|
||||
// Resolve contractor_id: contractor admins always use their own;
|
||||
// platform admins use the one selected in the form (null = platform user)
|
||||
$contractorId = $isSuperAdmin
|
||||
@@ -157,11 +159,11 @@ class UserController extends Controller
|
||||
$this->createProfile($user, $validated);
|
||||
|
||||
// Deliver credentials
|
||||
if ($validated['invite_method'] === 'email') {
|
||||
if ($inviteMethod === 'email') {
|
||||
$this->deliverByEmail($user, $plainPassword);
|
||||
}
|
||||
|
||||
$flashMessage = $validated['invite_method'] === 'direct'
|
||||
$flashMessage = $inviteMethod === 'direct'
|
||||
? "User created. Temporary password: {$plainPassword}"
|
||||
: "User invited. Credentials sent to {$user->email}.";
|
||||
|
||||
@@ -340,7 +342,7 @@ class UserController extends Controller
|
||||
|
||||
$request->validate([
|
||||
'file' => ['required', 'file', 'mimes:csv,txt', 'max:2048'],
|
||||
'invite_method' => ['required', Rule::in(['direct', 'email'])],
|
||||
'invite_method' => ['nullable', Rule::in(['direct', 'email'])],
|
||||
'contractor_id' => $isPlatformAdmin ? ['nullable', 'exists:contractors,id'] : ['prohibited'],
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user