@6thbridge/utils 0.2.2 → 0.2.3-7.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/lib/actions/amount.action.d.ts +10 -0
- package/lib/actions/amount.action.js +40 -0
- package/lib/actions/amount.action.js.map +1 -0
- package/lib/actions/charge.action.d.ts +32 -2
- package/lib/actions/charge.action.js +191 -179
- package/lib/actions/charge.action.js.map +1 -1
- package/lib/actions/currency.action.d.ts +11 -2
- package/lib/actions/currency.action.js +71 -33
- package/lib/actions/currency.action.js.map +1 -1
- package/lib/actions/database.action.d.ts +20 -0
- package/lib/actions/database.action.js +90 -0
- package/lib/actions/database.action.js.map +1 -0
- package/lib/actions/database.action.spec.js +208 -0
- package/lib/actions/database.action.spec.js.map +1 -0
- package/lib/actions/file.action.d.ts +24 -0
- package/lib/actions/file.action.js +66 -0
- package/lib/actions/file.action.js.map +1 -0
- package/lib/actions/index.d.ts +9 -0
- package/lib/actions/index.js +10 -0
- package/lib/actions/index.js.map +1 -1
- package/lib/actions/phone-number.action.d.ts +18 -0
- package/lib/actions/phone-number.action.js +50 -2
- package/lib/actions/phone-number.action.js.map +1 -1
- package/lib/actions/queue.action.d.ts +3 -0
- package/lib/actions/queue.action.js +20 -0
- package/lib/actions/queue.action.js.map +1 -0
- package/lib/actions/route.action.d.ts +22 -0
- package/lib/actions/route.action.js +52 -0
- package/lib/actions/route.action.js.map +1 -0
- package/lib/cache/redis.js +1 -1
- package/lib/cache/redis.js.map +1 -1
- package/lib/database/MongoDBRepository.js.map +1 -1
- package/lib/database/MongoDBTypeRepository.d.ts +1 -0
- package/lib/database/MongoDBTypeRepository.js.map +1 -1
- package/lib/database/query.d.ts +3 -1
- package/lib/database/query.js +3 -53
- package/lib/database/query.js.map +1 -1
- package/lib/helpers/errors.d.ts +14 -1
- package/lib/helpers/errors.js +15 -32
- package/lib/helpers/errors.js.map +1 -1
- package/lib/helpers/index.d.ts +7 -0
- package/lib/helpers/index.js +35 -13
- package/lib/helpers/index.js.map +1 -1
- package/lib/http/axios.d.ts +18 -0
- package/lib/http/axios.js +38 -0
- package/lib/http/axios.js.map +1 -1
- package/lib/index.d.ts +3 -2
- package/lib/index.js +10 -2
- package/lib/index.js.map +1 -1
- package/lib/logger/logger.d.ts +3 -1
- package/lib/logger/logger.js +16 -8
- package/lib/logger/logger.js.map +1 -1
- package/lib/middlewares/common.d.ts +3 -2
- package/lib/middlewares/common.js +19 -8
- package/lib/middlewares/common.js.map +1 -1
- package/lib/middlewares/express.js +2 -2
- package/lib/middlewares/express.js.map +1 -1
- package/lib/monitoring/index.d.ts +3 -3
- package/lib/monitoring/index.js +6 -6
- package/lib/monitoring/index.js.map +1 -1
- package/lib/monitoring/rollbar.d.ts +15 -0
- package/lib/monitoring/rollbar.js +23 -0
- package/lib/monitoring/rollbar.js.map +1 -0
- package/lib/responses/express.d.ts +3 -0
- package/lib/responses/express.js +68 -13
- package/lib/responses/express.js.map +1 -1
- package/lib/test/actions/amount.action.test.d.ts +1 -0
- package/lib/test/actions/amount.action.test.js +81 -0
- package/lib/test/actions/amount.action.test.js.map +1 -0
- package/lib/test/actions/charge.action.test.js +125 -47
- package/lib/test/actions/charge.action.test.js.map +1 -1
- package/lib/test/database/test.spec.js +17 -0
- package/lib/test/database/test.spec.js.map +1 -1
- package/lib/translations/index.js +3 -6
- package/lib/translations/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/broker.entity.d.ts +10 -0
- package/lib/types/custom.exception.d.ts +14 -0
- package/lib/types/custom.exception.js +16 -0
- package/lib/types/custom.exception.js.map +1 -0
- package/lib/types/index.d.ts +20 -83
- package/lib/types/index.js +25 -40
- package/lib/types/index.js.map +1 -1
- package/lib/types/integration.entity.d.ts +97 -0
- package/lib/types/integration.entity.js +61 -0
- package/lib/types/integration.entity.js.map +1 -0
- package/lib/types/wallet.entity.d.ts +34 -0
- package/lib/types/wallet.entity.js +24 -0
- package/lib/types/wallet.entity.js.map +1 -0
- package/package.json +22 -15
- package/readme.md +1 -1
- package/lib/cache/in-memory.d.ts +0 -0
- package/lib/cache/in-memory.js +0 -2
- package/lib/cache/in-memory.js.map +0 -1
- package/lib/logger/test.js +0 -45
- package/lib/logger/test.js.map +0 -1
- package/lib/secrets/aws.d.ts +0 -0
- package/lib/secrets/aws.js +0 -2
- package/lib/secrets/aws.js.map +0 -1
- /package/lib/{logger/test.d.ts → actions/database.action.spec.d.ts} +0 -0
package/lib/responses/express.js
CHANGED
|
@@ -32,9 +32,53 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.failed = exports.ok = exports.success = exports.paginated = exports.error = void 0;
|
|
35
|
+
exports.failed = exports.ok = exports.success = exports.paginated = exports.error = exports.friendlyHttpStatus = void 0;
|
|
36
36
|
const translations = __importStar(require("../translations"));
|
|
37
37
|
const lodash_1 = require("lodash");
|
|
38
|
+
exports.friendlyHttpStatus = {
|
|
39
|
+
'200': 'OK',
|
|
40
|
+
'201': 'Created',
|
|
41
|
+
'202': 'Accepted',
|
|
42
|
+
'203': 'NonAuthoritativeInformation',
|
|
43
|
+
'204': 'NoContent',
|
|
44
|
+
'205': 'ResetContent',
|
|
45
|
+
'206': 'PartialContent',
|
|
46
|
+
'300': 'MultipleChoices',
|
|
47
|
+
'301': 'MovedPermanently',
|
|
48
|
+
'302': 'Found',
|
|
49
|
+
'303': 'SeeOther',
|
|
50
|
+
'304': 'NotModified',
|
|
51
|
+
'305': 'UseProxy',
|
|
52
|
+
'306': 'Unused',
|
|
53
|
+
'307': 'TemporaryRedirect',
|
|
54
|
+
'400': 'BadRequest',
|
|
55
|
+
'401': 'Unauthorized',
|
|
56
|
+
'402': 'PaymentRequired',
|
|
57
|
+
'403': 'Forbidden',
|
|
58
|
+
'404': 'ResourceNotFound',
|
|
59
|
+
'405': 'MethodNotAllowed',
|
|
60
|
+
'406': 'NotAcceptable',
|
|
61
|
+
'407': 'ProxyAuthenticationRequired',
|
|
62
|
+
'408': 'RequestTimeout',
|
|
63
|
+
'409': 'Conflict',
|
|
64
|
+
'410': 'Gone',
|
|
65
|
+
'411': 'LengthRequired',
|
|
66
|
+
'412': 'PreconditionRequired',
|
|
67
|
+
'413': 'RequestEntryTooLarge',
|
|
68
|
+
'414': 'RequestURITooLong',
|
|
69
|
+
'415': 'UnsupportedMediaType',
|
|
70
|
+
'416': 'RequestedRangeNotSatisfiable',
|
|
71
|
+
'417': 'ExpectationFailed',
|
|
72
|
+
'418': 'ImaTeapot',
|
|
73
|
+
'422': 'ValidationError',
|
|
74
|
+
'429': 'TooManyRequests',
|
|
75
|
+
'500': 'InternalServerError',
|
|
76
|
+
'501': 'NotImplemented',
|
|
77
|
+
'502': 'BadGateway',
|
|
78
|
+
'503': 'ServiceUnavailable',
|
|
79
|
+
'504': 'GatewayTimeout',
|
|
80
|
+
'505': 'HTTPVersionNotSupported',
|
|
81
|
+
};
|
|
38
82
|
const success = (res, data, code = 200) => {
|
|
39
83
|
return res.status(code).json({
|
|
40
84
|
statusCode: code,
|
|
@@ -55,27 +99,37 @@ const paginated = (res, data, code = 200) => {
|
|
|
55
99
|
};
|
|
56
100
|
exports.paginated = paginated;
|
|
57
101
|
const error = (res, error = 'Oops. An Error Occurred', code = 500, errorCode) => {
|
|
102
|
+
var _a;
|
|
58
103
|
return res.status(code).json({
|
|
59
104
|
statusCode: code,
|
|
60
|
-
errorCode: errorCode
|
|
105
|
+
errorCode: (_a = errorCode !== null && errorCode !== void 0 ? errorCode : exports.friendlyHttpStatus[String(code)]) !== null && _a !== void 0 ? _a : String(code),
|
|
61
106
|
error,
|
|
62
107
|
});
|
|
63
108
|
};
|
|
64
109
|
exports.error = error;
|
|
65
110
|
const ok = (res, response) => __awaiter(void 0, void 0, void 0, function* () {
|
|
66
|
-
var _a, _b;
|
|
111
|
+
var _a, _b, _c, _d;
|
|
67
112
|
if (!(0, lodash_1.isEmpty)(response.locale)) {
|
|
68
113
|
response.locale.fields = response.locale.fields || [];
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (!value)
|
|
72
|
-
continue;
|
|
73
|
-
const translatedString = yield translations.translate({
|
|
114
|
+
if (typeof response.data === 'string') {
|
|
115
|
+
response.data = yield translations.translate({
|
|
74
116
|
fromLanguage: response.locale.fromLocale,
|
|
75
117
|
toLanguage: ((_a = response.locale) === null || _a === void 0 ? void 0 : _a.toLocale) || ((_b = res.locals) === null || _b === void 0 ? void 0 : _b.locale),
|
|
76
|
-
text:
|
|
118
|
+
text: response.data,
|
|
77
119
|
});
|
|
78
|
-
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
for (const field of response.locale.fields) {
|
|
123
|
+
const value = (0, lodash_1.get)(response.data, field);
|
|
124
|
+
if (!value)
|
|
125
|
+
continue;
|
|
126
|
+
const translatedString = yield translations.translate({
|
|
127
|
+
fromLanguage: response.locale.fromLocale,
|
|
128
|
+
toLanguage: ((_c = response.locale) === null || _c === void 0 ? void 0 : _c.toLocale) || ((_d = res.locals) === null || _d === void 0 ? void 0 : _d.locale),
|
|
129
|
+
text: value,
|
|
130
|
+
});
|
|
131
|
+
(0, lodash_1.set)(response.data, field, translatedString);
|
|
132
|
+
}
|
|
79
133
|
}
|
|
80
134
|
}
|
|
81
135
|
delete response.locale;
|
|
@@ -83,14 +137,15 @@ const ok = (res, response) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
83
137
|
});
|
|
84
138
|
exports.ok = ok;
|
|
85
139
|
const failed = (res, response) => __awaiter(void 0, void 0, void 0, function* () {
|
|
86
|
-
var
|
|
140
|
+
var _e, _f, _g, _h, _j;
|
|
87
141
|
if (!(0, lodash_1.isEmpty)(response.locale)) {
|
|
88
142
|
response.error = yield translations.translate({
|
|
89
|
-
fromLanguage: (response === null || response === void 0 ? void 0 : response.locale.fromLocale) || 'en',
|
|
90
|
-
toLanguage: ((
|
|
143
|
+
fromLanguage: ((_e = response === null || response === void 0 ? void 0 : response.locale) === null || _e === void 0 ? void 0 : _e.fromLocale) || 'en',
|
|
144
|
+
toLanguage: ((_f = response === null || response === void 0 ? void 0 : response.locale) === null || _f === void 0 ? void 0 : _f.toLocale) || ((_g = res.locals) === null || _g === void 0 ? void 0 : _g.locale),
|
|
91
145
|
text: response.error,
|
|
92
146
|
});
|
|
93
147
|
}
|
|
148
|
+
response.errorCode = (_j = (_h = response.errorCode) !== null && _h !== void 0 ? _h : exports.friendlyHttpStatus[String(response.statusCode)]) !== null && _j !== void 0 ? _j : String(response.statusCode);
|
|
94
149
|
delete response.locale;
|
|
95
150
|
return res.status(response.statusCode || 500).json(response);
|
|
96
151
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.js","sourceRoot":"","sources":["../../src/responses/express.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,8DAAgD;AAChD,mCAA2C;
|
|
1
|
+
{"version":3,"file":"express.js","sourceRoot":"","sources":["../../src/responses/express.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,8DAAgD;AAChD,mCAA2C;AAE9B,QAAA,kBAAkB,GAA4B;IACzD,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,6BAA6B;IACpC,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,gBAAgB;IACvB,KAAK,EAAE,iBAAiB;IACxB,KAAK,EAAE,kBAAkB;IACzB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,aAAa;IACpB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,mBAAmB;IAC1B,KAAK,EAAE,YAAY;IACnB,K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AAA;YAC5D,IAAI,EAAE,QAAQ,CAAC,KAAK;SACrB,CAAC,CAAC;IACL,CAAC;IAED,QAAQ,CAAC,SAAS,GAAI,MAAA,MAAA,QAAQ,CAAC,SAAS,mCAAI,0BAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,mCAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC3H,OAAO,QAAQ,CAAC,MAAM,CAAC;IACvB,OAAO,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/D,CAAC,CAAA,CAAC;AAEsC,wBAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const amount_action_1 = require("../../actions/amount.action");
|
|
4
|
+
// Mock BigNumber
|
|
5
|
+
describe('AmountAction', () => {
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
// Clear all mocks before each test
|
|
8
|
+
jest.clearAllMocks();
|
|
9
|
+
});
|
|
10
|
+
describe('validateNonDecimalAmount', () => {
|
|
11
|
+
describe('Input Validation', () => {
|
|
12
|
+
it('should return error when amount is not provided', () => {
|
|
13
|
+
const result = amount_action_1.AmountAction.validateNonDecimalAmount(0, 'USD');
|
|
14
|
+
expect(result).toEqual({ error: 'Amount is required' });
|
|
15
|
+
});
|
|
16
|
+
it('should return error when country is not provided', () => {
|
|
17
|
+
const result = amount_action_1.AmountAction.validateNonDecimalAmount(1000, '');
|
|
18
|
+
expect(result).toEqual({ error: 'Country is required' });
|
|
19
|
+
});
|
|
20
|
+
it('should return error when NonDecimalCountries is provided but not as an array', () => {
|
|
21
|
+
const result = amount_action_1.AmountAction.validateNonDecimalAmount(1000, 'USD', 'NOT_AN_ARRAY');
|
|
22
|
+
expect(result).toEqual({ error: 'NonDecimalCountries is required as an array' });
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
describe('Default NON_DECIMAL_ACCEPTING_COUNTRIES', () => {
|
|
26
|
+
it('should use default NON_DECIMAL_ACCEPTING_COUNTRIES when not provided', () => {
|
|
27
|
+
const result = amount_action_1.AmountAction.validateNonDecimalAmount(1000, 'XOF');
|
|
28
|
+
expect(result.data).toEqual(true);
|
|
29
|
+
});
|
|
30
|
+
it('should use custom NonDecimalCountries when provided', () => {
|
|
31
|
+
const customCountries = ['ABC', 'DEF'];
|
|
32
|
+
const result = amount_action_1.AmountAction.validateNonDecimalAmount(1000, 'ABC', customCountries);
|
|
33
|
+
expect(result.data).toEqual(true);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
describe('Amount Validation', () => {
|
|
37
|
+
it('should accept non-decimal amounts for non-decimal accepting countries', () => {
|
|
38
|
+
// Amount 10000 cents = 100.00 (no decimal after division by 100)
|
|
39
|
+
const result = amount_action_1.AmountAction.validateNonDecimalAmount(10000, 'KES');
|
|
40
|
+
expect(result).toEqual({ data: true });
|
|
41
|
+
});
|
|
42
|
+
it('should reject decimal amounts for non-decimal accepting countries', () => {
|
|
43
|
+
const result = amount_action_1.AmountAction.validateNonDecimalAmount(10050, 'KES');
|
|
44
|
+
expect(result).toEqual({
|
|
45
|
+
error: 'KES: Country Selected is not accepting decimal amount. Countries Not Supporting Decimals are KES, XOF, XAF, UGX, RWF'
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
it('should accept decimal amounts for decimal-accepting countries', () => {
|
|
49
|
+
const result = amount_action_1.AmountAction.validateNonDecimalAmount(10050, 'USD');
|
|
50
|
+
expect(result).toEqual({ data: true });
|
|
51
|
+
});
|
|
52
|
+
it('should accept non-decimal amounts for decimal-accepting countries', () => {
|
|
53
|
+
// Amount 10000 cents = 100.00 (no decimal after division by 100)
|
|
54
|
+
const result = amount_action_1.AmountAction.validateNonDecimalAmount(10000, 'USD');
|
|
55
|
+
expect(result).toEqual({ data: true });
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
describe('Edge Cases', () => {
|
|
59
|
+
it('should handle very large numbers correctly', () => {
|
|
60
|
+
const largeAmount = Number.MAX_SAFE_INTEGER;
|
|
61
|
+
const result = amount_action_1.AmountAction.validateNonDecimalAmount(largeAmount, 'USD');
|
|
62
|
+
expect(result).toEqual({ data: true });
|
|
63
|
+
});
|
|
64
|
+
it('should handle very small numbers correctly', () => {
|
|
65
|
+
const smallAmount = 1;
|
|
66
|
+
const result = amount_action_1.AmountAction.validateNonDecimalAmount(smallAmount, 'USD');
|
|
67
|
+
expect(result).toEqual({ data: true });
|
|
68
|
+
});
|
|
69
|
+
it('should handle negative numbers', () => {
|
|
70
|
+
const negativeAmount = -1000;
|
|
71
|
+
const result = amount_action_1.AmountAction.validateNonDecimalAmount(negativeAmount, 'USD');
|
|
72
|
+
expect(result).toEqual({ data: true });
|
|
73
|
+
});
|
|
74
|
+
it('should handle empty custom NonDecimalCountries array', () => {
|
|
75
|
+
const result = amount_action_1.AmountAction.validateNonDecimalAmount(1000, 'KES', []);
|
|
76
|
+
expect(result).toEqual({ data: true });
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=amount.action.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"amount.action.test.js","sourceRoot":"","sources":["../../../src/test/actions/amount.action.test.ts"],"names":[],"mappings":";;AAAA,+DAA4F;AAE5F,iBAAiB;AACjB,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,UAAU,CAAC,GAAG,EAAE;QACd,mCAAmC;QACnC,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;QACxC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;YAChC,EAAE,CAAC,iDAAiD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 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const target = __importStar(require("../../actions/charge.action"));
|
|
27
|
+
const charge_action_1 = require("../../actions/charge.action");
|
|
27
28
|
describe('charge.action.ts unit tests', () => {
|
|
28
|
-
describe('calculateCharge function', () => {
|
|
29
|
-
beforeEach(() => {
|
|
30
|
-
jest.clearAllMocks();
|
|
31
|
-
});
|
|
32
|
-
it('should return default response when chargeConfiguration is falsy', () => {
|
|
33
|
-
const chargeConfiguration = {
|
|
34
|
-
provider: {
|
|
35
|
-
percentage: 1,
|
|
36
|
-
fixed: 100,
|
|
37
|
-
},
|
|
38
|
-
platform: {
|
|
39
|
-
percentage: 1,
|
|
40
|
-
fixed: 100,
|
|
41
|
-
},
|
|
42
|
-
custom: {
|
|
43
|
-
percentage: 1,
|
|
44
|
-
fixed: 100,
|
|
45
|
-
},
|
|
46
|
-
tax: {
|
|
47
|
-
percentage: 1,
|
|
48
|
-
fixed: 100,
|
|
49
|
-
},
|
|
50
|
-
VATOnChargeAndFees: 1,
|
|
51
|
-
};
|
|
52
|
-
const payload = { currency: 'NGN', amount: 1000 };
|
|
53
|
-
const expectedResponse = {
|
|
54
|
-
partner: { clientId: undefined, value: 0 },
|
|
55
|
-
charge: 440,
|
|
56
|
-
provider: 110,
|
|
57
|
-
custom: 110,
|
|
58
|
-
platform: 110,
|
|
59
|
-
tax: 110,
|
|
60
|
-
VAT: 4.4,
|
|
61
|
-
total: 445,
|
|
62
|
-
};
|
|
63
|
-
const result = target.calculateCharge(chargeConfiguration, payload);
|
|
64
|
-
console.log('Result', result);
|
|
65
|
-
expect(result).toEqual(expectedResponse);
|
|
66
|
-
});
|
|
67
|
-
// Add more test cases for calculateCharge function covering different scenarios and edge cases
|
|
68
|
-
});
|
|
69
29
|
describe('processFrancophoneCountries function', () => {
|
|
70
30
|
it('should correctly process Francophone currency charges', () => {
|
|
71
31
|
const charge = {
|
|
72
32
|
partner: { clientId: undefined, value: 0 },
|
|
73
|
-
charge:
|
|
33
|
+
charge: 1015,
|
|
74
34
|
provider: 5,
|
|
75
35
|
custom: 3,
|
|
76
36
|
platform: 2,
|
|
77
37
|
tax: 1,
|
|
78
38
|
VAT: 2,
|
|
79
|
-
total:
|
|
39
|
+
total: 1015,
|
|
80
40
|
};
|
|
81
41
|
const result = target.processFrancophoneCountries(charge);
|
|
82
|
-
expect(result.total).toBe(
|
|
83
|
-
expect(result.extra).
|
|
42
|
+
expect(result.total).toBe(1100);
|
|
43
|
+
expect(result.extra).toBe(85);
|
|
84
44
|
});
|
|
85
45
|
// Add more test cases for processFrancophoneCountries function covering different scenarios and edge cases
|
|
86
46
|
});
|
|
@@ -101,7 +61,7 @@ describe('charge.action.ts unit tests', () => {
|
|
|
101
61
|
},
|
|
102
62
|
},
|
|
103
63
|
partner: {
|
|
104
|
-
clientId:
|
|
64
|
+
clientId: 'test-client-id',
|
|
105
65
|
type: 'flat',
|
|
106
66
|
value: {
|
|
107
67
|
percentage: 0.1, //5
|
|
@@ -180,7 +140,7 @@ describe('charge.action.ts unit tests', () => {
|
|
|
180
140
|
charge: 38100,
|
|
181
141
|
provider: 15000,
|
|
182
142
|
custom: 15000,
|
|
183
|
-
partner: { clientId:
|
|
143
|
+
partner: { clientId: 'test-client-id', value: 100 },
|
|
184
144
|
platform: 500,
|
|
185
145
|
tax: 7500,
|
|
186
146
|
VAT: 2000,
|
|
@@ -188,10 +148,128 @@ describe('charge.action.ts unit tests', () => {
|
|
|
188
148
|
customer: 6600,
|
|
189
149
|
merchant: 15400,
|
|
190
150
|
ownIntegration: false,
|
|
151
|
+
roundUpFinalValue: false,
|
|
152
|
+
chargeBearer: undefined
|
|
153
|
+
};
|
|
154
|
+
const result = charge_action_1.ChargeAction.calculateIntegrationCharge(integrationCharge, payload);
|
|
155
|
+
console.log('Result', result);
|
|
156
|
+
expect(result).toEqual(expectedResponse);
|
|
157
|
+
});
|
|
158
|
+
// it('should return charge as decimal', () => {
|
|
159
|
+
// const payload = { currency: 'XOF', amount: 10000, chargeBearer: "customer" };
|
|
160
|
+
//
|
|
161
|
+
// integrationCharge = {
|
|
162
|
+
// bearer: {
|
|
163
|
+
// merchant: 100,
|
|
164
|
+
// customer: 0,
|
|
165
|
+
// },
|
|
166
|
+
// platform: {
|
|
167
|
+
// type: 'flat',
|
|
168
|
+
// value: {
|
|
169
|
+
// percentage: 0.5, //5
|
|
170
|
+
// fixed: 0,
|
|
171
|
+
// },
|
|
172
|
+
// },
|
|
173
|
+
// partner: {
|
|
174
|
+
// clientId: 'test-client-id',
|
|
175
|
+
// type: 'flat',
|
|
176
|
+
// value: {
|
|
177
|
+
// percentage: 0, //5
|
|
178
|
+
// fixed: 0,
|
|
179
|
+
// },
|
|
180
|
+
// },
|
|
181
|
+
// provider: {
|
|
182
|
+
// type: 'flat', // 50 + 100 = 150 -> 155
|
|
183
|
+
// value: {
|
|
184
|
+
// percentage: 2.0,
|
|
185
|
+
// fixed: 0,
|
|
186
|
+
// }
|
|
187
|
+
// },
|
|
188
|
+
// tax: {
|
|
189
|
+
// type: 'flat', //75 -> 230
|
|
190
|
+
// value: {
|
|
191
|
+
// percentage: 0,
|
|
192
|
+
// fixed: 0,
|
|
193
|
+
// },
|
|
194
|
+
// },
|
|
195
|
+
// cap: {
|
|
196
|
+
// minimum: undefined,
|
|
197
|
+
// maximum: undefined, // -> 200
|
|
198
|
+
// },
|
|
199
|
+
// custom: undefined,
|
|
200
|
+
// VATOnChargeAndFees: undefined
|
|
201
|
+
// };
|
|
202
|
+
//
|
|
203
|
+
// const expectedResponse: TransactionFee = {
|
|
204
|
+
// chargeBearer: 'customer',
|
|
205
|
+
// charge: 38100,
|
|
206
|
+
// provider: 15000,
|
|
207
|
+
// custom: 15000,
|
|
208
|
+
// partner: { clientId: 'test-client-id', value: 100 },
|
|
209
|
+
// platform: 500,
|
|
210
|
+
// tax: 7500,
|
|
211
|
+
// VAT: 2000,
|
|
212
|
+
// total: 22000,
|
|
213
|
+
// customer: 22000,
|
|
214
|
+
// merchant: 0,
|
|
215
|
+
// ownIntegration: false,
|
|
216
|
+
// roundUpFinalValue: false,
|
|
217
|
+
// };
|
|
218
|
+
//
|
|
219
|
+
// const result = target.calculateIntegrationCharge(
|
|
220
|
+
// integrationCharge as IntegrationCharge,
|
|
221
|
+
// payload
|
|
222
|
+
// );
|
|
223
|
+
//
|
|
224
|
+
// console.log('Result', result);
|
|
225
|
+
// expect(result).toEqual(expectedResponse);
|
|
226
|
+
// expect(result.total).toEqual(result.customer);
|
|
227
|
+
// });
|
|
228
|
+
it('should return customer as 100% of the charge', () => {
|
|
229
|
+
const payload = { currency: 'NGN', amount: 100000, chargeBearer: "customer" };
|
|
230
|
+
const expectedResponse = {
|
|
231
|
+
chargeBearer: 'customer',
|
|
232
|
+
charge: 38100,
|
|
233
|
+
provider: 15000,
|
|
234
|
+
custom: 15000,
|
|
235
|
+
partner: { clientId: 'test-client-id', value: 100 },
|
|
236
|
+
platform: 500,
|
|
237
|
+
tax: 7500,
|
|
238
|
+
VAT: 2000,
|
|
239
|
+
total: 22000,
|
|
240
|
+
customer: 22000,
|
|
241
|
+
merchant: 0,
|
|
242
|
+
ownIntegration: false,
|
|
243
|
+
roundUpFinalValue: false,
|
|
191
244
|
};
|
|
192
245
|
const result = target.calculateIntegrationCharge(integrationCharge, payload);
|
|
193
246
|
console.log('Result', result);
|
|
194
247
|
expect(result).toEqual(expectedResponse);
|
|
248
|
+
expect(result.total).toEqual(result.customer);
|
|
249
|
+
});
|
|
250
|
+
it('should round up the final value of the charge', () => {
|
|
251
|
+
const payload = { currency: 'NGN', amount: 50555, chargeBearer: "customer", roundUpFinalValue: true };
|
|
252
|
+
integrationCharge.cap.maximum = null;
|
|
253
|
+
const expectedResponse = {
|
|
254
|
+
chargeBearer: 'customer',
|
|
255
|
+
charge: 29152,
|
|
256
|
+
provider: 12528,
|
|
257
|
+
custom: 12528,
|
|
258
|
+
partner: { clientId: 'test-client-id', value: 51 },
|
|
259
|
+
platform: 253,
|
|
260
|
+
tax: 3792,
|
|
261
|
+
VAT: 2916,
|
|
262
|
+
total: 32100,
|
|
263
|
+
customer: 32100,
|
|
264
|
+
merchant: 0,
|
|
265
|
+
ownIntegration: false,
|
|
266
|
+
extra: 32,
|
|
267
|
+
roundUpFinalValue: true
|
|
268
|
+
};
|
|
269
|
+
const result = charge_action_1.ChargeAction.calculateIntegrationCharge(integrationCharge, payload);
|
|
270
|
+
console.log('Result', result);
|
|
271
|
+
expect(result).toEqual(expectedResponse);
|
|
272
|
+
expect(result.total).toEqual(result.customer);
|
|
195
273
|
});
|
|
196
274
|
// Add more test cases for calculateCharge function covering different scenarios and edge cases
|
|
197
275
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charge.action.test.js","sourceRoot":"","sources":["../../../src/test/actions/charge.action.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAsD;
|
|
1
|
+
{"version":3,"file":"charge.action.test.js","sourceRoot":"","sources":["../../../src/test/actions/charge.action.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAsD;AAEtD,+DAA2D;AAE3D,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAE3C,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;QACpD,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;YAC/D,MAAM,MAAM,GAAmB;gBAC7B,OAAO,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE;gBAC1C,MAAM,EAAE,IAAI;gBACZ,QAAQ,EAAE,CAAC;gBACX,MAAM,EAAE,CAAC;gBACT,QAAQ,EAAE,CAAC;gBACX,GAAG,EAAE,CAAC;gBACN,GAAG,EAAE,CAAC;gBACN,KAAK,EAAE,IAAI;aACZ,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,CAAC,2BAA2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gBACb,QAAQ,EAAE,KAAK;gBACf,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE,EAAE;gBAClD,QAAQ,EAAE,GAAG;gBACb,GAAG,EAAE,IAAI;gBACT,GAAG,EAAE,IAAI;gBACT,KAAK,EAAE,KAAK;gBACZ,QAAQ,EAAE,KAAK;gBACf,QAAQ,EAAE,CAAC;gBACX,cAAc,EAAE,KAAK;gBACrB,KAAK,EAAE,EAAE;gBACT,iBAAiB,EAAE,IAAI;aACxB,CAAC;YAEF,MAAM,MAAM,GAAG,4BAAY,CAAC,0BAA0B,CACpD,iBAAsC,EACtC,OAAO,CACR,CAAC;YAEF,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC9B,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;YACzC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,+FAA+F;IACjG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -37,6 +37,23 @@ describe('query ', function () {
|
|
|
37
37
|
console.log('Response', JSON.stringify(response), response.filter);
|
|
38
38
|
expect(response).not.toBeNull();
|
|
39
39
|
}));
|
|
40
|
+
it('Date Test', () => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const queryFilter = { a: 1, b: 2, dateFrom: "29-09-2024T06:00:00.000Z", dateTo: "29-09-2024T06:00:00.000Z" };
|
|
42
|
+
const response = database_1.query.resolveObjectToMongoDBQuery(queryFilter, {
|
|
43
|
+
searchFields: ['email', 'phoneNumber', 'name', 'firstName', 'lastName', 'fullName'],
|
|
44
|
+
});
|
|
45
|
+
console.log('Response', JSON.stringify(response), response.filter);
|
|
46
|
+
expect(response).not.toBeNull();
|
|
47
|
+
}));
|
|
48
|
+
it('Date Test With Timestamp', () => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
const queryFilter = { a: 1, b: 2, dateFrom: 1727589600, dateTo: 1727676000 };
|
|
50
|
+
const response = database_1.query.resolveObjectToMongoDBQuery(queryFilter, {
|
|
51
|
+
searchFields: ['email', 'phoneNumber', 'name', 'firstName', 'lastName', 'fullName'],
|
|
52
|
+
dateFormat: "X"
|
|
53
|
+
});
|
|
54
|
+
console.log('Response', JSON.stringify(response), response.filter);
|
|
55
|
+
expect(response).not.toBeNull();
|
|
56
|
+
}));
|
|
40
57
|
});
|
|
41
58
|
describe('# Test Redis connection', function () {
|
|
42
59
|
let channel = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.spec.js","sourceRoot":"","sources":["../../../src/test/database/test.spec.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;AACb,+DAA2D;AAE3D,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,uBAAuB,CAAC;AAE1D,6CAAuC;AACvC,6CAA0C;
|
|
1
|
+
{"version":3,"file":"test.spec.js","sourceRoot":"","sources":["../../../src/test/database/test.spec.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;AACb,+DAA2D;AAE3D,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,uBAAuB,CAAC;AAE1D,6CAAuC;AACvC,6CAA0C;AAG1C,QAAQ,CAAC,QAAQ,EAAE;IACjB,IAAI,OAAsB,CAAC;IAC3B,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,GAAG,IAAI,8BAAa,EAAE,CAAC;QAC9B,OAAO,CAAC,eAAe,GAAG,gBAAgB,CAAC;QAC3C,OAAO,CAAC,eAAe,GAAG,gBAAgB,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,+BAA+B,EAAE,GAAS,EAAE;QAC7C,MAAM,WAAW,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC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
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.translate = void 0;
|
|
16
|
-
const axios_1 = __importDefault(require("axios"));
|
|
17
|
-
const logger_1 = require("../logger/logger");
|
|
18
13
|
const errors_1 = require("../helpers/errors");
|
|
19
|
-
const
|
|
14
|
+
const helpers_1 = require("../helpers");
|
|
15
|
+
const logger_1 = require("../logger/logger");
|
|
16
|
+
const _axios = (0, helpers_1.getAxiosInstance)({
|
|
20
17
|
baseURL: process.env.UTILITY_SERVICE_URL || 'http://utility-service',
|
|
21
18
|
headers: {
|
|
22
19
|
source: 'internal',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/translations/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/translations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAAsD;AACtD,wCAA8C;AAC9C,6CAA0C;AAE1C,MAAM,MAAM,GAAG,IAAA,0BAAgB,EAAC;IAC9B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,wBAAwB;IACpE,OAAO,EAAE;QACP,MAAM,EAAE,UAAU;KACnB;CACF,CAAC,CAAC;AASI,MAAM,SAAS,GAAG,CAAO,MAAuB,EAAmB,EAAE;;IAC1E,IAAI,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,UAAU;YAAE,OAAO,MAAM,CAAC,IAAI,CAAC;QAC3C,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,IAAI,CAAC;QAClD,IAAI,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,UAAU;YAAE,OAAO,MAAM,CAAC,IAAI,CAAC;QAEjE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,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