@os1-platform/dispatch-mobile 1.3.11 → 2.0.0
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/README.md +198 -30
- package/android/.gradle/7.0.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +6 -1
- package/android/.idea/jarRepositories.xml +35 -0
- package/android/.idea/kotlinc.xml +6 -0
- package/android/.idea/misc.xml +6 -1
- package/android/local.properties +1 -1
- package/android/src/main/java/com/dispatchsdk/DispatchSdkPackage.kt +3 -1
- package/android/src/main/java/com/dispatchsdk/sharedPref/SharedPreferenceModule.kt +166 -0
- package/lib/commonjs/@types/assets/index.d.js +2 -0
- package/lib/commonjs/@types/assets/index.d.js.map +1 -0
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +4 -4
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js +0 -28
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +35 -35
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/utils.js +13 -0
- package/lib/commonjs/components/executiontasks/captureInput/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +2 -2
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +187 -112
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +16 -16
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +37 -34
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +2 -2
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +52 -52
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +71 -66
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js +2 -2
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +3 -3
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +6 -3
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +34 -34
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +54 -54
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +33 -33
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +33 -33
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js +2 -2
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +112 -47
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +326 -428
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js +13 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/interfaces.js +15 -1
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/modalConstant.js +104 -0
- package/lib/commonjs/components/executiontasks/scan/modalConstant.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +72 -37
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +9 -7
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +1099 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js +548 -159
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +52 -53
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +4 -0
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpSchema.js.map +1 -1
- package/lib/commonjs/components/utils/index.js +14 -0
- package/lib/commonjs/components/utils/index.js.map +1 -0
- package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/Card.js +88 -0
- package/lib/commonjs/components/widgets/Card.js.map +1 -0
- package/lib/commonjs/components/widgets/GoBackModal.js +48 -0
- package/lib/commonjs/components/widgets/GoBackModal.js.map +1 -0
- package/lib/commonjs/components/widgets/IconButton.js.map +1 -1
- package/lib/commonjs/components/widgets/ModalWidget.js +99 -0
- package/lib/commonjs/components/widgets/ModalWidget.js.map +1 -0
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SearchBar.js +74 -0
- package/lib/commonjs/components/widgets/SearchBar.js.map +1 -0
- package/lib/commonjs/components/widgets/SnackBarCustom.js +12 -4
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -1
- package/lib/commonjs/components/widgets/TabsComponent.js +64 -0
- package/lib/commonjs/components/widgets/TabsComponent.js.map +1 -0
- package/lib/commonjs/constants/apiConstants.js +3 -1
- package/lib/commonjs/constants/apiConstants.js.map +1 -1
- package/lib/commonjs/constants/constants.js +2 -2
- package/lib/commonjs/constants/constants.js.map +1 -1
- package/lib/commonjs/events/EventDispatcher.js +1 -5
- package/lib/commonjs/events/EventDispatcher.js.map +1 -1
- package/lib/commonjs/events/constants.js +3 -1
- package/lib/commonjs/events/constants.js.map +1 -1
- package/lib/commonjs/events/interface.js.map +1 -1
- package/lib/commonjs/index.js +32 -13
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +315 -609
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js +21 -25
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js.map +1 -1
- package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js +15 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js +2 -2
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/commonjs/manager/sdk/callbacksHandler.js +26 -0
- package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -0
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js +15 -1
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js +36 -3
- package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/constants.js +17 -0
- package/lib/commonjs/manager/syncmanager/constants.js.map +1 -0
- package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +11 -17
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +5 -6
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +16 -6
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +377 -26
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +183 -65
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +150 -37
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/commonjs/models/DispatchModels.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETBaseModels.js +4 -0
- package/lib/commonjs/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/commonjs/models/sdk.js.map +1 -1
- package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
- package/lib/commonjs/network/GraphQLClient.js.map +1 -1
- package/lib/commonjs/network/NetworkClient.js.map +1 -1
- package/lib/commonjs/network/NetworkUtils.js.map +1 -1
- package/lib/commonjs/network/client.js.map +1 -1
- package/lib/commonjs/resources/Login.js.map +1 -1
- package/lib/commonjs/resources/network.js.map +1 -1
- package/lib/commonjs/styles/SdkColors.js +4 -2
- package/lib/commonjs/styles/SdkColors.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +19 -10
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/CancellationScreen.js +38 -7
- package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CaptureInputScreen.js +11 -3
- package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +11 -4
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +26 -4
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DisplayScreen.js +11 -2
- package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +13 -6
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +39 -15
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js +0 -7
- package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +95 -28
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/GeofenceScreen.js +10 -2
- package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js +10 -2
- package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +26 -18
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +22 -11
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +34 -8
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ScanScreen.js +72 -219
- package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +51 -16
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js +13 -7
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js +20 -5
- package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/commonjs/utils/ApiUtils.js +16 -2
- package/lib/commonjs/utils/ApiUtils.js.map +1 -1
- package/lib/commonjs/utils/ExecTaskUtils.js +33 -25
- package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js +37 -4
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/commonjs/utils/fcm/FCM.js +64 -35
- package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js +82 -46
- package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/commonjs/utils/helper.js.map +1 -1
- package/lib/commonjs/utils/hooks/useModal.js +53 -0
- package/lib/commonjs/utils/hooks/useModal.js.map +1 -0
- package/lib/commonjs/utils/loginHelper.js.map +1 -1
- package/lib/commonjs/utils/storage.js +37 -2
- package/lib/commonjs/utils/storage.js.map +1 -1
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/@types/assets/index.d.js +2 -0
- package/lib/module/@types/assets/index.d.js.map +1 -0
- package/lib/module/components/dispatch/DispatchExecNavigator.js +4 -4
- package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js +1 -5
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/CaptureText.js +38 -37
- package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/utils.js +7 -0
- package/lib/module/components/executiontasks/captureInput/utils.js.map +1 -0
- package/lib/module/components/executiontasks/deliver/DeliverET.js +2 -2
- package/lib/module/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +189 -114
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/display/DisplayModalET.js +16 -16
- package/lib/module/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +39 -36
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/DropCashET.js +2 -2
- package/lib/module/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js +53 -52
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js +73 -68
- package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +1 -1
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js +3 -3
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js +3 -3
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js +6 -3
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +36 -36
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js +55 -54
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +35 -34
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +35 -35
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickupET.js +2 -2
- package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +114 -49
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +332 -433
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanSchema.js +16 -1
- package/lib/module/components/executiontasks/scan/ScanSchema.js.map +1 -1
- package/lib/module/components/executiontasks/scan/interfaces.js +12 -0
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/module/components/executiontasks/scan/modalConstant.js +94 -0
- package/lib/module/components/executiontasks/scan/modalConstant.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +72 -37
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +9 -7
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +1092 -0
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -0
- package/lib/module/components/executiontasks/scan/utils.js +528 -160
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js +54 -55
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js +4 -0
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/utils.js.map +1 -1
- package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js +1 -1
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js +2 -2
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpSchema.js.map +1 -1
- package/lib/module/components/utils/index.js +8 -0
- package/lib/module/components/utils/index.js.map +1 -0
- package/lib/module/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/module/components/widgets/Card.js +80 -0
- package/lib/module/components/widgets/Card.js.map +1 -0
- package/lib/module/components/widgets/GoBackModal.js +40 -0
- package/lib/module/components/widgets/GoBackModal.js.map +1 -0
- package/lib/module/components/widgets/IconButton.js.map +1 -1
- package/lib/module/components/widgets/ModalWidget.js +92 -0
- package/lib/module/components/widgets/ModalWidget.js.map +1 -0
- package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/module/components/widgets/SearchBar.js +66 -0
- package/lib/module/components/widgets/SearchBar.js.map +1 -0
- package/lib/module/components/widgets/SnackBarCustom.js +12 -4
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/components/widgets/SplitTextInput.js.map +1 -1
- package/lib/module/components/widgets/TabsComponent.js +55 -0
- package/lib/module/components/widgets/TabsComponent.js.map +1 -0
- package/lib/module/constants/apiConstants.js +3 -1
- package/lib/module/constants/apiConstants.js.map +1 -1
- package/lib/module/constants/constants.js +2 -2
- package/lib/module/constants/constants.js.map +1 -1
- package/lib/module/events/EventDispatcher.js +0 -3
- package/lib/module/events/EventDispatcher.js.map +1 -1
- package/lib/module/events/constants.js +3 -1
- package/lib/module/events/constants.js.map +1 -1
- package/lib/module/events/interface.js.map +1 -1
- package/lib/module/index.js +6 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/manager/dispatch/DispatchStateContainer.js +319 -610
- package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/module/manager/jobRemoval/JobRemovalManager.js +21 -19
- package/lib/module/manager/jobRemoval/JobRemovalManager.js.map +1 -1
- package/lib/module/manager/location/LocationManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js +15 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSdkCache.js +2 -2
- package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/module/manager/sdk/callbacksHandler.js +19 -0
- package/lib/module/manager/sdk/callbacksHandler.js.map +1 -0
- package/lib/module/manager/syncmanager/AppSyncManager.js +15 -1
- package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +32 -2
- package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/module/manager/syncmanager/constants.js +6 -0
- package/lib/module/manager/syncmanager/constants.js.map +1 -0
- package/lib/module/manager/syncmanager/database.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js +11 -17
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +5 -6
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +16 -6
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +377 -25
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js +183 -65
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js +147 -34
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/module/models/DispatchModels.js.map +1 -1
- package/lib/module/models/execTasks/ETBaseModels.js +1 -1
- package/lib/module/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/module/models/sdk.js.map +1 -1
- package/lib/module/native/signature/SignatureCapture.js.map +1 -1
- package/lib/module/network/GraphQLClient.js.map +1 -1
- package/lib/module/network/NetworkClient.js.map +1 -1
- package/lib/module/network/NetworkUtils.js.map +1 -1
- package/lib/module/network/client.js.map +1 -1
- package/lib/module/resources/Login.js.map +1 -1
- package/lib/module/resources/network.js.map +1 -1
- package/lib/module/styles/SdkColors.js +4 -2
- package/lib/module/styles/SdkColors.js.map +1 -1
- package/lib/module/styles/executionTasks/CommonStyles.js +19 -10
- package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/module/ui/screens/CancellationScreen.js +39 -8
- package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/module/ui/screens/CaptureInputScreen.js +12 -4
- package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/module/ui/screens/CompleteObjectiveScreen.js +12 -5
- package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +27 -5
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DisplayScreen.js +12 -3
- package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +14 -7
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +42 -16
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/ETScreensIndex.js +1 -2
- package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +96 -29
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/GeofenceScreen.js +11 -3
- package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/module/ui/screens/HttpRequestScreen.js +11 -3
- package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js +27 -19
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +23 -12
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +36 -10
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/ui/screens/ScanScreen.js +74 -222
- package/lib/module/ui/screens/ScanScreen.js.map +1 -1
- package/lib/module/ui/screens/StartWorkFlowScreen.js +51 -16
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js +14 -8
- package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/module/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/module/ui/uiConfig/RouteParams.js +19 -5
- package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/module/utils/ApiUtils.js +17 -2
- package/lib/module/utils/ApiUtils.js.map +1 -1
- package/lib/module/utils/ExecTaskUtils.js +33 -25
- package/lib/module/utils/ExecTaskUtils.js.map +1 -1
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/module/utils/SyncManagerUtils.js +37 -4
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/utils/fcm/FCM.js +64 -35
- package/lib/module/utils/fcm/FCM.js.map +1 -1
- package/lib/module/utils/fcm/FcmUtils.js +82 -46
- package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/module/utils/helper.js.map +1 -1
- package/lib/module/utils/hooks/useModal.js +43 -0
- package/lib/module/utils/hooks/useModal.js.map +1 -0
- package/lib/module/utils/loginHelper.js.map +1 -1
- package/lib/module/utils/storage.js +37 -2
- package/lib/module/utils/storage.js.map +1 -1
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/components/dispatch/DispatchExecNavigator.d.ts +2 -2
- package/lib/typescript/components/executiontasks/ExecutionTasksIndex.d.ts +3 -8
- package/lib/typescript/components/executiontasks/cancellation/CancelET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/captureInput/CaptureText.d.ts +2 -2
- package/lib/typescript/components/executiontasks/captureInput/utils.d.ts +1 -0
- package/lib/typescript/components/executiontasks/deliver/DeliverET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/deliver/DeliverETInput.d.ts +1 -0
- package/lib/typescript/components/executiontasks/deliver/SLDeliverET.d.ts +3 -3
- package/lib/typescript/components/executiontasks/display/DisplayModalET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/doodle/SignatureET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/dropCash/DropCashET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/dropCash/SLDropCash.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/FormGenerator.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/widgets/DateTimeWidget.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/widgets/DropdownWidget.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/widgets/TimeRangeSelector.d.ts +2 -2
- package/lib/typescript/components/executiontasks/httpRequest/HttpEtUtils.d.ts +1 -1
- package/lib/typescript/components/executiontasks/httpRequest/HttpRequestET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/imageCapture/CaptureSchema.d.ts +1 -0
- package/lib/typescript/components/executiontasks/imageCapture/ImageCapture.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/init/InitPaymentET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/processPayment/ProcessPaymentET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/pickup/PickupET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/pickup/SLPickupET.d.ts +3 -3
- package/lib/typescript/components/executiontasks/scan/ScanET.d.ts +3 -3
- package/lib/typescript/components/executiontasks/scan/ScanSchema.d.ts +25 -9
- package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +54 -1
- package/lib/typescript/components/executiontasks/scan/modalConstant.d.ts +37 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/CScanner.d.ts +1 -1
- package/lib/typescript/components/executiontasks/scan/sub_components/DropDownUtils.d.ts +1 -1
- package/lib/typescript/components/executiontasks/scan/sub_components/ERDropDown.d.ts +1 -1
- package/lib/typescript/components/executiontasks/scan/sub_components/SummaryPage.d.ts +21 -0
- package/lib/typescript/components/executiontasks/scan/utils.d.ts +29 -13
- package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/validateOTP/sub-components/OTPInput.d.ts +2 -2
- package/lib/typescript/components/executiontasks/verifyLocation/VerifyLocationET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/verifyOtp/VerifyOtpET.d.ts +2 -2
- package/lib/typescript/components/executiontasks/verifyOtp/VerifyOtpSchema.d.ts +3 -3
- package/lib/typescript/components/utils/index.d.ts +2 -0
- package/lib/typescript/components/widgets/CancelOrderDialog.d.ts +2 -2
- package/lib/typescript/components/widgets/Card.d.ts +17 -0
- package/lib/typescript/components/widgets/GoBackModal.d.ts +9 -0
- package/lib/typescript/components/widgets/IconButton.d.ts +2 -2
- package/lib/typescript/components/widgets/ModalWidget.d.ts +30 -0
- package/lib/typescript/components/widgets/ProgressDialog.d.ts +2 -2
- package/lib/typescript/components/widgets/SearchBar.d.ts +10 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +3 -2
- package/lib/typescript/components/widgets/SplitTextInput.d.ts +2 -2
- package/lib/typescript/components/widgets/TabsComponent.d.ts +15 -0
- package/lib/typescript/constants/apiConstants.d.ts +1 -0
- package/lib/typescript/constants/constants.d.ts +2 -2
- package/lib/typescript/events/EventDispatcher.d.ts +0 -2
- package/lib/typescript/events/constants.d.ts +2 -0
- package/lib/typescript/events/interface.d.ts +1 -1
- package/lib/typescript/index.d.ts +8 -6
- package/lib/typescript/manager/dispatch/DispatchStateContainer.d.ts +27 -19
- package/lib/typescript/manager/jobRemoval/JobRemovalManager.d.ts +0 -6
- package/lib/typescript/manager/sdk/DispatchSdkCache.d.ts +0 -1
- package/lib/typescript/manager/sdk/callbacksHandler.d.ts +13 -0
- package/lib/typescript/manager/syncmanager/AppSyncManager.d.ts +2 -1
- package/lib/typescript/manager/syncmanager/DBConfig.d.ts +63 -7
- package/lib/typescript/manager/syncmanager/constants.d.ts +5 -0
- package/lib/typescript/manager/syncmanager/document/DocumentManager.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/document/DocumentSyncManager.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/events/ETEventsManager.d.ts +11 -2
- package/lib/typescript/manager/syncmanager/events/EventsSyncManager.d.ts +3 -5
- package/lib/typescript/manager/syncmanager/events/SyncHttpClient.d.ts +4 -3
- package/lib/typescript/models/DispatchModels.d.ts +40 -41
- package/lib/typescript/models/execTasks/ETBaseModels.d.ts +21 -16
- package/lib/typescript/models/sdk.d.ts +7 -0
- package/lib/typescript/native/signature/SignatureCapture.d.ts +1 -1
- package/lib/typescript/styles/SdkColors.d.ts +1 -0
- package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +16 -7
- package/lib/typescript/ui/screens/CancellationScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/CaptureInputScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/CompleteObjectiveScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DeliverScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DisplayScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DoodleScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/DropCashScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ETScreensIndex.d.ts +1 -2
- package/lib/typescript/ui/screens/FormsScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/GeofenceScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/HttpRequestScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/ImageCaptureScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/PaymentScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/PickupScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ScanScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/StartWorkFlowScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ValidateOTPScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/WithBaseDispatchScreen.d.ts +2 -2
- package/lib/typescript/ui/uiConfig/RouteParams.d.ts +10 -4
- package/lib/typescript/utils/ExecTaskUtils.d.ts +5 -4
- package/lib/typescript/utils/SyncManagerUtils.d.ts +4 -5
- package/lib/typescript/utils/hooks/useModal.d.ts +6 -0
- package/lib/typescript/utils/storage.d.ts +15 -0
- package/package.json +5 -4
- package/tsconfig.json +0 -1
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.idea/workspace.xml +0 -131
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js +0 -26
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/ScanList.js +0 -134
- package/lib/commonjs/components/executiontasks/scan/sub_components/ScanList.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/CScanner.js +0 -105
- package/lib/commonjs/components/executiontasks/scanner/CScanner.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js +0 -27
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js +0 -164
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js +0 -15
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js +0 -40
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -93
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js +0 -278
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -83
- package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js.map +0 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js +0 -248
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js.map +0 -1
- package/lib/commonjs/ui/screens/RTScanScreen.js +0 -99
- package/lib/commonjs/ui/screens/RTScanScreen.js.map +0 -1
- package/lib/module/components/executiontasks/doodle/DoodleUtils.js +0 -19
- package/lib/module/components/executiontasks/doodle/DoodleUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scan/sub_components/ScanList.js +0 -124
- package/lib/module/components/executiontasks/scan/sub_components/ScanList.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/CScanner.js +0 -96
- package/lib/module/components/executiontasks/scanner/CScanner.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js +0 -24
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js +0 -146
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js +0 -7
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js +0 -33
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -83
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js +0 -269
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -73
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js.map +0 -1
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js +0 -238
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js.map +0 -1
- package/lib/module/ui/screens/RTScanScreen.js +0 -89
- package/lib/module/ui/screens/RTScanScreen.js.map +0 -1
- package/lib/typescript/components/executiontasks/doodle/DoodleUtils.d.ts +0 -3
- package/lib/typescript/components/executiontasks/scan/sub_components/ScanList.d.ts +0 -8
- package/lib/typescript/components/executiontasks/scanner/CScanner.d.ts +0 -7
- package/lib/typescript/components/executiontasks/scanner/ScannerSchema.d.ts +0 -75
- package/lib/typescript/components/executiontasks/scanner/ScannerUtils.d.ts +0 -15
- package/lib/typescript/components/executiontasks/scanner/returns/DropDownSelector.d.ts +0 -3
- package/lib/typescript/components/executiontasks/scanner/returns/DropDownUtils.d.ts +0 -2
- package/lib/typescript/components/executiontasks/scanner/returns/RTReasonSelection.d.ts +0 -7
- package/lib/typescript/components/executiontasks/scanner/returns/RTScan.d.ts +0 -4
- package/lib/typescript/components/executiontasks/scanner/returns/ReasonDropDown.d.ts +0 -14
- package/lib/typescript/components/executiontasks/scanner/returns/ScanList.d.ts +0 -17
- package/lib/typescript/ui/screens/RTScanScreen.d.ts +0 -3
- /package/android/.gradle/{6.8 → 7.0.2}/fileChanges/last-build.bin +0 -0
- /package/android/.gradle/{6.8 → 7.0.2}/gc.properties +0 -0
- /package/android/.gradle/{configuration-cache → 7.2/dependencies-accessors}/gc.properties +0 -0
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
3
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
-
import { clearCache, createFmsFolder
|
|
5
|
-
import
|
|
6
|
-
import { ExecutionEngine } from '@os1-platform/mobile-execution-lib';
|
|
4
|
+
import { clearCache, createFmsFolder } from '../../utils/SyncManagerUtils';
|
|
5
|
+
import { DispatchExecutor as dispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
7
6
|
import { showToast } from '../../components/widgets/Toaster';
|
|
8
|
-
import {
|
|
7
|
+
import { CustomScreens, ExecutionTaskID } from '../../models/execTasks/ETConfig';
|
|
9
8
|
import EventsSyncManager from '../syncmanager/events/EventsSyncManager';
|
|
10
9
|
import Logger, { LOG_TYPE } from '../../utils/Logger';
|
|
11
10
|
import DispatchSdkCache from '../sdk/DispatchSdkCache';
|
|
@@ -20,26 +19,26 @@ import dispatchEvent from '../../events/EventDispatcher';
|
|
|
20
19
|
import EventCodeContainer from '../dispatchCodes/EventCodeContainer';
|
|
21
20
|
import { GO_BACK_EVENT_CODE, REASON_NOT_USED } from '../../constants/constants';
|
|
22
21
|
import AppSyncManager from '../syncmanager/AppSyncManager';
|
|
22
|
+
import { DispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
23
|
+
|
|
24
|
+
// NEW CODE
|
|
25
|
+
import { BULK_DATA_LIMIT, LAST_SYNCED_EVENT_ID, SCAN_MERGED_OBJ_ID_OUTPUT, SHARED_PREFERENCE_DISPATCH_ID, SHARED_PREFERENCE_SCAN_OUTPUT } from '../syncmanager/constants';
|
|
26
|
+
import Storage from '../../utils/storage';
|
|
27
|
+
import { clearScanOutput, getScanMergedObjectID } from '../../components/executiontasks/scan/utils';
|
|
23
28
|
export default class DispatchStateContainer {
|
|
24
29
|
constructor() {
|
|
25
30
|
_defineProperty(this, "cacheKeys", DispatchSdkCache.KEYS);
|
|
26
31
|
_defineProperty(this, "cache", DispatchSdkCache.getInstance());
|
|
27
|
-
_defineProperty(this, "dispatchExecutor", new ExecutionEngine());
|
|
28
32
|
_defineProperty(this, "successRoute", null);
|
|
29
33
|
_defineProperty(this, "failureRoute", null);
|
|
30
34
|
_defineProperty(this, "_stateKeys", []);
|
|
31
35
|
_defineProperty(this, "_jobObjectives", null);
|
|
32
36
|
_defineProperty(this, "_mappedStates", new Map());
|
|
33
|
-
_defineProperty(this, "
|
|
37
|
+
_defineProperty(this, "_mappedStatesData", new Map());
|
|
38
|
+
_defineProperty(this, "saveAndProceedToNextET", debounce(async (baseETProps, etOutput, states, navigation, isLastTask, isMergedObjectiveBasedOutput) => {
|
|
34
39
|
try {
|
|
35
|
-
|
|
36
|
-
// console.log('sendETOutput start: ', new Date().getTime());
|
|
37
|
-
await this.sendETOutput(etOutput, states, isJobBasedOutput);
|
|
38
|
-
// console.log('sendETOutput end: ', new Date().getTime());
|
|
39
|
-
// console.log('moveToNextET start: ', new Date().getTime());
|
|
40
|
+
await this.sendETOutput(etOutput, states, isMergedObjectiveBasedOutput);
|
|
40
41
|
await this.moveToNextET(etOutput, baseETProps, states, navigation, isLastTask);
|
|
41
|
-
// console.log('moveToNextET end: ', new Date().getTime());
|
|
42
|
-
// console.log('saveAndProceedToNextET end: ', new Date().getTime());
|
|
43
42
|
} catch (error) {
|
|
44
43
|
Logger.getInstance().logEvent('saveAndProceed', error.message, LOG_TYPE.SDK_ERROR);
|
|
45
44
|
baseETProps.showProgress(false);
|
|
@@ -63,325 +62,179 @@ export default class DispatchStateContainer {
|
|
|
63
62
|
* Call this function when dispatch data is fetched successfully in client app
|
|
64
63
|
* @param dispatchID
|
|
65
64
|
* @param jobs
|
|
66
|
-
* @param
|
|
65
|
+
* @param dispatchWorkflows
|
|
67
66
|
* @param maxTaskReattempt
|
|
68
67
|
*/
|
|
69
|
-
async initDispatchExecutor(dispatchID, jobs,
|
|
70
|
-
if (!dispatchID || !jobs || jobs.length < 1) {
|
|
68
|
+
async initDispatchExecutor(dispatchID, jobs, dispatchWorkflows, maxTaskReattempt) {
|
|
69
|
+
if (!dispatchID || !jobs || jobs.length < 1 || !dispatchWorkflows || Object.keys(dispatchWorkflows).length < 1) {
|
|
71
70
|
Logger.getInstance().logEvent('initDispatchExecutor', InvalidArgumentsError, LOG_TYPE.SDK_WARNING);
|
|
72
71
|
throw new BaseError(BaseErrorCodes.InvalidArgumentError, InvalidArgumentsError);
|
|
73
72
|
}
|
|
74
|
-
let storage = Storage.getInstance();
|
|
75
73
|
await clearCache(dispatchID);
|
|
76
74
|
await DispatchSdkCache.getInstance().setKeyInCache(DispatchSdkCache.KEYS.DISPATCH_ID, dispatchID);
|
|
77
75
|
await createFmsFolder(dispatchID);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
failureTaskName: FinalETName.COMPLETED_FAILURE,
|
|
93
|
-
maxTaskReattempts: maxTaskReattempt,
|
|
94
|
-
logLevel: logging ? 'debug' : 'emerg'
|
|
76
|
+
|
|
77
|
+
// NEW CODE
|
|
78
|
+
let storage = Storage.getInstance();
|
|
79
|
+
const sharedPreferenceDispatchId = await storage.getSharedItem(SHARED_PREFERENCE_DISPATCH_ID);
|
|
80
|
+
if (sharedPreferenceDispatchId) {
|
|
81
|
+
if (sharedPreferenceDispatchId !== dispatchID) {
|
|
82
|
+
await Promise.all([storage.setSharedItem(SHARED_PREFERENCE_DISPATCH_ID, dispatchID), storage.setSharedItem(LAST_SYNCED_EVENT_ID, '0')]);
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
await Promise.all([storage.setSharedItem(SHARED_PREFERENCE_DISPATCH_ID, dispatchID), storage.setSharedItem(LAST_SYNCED_EVENT_ID, '0')]);
|
|
86
|
+
}
|
|
87
|
+
await dispatchExecutor.start(dispatchID, jobs, dispatchWorkflows, {
|
|
88
|
+
maxTaskReattempt,
|
|
89
|
+
eventSyncBatchSize: BULK_DATA_LIMIT
|
|
95
90
|
});
|
|
96
91
|
}
|
|
97
92
|
|
|
98
|
-
//
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
// error: error.message,
|
|
110
|
-
// jobId: o.jobId,
|
|
111
|
-
// objRef: o.objectiveId,
|
|
112
|
-
// groupId: o.groupId,
|
|
113
|
-
// additionalData: o.additionalData,
|
|
114
|
-
// }),
|
|
115
|
-
// LOG_TYPE.SDK_ERROR
|
|
116
|
-
// );
|
|
117
|
-
// }
|
|
118
|
-
// if (nState) {
|
|
119
|
-
// if (this._mappedStates.has(nState.taskId)) {
|
|
120
|
-
// let val = this._mappedStates.get(nState.taskId);
|
|
121
|
-
// val?.push({
|
|
122
|
-
// nextState: nState,
|
|
123
|
-
// objRef: o.objectiveId,
|
|
124
|
-
// jobId: o.jobId,
|
|
125
|
-
// groupId: o.groupId,
|
|
126
|
-
// additionalData: o.additionalData,
|
|
127
|
-
// });
|
|
128
|
-
// } else {
|
|
129
|
-
// this._stateKeys.push(nState.taskId);
|
|
130
|
-
// this._mappedStates.set(nState.taskId, [
|
|
131
|
-
// {
|
|
132
|
-
// nextState: nState,
|
|
133
|
-
// objRef: o.objectiveId,
|
|
134
|
-
// jobId: o.jobId,
|
|
135
|
-
// groupId: o.groupId,
|
|
136
|
-
// additionalData: o.additionalData,
|
|
137
|
-
// },
|
|
138
|
-
// ]);
|
|
139
|
-
// }
|
|
140
|
-
// }
|
|
141
|
-
// }
|
|
93
|
+
// NEW CODE
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
* @param mergedObjectiveId
|
|
97
|
+
* @returns IExecutionTaskQueryResponse {
|
|
98
|
+
* mergedObjectiveId: string;
|
|
99
|
+
* taskName: string;
|
|
100
|
+
* taskId: string;
|
|
101
|
+
* input: any;
|
|
102
|
+
* }
|
|
103
|
+
*/
|
|
142
104
|
|
|
143
|
-
async
|
|
144
|
-
if (!
|
|
145
|
-
Logger.getInstance().logEvent('
|
|
105
|
+
async queryNextET(mergedObjectiveId, statusFilter) {
|
|
106
|
+
if (!mergedObjectiveId) {
|
|
107
|
+
Logger.getInstance().logEvent('queryNextET', 'CONSTRAINTS FAILED', LOG_TYPE.SDK_ERROR);
|
|
146
108
|
throw new BaseError(ErrorCodes.MERGING_ERROR, 'CONSTRAINTS FAILED');
|
|
147
109
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
let
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
110
|
+
return await dispatchExecutor.getNextTask(mergedObjectiveId[0], statusFilter);
|
|
111
|
+
}
|
|
112
|
+
async updateScanETOutputSharedPreference(etOutput, prefixedMergedObjectiveId, prefixKey) {
|
|
113
|
+
etOutput.mergedObjectiveIds = prefixedMergedObjectiveId;
|
|
114
|
+
let storage = Storage.getInstance();
|
|
115
|
+
const output = await storage.getSharedItem(SHARED_PREFERENCE_SCAN_OUTPUT);
|
|
116
|
+
if (output) {
|
|
117
|
+
const scanETOutput = JSON.parse(output);
|
|
118
|
+
let _scanETOutput = {};
|
|
119
|
+
if (scanETOutput[prefixKey]) {
|
|
120
|
+
_scanETOutput = scanETOutput[prefixKey];
|
|
121
|
+
}
|
|
122
|
+
prefixedMergedObjectiveId.forEach(mergedId => {
|
|
123
|
+
_scanETOutput[mergedId] = etOutput;
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
// SAVE IN SHARED PREFERENCE
|
|
127
|
+
await storage.setSharedItem(SHARED_PREFERENCE_SCAN_OUTPUT, JSON.stringify({
|
|
128
|
+
...scanETOutput,
|
|
129
|
+
[prefixKey]: _scanETOutput
|
|
130
|
+
}));
|
|
131
|
+
} else {
|
|
132
|
+
const scanETOutput = {};
|
|
133
|
+
prefixedMergedObjectiveId.forEach(mergedId => {
|
|
134
|
+
scanETOutput[mergedId] = etOutput;
|
|
135
|
+
});
|
|
136
|
+
// SAVE IN SHARED PREFERENCE
|
|
137
|
+
await storage.setSharedItem(SHARED_PREFERENCE_SCAN_OUTPUT, JSON.stringify({
|
|
138
|
+
[prefixKey]: scanETOutput
|
|
139
|
+
}));
|
|
161
140
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
});
|
|
141
|
+
}
|
|
142
|
+
async updatePendingSharedPreference(eventType, prefixedMergedObjectiveId, prefixKey) {
|
|
143
|
+
let storage = Storage.getInstance();
|
|
144
|
+
const mergedIdOutput = await storage.getSharedItem(SCAN_MERGED_OBJ_ID_OUTPUT);
|
|
145
|
+
if (mergedIdOutput) {
|
|
146
|
+
const mergedIds = JSON.parse(mergedIdOutput);
|
|
147
|
+
const _mergedIds = mergedIds[prefixKey];
|
|
148
|
+
if (_mergedIds) {
|
|
149
|
+
if (eventType) {
|
|
150
|
+
_mergedIds.success.push(...prefixedMergedObjectiveId);
|
|
151
|
+
_mergedIds.pending = [];
|
|
174
152
|
} else {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
nextState: nState,
|
|
178
|
-
objRef: o.objectiveId,
|
|
179
|
-
jobId: o.jobId,
|
|
180
|
-
groupId: o.groupId,
|
|
181
|
-
additionalData: o.additionalData
|
|
182
|
-
}]);
|
|
153
|
+
_mergedIds.failure.push(...prefixedMergedObjectiveId);
|
|
154
|
+
_mergedIds.pending = [];
|
|
183
155
|
}
|
|
184
|
-
|
|
156
|
+
await storage.setSharedItem(SCAN_MERGED_OBJ_ID_OUTPUT, JSON.stringify({
|
|
157
|
+
...mergedIds,
|
|
158
|
+
[prefixKey]: _mergedIds
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
185
161
|
}
|
|
186
|
-
|
|
187
|
-
// OLD CODE
|
|
188
|
-
// console.log('bulkQueryNextET: start ', new Date().getTime());
|
|
189
|
-
// const promises: any[] = [];
|
|
190
|
-
// for (const o of jobObjectiveList) {
|
|
191
|
-
// promises.push(this.getStates(o));
|
|
192
|
-
// }
|
|
193
|
-
// OLD CODE END
|
|
194
|
-
// await Promise.all(promises);
|
|
195
|
-
|
|
196
|
-
// console.log('bulkQueryNextET: end ', new Date().getTime());
|
|
197
|
-
let taskID;
|
|
198
|
-
const currentWorkingTaskId = await this.cache.getKeyFromCache(this.cacheKeys.CURRENT_WORKING_TASK_ID);
|
|
199
|
-
if (currentWorkingTaskId) {
|
|
200
|
-
taskID = currentWorkingTaskId;
|
|
201
|
-
const taskIndx = this._stateKeys.indexOf(taskID);
|
|
202
|
-
if (taskIndx >= 0) {
|
|
203
|
-
this._stateKeys.splice(taskIndx, 1);
|
|
204
|
-
} else taskID = this._stateKeys.pop();
|
|
205
|
-
} else taskID = this._stateKeys.pop();
|
|
206
|
-
if (taskID) {
|
|
207
|
-
const nextStates = this._mappedStates.get(taskID);
|
|
208
|
-
this._mappedStates.delete(taskID);
|
|
209
|
-
|
|
210
|
-
/* console.log(
|
|
211
|
-
'🚀 ~ file: DispatchStateContainer.tsx:250 ~ DispatchStateContainer ~ nextStates:',
|
|
212
|
-
JSON.stringify(nextStates),
|
|
213
|
-
this._mappedStates
|
|
214
|
-
); */
|
|
215
|
-
return nextStates ?? [];
|
|
216
|
-
} else return null;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
// public async queryNextTask(
|
|
220
|
-
// jobObjectiveList: JobObjectiveType[]
|
|
221
|
-
// ): Promise<PromiseSettledResult<state>[]> {
|
|
222
|
-
// try {
|
|
223
|
-
// const promises: any[] = [];
|
|
224
|
-
// const _jobObjectiveList = jobObjectiveList.map((jobObjective)=>({objectiveRef:jobObjective.objectiveId,jobId:jobObjective.jobId}))
|
|
225
|
-
|
|
226
|
-
// return await this.queryObjectives(_jobObjectiveList)
|
|
227
|
-
// // jobObjectiveList.forEach((jobObjective) => {
|
|
228
|
-
// // promises.push(
|
|
229
|
-
// // this.queryObjective(jobObjective.objectiveId, jobObjective.jobId)
|
|
230
|
-
// // );
|
|
231
|
-
// // });
|
|
232
|
-
// // return await Promise.all(promises);
|
|
233
|
-
// } catch (error: any) {
|
|
234
|
-
// if (error instanceof QuerySucceededObjectiveError) {
|
|
235
|
-
// showToast('OBJECTIVE IS ALREADY COMPLETED');
|
|
236
|
-
// } else if (error instanceof EngineNotReadyError) {
|
|
237
|
-
// showToast('ENGINE NOT READY! Please Try again after some time');
|
|
238
|
-
// } else if (error instanceof ObjectiveNotFoundError) {
|
|
239
|
-
// showToast('NO SUCH OBJECTIVE FOUND');
|
|
240
|
-
// } else if (error instanceof ObjectiveNotReadyError) {
|
|
241
|
-
// showToast('OBJECTIVE NOT READY');
|
|
242
|
-
// } else if (error instanceof ObjectiveJobAlreadyCompletedError) {
|
|
243
|
-
// showToast('OBJECTIVE CANNOT BE ATTEMPTED');
|
|
244
|
-
// } else if (
|
|
245
|
-
// error instanceof JobStatusInvalidError ||
|
|
246
|
-
// error instanceof JobNotFoundError ||
|
|
247
|
-
// error instanceof EmptyJobError ||
|
|
248
|
-
// error instanceof ETIdInvalidError
|
|
249
|
-
// ) {
|
|
250
|
-
// showToast('INVALID JOB');
|
|
251
|
-
// }
|
|
252
|
-
// return null;
|
|
253
|
-
// }
|
|
254
|
-
// }
|
|
255
|
-
|
|
256
|
-
// NEW CODE
|
|
257
|
-
async bulkLockObjectiveStates(lockInput) {
|
|
258
|
-
return await this.dispatchExecutor.lockBulkObjectiveState(lockInput);
|
|
259
162
|
}
|
|
260
163
|
|
|
261
164
|
// NEW CODE
|
|
262
|
-
async
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
165
|
+
async sendETOutput(etOutput, states, isMergedObjectiveBasedOutput) {
|
|
166
|
+
const mergedObjectiveIds = states[RouteParams.NEXT_STATES].mergedObjectiveIds;
|
|
167
|
+
const taskName = states[RouteParams.NEXT_STATES].taskName;
|
|
168
|
+
const taskID = states[RouteParams.NEXT_STATES].taskId;
|
|
169
|
+
const input = states[RouteParams.NEXT_STATES].input;
|
|
170
|
+
let lockTaskResponse = true;
|
|
171
|
+
if (isMergedObjectiveBasedOutput) {
|
|
172
|
+
// NEW CODE
|
|
173
|
+
const output = etOutput;
|
|
174
|
+
let promises = [];
|
|
175
|
+
const prefixKey = this.findPrefixKey(mergedObjectiveIds, etOutput, states);
|
|
176
|
+
let defaultConfig = {
|
|
177
|
+
index: -1,
|
|
178
|
+
success: false,
|
|
179
|
+
output: {}
|
|
180
|
+
};
|
|
181
|
+
let mergedIds = {
|
|
182
|
+
success: [],
|
|
183
|
+
failure: [],
|
|
184
|
+
pending: [prefixKey]
|
|
185
|
+
};
|
|
186
|
+
const filterIds = await getScanMergedObjectID();
|
|
187
|
+
if (filterIds) {
|
|
188
|
+
mergedIds = filterIds[prefixKey];
|
|
283
189
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
if (
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
(
|
|
190
|
+
Object.keys(etOutput).forEach(mergedObjectiveId => {
|
|
191
|
+
const _output = output[mergedObjectiveId].output;
|
|
192
|
+
// PREFIX_KEY
|
|
193
|
+
if (mergedObjectiveId === 'default') {
|
|
194
|
+
const defaultOutput = output['default'].output;
|
|
195
|
+
// DELIVER AT DIFF LOCATION
|
|
196
|
+
if (defaultOutput.eventCode === REASON_NOT_USED) {
|
|
197
|
+
// DO NOT SEND OUTPUT WHEN DELIVER AT DIFF LOCATION
|
|
198
|
+
defaultOutput.eventCode = '';
|
|
199
|
+
defaultOutput.reasonCode = '';
|
|
200
|
+
lockTaskResponse = false;
|
|
201
|
+
} else {
|
|
202
|
+
defaultConfig = {
|
|
203
|
+
index: promises.length,
|
|
204
|
+
success: defaultOutput.success,
|
|
205
|
+
output: output['default']
|
|
206
|
+
};
|
|
207
|
+
promises.push(dispatchExecutor.saveTaskOutput(mergedIds.pending, taskName, taskID, {
|
|
208
|
+
input,
|
|
209
|
+
output: defaultOutput
|
|
210
|
+
}, {
|
|
211
|
+
ec: defaultOutput.eventCode,
|
|
212
|
+
rc: defaultOutput.reasonCode || ''
|
|
213
|
+
}));
|
|
214
|
+
}
|
|
215
|
+
} else {
|
|
216
|
+
promises.push(dispatchExecutor.saveTaskOutput([mergedObjectiveId], taskName, taskID, {
|
|
217
|
+
input,
|
|
218
|
+
output: _output
|
|
219
|
+
}));
|
|
291
220
|
}
|
|
292
|
-
const computedOutput = {
|
|
293
|
-
...baseResponse,
|
|
294
|
-
...(Object.keys(etOutput === null || etOutput === void 0 ? void 0 : etOutput['pendingEtData']).length ? etOutput.pendingEtData[objItem.jobId] || {} : {})
|
|
295
|
-
};
|
|
296
|
-
objItem.nextState.data.output = {
|
|
297
|
-
...computedOutput
|
|
298
|
-
};
|
|
299
|
-
etState[index].nextState.data.output = {
|
|
300
|
-
...computedOutput
|
|
301
|
-
};
|
|
302
|
-
} else objItem.nextState.data.output = {
|
|
303
|
-
...etOutput
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
/* promises.push(
|
|
307
|
-
this.dispatchExecutor.storePendingState(
|
|
308
|
-
objItem.objRef,
|
|
309
|
-
objItem.jobId,
|
|
310
|
-
objItem.nextState
|
|
311
|
-
)
|
|
312
|
-
); */
|
|
313
|
-
_objectiveState.push({
|
|
314
|
-
// objectiveRef: objItem.objRef,
|
|
315
|
-
jobId: objItem.jobId,
|
|
316
|
-
_state: objItem.nextState
|
|
317
221
|
});
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
let isPendingState = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
324
|
-
const etState = !isPendingState ? states.next_states : states.pending_states;
|
|
325
|
-
if (!etState || etState.length === 0) {
|
|
326
|
-
Logger.getInstance().logEvent('sendETOutput', 'CONSTRAINTS FAILED', LOG_TYPE.SDK_ERROR);
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
// const promises: any[] = [];
|
|
330
|
-
const _objectiveState = [];
|
|
331
|
-
const _etDataVar = isPendingState ? 'pendingEtData' : 'etData';
|
|
332
|
-
etState.forEach((objItem, index) => {
|
|
333
|
-
if (objItem.nextState.taskId === ExecutionTaskID.DELIVER_CASH) {
|
|
334
|
-
var _objItem$nextState$da3, _objItem$nextState$da4;
|
|
335
|
-
etOutput.amount = (_objItem$nextState$da3 = objItem.nextState.data) === null || _objItem$nextState$da3 === void 0 ? void 0 : (_objItem$nextState$da4 = _objItem$nextState$da3.input) === null || _objItem$nextState$da4 === void 0 ? void 0 : _objItem$nextState$da4.expectedAmount;
|
|
222
|
+
const response = await Promise.all(promises);
|
|
223
|
+
if (defaultConfig.index !== -1) {
|
|
224
|
+
// UPDATE PENDING IN SHARED PREFERENCE MERGED_SCAN_OUTPUT
|
|
225
|
+
this.updatePendingSharedPreference(defaultConfig.success, response[defaultConfig.index], prefixKey);
|
|
226
|
+
this.updateScanETOutputSharedPreference(defaultConfig.output, response[defaultConfig.index], prefixKey);
|
|
336
227
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
var _etOutput$_etDataVar$2, _etOutput$_etDataVar$3;
|
|
342
|
-
baseResponse = etOutput[_etDataVar][objItem.jobId].baseResponse;
|
|
343
|
-
((_etOutput$_etDataVar$2 = etOutput[_etDataVar][objItem.jobId]) === null || _etOutput$_etDataVar$2 === void 0 ? void 0 : _etOutput$_etDataVar$2.baseResponse) && ((_etOutput$_etDataVar$3 = etOutput[_etDataVar][objItem.jobId]) === null || _etOutput$_etDataVar$3 === void 0 ? true : delete _etOutput$_etDataVar$3.baseResponse);
|
|
344
|
-
}
|
|
345
|
-
const computedOutput = {
|
|
346
|
-
...baseResponse,
|
|
347
|
-
...(Object.keys(etOutput === null || etOutput === void 0 ? void 0 : etOutput[_etDataVar]).length ? etOutput[_etDataVar][objItem.jobId] || {} : {})
|
|
348
|
-
};
|
|
349
|
-
objItem.nextState.data.output = {
|
|
350
|
-
...computedOutput
|
|
351
|
-
};
|
|
352
|
-
etState[index].nextState.data.output = {
|
|
353
|
-
...computedOutput
|
|
354
|
-
};
|
|
355
|
-
} else objItem.nextState.data.output = {
|
|
356
|
-
...etOutput
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
// NEW CODE
|
|
360
|
-
_objectiveState.push({
|
|
361
|
-
objectiveRef: objItem.objRef,
|
|
362
|
-
jobId: objItem.jobId,
|
|
363
|
-
state: objItem.nextState
|
|
228
|
+
} else {
|
|
229
|
+
await dispatchExecutor.saveTaskOutput(mergedObjectiveIds, taskName, taskID, {
|
|
230
|
+
input,
|
|
231
|
+
output: etOutput
|
|
364
232
|
});
|
|
365
|
-
|
|
366
|
-
// OLD CODE
|
|
367
|
-
// promises.push(
|
|
368
|
-
// this.dispatchExecutor.lockObjectiveState(
|
|
369
|
-
// objItem.objRef,
|
|
370
|
-
// objItem.jobId,
|
|
371
|
-
// objItem.nextState
|
|
372
|
-
// )
|
|
373
|
-
// );
|
|
374
|
-
});
|
|
375
|
-
// OLD CODE
|
|
376
|
-
// await Promise.all(promises);
|
|
377
|
-
// console.log('_objectiveState: ', JSON.stringify(_objectiveState));
|
|
378
|
-
|
|
379
|
-
await this.bulkLockObjectiveStates(_objectiveState);
|
|
233
|
+
}
|
|
380
234
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
// await this.dispatchExecutor.lockObjectiveState(objRef, jobId, etState);
|
|
235
|
+
findPrefixKey(mergedObjectiveIds, scanOutput, routeParams) {
|
|
236
|
+
const prefixedMergedObjectiveId = routeParams[RouteParams.ROOT_META_DATA].prefixedMergedObjectiveId;
|
|
237
|
+
return prefixedMergedObjectiveId;
|
|
385
238
|
}
|
|
386
239
|
static getInstance() {
|
|
387
240
|
if (!DispatchStateContainer.instance) {
|
|
@@ -389,9 +242,6 @@ export default class DispatchStateContainer {
|
|
|
389
242
|
}
|
|
390
243
|
return DispatchStateContainer.instance;
|
|
391
244
|
}
|
|
392
|
-
fetchObjectiveState(objRef, jobID) {
|
|
393
|
-
return this.dispatchExecutor.queryObjectiveStatus(objRef, jobID);
|
|
394
|
-
}
|
|
395
245
|
setSuccessRoute(route) {
|
|
396
246
|
this.successRoute = route;
|
|
397
247
|
}
|
|
@@ -427,131 +277,98 @@ export default class DispatchStateContainer {
|
|
|
427
277
|
return [];
|
|
428
278
|
}
|
|
429
279
|
}
|
|
430
|
-
async navigateToNextTask(navigation, route, etOutput, etSuccess, entityCode, eTaskID, baseETProps, isLastTask,
|
|
280
|
+
async navigateToNextTask(navigation, route, etOutput, etSuccess, entityCode, eTaskID, baseETProps, isLastTask, isMergeObjectiveBasedOutput) {
|
|
431
281
|
try {
|
|
432
282
|
baseETProps.showProgress(true);
|
|
283
|
+
const mergedObjectiveIds = route.params[RouteParams.NEXT_STATES].mergedObjectiveIds;
|
|
433
284
|
const reasonsContainer = ReasonCodeContainer.getInstance();
|
|
434
285
|
const eventsContainer = EventCodeContainer.getInstance();
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
478
|
-
rParams[RouteParams.EVENT_CODES] = successEventCodes;
|
|
479
|
-
rParams[RouteParams.APPLICABLE_CODES] = _successApplicable;
|
|
480
|
-
rParams[RouteParams.IS_JOB_BASED_OUTPUT] = isJobBasedOutput;
|
|
481
|
-
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
482
|
-
rParams[RouteParams.COMPLETED_STATES] = route.params[RouteParams.COMPLETED_STATES];
|
|
483
|
-
rParams[RouteParams.PENDING_STATES_OUTPUT] = route.params[RouteParams.PENDING_STATES_OUTPUT];
|
|
484
|
-
rParams[RouteParams.CANCEL_EVENT] = '';
|
|
485
|
-
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
486
|
-
} else {
|
|
487
|
-
const successCodes = await reasonsContainer.getReasonCodes(route.params[RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.success ? route.params[RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.success : route.params[RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons, _eventCode);
|
|
488
|
-
if (successCodes && successCodes.length > 0) {
|
|
489
|
-
if (successCodes.length === 1 || _isReasonNotToBeUsed) {
|
|
490
|
-
if (isJobBasedOutput) etOutput.baseResponse.reasonCode = successCodes[0].reasonCode;else etOutput.reasonCode = successCodes[0].reasonCode;
|
|
491
|
-
await this.saveAndProceed(baseETProps, etOutput, route.params, navigation, isLastTask, isJobBasedOutput);
|
|
286
|
+
if (isMergeObjectiveBasedOutput) {
|
|
287
|
+
await this.saveAndProceed(baseETProps, etOutput, route.params, navigation, isLastTask, isMergeObjectiveBasedOutput);
|
|
288
|
+
} else {
|
|
289
|
+
const _eventCode = etOutput.eventCode;
|
|
290
|
+
if (etSuccess) {
|
|
291
|
+
if (!_eventCode) {
|
|
292
|
+
const _successApplicable = route.params[RouteParams.NEXT_STATES].input.applicableReasons.success;
|
|
293
|
+
const successEventCodes = await eventsContainer.getEventCodes(_successApplicable);
|
|
294
|
+
let rParams;
|
|
295
|
+
rParams = {
|
|
296
|
+
...route.params
|
|
297
|
+
};
|
|
298
|
+
rParams[RouteParams.ET_SUCCESS] = true;
|
|
299
|
+
rParams[RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
300
|
+
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
301
|
+
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
302
|
+
rParams[RouteParams.EVENT_CODES] = successEventCodes;
|
|
303
|
+
rParams[RouteParams.APPLICABLE_CODES] = _successApplicable;
|
|
304
|
+
rParams[RouteParams.IS_MERGED_OBJ_BASED_OUTPUT] = isMergeObjectiveBasedOutput;
|
|
305
|
+
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
306
|
+
rParams[RouteParams.CANCEL_EVENT] = '';
|
|
307
|
+
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
308
|
+
} else {
|
|
309
|
+
const successCodes = await reasonsContainer.getReasonCodes(route.params[RouteParams.NEXT_STATES].input.applicableReasons.success ? route.params[RouteParams.NEXT_STATES].input.applicableReasons.success : route.params[RouteParams.NEXT_STATES].input.applicableReasons, _eventCode);
|
|
310
|
+
if (successCodes && successCodes.length > 0) {
|
|
311
|
+
if (successCodes.length === 1) {
|
|
312
|
+
if (isMergeObjectiveBasedOutput) etOutput.baseResponse.reasonCode = successCodes[0].reasonCode;else etOutput.reasonCode = successCodes[0].reasonCode;
|
|
313
|
+
await this.saveAndProceed(baseETProps, etOutput, route.params, navigation, isLastTask, isMergeObjectiveBasedOutput);
|
|
314
|
+
} else {
|
|
315
|
+
let rParams;
|
|
316
|
+
rParams = {
|
|
317
|
+
...route.params
|
|
318
|
+
};
|
|
319
|
+
rParams[RouteParams.ET_SUCCESS] = true;
|
|
320
|
+
rParams[RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
321
|
+
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
322
|
+
rParams[RouteParams.REASONS] = successCodes;
|
|
323
|
+
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
324
|
+
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
325
|
+
rParams[RouteParams.CANCEL_EVENT] = _eventCode;
|
|
326
|
+
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
327
|
+
}
|
|
492
328
|
} else {
|
|
493
|
-
|
|
494
|
-
rParams = {
|
|
495
|
-
...route.params
|
|
496
|
-
};
|
|
497
|
-
rParams[RouteParams.ET_SUCCESS] = true;
|
|
498
|
-
rParams[RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
499
|
-
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
500
|
-
rParams[RouteParams.REASONS] = successCodes;
|
|
501
|
-
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
502
|
-
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
503
|
-
rParams[RouteParams.COMPLETED_STATES] = route.params[RouteParams.COMPLETED_STATES];
|
|
504
|
-
rParams[RouteParams.PENDING_STATES_OUTPUT] = route.params[RouteParams.PENDING_STATES_OUTPUT];
|
|
505
|
-
rParams[RouteParams.CANCEL_EVENT] = _eventCode;
|
|
506
|
-
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
329
|
+
await this.saveAndProceed(baseETProps, etOutput, route.params, navigation, isLastTask, isMergeObjectiveBasedOutput);
|
|
507
330
|
}
|
|
508
|
-
} else {
|
|
509
|
-
await this.saveAndProceed(baseETProps, etOutput, route.params, navigation, isLastTask, isJobBasedOutput);
|
|
510
331
|
}
|
|
511
|
-
}
|
|
512
|
-
} else {
|
|
513
|
-
let failureCodes = [];
|
|
514
|
-
if (!_eventCode) {
|
|
515
|
-
const _failureApplicable = route.params[RouteParams.NEXT_STATES][0].nextState.data.input.applicableReasons.failure;
|
|
516
|
-
const failureEventCodes = await eventsContainer.getEventCodes(_failureApplicable);
|
|
517
|
-
let rParams;
|
|
518
|
-
rParams = {
|
|
519
|
-
...route.params
|
|
520
|
-
};
|
|
521
|
-
rParams[RouteParams.ET_SUCCESS] = false;
|
|
522
|
-
// rParams[RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
523
|
-
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
524
|
-
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
525
|
-
rParams[RouteParams.EVENT_CODES] = failureEventCodes;
|
|
526
|
-
rParams[RouteParams.APPLICABLE_CODES] = _failureApplicable;
|
|
527
|
-
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
528
|
-
rParams[RouteParams.COMPLETED_STATES] = route.params[RouteParams.COMPLETED_STATES];
|
|
529
|
-
rParams[RouteParams.PENDING_STATES_OUTPUT] = route.params[RouteParams.PENDING_STATES_OUTPUT];
|
|
530
|
-
rParams[RouteParams.CANCEL_EVENT] = '';
|
|
531
|
-
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
532
332
|
} else {
|
|
533
|
-
|
|
534
|
-
if (
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
333
|
+
let failureCodes = [];
|
|
334
|
+
if (!_eventCode) {
|
|
335
|
+
const _failureApplicable = route.params[RouteParams.NEXT_STATES].input.applicableReasons.failure;
|
|
336
|
+
const failureEventCodes = await eventsContainer.getEventCodes(_failureApplicable);
|
|
337
|
+
let rParams;
|
|
338
|
+
rParams = {
|
|
339
|
+
...route.params
|
|
340
|
+
};
|
|
341
|
+
rParams[RouteParams.ET_SUCCESS] = false;
|
|
342
|
+
// rParams[RouteParams.ET_SUCCESS_RESPONSE] = etOutput;
|
|
343
|
+
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
344
|
+
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
345
|
+
rParams[RouteParams.EVENT_CODES] = failureEventCodes;
|
|
346
|
+
rParams[RouteParams.APPLICABLE_CODES] = _failureApplicable;
|
|
347
|
+
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
348
|
+
rParams[RouteParams.CANCEL_EVENT] = '';
|
|
349
|
+
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
350
|
+
} else {
|
|
351
|
+
if (_eventCode === GO_BACK_EVENT_CODE) failureCodes = [];else failureCodes = await reasonsContainer.getReasonCodes(route.params[RouteParams.NEXT_STATES].input.applicableReasons.failure ? route.params[RouteParams.NEXT_STATES].input.applicableReasons.failure : route.params[RouteParams.NEXT_STATES].input.applicableReasons, _eventCode);
|
|
352
|
+
if (failureCodes && failureCodes.length > 0) {
|
|
353
|
+
if (isMergeObjectiveBasedOutput) etOutput.baseResponse.reasonCode = failureCodes[0].reasonCode;
|
|
354
|
+
if (failureCodes.length === 1) {
|
|
355
|
+
await this.saveAndProceed(baseETProps, isMergeObjectiveBasedOutput ? etOutput : await getBaseETResponse(entityCode, false, _eventCode, failureCodes[0].reasonCode, mergedObjectiveIds, eTaskID), route.params, navigation, isLastTask, isMergeObjectiveBasedOutput);
|
|
356
|
+
} else {
|
|
357
|
+
let rParams;
|
|
358
|
+
rParams = {
|
|
359
|
+
...route.params
|
|
360
|
+
};
|
|
361
|
+
rParams[RouteParams.ET_SUCCESS] = false;
|
|
362
|
+
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
363
|
+
rParams[RouteParams.REASONS] = failureCodes;
|
|
364
|
+
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
365
|
+
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
366
|
+
rParams[RouteParams.CANCEL_EVENT] = _eventCode;
|
|
367
|
+
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
368
|
+
}
|
|
538
369
|
} else {
|
|
539
|
-
|
|
540
|
-
rParams = {
|
|
541
|
-
...route.params
|
|
542
|
-
};
|
|
543
|
-
rParams[RouteParams.ET_SUCCESS] = false;
|
|
544
|
-
rParams[RouteParams.CURRENT_ET_NAME] = eTaskID;
|
|
545
|
-
rParams[RouteParams.REASONS] = failureCodes;
|
|
546
|
-
rParams[RouteParams.IS_LAST_ET] = isLastTask;
|
|
547
|
-
rParams[RouteParams.ROOT_META_DATA] = route.params[RouteParams.ROOT_META_DATA];
|
|
548
|
-
rParams[RouteParams.COMPLETED_STATES] = route.params[RouteParams.COMPLETED_STATES];
|
|
549
|
-
rParams[RouteParams.PENDING_STATES_OUTPUT] = route.params[RouteParams.PENDING_STATES_OUTPUT];
|
|
550
|
-
rParams[RouteParams.CANCEL_EVENT] = _eventCode;
|
|
551
|
-
navigation.replace(CustomScreens.REMARK_SCREEN, rParams);
|
|
370
|
+
await this.saveAndProceed(baseETProps, isMergeObjectiveBasedOutput ? etOutput : await getBaseETResponse(entityCode, false, _eventCode, '', mergedObjectiveIds, eTaskID), route.params, navigation, isLastTask, isMergeObjectiveBasedOutput);
|
|
552
371
|
}
|
|
553
|
-
} else {
|
|
554
|
-
await this.saveAndProceed(baseETProps, isJobBasedOutput ? etOutput : await getBaseETResponse(entityCode, false, _eventCode, ''), route.params, navigation, isLastTask, isJobBasedOutput);
|
|
555
372
|
}
|
|
556
373
|
}
|
|
557
374
|
}
|
|
@@ -560,223 +377,115 @@ export default class DispatchStateContainer {
|
|
|
560
377
|
Logger.getInstance().logEvent('navigateToNextTask', error.message, LOG_TYPE.SDK_ERROR);
|
|
561
378
|
}
|
|
562
379
|
}
|
|
563
|
-
getJobObjectiveList(nextStates) {
|
|
564
|
-
const result = [];
|
|
565
|
-
nextStates.forEach(s => {
|
|
566
|
-
result.push({
|
|
567
|
-
jobId: s.jobId,
|
|
568
|
-
objectiveId: s.objRef,
|
|
569
|
-
groupId: s.groupId,
|
|
570
|
-
additionalData: s.additionalData
|
|
571
|
-
});
|
|
572
|
-
});
|
|
573
|
-
return result;
|
|
574
|
-
}
|
|
575
380
|
async moveToNextET(etOutput, baseETProps, states, navigation, isLastTask) {
|
|
576
381
|
try {
|
|
577
382
|
let etStates = states.next_states;
|
|
578
383
|
baseETProps.showProgress(true);
|
|
579
|
-
if (isLastTask && etStates && etStates.length > 0) {
|
|
580
|
-
if (this._stateKeys.length
|
|
384
|
+
if (isLastTask && etStates && Object.keys(etStates).length > 0) {
|
|
385
|
+
if (this._mappedStates.size && this._stateKeys.length) {
|
|
581
386
|
const st = this._stateKeys.pop();
|
|
582
387
|
if (st) {
|
|
583
|
-
|
|
584
|
-
|
|
388
|
+
let rParams = {};
|
|
389
|
+
const _stData = this._mappedStates.get(st);
|
|
585
390
|
this._mappedStates.delete(st);
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
const promises = [];
|
|
591
|
-
const _objectiveState = [];
|
|
592
|
-
const _taskOutput = [];
|
|
593
|
-
/*for (let index = 0; index < nextStateList.length; index++) {
|
|
594
|
-
const objItem = nextStateList[index];
|
|
595
|
-
|
|
596
|
-
//OLD CODE
|
|
597
|
-
const prevOutput =
|
|
598
|
-
await this.dispatchExecutor.getTaskOutputByInstanceId(
|
|
599
|
-
objItem.nextState.name,
|
|
600
|
-
objItem.nextState.workflowInstanceId
|
|
601
|
-
);
|
|
602
|
-
objItem.nextState.data.output = { ...prevOutput }; */
|
|
603
|
-
//Updated the states of pending states to completed end-state ET
|
|
604
|
-
|
|
605
|
-
// NEW CODE
|
|
606
|
-
/* _objectiveState.push({
|
|
607
|
-
objectiveRef: objItem.objRef,
|
|
608
|
-
jobId: objItem.jobId,
|
|
609
|
-
state: objItem.nextState,
|
|
610
|
-
}); */
|
|
611
|
-
|
|
612
|
-
// OLD CODE
|
|
613
|
-
// promises.push(
|
|
614
|
-
// this.dispatchExecutor.lockObjectiveState(
|
|
615
|
-
// objItem.objRef,
|
|
616
|
-
// objItem.jobId,
|
|
617
|
-
// objItem.nextState
|
|
618
|
-
// )
|
|
619
|
-
// );
|
|
620
|
-
// }
|
|
621
|
-
// OLD CODE
|
|
622
|
-
// await Promise.all(promises);
|
|
623
|
-
|
|
624
|
-
// NEW CODE
|
|
625
|
-
nextStateList.forEach(objItem => {
|
|
626
|
-
// const objItem = nextStateList[index];
|
|
627
|
-
_taskOutput.push({
|
|
628
|
-
taskName: objItem.nextState.name,
|
|
629
|
-
jobId: objItem.jobId,
|
|
630
|
-
objectiveRef: objItem.objRef
|
|
631
|
-
});
|
|
632
|
-
});
|
|
633
|
-
const prevOutput = await this.dispatchExecutor.getBulkTaskOutput(_taskOutput);
|
|
634
|
-
nextStateList.forEach((objItem, index) => {
|
|
635
|
-
objItem.nextState.data.output = {
|
|
636
|
-
...prevOutput[index]
|
|
637
|
-
};
|
|
638
|
-
_objectiveState.push({
|
|
639
|
-
objectiveRef: objItem.objRef,
|
|
640
|
-
jobId: objItem.jobId,
|
|
641
|
-
state: objItem.nextState
|
|
642
|
-
});
|
|
643
|
-
});
|
|
644
|
-
await this.bulkLockObjectiveStates(_objectiveState);
|
|
645
|
-
|
|
646
|
-
/**
|
|
647
|
-
* Here we'll get the states data for end et
|
|
648
|
-
*/
|
|
649
|
-
const _states = await this.bulkQueryNextET(this.getJobObjectiveList(nextStateList));
|
|
650
|
-
if (_states[0].nextState.taskId === ExecutionTaskID.COMPLETED_FAILURE) {
|
|
651
|
-
var _states$0$nextState$d3, _states$0$nextState$d4, _failureCodes$2;
|
|
652
|
-
const failureCodes = await ReasonCodeContainer.getInstance().getReasonCodes((_states$0$nextState$d3 = _states[0].nextState.data.input) !== null && _states$0$nextState$d3 !== void 0 && _states$0$nextState$d3.applicableReasons.success ? _states[0].nextState.data.input.applicableReasons.success : (_states$0$nextState$d4 = _states[0].nextState.data.input) === null || _states$0$nextState$d4 === void 0 ? void 0 : _states$0$nextState$d4.applicableReasons, BaseEventCodes.ENTITY_SUCCESS);
|
|
653
|
-
let _etOutput = JSON.parse(JSON.stringify(etOutput));
|
|
654
|
-
_etOutput.entityCode = EntityCode.COMPLETED_FAILURE;
|
|
655
|
-
_etOutput.success = true;
|
|
656
|
-
_etOutput.eventCode = BaseEventCodes.ENTITY_SUCCESS;
|
|
657
|
-
_etOutput.reasonCode = ((_failureCodes$2 = failureCodes[0]) === null || _failureCodes$2 === void 0 ? void 0 : _failureCodes$2.reasonCode) || '';
|
|
658
|
-
|
|
659
|
-
/**
|
|
660
|
-
* Update end et state
|
|
661
|
-
*/
|
|
662
|
-
await this.sendETOutput(_etOutput, {
|
|
663
|
-
next_states: _states
|
|
664
|
-
});
|
|
665
|
-
states.pending_states = [...(states.pending_states || []), ..._states];
|
|
666
|
-
} else {
|
|
667
|
-
let rParams = {};
|
|
668
|
-
rParams[RouteParams.NEXT_STATES] = _states;
|
|
669
|
-
rParams[RouteParams.PENDING_STATES] = [...(states.pending_states || [])];
|
|
670
|
-
rParams[RouteParams.COMPLETED_STATES] = [...(states.completed_states || []), ...etStates];
|
|
671
|
-
rParams[RouteParams.PENDING_STATES_OUTPUT] = states.pending_states_output;
|
|
672
|
-
rParams[RouteParams.ROOT_META_DATA] = states.rootMetaData;
|
|
673
|
-
navigation.replace(_states[0].nextState.taskId, rParams);
|
|
674
|
-
}
|
|
675
|
-
} else {
|
|
676
|
-
let rParams = {};
|
|
677
|
-
rParams[RouteParams.NEXT_STATES] = nextStateList;
|
|
678
|
-
rParams[RouteParams.PENDING_STATES] = [...(states.pending_states || [])];
|
|
679
|
-
rParams[RouteParams.COMPLETED_STATES] = [...(states.completed_states || []), ...etStates];
|
|
680
|
-
rParams[RouteParams.PENDING_STATES_OUTPUT] = states.pending_states_output;
|
|
681
|
-
rParams[RouteParams.ROOT_META_DATA] = states.rootMetaData;
|
|
682
|
-
navigation.replace(nextStateList[0].nextState.taskId, rParams);
|
|
683
|
-
}
|
|
391
|
+
if (_stData) {
|
|
392
|
+
rParams[RouteParams.NEXT_STATES] = _stData;
|
|
393
|
+
rParams[RouteParams.ROOT_META_DATA] = states.rootMetaData;
|
|
394
|
+
navigation.replace(_stData.taskId, rParams);
|
|
684
395
|
}
|
|
685
|
-
if (isFailureFlow) return;
|
|
686
396
|
}
|
|
687
|
-
}
|
|
688
|
-
etStates = [...etStates, ...(states.pending_states || []), ...(states.completed_states || [])];
|
|
689
|
-
let nextState = etStates[0];
|
|
690
|
-
let completeJobsSummary = [];
|
|
691
|
-
let objSummary = await this.getObjectiveSummary({
|
|
692
|
-
jobId: etStates[0].jobId,
|
|
693
|
-
objectiveId: etStates[0].objRef
|
|
694
|
-
});
|
|
695
|
-
completeJobsSummary.push({
|
|
696
|
-
jobId: etStates[0].jobId,
|
|
697
|
-
objectiveRef: etStates[0].objRef,
|
|
698
|
-
jobObjectiveSummary: objSummary
|
|
699
|
-
});
|
|
700
|
-
for (let i = 1; i < etStates.length; i++) {
|
|
701
|
-
let obs = await this.getObjectiveSummary({
|
|
702
|
-
jobId: etStates[i].jobId,
|
|
703
|
-
objectiveId: etStates[i].objRef
|
|
704
|
-
});
|
|
705
|
-
completeJobsSummary.push({
|
|
706
|
-
jobId: etStates[i].jobId,
|
|
707
|
-
objectiveRef: etStates[i].objRef,
|
|
708
|
-
jobObjectiveSummary: obs
|
|
709
|
-
});
|
|
710
|
-
}
|
|
711
|
-
baseETProps.showProgress(false);
|
|
712
|
-
this.cache.clearKeys([this.cacheKeys.CURRENT_WORKING_TASK_ID]);
|
|
713
|
-
AppSyncManager.getInstance().isForceStartEnabled = true;
|
|
714
|
-
AppSyncManager.getInstance().isSyncActive = false;
|
|
715
|
-
AppSyncManager.getInstance().startSDKSyncManager();
|
|
716
|
-
if (nextState.nextState.taskId === ExecutionTaskID.COMPLETED_SUCCESS) {
|
|
717
|
-
navigation.replace(this.getSuccessRoute(), {
|
|
718
|
-
summary: objSummary,
|
|
719
|
-
completeSummary: completeJobsSummary,
|
|
720
|
-
objList: this.getJobObjectiveList(etStates),
|
|
721
|
-
objSuccess: true
|
|
722
|
-
});
|
|
723
397
|
} else {
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
398
|
+
baseETProps.showProgress(false);
|
|
399
|
+
// TODO: Remove this later
|
|
400
|
+
this.cache.clearKeys([this.cacheKeys.CURRENT_WORKING_TASK_ID]);
|
|
401
|
+
AppSyncManager.getInstance().isForceStartEnabled = true;
|
|
402
|
+
AppSyncManager.getInstance().isSyncActive = false;
|
|
403
|
+
AppSyncManager.getInstance().startSDKSyncManager();
|
|
404
|
+
let objSummary = {
|
|
405
|
+
success: [],
|
|
406
|
+
failure: []
|
|
407
|
+
};
|
|
408
|
+
for (let [_key, _value] of this._mappedStatesData) {
|
|
409
|
+
const _objKey = _key === ExecutionTaskID.COMPLETED_SUCCESS ? 'success' : 'failure';
|
|
410
|
+
const lastERCData = await DispatchExecutor.getlastERC(_value.mergedObjectiveIds);
|
|
411
|
+
for (const _lastER of lastERCData) {
|
|
412
|
+
var _objSummary$_objKey;
|
|
413
|
+
const reason = await ReasonCodeContainer.getInstance().getReasonByCode(_lastER.lastReasonCode);
|
|
414
|
+
(_objSummary$_objKey = objSummary[_objKey]) === null || _objSummary$_objKey === void 0 ? void 0 : _objSummary$_objKey.push({
|
|
415
|
+
entityCode: _lastER.lastEntityCode,
|
|
416
|
+
eventCode: _lastER.lastEventCode,
|
|
417
|
+
reasonCode: _lastER.lastReasonCode,
|
|
418
|
+
reasonCodeDesc: reason === null || reason === void 0 ? void 0 : reason.description
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
if (this._mappedStatesData.get(ExecutionTaskID.COMPLETED_SUCCESS)) {
|
|
423
|
+
this._mappedStatesData.clear();
|
|
424
|
+
this._mappedStates.clear();
|
|
425
|
+
this._stateKeys = [];
|
|
426
|
+
clearScanOutput(states.rootMetaData.prefixedMergedObjectiveId);
|
|
427
|
+
navigation.replace(this.getSuccessRoute(), {
|
|
428
|
+
summary: objSummary,
|
|
429
|
+
objSuccess: true
|
|
430
|
+
});
|
|
431
|
+
} else {
|
|
432
|
+
this._mappedStatesData.clear();
|
|
433
|
+
this._mappedStates.clear();
|
|
434
|
+
this._stateKeys = [];
|
|
435
|
+
clearScanOutput(states.rootMetaData.prefixedMergedObjectiveId);
|
|
436
|
+
navigation.replace(this.getFailureRoute(), {
|
|
437
|
+
summary: objSummary,
|
|
438
|
+
objSuccess: false
|
|
439
|
+
});
|
|
440
|
+
}
|
|
730
441
|
}
|
|
731
442
|
} else {
|
|
732
|
-
let
|
|
443
|
+
let rParams = {};
|
|
444
|
+
let nextStateDataArray = await this.queryNextET(states.next_states.mergedObjectiveIds, states.rootMetaData.statusFilter);
|
|
445
|
+
const storeTerminalData = nextStateDataArray.every(_state => _state.taskId === ExecutionTaskID.COMPLETED_SUCCESS || _state.taskId === ExecutionTaskID.COMPLETED_FAILURE);
|
|
446
|
+
if (storeTerminalData) {
|
|
447
|
+
if (nextStateDataArray.length === 2) {
|
|
448
|
+
// Array in case of last states containing c-s and c-f
|
|
449
|
+
this._mappedStates.set(nextStateDataArray[1].taskId, nextStateDataArray[1]);
|
|
450
|
+
this._stateKeys.push(nextStateDataArray[1].taskId);
|
|
451
|
+
}
|
|
452
|
+
nextStateDataArray.forEach(data => {
|
|
453
|
+
if (data.taskId === ExecutionTaskID.COMPLETED_SUCCESS || data.taskId === ExecutionTaskID.COMPLETED_FAILURE) this._mappedStatesData.set(data.taskId, data);
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
const nextStateData = nextStateDataArray[0];
|
|
733
457
|
baseETProps.showProgress(false);
|
|
734
|
-
if (
|
|
735
|
-
|
|
736
|
-
rParams[RouteParams.NEXT_STATES] = nextStateList;
|
|
737
|
-
rParams[RouteParams.PENDING_STATES] = [...(states.pending_states || [])];
|
|
738
|
-
rParams[RouteParams.COMPLETED_STATES] = states.completed_states;
|
|
458
|
+
if (nextStateData != null && Object.keys(nextStateData).length > 0) {
|
|
459
|
+
rParams[RouteParams.NEXT_STATES] = nextStateData;
|
|
739
460
|
rParams[RouteParams.ROOT_META_DATA] = states.rootMetaData;
|
|
740
|
-
rParams[RouteParams.PENDING_STATES_OUTPUT] = states.pending_states_output;
|
|
741
461
|
|
|
742
462
|
/**
|
|
743
|
-
*
|
|
744
|
-
* Add pending state(failed and unscanned) objectives only for scan et
|
|
463
|
+
* Send END/BACK custom event
|
|
745
464
|
*/
|
|
746
|
-
const _nextStates = etStates[0].nextState.taskId === ExecutionTaskID.SCAN ? [...etStates, ...(states.pending_states || [])] : etStates;
|
|
747
465
|
if (!isLastTask) {
|
|
748
|
-
var
|
|
466
|
+
var _etOutput$baseRespons;
|
|
749
467
|
const eventOutputData = {
|
|
750
|
-
meta: (
|
|
751
|
-
etData:
|
|
752
|
-
taskId: etStates
|
|
468
|
+
meta: (etOutput === null || etOutput === void 0 || (_etOutput$baseRespons = etOutput.baseResponse) === null || _etOutput$baseRespons === void 0 ? void 0 : _etOutput$baseRespons.meta) || (etOutput === null || etOutput === void 0 ? void 0 : etOutput.meta) || {},
|
|
469
|
+
etData: etOutput,
|
|
470
|
+
taskId: etStates.taskId,
|
|
753
471
|
nextTaskId: '',
|
|
754
|
-
timestamp: Date.now()
|
|
472
|
+
timestamp: Date.now(),
|
|
473
|
+
customData: rParams[RouteParams.ROOT_META_DATA].customEventsData
|
|
755
474
|
};
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
var _objItem$nextState$da5, _eventOutputData$etDa, _eventOutputData$etDa2, _eventOutputData$etDa3;
|
|
759
|
-
eventOutputData.etData[objItem.jobId] = {
|
|
760
|
-
...(((_objItem$nextState$da5 = objItem.nextState.data) === null || _objItem$nextState$da5 === void 0 ? void 0 : _objItem$nextState$da5.output) || {}),
|
|
761
|
-
workflowInstanceId: objItem.nextState.workflowInstanceId,
|
|
762
|
-
additionalData: (objItem === null || objItem === void 0 ? void 0 : objItem.additionalData) || {}
|
|
763
|
-
};
|
|
764
|
-
(((_eventOutputData$etDa = eventOutputData.etData[objItem.jobId]) === null || _eventOutputData$etDa === void 0 ? void 0 : _eventOutputData$etDa.meta) || ((_eventOutputData$etDa2 = eventOutputData.etData[objItem.jobId]) === null || _eventOutputData$etDa2 === void 0 ? void 0 : _eventOutputData$etDa2.meta) === null) && ((_eventOutputData$etDa3 = eventOutputData.etData[objItem.jobId]) === null || _eventOutputData$etDa3 === void 0 ? true : delete _eventOutputData$etDa3.meta);
|
|
765
|
-
});
|
|
766
|
-
eventOutputData.nextTaskId = nextStateList[0].nextState.taskId;
|
|
767
|
-
eventOutputData.etData[Object.keys(eventOutputData.etData)[0]].eventCode !== GO_BACK_EVENT_CODE ? dispatchEvent('END', etStates[0].nextState.name, eventOutputData) : dispatchEvent('BACK', etStates[0].nextState.name, eventOutputData);
|
|
475
|
+
eventOutputData.nextTaskId = nextStateData.taskId;
|
|
476
|
+
eventOutputData.etData.eventCode !== GO_BACK_EVENT_CODE ? dispatchEvent('END', etStates.taskName, eventOutputData) : dispatchEvent('BACK', etStates.taskName, eventOutputData);
|
|
768
477
|
}
|
|
769
|
-
navigation.replace(nextStateList[0].nextState.taskId, rParams);
|
|
770
478
|
}
|
|
479
|
+
navigation.replace(nextStateData.taskId, rParams);
|
|
771
480
|
}
|
|
772
481
|
} catch (error) {
|
|
773
482
|
baseETProps.showProgress(false);
|
|
774
483
|
Logger.getInstance().logEvent('moveToNextET', error.message, LOG_TYPE.SDK_ERROR);
|
|
775
484
|
}
|
|
776
485
|
}
|
|
777
|
-
async saveAndProceed(baseETProps, etOutput, states, navigation, isLastTask,
|
|
486
|
+
async saveAndProceed(baseETProps, etOutput, states, navigation, isLastTask, isMergedObjectiveBasedOutput) {
|
|
778
487
|
baseETProps.showProgress(true);
|
|
779
|
-
await this.saveAndProceedToNextET(baseETProps, etOutput, states, navigation, isLastTask,
|
|
488
|
+
await this.saveAndProceedToNextET(baseETProps, etOutput, states, navigation, isLastTask, isMergedObjectiveBasedOutput);
|
|
780
489
|
}
|
|
781
490
|
}
|
|
782
491
|
_defineProperty(DispatchStateContainer, "instance", void 0);
|