feat: use dedicated admin endpoints for profession management
- Create ProfessionAdminListPage component for admin list views - Update all 9 profession pages to use /api/admin/<profession> endpoints - Remove unused FALLBACK_* constants from onboarding-schemas - Improves performance and data accuracy for admin profession management
This commit is contained in:
parent
65156aafde
commit
2e3c2d6db8
11 changed files with 282 additions and 232 deletions
229
src/components/admin/ProfessionAdminListPage.tsx
Normal file
229
src/components/admin/ProfessionAdminListPage.tsx
Normal file
|
|
@ -0,0 +1,229 @@
|
|||
import { A } from '@solidjs/router';
|
||||
import { createMemo, createResource, createSignal, For, Show } from 'solid-js';
|
||||
|
||||
const API = '/api/gateway';
|
||||
|
||||
type SortMode = 'newest' | 'oldest' | 'name_asc' | 'name_desc';
|
||||
|
||||
async function fetchProfessionList(endpoint: string): Promise<any[]> {
|
||||
try {
|
||||
const res = await fetch(`${API}${endpoint}`);
|
||||
if (!res.ok) throw new Error(`Failed to load: ${res.status}`);
|
||||
const data = await res.json();
|
||||
return Array.isArray(data) ? data : [];
|
||||
} catch (e) {
|
||||
console.error(`Failed to fetch from ${endpoint}:`, e);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
function statusBadge(status?: string) {
|
||||
const normalized = (status || '').toUpperCase();
|
||||
if (normalized === 'ACTIVE') return 'inline-flex items-center rounded-full bg-green-100 px-2.5 py-0.5 text-xs font-medium text-green-700';
|
||||
if (normalized === 'PENDING') return 'inline-flex items-center rounded-full bg-orange-50 px-2.5 py-0.5 text-xs font-medium text-orange-700';
|
||||
return 'inline-flex items-center rounded-full bg-gray-100 px-2.5 py-0.5 text-xs font-medium text-gray-600';
|
||||
}
|
||||
|
||||
export default function ProfessionAdminListPage(props: {
|
||||
endpoint: string;
|
||||
title: string;
|
||||
subtitle: string;
|
||||
emptyLabel: string;
|
||||
viewHref: (id: string) => string;
|
||||
nameField?: string;
|
||||
}) {
|
||||
const nameField = props.nameField || 'first_name';
|
||||
const [items] = createResource(() => props.endpoint, fetchProfessionList);
|
||||
const [search, setSearch] = createSignal('');
|
||||
const [statusFilter, setStatusFilter] = createSignal<'all' | 'ACTIVE' | 'INACTIVE' | 'PENDING'>('all');
|
||||
const [sortBy, setSortBy] = createSignal<SortMode>('newest');
|
||||
const [sortMenuOpen, setSortMenuOpen] = createSignal(false);
|
||||
const [filterMenuOpen, setFilterMenuOpen] = createSignal(false);
|
||||
|
||||
const filtered = createMemo(() => {
|
||||
const list = items() ?? [];
|
||||
const q = search().toLowerCase().trim();
|
||||
const f = statusFilter();
|
||||
const sorted = list.filter((u) => {
|
||||
const firstName = String(u.first_name || '').toLowerCase();
|
||||
const lastName = String(u.last_name || '').toLowerCase();
|
||||
const fullName = `${firstName} ${lastName}`.trim();
|
||||
const email = String(u.email || '').toLowerCase();
|
||||
const st = String(u.status || '').toUpperCase();
|
||||
const matchesSearch = !q || fullName.includes(q) || email.includes(q);
|
||||
const matchesStatus = f === 'all' || st === f;
|
||||
return matchesSearch && matchesStatus;
|
||||
});
|
||||
|
||||
sorted.sort((a, b) => {
|
||||
const aDate = new Date(a.created_at || 0).getTime();
|
||||
const bDate = new Date(b.created_at || 0).getTime();
|
||||
if (sortBy() === 'oldest') return aDate - bDate;
|
||||
if (sortBy() === 'name_asc') return `${a.first_name || ''} ${a.last_name || ''}`.localeCompare(`${b.first_name || ''} ${b.last_name || ''}`);
|
||||
if (sortBy() === 'name_desc') return `${b.first_name || ''} ${b.last_name || ''}`.localeCompare(`${a.first_name || ''} ${a.last_name || ''}`);
|
||||
return bDate - aDate;
|
||||
});
|
||||
|
||||
return sorted;
|
||||
});
|
||||
|
||||
const exportCsv = () => {
|
||||
const headers = ['First Name', 'Last Name', 'Email', 'Phone', 'Status', 'Registered'];
|
||||
const rows = filtered().map((item) => [
|
||||
String(item.first_name || ''),
|
||||
String(item.last_name || ''),
|
||||
String(item.email || ''),
|
||||
String(item.phone || ''),
|
||||
String(item.status || ''),
|
||||
item.created_at ? new Date(item.created_at).toLocaleDateString() : '',
|
||||
]);
|
||||
const csv = [headers, ...rows]
|
||||
.map((line) => line.map((cell) => `"${String(cell).replace(/"/g, '""')}"`).join(','))
|
||||
.join('\n');
|
||||
|
||||
const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = `${props.title.toLowerCase().replace(/\s+/g, '-')}-export.csv`;
|
||||
link.click();
|
||||
URL.revokeObjectURL(url);
|
||||
};
|
||||
|
||||
return (
|
||||
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
|
||||
<div class="bg-white border-b border-gray-200 px-6 py-4">
|
||||
<h1 class="text-xl font-semibold text-gray-900">{props.title}</h1>
|
||||
<p class="text-sm text-gray-500 mt-0.5">{props.subtitle}</p>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 p-6">
|
||||
<div class="mb-4 flex flex-wrap items-center gap-2" style="position:relative;z-index:20;">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Search by name or email..."
|
||||
value={search()}
|
||||
onInput={(e) => setSearch(e.currentTarget.value)}
|
||||
class="rounded-lg border border-gray-200 px-3 py-2 text-sm outline-none focus:border-[#FF5E13] w-72"
|
||||
/>
|
||||
|
||||
<div style="position:relative;">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => { setSortMenuOpen((v) => !v); setFilterMenuOpen(false); }}
|
||||
style="display:inline-flex;height:34px;align-items:center;gap:6px;border-radius:8px;border:1px solid #E5E7EB;background:white;padding:0 12px;font-size:12px;font-weight:500;color:#374151;cursor:pointer"
|
||||
>
|
||||
Sort
|
||||
</button>
|
||||
<Show when={sortMenuOpen()}>
|
||||
<div style="position:absolute;right:0;top:38px;z-index:40;min-width:180px;border:1px solid #E5E7EB;border-radius:12px;background:#fff;box-shadow:0 12px 24px rgba(2,6,23,0.12);padding:8px">
|
||||
<For each={[
|
||||
{ key: 'newest', label: 'Newest First' },
|
||||
{ key: 'oldest', label: 'Oldest First' },
|
||||
{ key: 'name_asc', label: 'Name A-Z' },
|
||||
{ key: 'name_desc', label: 'Name Z-A' },
|
||||
] as { key: SortMode; label: string }[]}>
|
||||
{(item) => (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => { setSortBy(item.key); setSortMenuOpen(false); }}
|
||||
style={`display:block;width:100%;border-radius:8px;padding:8px 12px;text-align:left;font-size:13px;background:none;border:none;cursor:pointer;color:${sortBy() === item.key ? '#FF5E13' : '#374151'};background:${sortBy() === item.key ? '#FFF1EB' : 'transparent'}`}
|
||||
>
|
||||
{item.label}
|
||||
</button>
|
||||
)}
|
||||
</For>
|
||||
</div>
|
||||
</Show>
|
||||
</div>
|
||||
|
||||
<div style="position:relative;">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => { setFilterMenuOpen((v) => !v); setSortMenuOpen(false); }}
|
||||
style="display:inline-flex;height:34px;align-items:center;gap:6px;border-radius:8px;border:1px solid #E5E7EB;background:white;padding:0 12px;font-size:12px;font-weight:500;color:#374151;cursor:pointer"
|
||||
>
|
||||
Filters
|
||||
</button>
|
||||
<Show when={filterMenuOpen()}>
|
||||
<div style="position:absolute;right:0;top:38px;z-index:40;min-width:180px;border:1px solid #E5E7EB;border-radius:12px;background:#fff;box-shadow:0 12px 24px rgba(2,6,23,0.12);padding:8px">
|
||||
<For each={[
|
||||
{ key: 'all', label: 'All Status' },
|
||||
{ key: 'ACTIVE', label: 'Active' },
|
||||
{ key: 'INACTIVE', label: 'Inactive' },
|
||||
{ key: 'PENDING', label: 'Pending' },
|
||||
] as { key: 'all' | 'ACTIVE' | 'INACTIVE' | 'PENDING'; label: string }[]}>
|
||||
{(item) => (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => { setStatusFilter(item.key); setFilterMenuOpen(false); }}
|
||||
style={`display:block;width:100%;border-radius:8px;padding:8px 12px;text-align:left;font-size:13px;background:none;border:none;cursor:pointer;color:${statusFilter() === item.key ? '#FF5E13' : '#374151'};background:${statusFilter() === item.key ? '#FFF1EB' : 'transparent'}`}
|
||||
>
|
||||
{item.label}
|
||||
</button>
|
||||
)}
|
||||
</For>
|
||||
</div>
|
||||
</Show>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onClick={exportCsv}
|
||||
style="display:inline-flex;height:34px;align-items:center;gap:6px;border-radius:8px;border:1px solid #D1D5DB;background:#fff;padding:0 12px;font-size:12px;font-weight:600;color:#0f172a;cursor:pointer"
|
||||
>
|
||||
Export
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="table-card">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="data-table w-full text-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Phone</th>
|
||||
<th>Status</th>
|
||||
<th>Registered</th>
|
||||
<th class="text-right">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<Show when={items.loading}>
|
||||
<tr><td colspan="6" class="text-center py-8 text-slate-500">Loading...</td></tr>
|
||||
</Show>
|
||||
<Show when={!items.loading && items.error}>
|
||||
<tr><td colspan="6" class="text-center py-8 text-red-700">Failed to load. Is the backend running?</td></tr>
|
||||
</Show>
|
||||
<Show when={!items.loading && !items.error && filtered().length === 0}>
|
||||
<tr><td colspan="6" class="text-center py-8 text-slate-400">{props.emptyLabel}</td></tr>
|
||||
</Show>
|
||||
<Show when={!items.loading && !items.error && filtered().length > 0}>
|
||||
<For each={filtered()}>
|
||||
{(item) => (
|
||||
<tr class="hover:bg-slate-50">
|
||||
<td class="font-semibold text-slate-900">{item.first_name || ''} {item.last_name || ''}</td>
|
||||
<td class="text-slate-500">{item.email}</td>
|
||||
<td class="text-slate-500">{item.phone || '—'}</td>
|
||||
<td>
|
||||
<span class={statusBadge(item.status)}>{item.status?.toUpperCase() || '—'}</span>
|
||||
</td>
|
||||
<td class="text-slate-500">{item.created_at ? new Date(item.created_at).toLocaleDateString() : '—'}</td>
|
||||
<td>
|
||||
<div class="flex items-center justify-end gap-1">
|
||||
<A class="rounded-lg border border-gray-200 px-3 py-1.5 text-sm hover:bg-gray-50" href={props.viewHref(String(item.id))}>View</A>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
</For>
|
||||
</Show>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
import RoleUserManagementTablePage from '~/components/admin/RoleUserManagementTablePage';
|
||||
import ProfessionAdminListPage from '~/components/admin/ProfessionAdminListPage';
|
||||
|
||||
export default function CateringServicesPage() {
|
||||
export default function Page() {
|
||||
return (
|
||||
<RoleUserManagementTablePage
|
||||
role="catering_services"
|
||||
<ProfessionAdminListPage
|
||||
endpoint="/api/admin/catering-services"
|
||||
title="Catering Services Management"
|
||||
subtitle="Manage all catering service accounts on the platform."
|
||||
emptyLabel="No catering services users found."
|
||||
viewHref={(id) => `/admin/users/${id}`}
|
||||
emptyLabel="No catering services found."
|
||||
viewHref={(id) => `/admin/catering-services/${id}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import RoleUserManagementTablePage from '~/components/admin/RoleUserManagementTablePage';
|
||||
import ProfessionAdminListPage from '~/components/admin/ProfessionAdminListPage';
|
||||
|
||||
export default function DevelopersPage() {
|
||||
export default function Page() {
|
||||
return (
|
||||
<RoleUserManagementTablePage
|
||||
role="developer"
|
||||
<ProfessionAdminListPage
|
||||
endpoint="/api/admin/developers"
|
||||
title="Developers Management"
|
||||
subtitle="Manage all developer accounts on the platform."
|
||||
emptyLabel="No developer users found."
|
||||
viewHref={(id) => `/admin/users/${id}`}
|
||||
emptyLabel="No developers found."
|
||||
viewHref={(id) => `/admin/developers/${id}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import RoleUserManagementTablePage from '~/components/admin/RoleUserManagementTablePage';
|
||||
import ProfessionAdminListPage from '~/components/admin/ProfessionAdminListPage';
|
||||
|
||||
export default function FitnessTrainersPage() {
|
||||
export default function Page() {
|
||||
return (
|
||||
<RoleUserManagementTablePage
|
||||
role="fitness_trainer"
|
||||
<ProfessionAdminListPage
|
||||
endpoint="/api/admin/fitness-trainers"
|
||||
title="Fitness Trainer Management"
|
||||
subtitle="Manage all fitness trainer accounts on the platform."
|
||||
emptyLabel="No fitness trainer users found."
|
||||
viewHref={(id) => `/admin/users/${id}`}
|
||||
emptyLabel="No fitness trainers found."
|
||||
viewHref={(id) => `/admin/fitness-trainers/${id}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import RoleUserManagementTablePage from '~/components/admin/RoleUserManagementTablePage';
|
||||
import ProfessionAdminListPage from '~/components/admin/ProfessionAdminListPage';
|
||||
|
||||
export default function GraphicDesignersPage() {
|
||||
export default function Page() {
|
||||
return (
|
||||
<RoleUserManagementTablePage
|
||||
role="graphic_designer"
|
||||
<ProfessionAdminListPage
|
||||
endpoint="/api/admin/graphic-designers"
|
||||
title="Graphics Designer Management"
|
||||
subtitle="Manage all graphics designer accounts on the platform."
|
||||
emptyLabel="No graphics designer users found."
|
||||
viewHref={(id) => `/admin/users/${id}`}
|
||||
subtitle="Manage all graphic designer accounts on the platform."
|
||||
emptyLabel="No graphic designers found."
|
||||
viewHref={(id) => `/admin/graphic-designers/${id}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import RoleUserManagementTablePage from '~/components/admin/RoleUserManagementTablePage';
|
||||
import ProfessionAdminListPage from '~/components/admin/ProfessionAdminListPage';
|
||||
|
||||
export default function MakeupArtistPage() {
|
||||
export default function Page() {
|
||||
return (
|
||||
<RoleUserManagementTablePage
|
||||
role="makeup_artist"
|
||||
<ProfessionAdminListPage
|
||||
endpoint="/api/admin/makeup-artists"
|
||||
title="Makeup Artist Management"
|
||||
subtitle="Manage all makeup artist accounts on the platform."
|
||||
emptyLabel="No makeup artist users found."
|
||||
viewHref={(id) => `/admin/users/${id}`}
|
||||
emptyLabel="No makeup artists found."
|
||||
viewHref={(id) => `/admin/makeup-artist/${id}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,187 +58,8 @@ type OnboardingSchema = {
|
|||
updatedAt: string;
|
||||
};
|
||||
|
||||
const FALLBACK_SCHEMAS: OnboardingSchema[] = [
|
||||
{
|
||||
id: 'os1',
|
||||
name: 'Professional Photographer Flow',
|
||||
code: 'ONB-PRO-PHOTO',
|
||||
userType: 'PROFESSIONAL',
|
||||
role: 'Photographer',
|
||||
description: 'Onboarding for professional photographers (India localization).',
|
||||
verificationType: 'IDENTITY',
|
||||
requiredDocuments: ['Aadhaar Card', 'PAN Card', 'Portfolio Sample'],
|
||||
steps: [
|
||||
{
|
||||
id: 'st_role',
|
||||
name: 'Choose Role',
|
||||
description: 'Confirm your onboarding role and specialization.',
|
||||
required: true,
|
||||
fields: [
|
||||
{ id: 'f_role', key: 'role', label: 'Professional Role', type: 'select', required: true, options: ['Photographer', 'Makeup Artist', 'Tutor', 'Developer', 'Video Editor', 'UGC Content Creator'] },
|
||||
{ id: 'f_special', key: 'specialization', label: 'Specialization', type: 'select', required: true, options: ['Wedding', 'Product', 'Corporate', 'Portrait', 'Events'] },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'st_profile',
|
||||
name: 'Profile Details',
|
||||
description: 'Tell us about your profile.',
|
||||
required: true,
|
||||
fields: [
|
||||
{ id: 'f_name', key: 'full_name', label: 'Full Name', type: 'text', required: true, placeholder: 'e.g., Ashwin Kumar' },
|
||||
{ id: 'f_email', key: 'email', label: 'Email', type: 'email', required: true, placeholder: 'e.g., ashwin@example.com' },
|
||||
{ id: 'f_phone', key: 'phone', label: 'Phone Number', type: 'phone', required: true, placeholder: 'e.g., +91 98765 43210' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'st_location',
|
||||
name: 'Contact & Location',
|
||||
description: 'Your contact address details.',
|
||||
required: true,
|
||||
fields: [
|
||||
{ id: 'f_city', key: 'city', label: 'City', type: 'text', required: true, placeholder: 'e.g., Chennai' },
|
||||
{ id: 'f_pin', key: 'pincode', label: 'PIN Code', type: 'pincode', required: true, placeholder: 'e.g., 600001' },
|
||||
{ id: 'f_addr', key: 'address', label: 'Address', type: 'textarea', required: true, placeholder: 'House no, Street, Area' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'st_portfolio',
|
||||
name: 'Portfolio & Submission',
|
||||
description: 'Upload your portfolio sample.',
|
||||
required: true,
|
||||
fields: [
|
||||
{ id: 'f_portfolio', key: 'portfolio_file', label: 'Portfolio File', type: 'file', required: true, allowedFileTypes: ['PDF', 'JPG', 'JPEG', 'PNG'] },
|
||||
{ id: 'f_about', key: 'about', label: 'About You', type: 'textarea', required: true, placeholder: 'Tell us about your work…' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'st_identity',
|
||||
name: 'Identity Verification',
|
||||
description: 'Upload identity documents for verification.',
|
||||
required: true,
|
||||
fields: [
|
||||
{ id: 'f_aadhaar', key: 'aadhaar', label: 'Aadhaar Card', type: 'file', required: true, allowedFileTypes: ['PDF', 'JPG', 'JPEG', 'PNG'] },
|
||||
{ id: 'f_pan', key: 'pan', label: 'PAN Card', type: 'file', required: true, allowedFileTypes: ['PDF', 'JPG', 'JPEG', 'PNG'] },
|
||||
],
|
||||
},
|
||||
],
|
||||
status: 'ACTIVE',
|
||||
version: '1.2.0',
|
||||
updatedAt: '2026-03-27',
|
||||
},
|
||||
{
|
||||
id: 'os2',
|
||||
name: 'Basic Company Onboarding',
|
||||
code: 'ONB-COMP-BASIC',
|
||||
userType: 'COMPANY',
|
||||
description: 'Company onboarding with business verification.',
|
||||
verificationType: 'BUSINESS',
|
||||
requiredDocuments: ['GST Certificate', 'Company PAN', 'Incorporation Certificate'],
|
||||
steps: [
|
||||
{
|
||||
id: 'st_comp_identity',
|
||||
name: 'Company Identity',
|
||||
description: 'Provide company identity details.',
|
||||
required: true,
|
||||
fields: [
|
||||
{ id: 'f_company_name', key: 'company_name', label: 'Company Name', type: 'text', required: true, placeholder: 'e.g., Tech Solutions Inc' },
|
||||
{ id: 'f_industry', key: 'industry', label: 'Industry', type: 'select', required: true, options: ['Software', 'Design', 'Logistics', 'Manufacturing', 'Services'] },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'st_comp_contact',
|
||||
name: 'Contact Details',
|
||||
description: 'Primary contact information.',
|
||||
required: true,
|
||||
fields: [
|
||||
{ id: 'f_c_email', key: 'email', label: 'Company Email', type: 'email', required: true, placeholder: 'e.g., hr@company.com' },
|
||||
{ id: 'f_c_phone', key: 'phone', label: 'Phone Number', type: 'phone', required: true, placeholder: 'e.g., +91 98765 43210' },
|
||||
{ id: 'f_c_city', key: 'city', label: 'City', type: 'text', required: true, placeholder: 'e.g., Chennai' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'st_hiring',
|
||||
name: 'Hiring Preferences',
|
||||
description: 'Tell us about hiring needs.',
|
||||
required: true,
|
||||
fields: [
|
||||
{ id: 'f_roles', key: 'hire_for', label: 'Hiring For', type: 'multi-select', required: true, options: ['Developers', 'Designers', 'Photographers', 'UGC Content Creators', 'Tutors'] },
|
||||
{ id: 'f_budget', key: 'budget', label: 'Monthly Hiring Budget (₹)', type: 'number', required: true, placeholder: 'e.g., 50000' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'st_business',
|
||||
name: 'Business Verification',
|
||||
description: 'Upload business documents.',
|
||||
required: true,
|
||||
fields: [
|
||||
{ id: 'f_gst', key: 'gst', label: 'GST Certificate', type: 'file', required: true, allowedFileTypes: ['PDF', 'JPG', 'JPEG', 'PNG'] },
|
||||
{ id: 'f_comp_pan', key: 'company_pan', label: 'Company PAN', type: 'file', required: true, allowedFileTypes: ['PDF', 'JPG', 'JPEG', 'PNG'] },
|
||||
],
|
||||
},
|
||||
],
|
||||
status: 'ACTIVE',
|
||||
version: '1.0.5',
|
||||
updatedAt: '2026-03-27',
|
||||
},
|
||||
{
|
||||
id: 'os3',
|
||||
name: 'Jobseeker Registration',
|
||||
code: 'ONB-JOB-DEFAULT',
|
||||
userType: 'JOBSEEKER',
|
||||
description: 'Jobseeker registration with identity verification.',
|
||||
verificationType: 'IDENTITY',
|
||||
requiredDocuments: ['Aadhaar Card', 'Resume'],
|
||||
steps: [
|
||||
{
|
||||
id: 'st_basic',
|
||||
name: 'Basic Profile',
|
||||
description: 'Fill basic profile details.',
|
||||
required: true,
|
||||
fields: [
|
||||
{ id: 'f_js_name', key: 'full_name', label: 'Full Name', type: 'text', required: true, placeholder: 'e.g., Priya Sharma' },
|
||||
{ id: 'f_js_email', key: 'email', label: 'Email', type: 'email', required: true, placeholder: 'e.g., priya@example.com' },
|
||||
{ id: 'f_js_phone', key: 'phone', label: 'Phone Number', type: 'phone', required: true, placeholder: 'e.g., +91 98765 43210' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'st_pref',
|
||||
name: 'Job Preferences',
|
||||
description: 'Your job preferences.',
|
||||
required: true,
|
||||
fields: [
|
||||
{ id: 'f_job_type', key: 'job_type', label: 'Job Type', type: 'select', required: true, options: ['Full-time', 'Part-time', 'Contract', 'Internship'] },
|
||||
{ id: 'f_location', key: 'preferred_location', label: 'Preferred Location', type: 'text', required: true, placeholder: 'e.g., Chennai' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'st_docs',
|
||||
name: 'Documents & Links',
|
||||
description: 'Upload resume and identity.',
|
||||
required: true,
|
||||
fields: [
|
||||
{ id: 'f_resume', key: 'resume', label: 'Resume', type: 'file', required: true, allowedFileTypes: ['PDF'] },
|
||||
{ id: 'f_js_aadhaar', key: 'aadhaar', label: 'Aadhaar Card', type: 'file', required: true, allowedFileTypes: ['PDF', 'JPG', 'JPEG', 'PNG'] },
|
||||
],
|
||||
},
|
||||
],
|
||||
status: 'DRAFT',
|
||||
version: '2.0.0-rc',
|
||||
updatedAt: '2026-03-27',
|
||||
},
|
||||
];
|
||||
|
||||
const FALLBACK_SUBMISSIONS: OnboardingSubmission[] = [
|
||||
{ id: 'sub_1001', userId: 'u_2001', userName: 'Rohit Mehra', roleKey: 'PROFESSIONAL_PHOTOGRAPHER', status: 'PENDING_APPROVAL', createdAt: '2026-03-25', updatedAt: '2026-03-27' },
|
||||
{ id: 'sub_1002', userId: 'u_2002', userName: 'Tech Solutions Inc', roleKey: 'COMPANY', status: 'DOCUMENT_REQUESTED', createdAt: '2026-03-20', updatedAt: '2026-03-26' },
|
||||
{ id: 'sub_1003', userId: 'u_2003', userName: 'Priya Sharma', roleKey: 'JOBSEEKER', status: 'SUBMITTED', createdAt: '2026-03-22', updatedAt: '2026-03-22' },
|
||||
];
|
||||
|
||||
const FALLBACK_AUDIT: AuditEvent[] = [
|
||||
{ id: 'evt_1', event: 'ONBOARDING_CREATED', actor: 'Admin', target: 'ONB-PRO-PHOTO', createdAt: '2026-03-01 10:11' },
|
||||
{ id: 'evt_2', event: 'ONBOARDING_UPDATED', actor: 'Admin', target: 'ONB-COMP-BASIC', createdAt: '2026-03-15 16:40' },
|
||||
{ id: 'evt_3', event: 'ONBOARDING_PREVIEWED', actor: 'Admin', target: 'ONB-JOB-DEFAULT', createdAt: '2026-03-26 09:20' },
|
||||
];
|
||||
|
||||
function StatusBadge(props: { status: string }) {
|
||||
const active = () => props.status === 'ACTIVE';
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import RoleUserManagementTablePage from '~/components/admin/RoleUserManagementTablePage';
|
||||
import ProfessionAdminListPage from '~/components/admin/ProfessionAdminListPage';
|
||||
|
||||
export default function PhotographerPage() {
|
||||
return (
|
||||
<RoleUserManagementTablePage
|
||||
role="photographer"
|
||||
<ProfessionAdminListPage
|
||||
endpoint="/api/admin/photographers"
|
||||
title="Photographer Management"
|
||||
subtitle="Manage all photographer accounts on the platform."
|
||||
emptyLabel="No photographer users found."
|
||||
emptyLabel="No photographers found."
|
||||
viewHref={(id) => `/admin/photographer/${id}`}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import RoleUserManagementTablePage from '~/components/admin/RoleUserManagementTablePage';
|
||||
import ProfessionAdminListPage from '~/components/admin/ProfessionAdminListPage';
|
||||
|
||||
export default function SocialMediaManagersPage() {
|
||||
export default function Page() {
|
||||
return (
|
||||
<RoleUserManagementTablePage
|
||||
role="social_media_manager"
|
||||
<ProfessionAdminListPage
|
||||
endpoint="/api/admin/social-media-managers"
|
||||
title="Social Media Manager Management"
|
||||
subtitle="Manage all social media manager accounts on the platform."
|
||||
emptyLabel="No social media manager users found."
|
||||
viewHref={(id) => `/admin/users/${id}`}
|
||||
emptyLabel="No social media managers found."
|
||||
viewHref={(id) => `/admin/social-media-managers/${id}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import RoleUserManagementTablePage from '~/components/admin/RoleUserManagementTablePage';
|
||||
import ProfessionAdminListPage from '~/components/admin/ProfessionAdminListPage';
|
||||
|
||||
export default function TutorsPage() {
|
||||
export default function Page() {
|
||||
return (
|
||||
<RoleUserManagementTablePage
|
||||
role="tutor"
|
||||
<ProfessionAdminListPage
|
||||
endpoint="/api/admin/tutors"
|
||||
title="Tutors Management"
|
||||
subtitle="Manage all tutor accounts on the platform."
|
||||
emptyLabel="No tutor users found."
|
||||
viewHref={(id) => `/admin/users/${id}`}
|
||||
emptyLabel="No tutors found."
|
||||
viewHref={(id) => `/admin/tutors/${id}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import RoleUserManagementTablePage from '~/components/admin/RoleUserManagementTablePage';
|
||||
import ProfessionAdminListPage from '~/components/admin/ProfessionAdminListPage';
|
||||
|
||||
export default function VideoEditorsPage() {
|
||||
export default function Page() {
|
||||
return (
|
||||
<RoleUserManagementTablePage
|
||||
role="video_editor"
|
||||
<ProfessionAdminListPage
|
||||
endpoint="/api/admin/video-editors"
|
||||
title="Video Editor Management"
|
||||
subtitle="Manage all video editor accounts on the platform."
|
||||
emptyLabel="No video editor users found."
|
||||
viewHref={(id) => `/admin/users/${id}`}
|
||||
emptyLabel="No video editors found."
|
||||
viewHref={(id) => `/admin/video-editors/${id}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue