@os1-platform/dispatch-mobile 3.1.1 → 3.1.4

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 (58) hide show
  1. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +41 -21
  2. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
  3. package/lib/commonjs/components/executiontasks/validateOTP/constants.js +2 -1
  4. package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -1
  5. package/lib/commonjs/components/executiontasks/validateOTP/utils.js +12 -3
  6. package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -1
  7. package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +1 -1
  8. package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
  9. package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +1 -1
  10. package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  11. package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +6 -7
  12. package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  13. package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +1 -0
  14. package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  15. package/lib/commonjs/ui/screens/DropCashScreen.js +3 -2
  16. package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
  17. package/lib/commonjs/utils/ExecTaskUtils.js +2 -0
  18. package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
  19. package/lib/commonjs/utils/Logger.js +18 -0
  20. package/lib/commonjs/utils/Logger.js.map +1 -1
  21. package/lib/commonjs/utils/SdkUtils.js +4 -1
  22. package/lib/commonjs/utils/SdkUtils.js.map +1 -1
  23. package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js +42 -22
  24. package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
  25. package/lib/module/components/executiontasks/validateOTP/constants.js +1 -0
  26. package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -1
  27. package/lib/module/components/executiontasks/validateOTP/utils.js +13 -4
  28. package/lib/module/components/executiontasks/validateOTP/utils.js.map +1 -1
  29. package/lib/module/manager/dispatch/DispatchStateContainer.js +2 -2
  30. package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
  31. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +1 -1
  32. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  33. package/lib/module/manager/syncmanager/events/ETEventsManager.js +6 -7
  34. package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  35. package/lib/module/manager/syncmanager/events/EventsSyncManager.js +1 -0
  36. package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  37. package/lib/module/ui/screens/DropCashScreen.js +3 -2
  38. package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
  39. package/lib/module/utils/ExecTaskUtils.js +2 -0
  40. package/lib/module/utils/ExecTaskUtils.js.map +1 -1
  41. package/lib/module/utils/Logger.js +18 -0
  42. package/lib/module/utils/Logger.js.map +1 -1
  43. package/lib/module/utils/SdkUtils.js +4 -1
  44. package/lib/module/utils/SdkUtils.js.map +1 -1
  45. package/lib/typescript/components/executiontasks/validateOTP/constants.d.ts +1 -0
  46. package/lib/typescript/utils/Logger.d.ts +1 -0
  47. package/package.json +5 -4
  48. package/src/components/executiontasks/validateOTP/ValidateOTPET.tsx +40 -19
  49. package/src/components/executiontasks/validateOTP/constants.ts +2 -0
  50. package/src/components/executiontasks/validateOTP/utils.ts +26 -4
  51. package/src/manager/dispatch/DispatchStateContainer.tsx +3 -1
  52. package/src/manager/dispatchCodes/ReasonCodeContainer.ts +1 -1
  53. package/src/manager/syncmanager/events/ETEventsManager.ts +6 -7
  54. package/src/manager/syncmanager/events/EventsSyncManager.ts +1 -0
  55. package/src/ui/screens/DropCashScreen.tsx +28 -29
  56. package/src/utils/ExecTaskUtils.ts +2 -0
  57. package/src/utils/Logger.ts +18 -0
  58. package/src/utils/SdkUtils.ts +3 -0
@@ -61,6 +61,7 @@ import {
61
61
  INVALID_OTP_LENGTH,
62
62
  INVALID_OTP_ONE_ATTEMPT_LEFT,
63
63
  OTP_SENT_SUCCESSFULLY,
64
+ TAG_VERIFY_OTP,
64
65
  UNABLE_TO_SEND_OTP,
65
66
  } from './constants';
66
67
 
@@ -89,6 +90,7 @@ import {
89
90
  SeverityLevelValue,
90
91
  } from '../../../analytics/sentry/SentrySdkConstants';
91
92
  import { fireEventWithScreenName } from '../../../analytics/sentry/SentryAnalyticsUtils';
93
+ import Logger, { LOG_TYPE } from '../../../utils/Logger';
92
94
 
93
95
  const ValidateOTPET: FC<ValidateOTPInput> = (props) => {
94
96
  const { contacts, navigation } = props;
@@ -284,28 +286,47 @@ const ValidateOTPET: FC<ValidateOTPInput> = (props) => {
284
286
  },
285
287
  };
286
288
 
