Commit graph

135 commits

Author SHA1 Message Date
Ashwin Kumar Sivakumar
fbf343263d fix: expose verification_status as a selectable JOB_SEEKER dashboard widget
All checks were successful
build-and-release / build (push) Successful in 47s
Job seekers had no way to see/submit verification documents from their
dashboard because the widget picker never offered this option for their
role, so no admin could add it via the builder UI.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-23 04:25:53 +05:30
Ashwin Kumar Sivakumar
1de5baeb92 fix: show real company/applicant data in Verification Management table and detail view
All checks were successful
build-and-release / build (push) Successful in 44s
Applicant Name was hardcoded to 'Applicant' (backend never returns a
user_name field), the Company category tab could never match anything
since requestType was never set to 'Company Approval', and a class of
submissions with an accidentally double-wrapped payload rendered as
blank/Unknown everywhere. Derives the display name and area from the
actual payload fields (with defensive unwrapping for the double-wrapped
shape), and classifies company submissions correctly for tab filtering.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 22:03:59 +05:30
Ashwin Kumar Sivakumar
fadb2c0a80 fix: make Verification Management pagination actually work
All checks were successful
build-and-release / build (push) Successful in 1m3s
The page/next/prev controls were static markup with no onClick handlers,
and the "Showing X-Y of Z" label always rendered the same number for X, Y,
and Z (all displayRows().length) - pagination never did anything, all
fetched rows rendered on one page. Wires it to a real page signal with
working prev/next/page-number buttons, resets to page 1 when filters
change, and fixes the range label.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 19:41:39 +05:30
Ashwin Kumar Sivakumar
b208b37845 fix: show real uploaded documents/profile data on verification review, use reference numbers
All checks were successful
build-and-release / build (push) Successful in 52s
The verification review page was rendering hardcoded mock documents and
mock profile data instead of the real API response, so admins never saw
what customers actually submitted. Wires it to the real documents/payload
fields. Also replaces raw UUID displays with the new human-readable
reference_number across verification, support, orders, and users.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 16:35:49 +05:30
Ashwin Kumar Sivakumar
0e08cf9d6b feat(admin): extend session on activity, expire on 15 min idle
All checks were successful
build-and-release / build (push) Successful in 1m33s
Pairs with the backend's new POST /api/admin/auth/refresh (nxtgauge-backend-rust).
While the admin is active (mouse/keyboard/scroll/touch), silently exchange
the refresh-token cookie for a new access token every 3 minutes so the
15-minute access token never actually expires mid-work. Once idle for 15
minutes, the refresh loop stops on its own and the token expires naturally,
triggering the existing session-expired dialog - "logged out on inactivity,
not on a fixed timer" as intended.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 00:14:39 +05:30
Ashwin Kumar Sivakumar
ca2c5a4ef6 feat(admin): show a dialog when the session expires instead of failing silently
All checks were successful
build-and-release / build (push) Successful in 1m2s
Admin access tokens expire after 15 minutes with no refresh flow. Until now,
once the token expired, every subsequent action (approve, save, etc.) just
403/401'd with no visible feedback, or an error banner easy to miss inside a
modal — it looked like the button "didn't work."

