@os1-platform/dispatch-mobile 2.1.23 → 2.1.25
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/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.8/gc.properties +0 -0
- package/android/.gradle/7.5/checksums/checksums.lock +0 -0
- package/android/.gradle/7.5/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.5/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.5/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.5/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.5/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.5/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.5/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.5/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.5/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/config.properties +2 -0
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +18 -0
- package/android/.idea/kotlinc.xml +6 -0
- package/android/.idea/migrations.xml +10 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/other.xml +263 -0
- package/android/.idea/vcs.xml +6 -0
- package/lib/commonjs/analytics/firebase/FirebaseLogging.js +0 -3
- package/lib/commonjs/analytics/firebase/FirebaseLogging.js.map +1 -1
- package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js +0 -6
- package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js +21 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js +17 -1
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js +11 -14
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js +183 -36
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
- package/lib/commonjs/components/widgets/ProgressDialog.js +1 -1
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SnackBarCustom.js +44 -21
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/icons/blurQRCode.png +0 -0
- package/lib/commonjs/manager/syncmanager/constants.js +1 -1
- package/lib/commonjs/manager/syncmanager/constants.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +1 -4
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +6 -32
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/ui/screens/CollectPaymentScreen.js +6 -2
- package/lib/commonjs/ui/screens/CollectPaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +1 -1
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +0 -55
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/module/analytics/firebase/FirebaseLogging.js +0 -3
- package/lib/module/analytics/firebase/FirebaseLogging.js.map +1 -1
- package/lib/module/analytics/sentry/SentryAnalyticsUtils.js +0 -6
- package/lib/module/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js +2 -0
- package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js +21 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js +14 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js +11 -14
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js +187 -38
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
- package/lib/module/components/widgets/ProgressDialog.js +1 -1
- package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/module/components/widgets/SnackBarCustom.js +43 -21
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/icons/blurQRCode.png +0 -0
- package/lib/module/manager/syncmanager/constants.js +1 -1
- package/lib/module/manager/syncmanager/constants.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +1 -4
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +6 -32
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/ui/screens/CollectPaymentScreen.js +6 -2
- package/lib/module/ui/screens/CollectPaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/StartWorkFlowScreen.js +1 -1
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/utils/Logger.js +0 -55
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/typescript/components/executiontasks/collectPayment/CollectPaymentSchema.d.ts +1 -0
- package/lib/typescript/components/executiontasks/collectPayment/PaymentStyles.d.ts +20 -0
- package/lib/typescript/components/executiontasks/collectPayment/PaymentUtils.d.ts +1 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +2 -1
- package/lib/typescript/manager/syncmanager/constants.d.ts +1 -1
- package/package.json +3 -3
- package/src/analytics/firebase/FirebaseLogging.ts +2 -11
- package/src/analytics/sentry/SentryAnalyticsUtils.ts +0 -7
- package/src/components/executiontasks/collectPayment/CollectPaymentSchema.ts +2 -0
- package/src/components/executiontasks/collectPayment/PaymentStyles.ts +37 -12
- package/src/components/executiontasks/collectPayment/PaymentUtils.ts +17 -0
- package/src/components/executiontasks/collectPayment/components/CompletePayment.tsx +19 -18
- package/src/components/executiontasks/collectPayment/components/InitPayment.tsx +5 -4
- package/src/components/executiontasks/collectPayment/components/ProcessPayment.tsx +268 -91
- package/src/components/widgets/ProgressDialog.tsx +2 -0
- package/src/components/widgets/SnackBarCustom.tsx +59 -19
- package/src/icons/blurQRCode.png +0 -0
- package/src/manager/syncmanager/constants.ts +1 -1
- package/src/manager/syncmanager/document/DocumentManager.ts +6 -8
- package/src/manager/syncmanager/document/DocumentSyncManager.ts +8 -43
- package/src/ui/screens/CollectPaymentScreen.tsx +6 -3
- package/src/ui/screens/StartWorkFlowScreen.tsx +1 -1
- package/src/utils/Logger.ts +1 -58
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import {
|
|
3
4
|
Animated,
|
|
@@ -12,7 +13,11 @@ import {
|
|
|
12
13
|
import { Surface, withTheme } from 'react-native-paper';
|
|
13
14
|
import { AntDesign } from '@expo/vector-icons';
|
|
14
15
|
import { Fonts } from '../../styles/executionTasks/CommonStyles';
|
|
15
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
ScreenNameSdkConstants,
|
|
18
|
+
SentryEventNameSdkConstants,
|
|
19
|
+
SeverityLevelValue,
|
|
20
|
+
} from '../../analytics/sentry/SentrySdkConstants';
|
|
16
21
|
import { fireEventWithScreenName } from '../../analytics/sentry/SentryAnalyticsUtils';
|
|
17
22
|
|
|
18
23
|
export interface SnackbarProps {
|
|
@@ -37,6 +42,7 @@ export enum SnackBarType {
|
|
|
37
42
|
SUCCESS,
|
|
38
43
|
FAILURE,
|
|
39
44
|
WARNING,
|
|
45
|
+
PAYMENT_WARNING,
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
const SnackbarCustom = ({
|
|
@@ -52,7 +58,7 @@ const SnackbarCustom = ({
|
|
|
52
58
|
const { current: opacity } = React.useRef<Animated.Value>(
|
|
53
59
|
new Animated.Value(0.0)
|
|
54
60
|
);
|
|
55
|
-
const [hidden, setHidden] = React.useState<boolean>(
|
|
61
|
+
const [hidden, setHidden] = React.useState<boolean>(true);
|
|
56
62
|
|
|
57
63
|
const hideTimeout = React.useRef<NodeJS.Timeout | undefined>(undefined);
|
|
58
64
|
const { scale } = theme.animation;
|
|
@@ -135,7 +141,7 @@ const SnackbarCustom = ({
|
|
|
135
141
|
},
|
|
136
142
|
],
|
|
137
143
|
},
|
|
138
|
-
{ backgroundColor: colors.onSurface },
|
|
144
|
+
// { backgroundColor: colors.onSurface },
|
|
139
145
|
] as StyleProp<ViewStyle>
|
|
140
146
|
}
|
|
141
147
|
>
|
|
@@ -145,23 +151,44 @@ const SnackbarCustom = ({
|
|
|
145
151
|
? styles.fail
|
|
146
152
|
: type && type === SnackBarType.WARNING
|
|
147
153
|
? styles.warn
|
|
154
|
+
: type && type === SnackBarType.PAYMENT_WARNING
|
|
155
|
+
? styles.paymentWarn
|
|
148
156
|
: styles.main
|
|
149
157
|
}
|
|
150
158
|
>
|
|
151
159
|
{type && type === SnackBarType.FAILURE ? (
|
|
152
160
|
<AntDesign name="exclamationcircleo" size={20} color="white" />
|
|
161
|
+
) : type && type === SnackBarType.PAYMENT_WARNING ? (
|
|
162
|
+
<AntDesign name="infocirlceo" size={20} color="#D97706" />
|
|
153
163
|
) : (
|
|
154
164
|
<AntDesign name="checkcircleo" size={20} color="white" />
|
|
155
165
|
)}
|
|
156
|
-
<Text
|
|
166
|
+
<Text
|
|
167
|
+
style={[
|
|
168
|
+
styles.messageStyle,
|
|
169
|
+
type === SnackBarType.PAYMENT_WARNING && { color: '#B45309' },
|
|
170
|
+
]}
|
|
171
|
+
>
|
|
172
|
+
{message}
|
|
173
|
+
</Text>
|
|
157
174
|
<AntDesign
|
|
158
175
|
name="close"
|
|
159
|
-
size={
|
|
160
|
-
color=
|
|
176
|
+
size={20}
|
|
177
|
+
color={
|
|
178
|
+
type && type === SnackBarType.PAYMENT_WARNING
|
|
179
|
+
? '#3D445C'
|
|
180
|
+
: 'white'
|
|
181
|
+
}
|
|
161
182
|
onPress={() => {
|
|
162
183
|
setHidden(true);
|
|
163
|
-
|
|
164
|
-
|
|
184
|
+
onDismiss();
|
|
185
|
+
const cta = 'Close';
|
|
186
|
+
fireEventWithScreenName({
|
|
187
|
+
severityLevel: SeverityLevelValue.LOG,
|
|
188
|
+
eventName: SentryEventNameSdkConstants.BUTTON_CLICKED,
|
|
189
|
+
screenName: ScreenNameSdkConstants.SCAN_BAR_CUSTOM_SCREEN,
|
|
190
|
+
cta: cta,
|
|
191
|
+
});
|
|
165
192
|
}}
|
|
166
193
|
/>
|
|
167
194
|
</View>
|
|
@@ -183,40 +210,53 @@ const styles = StyleSheet.create({
|
|
|
183
210
|
justifyContent: 'space-between',
|
|
184
211
|
alignItems: 'center',
|
|
185
212
|
margin: 8,
|
|
186
|
-
borderRadius:
|
|
213
|
+
borderRadius: 8,
|
|
187
214
|
},
|
|
188
215
|
main: {
|
|
189
|
-
padding:
|
|
216
|
+
padding: 12,
|
|
190
217
|
flexDirection: 'row',
|
|
191
218
|
alignItems: 'center',
|
|
192
219
|
backgroundColor: '#059669',
|
|
193
220
|
flex: 1,
|
|
194
|
-
borderRadius:
|
|
221
|
+
borderRadius: 8,
|
|
195
222
|
},
|
|
196
223
|
fail: {
|
|
197
|
-
padding:
|
|
224
|
+
padding: 12,
|
|
198
225
|
flexDirection: 'row',
|
|
199
226
|
alignItems: 'center',
|
|
200
227
|
backgroundColor: '#DC2626',
|
|
201
228
|
flex: 1,
|
|
229
|
+
borderRadius: 8,
|
|
202
230
|
},
|
|
203
231
|
warn: {
|
|
204
|
-
padding:
|
|
232
|
+
padding: 12,
|
|
205
233
|
flexDirection: 'row',
|
|
206
234
|
alignItems: 'center',
|
|
207
235
|
backgroundColor: '#D97706',
|
|
208
236
|
flex: 1,
|
|
237
|
+
borderRadius: 8,
|
|
209
238
|
},
|
|
210
|
-
|
|
239
|
+
paymentWarn: {
|
|
240
|
+
padding: 16,
|
|
241
|
+
flexDirection: 'row',
|
|
242
|
+
alignItems: 'center',
|
|
243
|
+
backgroundColor: '#FFFBEB',
|
|
211
244
|
flex: 1,
|
|
212
|
-
|
|
213
|
-
|
|
245
|
+
borderRadius: 8,
|
|
246
|
+
},
|
|
247
|
+
messageStyle: {
|
|
248
|
+
fontSize: 14,
|
|
249
|
+
marginStart: 8,
|
|
250
|
+
marginEnd: 8,
|
|
251
|
+
width: '80%',
|
|
214
252
|
color: '#ffffff',
|
|
215
|
-
|
|
253
|
+
flex: 1,
|
|
254
|
+
fontWeight: '400',
|
|
255
|
+
lineHeight: 20,
|
|
216
256
|
fontFamily:
|
|
217
257
|
Platform.OS === 'android'
|
|
218
|
-
? Fonts.
|
|
219
|
-
: '
|
|
258
|
+
? Fonts.IBMPlexSans_400Regular
|
|
259
|
+
: 'IBMPlexSans_400Regular',
|
|
220
260
|
},
|
|
221
261
|
});
|
|
222
262
|
|
|
Binary file
|
|
@@ -4,5 +4,5 @@ export const SHARED_PREFERENCE_DISPATCH_ID = 'sharedPreferenceDispatchId';
|
|
|
4
4
|
export const SHARED_PREFERENCE_SCAN_OUTPUT = 'scanETMappedOutput';
|
|
5
5
|
export const SCAN_MERGED_OBJ_ID_OUTPUT = 'scanMergedObjectiveIDs';
|
|
6
6
|
export const POD_DOC = 'POD_DOC';
|
|
7
|
-
export const PROCESS_MAX_RETRIED_ROWS =
|
|
7
|
+
export const PROCESS_MAX_RETRIED_ROWS = true;
|
|
8
8
|
export const MAX_RETRY_COUNT = 3;
|
|
@@ -6,7 +6,7 @@ import type { SQLResultSet } from 'expo-sqlite';
|
|
|
6
6
|
export default class DocumentManager {
|
|
7
7
|
private static instance: DocumentManager;
|
|
8
8
|
|
|
9
|
-
private constructor() {}
|
|
9
|
+
private constructor() { }
|
|
10
10
|
|
|
11
11
|
public static async getInstance(): Promise<DocumentManager> {
|
|
12
12
|
if (!DocumentManager.instance) {
|
|
@@ -48,8 +48,6 @@ export default class DocumentManager {
|
|
|
48
48
|
fmsFolderID: string | null,
|
|
49
49
|
desc: string,
|
|
50
50
|
dspID: string,
|
|
51
|
-
// jobID: string,
|
|
52
|
-
// objectiveRef: string,
|
|
53
51
|
base64: boolean,
|
|
54
52
|
fileName: string,
|
|
55
53
|
fileType: string,
|
|
@@ -108,14 +106,14 @@ export default class DocumentManager {
|
|
|
108
106
|
}
|
|
109
107
|
|
|
110
108
|
public async getAllUnsyncedDocs(): Promise<DocumentRow[]> {
|
|
111
|
-
if(PROCESS_MAX_RETRIED_ROWS){
|
|
109
|
+
if (PROCESS_MAX_RETRIED_ROWS) {
|
|
112
110
|
let resultSet = await Database.executeQuery(
|
|
113
111
|
`SELECT * from ${DOCUMENT_TABLE}\
|
|
114
112
|
WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0;`,
|
|
115
113
|
[]
|
|
116
114
|
);
|
|
117
115
|
return resultSet.rows._array;
|
|
118
|
-
}else{
|
|
116
|
+
} else {
|
|
119
117
|
let resultSet = await Database.executeQuery(
|
|
120
118
|
`SELECT * from ${DOCUMENT_TABLE}\
|
|
121
119
|
WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0 AND ${DOCUMENT_COLUMNS.ATTEMPT_COUNT} < ${MAX_RETRY_COUNT};`,
|
|
@@ -154,7 +152,7 @@ export default class DocumentManager {
|
|
|
154
152
|
[sync, fmsID, attempt, id]
|
|
155
153
|
);
|
|
156
154
|
}
|
|
157
|
-
|
|
155
|
+
// This function is updating processed_file_path column for the base64 overlayed data and overlayed image file for POD. Also if it is base 64 then it is also storing temprary file path in file_path as original bae64 image.
|
|
158
156
|
public async updateProcesedFilePath(
|
|
159
157
|
id: number,
|
|
160
158
|
origialFilePath: String,
|
|
@@ -198,7 +196,7 @@ export default class DocumentManager {
|
|
|
198
196
|
|
|
199
197
|
public async getUnsyncedDocument(): Promise<DocumentRow[]> {
|
|
200
198
|
// If it is allowed max_retried_rows are allowed to process then it will refetch those data which are even have tried max attempt otherwise it will skip those events.
|
|
201
|
-
if(PROCESS_MAX_RETRIED_ROWS){
|
|
199
|
+
if (PROCESS_MAX_RETRIED_ROWS) {
|
|
202
200
|
let rs = await Database.executeQuery(
|
|
203
201
|
`SELECT * from ${DOCUMENT_TABLE}\
|
|
204
202
|
WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0 \
|
|
@@ -206,7 +204,7 @@ export default class DocumentManager {
|
|
|
206
204
|
[]
|
|
207
205
|
);
|
|
208
206
|
return rs.rows._array;
|
|
209
|
-
}else{
|
|
207
|
+
} else {
|
|
210
208
|
let rs = await Database.executeQuery(
|
|
211
209
|
`SELECT * from ${DOCUMENT_TABLE}\
|
|
212
210
|
WHERE ${DOCUMENT_COLUMNS.SYNCED} = 0 AND ${DOCUMENT_COLUMNS.ATTEMPT_COUNT} < ${MAX_RETRY_COUNT} \
|
|
@@ -14,15 +14,11 @@ import NetworkUtil from '../../../utils/NetworkUtil';
|
|
|
14
14
|
import ETEventsManager from '../events/ETEventsManager';
|
|
15
15
|
import { LAST_SYNCED_EVENT_ID, MAX_RETRY_COUNT, POD_DOC } from '../../syncmanager/constants';
|
|
16
16
|
import EventsSyncManager from '../events/EventsSyncManager';
|
|
17
|
-
import Marker, {
|
|
18
|
-
Position,
|
|
19
|
-
TextBackgroundType,
|
|
20
|
-
ImageFormat,
|
|
21
|
-
} from 'react-native-image-marker';
|
|
17
|
+
import Marker, { Position, TextBackgroundType, ImageFormat } from 'react-native-image-marker';
|
|
22
18
|
import RNFS from 'react-native-fs';
|
|
23
19
|
import Storage from '../../../utils/storage';
|
|
24
20
|
import { Platform } from 'react-native';
|
|
25
|
-
import {
|
|
21
|
+
import { SentryEventNameSdkConstants, SeverityLevelValue } from '../../../analytics/sentry/SentrySdkConstants';
|
|
26
22
|
import { fireEventWithScreenName } from '../../../analytics/sentry/SentryAnalyticsUtils';
|
|
27
23
|
const latlngToDms = require('latlng-to-dms');
|
|
28
24
|
|
|
@@ -68,8 +64,7 @@ export default class DocumentSyncManager {
|
|
|
68
64
|
this.docManager = await DocumentManager.getInstance();
|
|
69
65
|
}
|
|
70
66
|
if (hasNetwork) {
|
|
71
|
-
let documentRows: DocumentRow[] =
|
|
72
|
-
await this.docManager.getUnsyncedDocument();
|
|
67
|
+
let documentRows: DocumentRow[] = await this.docManager.getUnsyncedDocument();
|
|
73
68
|
if (documentRows?.length > 0) {
|
|
74
69
|
await this.uploadDocToServer(documentRows[0]);
|
|
75
70
|
} else {
|
|
@@ -83,11 +78,7 @@ export default class DocumentSyncManager {
|
|
|
83
78
|
msg: 'No data to sync'
|
|
84
79
|
},
|
|
85
80
|
});
|
|
86
|
-
Logger.getInstance().logEvent(
|
|
87
|
-
cta,
|
|
88
|
-
'No data to sync',
|
|
89
|
-
LOG_TYPE.SDK_ERROR
|
|
90
|
-
);
|
|
81
|
+
Logger.getInstance().logEvent(cta, 'No data to sync', LOG_TYPE.SDK_ERROR);
|
|
91
82
|
}
|
|
92
83
|
} else {
|
|
93
84
|
let cta = 'startDocumentSync-NoNetwork'
|
|
@@ -179,8 +170,6 @@ export default class DocumentSyncManager {
|
|
|
179
170
|
base64: boolean,
|
|
180
171
|
desc: string,
|
|
181
172
|
dspID: string,
|
|
182
|
-
// jobID: string,
|
|
183
|
-
// objRef: string,
|
|
184
173
|
filePath: string | null,
|
|
185
174
|
fileType: string,
|
|
186
175
|
fileName: string,
|
|
@@ -191,17 +180,12 @@ export default class DocumentSyncManager {
|
|
|
191
180
|
if (
|
|
192
181
|
isEmptyOrBlank(desc) ||
|
|
193
182
|
isEmptyOrBlank(dspID) ||
|
|
194
|
-
// isEmptyOrBlank(jobID) ||
|
|
195
|
-
// isEmptyOrBlank(objRef) ||
|
|
196
183
|
isEmptyOrBlank(fileType) ||
|
|
197
184
|
isEmptyOrBlank(fileName) ||
|
|
198
185
|
(base64 && isEmptyOrBlank(data)) ||
|
|
199
186
|
(!base64 && isEmptyOrBlank(filePath))
|
|
200
187
|
)
|
|
201
|
-
throw new BaseError(
|
|
202
|
-
BaseErrorCodes.InvalidArgumentError,
|
|
203
|
-
InvalidArgumentsError
|
|
204
|
-
);
|
|
188
|
+
throw new BaseError(BaseErrorCodes.InvalidArgumentError, InvalidArgumentsError);
|
|
205
189
|
else {
|
|
206
190
|
if (!this.docManager) {
|
|
207
191
|
this.docManager = await DocumentManager.getInstance();
|
|
@@ -211,8 +195,6 @@ export default class DocumentSyncManager {
|
|
|
211
195
|
fmsFolderID,
|
|
212
196
|
desc,
|
|
213
197
|
dspID,
|
|
214
|
-
// jobID,
|
|
215
|
-
// objRef,
|
|
216
198
|
base64,
|
|
217
199
|
fileName,
|
|
218
200
|
fileType,
|
|
@@ -229,12 +211,12 @@ export default class DocumentSyncManager {
|
|
|
229
211
|
screenName: cta,
|
|
230
212
|
cta: cta,
|
|
231
213
|
extraParams: {
|
|
232
|
-
msg: '
|
|
214
|
+
msg: 'insertResponse ' + flattenObject(insertResponse)
|
|
233
215
|
},
|
|
234
216
|
});
|
|
235
217
|
Logger.getInstance().logEvent(
|
|
236
218
|
cta,
|
|
237
|
-
'
|
|
219
|
+
'insertResponse ' + flattenObject(insertResponse),
|
|
238
220
|
LOG_TYPE.SDK_ERROR
|
|
239
221
|
);
|
|
240
222
|
return insertResponse;
|
|
@@ -247,23 +229,6 @@ export default class DocumentSyncManager {
|
|
|
247
229
|
await this.startDocumentSync();
|
|
248
230
|
}
|
|
249
231
|
|
|
250
|
-
// private async updateDocument(documentRow: DocumentRow, fmsID: string) {
|
|
251
|
-
// if (!this.docManager) this.docManager = await DocumentManager.getInstance();
|
|
252
|
-
// try {
|
|
253
|
-
// await this.docManager.markDocumentSynced(documentRow.id, fmsID);
|
|
254
|
-
// let eventsManager = await ETEventsManager.getInstance();
|
|
255
|
-
// let podId = POD_DOC + '_' + documentRow.id;
|
|
256
|
-
// await eventsManager.markPODDocEventSynced(1, 1, podId);
|
|
257
|
-
// EventsSyncManager.getInstance().startSync();
|
|
258
|
-
// } catch (err: any) {
|
|
259
|
-
// Logger.getInstance().logEvent(
|
|
260
|
-
// 'updateDocument',
|
|
261
|
-
// err.message,
|
|
262
|
-
// LOG_TYPE.SDK_WARNING
|
|
263
|
-
// );
|
|
264
|
-
// }
|
|
265
|
-
// }
|
|
266
|
-
|
|
267
232
|
// This function will update document row with attempt count and sync status
|
|
268
233
|
private async updateDocumentWithAttempt(
|
|
269
234
|
documentRow: DocumentRow,
|
|
@@ -329,7 +294,7 @@ export default class DocumentSyncManager {
|
|
|
329
294
|
Logger.getInstance().logEvent(
|
|
330
295
|
cta,
|
|
331
296
|
flattenObject(err),
|
|
332
|
-
LOG_TYPE.
|
|
297
|
+
LOG_TYPE.SDK_ERROR
|
|
333
298
|
);
|
|
334
299
|
}
|
|
335
300
|
}
|
|
@@ -79,7 +79,6 @@ const CollectPaymentScreen = ({
|
|
|
79
79
|
);
|
|
80
80
|
|
|
81
81
|
useEffect(() => {
|
|
82
|
-
|
|
83
82
|
if (
|
|
84
83
|
taskId === ExecutionTaskID.COLLECT_PAYMENT_ET &&
|
|
85
84
|
(!isMandatoryKeysPresent(route.params[RouteParams.ROOT_META_DATA], [
|
|
@@ -149,6 +148,10 @@ const CollectPaymentScreen = ({
|
|
|
149
148
|
...modifiedInput.allowedModes,
|
|
150
149
|
...updatedInput.allowedModes,
|
|
151
150
|
];
|
|
151
|
+
const index = updatedInput.allowedModes.indexOf('ONLINE');
|
|
152
|
+
if (index > -1) {
|
|
153
|
+
updatedInput.allowedModes.splice(index, 1);
|
|
154
|
+
}
|
|
152
155
|
}
|
|
153
156
|
if (!updatedInput.allowedModes?.length) {
|
|
154
157
|
navigateWithError(
|
|
@@ -191,10 +194,10 @@ const CollectPaymentScreen = ({
|
|
|
191
194
|
// };
|
|
192
195
|
|
|
193
196
|
const configData = paymentResp?.data?.data?.configDetails[0];
|
|
194
|
-
if (configData?.paymentMethods?.QR) {
|
|
197
|
+
if (configData?.paymentMethods?.QR === true) {
|
|
195
198
|
response.methods.push('QR_CODE');
|
|
196
199
|
}
|
|
197
|
-
if (configData?.paymentMethods?.paymentLink) {
|
|
200
|
+
if (configData?.paymentMethods?.paymentLink === true) {
|
|
198
201
|
response.methods.push('PAYMENT_LINK');
|
|
199
202
|
}
|
|
200
203
|
if (configData?.modesMapping) {
|
|
@@ -226,7 +226,7 @@ const StartWorkFlowScreen = ({
|
|
|
226
226
|
}
|
|
227
227
|
} catch (error: any) {
|
|
228
228
|
baseETProps.showProgress(false);
|
|
229
|
-
navigateWithError(ErrorCodes.UNEXPECTED_ERROR, error.message);
|
|
229
|
+
navigateWithError(error?.code ?? ErrorCodes.UNEXPECTED_ERROR, error.message);
|
|
230
230
|
Logger.getInstance().logEvent(TAG, error.message, LOG_TYPE.SDK_ERROR);
|
|
231
231
|
}
|
|
232
232
|
})();
|
package/src/utils/Logger.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import DispatchSdkCache from '../manager/sdk/DispatchSdkCache';
|
|
2
1
|
import type { DispatchSDKConfig } from '../models/sdk';
|
|
3
|
-
import * as Sentry from '@sentry/react-native';
|
|
4
2
|
import crashlytics from '@react-native-firebase/crashlytics';
|
|
5
3
|
|
|
6
4
|
export const enum LOG_TYPE {
|
|
@@ -33,8 +31,6 @@ class Logger {
|
|
|
33
31
|
|
|
34
32
|
logEvent(TAG: string, message: string, logType: LOG_TYPE) {
|
|
35
33
|
if (this.enableLogs) console.log(TAG, message);
|
|
36
|
-
// crashlytics().log(`${TAG} - ${logType} -${message}`);
|
|
37
|
-
// this.sendSentryMessage(message, TAG, logType);
|
|
38
34
|
if (
|
|
39
35
|
logType === LOG_TYPE.SDK_WARNING ||
|
|
40
36
|
logType === LOG_TYPE.SDK_ERROR ||
|
|
@@ -42,8 +38,7 @@ class Logger {
|
|
|
42
38
|
logType === LOG_TYPE.APP_WARNING
|
|
43
39
|
) {
|
|
44
40
|
crashlytics().recordError(new Error(message), TAG);
|
|
45
|
-
|
|
46
|
-
}
|
|
41
|
+
}
|
|
47
42
|
}
|
|
48
43
|
|
|
49
44
|
|
|
@@ -53,58 +48,6 @@ class Logger {
|
|
|
53
48
|
}
|
|
54
49
|
return Logger.instance;
|
|
55
50
|
}
|
|
56
|
-
|
|
57
|
-
// public sendSentryException(exception: any, logTag: string, logType: string) {
|
|
58
|
-
// // (async () => {
|
|
59
|
-
// // try {
|
|
60
|
-
// // Sentry.captureException(
|
|
61
|
-
// // exception,
|
|
62
|
-
// // await this.getUserConfig(Severity.Error, logType, logTag)
|
|
63
|
-
// // );
|
|
64
|
-
// // } catch (error: any) {}
|
|
65
|
-
// // })();
|
|
66
|
-
// }
|
|
67
|
-
|
|
68
|
-
// public sendSentryMessage(message: string, logTag: string, logType: string) {
|
|
69
|
-
// // (async () => {
|
|
70
|
-
// // try {
|
|
71
|
-
// // Sentry.captureMessage(
|
|
72
|
-
// // message,
|
|
73
|
-
// // await this.getUserConfig(Severity.Warning, logType, logTag)
|
|
74
|
-
// // );
|
|
75
|
-
// // } catch (error: any) {}
|
|
76
|
-
// // })();
|
|
77
|
-
// }
|
|
78
|
-
|
|
79
|
-
// private async getUserConfig(
|
|
80
|
-
// logLevel: Severity,
|
|
81
|
-
// logType: string,
|
|
82
|
-
// logTag: string
|
|
83
|
-
// ) {
|
|
84
|
-
// try {
|
|
85
|
-
// const config = (await DispatchSdkCache.getInstance().getObjectFromCache(
|
|
86
|
-
// DispatchSdkCache.KEYS.SDK_CONFIG
|
|
87
|
-
// )) as DispatchSDKConfig;
|
|
88
|
-
// const dspId = await DispatchSdkCache.getInstance().getKeyFromCache(
|
|
89
|
-
// DispatchSdkCache.KEYS.DISPATCH_ID
|
|
90
|
-
// );
|
|
91
|
-
// return {
|
|
92
|
-
// user: {
|
|
93
|
-
// id: config?.userID,
|
|
94
|
-
// username: config?.userName,
|
|
95
|
-
// },
|
|
96
|
-
// tags: {
|
|
97
|
-
// dispatchId: dspId,
|
|
98
|
-
// errorTime: Date.now(),
|
|
99
|
-
// logType: logType,
|
|
100
|
-
// logTag: logTag,
|
|
101
|
-
// },
|
|
102
|
-
// level: logLevel,
|
|
103
|
-
// };
|
|
104
|
-
// } catch (error: any) {
|
|
105
|
-
// return undefined;
|
|
106
|
-
// }
|
|
107
|
-
// }
|
|
108
51
|
}
|
|
109
52
|
|
|
110
53
|
export default Logger;
|