@mcdylanproperenterprise/nodejs-proper-money-types 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/enum.ts +75 -0
- package/exchangeRate.ts +6 -0
- package/lists/country.ts +408 -0
- package/lists/currency.ts +176 -0
- package/lists/language.ts +5 -0
- package/middleware.ts +8 -0
- package/mission.ts +34 -0
- package/package.json +12 -0
- package/point.ts +30 -0
- package/reward.ts +56 -0
- package/topup.ts +19 -0
- package/transaction.ts +99 -0
- package/transactionCategory.ts +45 -0
- package/transactionLabel.ts +29 -0
- package/user.ts +174 -0
- package/verification.ts +35 -0
package/enum.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export enum EEnvironmentType {
|
|
2
|
+
PRODUCTION = "PRODUCTION",
|
|
3
|
+
STAGING = "STAGING",
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export enum ESubscriptionEntitlement {
|
|
7
|
+
starter = "Starter",
|
|
8
|
+
plus = "Plus",
|
|
9
|
+
premium = "Premium",
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export enum EUserGetInfoResponseErrorMessage {
|
|
13
|
+
logged_in_another_devices = "0",
|
|
14
|
+
google_token_revoked = "1",
|
|
15
|
+
apple_token_revoked = "2",
|
|
16
|
+
facebook_token_revoked = "3",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export enum ETransactionCategoryType {
|
|
20
|
+
income = 0,
|
|
21
|
+
expense = 1,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export enum EMissionType {
|
|
25
|
+
dailyCheckIn = 0,
|
|
26
|
+
weeklyCheckIn = 1,
|
|
27
|
+
daiyAddIncomeOrExpense = 2,
|
|
28
|
+
weeklyAddIncomeOrExpense = 3,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export enum EPointType {
|
|
32
|
+
add = 0,
|
|
33
|
+
deduct = 1,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export enum EPointFromType {
|
|
37
|
+
mission = 0,
|
|
38
|
+
weekly_winner_touch_and_go = 1,
|
|
39
|
+
reward_item_store = 2,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export enum ERewardType {
|
|
43
|
+
weekly_winner_touch_and_go = 0,
|
|
44
|
+
weekly_winner_touch_and_go_reward_point = 1,
|
|
45
|
+
reward_store_item_touch_and_go_ewallet = 2,
|
|
46
|
+
reward_store_item_touch_and_go_ewallet_check_in_weekly_ticket = 3,
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export enum EVerificationOneTimePasswordType {
|
|
50
|
+
Login = "Login",
|
|
51
|
+
ShareUser = "ShareUser",
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export enum EGetTransactionsByType {
|
|
55
|
+
category = "category",
|
|
56
|
+
label = "label",
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export enum EGetTransactionsBySort {
|
|
60
|
+
recent = "recent",
|
|
61
|
+
highest = "highest",
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export enum EUserSignInMethod {
|
|
65
|
+
anonymous = "anonymous",
|
|
66
|
+
phoneNumber = "phoneNumber",
|
|
67
|
+
email = "email",
|
|
68
|
+
google = "google",
|
|
69
|
+
apple = "apple",
|
|
70
|
+
facebook = "facebook",
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export enum EFirebaseCloudMessagingTopic {
|
|
74
|
+
global = "PROPERMONEY-GLOBAL",
|
|
75
|
+
}
|
package/exchangeRate.ts
ADDED
package/lists/country.ts
ADDED
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
export type TCountry = {
|
|
2
|
+
name: string;
|
|
3
|
+
flagIcon: string;
|
|
4
|
+
countryCode: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const countryList: TCountry[] = [
|
|
8
|
+
{
|
|
9
|
+
countryCode: "+60",
|
|
10
|
+
name: "Malaysia",
|
|
11
|
+
flagIcon: "🇲🇾",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
countryCode: "+86",
|
|
15
|
+
name: "China",
|
|
16
|
+
flagIcon: "🇨🇳",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
countryCode: "+93",
|
|
20
|
+
name: "Afghanistan",
|
|
21
|
+
flagIcon: "🇦🇫",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
countryCode: "+355",
|
|
25
|
+
name: "Albania",
|
|
26
|
+
flagIcon: "🇦🇱",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
countryCode: "+213",
|
|
30
|
+
name: "Algeria",
|
|
31
|
+
flagIcon: "🇩🇿",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
countryCode: "+1-684",
|
|
35
|
+
name: "American Samoa",
|
|
36
|
+
flagIcon: "🇦🇸",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
countryCode: "+376",
|
|
40
|
+
name: "Andorra",
|
|
41
|
+
flagIcon: "🇦🇩",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
countryCode: "+244",
|
|
45
|
+
name: "Angola",
|
|
46
|
+
flagIcon: "🇦🇴",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
countryCode: "+1-264",
|
|
50
|
+
name: "Anguilla",
|
|
51
|
+
flagIcon: "🇦🇮",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
countryCode: "+672",
|
|
55
|
+
name: "Antarctica",
|
|
56
|
+
flagIcon: "🇦🇶",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
countryCode: "+54",
|
|
60
|
+
name: "Argentina",
|
|
61
|
+
flagIcon: "🇦🇷",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
countryCode: "+374",
|
|
65
|
+
name: "Armenia",
|
|
66
|
+
flagIcon: "🇦🇲",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
countryCode: "+297",
|
|
70
|
+
name: "Aruba",
|
|
71
|
+
flagIcon: "🇦🇼",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
countryCode: "+61",
|
|
75
|
+
name: "Australia",
|
|
76
|
+
flagIcon: "australia",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
countryCode: "+43",
|
|
80
|
+
name: "Austria",
|
|
81
|
+
flagIcon: "🇦🇺",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
countryCode: "+994",
|
|
85
|
+
name: "Azerbaijan",
|
|
86
|
+
flagIcon: "🇦🇿",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
countryCode: "+1-242 ",
|
|
90
|
+
name: "Bahamas",
|
|
91
|
+
flagIcon: "🇧🇸",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
countryCode: "+973",
|
|
95
|
+
name: "Bahrain",
|
|
96
|
+
flagIcon: "🇧ðŸ‡",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
countryCode: "+880",
|
|
100
|
+
name: "Bangladesh",
|
|
101
|
+
flagIcon: "🇧🇩",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
countryCode: "+1-246",
|
|
105
|
+
name: "Barbados",
|
|
106
|
+
flagIcon: "🇧🇧",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
countryCode: "+375",
|
|
110
|
+
name: "Belarus",
|
|
111
|
+
flagIcon: "🇧🇾",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
countryCode: "+32",
|
|
115
|
+
name: "Belgium",
|
|
116
|
+
flagIcon: "🇧🇪",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
countryCode: "+501",
|
|
120
|
+
name: "Belize",
|
|
121
|
+
flagIcon: "🇧🇿",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
countryCode: "+229",
|
|
125
|
+
name: "Benin",
|
|
126
|
+
flagIcon: "🇧🇯",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
countryCode: "+1-441",
|
|
130
|
+
name: "Bermuda",
|
|
131
|
+
flagIcon: "🇧🇯",
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
countryCode: "+975",
|
|
135
|
+
name: "Bhutan",
|
|
136
|
+
flagIcon: "🇧🇲",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
countryCode: "+591",
|
|
140
|
+
name: "Bolivia",
|
|
141
|
+
flagIcon: "🇧🇴",
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
countryCode: "+387",
|
|
145
|
+
name: "Bosnia and Herzegovina",
|
|
146
|
+
flagIcon: "🇧🇦",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
countryCode: "+267",
|
|
150
|
+
name: "Botswana",
|
|
151
|
+
flagIcon: "🇧🇼",
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
countryCode: "+55",
|
|
155
|
+
name: "Brazil",
|
|
156
|
+
flagIcon: "🇧🇷",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
countryCode: "+1-284",
|
|
160
|
+
name: "British Virgin Islands",
|
|
161
|
+
flagIcon: "🇻🇬",
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
countryCode: "+673",
|
|
165
|
+
name: "Brunei",
|
|
166
|
+
flagIcon: "🇧🇳",
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
countryCode: "+359",
|
|
170
|
+
name: "Bulgaria",
|
|
171
|
+
flagIcon: "🇧🇬",
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
countryCode: "+226",
|
|
175
|
+
name: "Burkina Faso",
|
|
176
|
+
flagIcon: "🇧🇫",
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
countryCode: "+257",
|
|
180
|
+
name: "Burundi",
|
|
181
|
+
flagIcon: "🇧🇮",
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
countryCode: "+855",
|
|
185
|
+
name: "Cambodia",
|
|
186
|
+
flagIcon: "🇰ðŸ‡",
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
countryCode: "+237",
|
|
190
|
+
name: "Cameroon",
|
|
191
|
+
flagIcon: "🇨🇲",
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
countryCode: "+1",
|
|
195
|
+
name: "Canada",
|
|
196
|
+
flagIcon: "🇨🇦",
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
countryCode: "+238",
|
|
200
|
+
name: "Cape Verde",
|
|
201
|
+
flagIcon: "🇨🇻",
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
countryCode: "+1-345",
|
|
205
|
+
name: "Cayman Islands",
|
|
206
|
+
flagIcon: "🇰🇾",
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
countryCode: "+236",
|
|
210
|
+
name: "Central African Republic",
|
|
211
|
+
flagIcon: "🇨🇫",
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
countryCode: "+235",
|
|
215
|
+
name: "Chad",
|
|
216
|
+
flagIcon: "🇹🇩",
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
countryCode: "+56",
|
|
220
|
+
name: "Chile",
|
|
221
|
+
flagIcon: "🇨🇱",
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
countryCode: "+61",
|
|
225
|
+
name: "Christmas Island",
|
|
226
|
+
flagIcon: "🇨🇽",
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
countryCode: "+57",
|
|
230
|
+
name: "Colombia",
|
|
231
|
+
flagIcon: "🇨🇴",
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
countryCode: "+269",
|
|
235
|
+
name: "Comoros",
|
|
236
|
+
flagIcon: "🇰🇲",
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
countryCode: "+682",
|
|
240
|
+
name: "Cook Islands",
|
|
241
|
+
flagIcon: "🇨🇰",
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
countryCode: "+506",
|
|
245
|
+
name: "Costa Rica",
|
|
246
|
+
flagIcon: "🇨🇷",
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
countryCode: "+385",
|
|
250
|
+
name: "Croatia",
|
|
251
|
+
flagIcon: "ðŸ‡ðŸ‡·",
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
countryCode: "+53",
|
|
255
|
+
name: "Cuba",
|
|
256
|
+
flagIcon: "🇨🇺",
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
countryCode: "+599",
|
|
260
|
+
name: "Curacao",
|
|
261
|
+
flagIcon: "🇨🇼",
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
countryCode: "+357",
|
|
265
|
+
name: "Cyprus",
|
|
266
|
+
flagIcon: "🇨🇾",
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
countryCode: "+45",
|
|
270
|
+
name: "Denmark",
|
|
271
|
+
flagIcon: "🇩🇰",
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
countryCode: "+253",
|
|
275
|
+
name: "Djibouti",
|
|
276
|
+
flagIcon: "🇩🇯",
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
countryCode: "+1-767",
|
|
280
|
+
name: "Dominica",
|
|
281
|
+
flagIcon: "🇩🇲",
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
countryCode: "+1-809",
|
|
285
|
+
name: "Dominican Republic",
|
|
286
|
+
flagIcon: "🇩🇴",
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
countryCode: "+1-809",
|
|
290
|
+
name: "Dominican Republic",
|
|
291
|
+
flagIcon: "🇩🇴",
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
countryCode: "+1-829",
|
|
295
|
+
name: "Dominican Republic",
|
|
296
|
+
flagIcon: "🇩🇴",
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
countryCode: "+1-849",
|
|
300
|
+
name: "Dominican Republic",
|
|
301
|
+
flagIcon: "🇩🇴",
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
countryCode: "+593",
|
|
305
|
+
name: "Ecuador",
|
|
306
|
+
flagIcon: "🇪🇨",
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
countryCode: "+20",
|
|
310
|
+
name: "Egypt",
|
|
311
|
+
flagIcon: "🇪🇬",
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
countryCode: "+503",
|
|
315
|
+
name: "El Salvador",
|
|
316
|
+
flagIcon: "🇸🇻",
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
countryCode: "+240",
|
|
320
|
+
name: "Equatorial Guinea",
|
|
321
|
+
flagIcon: "🇬🇶",
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
countryCode: "+291",
|
|
325
|
+
name: "Eritrea",
|
|
326
|
+
flagIcon: "🇪🇷",
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
countryCode: "+372",
|
|
330
|
+
name: "Estonia",
|
|
331
|
+
flagIcon: "🇪🇪",
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
countryCode: "+251",
|
|
335
|
+
name: "Ethiopia",
|
|
336
|
+
flagIcon: "🇪🇹",
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
countryCode: "+500",
|
|
340
|
+
name: "Falkland Islands",
|
|
341
|
+
flagIcon: "🇫🇰",
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
countryCode: "+298",
|
|
345
|
+
name: "Faroe Islands",
|
|
346
|
+
flagIcon: "🇫🇴",
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
countryCode: "+679",
|
|
350
|
+
name: "Fiji",
|
|
351
|
+
flagIcon: "🇫🇯",
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
countryCode: "+33",
|
|
355
|
+
name: "Finland",
|
|
356
|
+
flagIcon: "🇫🇮",
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
countryCode: "+689",
|
|
360
|
+
name: "France",
|
|
361
|
+
flagIcon: "🇫🇷",
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
countryCode: "+241",
|
|
365
|
+
name: "French Polynesia",
|
|
366
|
+
flagIcon: "🇵🇫",
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
countryCode: "+220",
|
|
370
|
+
name: "Gabon",
|
|
371
|
+
flagIcon: "🇬🇦",
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
countryCode: "+995",
|
|
375
|
+
name: "Gambia",
|
|
376
|
+
flagIcon: "🇬🇲",
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
countryCode: "+49",
|
|
380
|
+
name: "Georgia",
|
|
381
|
+
flagIcon: "🇬🇪",
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
countryCode: "+233",
|
|
385
|
+
name: "Germany",
|
|
386
|
+
flagIcon: "🇩🇪",
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
countryCode: "+62",
|
|
390
|
+
name: "Indonesia",
|
|
391
|
+
flagIcon: "🇮🇩",
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
countryCode: "+353",
|
|
395
|
+
name: "Ireland",
|
|
396
|
+
flagIcon: "🇮🇪",
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
countryCode: "+39",
|
|
400
|
+
name: "Italy",
|
|
401
|
+
flagIcon: "🇮🇹",
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
countryCode: "+81",
|
|
405
|
+
name: "Japan",
|
|
406
|
+
flagIcon: "🇯🇵",
|
|
407
|
+
},
|
|
408
|
+
];
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
export const currencyList: {
|
|
2
|
+
name: string;
|
|
3
|
+
iso: string;
|
|
4
|
+
nickname: string;
|
|
5
|
+
}[] = [
|
|
6
|
+
{ name: "Ringgit Malaysia", iso: "MYR", nickname: "RM" },
|
|
7
|
+
{ name: "Singapore Dollar", iso: "SGD", nickname: "SGD" },
|
|
8
|
+
{ name: "Baht", iso: "THB", nickname: "THB" },
|
|
9
|
+
{ name: "Yuan Renminbi", iso: "CNY", nickname: "CNY" },
|
|
10
|
+
{ name: "Hong Kong Dollar", iso: "HKD", nickname: "HKD" },
|
|
11
|
+
{ name: "Indian Rupee", iso: "INR", nickname: "INR" },
|
|
12
|
+
{ name: "Rupiah", iso: "IDR", nickname: "IDR" },
|
|
13
|
+
{ name: "Won", iso: "KRW", nickname: "KRW" },
|
|
14
|
+
{ name: "United States Dollar", iso: "USD", nickname: "USD" },
|
|
15
|
+
{ name: "European Euro", iso: "EUR", nickname: "EUR" },
|
|
16
|
+
{ name: "Australian Dollar", iso: "AUD", nickname: "AUD" },
|
|
17
|
+
{ name: "Norwegian Krone", iso: "NOK", nickname: "NOK" },
|
|
18
|
+
{ name: "Brazilian Real", iso: "BRL", nickname: "BRL" },
|
|
19
|
+
{ name: "Bulgarian Lev", iso: "BGN", nickname: "BGN" },
|
|
20
|
+
{ name: "Canadian Dollar", iso: "CAD", nickname: "CAD" },
|
|
21
|
+
{ name: "New Zealand Dollar", iso: "NZD", nickname: "NZD" },
|
|
22
|
+
{ name: "Czech Koruna", iso: "CZK", nickname: "CZK" },
|
|
23
|
+
{ name: "Danish Krone", iso: "DKK", nickname: "DKK" },
|
|
24
|
+
{ name: "Pound Sterling", iso: "GBP", nickname: "GBP" },
|
|
25
|
+
{ name: "Forint", iso: "HUF", nickname: "HUF" },
|
|
26
|
+
{ name: "Iceland Krona", iso: "ISK", nickname: "ISK" },
|
|
27
|
+
{ name: "New Israeli Sheqel", iso: "ILS", nickname: "ILS" },
|
|
28
|
+
{ name: "Rand", iso: "ZAR", nickname: "ZAR" },
|
|
29
|
+
{ name: "Swiss Franc", iso: "CHF", nickname: "CHF" },
|
|
30
|
+
{ name: "Philippine Peso", iso: "PHP", nickname: "PHP" },
|
|
31
|
+
{ name: "Zloty", iso: "PLN", nickname: "PLN" },
|
|
32
|
+
{ name: "Romanian Leu", iso: "RON", nickname: "RON" },
|
|
33
|
+
{ name: "Swedish Krona", iso: "SEK", nickname: "SEK" },
|
|
34
|
+
{ name: "Turkish Lira", iso: "TRY", nickname: "TRY" },
|
|
35
|
+
// { name: "Saudi Riyal", iso: "SAR", nickname: "SAR" },
|
|
36
|
+
// { name: "Afghani", iso: "AFN", nickname: "AFN" },
|
|
37
|
+
// { name: "Lek", iso: "ALL", nickname: "ALL" },
|
|
38
|
+
// { name: "Algerian Dinar", iso: "DZD", nickname: "DZD" },
|
|
39
|
+
// { name: "Kwanza", iso: "AOA", nickname: "AOA" },
|
|
40
|
+
// { name: "East Caribbean Dollar", iso: "XCD", nickname: "XCD" },
|
|
41
|
+
// { name: "Argentine Peso", iso: "ARS", nickname: "ARS" },
|
|
42
|
+
// { name: "Armenian Dram", iso: "AMD", nickname: "AMD" },
|
|
43
|
+
// { name: "Aruban Florin", iso: "AWG", nickname: "AWG" },
|
|
44
|
+
// { name: "Azerbaijanian Manat", iso: "AZN", nickname: "AZN" },
|
|
45
|
+
// { name: "Bahamian Dollar", iso: "BSD", nickname: "BSD" },
|
|
46
|
+
// { name: "Bahraini Dinar", iso: "BHD", nickname: "BHD" },
|
|
47
|
+
// { name: "Taka", iso: "BHD", nickname: "BHD" },
|
|
48
|
+
// { name: "Barbados Dollar", iso: "BBD", nickname: "BBD" },
|
|
49
|
+
// { name: "Belarussian Ruble", iso: "BYN", nickname: "BYN" },
|
|
50
|
+
// { name: "Belize Dollar", iso: "BYN", nickname: "BYN" },
|
|
51
|
+
// { name: "Bermudian Dollar", iso: "BMD", nickname: "BMD" },
|
|
52
|
+
// { name: "Ngultrum", iso: "BTN", nickname: "BTN" },
|
|
53
|
+
// { name: "Boliviano", iso: "INR", nickname: "INR" },
|
|
54
|
+
// { name: "Mvdol", iso: "BOV", nickname: "BOV" },
|
|
55
|
+
// { name: "Convertible Mark", iso: "BAM", nickname: "BAM" },
|
|
56
|
+
// { name: "Pula", iso: "BWP", nickname: "BWP" },
|
|
57
|
+
// { name: "Brunei Dollar", iso: "BND", nickname: "BND" },
|
|
58
|
+
// { name: "Burundi Franc", iso: "BIF", nickname: "BIF" },
|
|
59
|
+
// { name: "Cabo Verde Escudo", iso: "CVE", nickname: "CVE" },
|
|
60
|
+
// { name: "Riel", iso: "KHR", nickname: "KHR" },
|
|
61
|
+
// { name: "CFA Franc BEAC", iso: "XAF", nickname: "XAF" },
|
|
62
|
+
// { name: "Cayman Islands Dollar", iso: "KYD", nickname: "KYD" },
|
|
63
|
+
// { name: "Unidad de Fomento", iso: "CLF", nickname: "CLF" },
|
|
64
|
+
// { name: "Chilean Peso", iso: "CLP", nickname: "CLP" },
|
|
65
|
+
// { name: "Colombian Peso", iso: "COP", nickname: "COP" },
|
|
66
|
+
// { name: "Unidad de Valor Real", iso: "COU", nickname: "COU" },
|
|
67
|
+
// { name: "Comoro Franc", iso: "KMF", nickname: "KMF" },
|
|
68
|
+
// { name: "Congolese Franc", iso: "CDF", nickname: "CDF" },
|
|
69
|
+
// { name: "Costa Rican Colon", iso: "CRC", nickname: "CRC" },
|
|
70
|
+
// { name: "Kuna", iso: "HRK", nickname: "HRK" },
|
|
71
|
+
// { name: "Peso Convertible", iso: "CUC", nickname: "CUC" },
|
|
72
|
+
// { name: "Cuban Peso", iso: " CUP", nickname: "CUP" },
|
|
73
|
+
// { name: "Netherlands Antillean Guilder", iso: "ANG", nickname: "ANG" },
|
|
74
|
+
// { name: "CFA Franc BCEAO", iso: "XOF", nickname: "XOF" },
|
|
75
|
+
// { name: "Djibouti Franc", iso: "DJF", nickname: "DJF" },
|
|
76
|
+
// { name: "Dominican Peso", iso: "DOP", nickname: "DOP" },
|
|
77
|
+
// { name: "Egyptian Pound", iso: "EGP", nickname: "EGP" },
|
|
78
|
+
// { name: "El Salvador Colon", iso: "SVC", nickname: "SVC" },
|
|
79
|
+
// { name: "Nakfa", iso: "ERN", nickname: "ERN" },
|
|
80
|
+
// { name: "Ethiopian Birr", iso: "ETB", nickname: "ETB" },
|
|
81
|
+
// { name: "Falkland Islands Pound", iso: "FKP", nickname: "FKP" },
|
|
82
|
+
// { name: "Fiji Dollar", iso: "FJD", nickname: "FJD" },
|
|
83
|
+
// { name: "CFP Franc", iso: "XPF", nickname: "XPF" },
|
|
84
|
+
// { name: "Dalasi", iso: "GMD", nickname: "GMD" },
|
|
85
|
+
// { name: "Lari", iso: "GEL", nickname: "GEL" },
|
|
86
|
+
// { name: "Ghana Cedi", iso: "GHS", nickname: "GHS" },
|
|
87
|
+
// { name: "Gibraltar Pound", iso: "GIP", nickname: "GIP" },
|
|
88
|
+
// { name: "Quetzal", iso: "GTQ", nickname: "GTQ" },
|
|
89
|
+
// { name: "Guinea Franc", iso: "GNF", nickname: "GNF" },
|
|
90
|
+
// { name: "Guyana Dollar", iso: "GYD", nickname: "GYD" },
|
|
91
|
+
// { name: "Gourde", iso: "HTG", nickname: "HTG" },
|
|
92
|
+
// { name: "Lempira", iso: "HNL", nickname: "HNL" },
|
|
93
|
+
// { name: "Special Drawing Right", iso: "XDR", nickname: "XDR" },
|
|
94
|
+
// { name: "Iranian Rial", iso: "IRR", nickname: "IRR" },
|
|
95
|
+
// { name: "Iraqi Dinar", iso: "IQD", nickname: "IQD" },
|
|
96
|
+
// { name: "Jamaican Dollar", iso: "JMD", nickname: "JMD" },
|
|
97
|
+
// { name: "Yen", iso: "JPY", nickname: "JPY" }, //
|
|
98
|
+
// { name: "Jordanian Dinar", iso: "JOD", nickname: "JOD" },
|
|
99
|
+
// { name: "Tenge", iso: "KZT", nickname: "KZT" },
|
|
100
|
+
// { name: "Kenyan Shilling", iso: "KES", nickname: "KES" },
|
|
101
|
+
// { name: "North Korean Won", iso: "KPW", nickname: "KPW" },
|
|
102
|
+
// { name: "Kuwaiti Dinar", iso: "KWD", nickname: "KWD" },
|
|
103
|
+
// { name: "Som", iso: "KGS", nickname: "KGS" },
|
|
104
|
+
// { name: "Kip", iso: "LAK", nickname: "LAK" },
|
|
105
|
+
// { name: "Lebanese Pound", iso: "LBP", nickname: "LBP" },
|
|
106
|
+
// { name: "Loti", iso: "LSL", nickname: "LSL" },
|
|
107
|
+
// { name: "Liberian Dollar", iso: "LRD", nickname: "LRD" },
|
|
108
|
+
// { name: "Libyan Dinar", iso: "LYD", nickname: "LYD" },
|
|
109
|
+
// { name: "Pataca", iso: "MOP", nickname: "MOP" },
|
|
110
|
+
// { name: "Malagasy Ariary", iso: "MGA", nickname: "MGA" },
|
|
111
|
+
// { name: "Kwacha", iso: "MWK", nickname: "MWK" },
|
|
112
|
+
// { name: "Rufiyaa", iso: "MVR", nickname: "MVR" },
|
|
113
|
+
// { name: "Ouguiya", iso: "MRU", nickname: "MRU" },
|
|
114
|
+
// { name: "Mauritius Rupee", iso: "MUR", nickname: "MUR" },
|
|
115
|
+
// { name: "ADB Unit of Account", iso: "XUA", nickname: "XUA" },
|
|
116
|
+
// { name: "Mexican Peso", iso: "MXN", nickname: "MXN" }, //
|
|
117
|
+
// { name: "Mexican Unidad de Inversion (UDI)", iso: "MXV", nickname: "MXV" },
|
|
118
|
+
// { name: "Moldovan Leu", iso: "MDL", nickname: "MDL" },
|
|
119
|
+
// { name: "Tugrik", iso: "MNT", nickname: "MNT" },
|
|
120
|
+
// { name: "Moroccan Dirham", iso: "MAD", nickname: "MAD" },
|
|
121
|
+
// { name: "Mozambique Metical", iso: "MZN", nickname: "MZN" },
|
|
122
|
+
// { name: "Kyat", iso: "MMK", nickname: "MMK" },
|
|
123
|
+
// { name: "Namibia Dollar", iso: "NAD", nickname: "NAD" },
|
|
124
|
+
// { name: "Nepalese Rupee", iso: "NPR", nickname: "NPR" },
|
|
125
|
+
// { name: "CFP Franc", iso: "XPF", nickname: "XPF" },
|
|
126
|
+
// { name: "Cordoba Oro", iso: "NIO", nickname: "NIO" },
|
|
127
|
+
// { name: "Naira", iso: "NGN", nickname: "NGN" },
|
|
128
|
+
// { name: "Rial Omani", iso: "OMR", nickname: "OMR" },
|
|
129
|
+
// { name: "Balboa", iso: "PAB", nickname: "PAB" },
|
|
130
|
+
// { name: "Kina", iso: "PGK", nickname: "PGK" },
|
|
131
|
+
// { name: "Guarani", iso: "PYG", nickname: "PYG" },
|
|
132
|
+
// { name: "Nuevo Sol", iso: "PEN", nickname: "PEN" },
|
|
133
|
+
// { name: "Qatari Rial", iso: "QAR", nickname: "QAR" },
|
|
134
|
+
// { name: "Denar", iso: "MKD", nickname: "MKD" },
|
|
135
|
+
// { name: "Russian Ruble", iso: "RUB", nickname: "RUB" },
|
|
136
|
+
// { name: "Rwanda Franc", iso: "RWF", nickname: "RWF" },
|
|
137
|
+
// { name: "Saint Helena Pound", iso: "SHP", nickname: "SHP" },
|
|
138
|
+
// { name: "Tala", iso: "WST", nickname: "WST" },
|
|
139
|
+
// { name: "Dobra", iso: "STN", nickname: "STN" },
|
|
140
|
+
// { name: "Serbian Dinar", iso: "RSD", nickname: "RSD" },
|
|
141
|
+
// { name: "Seychelles Rupee", iso: "SCR", nickname: "SCR" },
|
|
142
|
+
// { name: "Leone", iso: "SLL", nickname: "SLL" },
|
|
143
|
+
// { name: "Sucre", iso: "XSU", nickname: "XSU" },
|
|
144
|
+
// { name: "Solomon Islands Dollar", iso: "SBD", nickname: "SBD" },
|
|
145
|
+
// { name: "Somali Shilling", iso: "SOS", nickname: "SOS" },
|
|
146
|
+
// { name: "South Sudanese Pound", iso: "SSP", nickname: "SSP" },
|
|
147
|
+
// { name: "Sri Lanka Rupee", iso: "LKR", nickname: "LKR" },
|
|
148
|
+
// { name: "Sudanese Pound", iso: "SDG", nickname: "SDG" },
|
|
149
|
+
// { name: "Surinam Dollar", iso: "SRD", nickname: "SRD" },
|
|
150
|
+
// { name: "Lilangeni", iso: "SZL", nickname: "SZL" },
|
|
151
|
+
// { name: "WIR Euro", iso: "CHE", nickname: "CHE" },
|
|
152
|
+
// { name: "Swiss Franc", iso: "CHF", nickname: "CHF" },
|
|
153
|
+
// { name: "WIR Franc", iso: "CHF", nickname: "CHF" },
|
|
154
|
+
// { name: "Syrian Pound", iso: "SYP", nickname: "SYP" },
|
|
155
|
+
// { name: "New Taiwan Dollar", iso: "TWD", nickname: "TWD" },
|
|
156
|
+
// { name: "Somoni", iso: "TJS", nickname: "TJS" },
|
|
157
|
+
// { name: "Tanzanian Shilling", iso: "TZS", nickname: "TZS" },
|
|
158
|
+
// { name: "Pa’anga", iso: "TOP", nickname: "TOP" },
|
|
159
|
+
// { name: "Trinidad and Tobago Dollar", iso: "TTD", nickname: "TTD" },
|
|
160
|
+
// { name: "Tunisian Dinar", iso: "TND", nickname: "TND" },
|
|
161
|
+
// { name: "Turkmenistan New Manat", iso: "TMT", nickname: "TMT" },
|
|
162
|
+
// { name: "Uganda Shilling", iso: "UGX", nickname: "UGX" },
|
|
163
|
+
// { name: "Hryvnia", iso: "UAH", nickname: "UAH" },
|
|
164
|
+
// { name: "UAE Dirham", iso: "AED", nickname: "AED" },
|
|
165
|
+
// { name: "Uruguay Peso en Unidades Indexadas", iso: "UYI", nickname: "UYI" },
|
|
166
|
+
// { name: "Peso Uruguayo", iso: "UYU", nickname: "UYU" },
|
|
167
|
+
// { name: "Uzbekistan Sum", iso: "UZS", nickname: "UZS" },
|
|
168
|
+
// { name: "Vatu", iso: "VUV", nickname: "VUV" },
|
|
169
|
+
// { name: "Bolivar", iso: "VEF", nickname: "VEF" },
|
|
170
|
+
// { name: "Dong", iso: "VND", nickname: "VND" },
|
|
171
|
+
// { name: "CFP Franc", iso: "XPF", nickname: "XPF" },
|
|
172
|
+
// { name: "Moroccan Dirham", iso: "MAD", nickname: "MAD" },
|
|
173
|
+
// { name: "Yemeni Rial", iso: "YER", nickname: "YER" },
|
|
174
|
+
// { name: "Zambian Kwacha", iso: "ZMW", nickname: "ZMW" },
|
|
175
|
+
// { name: "Zimbabwe Dollar", iso: "ZWL", nickname: "ZWL" },
|
|
176
|
+
];
|
package/middleware.ts
ADDED
package/mission.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { EMissionType, ESubscriptionEntitlement } from "./enum";
|
|
2
|
+
|
|
3
|
+
export type TMission = {
|
|
4
|
+
userId?: String;
|
|
5
|
+
type: EMissionType;
|
|
6
|
+
description: string;
|
|
7
|
+
missionCount: {
|
|
8
|
+
completedCount: number;
|
|
9
|
+
totalCount: number;
|
|
10
|
+
};
|
|
11
|
+
point: Number;
|
|
12
|
+
isClaimed: boolean;
|
|
13
|
+
isClaimable: boolean;
|
|
14
|
+
isActive: boolean;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type TMissionGetMissionsQuery = {
|
|
18
|
+
entitlement: ESubscriptionEntitlement;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type TMissionGetMissionsResponse = {
|
|
22
|
+
dailyMissions: {
|
|
23
|
+
missions: TMission[];
|
|
24
|
+
refreshAt: string;
|
|
25
|
+
};
|
|
26
|
+
weeklyMissions: {
|
|
27
|
+
missions: TMission[];
|
|
28
|
+
period: {
|
|
29
|
+
startAt: Date;
|
|
30
|
+
endAt: Date;
|
|
31
|
+
};
|
|
32
|
+
refreshAt: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mcdylanproperenterprise/nodejs-proper-money-types",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "ISC"
|
|
12
|
+
}
|
package/point.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EMissionType,
|
|
3
|
+
EPointFromType,
|
|
4
|
+
EPointType,
|
|
5
|
+
ERewardType,
|
|
6
|
+
ESubscriptionEntitlement,
|
|
7
|
+
} from "./enum";
|
|
8
|
+
|
|
9
|
+
export type TPoint = {
|
|
10
|
+
_id: string;
|
|
11
|
+
userId: string;
|
|
12
|
+
type: EPointType;
|
|
13
|
+
value: number;
|
|
14
|
+
pointFrom: {
|
|
15
|
+
type: EPointFromType;
|
|
16
|
+
id: string | null;
|
|
17
|
+
documentType: ERewardType | EMissionType;
|
|
18
|
+
};
|
|
19
|
+
expiryAt: Date;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type TPointGetTotalPointsResponse = {
|
|
24
|
+
totalPoints: number;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type TPointClaimPointBody = {
|
|
28
|
+
missionType: EMissionType;
|
|
29
|
+
entitlement: ESubscriptionEntitlement;
|
|
30
|
+
};
|
package/reward.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ERewardType } from "./enum";
|
|
2
|
+
|
|
3
|
+
export type TReward = {
|
|
4
|
+
_id: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
type: ERewardType;
|
|
7
|
+
value: number;
|
|
8
|
+
expiryAt: Date;
|
|
9
|
+
isRedeemed: boolean;
|
|
10
|
+
phoneNumber: null | string;
|
|
11
|
+
emailAddress: null | string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type TRewardStoreItem = {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
type: ERewardType;
|
|
18
|
+
price: number;
|
|
19
|
+
refreshAt: string;
|
|
20
|
+
inventoryLeft: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type TRewardGetRewardsQuery = {
|
|
24
|
+
isValid: string;
|
|
25
|
+
page: string;
|
|
26
|
+
limit: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type TRewardGetRewardsResponse = {
|
|
30
|
+
rewards: TReward[];
|
|
31
|
+
pagination: {
|
|
32
|
+
last_visible_page: number;
|
|
33
|
+
has_next_page: boolean;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type TRewardSubmitRedeemFormBody = {
|
|
38
|
+
rewardId: string;
|
|
39
|
+
phoneNumber: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type TRewardClaimRewardPointBody = {
|
|
43
|
+
rewardId: string;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type TRewardGetRewardStoreItemsResponse = {
|
|
47
|
+
rewardStoreItems: TRewardStoreItem[];
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export type TRewardRedeemStoreItemBody = {
|
|
51
|
+
rewardType: ERewardType;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type TRewardRedeemStoreItemResponse = {
|
|
55
|
+
value: string;
|
|
56
|
+
};
|
package/topup.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type TTopUpCreateBillBody = {
|
|
2
|
+
userId: string;
|
|
3
|
+
productId: string;
|
|
4
|
+
description: string;
|
|
5
|
+
name: string;
|
|
6
|
+
email: string;
|
|
7
|
+
amount:string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type TTopUpCreateReferenceBody = {
|
|
11
|
+
userId: string;
|
|
12
|
+
productId: string;
|
|
13
|
+
referenceNo: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type TTopUpEditReferenceBody = {
|
|
17
|
+
iPayEightyEightResponse: Object;
|
|
18
|
+
iPayEightyEightBackend: Object;
|
|
19
|
+
};
|
package/transaction.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { EGetTransactionsBySort, EGetTransactionsByType } from "./enum";
|
|
2
|
+
import { TTransactionCategory } from "./transactionCategory";
|
|
3
|
+
import { TTransactionLabel } from "./transactionLabel";
|
|
4
|
+
|
|
5
|
+
export type TTransaction = {
|
|
6
|
+
_id: string;
|
|
7
|
+
userId: string;
|
|
8
|
+
transactionCategoryId: string;
|
|
9
|
+
transactionLabelIds: string[];
|
|
10
|
+
transactionCategory: TTransactionCategory;
|
|
11
|
+
transactionLabels: TTransactionLabel[] | null;
|
|
12
|
+
currency: string;
|
|
13
|
+
amount: number;
|
|
14
|
+
imagePath: string | null;
|
|
15
|
+
note: string | null;
|
|
16
|
+
isDeleted: boolean;
|
|
17
|
+
transactedAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
createdAt: Date;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type TTimelineTransaction = {
|
|
23
|
+
date: string;
|
|
24
|
+
records: TTransaction[];
|
|
25
|
+
totalIncome: number;
|
|
26
|
+
totalExpense: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type TTransactionGetTransactionsQuery = {
|
|
30
|
+
startTransactedAt: string;
|
|
31
|
+
endTransactedAt: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type TTransactionGetTransactionsResponse = {
|
|
35
|
+
user: {
|
|
36
|
+
transactions: TTransaction[];
|
|
37
|
+
transactionCategories: TTransactionCategory[];
|
|
38
|
+
transactionLabels: TTransactionLabel[];
|
|
39
|
+
timelineTransactions: TTimelineTransaction[];
|
|
40
|
+
};
|
|
41
|
+
sharedUser: {
|
|
42
|
+
transactions: TTransaction[];
|
|
43
|
+
transactionCategories: TTransactionCategory[];
|
|
44
|
+
transactionLabels: TTransactionLabel[];
|
|
45
|
+
timelineTransactions: TTimelineTransaction[];
|
|
46
|
+
};
|
|
47
|
+
total: {
|
|
48
|
+
transactions: TTransaction[];
|
|
49
|
+
transactionCategories: TTransactionCategory[];
|
|
50
|
+
transactionLabels: TTransactionLabel[];
|
|
51
|
+
timelineTransactions: TTimelineTransaction[];
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type TTransactionCreateTransactionBody = {
|
|
56
|
+
transactionCategoryId: string;
|
|
57
|
+
transactionLabelIds: string[];
|
|
58
|
+
currency: string;
|
|
59
|
+
amount: number;
|
|
60
|
+
imagePath: string | null;
|
|
61
|
+
note: string | null;
|
|
62
|
+
transactedAt: Date;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type TTransactionEditTransactionBody = {
|
|
66
|
+
_id: string;
|
|
67
|
+
transactionCategoryId: string;
|
|
68
|
+
transactionLabelIds: string[];
|
|
69
|
+
currency: string;
|
|
70
|
+
amount: number;
|
|
71
|
+
imagePath: string | null;
|
|
72
|
+
note: string | null;
|
|
73
|
+
transactedAt: Date;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type TTransactionDeleteTransactionBody = {
|
|
77
|
+
_id: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type TTransactionGetTransactionsByIdQuery = {
|
|
81
|
+
sort: EGetTransactionsBySort;
|
|
82
|
+
targetUserId: string;
|
|
83
|
+
_id: string;
|
|
84
|
+
type: EGetTransactionsByType;
|
|
85
|
+
page: string;
|
|
86
|
+
limit: string;
|
|
87
|
+
startTransactedAt: string | null;
|
|
88
|
+
endTransactedAt: string | null;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export type TTransactionGetTransactionsByIdResponse = {
|
|
92
|
+
transactions: TTransaction[];
|
|
93
|
+
totalAmount: number;
|
|
94
|
+
totalTransactionsLength: number;
|
|
95
|
+
pagination: {
|
|
96
|
+
last_visible_page: number;
|
|
97
|
+
has_next_page: boolean;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ETransactionCategoryType } from "./enum";
|
|
2
|
+
|
|
3
|
+
export type TTransactionCategory = {
|
|
4
|
+
_id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: ETransactionCategoryType;
|
|
7
|
+
backgroundColor: string;
|
|
8
|
+
imagePath: string;
|
|
9
|
+
userId: string;
|
|
10
|
+
isDeleted: boolean;
|
|
11
|
+
updatedAt: Date;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type TTransactionCategoryGetTransactionCategoryResponse = {
|
|
16
|
+
categories: TTransactionCategory[];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type TTransactionCategoryCreateTransactionCategoryBody = {
|
|
20
|
+
name: string;
|
|
21
|
+
type: ETransactionCategoryType;
|
|
22
|
+
backgroundColor: string;
|
|
23
|
+
imagePath: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type TTransactionCategoryCreateTransactionCategoryResponse = {
|
|
27
|
+
_id: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type TTransactionCategoryEditTransactionCategoryBody = {
|
|
31
|
+
_id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
type: ETransactionCategoryType;
|
|
34
|
+
backgroundColor: string;
|
|
35
|
+
imagePath: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type TTransactionCategoryDeleteTransactionCategoryBody = {
|
|
39
|
+
_id: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type TTransactionCategoryGetTransactionCategoryAssetResponse = {
|
|
43
|
+
icons: string[];
|
|
44
|
+
backgroundColors: string[];
|
|
45
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type TTransactionLabel = {
|
|
2
|
+
_id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
isDeleted: boolean;
|
|
6
|
+
updatedAt: Date;
|
|
7
|
+
createdAt: Date;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type TTransactionLabelGetTransactionLabelResponse = {
|
|
11
|
+
labels: TTransactionLabel[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type TTransactionLabelCreateTransactionLabelBody = {
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type TTransactionLabelCreateTransactionLabelResponse = {
|
|
19
|
+
_id: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type TTransactionLabelEditTransactionLabelBody = {
|
|
23
|
+
_id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type TTransactionLabelDeleteTransactionLabelBody = {
|
|
28
|
+
_id: string;
|
|
29
|
+
};
|
package/user.ts
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { TJwtToken } from "./middleware";
|
|
2
|
+
import {
|
|
3
|
+
ESubscriptionEntitlement,
|
|
4
|
+
EVerificationOneTimePasswordType,
|
|
5
|
+
} from "./enum";
|
|
6
|
+
|
|
7
|
+
export type TMemberFeature = {
|
|
8
|
+
name: ESubscriptionEntitlement;
|
|
9
|
+
maximumCategories: number;
|
|
10
|
+
maximumLabels: number;
|
|
11
|
+
claimPointMultiplier: number;
|
|
12
|
+
isAblePhotoAI: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const memberFeatureFree: TMemberFeature = {
|
|
16
|
+
name: ESubscriptionEntitlement.starter,
|
|
17
|
+
maximumCategories: 5,
|
|
18
|
+
maximumLabels: 10,
|
|
19
|
+
claimPointMultiplier: 1,
|
|
20
|
+
isAblePhotoAI: false,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const memberFeaturePlus: TMemberFeature = {
|
|
24
|
+
name: ESubscriptionEntitlement.plus,
|
|
25
|
+
maximumCategories: 50,
|
|
26
|
+
maximumLabels: 100,
|
|
27
|
+
claimPointMultiplier: 2,
|
|
28
|
+
isAblePhotoAI: false,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const memberFeaturePremium: TMemberFeature = {
|
|
32
|
+
name: ESubscriptionEntitlement.premium,
|
|
33
|
+
maximumCategories: 100,
|
|
34
|
+
maximumLabels: 200,
|
|
35
|
+
claimPointMultiplier: 4,
|
|
36
|
+
isAblePhotoAI: true,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type TSharedUserInfo = {
|
|
40
|
+
_id: string;
|
|
41
|
+
id: string;
|
|
42
|
+
profileImageAsset: TProfileImageAsset;
|
|
43
|
+
emailAddress: string | null;
|
|
44
|
+
phoneNumber: string | null;
|
|
45
|
+
displayName: string;
|
|
46
|
+
notificationToken: string | null;
|
|
47
|
+
} | null;
|
|
48
|
+
|
|
49
|
+
export type TSSOgoogle = {
|
|
50
|
+
userId: String;
|
|
51
|
+
accessToken: String;
|
|
52
|
+
refreshToken: String;
|
|
53
|
+
email: String;
|
|
54
|
+
name: String | null;
|
|
55
|
+
picture: String | null;
|
|
56
|
+
} | null;
|
|
57
|
+
|
|
58
|
+
export type TSSOapple = {
|
|
59
|
+
identityToken: string;
|
|
60
|
+
email: string;
|
|
61
|
+
userId: string;
|
|
62
|
+
accessToken: string;
|
|
63
|
+
refreshToken: string;
|
|
64
|
+
authorizationCode: string;
|
|
65
|
+
} | null;
|
|
66
|
+
|
|
67
|
+
export type TSSOfacebook = {
|
|
68
|
+
userId: String;
|
|
69
|
+
accessToken: String;
|
|
70
|
+
email: String;
|
|
71
|
+
name: String | null;
|
|
72
|
+
} | null;
|
|
73
|
+
|
|
74
|
+
export type TUser = {
|
|
75
|
+
_id: string;
|
|
76
|
+
phoneNumber: string;
|
|
77
|
+
profileImageAsset: TProfileImageAsset;
|
|
78
|
+
displayName: string;
|
|
79
|
+
language: string;
|
|
80
|
+
currency: string;
|
|
81
|
+
sharedUserId: string | null;
|
|
82
|
+
sharedUserInfo: TSharedUserInfo;
|
|
83
|
+
lastActiveAt: Date;
|
|
84
|
+
premiumMemberTrialEndAt: Date | null;
|
|
85
|
+
topUpMemberRole: ESubscriptionEntitlement | null;
|
|
86
|
+
topUpMemberEndAt: Date | null;
|
|
87
|
+
createdAt: Date;
|
|
88
|
+
notificationToken: string | null;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export type TProfileImageAsset = {
|
|
92
|
+
emoji: string;
|
|
93
|
+
backgroundColor: string;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export type TUserGetInfoResponse = TUser;
|
|
97
|
+
|
|
98
|
+
export type TUserContinueWithGoogleBody = {
|
|
99
|
+
deviceUniqueId: string;
|
|
100
|
+
idToken: string;
|
|
101
|
+
serverAuthCode: string;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export type TUserContinueWithGoogleResponse = TJwtToken;
|
|
105
|
+
|
|
106
|
+
export type TUserContinueWithAppleBody = {
|
|
107
|
+
authorizationCode: string;
|
|
108
|
+
deviceUniqueId: string;
|
|
109
|
+
identityToken: string;
|
|
110
|
+
appleUserId: string;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export type TUserContinueWithAppleResponse = TJwtToken;
|
|
114
|
+
|
|
115
|
+
export type TUserContinueWithFacebookBody = {
|
|
116
|
+
deviceUniqueId: string;
|
|
117
|
+
accessToken: string;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export type TUserContinueWithFacebookResponse = TJwtToken;
|
|
121
|
+
|
|
122
|
+
export type TUserRegisterNotificationBody = {
|
|
123
|
+
notificationToken: string;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export type TUserUpdateUserProfileAssetBody = TProfileImageAsset;
|
|
127
|
+
|
|
128
|
+
export type TUserUpdateUserDisplayNameBody = {
|
|
129
|
+
displayName: string;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export type TUserUpdateUserLanguageBody = {
|
|
133
|
+
language: string;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export type TUserUpdateUserCurrencyBody = {
|
|
137
|
+
currency: string;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export type TUserGetProfileImageAssetsResponse = {
|
|
141
|
+
emojis: string[];
|
|
142
|
+
backgroundColors: string[];
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export type TUserResetPasswordBody = {
|
|
146
|
+
deviceUniqueId: string;
|
|
147
|
+
emailAddress?: string;
|
|
148
|
+
phoneNumber?: string;
|
|
149
|
+
password: string;
|
|
150
|
+
oneTimePassword: string;
|
|
151
|
+
oneTimePasswordType: EVerificationOneTimePasswordType;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export type TUserChangePasswordBody = {
|
|
155
|
+
currentPassword: string;
|
|
156
|
+
newPassword: string;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export type TUserRemoveSharedUserBody = {
|
|
160
|
+
sharedUserId: string;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export type TUserSendGlobalNotificationBody = {
|
|
164
|
+
title: string;
|
|
165
|
+
body: string;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export type TUserRequestOTPBody = {
|
|
169
|
+
phoneNumber: string;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export type TUserRequestOTPResponse = {
|
|
173
|
+
verificationOneTimePasswordType: EVerificationOneTimePasswordType;
|
|
174
|
+
};
|
package/verification.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { EVerificationOneTimePasswordType } from "./enum";
|
|
2
|
+
import { TJwtToken } from "./middleware";
|
|
3
|
+
|
|
4
|
+
export type TVerification = {
|
|
5
|
+
_id: string;
|
|
6
|
+
userId: string;
|
|
7
|
+
type: EVerificationOneTimePasswordType;
|
|
8
|
+
oneTimePassword: string;
|
|
9
|
+
phoneNumber: string | null;
|
|
10
|
+
expiryAt: Date;
|
|
11
|
+
isVerify: boolean;
|
|
12
|
+
verifiedAt: Date | null;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type TVerificationVerifyBody = {
|
|
17
|
+
phoneNumber: string;
|
|
18
|
+
oneTimePassword: string;
|
|
19
|
+
oneTimePasswordType: EVerificationOneTimePasswordType;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type TVerificationVerifyResponse = TJwtToken;
|
|
23
|
+
|
|
24
|
+
export type TVerificationGetShareIdResponse = {
|
|
25
|
+
oneTimePassword: string;
|
|
26
|
+
expiryAt: Date;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type TVerifyShareIdBody = {
|
|
30
|
+
oneTimePassword: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type TVerifyShareIdReponse = {
|
|
34
|
+
sharedUserId: string;
|
|
35
|
+
};
|