289
+ Logger.getInstance().log(TAG_VERIFY_OTP, `handleContactListProceed:payloadForGenerateOTP : ${JSON.stringify(payload)}`);
290
+
287
291
  const response = await generateOTP(payload, { ...props, domain });
288
292
 
289
- if (!response?.status) {
290
- if (!response.status && response?.code === '101080001017') {
291
- setCurrentScreen(VALIDATE_OTP_SCREENS.OTP_VIEW);
292
- setLoading(false);
293
- setSnackBar({
294
- show: true,
295
- message: response?.data?.result?.message || UNABLE_TO_SEND_OTP,
296
- type: SnackBarType.OTP_FAILED,
297
- });
298
- } else {
299
- setLoading(false);
300
- setSnackBar({
301
- show: true,
302
- message: response?.data?.result?.message || ERROR_GENERATING_OTP,
303
- type: SnackBarType.OTP_FAILED,
304
- });
305
- }
293
+ Logger.getInstance().log(TAG_VERIFY_OTP, `handleContactListProceed:responseForGenerateOTP : ${JSON.stringify(response)}`);
306
294
 
295
+ if (response?.status != undefined) {
296
+ Logger.getInstance().log(TAG_VERIFY_OTP, `handleContactListProceed:response.status != undefined : ${JSON.stringify(response)}`);
297
+ if (!response?.status) {
298
+ Logger.getInstance().log(TAG_VERIFY_OTP, `handleContactListProceed:response.status == false : ${JSON.stringify(response)}`);
299
+ if (response?.code === '101080001017') {
300
+ setCurrentScreen(VALIDATE_OTP_SCREENS.OTP_VIEW);
301
+ setLoading(false);
302
+ Logger.getInstance().log(TAG_VERIFY_OTP, `handleContactListProceed:${UNABLE_TO_SEND_OTP}`);
303
+ setSnackBar({
304
+ show: true,
305
+ message: response?.data?.result?.message || UNABLE_TO_SEND_OTP,
306
+ type: SnackBarType.OTP_FAILED,
307
+ });
308
+ } else {
309
+ setLoading(false);
310
+ Logger.getInstance().log(TAG_VERIFY_OTP, `handleContactListProceed:${ERROR_GENERATING_OTP}`);
311
+ setSnackBar({
312
+ show: true,
313
+ message: response?.data?.result?.message || ERROR_GENERATING_OTP,
314
+ type: SnackBarType.OTP_FAILED,
315
+ });
316
+ }
317
+ return;
318
+ }
319
+ }else{
320
+ Logger.getInstance().log(TAG_VERIFY_OTP, `handleContactListProceed:response.status == undefined : ${JSON.stringify(response)}`);
321
+ setLoading(false);
322
+ setSnackBar({
323
+ show: true,
324
+ message: response?.data?.result?.message || ERROR_GENERATING_OTP,
325
+ type: SnackBarType.OTP_FAILED,
326
+ });
307
327
  return;
308
328
  }
329
+ Logger.getInstance().log(TAG_VERIFY_OTP, `handleContactListProceed:response.status == true : ${JSON.stringify(response)}`);
309
330
 
310
331
  const resendCountValue =
311
332
  Number(
@@ -322,9 +343,9 @@ const ValidateOTPET: FC<ValidateOTPInput> = (props) => {
322
343
  message: OTP_SENT_SUCCESSFULLY,
323
344
  type: SnackBarType.OTP_SUCCESS,
324
345
  });
325
- } catch (error) {
346
+ } catch (error: any) {
347
+ Logger.getInstance().log(TAG_VERIFY_OTP,`handleContactListProceed:catch : ${error.message}`)
326
348
  setLoading(false);
327
- console.error('Error in handleContactListProceed:', error);
328
349
  setSnackBar({
329
350
  show: true,
330
351
  message: ERROR_GENERATING_OTP,
@@ -29,3 +29,5 @@ export const DEFAULT_RETRY_CONFIG = {
29
29
  enableDelay: 60,
30
30
  maxResends: 5,
31
31
  };
32
+
33
+ export const TAG_VERIFY_OTP = 'VerifyOTP';
@@ -2,7 +2,7 @@
2
2
  import * as jsonLogic from 'json-logic-js';
3
3
  import Logger, { LOG_TYPE } from '../../../utils/Logger';
4
4
  import { createApiData, getAxiosApiResponse } from '../../../utils/ApiUtils';
5
- import { DEFAULT_RETRY_CONFIG } from './constants';
5
+ import { DEFAULT_RETRY_CONFIG, TAG_VERIFY_OTP } from './constants';
6
6
  import type {
7
7
  ResendOTPConfigType,
8
8
  EmailAndPhoneResponse,
@@ -56,8 +56,14 @@ export const generateOTP = async (
56
56
  isCustomConfig ? props.otpGeneration : undefined
57
57
  );
58
58
 
59
+ Logger.getInstance().log(TAG_VERIFY_OTP, `generateOTP:apiData : ${JSON.stringify(apiData)}`);
60
+
61
+
59
62
  const apiResponse = await getAxiosApiResponse(apiData);
60
63
 
64
+ Logger.getInstance().log(TAG_VERIFY_OTP, `generateOTP:apiResponse : ${JSON.stringify(apiResponse)}`);
65
+
66
+
61
67
  if (isCustomConfig && apiData.responseJsonLogic) {
62
68
  return jsonLogic.apply(
63
69
  <jsonLogic.RulesLogic>apiData.responseJsonLogic,
@@ -72,7 +78,10 @@ export const generateOTP = async (
72
78
  error.message,
73
79
  LOG_TYPE.SDK_ERROR
74
80
  );
75
- console.error('error: ', JSON.stringify(error));
81
+
82
+ Logger.getInstance().log(TAG_VERIFY_OTP, `generateOTP:catch : ${error.message}`);
83
+
84
+ console.error('error: ', error.message);
76
85
  return error?.response?.data ?? false;
77
86
  }
78
87
  };
@@ -94,8 +103,12 @@ export const verifyOTP = async (
94
103
  isCustomConfig ? props.validationApi : undefined
95
104
  );
96
105
 
106
+ Logger.getInstance().log(TAG_VERIFY_OTP, `verifyOTP:apiData : ${JSON.stringify(apiData)}`);
107
+
97
108
  const apiResponse = await getAxiosApiResponse(apiData);
98
109
 
110
+ Logger.getInstance().log(TAG_VERIFY_OTP, `verifyOTP:apiResponse : ${JSON.stringify(apiResponse)}`);
111
+
99
112
  if (isCustomConfig && apiData.responseJsonLogic) {
100
113
  return jsonLogic.apply(
101
114
  <jsonLogic.RulesLogic>apiData.responseJsonLogic,
@@ -110,7 +123,8 @@ export const verifyOTP = async (
110
123
  error.message,
111
124
  LOG_TYPE.SDK_ERROR
112
125
  );
113
- console.error('error: ', JSON.stringify(error));
126
+ console.error('error: ', error.message);
127
+ Logger.getInstance().log(TAG_VERIFY_OTP, `verifyOTP:catch : ${error.message}`);
114
128
  return error?.response?.data ?? false;
115
129
  }
116
130
  };
@@ -132,8 +146,13 @@ export const resendOTP = async (
132
146
  isCustomConfig ? props.resendApi : undefined
133
147
  );
134
148
 
149
+ Logger.getInstance().log(TAG_VERIFY_OTP, `resendOTP:apiData : ${JSON.stringify(apiData)}`);
150
+
135
151
  const apiResponse = await getAxiosApiResponse(apiData);
136
152
 
153
+ Logger.getInstance().log(TAG_VERIFY_OTP, `resendOTP:apiResponse : ${JSON.stringify(apiResponse)}`);
154
+
155
+
137
156
  if (isCustomConfig && apiData.responseJsonLogic) {
138
157
  return jsonLogic.apply(
139
158
  <jsonLogic.RulesLogic>apiData.responseJsonLogic,
@@ -141,6 +160,8 @@ export const resendOTP = async (
141
160
  );
142
161
  }
143
162
 
163
+
164
+
144
165
  return apiResponse.data;
145
166
  } catch (error: any) {
146
167
  Logger.getInstance().logEvent(
@@ -148,7 +169,8 @@ export const resendOTP = async (
148
169
  error.message,
149
170
  LOG_TYPE.SDK_ERROR
150
171
  );
151
- console.error('error: ', JSON.stringify(error));
172
+ Logger.getInstance().log(TAG_VERIFY_OTP, `resendOTP:catch : ${error.message}`);
173
+ console.error('error: ', error.message);
152
174
  return error?.response?.data ?? false;
153
175
  }
154
176
  };
@@ -32,7 +32,7 @@ import { RouteParams } from '../../ui/uiConfig/RouteParams';
32
32
  import { debounce } from 'lodash';
33
33
  import dispatchEvent from '../../events/EventDispatcher';
34
34
  import EventCodeContainer from '../dispatchCodes/EventCodeContainer';
35
- import { GO_BACK_EVENT_CODE, REASON_NOT_USED } from '../../constants/constants';
35
+ import { GO_BACK_EVENT_CODE, REASON_NOT_USED, RETRY_LIMIT_REACHED_CODE } from '../../constants/constants';
36
36
  import AppSyncManager from '../syncmanager/AppSyncManager';
37
37
  import { DispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';
38
38
 
@@ -555,6 +555,8 @@ export default class DispatchStateContainer {
555
555
  navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
556
556
  } else {
557
557
  if (_eventCode === GO_BACK_EVENT_CODE) failureCodes = [];
558
+ else if (etOutput.reasonCode === RETRY_LIMIT_REACHED_CODE)
559
+ failureCodes = [];
558
560
  else
559
561
  failureCodes = await reasonsContainer.getReasonCodes(
560
562
  route.params[RouteParams.NEXT_STATES].input.applicableReasons
@@ -105,7 +105,7 @@ export default class ReasonCodeContainer {
105
105
  } catch (error: any) {
106
106
  Logger.getInstance().logEvent(
107
107
  'fetchReasonCode',
108
- JSON.stringify(error),
108
+ error.message,
109
109
  LOG_TYPE.SDK_ERROR
110
110
  );
111
111
  throw new BaseError(ErrorCodes.REASON_CODE_API_ERROR, error.message);
@@ -638,11 +638,10 @@ export default class ETEventsManager {
638
638
  async getRowToSync(id: string, dispatchId: string): Promise<EventRow[]> {
639
639
  const sqlResult = await Database.executeQuery(
640
640
  `SELECT * from ${EVENTS_TABLE}\
641
- WHERE ${EVENTS_COLUMNS.ID} = ? and \
642
- ${EVENTS_COLUMNS.DISPATCH_ID} = ? and \
641
+ WHERE ${EVENTS_COLUMNS.DISPATCH_ID} = ? and \
643
642
  ${EVENTS_COLUMNS.SYNCED} = 0 \
644
643
  ORDER BY ${EVENTS_COLUMNS.ID} ASC;`,
645
- [id, dispatchId]
644
+ [dispatchId]
646
645
  );
647
646
  return sqlResult.rows._array;
648
647
  }
@@ -654,11 +653,11 @@ export default class ETEventsManager {
654
653
  (SELECT *, \
655
654
  (SELECT SUM(${EVENTS_COLUMNS.DATA_LENGTH}) \
656
655
  FROM ${EVENTS_TABLE} \
657
- WHERE id <= t.id and ${EVENTS_COLUMNS.ID} > ${id} and ${EVENTS_COLUMNS.DISPATCH_ID} \ = '${dispatchId}' and ${EVENTS_COLUMNS.DATA_LENGTH} > 0 and ${EVENTS_COLUMNS.SYNCED} = 0 \
656
+ WHERE ${EVENTS_COLUMNS.DISPATCH_ID} \ = '${dispatchId}' and ${EVENTS_COLUMNS.DATA_LENGTH} > 0 and ${EVENTS_COLUMNS.SYNCED} = 0 \
658
657
  ) total \
659
658
  FROM ${EVENTS_TABLE} t \
660
659
  ) q \
661
- WHERE total <= ${BULK_DATA_LIMIT} \
660
+ WHERE ${EVENTS_COLUMNS.DISPATCH_ID} \ = '${dispatchId}' and ${EVENTS_COLUMNS.DATA_LENGTH} > 0 and ${EVENTS_COLUMNS.SYNCED} = 0 and total <= ${BULK_DATA_LIMIT} \
662
661
  ORDER BY ${EVENTS_COLUMNS.ID};`;
663
662
 
664
663
  const sqlResult = await Database.executeQuery(query, []);
@@ -668,11 +667,11 @@ export default class ETEventsManager {
668
667
  (SELECT *, \
669
668
  (SELECT SUM(${EVENTS_COLUMNS.DATA_LENGTH}) \
670
669
  FROM ${EVENTS_TABLE} \
671
- WHERE id <= t.id and ${EVENTS_COLUMNS.ID} > ${id} and ${EVENTS_COLUMNS.DISPATCH_ID} \ = '${dispatchId}' and ${EVENTS_COLUMNS.DATA_LENGTH} > 0 and ${EVENTS_COLUMNS.SYNCED} = 0 and ${EVENTS_COLUMNS.ATTEMPT_COUNT} < ${MAX_RETRY_COUNT} \
670
+ WHERE ${EVENTS_COLUMNS.DISPATCH_ID} \ = '${dispatchId}' and ${EVENTS_COLUMNS.DATA_LENGTH} > 0 and ${EVENTS_COLUMNS.SYNCED} = 0 and ${EVENTS_COLUMNS.ATTEMPT_COUNT} < ${MAX_RETRY_COUNT} \
672
671
  ) total \
673
672
  FROM ${EVENTS_TABLE} t \
674
673
  ) q \
675
- WHERE total <= ${BULK_DATA_LIMIT} \
674
+ WHERE ${EVENTS_COLUMNS.DISPATCH_ID} \ = '${dispatchId}' and ${EVENTS_COLUMNS.DATA_LENGTH} > 0 and ${EVENTS_COLUMNS.SYNCED} = 0 and ${EVENTS_COLUMNS.ATTEMPT_COUNT} < ${MAX_RETRY_COUNT} and total <= ${BULK_DATA_LIMIT} \
676
675
  ORDER BY ${EVENTS_COLUMNS.ID};`;
677
676
 
678
677
  const sqlResult = await Database.executeQuery(query, []);
@@ -289,6 +289,7 @@ export default class EventsSyncManager {
289
289
  if (!this.eventsManager)
290
290
  this.eventsManager = await ETEventsManager.getInstance();
291
291
  this._retries = 0;
292
+ this.inProgress = false;
292
293
  await this.startSync();
293
294
  }
294
295
 
@@ -59,7 +59,7 @@ const DropCashScreen = ({
59
59
  useEffect(() => {
60
60
  (async () => {
61
61
  //fire sentry event
62
- fireEventWithScreenName({severityLevel:SeverityLevelValue.LOG, eventName:SentryEventNameSdkConstants.RETURN_CASH_ET_OPENED, screenName:ScreenNameSdkConstants.RETURN_CASH_ET_SCREEN});
62
+ fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.RETURN_CASH_ET_OPENED, screenName: ScreenNameSdkConstants.RETURN_CASH_ET_SCREEN });
63
63
  //
64
64
  onTaskStart(
65
65
  nextState,
@@ -72,8 +72,8 @@ const DropCashScreen = ({
72
72
 
73
73
  useEffect(() => {
74
74
  (async () => {
75
- console.log("expectedAmount:",expectedAmount);
76
- if(expectedAmount.value === 0){
75
+ console.log("expectedAmount:", expectedAmount);
76
+ if (expectedAmount.value === 0) {
77
77
  // setLoading(true);
78
78
  let dropCashETOutput = {
79
79
  amount: {
@@ -103,17 +103,16 @@ const DropCashScreen = ({
103
103
  });
104
104
  }
105
105
  // setLoading(false);
106
- }
106
+ }
107
107
  })();
108
108
  }, [expectedAmount.value])
109
109
 
110
110
 
111
111
 
112
112
  const getTotalExpected = async () => {
113
- const totalAmount: number = await DispatchExecutor.getTotalAmountMWI(
114
- mergedObjectiveId
115
- );
116
- setExpectedAmount({ ...expectedAmount, value: totalAmount });
113
+ const totalAmountArr: any[] = await DispatchExecutor.getTotalAmountMWI(mergedObjectiveId);
114
+ let finalValue = totalAmountArr.map(Number).reduce((sum, num) => sum + num, 0).toFixed(2);
115
+ setExpectedAmount({ ...expectedAmount, value: Number(finalValue) });
117
116
  };
118
117
 
119
118
  const getSelfLoopBool = async () => {
@@ -144,30 +143,30 @@ const DropCashScreen = ({
144
143
  },
145
144
  [baseETProps, navigation, route]
146
145
  );
147
-
146
+
148
147
  return (
149
148
  <View style={{ flex: 1 }}>
150
- { expectedAmount.value === 0 ? <View><ProgressDialog visible={loading} label={'Please wait...'} /></View> :
151
- <SLDropCash
152
- {...input}
153
- expectedAmount={expectedAmount}
154
- isSelfLoop={isSelfLoopTrue}
155
- navigation={navigation}
156
- mergedObjectiveId={mergedObjectiveId}
157
- taskMeta={taskMeta}
158
- onSubmitET={async (etOutput) => {
159
- if (etOutput.success || etOutput.eventCode == GO_BACK_EVENT_CODE) {
160
- await submitOutput(etOutput);
161
- } else {
162
- setResponse((_prevState: any) => {
163
- setShowAlert(true);
164
- return etOutput;
165
- });
166
- }
167
- }}
168
- />
149
+ {expectedAmount.value === 0 ? <View><ProgressDialog visible={loading} label={'Please wait...'} /></View> :
150
+ <SLDropCash
151
+ {...input}
152
+ expectedAmount={expectedAmount}
153
+ isSelfLoop={isSelfLoopTrue}
154
+ navigation={navigation}
155
+ mergedObjectiveId={mergedObjectiveId}
156
+ taskMeta={taskMeta}
157
+ onSubmitET={async (etOutput) => {
158
+ if (etOutput.success || etOutput.eventCode == GO_BACK_EVENT_CODE) {
159
+ await submitOutput(etOutput);
160
+ } else {
161
+ setResponse((_prevState: any) => {
162
+ setShowAlert(true);
163
+ return etOutput;
164
+ });
165
+ }
166
+ }}
167
+ />
169
168
  }
170
-
169
+
171
170
  <CancelOrderDialog
172
171
  visible={showAlert}
173
172
  onSubmit={async (value) => {
@@ -118,6 +118,8 @@ export function getEntityCodeByET(etId: string): string {
118
118
  return EntityCode.PROCESS_PAYMENT;
119
119
  case ExecutionTaskID.COMPLETE_PAYMENT:
120
120
  return EntityCode.COMPLETE_PAYMENT;
121
+ case ExecutionTaskID.COLLECT_PAYMENT_ET:
122
+ return EntityCode.COLLECT_PAYMENT_ET;
121
123
  case ExecutionTaskID.DELIVER_CASH:
122
124
  return EntityCode.DELIVER_CASH;
123
125
  case ExecutionTaskID.VERIFY_INPUT:
@@ -1,5 +1,8 @@
1
+ import { CoralogixRum } from '@coralogix/react-native-sdk';
1
2
  import type { DispatchSDKConfig } from '../models/sdk';
2
3
  import crashlytics from '@react-native-firebase/crashlytics';
4
+ import { CoralogixLogSeverity } from '@coralogix/react-native-sdk/src/types-external';
5
+ import SdkUtils from './SdkUtils';
3
6
 
4
7
  export const enum LOG_TYPE {
5
8
  SDK_ERROR = 'sdk_error',
@@ -39,8 +42,23 @@ class Logger {
39
42
  ) {
40
43
  crashlytics().recordError(new Error(message), TAG);
41
44
  }
45
+
42
46
  }
43
47
 
48
+ async log(Tag: string, msg: string) {
49
+ try {
50
+ let result = await SdkUtils.getRemoteConfig(0);
51
+ if (result?.enableLogging?._value && result?.enableLogging?._value === "true") {
52
+ console.log("====================================");
53
+ console.log("Logging to Coralogix: ",Tag,msg);
54
+ console.log("====================================");
55
+ CoralogixRum.log(CoralogixLogSeverity.Info, Tag, msg);
56
+ }
57
+ } catch (error:any) {
58
+ this.logEvent("DispatchSDK:RemoteConfigError:", error.message, LOG_TYPE.SDK_ERROR);
59
+ return;
60
+ }
61
+ }
44
62
 
45
63
  public static getInstance(): Logger {
46
64
  if (!Logger.instance) {
@@ -43,6 +43,9 @@ export default class SdkUtils {
43
43
  isMandatoryUpdateiOS: 'false',
44
44
  toggleInAppUpdateiOS: 'false',
45
45
  toggleInAppUpdate: 'false',
46
+ enableLogging: 'true',
47
+ enableLoggingTenantIds: '',
48
+ enableLoggingUserIds: '',
46
49
  })
47
50
  .then(() => remoteConfig().fetchAndActivate())
48
51
  .then((fetchedRemotely) => {