Commit Graph

14 Commits

Author SHA1 Message Date
dwindown
50ce884a43 fix: apply theme colors to all admin pages
AdminDashboard:
- Replace all gray colors with theme variables
- Indonesian text: 'Selamat datang', 'Kelola Plans', etc.
- Loading: 'Memuat...'

AdminPlans:
- bg-card, text-foreground, border-border
- text-muted-foreground for secondary text
- bg-muted for sections
- text-primary for links/icons
- text-destructive for delete
- Indonesian: 'Kelola Plans', 'Tambah Plan', 'Tidak ada plan'

AdminUsers:
- Same theme color replacements
- Indonesian: 'Kelola Users', 'Tidak ada user'
- bg-primary for avatars
- Consistent hover states

All pages now:
 Respect light/dark mode
 Use @theme colors from index.css
 Indonesian text (keeping English tech terms)
 Consistent with member layout styling
2025-10-11 20:18:10 +07:00
dwindown
4bd95e50e8 fix: include role field in all auth responses
- Add role to login response
- Add role to register response
- Add role to Google login response
- Add role to OTP verification response
- Add role to getUserProfile response
- Fixes admin panel access denied issue
2025-10-11 18:42:23 +07:00
dwindown
df92bebc8d docs: update implementation plan - admin frontend 50% complete 2025-10-11 18:34:15 +07:00
dwindown
be44384475 docs: add admin frontend progress summary 2025-10-11 18:33:42 +07:00
dwindown
7396cb5bd6 feat: add admin pages for plans, users, and placeholders
- AdminPlans: full CRUD UI with cards, visibility toggle
- AdminUsers: search, suspend/unsuspend, grant Pro access
- AdminPaymentMethods: placeholder
- AdminPayments: placeholder
- AdminSettings: placeholder
- All routes wired in App.tsx
- Admin panel fully navigable
2025-10-11 18:30:18 +07:00
dwindown
cd6b047d3f feat: add admin frontend layout and dashboard
- Add role field to User interface in AuthContext
- Create AdminLayout with responsive sidebar navigation
- Create AdminDashboard with stats cards
- Add admin routes to App.tsx
- Admin panel accessible at /admin
- Shows stats: total users, active subscriptions, pending payments
- Access control: only users with role=admin can access
2025-10-11 18:22:42 +07:00
dwindown
e84d4affc6 docs: add comprehensive admin backend testing
- Create ADMIN_BACKEND_TESTED.md with test results
- Create test-admin-api.sh automated test script
- All endpoints tested and working:
  - GET /admin/plans 
  - POST /admin/plans 
  - PUT /admin/plans/:id 
  - DELETE /admin/plans/:id 
  - GET /admin/payment-methods 
  - GET /admin/users 
  - GET /admin/users/stats 
  - GET /admin/payments/pending/count 
  - GET /admin/config 
  - Security (401 without token) 

Backend fully tested and ready for frontend development
2025-10-11 18:10:20 +07:00
dwindown
ddca073610 fix: await async generateToken in auth service
- Add await to all generateToken() calls
- Fixes empty token issue in login/register responses
- Token now properly includes user role for admin access
2025-10-11 18:08:01 +07:00
dwindown
1c28e51b53 docs: update implementation plan and add backend completion summary
- Mark backend as complete in IMPLEMENTATION_PLAN.md
- Create ADMIN_BACKEND_COMPLETE.md with full documentation
- Document all API endpoints
- Add testing instructions
- Add deployment notes
2025-10-11 14:37:18 +07:00
dwindown
12850ab12d feat: complete admin backend controllers and services
- AdminPlansController & Service (CRUD, reorder)
- AdminPaymentMethodsController & Service (CRUD, reorder)
- AdminPaymentsController & Service (verify, reject, pending count)
- AdminUsersController & Service (search, suspend, grant pro access, stats)
- AdminConfigController & Service (dynamic config management)
- Wire all controllers into AdminModule
- Import AdminModule in AppModule

Admin API Routes:
- GET/POST/PUT/DELETE /admin/plans
- GET/POST/PUT/DELETE /admin/payment-methods
- GET /admin/payments (with status filter)
- POST /admin/payments/:id/verify
- POST /admin/payments/:id/reject
- GET /admin/users (with search)
- POST /admin/users/:id/grant-pro
- GET/POST/DELETE /admin/config

All routes protected by AuthGuard + AdminGuard
2025-10-11 14:32:45 +07:00
dwindown
9b789b333f feat: add admin guard and JWT role support
- Create AdminGuard to check user role
- Update JWT strategy to include role in payload
- Update auth service to include role in token generation
- Prepare admin module structure
- TypeScript will resolve lint errors after server restart
2025-10-11 14:15:34 +07:00
dwindown
c3bc181063 feat: add admin dashboard schema and seeder
- Add Plan, Subscription, Payment, PaymentMethod, Coupon models
- Add ApiKey, Webhook models for API access
- Add AppConfig model for dynamic configuration
- Add role, suspendedAt fields to User model
- Create comprehensive seeder with:
  - Admin user (dwindi.ramadhana@gmail.com)
  - Default plans (Free, Pro Monthly, Pro Yearly)
  - Payment methods (BCA, Mandiri, GoPay)
  - App config (maintenance mode)
- Zero data loss migration strategy
2025-10-11 14:06:55 +07:00
dwindown
249f3a9d7d feat: remove OTP gate from transactions, fix categories auth, add implementation plan
- Remove OtpGateGuard from transactions controller (OTP verified at login)
- Fix categories controller to use authenticated user instead of TEMP_USER_ID
- Add comprehensive implementation plan document
- Update .env.example with WEB_APP_URL
- Prepare for admin dashboard development
2025-10-11 14:00:11 +07:00
dwindown
0da6071eb3 first commit 2025-10-09 12:52:41 +07:00