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
This commit is contained in:
dwindown
2025-10-11 14:37:18 +07:00
parent 12850ab12d
commit 1c28e51b53
13 changed files with 464 additions and 224 deletions

240
ADMIN_BACKEND_COMPLETE.md Normal file
View File

@@ -0,0 +1,240 @@
# ✅ ADMIN BACKEND COMPLETE
**Date:** 2025-01-11
**Status:** Backend Complete - Frontend Pending
---
## 🎉 COMPLETED
### **1. Database Schema** ✅
- 10+ new models added
- Zero data loss migration
- All fields properly indexed
### **2. Admin Seeder** ✅
- Admin account: `dwindi.ramadhana@gmail.com`
- 3 default plans (Free, Pro Monthly, Pro Yearly)
- 3 payment methods (BCA, Mandiri, GoPay)
- Can run multiple times safely
### **3. Authentication** ✅
- AdminGuard checks role = "admin"
- JWT includes role in payload
- Auth service generates tokens with role
### **4. Admin Controllers** ✅
#### **Plans Management**
```
GET /admin/plans - List all plans
GET /admin/plans/:id - Get plan details
POST /admin/plans - Create plan
PUT /admin/plans/:id - Update plan
DELETE /admin/plans/:id - Soft delete plan
POST /admin/plans/reorder - Reorder plans
```
#### **Payment Methods**
```
GET /admin/payment-methods - List all methods
GET /admin/payment-methods/:id - Get method details
POST /admin/payment-methods - Create method
PUT /admin/payment-methods/:id - Update method
DELETE /admin/payment-methods/:id - Delete method
POST /admin/payment-methods/reorder - Reorder methods
```
#### **Payment Verification**
```
GET /admin/payments - List payments (filter by status)
GET /admin/payments/pending/count - Count pending payments
GET /admin/payments/:id - Get payment details
POST /admin/payments/:id/verify - Verify payment (activate subscription)
POST /admin/payments/:id/reject - Reject payment
```
#### **User Management**
```
GET /admin/users - List users (with search)
GET /admin/users/stats - Get user statistics
GET /admin/users/:id - Get user details
PUT /admin/users/:id/role - Change user role
POST /admin/users/:id/suspend - Suspend user
POST /admin/users/:id/unsuspend - Unsuspend user
POST /admin/users/:id/grant-pro - Manually grant Pro access
```
#### **App Configuration**
```
GET /admin/config - List all configs (filter by category)
GET /admin/config/by-category - Get configs grouped by category
GET /admin/config/:key - Get specific config
POST /admin/config/:key - Create/update config
DELETE /admin/config/:key - Delete config
```
---
## 🔐 SECURITY
All admin routes are protected by:
1. **AuthGuard** - Requires valid JWT token
2. **AdminGuard** - Requires role = "admin"
Example request:
```bash
curl -X GET http://localhost:3001/admin/plans \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
```
---
## 📊 FEATURES
### **Plans Management**
- ✅ Dynamic plans (no hardcoded values)
- ✅ Create/edit/delete plans
- ✅ Set pricing & features
- ✅ Toggle visibility
- ✅ Reorder display
- ✅ Track subscriptions per plan
### **Payment Methods**
- ✅ Add bank accounts with logos
- ✅ Add e-wallets with logos
- ✅ Set custom instructions
- ✅ Toggle active/inactive
- ✅ Reorder display
### **Payment Verification**
- ✅ View pending payments
- ✅ Review proof images
- ✅ Approve payments (auto-activate subscription)
- ✅ Reject payments with reason
- ✅ Track verification history
### **User Management**
- ✅ Search users by email/name
- ✅ View user details & stats
- ✅ Change user role
- ✅ Suspend/unsuspend users
- ✅ Manually grant Pro access
- ✅ View user statistics
### **App Configuration**
- ✅ Dynamic config (no .env restart needed)
- ✅ Grouped by category
- ✅ Support for secrets (encrypted)
- ✅ Audit trail (who changed what)
---
## 🧪 TESTING
### **Test Admin Login**
```bash
# 1. Login as admin
curl -X POST http://localhost:3001/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "dwindi.ramadhana@gmail.com",
"password": "tabungin2k25!@#"
}'
# Response will include JWT token
```
### **Test Admin Endpoints**
```bash
# 2. Get all plans
curl -X GET http://localhost:3001/admin/plans \
-H "Authorization: Bearer YOUR_TOKEN"
# 3. Get all users
curl -X GET http://localhost:3001/admin/users \
-H "Authorization: Bearer YOUR_TOKEN"
# 4. Get pending payments
curl -X GET http://localhost:3001/admin/payments?status=pending \
-H "Authorization: Bearer YOUR_TOKEN"
```
---
## 📝 NEXT STEPS
### **Frontend (3-4 hours)**
1. Admin layout with sidebar
2. Plans management UI
3. Payment methods UI
4. Payment verification UI
5. Users management UI
6. App settings UI
### **Testing (1 hour)**
1. Test all CRUD operations
2. Test payment verification flow
3. Test user management
4. Test config management
---
## 🚀 DEPLOYMENT NOTES
### **Environment Variables**
No changes needed. All operational config can be managed via admin dashboard.
### **Database**
Migration already applied. No manual SQL needed.
### **API Server**
Just restart the API server to load new routes:
```bash
cd apps/api
npm run start:dev
```
---
## 📚 DOCUMENTATION
### **Admin Credentials**
- Email: `dwindi.ramadhana@gmail.com`
- Password: `tabungin2k25!@#`
- **⚠️ Change password after first login!**
### **Default Plans**
1. **Free** - Rp 0 (5 wallets, 3 goals)
2. **Pro Monthly** - Rp 49,000 (unlimited)
3. **Pro Yearly** - Rp 490,000 (unlimited, save 17%)
### **Default Payment Methods**
1. **BCA** - 1234567890 (PT Tabungin Indonesia)
2. **Mandiri** - 9876543210 (PT Tabungin Indonesia)
3. **GoPay** - 081234567890 (Dwindi Ramadhana)
---
## ✅ CHECKLIST
- [x] Database schema
- [x] Migrations
- [x] Seeder
- [x] Admin guard
- [x] JWT role support
- [x] Plans controller & service
- [x] Payment methods controller & service
- [x] Payments controller & service
- [x] Users controller & service
- [x] Config controller & service
- [x] Admin module
- [x] Wired into AppModule
- [x] Build successful
- [ ] Frontend UI (NEXT)
- [ ] End-to-end testing
---
**Last Updated:** 2025-01-11
**Next Session:** Build admin frontend UI

