-
Notifications
You must be signed in to change notification settings - Fork 76
/
errors.py
81 lines (78 loc) · 3.69 KB
/
errors.py
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
error_reference = {
"expense_report": {
'category_reference_error': {
'regex': r"An error occured in a upsert request: Invalid category reference key \d+ for entity \d+",
'keys': ['expense_category', 'employee']
},
'account_reference_error': {
'regex': r"An error occured in a upsert request: Invalid account reference key \d+ for subsidiary \d+",
'keys': ['account', 'subsidiary']
},
'project_reference_error': {
'regex': r"An error occured in a upsert request: Invalid customer reference key \d+ for entity \d+",
'keys': ['customer', 'employee']
},
'location_reference_error': {
'regex': r"An error occured in a upsert request: Invalid location reference key \d+ for subsidiary \d+",
'keys': ['location', 'subsidiary']
},
'department_reference_error': {
'regex':r"An error occured in a upsert request: Invalid department reference key \d+ for subsidiary \d+" ,
'keys': ['department', 'subsidiary']
},
'currency_reference_error': {
'regex': r"An error occured in a upsert request: Invalid currency reference key \d+ for subsidiary \d+",
'keys': ['currency', 'subsidiary']
}
},
"bills": {
'bill_account_reference_error': {
'regex': r"An error occured in a upsert request: Invalid account reference key \d+ for subsidiary \d+",
'keys': ['account', 'subsidiary']
},
'location_reference_error': {
'regex': r"An error occured in a upsert request: Invalid location reference key \d+ for subsidiary \d+",
'keys': ['location', 'subsidiary']
},
'department_reference_error': {
'regex':r"An error occured in a upsert request: Invalid department reference key \d+ for subsidiary \d+" ,
'keys': ['department', 'subsidiary']
},
'currency_reference_error': {
'regex': r"An error occured in a upsert request: Invalid currency reference key \d+ for subsidiary \d+",
'keys': ['currency', 'subsidiary']
},
'vendor_reference_error': {
'regex': r"An error occured in a upsert request: Invalid entity reference key \d+ for subsidiary \d+",
'keys': ['vendor', 'subsidiary']
}
},
"journal_entry": {
'location_reference_error': {
'regex': r"An error occured in a upsert request: Invalid location reference key \d+ for subsidiary \d+",
'keys': ['location', 'subsidiary']
},
'department_reference_error': {
'regex':r"An error occured in a upsert request: Invalid department reference key \d+ for subsidiary \d+" ,
'keys': ['department', 'subsidiary']
},
'account_reference_error': {
'regex': r"An error occured in a upsert request: Invalid account reference key \d+ for subsidiary \d+",
'keys': ['account', 'subsidiary']
},
'currency_reference_error': {
'regex': r"An error occured in a upsert request: Invalid currency reference key \d+ for subsidiary \d+",
'keys': ['currency', 'subsidiary']
},
'project_reference_error': {
'regex': r"An error occured in a upsert request: Invalid customer reference key \d+ for entity \d+",
'keys': ['customer', 'employee']
},
}
}
list_of_dicts = [
['expense_category', 'employee'], ['account', 'subsidiary'],
['customer', 'employee'], ['location', 'subsidiary'],
['department', 'subsidiary'], ['currency', 'subsidiary'],
['vendor', 'subsdiary']
]