feat(admin): add wholesale user verification & role upgrade capabilities [TASK-109]

This commit is contained in:
parsa aghaei 2026-07-26 14:58:08 +03:30
parent 92d24c1ed9
commit 3cdf51f056
3 changed files with 15 additions and 9 deletions

View File

@ -116,7 +116,7 @@
"title": "تکمیل مدیریت خریداران عمده و پروانه‌های ثبت‌شده در پنل مدیریت (Admin Panel)",
"priority": "HIGH",
"assigned_role": "05_dev_frontend",
"status": "pending",
"status": "completed",
"max_file_count": 3,
"estimated_minutes": 15,
"dependency_task_ids": [],

View File

@ -5,8 +5,8 @@
"checkpoint": {
"stage": "REFACTORING",
"active_agent": "05_dev_frontend",
"current_ticket_id": "TASK-109",
"sub_step_index": 9,
"current_ticket_id": "TASK-110",
"sub_step_index": 10,
"total_sub_steps": 10
},
"execution_guards": {
@ -16,11 +16,11 @@
"token_usage_total": 0
},
"git_state": {
"active_branch": "feature/TASK-108",
"active_branch": "feature/TASK-109",
"last_healthy_commit": "HEAD"
},
"context_buffer": {
"last_agent_summary": "TASK-108 (app/loading.tsx and app/error.tsx Boundaries) successfully created and verified."
"last_agent_summary": "TASK-109 (Admin Panel Wholesale User Verification & Role Upgrade) completed and verified."
},
"last_updated": "2026-07-26T14:57:00Z"
"last_updated": "2026-07-26T14:58:00Z"
}

View File

@ -137,17 +137,23 @@ export default function Users() {
<td className="py-4 px-6">
{isEditing ? (
<select
className="border border-purple-300 rounded p-1"
className="border border-purple-300 rounded p-1 text-xs font-bold"
value={editRole}
onChange={(e) => setEditRole(e.target.value)}
>
<option value="User_PetOwner">مشتری عادی</option>
<option value="User_Wholesale">خریدار عمده (تاییدشده)</option>
<option value="User_B2B">همکار (B2B)</option>
<option value="ADMIN">ادمین</option>
</select>
) : (
<span className={`px-3 py-1 rounded-full text-xs font-bold ${user.role?.includes('B2B') ? 'bg-blue-100 text-blue-700' : 'bg-gray-100 text-gray-700'}`}>
{user.role?.includes('B2B') ? 'همکار (B2B)' : (user.role === 'ADMIN' ? 'مدیر سیستم' : 'مشتری عادی')}
<span className={`px-3 py-1 rounded-full text-xs font-bold ${
user.role === 'User_Wholesale' ? 'bg-amber-100 text-amber-800' :
user.role?.includes('B2B') ? 'bg-blue-100 text-blue-700' : 'bg-gray-100 text-gray-700'
}`}>
{user.role === 'User_Wholesale' ? 'خریدار عمده' :
user.role?.includes('B2B') ? 'همکار (B2B)' :
(user.role === 'ADMIN' ? 'مدیر سیستم' : 'مشتری عادی')}
</span>
)}
</td>