Commit Graph

7 Commits

Author SHA1 Message Date
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