Add a global window.fetch wrapper (installSessionExpiryWatcher, installed
once from AdminShell) that flips a shared signal whenever an authenticated
request comes back 401. AdminShell renders a "You have been logged out"
dialog on top of everything when that fires, with a button that clears the
stale session and sends the admin back to /login?from=<current path>.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 00:03:57 +05:30
Ashwin Kumar Sivakumar
5df2d6c07e fix(admin-verification): send request body on Approve action from queue list
All checks were successful
build-and-release / build (push) Successful in 1m21s
Every action branch (reject, request-documents, request-revision, notes)
set common.body to a JSON payload, but the isApprove branch never did,
leaving body: undefined. axum's Json<ActionPayload> extractor rejects a
body-less POST before approve_verification even runs, so clicking Approve
in the queue-list modal silently failed (the error banner renders at the
top of the page, easy to miss behind the open modal).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 23:41:22 +05:30
Ashwin Kumar Sivakumar
fe9c994b74 fix(admin-verification): attach bearer token to verification queue/detail fetches
All checks were successful
build-and-release / build (push) Successful in 1m1s
Backend's AuthUser extractor only reads the Authorization header — it never
looks at cookies. The verification queue list (index.tsx load()) and every
call in the verification detail page (via the shared adminFetch helper) sent
credentials: 'include' but no Authorization header, so they 401'd right after
a successful login even though the access token was already in sessionStorage.
Matches the pattern already used by the approve/reject actions further down
in index.tsx.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 22:59:04 +05:30
Ashwin Kumar Sivakumar
d1db169162 fix(admin-auth): read GATEWAY_URL from process.env instead of build-time Vite var
All checks were successful
build-and-release / build (push) Successful in 1m44s
Server-side gateway proxy (login, forgot-password, reset-password, all
/api/admin/* and /api/gateway/* calls) was reading import.meta.env.VITE_GATEWAY_URL,
which Vite only inlines at build time. The Dockerfile wrote GATEWAY_URL (no VITE_
prefix, and localhost besides) to .env at build time, so the var was never picked
up and the fallback http://localhost:9100 got baked into the server bundle
permanently — unreachable inside the pod, causing every admin auth call to 502
regardless of the correct GATEWAY_URL already set in the k8s ConfigMap.

Switch to process.env.GATEWAY_URL, read at runtime like the rest of the server
config already is.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 22:23:19 +05:30
Tracewebstudio Dev
bed7035ec5 fix: TypeScript errors, test quality, and admin panel correctness
All checks were successful
build-and-release / build (push) Successful in 1m19s
- tsconfig.json: add @types/node for playwright/test configs
- lib/api.ts: handle both array and wrapped packages response from tracecoin endpoint
- lib/server/gateway.ts: use import.meta.env instead of process.env
- routes/admin/pricing.tsx: fix packages() usage after api.ts fix
- routes/admin/roles/*.tsx: fix Set<string> types and module filter types
- routes/admin/users/[id]/edit.tsx: add phone? to local User type
- routes/admin/users/details/[id].tsx: fix roleFilter param type narrowing
- components/admin/DashboardDesignPreview.tsx: fix budget→budget, responses→responseTag
- vite.config.ts: type proxy callbacks as any
- test/setup.ts: fix IntersectionObserver mock, add vitest/globals reference
- tests/e2e: fix PNG type mismatches, add as any for mock overrides
- tests/vitest: fix global.createElement mock type, vitest globals reference
- tests/tsconfig.json: test-specific tsconfig with node types

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-17 00:47:43 +02:00
Ashwin Kumar Sivakumar
87fe3c0c59 fix(admin-auth): point forgot-password at the employees endpoint, not users
All checks were successful
build-and-release / build (push) Successful in 57s
The previous fix routed through /api/gateway/auth/* (the users-table
forgot-password), which succeeds but changes the wrong account entirely —
admin.nxtgauge.com authenticates against a separate employees table.
Backend now exposes /api/admin/auth/forgot-password and
/api/admin/auth/reset-password against EmployeeRepository; route there.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 23:29:27 +05:30
Ashwin Kumar Sivakumar
eb6baf037b fix(admin-auth): route forgot-password calls through the gateway proxy
All checks were successful
build-and-release / build (push) Successful in 49s
/api/auth/forgot-password and /api/auth/reset-password aren't routes this
app serves itself — admin.nxtgauge.com only proxies specific prefixes
(/api/admin/*, /api/gateway/*, /api/me/*), so calling the bare path 404'd
at the SolidStart routing layer before ever reaching the backend. The
existing /api/gateway/[...path] proxy already rewrites /auth/* to
/api/auth/* on the real backend — route through that instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 23:09:28 +05:30
Ashwin Kumar Sivakumar
812fc5ef04 fix(admin-auth): point forgot-password flow at endpoints that actually exist
All checks were successful
build-and-release / build (push) Successful in 48s
The reset-password flow called /api/auth/internal/forgot-password/request-code
and /verify-code with a challengeId-based two-step contract — neither route
exists anywhere in the backend, so every reset attempt failed with "Failed to
send reset code." The real backend only exposes /api/auth/forgot-password
(sends a one-time code, always 200 to avoid account enumeration) and
/api/auth/reset-password (consumes the code + new password, no challengeId
involved). Rewrites both request/verify handlers to match that contract.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 22:56:52 +05:30
Ashwin Kumar Sivakumar
0866b7a069 fix(admin): add missing detail pages for 8 profession admin lists
All checks were successful
build-and-release / build (push) Successful in 44s
Each of these profession admin list pages (makeup artist, tutor, developer,
video editor, graphic designer, social media manager, fitness trainer,
catering services) linked "View Profile" to /admin/{role}/{id}, but only
Photographer and Company had a real [id].tsx route — every other role fell
through to the legacy catch-all module and showed a placeholder instead of
the applicant's actual profile. Converts each flat list route into a
folder (index.tsx + [id].tsx) and adds a shared ProfessionDetailPage
component, modeled on the working Photographer detail page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 21:24:02 +05:30
Ashwin Kumar Sivakumar
7ae59fee20 fix: admin panel bugs found in QA audit
All checks were successful
build-and-release / build (push) Successful in 59s
- users: wire suspend/block buttons to PATCH /api/admin/users/:id/status
  (previously only mutated local state, reverted on refresh); add
  load/action error banners instead of silently emptying the table
- [...module]: stop rendering a dead localhost:9201 iframe for legacy
  modules when VITE_LEGACY_ADMIN_ORIGIN isn't configured (it never is
  in production); show a clear "not available" message instead
- dashboard: surface a banner when /api/admin/dashboard/metrics fails
  instead of silently showing "No Data" on every widget
- credit: fix stray extra closing </Show> tag that broke the whole
  file's JSX parse; restore missing API/authHeaders module helpers
  dropped in a previous refactor (AI Credits handlers referenced them
  but they were undefined); replace a dead, broken exportLedgerCsv/
  filteredLedger implementation with one matching actual call sites;
  fix activeTab type/tab keys so the Balance & Ledger and Platform
  Ledger tabs were actually reachable (they compared against 'balance'
  /'platform' but the tab buttons only ever set 'ledger')
- roles: surface errors when fetching a role's permissions for edit
  fails, instead of silently swallowing them
- runtime-roles: surface fetch/delete errors instead of silently
  swallowing them or presenting fallback sample data as if real

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-13 18:24:44 +05:30
Ashwin Kumar Sivakumar
ef8f4410c7 fix: dead Add Note buttons and no-op row click in admin review pages
Some checks failed
build-and-release / build (push) Failing after 1m16s
- verification/[id].tsx: "Add Note" in the Reviewer Notes panel had no
  onClick — wired to the existing POST /api/admin/verifications/:id/notes
  endpoint.
- approval/index.tsx: Decision Notes textarea was uncontrolled and its
  "Add Note" button was a no-op; there's no standalone notes endpoint
  for approval_requests, so the textarea is now bound to state and its
  value is sent as the rejection reason when the reviewer rejects
  (the only channel the backend currently supports).
- support.tsx: removed a no-op onClick={() => {}} on the case row —
  the row isn't actually clickable, only the adjacent "View" link is
  (though that link's target route doesn't exist yet — flagged
  separately, out of scope here).
2026-07-12 17:59:03 +05:30
Ashwin Kumar Sivakumar
78b6558539 fix: Storybook import path for onboarding-management
- Update import from non-existent onboarding-management to onboarding-schemas/index
2026-07-06 22:02:39 +05:30
Ashwin Kumar Sivakumar
43d181bf5a fix: JSX structure in credit.tsx
Some checks failed
build-and-release / build (push) Failing after 1m11s
- Fix nested tag structure: AI Credits tab was incorrectly nested inside Platform Ledger section
- Close Platform Ledger section before starting AI Credits tab
- Move AI Credits tab to be a sibling of Platform Ledger tab, not a child
- Wrap AI Credits content in proper section element for consistent styling

Fixes build errors in admin-solid
2026-07-06 03:04:14 +05:30
Ashwin Kumar Sivakumar
578fb2c5a1 fix: JSX structure in credit.tsx
Some checks failed
build-and-release / build (push) Failing after 1m10s
- Fix nested tag structure: AI Credits tab was incorrectly nested inside Platform Ledger section
- Close Platform Ledger section before starting AI Credits tab
- Move AI Credits tab to be a sibling of Platform Ledger tab, not a child
- Wrap AI Credits content in proper section element for consistent styling
2026-07-06 02:49:39 +05:30
Ashwin Kumar Sivakumar
059c7569c4 feat: Add AI Credits admin UI on high-performance branch (Task 2)
Some checks failed
build-and-release / build (push) Failing after 1m10s
- pricing.tsx: AI Credit Packages tab
- credit.tsx: AI Credits panel with Balance/Ledger/Adjust/Reconcile
2026-07-06 01:49:44 +05:30
Tracewebstudio Dev
69079caa1d feat: admin invoice/credit/pricing UI overhaul with auth token injection
Some checks failed
build-and-release / build (push) Failing after 0s
- Inject Bearer token from sessionStorage into all API requests
- Add typed API helpers for invoices, credits, discounts, ledger, orders, pricing, tax
- Overhaul invoice, credit, pricing, tax admin routes with full CRUD UI
- Remove committed log files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 13:51:08 +02:00
Tracewebstudio Dev
22fe140987 Refine admin Razorpay gateway screen 2026-06-26 21:08:26 +02:00
Ashwin Kumar Sivakumar
41b3bf3e1d Merge remote high-performance: keep local AI management page and resolve conflicts 2026-06-15 06:19:36 +05:30
Ashwin Kumar Sivakumar
446152648f feat(ai): add AI management page and sidebar link 2026-06-15 06:19:17 +05:30
Tracewebstudio Dev
f511a3c31a feat: add AI management page to admin panel
New AI Management page (/admin/ai-management):
- Overview tab: AI users, daily/monthly generations, active plans
- User Usage tab: searchable table with plan, usage, addon balance
- Plans tab: grid of available AI plans

Sidebar:
- Added AI Management nav item with Sparkles icon

Dashboard:
- Added kpi_ai_users widget
- Added kpi_ai_generations_today widget

Files:
- src/routes/admin/ai-management.tsx (new)
2026-06-14 20:28:38 +02:00
Tracewebstudio Dev
394046fdb3 Update admin session, gateway, jobs/leads routes, login, and add API me endpoint 2026-05-08 15:34:46 +02:00
Tracewebstudio Dev
b75c99408c chore: checkpoint workspace updates 2026-04-26 23:58:42 +02:00
Tracewebstudio Dev
2c4e579725 Fix admin dashboard API endpoint and close missing bracket in create role form 2026-04-19 22:20:08 +02:00
Tracewebstudio Dev
10c7ba0934 fix: close div tag properly in department.tsx settings tab 2026-04-15 15:17:12 +02:00
Tracewebstudio Dev
232309e353 fix: update admin forms to match DB schema 2026-04-15 06:23:29 +02:00
Tracewebstudio Dev
3265b1a16a Align external preview UX and unlock leads preview flow 2026-04-15 00:15:22 +02:00
Tracewebstudio Dev
a8b1b7cd11 feat: multi-select roles in pricing management UI 2026-04-13 01:36:15 +02:00
Ashwin Kumar
ad9be1ab15 fix(build): restore missing admin imports and api client 2026-04-10 19:57:23 +02:00
Ashwin Kumar
10b6c48f1b feat(smtp): update SMTP management page with test functionality and email templates link
- Redesign SMTP management page with two-column layout

- Add SMTP connection test functionality

- Add link to email templates page

- Show current SMTP status

- Add quick help section
2026-04-10 04:55:44 +02:00
Ashwin Kumar
2409d85b3c feat(admin): add email management page with preview and test functionality
- Add email management page with template listing

- Add email preview with iframe

- Add test email sending functionality

- Add Email Management to sidebar navigation
2026-04-10 04:50:00 +02:00
Ashwin Kumar
1c94f97d11 dashboard implementation 2026-04-10 01:17:00 +02:00
Ashwin Kumar
8950a502f6 chore: align admin management modules, auth flows, and test stability 2026-04-08 22:12:38 +02:00
Ashwin Kumar
08f0cb6402 feat: comprehensive testing infrastructure
- Add vitest with solid plugin, coverage, jsdom environment
- Create MSW mocks for API responses in test setup
- Add unit test for ProfessionAdminListPage
- Add Playwright accessibility and visual regression configs
- Add sample accessibility and visual tests
- Add ESLint + Prettier configs with SolidJS rules
- Update scripts: test, test:coverage, test:accessibility, test:visual
- Add .gitignore entries for coverage, test-results, playwright-report, .vitest
- Install required dev dependencies: vitest, @solidjs/testing-library, msw, eslint, prettier, typescript, @axe-core/playwright, etc.
- Create .github/workflows/ci.yml with lint, test, coverage, e2e, accessibility, visual checks

This sets up full testing pipeline for admin frontend.
2026-04-08 02:38:17 +02:00
Ashwin Kumar
411827f837 Fix auth headers on pricing/credit/invoice/coupon pages
- All 4 pages now send Bearer token from sessionStorage on every fetch
- Pricing: fixed endpoint from /api/admin/packages → /api/admin/tracecoin-packages;
  added search, role filter, status filter, and sort (name/price/coins)
- Coupon: added search by code/title and status filter; fixed refetch to use load()
- Invoice: refactored from createResource to onMount+signals for consistent auth
- Credit: authenticated balance, ledger, adjust, and reconcile fetch calls

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 02:11:06 +02:00
Ashwin Kumar
0ec64be905 feat: unify API paths and upgrade table UIs
- Replace all /api/gateway/* with /api/* to match gateway routing
- Fix AdminShell.tsx: update UGC route to singular and fix logout URL
- Remove Applications and Responses from sidebar (unused)
- Move conflicting route files into folders (company, approval, verification, users, jobs, kb, leads, photographer) as index.tsx to avoid catch-all interference
- Upgrade ProfessionAdminListPage to match Department Management UI:
  • Dark headers with white text
  • Icons on Sort/Filters/Export buttons
  • Pagination UI
  • Improved empty state with Create button
  • Hover effects and consistent spacing
- Update all pages using ProfessionAdminListPage to benefit from new UI
- Fix jobs admin endpoint to use /api/admin/companies/jobs with auth
- Add authentication headers to jobs and leads fetch calls

These changes unify the API architecture and bring a consistent, professional look to all management tables.
2026-04-07 22:12:52 +02:00
Ashwin Kumar
ead325a3e3 fix: use formRoleKey fallback for roleKey in external dashboard preview
When roles API fails to load or roleId doesn't match a loaded role,
selectedRoleKey() returns empty string. Fall back to formRoleKey() in
all three DashboardDesignPreview instances (compact, full_preview tab,
fullscreen overlay) so the role-specific preview always renders correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 22:24:59 +02:00
Ashwin Kumar
2e3c2d6db8 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
2026-04-06 19:51:47 +02:00
Ashwin Kumar
65156aafde fix: use admin jobs endpoint in admin jobs management page
- Change fetch from /api/jobs to /api/admin/jobs
- Adjust fields to match new endpoint: use salary_min/salary_max, posted_at, company_name
2026-04-06 19:12:22 +02:00
Ashwin Kumar
88a00db3bd feat: complete Knowledge Base category management and fix structure
- Added full CRUD UI for categories (create/edit/delete)
- Category form with name, slug, description, display order, active toggle
- Categories displayed as editable tags with delete icons
- Removed duplicate second implementation entirely
- Fixed file structure to have single component
- Updated package.json with solid-markdown dependency
- Integrated Markdown component into article detail page for proper rendering
2026-04-06 18:39:20 +02:00
Ashwin Kumar
44d4ce5b2a feat: add admin notification polling, KB category CRUD helpers, fix duplicate code
- AdminShell: added notification bell polling every 30s
- KB page: added createCategory, updateCategory, deleteCategory API helpers
- KB page: added category management state and handlers
- KB page: removed duplicate second implementation (partial)
- KB page: need to insert category UI in next step
2026-04-06 18:38:28 +02:00
Ashwin Kumar
0c757cf5bd feat(admin): wire verification actions, remove onboarding management, fix kb.tsx
- verification/[id].tsx: approve, reject, request-documents, request-revision
  all wired to real API endpoints with loading states and feedback banners
- Delete onboarding-management/ (flow moved to dashboard My Profile/Portfolio)
- kb.tsx: remove stray closing brace (TS1128 syntax error)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 17:20:41 +02:00
Ashwin Kumar
005572cdd2 feat(kb): migrate admin KB page to persistent API storage
- Replace runtime storage CRUD with real /api/admin/kb endpoints
- Add proper error handling and state management
- Support seed functionality via API
- Align data mapping with backend Article and Category structs
- Improves data persistence and admin UX

Closes #KB-API-Migration
2026-04-06 15:06:22 +02:00
Ashwin Kumar
82cfd3c1d7 fix: admin pricing page endpoint, JSX structure fixes
- pricing: change /api/admin/tracecoin-packages to /api/admin/packages
- modules.tsx: wrap with fragment, fix heading structure
- [...module].tsx: fix missing container div
- DashboardDesignPreview.tsx: fix '>' in text
2026-04-06 08:24:14 +02:00
Ashwin Kumar
0a0c51adc1 feat: wire admin dashboard to real metrics and fix JSX errors
- Wire dashboard home to live /api/admin/dashboard/metrics with 8 KPI widgets
- Add pending_approvals and total_revenue widget definitions
- Fix JSX syntax errors in [...module].tsx and modules.tsx
- Fix '>' character in DashboardDesignPreview.tsx
2026-04-06 06:19:14 +02:00
Ashwin Kumar
ac146c4d36 feat: implement dynamic knowledge base management and seeding 2026-04-06 03:33:11 +02:00