@tomei/finance 0.6.99 → 0.6.102

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.
Files changed (223) hide show
  1. package/.husky/commit-msg +12 -3
  2. package/.husky/pre-commit +4 -4
  3. package/configs/config.js +1 -1
  4. package/dist/account/account.d.ts +37 -37
  5. package/dist/account/account.js +251 -263
  6. package/dist/account/account.js.map +1 -1
  7. package/dist/account/account.repository.d.ts +5 -5
  8. package/dist/account/account.repository.js +11 -11
  9. package/dist/account/interfaces/account-attr.interface.d.ts +29 -29
  10. package/dist/account/interfaces/account-attr.interface.js +2 -2
  11. package/dist/account-system-entity/account-system-entity.d.ts +12 -12
  12. package/dist/account-system-entity/account-system-entity.js +55 -66
  13. package/dist/account-system-entity/account-system-entity.js.map +1 -1
  14. package/dist/account-system-entity/post-history.repository.d.ts +5 -5
  15. package/dist/account-system-entity/post-history.repository.js +11 -11
  16. package/dist/config.d.ts +1888 -1888
  17. package/dist/config.js +331 -331
  18. package/dist/config.js.map +1 -1
  19. package/dist/customer/customer.d.ts +44 -44
  20. package/dist/customer/customer.js +212 -234
  21. package/dist/customer/customer.js.map +1 -1
  22. package/dist/customer/finance-customer.repository.d.ts +5 -5
  23. package/dist/customer/finance-customer.repository.js +25 -25
  24. package/dist/customer/finance-customer.repository.js.map +1 -1
  25. package/dist/customer/interfaces/customer.repository.interface.d.ts +3 -3
  26. package/dist/customer/interfaces/customer.repository.interface.js +2 -2
  27. package/dist/customer/interfaces/finance-customer-attr.interface.d.ts +10 -10
  28. package/dist/customer/interfaces/finance-customer-attr.interface.js +2 -2
  29. package/dist/customer/interfaces/finance-customer.repository.interface.d.ts +3 -3
  30. package/dist/customer/interfaces/finance-customer.repository.interface.js +2 -2
  31. package/dist/database.d.ts +4 -4
  32. package/dist/database.js +46 -47
  33. package/dist/database.js.map +1 -1
  34. package/dist/document/document-item.d.ts +46 -46
  35. package/dist/document/document-item.js +122 -132
  36. package/dist/document/document-item.js.map +1 -1
  37. package/dist/document/document-item.repository.d.ts +5 -5
  38. package/dist/document/document-item.repository.js +11 -11
  39. package/dist/document/document.d.ts +87 -88
  40. package/dist/document/document.js +735 -766
  41. package/dist/document/document.js.map +1 -1
  42. package/dist/document/document.repository.d.ts +5 -5
  43. package/dist/document/document.repository.js +11 -11
  44. package/dist/document/interfaces/document-attr.interface.d.ts +27 -27
  45. package/dist/document/interfaces/document-attr.interface.js +6 -6
  46. package/dist/document/interfaces/document-find-all.interface.d.ts +13 -13
  47. package/dist/document/interfaces/document-find-all.interface.js +2 -2
  48. package/dist/document/interfaces/document-item-attr.interface.d.ts +26 -26
  49. package/dist/document/interfaces/document-item-attr.interface.js +6 -6
  50. package/dist/document/interfaces/document-item.repository.interface.d.ts +3 -3
  51. package/dist/document/interfaces/document-item.repository.interface.js +2 -2
  52. package/dist/enum/collect-payment-type.d.ts +4 -4
  53. package/dist/enum/collect-payment-type.js +8 -8
  54. package/dist/enum/collect-payment-type.js.map +1 -1
  55. package/dist/enum/doc-type.enum.d.ts +8 -8
  56. package/dist/enum/doc-type.enum.js +12 -12
  57. package/dist/enum/doc-type.enum.js.map +1 -1
  58. package/dist/enum/document-status.enum.d.ts +6 -6
  59. package/dist/enum/document-status.enum.js +10 -10
  60. package/dist/enum/document-status.enum.js.map +1 -1
  61. package/dist/enum/index.d.ts +9 -9
  62. package/dist/enum/index.js +19 -19
  63. package/dist/enum/payment-method.enum.d.ts +3 -3
  64. package/dist/enum/payment-method.enum.js +7 -7
  65. package/dist/enum/payment-method.enum.js.map +1 -1
  66. package/dist/enum/payment-status.enum.d.ts +10 -10
  67. package/dist/enum/payment-status.enum.js +15 -16
  68. package/dist/enum/payment-status.enum.js.map +1 -1
  69. package/dist/enum/payment-type.enum.d.ts +4 -4
  70. package/dist/enum/payment-type.enum.js +8 -8
  71. package/dist/enum/payment-type.enum.js.map +1 -1
  72. package/dist/enum/quick-book-client-scopes.enum.d.ts +13 -13
  73. package/dist/enum/quick-book-client-scopes.enum.js +18 -18
  74. package/dist/enum/quick-book-client-scopes.enum.js.map +1 -1
  75. package/dist/enum/transaction-type.enum.d.ts +4 -4
  76. package/dist/enum/transaction-type.enum.js +8 -8
  77. package/dist/enum/transaction-type.enum.js.map +1 -1
  78. package/dist/finance-company/finance-company.d.ts +88 -88
  79. package/dist/finance-company/finance-company.js +1533 -1576
  80. package/dist/finance-company/finance-company.js.map +1 -1
  81. package/dist/finance-company/finance-company.repository.d.ts +5 -5
  82. package/dist/finance-company/finance-company.repository.js +11 -11
  83. package/dist/helpers/login-user.d.ts +13 -13
  84. package/dist/helpers/login-user.js +28 -28
  85. package/dist/helpers/login-user.js.map +1 -1
  86. package/dist/helpers/typeof.d.ts +1 -1
  87. package/dist/helpers/typeof.js +28 -29
  88. package/dist/helpers/typeof.js.map +1 -1
  89. package/dist/index.d.ts +17 -17
  90. package/dist/index.js +32 -32
  91. package/dist/interfaces/account-system.interface.d.ts +30 -30
  92. package/dist/interfaces/account-system.interface.js +2 -2
  93. package/dist/interfaces/index.d.ts +2 -2
  94. package/dist/interfaces/index.js +2 -2
  95. package/dist/journal-entry/interfaces/journal-entry-attr.interface.d.ts +12 -12
  96. package/dist/journal-entry/interfaces/journal-entry-attr.interface.js +2 -2
  97. package/dist/journal-entry/journal-entry.d.ts +42 -42
  98. package/dist/journal-entry/journal-entry.js +216 -233
  99. package/dist/journal-entry/journal-entry.js.map +1 -1
  100. package/dist/journal-entry/journal-entry.repository.d.ts +6 -6
  101. package/dist/journal-entry/journal-entry.repository.js +16 -27
  102. package/dist/journal-entry/journal-entry.repository.js.map +1 -1
  103. package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts +17 -17
  104. package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.js +2 -2
  105. package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.d.ts +5 -5
  106. package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.js +2 -2
  107. package/dist/ledger-transaction/ledger-transaction.d.ts +54 -54
  108. package/dist/ledger-transaction/ledger-transaction.js +143 -164
  109. package/dist/ledger-transaction/ledger-transaction.js.map +1 -1
  110. package/dist/ledger-transaction/ledger-transaction.repository.d.ts +6 -6
  111. package/dist/ledger-transaction/ledger-transaction.repository.js +16 -27
  112. package/dist/ledger-transaction/ledger-transaction.repository.js.map +1 -1
  113. package/dist/models/account.entity.d.ts +30 -30
  114. package/dist/models/account.entity.js +232 -232
  115. package/dist/models/account.entity.js.map +1 -1
  116. package/dist/models/customer.entity.d.ts +13 -13
  117. package/dist/models/customer.entity.js +109 -109
  118. package/dist/models/customer.entity.js.map +1 -1
  119. package/dist/models/document-item.entity.d.ts +31 -31
  120. package/dist/models/document-item.entity.js +200 -200
  121. package/dist/models/document-item.entity.js.map +1 -1
  122. package/dist/models/document.entity.d.ts +36 -36
  123. package/dist/models/document.entity.js +242 -242
  124. package/dist/models/document.entity.js.map +1 -1
  125. package/dist/models/finance-company.entity.d.ts +15 -15
  126. package/dist/models/finance-company.entity.js +93 -93
  127. package/dist/models/finance-company.entity.js.map +1 -1
  128. package/dist/models/journal-entry.entity.d.ts +16 -16
  129. package/dist/models/journal-entry.entity.js +127 -127
  130. package/dist/models/journal-entry.entity.js.map +1 -1
  131. package/dist/models/ledger-transaction.entity.d.ts +24 -24
  132. package/dist/models/ledger-transaction.entity.js +172 -172
  133. package/dist/models/ledger-transaction.entity.js.map +1 -1
  134. package/dist/models/payment-item.entity.d.ts +12 -12
  135. package/dist/models/payment-item.entity.js +75 -75
  136. package/dist/models/payment-item.entity.js.map +1 -1
  137. package/dist/models/payment-method-type.entity.d.ts +13 -13
  138. package/dist/models/payment-method-type.entity.js +85 -85
  139. package/dist/models/payment-method-type.entity.js.map +1 -1
  140. package/dist/models/payment-method.entity.d.ts +10 -10
  141. package/dist/models/payment-method.entity.js +62 -62
  142. package/dist/models/payment-method.entity.js.map +1 -1
  143. package/dist/models/payment-paid-with.entity.d.ts +24 -24
  144. package/dist/models/payment-paid-with.entity.js +158 -158
  145. package/dist/models/payment-paid-with.entity.js.map +1 -1
  146. package/dist/models/payment.entity.d.ts +29 -29
  147. package/dist/models/payment.entity.js +193 -193
  148. package/dist/models/payment.entity.js.map +1 -1
  149. package/dist/models/post-history.entity.d.ts +11 -11
  150. package/dist/models/post-history.entity.js +63 -63
  151. package/dist/models/post-history.entity.js.map +1 -1
  152. package/dist/models/tax.entity.d.ts +13 -13
  153. package/dist/models/tax.entity.js +89 -89
  154. package/dist/models/tax.entity.js.map +1 -1
  155. package/dist/payment/interfaces/payment-attr.interface.d.ts +22 -22
  156. package/dist/payment/interfaces/payment-attr.interface.js +6 -6
  157. package/dist/payment/interfaces/payment-params.interface.d.ts +7 -7
  158. package/dist/payment/interfaces/payment-params.interface.js +2 -2
  159. package/dist/payment/payment.d.ts +53 -53
  160. package/dist/payment/payment.js +186 -201
  161. package/dist/payment/payment.js.map +1 -1
  162. package/dist/payment/payment.repository.d.ts +5 -5
  163. package/dist/payment/payment.repository.js +11 -11
  164. package/dist/payment-item/interfaces/payment-item-attr.interface.d.ts +10 -10
  165. package/dist/payment-item/interfaces/payment-item-attr.interface.js +6 -6
  166. package/dist/payment-item/payment-item.d.ts +25 -25
  167. package/dist/payment-item/payment-item.js +111 -122
  168. package/dist/payment-item/payment-item.js.map +1 -1
  169. package/dist/payment-item/payment-item.repository.d.ts +5 -5
  170. package/dist/payment-item/payment-item.repository.js +11 -11
  171. package/dist/payment-method/interfaces/payment-method-attr.interface.d.ts +5 -5
  172. package/dist/payment-method/interfaces/payment-method-attr.interface.js +2 -2
  173. package/dist/payment-method/payment-method.d.ts +21 -21
  174. package/dist/payment-method/payment-method.js +104 -117
  175. package/dist/payment-method/payment-method.js.map +1 -1
  176. package/dist/payment-method/payment-method.repository.d.ts +5 -5
  177. package/dist/payment-method/payment-method.repository.js +11 -11
  178. package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.d.ts +8 -8
  179. package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.js +2 -2
  180. package/dist/payment-method-type/payment-method-type.d.ts +18 -18
  181. package/dist/payment-method-type/payment-method-type.js +65 -76
  182. package/dist/payment-method-type/payment-method-type.js.map +1 -1
  183. package/dist/payment-method-type/payment-method-type.repository.d.ts +5 -5
  184. package/dist/payment-method-type/payment-method-type.repository.js +11 -11
  185. package/dist/payment-paid-with/interfaces/payment-paid-with.interface.d.ts +19 -19
  186. package/dist/payment-paid-with/interfaces/payment-paid-with.interface.js +6 -6
  187. package/dist/payment-paid-with/payment-paid-with.d.ts +33 -33
  188. package/dist/payment-paid-with/payment-paid-with.js +56 -56
  189. package/dist/payment-paid-with/payment-paid-with.js.map +1 -1
  190. package/dist/payment-paid-with/payment-paid-with.repository.d.ts +5 -5
  191. package/dist/payment-paid-with/payment-paid-with.repository.js +11 -11
  192. package/dist/tax/interfaces/tax-attr.interface.d.ts +10 -10
  193. package/dist/tax/interfaces/tax-attr.interface.js +2 -2
  194. package/dist/tax/tax.d.ts +26 -26
  195. package/dist/tax/tax.js +51 -51
  196. package/dist/tax/tax.js.map +1 -1
  197. package/dist/tax/tax.repository.d.ts +5 -5
  198. package/dist/tax/tax.repository.js +11 -11
  199. package/dist/test-document.d.ts +3 -3
  200. package/dist/test-document.js +18 -18
  201. package/dist/test.d.ts +1 -1
  202. package/dist/test.js +6 -7
  203. package/dist/test.js.map +1 -1
  204. package/dist/tsconfig.tsbuildinfo +1 -1
  205. package/eslint.config.mjs +58 -0
  206. package/invoice-template/assets/js/html2canvas.min.js +16 -16
  207. package/package.json +35 -41
  208. package/src/account/account.ts +2 -1
  209. package/src/customer/customer.ts +8 -7
  210. package/src/document/document-item.ts +3 -2
  211. package/src/document/document.ts +20 -13
  212. package/src/enum/collect-payment-type.ts +3 -3
  213. package/src/enum/payment-status.enum.ts +1 -1
  214. package/src/finance-company/finance-company.ts +5 -7
  215. package/src/journal-entry/journal-entry.ts +0 -1
  216. package/src/ledger-transaction/ledger-transaction.ts +4 -4
  217. package/src/payment-method-type/payment-method-type.ts +1 -1
  218. package/src/tax/tax.ts +0 -1
  219. package/tsconfig.json +4 -3
  220. package/.eslintrc.js +0 -72
  221. package/img.png +0 -0
  222. package/img_1.png +0 -0
  223. package/tslint.json +0 -18
