Commit Graph

9 Commits

Author SHA1 Message Date
765a944c11 feat: add user dropdown menu in admin and employee headers
- Add dropdown menu with user avatar, name, and email in admin header
- Add dropdown menu with user avatar, name, and email in employee header
- Create admin profile page at /admin/profil
- Create employee profile page at /employe/profil
- Remove Profil link from admin sidebar (now in dropdown)
- Fix header public display: hide for admin/employee on all pages
- Use router.replace() instead of router.push() for login redirects to avoid history pollution
- Simplify employe dashboard page: remove redundant auth checks handled by layout
- Add click-outside-to-close functionality for dropdown menus

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 01:24:21 +01:00
34474cc275 fix: use API_BASE_URL constant instead of direct env access
Replace all instances of process.env.NEXT_PUBLIC_API_URL with
API_BASE_URL constant for consistency and to ensure the API URL
is properly defined at runtime.

Files updated:
- app/admin/marketing-data/page.tsx
- app/admin/tirages/page.tsx
- app/employe/dashboard/page.tsx
- app/employe/gains-client/page.tsx
- app/employe/historique/page.tsx
- components/admin/TicketManagement.tsx

This fixes the "undefined" API URL issue that was preventing
API calls from working correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 15:07:49 +01:00
00f5d432dc fix: remove all snake_case property accesses in modal section
Remove invalid snake_case property accesses in the ticket details modal:
- selectedTicket.user_name → selectedTicket.user (with firstName/lastName)
- selectedTicket.user_email → selectedTicket.user?.email
- selectedTicket.user_phone → selectedTicket.user?.phone
- selectedTicket.prize_name → selectedTicket.prize?.name
- selectedTicket.prize_value → selectedTicket.prize?.value
- selectedTicket.played_at → selectedTicket.playedAt

All properties now match the Ticket type definition.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 00:58:56 +01:00
ecdfb826be fix: use correct Ticket type properties in verification page
Fix property access to match the Ticket type definition:
- ticket.user_name → ticket.user?.firstName + lastName
- ticket.user_email → ticket.user?.email
- ticket.prize_name → ticket.prize?.name
- ticket.played_at → ticket.playedAt

The Ticket type uses camelCase and nested objects (user, prize),
not snake_case flat properties.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 00:52:12 +01:00
7f04ae5eca fix: add type annotation to badges object in verification page
Add Record<string, React.ReactElement> type to badges object to allow
dynamic string indexing in app/employe/verification/page.tsx.

This matches the fix already applied to page-new.tsx and resolves the
TypeScript compilation error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 00:47:45 +01:00
a40eb7b5d1 fix: add type annotation to badges object in getStatusBadge
Add Record<string, React.ReactElement> type to badges object to allow
dynamic string indexing. This fixes TypeScript error where status string
parameter cannot be used to index the badges object.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 00:42:31 +01:00
279556cb72 fix: use correct action values for validateTicket function
Change validateTicket action parameters from lowercase "validate"/"reject"
to uppercase "APPROVE"/"REJECT" to match the function signature.

The employeeService.validateTicket function expects action type of
'APPROVE' | 'REJECT', not 'validate' | 'reject'.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 00:38:53 +01:00
84d42132ad fix: remove invalid lowercase employee role comparisons
Remove invalid comparisons against lowercase 'employee' role that don't exist
in the User type. The role type only includes uppercase 'EMPLOYEE'.

Fixed in:
- app/employe/dashboard/page.tsx (lines 42, 117)
- app/employe/layout.tsx (lines 28, 48)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 00:34:50 +01:00
2f7abde4ea dev 2025-11-17 23:38:02 +01:00