View File

@@ -130,15 +130,15 @@ Tabungin is a personal finance SaaS with unique differentiators:
- [ ] Phase 1: Admin Dashboard
- [x] Schema migration ✅
- [x] Seeder ✅
- [ ] Backend (IN PROGRESS)
- [x] Backend
- [x] Admin Guard
- [x] JWT Role Support
- [ ] Plans CRUD
- [ ] Payment Methods CRUD
- [ ] Payments Verification
- [ ] Users Management
- [ ] App Config
- [ ] Frontend
- [x] Plans CRUD
- [x] Payment Methods CRUD
- [x] Payments Verification
- [x] Users Management
- [x] App Config
- [ ] Frontend (NEXT)
**Next:**
- [ ] Phase 2: Team

View File

@@ -8,52 +8,52 @@ export declare class AdminConfigController {
private readonly service;
constructor(service: AdminConfigService);
findAll(category?: string): Promise<{
id: string;
key: string;
value: string;
category: string;
label: string;
description: string | null;
type: string;
isSecret: boolean;
id: string;
updatedAt: Date;
type: string;
value: string;
description: string | null;
key: string;
label: string;
isSecret: boolean;
updatedBy: string | null;
}[]>;
getByCategory(): Promise<Record<string, any[]>>;
findOne(key: string): Promise<{
id: string;
key: string;
value: string;
category: string;
label: string;
description: string | null;
type: string;
isSecret: boolean;
id: string;
updatedAt: Date;
type: string;
value: string;
description: string | null;
key: string;
label: string;
isSecret: boolean;
updatedBy: string | null;
} | null>;
upsert(key: string, data: any, req: RequestWithUser): Promise<{
id: string;
key: string;
value: string;
category: string;
label: string;
description: string | null;
type: string;
isSecret: boolean;
id: string;
updatedAt: Date;
type: string;
value: string;
description: string | null;
key: string;
label: string;
isSecret: boolean;
updatedBy: string | null;
}>;
delete(key: string): Promise<{
id: string;
key: string;
value: string;
category: string;
label: string;
description: string | null;
type: string;
isSecret: boolean;
id: string;
updatedAt: Date;
type: string;
value: string;
description: string | null;
key: string;
label: string;
isSecret: boolean;
updatedBy: string | null;
}>;
}

