forked from softwaregroup-bg/ut-rule
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.js
More file actions
32 lines (29 loc) · 2.2 KB
/
Copy patherrors.js
File metadata and controls
32 lines (29 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
module.exports = function error({utError: {defineError, getError, fetchErrors}}) {
if (!getError('rule')) {
const Rule = defineError('rule', null, 'ut-rule rule error', 'error');
defineError('generic', Rule, 'Rule generic');
defineError('ruleNotExists', Rule, 'Rule does not exists');
defineError('exceedMaxLimitAmount', Rule, 'Transaction amount is above maximum');
defineError('exceedMinLimitAmount', Rule, 'Transaction amount is below minimum');
defineError('reachedDailyLimitAmount', Rule, 'Daily amount limit reached');
defineError('reachedWeeklyLimitAmount', Rule, 'Weekly amount limit reached');
defineError('reachedMonthlyLimitAmount', Rule, 'Monthly amount limit reached');
defineError('exceedDailyLimitAmount', Rule, 'Daily amount limit exceeded');
defineError('exceedWeeklyLimitAmount', Rule, 'Weekly amount limit exceeded');
defineError('exceedMonthlyLimitAmount', Rule, 'Monthly amount limit exceeded');
defineError('exceedDailyLimitCount', Rule, 'Daily count limit reached');
defineError('exceedWeeklyLimitCount', Rule, 'Weekly count limit reached');
defineError('exceedMonthlyLimitCount', Rule, 'Monthly count limit reached');
defineError('duplicatedPriority', Rule, 'Rule with this priority already exists');
defineError('securityViolation', Rule, 'Unauthorized operation');
defineError('unauthorizedMinLimitAmount', Rule, 'Transaction amount below minimum unauthorized');
defineError('unauthorizedMaxLimitAmount', Rule, 'Transaction amount above maximum unauthorized');
defineError('unauthorizedDailyLimitAmount', Rule, 'Daily amount limit unauthorized');
defineError('unauthorizedDailyLimitCount', Rule, 'Daily count limit unauthorized');
defineError('unauthorizedWeeklyLimitAmount', Rule, 'Weekly amount limit unauthorized');
defineError('unauthorizedWeeklyLimitCount', Rule, 'Weekly count limit unauthorized');
defineError('unauthorizedMonthlyLimitAmount', Rule, 'Monthly amount limit unauthorized');
defineError('unauthorizedMonthlyLimitCount', Rule, 'Monthly count limit unauthorized');
}
return fetchErrors('rule');
};