package/dist/config.js CHANGED
@@ -1,332 +1,332 @@
1
- const dotenv = require('dotenv');
2
- dotenv.config();
3
- const defaultConfig = {
4
- commonApiUrl: process.env.COMMON_API_URL,
5
- accountingSystem: {
6
- quickbooks: {
7
- packageName: process.env.PACKAGE_NAME || '',
8
- accountSystemClass: process.env.ACCOUNT_SYSTEM_CLASS || '',
9
- apiUrl: process.env.API_URL || '',
10
- },
11
- xero: {
12
- packageName: process.env.PACKAGE_NAME || '',
13
- accountSystemClass: process.env.ACCOUNT_SYSTEM_CLASS || '',
14
- apiUrl: process.env.API_URL || '',
15
- },
16
- },
17
- financeCompanies: {
18
- 'TXG-FS': {
19
- companyId: process.env.COMPANYID || 'TXG-FS',
20
- companyName: process.env.COMPANYNAME || 'TXG Financial Solutions Sdn Bhd',
21
- companySystemCode: process.env.COMPSYSTEMCODE || 'Tomei-SSO',
22
- companySystemRefId: process.env.COMPSYSTEMREFID || '',
23
- accountSystemCode: process.env.ACCSYSTEMCODE || '',
24
- accountingSystem: 'quickbooks',
25
- apiKey: process.env.QUICKBOOK_API_KEY,
26
- redirectUrl: process.env.EZGOLD_REDIRECT_URL,
27
- apiSecret: process.env.QUICKBOOK_API_SECRET,
28
- paymentMethods: {
29
- cash: {
30
- id: 'CS',
31
- name: 'Cash',
32
- types: {
33
- cash: {
34
- id: 'CS-CASH',
35
- name: 'Cash',
36
- accountNo: 'CASH',
37
- processingFeeRate: 0.0,
38
- processingFeeAccountNo: 'CASH-FEE',
39
- },
40
- },
41
- },
42
- cheque: {
43
- id: 'CQ',
44
- name: 'Cheque',
45
- types: {
46
- cash: {
47
- id: 'CQ-Cheque',
48
- name: 'Cheque',
49
- accountNo: 'CHEQUE',
50
- processingFeeRate: 0.0,
51
- processingFeeAccountNo: 'CASH-FEE',
52
- },
53
- },
54
- },
55
- bankTransfer: {
56
- id: 'BT',
57
- name: 'Bank Transfer',
58
- types: {
59
- bankTransfer: {
60
- id: 'BT-RHB',
61
- name: 'RHB',
62
- accountNo: '19GKBA20900-01',
63
- processingFeeRate: 1.0,
64
- processingFeeAccountNo: 'RHB-FEE',
65
- },
66
- },
67
- },
68
- debitCard: {
69
- id: 'DC',
70
- name: 'Debit Card',
71
- types: {
72
- mastercard: {
73
- id: 'DC-MSC',
74
- name: 'Mastercard',
75
- accountNo: 'CURLEC',
76
- processingFeeRate: 1.5,
77
- processingFeeAccountNo: 'CURLEC-FEE',
78
- },
79
- visa: {
80
- id: 'DC-VISA',
81
- name: 'Visa',
82
- accountNo: 'CURLEC',
83
- processingFeeRate: 1.5,
84
- processingFeeAccountNo: 'CURLEC-FEE',
85
- },
86
- },
87
- },
88
- creditCard: {
89
- id: 'CC',
90
- name: 'Credit Card',
91
- types: {
92
- mastercard: {
93
- id: 'CC-MSC',
94
- name: 'Mastercard',
95
- accountNo: 'CURLEC',
96
- processingFeeRate: 2.5,
97
- processingFeeAccountNo: 'CURLEC-FEE',
98
- },
99
- visa: {
100
- id: 'CC-VISA',
101
- name: 'Visa',
102
- accountNo: 'CURLEC',
103
- processingFeeRate: 2.5,
104
- processingFeeAccountNo: 'CURLEC-FEE',
105
- },
106
- amex: {
107
- id: 'CC-AMEX',
108
- name: 'American Express',
109
- accountNo: 'CURLEC',
110
- processingFeeRate: 3.5,
111
- processingFeeAccountNo: 'CURLEC-FEE',
112
- },
113
- },
114
- },
115
- mandate: {
116
- id: 'MD',
117
- name: 'Mandate',
118
- types: {
119
- RHB: {
120
- id: 'MD-RHB',
121
- name: 'RHB Mandate',
122
- accountNo: '19GKBA20900-01',
123
- processingFeeRate: 1.0,
124
- processingFeeAccountNo: 'RHB-FEE',
125
- },
126
- },
127
- },
128
- },
129
- },
130
- 'TXG-B': {
131
- companyId: 'TXG-B',
132
- companyName: 'TXG Bullion Sdn Bhd',
133
- companySystemCode: 'Tomei-SSO',
134
- companySystemRefId: '',
135
- accountingSystem: 'quickbooks',
136
- accountSystemCode: '',
137
- apiKey: '',
138
- apiSecret: '',
139
- redirectUrl: process.env.EZGOLD_REDIRECT_URL,
140
- paymentMethods: {
141
- cash: {
142
- id: 'CS',
143
- name: 'Cash',
144
- types: {
145
- cash: {
146
- id: 'CS-CASH',
147
- name: 'Cash',
148
- accountno: '',
149
- processingFeeRate: 0.0,
150
- processingFeeAccountNo: '',
151
- },
152
- },
153
- },
154
- bankTransfer: {
155
- id: 'BT',
156
- name: 'Bank Transfer',
157
- types: {
158
- banktransfer: {
159
- id: 'BT-RHB',
160
- name: 'RHB',
161
- accountno: '',
162
- processingFeeRate: 1.0,
163
- processingFeeAccountNo: '',
164
- },
165
- },
166
- },
167
- debitCard: {
168
- id: 'DC',
169
- name: 'Debit Card',
170
- types: {
171
- mastercard: {
172
- id: 'DC-MSC',
173
- name: 'Mastercard',
174
- accountno: '',
175
- processingFeeRate: 1.5,
176
- processingFeeAccountNo: '',
177
- },
178
- visa: {
179
- id: 'DC-VISA',
180
- name: 'Visa',
181
- accountno: '',
182
- processingFeeRate: 1.5,
183
- processingFeeAccountNo: '',
184
- },
185
- },
186
- },
187
- creditCard: {
188
- id: 'CC',
189
- name: 'Credit Card',
190
- types: {
191
- mastercard: {
192
- id: 'CC-MSC',
193
- name: 'Mastercard',
194
- accountno: '',
195
- processingFeeRate: 2.5,
196
- processingFeeAccountNo: '',
197
- },
198
- visa: {
199
- id: 'CC-VISA',
200
- name: 'Visa',
201
- accountno: '',
202
- processingFeeRate: 2.5,
203
- processingFeeAccountNo: '',
204
- },
205
- amex: {
206
- id: 'CC-AMEX',
207
- name: 'American Express',
208
- accountno: '',
209
- processingFeeRate: 3.5,
210
- processingFeeAccountNo: '',
211
- },
212
- },
213
- },
214
- eWallet: {
215
- id: 'EW',
216
- name: 'E-Wallet',
217
- types: {
218
- touchngo: {
219
- id: 'EW-T&G',
220
- name: 'Touch & Go',
221
- accountno: '',
222
- processingFeeRate: 1.5,
223
- processingFeeAccountNo: '',
224
- },
225
- Boost: {
226
- id: 'EW-BOOST',
227
- name: 'Boost',
228
- accountno: '',
229
- processingFeeRate: 2.5,
230
- processingFeeAccountNo: '',
231
- },
232
- GrabPay: {
233
- id: 'EW-GRAB',
234
- name: 'GrabPay',
235
- accountno: '',
236
- processingFeeRate: 2.5,
237
- processingFeeAccountNo: '',
238
- },
239
- ShopeePay: {
240
- id: 'EW-SHOPEE',
241
- name: 'ShopeePay',
242
- accountno: '',
243
- processingFeeRate: 2.5,
244
- processingFeeAccountNo: '',
245
- },
246
- },
247
- },
248
- mandate: {
249
- id: 'MD',
250
- name: 'Mandate',
251
- types: {
252
- RHB: {
253
- id: 'MD-RHB',
254
- name: 'RHB Mandate',
255
- accountno: '',
256
- processingFeeRate: 1.0,
257
- processingFeeAccountNo: '',
258
- },
259
- },
260
- },
261
- storeCredit: {
262
- id: 'SC',
263
- name: 'Store Credit',
264
- types: {
265
- scTomei: {
266
- id: 'SC-TOMEI',
267
- name: 'Tomei Store Credit',
268
- accountno: '',
269
- processingFeeRate: 0.0,
270
- processingFeeAccountNo: '',
271
- },
272
- },
273
- },
274
- pointsRedemption: {
275
- id: 'PR',
276
- name: 'Points Redemption',
277
- types: {
278
- prTomei: {
279
- id: 'PR-TOMEI',
280
- name: 'Tomei Points Redemption',
281
- accountno: '',
282
- processingFeeRate: 0.0,
283
- processingFeeAccountNo: '',
284
- },
285
- },
286
- },
287
- voucher: {
288
- id: 'VC',
289
- name: 'Voucher',
290
- types: {
291
- gift: {
292
- id: 'VC-GF',
293
- name: 'Gift Voucher',
294
- accountno: '',
295
- processingFeeRate: 0.0,
296
- processingFeeAccountNo: '',
297
- },
298
- cash: {
299
- id: 'VC-CS',
300
- name: 'Cash Voucher',
301
- accountno: '',
302
- processingFeeRate: 0.0,
303
- processingFeeAccountNo: '',
304
- },
305
- },
306
- },
307
- },
308
- },
309
- },
310
- };
311
- const config = {
312
- development: Object.assign({ environment: 'development' }, defaultConfig),
313
- test: Object.assign({ environment: 'test' }, defaultConfig),
314
- staging: Object.assign({ environment: 'staging' }, defaultConfig),
315
- production: Object.assign({ environment: 'production' }, defaultConfig),
316
- };
317
- const getConfig = () => {
318
- switch (process.env.NODE_ENV) {
319
- case 'development':
320
- return config['development'];
321
- case 'test':
322
- return config['test'];
323
- case 'staging':
324
- return config['staging'];
325
- case 'production':
326
- return config['production'];
327
- default:
328
- break;
329
- }
330
- };
331
- module.exports = () => getConfig();
1
+ const dotenv = require('dotenv');
2
+ dotenv.config();
3
+ const defaultConfig = {
4
+ commonApiUrl: process.env.COMMON_API_URL,
5
+ accountingSystem: {
6
+ quickbooks: {
7
+ packageName: process.env.PACKAGE_NAME || '',
8
+ accountSystemClass: process.env.ACCOUNT_SYSTEM_CLASS || '',
9
+ apiUrl: process.env.API_URL || '',
10
+ },
11
+ xero: {
12
+ packageName: process.env.PACKAGE_NAME || '',
13
+ accountSystemClass: process.env.ACCOUNT_SYSTEM_CLASS || '',
14
+ apiUrl: process.env.API_URL || '',
15
+ },
16
+ },
17
+ financeCompanies: {
18
+ 'TXG-FS': {
19
+ companyId: process.env.COMPANYID || 'TXG-FS',
20
+ companyName: process.env.COMPANYNAME || 'TXG Financial Solutions Sdn Bhd',
21
+ companySystemCode: process.env.COMPSYSTEMCODE || 'Tomei-SSO',
22
+ companySystemRefId: process.env.COMPSYSTEMREFID || '',
23
+ accountSystemCode: process.env.ACCSYSTEMCODE || '',
24
+ accountingSystem: 'quickbooks',
25
+ apiKey: process.env.QUICKBOOK_API_KEY,
26
+ redirectUrl: process.env.EZGOLD_REDIRECT_URL,
27
+ apiSecret: process.env.QUICKBOOK_API_SECRET,
28
+ paymentMethods: {
29
+ cash: {
30
+ id: 'CS',
31
+ name: 'Cash',
32
+ types: {
33
+ cash: {
34
+ id: 'CS-CASH',
35
+ name: 'Cash',
36
+ accountNo: 'CASH',
37
+ processingFeeRate: 0.0,
38
+ processingFeeAccountNo: 'CASH-FEE',
39
+ },
40
+ },
41
+ },
42
+ cheque: {
43
+ id: 'CQ',
44
+ name: 'Cheque',
45
+ types: {
46
+ cash: {
47
+ id: 'CQ-Cheque',
48
+ name: 'Cheque',
49
+ accountNo: 'CHEQUE',
50
+ processingFeeRate: 0.0,
51
+ processingFeeAccountNo: 'CASH-FEE',
52
+ },
53
+ },
54
+ },
55
+ bankTransfer: {
56
+ id: 'BT',
57
+ name: 'Bank Transfer',
58
+ types: {
59
+ bankTransfer: {
60
+ id: 'BT-RHB',
61
+ name: 'RHB',
62
+ accountNo: '19GKBA20900-01',
63
+ processingFeeRate: 1.0,
64
+ processingFeeAccountNo: 'RHB-FEE',
65
+ },
66
+ },
67
+ },
68
+ debitCard: {
69
+ id: 'DC',
70
+ name: 'Debit Card',
71
+ types: {
72
+ mastercard: {
73
+ id: 'DC-MSC',
74
+ name: 'Mastercard',
75
+ accountNo: 'CURLEC',
76
+ processingFeeRate: 1.5,
77
+ processingFeeAccountNo: 'CURLEC-FEE',
78
+ },
79
+ visa: {
80
+ id: 'DC-VISA',
81
+ name: 'Visa',
82
+ accountNo: 'CURLEC',
83
+ processingFeeRate: 1.5,
84
+ processingFeeAccountNo: 'CURLEC-FEE',
85
+ },
86
+ },
87
+ },
88
+ creditCard: {
89
+ id: 'CC',
90
+ name: 'Credit Card',
91
+ types: {
92
+ mastercard: {
93
+ id: 'CC-MSC',
94
+ name: 'Mastercard',
95
+ accountNo: 'CURLEC',
96
+ processingFeeRate: 2.5,
97
+ processingFeeAccountNo: 'CURLEC-FEE',
98
+ },
99
+ visa: {
100
+ id: 'CC-VISA',
101
+ name: 'Visa',
102
+ accountNo: 'CURLEC',
103
+ processingFeeRate: 2.5,
104
+ processingFeeAccountNo: 'CURLEC-FEE',
105
+ },
106
+ amex: {
107
+ id: 'CC-AMEX',
108
+ name: 'American Express',
109
+ accountNo: 'CURLEC',
110
+ processingFeeRate: 3.5,
111
+ processingFeeAccountNo: 'CURLEC-FEE',
112
+ },
113
+ },
114
+ },
115
+ mandate: {
116
+ id: 'MD',
117
+ name: 'Mandate',
118
+ types: {
119
+ RHB: {
120
+ id: 'MD-RHB',
121
+ name: 'RHB Mandate',
122
+ accountNo: '19GKBA20900-01',
123
+ processingFeeRate: 1.0,
124
+ processingFeeAccountNo: 'RHB-FEE',
125
+ },
126
+ },
127
+ },
128
+ },
129
+ },
130
+ 'TXG-B': {
131
+ companyId: 'TXG-B',
132
+ companyName: 'TXG Bullion Sdn Bhd',
133
+ companySystemCode: 'Tomei-SSO',
134
+ companySystemRefId: '',
135
+ accountingSystem: 'quickbooks',
136
+ accountSystemCode: '',
137
+ apiKey: '',
138
+ apiSecret: '',
139
+ redirectUrl: process.env.EZGOLD_REDIRECT_URL,
140
+ paymentMethods: {
141
+ cash: {
142
+ id: 'CS',
143
+ name: 'Cash',
144
+ types: {
145
+ cash: {
146
+ id: 'CS-CASH',
147
+ name: 'Cash',
148
+ accountno: '',
149
+ processingFeeRate: 0.0,
150
+ processingFeeAccountNo: '',
151
+ },
152
+ },
153
+ },
154
+ bankTransfer: {
155
+ id: 'BT',
156
+ name: 'Bank Transfer',
157
+ types: {
158
+ banktransfer: {
159
+ id: 'BT-RHB',
160
+ name: 'RHB',
161
+ accountno: '',
162
+ processingFeeRate: 1.0,
163
+ processingFeeAccountNo: '',
164
+ },
165
+ },
166
+ },
167
+ debitCard: {
168
+ id: 'DC',
169
+ name: 'Debit Card',
170
+ types: {
171
+ mastercard: {
172
+ id: 'DC-MSC',
173
+ name: 'Mastercard',
174
+ accountno: '',
175
+ processingFeeRate: 1.5,
176
+ processingFeeAccountNo: '',
177
+ },
178
+ visa: {
179
+ id: 'DC-VISA',
180
+ name: 'Visa',
181
+ accountno: '',
182
+ processingFeeRate: 1.5,
183
+ processingFeeAccountNo: '',
184
+ },
185
+ },
186
+ },
187
+ creditCard: {
188
+ id: 'CC',
189
+ name: 'Credit Card',
190
+ types: {
191
+ mastercard: {
192
+ id: 'CC-MSC',
193
+ name: 'Mastercard',
194
+ accountno: '',
195
+ processingFeeRate: 2.5,
196
+ processingFeeAccountNo: '',
197
+ },
198
+ visa: {
199
+ id: 'CC-VISA',
200
+ name: 'Visa',
201
+ accountno: '',
202
+ processingFeeRate: 2.5,
203
+ processingFeeAccountNo: '',
204
+ },
205
+ amex: {
206
+ id: 'CC-AMEX',
207
+ name: 'American Express',
208
+ accountno: '',
209
+ processingFeeRate: 3.5,
210
+ processingFeeAccountNo: '',
211
+ },
212
+ },
213
+ },
214
+ eWallet: {
215
+ id: 'EW',
216
+ name: 'E-Wallet',
217
+ types: {
218
+ touchngo: {
219
+ id: 'EW-T&G',
220
+ name: 'Touch & Go',
221
+ accountno: '',
222
+ processingFeeRate: 1.5,
223
+ processingFeeAccountNo: '',
224
+ },
225
+ Boost: {
226
+ id: 'EW-BOOST',
227
+ name: 'Boost',
228
+ accountno: '',
229
+ processingFeeRate: 2.5,
230
+ processingFeeAccountNo: '',
231
+ },
232
+ GrabPay: {
233
+ id: 'EW-GRAB',
234
+ name: 'GrabPay',
235
+ accountno: '',
236
+ processingFeeRate: 2.5,
237
+ processingFeeAccountNo: '',
238
+ },
239
+ ShopeePay: {
240
+ id: 'EW-SHOPEE',
241
+ name: 'ShopeePay',
242
+ accountno: '',
243
+ processingFeeRate: 2.5,
244
+ processingFeeAccountNo: '',
245
+ },
246
+ },
247
+ },
248
+ mandate: {
249
+ id: 'MD',
250
+ name: 'Mandate',
251
+ types: {
252
+ RHB: {
253
+ id: 'MD-RHB',
254
+ name: 'RHB Mandate',
255
+ accountno: '',
256
+ processingFeeRate: 1.0,
257
+ processingFeeAccountNo: '',
258
+ },
259
+ },
260
+ },
261
+ storeCredit: {
262
+ id: 'SC',
263
+ name: 'Store Credit',
264
+ types: {
265
+ scTomei: {
266
+ id: 'SC-TOMEI',
267
+ name: 'Tomei Store Credit',
268
+ accountno: '',
269
+ processingFeeRate: 0.0,
270
+ processingFeeAccountNo: '',
271
+ },
272
+ },
273
+ },
274
+ pointsRedemption: {
275
+ id: 'PR',
276
+ name: 'Points Redemption',
277
+ types: {
278
+ prTomei: {
279
+ id: 'PR-TOMEI',
280
+ name: 'Tomei Points Redemption',
281
+ accountno: '',
282
+ processingFeeRate: 0.0,
283
+ processingFeeAccountNo: '',
284
+ },
285
+ },
286
+ },
287
+ voucher: {
288
+ id: 'VC',
289
+ name: 'Voucher',
290
+ types: {
291
+ gift: {
292
+ id: 'VC-GF',
293
+ name: 'Gift Voucher',
294
+ accountno: '',
295
+ processingFeeRate: 0.0,
296
+ processingFeeAccountNo: '',
297
+ },
298
+ cash: {
299
+ id: 'VC-CS',
300
+ name: 'Cash Voucher',
301
+ accountno: '',
302
+ processingFeeRate: 0.0,
303
+ processingFeeAccountNo: '',
304
+ },
305
+ },
306
+ },
307
+ },
308
+ },
309
+ },
310
+ };
311
+ const config = {
312
+ development: Object.assign({ environment: 'development' }, defaultConfig),
313
+ test: Object.assign({ environment: 'test' }, defaultConfig),
314
+ staging: Object.assign({ environment: 'staging' }, defaultConfig),
315
+ production: Object.assign({ environment: 'production' }, defaultConfig),
316
+ };
317
+ const getConfig = () => {
318
+ switch (process.env.NODE_ENV) {
319
+ case 'development':
320
+ return config['development'];
321
+ case 'test':
322
+ return config['test'];
323
+ case 'staging':
324
+ return config['staging'];
325
+ case 'production':
326
+ return config['production'];
327
+ default:
328
+ break;
329
+ }
330
+ };
331
+ module.exports = () => getConfig();
332
332
  //# sourceMappingURL=config.js.map