-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
91 lines (87 loc) · 2.01 KB
/
types.ts
File metadata and controls
91 lines (87 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Notification interface
export interface Notification {
_id: string;
user: string;
title: string;
message: string;
type: 'membership_expiry' | 'payment_success' | 'payment_failed' | 'membership_activated' | 'promotion' | 'general';
priority?: 'low' | 'medium' | 'high' | 'urgent';
isRead: boolean;
createdAt: string;
updatedAt: string;
}
export interface MembershipPackage {
_id: string;
name: string;
description: string;
durationMonths: number;
price: number;
features: string[];
isActive: boolean;
category: 'basic' | 'premium' | 'vip' | 'custom';
maxMembers?: number;
currentMembers: number;
discount?: number;
createdBy: string;
createdAt: string;
updatedAt: string;
discountedPrice?: number;
isAvailable?: boolean;
}
export interface Payment {
_id: string;
user: string | any;
package: string | MembershipPackage;
orderId: string;
merchantId: string;
amount: number;
currency: string;
status: 'pending' | 'success' | 'failed' | 'cancelled' | 'refunded';
paymentMethod: string;
payHerePaymentId?: string;
payHereStatusCode?: string;
payHereCardHolderName?: string;
payHereCardNo?: string;
statusMessage?: string;
membershipStartDate?: string;
membershipEndDate?: string;
metadata: {
ipAddress?: string;
userAgent?: string;
rawResponse?: any;
};
refundAmount?: number;
refundReason?: string;
refundedAt?: string;
createdAt: string;
updatedAt: string;
}
export interface ApiResponse<T = any> {
success: boolean;
message?: string;
data?: T;
error?: string;
}
export interface PaymentInitiateResponse {
orderId: string;
paymentData: {
merchant_id: string;
return_url: string;
cancel_url: string;
notify_url: string;
order_id: string;
items: string;
currency: string;
amount: number;
first_name: string;
last_name: string;
email: string;
phone: string;
address: string;
city: string;
country: string;
hash: string;
sandbox?: boolean;
[key: string]: any;
};
}