View File

@@ -3,51 +3,51 @@ export declare class AdminConfigService {
private readonly prisma;
constructor(prisma: PrismaService);
findAll(category?: string): Promise<{
id: string;
key: string;
value: string;
category: string;
label: string;
description: string | null;
type: string;
isSecret: boolean;
id: string;
updatedAt: Date;
type: string;
value: string;
description: string | null;
key: string;
label: string;
isSecret: boolean;
updatedBy: string | null;
}[]>;
findOne(key: string): Promise<{
id: string;
key: string;
value: string;
category: string;
label: string;
description: string | null;
type: string;
isSecret: boolean;
id: string;
updatedAt: Date;
type: string;
value: string;
description: string | null;
key: string;
label: string;
isSecret: boolean;
updatedBy: string | null;
} | null>;
upsert(key: string, data: any, updatedBy: string): Promise<{
id: string;
key: string;
value: string;
category: string;
label: string;
description: string | null;
type: string;
isSecret: boolean;
id: string;
updatedAt: Date;
type: string;
value: string;
description: string | null;
key: string;
label: string;
isSecret: boolean;
updatedBy: string | null;
}>;
delete(key: string): Promise<{
id: string;
key: string;
value: string;
category: string;
label: string;
description: string | null;
type: string;
isSecret: boolean;
id: string;
updatedAt: Date;
type: string;
value: string;
description: string | null;
key: string;
label: string;
isSecret: boolean;
updatedBy: string | null;
}>;
getByCategory(): Promise<Record<string, any[]>>;

View File

@@ -4,73 +4,73 @@ export declare class AdminPaymentMethodsController {
constructor(service: AdminPaymentMethodsService);
findAll(): Promise<{
id: string;
type: string;
createdAt: Date;
updatedAt: Date;
provider: string;
type: string;
sortOrder: number;
isActive: boolean;
accountName: string;
accountNumber: string;
displayName: string;
logoUrl: string | null;
instructions: string | null;
isActive: boolean;
sortOrder: number;
createdAt: Date;
updatedAt: Date;
}[]>;
findOne(id: string): Promise<{
id: string;
type: string;
createdAt: Date;
updatedAt: Date;
provider: string;
type: string;
sortOrder: number;
isActive: boolean;
accountName: string;
accountNumber: string;
displayName: string;
logoUrl: string | null;
instructions: string | null;
isActive: boolean;
sortOrder: number;
createdAt: Date;
updatedAt: Date;
} | null>;
create(data: any): Promise<{
id: string;
type: string;
createdAt: Date;
updatedAt: Date;
provider: string;
type: string;
sortOrder: number;
isActive: boolean;
accountName: string;
accountNumber: string;
displayName: string;
logoUrl: string | null;
instructions: string | null;
isActive: boolean;
sortOrder: number;
createdAt: Date;
updatedAt: Date;
}>;
update(id: string, data: any): Promise<{
id: string;
type: string;
createdAt: Date;
updatedAt: Date;
provider: string;
type: string;
sortOrder: number;
isActive: boolean;
accountName: string;
accountNumber: string;
displayName: string;
logoUrl: string | null;
instructions: string | null;
isActive: boolean;
sortOrder: number;
createdAt: Date;
updatedAt: Date;
}>;
delete(id: string): Promise<{
id: string;
type: string;
createdAt: Date;
updatedAt: Date;
provider: string;
type: string;
sortOrder: number;
isActive: boolean;
accountName: string;
accountNumber: string;
displayName: string;
logoUrl: string | null;
instructions: string | null;
isActive: boolean;
sortOrder: number;
createdAt: Date;
updatedAt: Date;
}>;
reorder(body: {
methodIds: string[];

View File

@@ -4,73 +4,73 @@ export declare class AdminPaymentMethodsService {
constructor(prisma: PrismaService);
findAll(): Promise<{
id: string;
type: string;
createdAt: Date;
updatedAt: Date;
provider: string;
type: string;
sortOrder: number;
isActive: boolean;
accountName: string;
accountNumber: string;
displayName: string;
logoUrl: string | null;
instructions: string | null;
isActive: boolean;
sortOrder: number;
createdAt: Date;
updatedAt: Date;
}[]>;
findOne(id: string): Promise<{
id: string;
type: string;
createdAt: Date;
updatedAt: Date;
provider: string;
type: string;
sortOrder: number;
isActive: boolean;
accountName: string;
accountNumber: string;
displayName: string;
logoUrl: string | null;
instructions: string | null;
isActive: boolean;
sortOrder: number;
createdAt: Date;
updatedAt: Date;
} | null>;
create(data: any): Promise<{
id: string;
type: string;
createdAt: Date;
updatedAt: Date;
provider: string;
type: string;
sortOrder: number;
isActive: boolean;
accountName: string;
accountNumber: string;
displayName: string;
logoUrl: string | null;
instructions: string | null;
isActive: boolean;
sortOrder: number;
createdAt: Date;
updatedAt: Date;
}>;
update(id: string, data: any): Promise<{
id: string;
type: string;
createdAt: Date;
updatedAt: Date;
provider: string;
type: string;
sortOrder: number;
isActive: boolean;
accountName: string;
accountNumber: string;
displayName: string;
logoUrl: string | null;
instructions: string | null;
isActive: boolean;
sortOrder: number;
createdAt: Date;
updatedAt: Date;
}>;
delete(id: string): Promise<{
id: string;
type: string;
createdAt: Date;
updatedAt: Date;
provider: string;
type: string;
sortOrder: number;
isActive: boolean;
accountName: string;
accountNumber: string;
displayName: string;
logoUrl: string | null;
instructions: string | null;
isActive: boolean;
sortOrder: number;
createdAt: Date;
updatedAt: Date;
}>;
reorder(methodIds: string[]): Promise<{
success: boolean;

View File

@@ -16,10 +16,10 @@ export declare class AdminPaymentsController {
subscription: ({
plan: {
id: string;
currency: string;
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
@@ -42,10 +42,10 @@ export declare class AdminPaymentsController {
};
} & {
id: string;
userId: string;
status: string;
createdAt: Date;
updatedAt: Date;
status: string;
userId: string;
planId: string;
startDate: Date;
endDate: Date;
@@ -56,19 +56,21 @@ export declare class AdminPaymentsController {
}) | null;
} & {
id: string;
createdAt: Date;
updatedAt: Date;
status: string;
method: string;
userId: string;
currency: string;
amount: import("@prisma/client/runtime/library").Decimal;
subscriptionId: string | null;
invoiceNumber: string;
amount: import("@prisma/client/runtime/library").Decimal;
currency: string;
method: string;
tripayReference: string | null;
tripayFee: import("@prisma/client/runtime/library").Decimal | null;
totalAmount: import("@prisma/client/runtime/library").Decimal;
paymentChannel: string | null;
paymentUrl: string | null;
qrUrl: string | null;
status: string;
proofImageUrl: string | null;
transferDate: Date | null;
verifiedBy: string | null;
@@ -79,8 +81,6 @@ export declare class AdminPaymentsController {
notes: string | null;
expiresAt: Date | null;
paidAt: Date | null;
createdAt: Date;
updatedAt: Date;
})[]>;
getPendingCount(): Promise<number>;
findOne(id: string): Promise<({
@@ -92,10 +92,10 @@ export declare class AdminPaymentsController {
subscription: ({
plan: {
id: string;
currency: string;
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
@@ -118,10 +118,10 @@ export declare class AdminPaymentsController {
};
} & {
id: string;
userId: string;
status: string;
createdAt: Date;
updatedAt: Date;
status: string;
userId: string;
planId: string;
startDate: Date;
endDate: Date;
@@ -132,19 +132,21 @@ export declare class AdminPaymentsController {
}) | null;
} & {
id: string;
createdAt: Date;
updatedAt: Date;
status: string;
method: string;
userId: string;
currency: string;
amount: import("@prisma/client/runtime/library").Decimal;
subscriptionId: string | null;
invoiceNumber: string;
amount: import("@prisma/client/runtime/library").Decimal;
currency: string;
method: string;
tripayReference: string | null;
tripayFee: import("@prisma/client/runtime/library").Decimal | null;
totalAmount: import("@prisma/client/runtime/library").Decimal;
paymentChannel: string | null;
paymentUrl: string | null;
qrUrl: string | null;
status: string;
proofImageUrl: string | null;
transferDate: Date | null;
verifiedBy: string | null;
@@ -155,24 +157,24 @@ export declare class AdminPaymentsController {
notes: string | null;
expiresAt: Date | null;
paidAt: Date | null;
createdAt: Date;
updatedAt: Date;
}) | null>;
verify(id: string, req: RequestWithUser): Promise<{
id: string;
createdAt: Date;
updatedAt: Date;
status: string;
method: string;
userId: string;
currency: string;
amount: import("@prisma/client/runtime/library").Decimal;
subscriptionId: string | null;
invoiceNumber: string;
amount: import("@prisma/client/runtime/library").Decimal;
currency: string;
method: string;
tripayReference: string | null;
tripayFee: import("@prisma/client/runtime/library").Decimal | null;
totalAmount: import("@prisma/client/runtime/library").Decimal;
paymentChannel: string | null;
paymentUrl: string | null;
qrUrl: string | null;
status: string;
proofImageUrl: string | null;
transferDate: Date | null;
verifiedBy: string | null;
@@ -183,26 +185,26 @@ export declare class AdminPaymentsController {
notes: string | null;
expiresAt: Date | null;
paidAt: Date | null;
createdAt: Date;
updatedAt: Date;
}>;
reject(id: string, req: RequestWithUser, body: {
reason: string;
}): Promise<{
id: string;
createdAt: Date;
updatedAt: Date;
status: string;
method: string;
userId: string;
currency: string;
amount: import("@prisma/client/runtime/library").Decimal;
subscriptionId: string | null;
invoiceNumber: string;
amount: import("@prisma/client/runtime/library").Decimal;
currency: string;
method: string;
tripayReference: string | null;
tripayFee: import("@prisma/client/runtime/library").Decimal | null;
totalAmount: import("@prisma/client/runtime/library").Decimal;
paymentChannel: string | null;
paymentUrl: string | null;
qrUrl: string | null;
status: string;
proofImageUrl: string | null;
transferDate: Date | null;
verifiedBy: string | null;
@@ -213,8 +215,6 @@ export declare class AdminPaymentsController {
notes: string | null;
expiresAt: Date | null;
paidAt: Date | null;
createdAt: Date;
updatedAt: Date;
}>;
}
export {};

View File

@@ -11,10 +11,10 @@ export declare class AdminPaymentsService {
subscription: ({
plan: {
id: string;
currency: string;
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
@@ -37,10 +37,10 @@ export declare class AdminPaymentsService {
};
} & {
id: string;
userId: string;
status: string;
createdAt: Date;
updatedAt: Date;
status: string;
userId: string;
planId: string;
startDate: Date;
endDate: Date;
@@ -51,19 +51,21 @@ export declare class AdminPaymentsService {
}) | null;
} & {
id: string;
createdAt: Date;
updatedAt: Date;
status: string;
method: string;
userId: string;
currency: string;
amount: import("@prisma/client/runtime/library").Decimal;
subscriptionId: string | null;
invoiceNumber: string;
amount: import("@prisma/client/runtime/library").Decimal;
currency: string;
method: string;
tripayReference: string | null;
tripayFee: import("@prisma/client/runtime/library").Decimal | null;
totalAmount: import("@prisma/client/runtime/library").Decimal;
paymentChannel: string | null;
paymentUrl: string | null;
qrUrl: string | null;
status: string;
proofImageUrl: string | null;
transferDate: Date | null;
verifiedBy: string | null;
@@ -74,8 +76,6 @@ export declare class AdminPaymentsService {
notes: string | null;
expiresAt: Date | null;
paidAt: Date | null;
createdAt: Date;
updatedAt: Date;
})[]>;
findOne(id: string): Promise<({
user: {
@@ -86,10 +86,10 @@ export declare class AdminPaymentsService {
subscription: ({
plan: {
id: string;
currency: string;
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
@@ -112,10 +112,10 @@ export declare class AdminPaymentsService {
};
} & {
id: string;
userId: string;
status: string;
createdAt: Date;
updatedAt: Date;
status: string;
userId: string;
planId: string;
startDate: Date;
endDate: Date;
@@ -126,19 +126,21 @@ export declare class AdminPaymentsService {
}) | null;
} & {
id: string;
createdAt: Date;
updatedAt: Date;
status: string;
method: string;
userId: string;
currency: string;
amount: import("@prisma/client/runtime/library").Decimal;
subscriptionId: string | null;
invoiceNumber: string;
amount: import("@prisma/client/runtime/library").Decimal;
currency: string;
method: string;
tripayReference: string | null;
tripayFee: import("@prisma/client/runtime/library").Decimal | null;
totalAmount: import("@prisma/client/runtime/library").Decimal;
paymentChannel: string | null;
paymentUrl: string | null;
qrUrl: string | null;
status: string;
proofImageUrl: string | null;
transferDate: Date | null;
verifiedBy: string | null;
@@ -149,24 +151,24 @@ export declare class AdminPaymentsService {
notes: string | null;
expiresAt: Date | null;
paidAt: Date | null;
createdAt: Date;
updatedAt: Date;
}) | null>;
verify(id: string, adminUserId: string): Promise<{
id: string;
createdAt: Date;
updatedAt: Date;
status: string;
method: string;
userId: string;
currency: string;
amount: import("@prisma/client/runtime/library").Decimal;
subscriptionId: string | null;
invoiceNumber: string;
amount: import("@prisma/client/runtime/library").Decimal;
currency: string;
method: string;
tripayReference: string | null;
tripayFee: import("@prisma/client/runtime/library").Decimal | null;
totalAmount: import("@prisma/client/runtime/library").Decimal;
paymentChannel: string | null;
paymentUrl: string | null;
qrUrl: string | null;
status: string;
proofImageUrl: string | null;
transferDate: Date | null;
verifiedBy: string | null;
@@ -177,24 +179,24 @@ export declare class AdminPaymentsService {
notes: string | null;
expiresAt: Date | null;
paidAt: Date | null;
createdAt: Date;
updatedAt: Date;
}>;
reject(id: string, adminUserId: string, reason: string): Promise<{
id: string;
createdAt: Date;
updatedAt: Date;
status: string;
method: string;
userId: string;
currency: string;
amount: import("@prisma/client/runtime/library").Decimal;
subscriptionId: string | null;
invoiceNumber: string;
amount: import("@prisma/client/runtime/library").Decimal;
currency: string;
method: string;
tripayReference: string | null;
tripayFee: import("@prisma/client/runtime/library").Decimal | null;
totalAmount: import("@prisma/client/runtime/library").Decimal;
paymentChannel: string | null;
paymentUrl: string | null;
qrUrl: string | null;
status: string;
proofImageUrl: string | null;
transferDate: Date | null;
verifiedBy: string | null;
@@ -205,8 +207,6 @@ export declare class AdminPaymentsService {
notes: string | null;
expiresAt: Date | null;
paidAt: Date | null;
createdAt: Date;
updatedAt: Date;
}>;
getPendingCount(): Promise<number>;
}

View File

@@ -8,11 +8,13 @@ export declare class AdminPlansController {
};
} & {
id: string;
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
currency: string;
durationType: string;
durationDays: number | null;
trialDays: number;
@@ -29,8 +31,6 @@ export declare class AdminPlansController {
maxTeamMembers: number | null;
apiEnabled: boolean;
apiRateLimit: number | null;
createdAt: Date;
updatedAt: Date;
})[]>;
findOne(id: string): Promise<({
_count: {
@@ -38,11 +38,13 @@ export declare class AdminPlansController {
};
} & {
id: string;
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
currency: string;
durationType: string;
durationDays: number | null;
trialDays: number;
@@ -59,16 +61,16 @@ export declare class AdminPlansController {
maxTeamMembers: number | null;
apiEnabled: boolean;
apiRateLimit: number | null;
createdAt: Date;
updatedAt: Date;
}) | null>;
create(data: any): Promise<{
id: string;
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
currency: string;
durationType: string;
durationDays: number | null;
trialDays: number;
@@ -85,16 +87,16 @@ export declare class AdminPlansController {
maxTeamMembers: number | null;
apiEnabled: boolean;
apiRateLimit: number | null;
createdAt: Date;
updatedAt: Date;
}>;
update(id: string, data: any): Promise<{
id: string;
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
currency: string;
durationType: string;
durationDays: number | null;
trialDays: number;
@@ -111,16 +113,16 @@ export declare class AdminPlansController {
maxTeamMembers: number | null;
apiEnabled: boolean;
apiRateLimit: number | null;
createdAt: Date;
updatedAt: Date;
}>;
delete(id: string): Promise<{
id: string;
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
currency: string;
durationType: string;
durationDays: number | null;
trialDays: number;
@@ -137,8 +139,6 @@ export declare class AdminPlansController {
maxTeamMembers: number | null;
apiEnabled: boolean;
apiRateLimit: number | null;
createdAt: Date;
updatedAt: Date;
}>;
reorder(body: {
planIds: string[];

View File

@@ -8,11 +8,13 @@ export declare class AdminPlansService {
};
} & {
id: string;
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
currency: string;
durationType: string;
durationDays: number | null;
trialDays: number;
@@ -29,8 +31,6 @@ export declare class AdminPlansService {
maxTeamMembers: number | null;
apiEnabled: boolean;
apiRateLimit: number | null;
createdAt: Date;
updatedAt: Date;
})[]>;
findOne(id: string): Promise<({
_count: {
@@ -38,11 +38,13 @@ export declare class AdminPlansService {
};
} & {
id: string;
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
currency: string;
durationType: string;
durationDays: number | null;
trialDays: number;
@@ -59,16 +61,16 @@ export declare class AdminPlansService {
maxTeamMembers: number | null;
apiEnabled: boolean;
apiRateLimit: number | null;
createdAt: Date;
updatedAt: Date;
}) | null>;
create(data: any): Promise<{
id: string;
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
currency: string;
durationType: string;
durationDays: number | null;
trialDays: number;
@@ -85,16 +87,16 @@ export declare class AdminPlansService {
maxTeamMembers: number | null;
apiEnabled: boolean;
apiRateLimit: number | null;
createdAt: Date;
updatedAt: Date;
}>;
update(id: string, data: any): Promise<{
id: string;
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
currency: string;
durationType: string;
durationDays: number | null;
trialDays: number;
@@ -111,16 +113,16 @@ export declare class AdminPlansService {
maxTeamMembers: number | null;
apiEnabled: boolean;
apiRateLimit: number | null;
createdAt: Date;
updatedAt: Date;
}>;
delete(id: string): Promise<{
id: string;
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
currency: string;
durationType: string;
durationDays: number | null;
trialDays: number;
@@ -137,8 +139,6 @@ export declare class AdminPlansService {
maxTeamMembers: number | null;
apiEnabled: boolean;
apiRateLimit: number | null;
createdAt: Date;
updatedAt: Date;
}>;
reorder(planIds: string[]): Promise<{
success: boolean;

View File

@@ -4,8 +4,8 @@ export declare class AdminUsersController {
constructor(service: AdminUsersService);
findAll(search?: string): Promise<{
id: string;
createdAt: Date;
email: string;
createdAt: Date;
emailVerified: boolean;
name: string | null;
role: string;
@@ -28,10 +28,10 @@ export declare class AdminUsersController {
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
currency: string;
durationType: string;
durationDays: number | null;
trialDays: number;
@@ -70,15 +70,15 @@ export declare class AdminUsersController {
};
} & {
id: string;
email: string;
phone: string | null;
createdAt: Date;
updatedAt: Date;
status: string;
email: string;
emailVerified: boolean;
passwordHash: string | null;
name: string | null;
avatarUrl: string | null;
phone: string | null;
defaultCurrency: string | null;
timeZone: string | null;
otpEmailEnabled: boolean;
@@ -94,15 +94,15 @@ export declare class AdminUsersController {
role: string;
}): Promise<{
id: string;
email: string;
phone: string | null;
createdAt: Date;
updatedAt: Date;
status: string;
email: string;
emailVerified: boolean;
passwordHash: string | null;
name: string | null;
avatarUrl: string | null;
phone: string | null;
defaultCurrency: string | null;
timeZone: string | null;
otpEmailEnabled: boolean;
@@ -118,15 +118,15 @@ export declare class AdminUsersController {
reason: string;
}): Promise<{
id: string;
email: string;
phone: string | null;
createdAt: Date;
updatedAt: Date;
status: string;
email: string;
emailVerified: boolean;
passwordHash: string | null;
name: string | null;
avatarUrl: string | null;
phone: string | null;
defaultCurrency: string | null;
timeZone: string | null;
otpEmailEnabled: boolean;
@@ -140,15 +140,15 @@ export declare class AdminUsersController {
}>;
unsuspend(id: string): Promise<{
id: string;
email: string;
phone: string | null;
createdAt: Date;
updatedAt: Date;
status: string;
email: string;
emailVerified: boolean;
passwordHash: string | null;
name: string | null;
avatarUrl: string | null;
phone: string | null;
defaultCurrency: string | null;
timeZone: string | null;
otpEmailEnabled: boolean;

View File

@@ -4,8 +4,8 @@ export declare class AdminUsersService {
constructor(prisma: PrismaService);
findAll(search?: string): Promise<{
id: string;
createdAt: Date;
email: string;
createdAt: Date;
emailVerified: boolean;
name: string | null;
role: string;
@@ -23,10 +23,10 @@ export declare class AdminUsersService {
createdAt: Date;
updatedAt: Date;
name: string;
currency: string;
slug: string;
description: string | null;
price: import("@prisma/client/runtime/library").Decimal;
currency: string;
durationType: string;
durationDays: number | null;
trialDays: number;
@@ -65,15 +65,15 @@ export declare class AdminUsersService {
};
} & {
id: string;
email: string;
phone: string | null;
createdAt: Date;
updatedAt: Date;
status: string;
email: string;
emailVerified: boolean;
passwordHash: string | null;
name: string | null;
avatarUrl: string | null;
phone: string | null;
defaultCurrency: string | null;
timeZone: string | null;
otpEmailEnabled: boolean;
@@ -87,15 +87,15 @@ export declare class AdminUsersService {
}) | null>;
updateRole(id: string, role: string): Promise<{
id: string;
email: string;
phone: string | null;
createdAt: Date;
updatedAt: Date;
status: string;
email: string;
emailVerified: boolean;
passwordHash: string | null;
name: string | null;
avatarUrl: string | null;
phone: string | null;
defaultCurrency: string | null;
timeZone: string | null;
otpEmailEnabled: boolean;
@@ -109,15 +109,15 @@ export declare class AdminUsersService {
}>;
suspend(id: string, reason: string): Promise<{
id: string;
email: string;
phone: string | null;
createdAt: Date;
updatedAt: Date;
status: string;
email: string;
emailVerified: boolean;
passwordHash: string | null;
name: string | null;
avatarUrl: string | null;
phone: string | null;
defaultCurrency: string | null;
timeZone: string | null;
otpEmailEnabled: boolean;
@@ -131,15 +131,15 @@ export declare class AdminUsersService {
}>;
unsuspend(id: string): Promise<{
id: string;
email: string;
phone: string | null;
createdAt: Date;
updatedAt: Date;
status: string;
email: string;
emailVerified: boolean;
passwordHash: string | null;
name: string | null;
avatarUrl: string | null;
phone: string | null;
defaultCurrency: string | null;
timeZone: string | null;
otpEmailEnabled: boolean;

File diff suppressed because one or more lines are too long