-
Notifications
You must be signed in to change notification settings - Fork 235
/
index.js
107 lines (93 loc) · 2.66 KB
/
index.js
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
'use strict';
const FORMATDATE = 'YYYY/MM/DD HH:mm:ss A Z';
const MAILTYPE = {
WELCOME: 'welcome',
LOGIN: 'login',
SIGNUP: 'signup',
RESET_PASSWORD: 'reset_password',
CHANGE_PASSWORD: 'change_password',
PASSWORD_CHANGED: 'password_changed',
USER_VERIFICATION_REJECT: 'user_verification_reject',
ACCOUNT_UPGRADE: 'account_upgrade',
ACCOUNT_VERIFY: 'account_verify',
WITHDRAWAL_REQUEST: 'withdrawal_request',
DEPOSIT_CANCEL: 'deposit_cancel',
DEPOSIT: 'deposit',
WITHDRAWAL: 'withdrawal',
CONTACT_FORM: 'contactForm',
SUSPICIOUS_DEPOSIT: 'suspicious_deposit',
USER_VERIFICATION: 'user_verification',
USER_DEACTIVATED: 'user_deactivated',
INVALID_ADDRESS: 'invalid_address',
INVITED_OPERATOR: 'invitedOperator',
ALERT: 'alert',
DISCOUNT_UPDATE: 'discount_update',
BANK_VERIFIED: 'bank_verified',
CONFIRM_EMAIL: 'confirm_email',
LOCKED_ACCOUNT: 'locked_account',
USER_DELETED: 'user_deleted',
// USER_VERIFICATION_REJECT split
USER_ID_VERIFICATION_REJECT: 'user_id_verification_reject',
USER_BANK_VERIFICATION_REJECT: 'user_bank_verification_reject',
// DEPOSIT_CANCEL split
WITHDRAWAL_CANCEL: 'withdrawal_cancel',
// USER_DEACTIVATED split
USER_ACTIVATED: 'user_activated',
// WITHDRAWAL split
WITHDRAWAL_PENDING: 'withdrawal_pending' ,
WITHDRAWAL_COMPLETED: 'withdrawal_completed',
// DEPOSIT split
DEPOSIT_PENDING: 'deposit_pending',
DEPOSIT_COMPLETED: 'deposit_completed',
// KYC
DOC_REJECTED: 'doc_rejected',
DOC_VERIFIED: 'doc_verified',
// OTP
OTP_DISABLED: 'otp_disabled',
OTP_ENABLED: 'otp_enabled',
//P2P
P2P_MERCHANT_IN_PROGRESS: 'p2p_merchant_in_progress',
P2P_BUYER_PAID_ORDER: 'p2p_buyer_paid_order',
P2P_ORDER_EXPIRED: 'p2p_order_expired',
P2P_ORDER_CLOSED: 'p2p_order_closed',
P2P_BUYER_CANCELLED_ORDER: 'p2p_buyer_cancelled_order',
P2P_BUYER_APPEALED_ORDER: 'p2p_buyer_appealed_order',
P2P_VENDOR_CONFIRMED_ORDER: 'p2p_vendor_confirmed_order',
P2P_VENDOR_CANCELLED_ORDER: 'p2p_vendor_cancelled_order',
P2P_VENDOR_APPEALED_ORDER: 'p2p_vendor_appealed_order',
};
const languageFile = (lang) => {
let langFile = undefined;
try {
langFile = require(`./${lang}`);
} catch (err) {
if (err.code === 'MODULE_NOT_FOUND') {
langFile = require('./en');
}
}
return langFile;
};
const getStringObject = (lang, type) => {
let langFile = undefined;
let result = undefined;
try {
langFile = require(`./${lang}`);
result = langFile[type];
if (!result) {
langFile = require('./en');
result = langFile[type];
}
} catch (err) {
if (err.code === 'MODULE_NOT_FOUND') {
langFile = require('./en');
result = langFile[type];
}
}
return result;
};
module.exports = {
FORMATDATE,
MAILTYPE,
languageFile,
getStringObject
};