@os1-platform/dispatch-mobile 1.0.8 → 1.3.11
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 +116 -48
- package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.8/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/gradle.xml +13 -0
- package/android/.idea/misc.xml +4 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/.idea/workspace.xml +131 -0
- package/android/gradle.properties +1 -1
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +0 -1
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +46 -39
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js +14 -24
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +142 -23
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +64 -16
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +6 -16
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +68 -26
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +4 -13
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js +0 -2
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +61 -28
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +5 -19
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +62 -18
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +112 -28
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +3 -26
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +49 -0
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -0
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +1 -16
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +0 -10
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js +4 -13
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +0 -12
- 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 +7 -35
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +74 -49
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js +0 -4
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js +0 -2
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +64 -17
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +63 -24
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +71 -22
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js +5 -15
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +60 -19
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +843 -0
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js +6 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/constants.js +19 -0
- package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/interfaces.js +29 -0
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +103 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +74 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +115 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ScanList.js +134 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ScanList.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js +373 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scanner/CScanner.js +3 -21
- package/lib/commonjs/components/executiontasks/scanner/CScanner.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js +4 -9
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js +7 -36
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js +0 -5
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js +0 -9
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -14
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js +1 -40
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -17
- package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js +0 -28
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +334 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js +14 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js +37 -0
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +59 -0
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js +147 -0
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +0 -13
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +4 -17
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +3 -18
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/commonjs/components/widgets/AlertDisplay.js +0 -5
- package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/commonjs/components/widgets/CancelOrderDialog.js +0 -12
- package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/IconButton.js +34 -0
- package/lib/commonjs/components/widgets/IconButton.js.map +1 -0
- package/lib/commonjs/components/widgets/ProgressDialog.js +0 -7
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SnackBarCustom.js +38 -38
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/components/widgets/SplitTextInput.js +93 -0
- package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -0
- package/lib/commonjs/components/widgets/Toaster.js +0 -2
- package/lib/commonjs/components/widgets/Toaster.js.map +1 -1
- package/lib/commonjs/config/DispatchSDKConfig.js +4 -5
- package/lib/commonjs/config/DispatchSDKConfig.js.map +1 -1
- package/lib/commonjs/constants/apiConstants.js +15 -0
- package/lib/commonjs/constants/apiConstants.js.map +1 -0
- package/lib/commonjs/constants/constants.js +7 -3
- package/lib/commonjs/constants/constants.js.map +1 -1
- package/lib/commonjs/constants/statuscode.js +3 -5
- package/lib/commonjs/constants/statuscode.js.map +1 -1
- package/lib/commonjs/errors/BaseError.js +3 -8
- package/lib/commonjs/errors/BaseError.js.map +1 -1
- package/lib/commonjs/errors/ErrorCodes.js +7 -6
- package/lib/commonjs/errors/ErrorCodes.js.map +1 -1
- package/lib/commonjs/events/EventDispatcher.js +27 -0
- package/lib/commonjs/events/EventDispatcher.js.map +1 -0
- package/lib/commonjs/events/EventListener.js +20 -0
- package/lib/commonjs/events/EventListener.js.map +1 -0
- package/lib/commonjs/events/constants.js +13 -0
- package/lib/commonjs/events/constants.js.map +1 -0
- package/lib/commonjs/events/index.js +11 -0
- package/lib/commonjs/events/index.js.map +1 -0
- package/lib/commonjs/events/interface.js +2 -0
- package/lib/commonjs/events/interface.js.map +1 -0
- package/lib/commonjs/index.js +9 -23
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +527 -177
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +55 -4
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +70 -0
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -0
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +3 -29
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +6 -20
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js +27 -0
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js.map +1 -0
- package/lib/commonjs/manager/location/LocationManager.js +3 -20
- package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js +8 -36
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js +6 -17
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js +12 -46
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js +13 -7
- package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js +0 -2
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/database.js +28 -12
- package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +0 -19
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +3 -20
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +3 -52
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +59 -25
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +77 -90
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +27 -19
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/commonjs/models/DispatchModels.js +4 -5
- package/lib/commonjs/models/DispatchModels.js.map +1 -1
- package/lib/commonjs/models/ReasonCodes.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETConfig.js +28 -35
- package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
- package/lib/commonjs/models/sdk.js +4 -5
- package/lib/commonjs/models/sdk.js.map +1 -1
- package/lib/commonjs/native/signature/SignatureCapture.js +3 -24
- package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
- package/lib/commonjs/network/GraphQLClient.js +7 -35
- package/lib/commonjs/network/GraphQLClient.js.map +1 -1
- package/lib/commonjs/network/NetworkClient.js +2 -13
- package/lib/commonjs/network/NetworkClient.js.map +1 -1
- package/lib/commonjs/network/NetworkUtils.js +10 -8
- package/lib/commonjs/network/NetworkUtils.js.map +1 -1
- package/lib/commonjs/network/Queries.js +0 -2
- package/lib/commonjs/network/Queries.js.map +1 -1
- package/lib/commonjs/network/client.js +6 -21
- package/lib/commonjs/network/client.js.map +1 -1
- package/lib/commonjs/res/strings.js.map +1 -1
- package/lib/commonjs/resources/Login.js +4 -15
- package/lib/commonjs/resources/Login.js.map +1 -1
- package/lib/commonjs/resources/network.js +3 -8
- package/lib/commonjs/resources/network.js.map +1 -1
- package/lib/commonjs/styles/SdkColors.js +7 -7
- package/lib/commonjs/styles/SdkColors.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +42 -18
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/CancellationScreen.js +36 -27
- package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CaptureInputScreen.js +6 -15
- package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +0 -19
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +6 -15
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DisplayScreen.js +7 -12
- package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +6 -16
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +6 -18
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js +14 -16
- package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +36 -15
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/GeofenceScreen.js +7 -13
- package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js +5 -10
- package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +27 -14
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +11 -23
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +9 -13
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RTScanScreen.js +8 -27
- package/lib/commonjs/ui/screens/RTScanScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ScanScreen.js +268 -0
- package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +21 -30
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js +49 -0
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +0 -10
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js +9 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/commonjs/utils/ApiUtils.js +115 -0
- package/lib/commonjs/utils/ApiUtils.js.map +1 -0
- package/lib/commonjs/utils/ExecTaskUtils.js +93 -31
- package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +10 -29
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +3 -19
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js +2 -31
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js +25 -40
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/commonjs/utils/fcm/FCM.js +35 -16
- package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js +50 -25
- package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/commonjs/utils/helper.js +0 -5
- package/lib/commonjs/utils/helper.js.map +1 -1
- package/lib/commonjs/utils/hooks/useTimer.js +44 -0
- package/lib/commonjs/utils/hooks/useTimer.js.map +1 -0
- package/lib/commonjs/utils/loginHelper.js +6 -18
- package/lib/commonjs/utils/loginHelper.js.map +1 -1
- package/lib/commonjs/utils/storage.js +53 -32
- package/lib/commonjs/utils/storage.js.map +1 -1
- package/lib/commonjs/utils/utils.js +8 -11
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/components/dispatch/DispatchExecNavigator.js +46 -28
- package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js +3 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancelET.js +145 -19
- package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/CaptureText.js +66 -9
- package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/DeliverET.js +6 -7
- package/lib/module/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +69 -16
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/display/DisplayModalET.js +4 -3
- package/lib/module/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/DoodleUtils.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +64 -14
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/DropCashET.js +5 -6
- package/lib/module/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js +62 -8
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js +114 -14
- package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +3 -15
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js +39 -0
- package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -0
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +1 -5
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js +0 -3
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js +4 -2
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js +0 -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 +7 -10
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +75 -35
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js +64 -6
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +63 -11
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +71 -10
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickupET.js +5 -6
- package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +61 -10
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +833 -0
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/module/components/executiontasks/scan/ScanSchema.js +2 -0
- package/lib/module/components/executiontasks/scan/ScanSchema.js.map +1 -0
- package/lib/module/components/executiontasks/scan/constants.js +7 -0
- package/lib/module/components/executiontasks/scan/constants.js.map +1 -0
- package/lib/module/components/executiontasks/scan/interfaces.js +21 -0
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +94 -0
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +66 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +105 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/ScanList.js +124 -0
- package/lib/module/components/executiontasks/scan/sub_components/ScanList.js.map +1 -0
- package/lib/module/components/executiontasks/scan/utils.js +358 -0
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/module/components/executiontasks/scanner/CScanner.js +3 -8
- package/lib/module/components/executiontasks/scanner/CScanner.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js +3 -3
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js +6 -18
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js +0 -2
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js +0 -5
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -3
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js +1 -19
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -7
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js +0 -15
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js +325 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js +8 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/constants.js +25 -0
- package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js +49 -0
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/utils.js +133 -0
- package/lib/module/components/executiontasks/validateOTP/utils.js.map +1 -0
- package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js +0 -6
- package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js +4 -3
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js +4 -8
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/module/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/module/components/widgets/CancelOrderDialog.js +0 -2
- package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/module/components/widgets/IconButton.js +26 -0
- package/lib/module/components/widgets/IconButton.js.map +1 -0
- package/lib/module/components/widgets/ProgressDialog.js +0 -2
- package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/module/components/widgets/SnackBarCustom.js +36 -18
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/components/widgets/SplitTextInput.js +84 -0
- package/lib/module/components/widgets/SplitTextInput.js.map +1 -0
- package/lib/module/components/widgets/Toaster.js.map +1 -1
- package/lib/module/config/DispatchSDKConfig.js +3 -4
- package/lib/module/config/DispatchSDKConfig.js.map +1 -1
- package/lib/module/constants/apiConstants.js +7 -0
- package/lib/module/constants/apiConstants.js.map +1 -0
- package/lib/module/constants/constants.js +4 -2
- package/lib/module/constants/constants.js.map +1 -1
- package/lib/module/constants/statuscode.js +3 -5
- package/lib/module/constants/statuscode.js.map +1 -1
- package/lib/module/errors/BaseError.js +3 -6
- package/lib/module/errors/BaseError.js.map +1 -1
- package/lib/module/errors/ErrorCodes.js +5 -5
- package/lib/module/errors/ErrorCodes.js.map +1 -1
- package/lib/module/events/EventDispatcher.js +19 -0
- package/lib/module/events/EventDispatcher.js.map +1 -0
- package/lib/module/events/EventListener.js +13 -0
- package/lib/module/events/EventListener.js.map +1 -0
- package/lib/module/events/constants.js +6 -0
- package/lib/module/events/constants.js.map +1 -0
- package/lib/module/events/index.js +3 -0
- package/lib/module/events/index.js.map +1 -0
- package/lib/module/events/interface.js +2 -0
- package/lib/module/events/interface.js.map +1 -0
- package/lib/module/index.js +4 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/manager/dispatch/DispatchStateContainer.js +529 -151
- package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js +52 -2
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js +61 -0
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -0
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +3 -16
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +6 -14
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/module/manager/jobRemoval/JobRemovalManager.js +20 -0
- package/lib/module/manager/jobRemoval/JobRemovalManager.js.map +1 -0
- package/lib/module/manager/location/LocationManager.js +3 -14
- package/lib/module/manager/location/LocationManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js +8 -14
- package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSdkCache.js +6 -13
- package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/module/manager/syncmanager/AppSyncManager.js +12 -26
- package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +9 -5
- package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/module/manager/syncmanager/NativeSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/database.js +27 -3
- package/lib/module/manager/syncmanager/database.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js +0 -7
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +3 -14
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +3 -35
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +59 -18
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js +77 -68
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js +26 -11
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/module/models/DispatchModels.js +3 -4
- package/lib/module/models/DispatchModels.js.map +1 -1
- package/lib/module/models/ReasonCodes.js.map +1 -1
- package/lib/module/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/module/models/execTasks/ETConfig.js +22 -29
- package/lib/module/models/execTasks/ETConfig.js.map +1 -1
- package/lib/module/models/sdk.js +3 -4
- package/lib/module/models/sdk.js.map +1 -1
- package/lib/module/native/signature/SignatureCapture.js +3 -18
- package/lib/module/native/signature/SignatureCapture.js.map +1 -1
- package/lib/module/network/GraphQLClient.js +6 -26
- package/lib/module/network/GraphQLClient.js.map +1 -1
- package/lib/module/network/NetworkClient.js +2 -6
- package/lib/module/network/NetworkClient.js.map +1 -1
- package/lib/module/network/NetworkUtils.js +10 -3
- package/lib/module/network/NetworkUtils.js.map +1 -1
- package/lib/module/network/Queries.js.map +1 -1
- package/lib/module/network/client.js +7 -17
- package/lib/module/network/client.js.map +1 -1
- package/lib/module/res/strings.js.map +1 -1
- package/lib/module/resources/Login.js +4 -13
- package/lib/module/resources/Login.js.map +1 -1
- package/lib/module/resources/network.js +3 -6
- package/lib/module/resources/network.js.map +1 -1
- package/lib/module/styles/SdkColors.js +6 -6
- package/lib/module/styles/SdkColors.js.map +1 -1
- package/lib/module/styles/executionTasks/CommonStyles.js +41 -7
- package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/module/ui/screens/CancellationScreen.js +36 -14
- package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/module/ui/screens/CaptureInputScreen.js +7 -4
- package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/module/ui/screens/CompleteObjectiveScreen.js +0 -3
- package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +7 -4
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DisplayScreen.js +5 -4
- package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +7 -4
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +7 -7
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/ETScreensIndex.js +3 -1
- package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +34 -6
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/GeofenceScreen.js +5 -4
- package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/module/ui/screens/HttpRequestScreen.js +5 -3
- package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js +25 -5
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +12 -10
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +7 -5
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/ui/screens/RTScanScreen.js +9 -13
- package/lib/module/ui/screens/RTScanScreen.js.map +1 -1
- package/lib/module/ui/screens/ScanScreen.js +259 -0
- package/lib/module/ui/screens/ScanScreen.js.map +1 -0
- package/lib/module/ui/screens/StartWorkFlowScreen.js +22 -9
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js +39 -0
- package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -0
- package/lib/module/ui/screens/WithBaseDispatchScreen.js +0 -3
- package/lib/module/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/module/ui/uiConfig/RouteParams.js +9 -1
- package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/module/utils/ApiUtils.js +101 -0
- package/lib/module/utils/ApiUtils.js.map +1 -0
- package/lib/module/utils/ExecTaskUtils.js +92 -21
- package/lib/module/utils/ExecTaskUtils.js.map +1 -1
- package/lib/module/utils/Logger.js +9 -21
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +3 -15
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/SdkUtils.js +2 -15
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/module/utils/SyncManagerUtils.js +25 -10
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/utils/fcm/FCM.js +35 -4
- package/lib/module/utils/fcm/FCM.js.map +1 -1
- package/lib/module/utils/fcm/FcmUtils.js +50 -7
- package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/module/utils/helper.js +0 -3
- package/lib/module/utils/helper.js.map +1 -1
- package/lib/module/utils/hooks/useTimer.js +37 -0
- package/lib/module/utils/hooks/useTimer.js.map +1 -0
- package/lib/module/utils/loginHelper.js +6 -16
- package/lib/module/utils/loginHelper.js.map +1 -1
- package/lib/module/utils/storage.js +51 -29
- package/lib/module/utils/storage.js.map +1 -1
- package/lib/module/utils/utils.js +8 -6
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/components/executiontasks/CompletedWFSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/ExecutionTasksIndex.d.ts +6 -2
- package/lib/typescript/components/executiontasks/cancellation/CancellationSchema.d.ts +10 -5
- package/lib/typescript/components/executiontasks/captureInput/CaptureInputSchema.d.ts +7 -7
- package/lib/typescript/components/executiontasks/deliver/DeliverETInput.d.ts +7 -7
- package/lib/typescript/components/executiontasks/display/DisplaySchema.d.ts +5 -5
- package/lib/typescript/components/executiontasks/doodle/SignatureSchema.d.ts +7 -7
- package/lib/typescript/components/executiontasks/dropCash/DropCashSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/FormSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/widgets/DateTimeWidget.d.ts +1 -1
- package/lib/typescript/components/executiontasks/forms/widgets/DropdownWidget.d.ts +9 -0
- package/lib/typescript/components/executiontasks/httpRequest/HttpRequestETSchema.d.ts +6 -6
- package/lib/typescript/components/executiontasks/imageCapture/CaptureSchema.d.ts +16 -11
- package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/init/InitPaymentSchema.d.ts +3 -3
- package/lib/typescript/components/executiontasks/payments/processPayment/ProcessPaymentSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/pickup/PickpSchema.d.ts +3 -3
- package/lib/typescript/components/executiontasks/scan/ScanET.d.ts +16 -0
- package/lib/typescript/components/executiontasks/scan/ScanSchema.d.ts +70 -0
- package/lib/typescript/components/executiontasks/scan/constants.d.ts +6 -0
- package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +41 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/CScanner.d.ts +7 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/DropDownUtils.d.ts +7 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/ERDropDown.d.ts +17 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/ScanList.d.ts +8 -0
- package/lib/typescript/components/executiontasks/scan/utils.d.ts +21 -0
- package/lib/typescript/components/executiontasks/scanner/ScannerSchema.d.ts +6 -6
- package/lib/typescript/components/executiontasks/scanner/returns/DropDownUtils.d.ts +1 -2
- package/lib/typescript/components/executiontasks/scanner/returns/RTReasonSelection.d.ts +1 -1
- package/lib/typescript/components/executiontasks/scanner/returns/ScanList.d.ts +1 -1
- package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPET.d.ts +4 -0
- package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPSchema.d.ts +54 -0
- package/lib/typescript/components/executiontasks/validateOTP/constants.d.ts +10 -0
- package/lib/typescript/components/executiontasks/validateOTP/sub-components/OTPInput.d.ts +12 -0
- package/lib/typescript/components/executiontasks/validateOTP/utils.d.ts +7 -0
- package/lib/typescript/components/executiontasks/verifyInput/VerifyInputSchema.d.ts +8 -8
- package/lib/typescript/components/executiontasks/verifyLocation/VerifyLocSchema.d.ts +9 -9
- package/lib/typescript/components/executiontasks/verifyOtp/VerifyOtpSchema.d.ts +3 -3
- package/lib/typescript/components/widgets/IconButton.d.ts +9 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +9 -5
- package/lib/typescript/components/widgets/SplitTextInput.d.ts +12 -0
- package/lib/typescript/constants/apiConstants.d.ts +6 -0
- package/lib/typescript/constants/constants.d.ts +4 -2
- package/lib/typescript/errors/ErrorCodes.d.ts +3 -1
- package/lib/typescript/events/EventDispatcher.d.ts +5 -0
- package/lib/typescript/events/EventListener.d.ts +5 -0
- package/lib/typescript/events/constants.d.ts +5 -0
- package/lib/typescript/events/index.d.ts +2 -0
- package/lib/typescript/events/interface.d.ts +1 -0
- package/lib/typescript/index.d.ts +5 -4
- package/lib/typescript/manager/dispatch/DispatchStateContainer.d.ts +21 -8
- package/lib/typescript/manager/dispatchCodes/EventCodeContainer.d.ts +12 -1
- package/lib/typescript/manager/dispatchCodes/EventCodeRepo.d.ts +13 -0
- package/lib/typescript/manager/jobRemoval/JobRemovalManager.d.ts +6 -0
- package/lib/typescript/manager/sdk/DispatchSdkCache.d.ts +2 -0
- package/lib/typescript/manager/syncmanager/AppSyncManager.d.ts +1 -0
- package/lib/typescript/manager/syncmanager/DBConfig.d.ts +22 -2
- package/lib/typescript/manager/syncmanager/database.d.ts +5 -0
- package/lib/typescript/manager/syncmanager/document/models.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/events/ETEventsManager.d.ts +5 -1
- package/lib/typescript/manager/syncmanager/events/EventsSyncManager.d.ts +5 -1
- package/lib/typescript/manager/syncmanager/events/SyncHttpClient.d.ts +3 -1
- package/lib/typescript/models/DispatchModels.d.ts +56 -1
- package/lib/typescript/models/ReasonCodes.d.ts +5 -0
- package/lib/typescript/models/auth.d.ts +1 -1
- package/lib/typescript/models/execTasks/ETBaseModels.d.ts +27 -8
- package/lib/typescript/models/execTasks/ETConfig.d.ts +8 -4
- package/lib/typescript/models/sdk.d.ts +5 -0
- package/lib/typescript/native/signature/SignatureCapture.d.ts +1 -1
- package/lib/typescript/network/NetworkUtils.d.ts +1 -5
- package/lib/typescript/styles/SdkColors.d.ts +1 -0
- package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +36 -0
- package/lib/typescript/ui/screens/ETScreensIndex.d.ts +3 -1
- package/lib/typescript/ui/screens/ScanScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/ValidateOTPScreen.d.ts +3 -0
- package/lib/typescript/ui/uiConfig/RouteParams.d.ts +8 -0
- package/lib/typescript/utils/ApiUtils.d.ts +61 -0
- package/lib/typescript/utils/ExecTaskUtils.d.ts +7 -2
- package/lib/typescript/utils/NetworkUtil.d.ts +1 -1
- package/lib/typescript/utils/SyncManagerUtils.d.ts +3 -1
- package/lib/typescript/utils/hooks/useTimer.d.ts +5 -0
- package/lib/typescript/utils/storage.d.ts +17 -0
- package/package.json +23 -24
- package/tsconfig.json +9 -8
- package/file_unzip.js +0 -5
- package/mobile-execution-lib-0.6.4.tgz +0 -0
package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js
CHANGED
|
@@ -4,32 +4,79 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _ExecTaskUtils = require("../../../../utils/ExecTaskUtils");
|
|
11
|
-
|
|
12
9
|
var _EventCodeContainer = require("../../../../manager/dispatchCodes/EventCodeContainer");
|
|
13
|
-
|
|
14
10
|
var _ETConfig = require("../../../../models/execTasks/ETConfig");
|
|
15
|
-
|
|
16
11
|
var _reactNativePaper = require("react-native-paper");
|
|
17
|
-
|
|
18
12
|
var _reactNative = require("react-native");
|
|
19
|
-
|
|
20
13
|
var _CommonStyles = require("../../../../styles/executionTasks/CommonStyles");
|
|
21
|
-
|
|
22
14
|
var _PaymentUtils = require("../PaymentUtils");
|
|
23
|
-
|
|
24
15
|
var _PaymentStyles = require("../PaymentStyles");
|
|
25
|
-
|
|
16
|
+
var _constants = require("../../../../constants/constants");
|
|
17
|
+
var _MaterialIcons = _interopRequireDefault(require("react-native-vector-icons/MaterialIcons"));
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
-
|
|
28
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
-
|
|
30
21
|
const CompletePaymentET = etProps => {
|
|
31
22
|
const [disableProceed, setDisableProceed] = (0, _react.useState)(false);
|
|
32
|
-
|
|
23
|
+
const [showBackModal, setShowBackModal] = (0, _react.useState)(false);
|
|
24
|
+
(0, _react.useLayoutEffect)(() => {
|
|
25
|
+
etProps.navigation.setOptions({
|
|
26
|
+
title: etProps.title,
|
|
27
|
+
headerLeft: () => {
|
|
28
|
+
var _etProps$taskMeta;
|
|
29
|
+
return (_etProps$taskMeta = etProps.taskMeta) !== null && _etProps$taskMeta !== void 0 && _etProps$taskMeta.enableGoBack ? /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
30
|
+
onPress: async () => {
|
|
31
|
+
setShowBackModal(true);
|
|
32
|
+
},
|
|
33
|
+
name: "arrow-back",
|
|
34
|
+
color: 'black',
|
|
35
|
+
size: 25,
|
|
36
|
+
style: {
|
|
37
|
+
paddingRight: 15,
|
|
38
|
+
paddingTop: 5
|
|
39
|
+
}
|
|
40
|
+
}) : null;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}, [etProps.navigation, etProps.title]);
|
|
44
|
+
const renderModal = () => {
|
|
45
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativePaper.Portal, null, /*#__PURE__*/_react.default.createElement(_reactNativePaper.Modal, {
|
|
46
|
+
visible: showBackModal,
|
|
47
|
+
dismissable: true,
|
|
48
|
+
contentContainerStyle: _CommonStyles.CommonStyles.modalContent
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
50
|
+
style: _CommonStyles.CommonStyles.modalView
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNativePaper.Text, {
|
|
52
|
+
style: _CommonStyles.CommonStyles.subText
|
|
53
|
+
}, 'Are you sure you want to go back?'), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
|
|
54
|
+
labelStyle: _CommonStyles.CommonStyles.nextButtonLabel,
|
|
55
|
+
style: {
|
|
56
|
+
..._CommonStyles.CommonStyles.nextButton,
|
|
57
|
+
marginTop: 10
|
|
58
|
+
},
|
|
59
|
+
uppercase: false,
|
|
60
|
+
onPress: async () => {
|
|
61
|
+
etProps.onSubmitET({
|
|
62
|
+
paymentMode: etProps.paymentMode,
|
|
63
|
+
collectedAmount: etProps.collectedAmount,
|
|
64
|
+
tenantTransactionId: etProps.tenantTransactionId,
|
|
65
|
+
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.COMPLETE_PAYMENT, false, _constants.GO_BACK_EVENT_CODE, ''))
|
|
66
|
+
});
|
|
67
|
+
setShowBackModal(false);
|
|
68
|
+
}
|
|
69
|
+
}, "Yes"), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
|
|
70
|
+
labelStyle: _CommonStyles.CommonStyles.cancelButtonLabel,
|
|
71
|
+
style: {
|
|
72
|
+
..._CommonStyles.CommonStyles.cancelButton,
|
|
73
|
+
marginTop: 10
|
|
74
|
+
},
|
|
75
|
+
uppercase: false,
|
|
76
|
+
onPress: () => setShowBackModal(false)
|
|
77
|
+
}, "No"))));
|
|
78
|
+
};
|
|
79
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativePaper.Provider, null, renderModal(), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Portal, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
33
80
|
style: _CommonStyles.DeliverPickupStyles.mainContainer
|
|
34
81
|
}, /*#__PURE__*/_react.default.createElement(_reactNativePaper.Modal, {
|
|
35
82
|
dismissable: false,
|
|
@@ -54,12 +101,13 @@ const CompletePaymentET = etProps => {
|
|
|
54
101
|
marginTop: 20
|
|
55
102
|
}],
|
|
56
103
|
onPress: async () => {
|
|
104
|
+
var _etProps$applicableRe;
|
|
57
105
|
let etOutput = {
|
|
58
106
|
paymentMode: etProps.paymentMode,
|
|
59
107
|
collectedAmount: etProps.collectedAmount,
|
|
60
108
|
tenantTransactionId: etProps.tenantTransactionId,
|
|
61
109
|
// todo Hardcoded for SL Release and is only for CASH Payment Type
|
|
62
|
-
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.COMPLETE_PAYMENT, true, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.COMPLETE_PAYMENT, true), ''))
|
|
110
|
+
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.COMPLETE_PAYMENT, true, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.COMPLETE_PAYMENT, true, (_etProps$applicableRe = etProps.applicableReasons) === null || _etProps$applicableRe === void 0 ? void 0 : _etProps$applicableRe.success), ''))
|
|
63
111
|
};
|
|
64
112
|
setDisableProceed(true);
|
|
65
113
|
etProps.onSubmitET(etOutput);
|
|
@@ -71,22 +119,21 @@ const CompletePaymentET = etProps => {
|
|
|
71
119
|
}],
|
|
72
120
|
mode: 'outlined',
|
|
73
121
|
onPress: async () => {
|
|
122
|
+
var _etProps$applicableRe2;
|
|
74
123
|
let etOutput = {
|
|
75
124
|
paymentMode: etProps.paymentMode,
|
|
76
125
|
collectedAmount: etProps.collectedAmount,
|
|
77
126
|
tenantTransactionId: etProps.tenantTransactionId,
|
|
78
127
|
// todo Hardcoded for SL Release and is only for CASH Payment Type
|
|
79
|
-
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.COMPLETE_PAYMENT, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.COMPLETE_PAYMENT, false), ''))
|
|
128
|
+
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.COMPLETE_PAYMENT, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.COMPLETE_PAYMENT, false, (_etProps$applicableRe2 = etProps.applicableReasons) === null || _etProps$applicableRe2 === void 0 ? void 0 : _etProps$applicableRe2.failure), ''))
|
|
80
129
|
};
|
|
81
130
|
setDisableProceed(true);
|
|
82
131
|
etProps.onSubmitET(etOutput);
|
|
83
132
|
}
|
|
84
133
|
}, "Cancel"))))));
|
|
85
134
|
};
|
|
86
|
-
|
|
87
135
|
var _default = CompletePaymentET;
|
|
88
136
|
exports.default = _default;
|
|
89
|
-
|
|
90
137
|
const styles = _reactNative.StyleSheet.create({
|
|
91
138
|
title: {
|
|
92
139
|
fontSize: 18,
|
package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CompletePaymentET","etProps","disableProceed","setDisableProceed","useState","DeliverPickupStyles","mainContainer","modalContent","modalView","styles","title","color","PaymentStyles","amountStyle","expectedAmount","currencyCode","getPaymentValue","value","minorUnit","toLocaleString","message","message1","CommonStyles","nextButtonLabel","nextButton","marginTop","etOutput","paymentMode","collectedAmount","tenantTransactionId","getBaseETResponse","EntityCode","COMPLETE_PAYMENT","getEventCodeByET","ExecutionTaskID","onSubmitET","cancelButtonLabel","cancelButton","StyleSheet","create","fontSize","fontStyle","fontWeight","lineHeight","textAlign","fontFamily","Fonts","IBMPlexSans_600SemiBold","IBMPlexSans_400Regular"],"sources":["CompletePaymentET.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport type {\n CompletePaymentInput,\n CompletePaymentOutput,\n} from './CompletePaymentSchema';\nimport { getBaseETResponse } from '../../../../utils/ExecTaskUtils';\nimport { getEventCodeByET } from '../../../../manager/dispatchCodes/EventCodeContainer';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../../models/execTasks/ETConfig';\nimport {\n Button,\n Modal,\n Paragraph,\n Portal,\n Provider,\n Text,\n Title,\n} from 'react-native-paper';\nimport { StyleSheet, View } from 'react-native';\nimport {\n CommonStyles,\n DeliverPickupStyles,\n Fonts,\n} from '../../../../styles/executionTasks/CommonStyles';\nimport { getPaymentValue } from '../PaymentUtils';\nimport { PaymentStyles } from '../PaymentStyles';\n\nconst CompletePaymentET = (etProps: CompletePaymentInput) => {\n const [disableProceed, setDisableProceed] = useState(false);\n return (\n <Provider>\n <Portal>\n <View style={DeliverPickupStyles.mainContainer}>\n <Modal\n dismissable={false}\n visible={true}\n contentContainerStyle={DeliverPickupStyles.modalContent}\n >\n <View style={DeliverPickupStyles.modalView}>\n <Title style={[styles.title, { color: 'grey' }]}>\n {etProps.title}\n </Title>\n <Paragraph style={PaymentStyles.amountStyle}>\n {etProps.expectedAmount.currencyCode +\n ' ' +\n getPaymentValue(\n etProps.expectedAmount.value,\n etProps.expectedAmount.minorUnit\n ).toLocaleString()}\n </Paragraph>\n {etProps.message && (\n <Text style={styles.message1}>{etProps.message}</Text>\n )}\n <Button\n disabled={disableProceed}\n mode={'contained'}\n uppercase={false}\n labelStyle={CommonStyles.nextButtonLabel}\n style={[\n CommonStyles.nextButton,\n {\n marginTop: 20,\n },\n ]}\n onPress={async () => {\n let etOutput: CompletePaymentOutput = {\n paymentMode: etProps.paymentMode,\n collectedAmount: etProps.collectedAmount,\n tenantTransactionId: etProps.tenantTransactionId, // todo Hardcoded for SL Release and is only for CASH Payment Type\n ...(await getBaseETResponse(\n EntityCode.COMPLETE_PAYMENT,\n true,\n getEventCodeByET(ExecutionTaskID.COMPLETE_PAYMENT, true),\n ''\n )),\n };\n setDisableProceed(true);\n etProps.onSubmitET(etOutput);\n }}\n >\n Continue\n </Button>\n <Button\n labelStyle={CommonStyles.cancelButtonLabel}\n style={[CommonStyles.cancelButton, { marginTop: 10 }]}\n mode={'outlined'}\n onPress={async () => {\n let etOutput: CompletePaymentOutput = {\n paymentMode: etProps.paymentMode,\n collectedAmount: etProps.collectedAmount,\n tenantTransactionId: etProps.tenantTransactionId, // todo Hardcoded for SL Release and is only for CASH Payment Type\n ...(await getBaseETResponse(\n EntityCode.COMPLETE_PAYMENT,\n false,\n getEventCodeByET(ExecutionTaskID.COMPLETE_PAYMENT, false),\n ''\n )),\n };\n setDisableProceed(true);\n etProps.onSubmitET(etOutput);\n }}\n >\n Cancel\n </Button>\n </View>\n </Modal>\n </View>\n </Portal>\n </Provider>\n );\n};\nexport default CompletePaymentET;\n\nconst styles = StyleSheet.create({\n title: {\n fontSize: 18,\n fontStyle: 'normal',\n fontWeight: '600',\n lineHeight: 28,\n textAlign: 'center',\n color: '#111111',\n fontFamily: Fonts.IBMPlexSans_600SemiBold,\n },\n message1: {\n fontStyle: 'normal',\n fontWeight: 'normal',\n fontSize: 12,\n lineHeight: 20,\n textAlign: 'center',\n color: '#111111',\n marginTop: 12,\n fontFamily: Fonts.IBMPlexSans_400Regular,\n },\n});\n"],"mappings":";;;;;;;AAAA;;AAKA;;AACA;;AACA;;AAIA;;AASA;;AACA;;AAKA;;AACA;;;;;;AAEA,MAAMA,iBAAiB,GAAIC,OAAD,IAAmC;EAC3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,UAAU,EAAEC,mBAAA,CAAMC;EAPb,CADwB;EAU/B1B,QAAQ,EAAE;IACRoB,SAAS,EAAE,QADH;IAERC,UAAU,EAAE,QAFJ;IAGRF,QAAQ,EAAE,EAHF;IAIRG,UAAU,EAAE,EAJJ;IAKRC,SAAS,EAAE,QALH;IAMRjC,KAAK,EAAE,SANC;IAORc,SAAS,EAAE,EAPH;IAQRoB,UAAU,EAAEC,mBAAA,CAAME;EARV;AAVqB,CAAlB,CAAf"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_ExecTaskUtils","_EventCodeContainer","_ETConfig","_reactNativePaper","_reactNative","_CommonStyles","_PaymentUtils","_PaymentStyles","_constants","_MaterialIcons","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","CompletePaymentET","etProps","disableProceed","setDisableProceed","useState","showBackModal","setShowBackModal","useLayoutEffect","navigation","setOptions","title","headerLeft","_etProps$taskMeta","taskMeta","enableGoBack","createElement","onPress","name","color","size","style","paddingRight","paddingTop","renderModal","Portal","Modal","visible","dismissable","contentContainerStyle","CommonStyles","modalContent","View","modalView","Text","subText","Button","labelStyle","nextButtonLabel","nextButton","marginTop","uppercase","onSubmitET","paymentMode","collectedAmount","tenantTransactionId","getBaseETResponse","EntityCode","COMPLETE_PAYMENT","GO_BACK_EVENT_CODE","cancelButtonLabel","cancelButton","Provider","DeliverPickupStyles","mainContainer","Title","styles","Paragraph","PaymentStyles","amountStyle","expectedAmount","currencyCode","getPaymentValue","value","minorUnit","toLocaleString","message","message1","disabled","mode","_etProps$applicableRe","etOutput","getEventCodeByET","ExecutionTaskID","applicableReasons","success","_etProps$applicableRe2","failure","_default","exports","StyleSheet","create","fontSize","fontStyle","fontWeight","lineHeight","textAlign","fontFamily","Fonts","IBMPlexSans_600SemiBold","IBMPlexSans_400Regular"],"sources":["CompletePaymentET.tsx"],"sourcesContent":["import React, { useState, useLayoutEffect } from 'react';\nimport type {\n CompletePaymentInput,\n CompletePaymentOutput,\n} from './CompletePaymentSchema';\nimport { getBaseETResponse } from '../../../../utils/ExecTaskUtils';\nimport { getEventCodeByET } from '../../../../manager/dispatchCodes/EventCodeContainer';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../../models/execTasks/ETConfig';\nimport {\n Button,\n Modal,\n Paragraph,\n Portal,\n Provider,\n Text,\n Title,\n} from 'react-native-paper';\nimport { StyleSheet, View } from 'react-native';\nimport {\n CommonStyles,\n DeliverPickupStyles,\n Fonts,\n} from '../../../../styles/executionTasks/CommonStyles';\nimport { getPaymentValue } from '../PaymentUtils';\nimport { PaymentStyles } from '../PaymentStyles';\nimport { GO_BACK_EVENT_CODE } from '../../../../constants/constants';\nimport Icon from 'react-native-vector-icons/MaterialIcons';\n\nconst CompletePaymentET = (etProps: CompletePaymentInput) => {\n const [disableProceed, setDisableProceed] = useState(false);\n const [showBackModal, setShowBackModal] = useState(false);\n useLayoutEffect(() => {\n etProps.navigation.setOptions({\n title: etProps.title,\n headerLeft: () =>\n etProps.taskMeta?.enableGoBack ? (\n <Icon\n onPress={async () => {\n setShowBackModal(true);\n }}\n name=\"arrow-back\"\n color={'black'}\n size={25}\n style={{\n paddingRight: 15,\n paddingTop: 5,\n }}\n />\n ) : null,\n });\n }, [etProps.navigation, etProps.title]);\n\n const renderModal = () => {\n return (\n <Portal>\n <Modal\n visible={showBackModal}\n dismissable={true}\n contentContainerStyle={CommonStyles.modalContent}\n >\n <View style={CommonStyles.modalView}>\n <Text style={CommonStyles.subText}>\n {'Are you sure you want to go back?'}\n </Text>\n <Button\n labelStyle={CommonStyles.nextButtonLabel}\n style={{ ...CommonStyles.nextButton, marginTop: 10 }}\n uppercase={false}\n onPress={async () => {\n etProps.onSubmitET({\n paymentMode: etProps.paymentMode,\n collectedAmount: etProps.collectedAmount,\n tenantTransactionId: etProps.tenantTransactionId,\n ...(await getBaseETResponse(\n EntityCode.COMPLETE_PAYMENT,\n false,\n GO_BACK_EVENT_CODE,\n ''\n )),\n });\n setShowBackModal(false);\n }}\n >\n Yes\n </Button>\n <Button\n labelStyle={CommonStyles.cancelButtonLabel}\n style={{ ...CommonStyles.cancelButton, marginTop: 10 }}\n uppercase={false}\n onPress={() => setShowBackModal(false)}\n >\n No\n </Button>\n </View>\n </Modal>\n </Portal>\n );\n };\n return (\n <Provider>\n {renderModal()}\n <Portal>\n <View style={DeliverPickupStyles.mainContainer}>\n <Modal\n dismissable={false}\n visible={true}\n contentContainerStyle={DeliverPickupStyles.modalContent}\n >\n <View style={DeliverPickupStyles.modalView}>\n <Title style={[styles.title, { color: 'grey' }]}>\n {etProps.title}\n </Title>\n <Paragraph style={PaymentStyles.amountStyle}>\n {etProps.expectedAmount.currencyCode +\n ' ' +\n getPaymentValue(\n etProps.expectedAmount.value,\n etProps.expectedAmount.minorUnit\n ).toLocaleString()}\n </Paragraph>\n {etProps.message && (\n <Text style={styles.message1}>{etProps.message}</Text>\n )}\n <Button\n disabled={disableProceed}\n mode={'contained'}\n uppercase={false}\n labelStyle={CommonStyles.nextButtonLabel}\n style={[\n CommonStyles.nextButton,\n {\n marginTop: 20,\n },\n ]}\n onPress={async () => {\n let etOutput: CompletePaymentOutput = {\n paymentMode: etProps.paymentMode,\n collectedAmount: etProps.collectedAmount,\n tenantTransactionId: etProps.tenantTransactionId, // todo Hardcoded for SL Release and is only for CASH Payment Type\n ...(await getBaseETResponse(\n EntityCode.COMPLETE_PAYMENT,\n true,\n getEventCodeByET(\n ExecutionTaskID.COMPLETE_PAYMENT,\n true,\n etProps.applicableReasons?.success\n ),\n ''\n )),\n };\n setDisableProceed(true);\n etProps.onSubmitET(etOutput);\n }}\n >\n Continue\n </Button>\n <Button\n labelStyle={CommonStyles.cancelButtonLabel}\n style={[CommonStyles.cancelButton, { marginTop: 10 }]}\n mode={'outlined'}\n onPress={async () => {\n let etOutput: CompletePaymentOutput = {\n paymentMode: etProps.paymentMode,\n collectedAmount: etProps.collectedAmount,\n tenantTransactionId: etProps.tenantTransactionId, // todo Hardcoded for SL Release and is only for CASH Payment Type\n ...(await getBaseETResponse(\n EntityCode.COMPLETE_PAYMENT,\n false,\n getEventCodeByET(\n ExecutionTaskID.COMPLETE_PAYMENT,\n false,\n etProps.applicableReasons?.failure\n ),\n ''\n )),\n };\n setDisableProceed(true);\n etProps.onSubmitET(etOutput);\n }}\n >\n Cancel\n </Button>\n </View>\n </Modal>\n </View>\n </Portal>\n </Provider>\n );\n};\nexport default CompletePaymentET;\n\nconst styles = StyleSheet.create({\n title: {\n fontSize: 18,\n fontStyle: 'normal',\n fontWeight: '600',\n lineHeight: 28,\n textAlign: 'center',\n color: '#111111',\n fontFamily: Fonts.IBMPlexSans_600SemiBold,\n },\n message1: {\n fontStyle: 'normal',\n fontWeight: 'normal',\n fontSize: 12,\n lineHeight: 20,\n textAlign: 'center',\n color: '#111111',\n marginTop: 12,\n fontFamily: Fonts.IBMPlexSans_400Regular,\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAIA,IAAAI,iBAAA,GAAAJ,OAAA;AASA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAKA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAC,sBAAA,CAAAX,OAAA;AAA2D,SAAAW,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBA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,CAACwE,iBAAiB,cAAAE,sBAAA,uBAAzBA,sBAAA,CAA2BC,OAAO,CACnC,EACD,EAAE,CACH;MACH,CAAC;MACDzE,iBAAiB,CAAC,IAAI,CAAC;MACvBF,OAAO,CAACwC,UAAU,CAAC6B,QAAQ,CAAC;IAC9B;EAAE,GACH,QAED,CAAS,CACJ,CACD,CACH,CACA,CACA;AAEf,CAAC;AAAC,IAAAO,QAAA,GACa7E,iBAAiB;AAAA8E,OAAA,CAAAlG,OAAA,GAAAiG,QAAA;AAEhC,MAAMtB,MAAM,GAAGwB,uBAAU,CAACC,MAAM,CAAC;EAC/BtE,KAAK,EAAE;IACLuE,QAAQ,EAAE,EAAE;IACZC,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,KAAK;IACjBC,UAAU,EAAE,EAAE;IACdC,SAAS,EAAE,QAAQ;IACnBnE,KAAK,EAAE,SAAS;IAChBoE,UAAU,EAAEC,mBAAK,CAACC;EACpB,CAAC;EACDtB,QAAQ,EAAE;IACRgB,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,QAAQ;IACpBF,QAAQ,EAAE,EAAE;IACZG,UAAU,EAAE,EAAE;IACdC,SAAS,EAAE,QAAQ;IACnBnE,KAAK,EAAE,SAAS;IAChBqB,SAAS,EAAE,EAAE;IACb+C,UAAU,EAAEC,mBAAK,CAACE;EACpB;AACF,CAAC,CAAC"}
|
|
@@ -4,35 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
var _reactNativePaper = require("react-native-paper");
|
|
13
|
-
|
|
14
9
|
var _utils = require("../../../../utils/utils");
|
|
15
|
-
|
|
16
10
|
var _PaymentUtils = require("../PaymentUtils");
|
|
17
|
-
|
|
18
11
|
var _ExecTaskUtils = require("../../../../utils/ExecTaskUtils");
|
|
19
|
-
|
|
20
12
|
var _ETConfig = require("../../../../models/execTasks/ETConfig");
|
|
21
|
-
|
|
22
13
|
var _EventCodeContainer = require("../../../../manager/dispatchCodes/EventCodeContainer");
|
|
23
|
-
|
|
24
14
|
var _PaymentStyles = require("../PaymentStyles");
|
|
25
|
-
|
|
26
15
|
var _CommonStyles = require("../../../../styles/executionTasks/CommonStyles");
|
|
27
|
-
|
|
28
16
|
var _Toaster = require("../../../widgets/Toaster");
|
|
29
|
-
|
|
17
|
+
var _reactNativePaper = require("react-native-paper");
|
|
18
|
+
var _MaterialIcons = _interopRequireDefault(require("react-native-vector-icons/MaterialIcons"));
|
|
19
|
+
var _constants = require("../../../../constants/constants");
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
|
-
|
|
32
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
-
|
|
34
23
|
const styles = _PaymentStyles.PaymentStyles;
|
|
35
|
-
|
|
36
24
|
const footerMessage = message => {
|
|
37
25
|
if (message) return /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
38
26
|
style: styles.textStyle1
|
|
@@ -40,16 +28,67 @@ const footerMessage = message => {
|
|
|
40
28
|
style: styles.messageStyle
|
|
41
29
|
}, message));else return null;
|
|
42
30
|
};
|
|
43
|
-
|
|
44
31
|
const InitPaymentET = props => {
|
|
45
32
|
const [paymentMode, setPaymentMode] = (0, _react.useState)('');
|
|
46
33
|
const [disableNext, setDisableNext] = (0, _react.useState)(false);
|
|
34
|
+
const [showBackModal, setShowBackModal] = (0, _react.useState)(false);
|
|
35
|
+
(0, _react.useLayoutEffect)(() => {
|
|
36
|
+
props.navigation.setOptions({
|
|
37
|
+
title: props.title,
|
|
38
|
+
headerLeft: () => {
|
|
39
|
+
var _props$taskMeta;
|
|
40
|
+
return (_props$taskMeta = props.taskMeta) !== null && _props$taskMeta !== void 0 && _props$taskMeta.enableGoBack ? /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
41
|
+
onPress: async () => {
|
|
42
|
+
setShowBackModal(true);
|
|
43
|
+
},
|
|
44
|
+
name: "arrow-back",
|
|
45
|
+
color: 'black',
|
|
46
|
+
size: 25,
|
|
47
|
+
style: {
|
|
48
|
+
paddingRight: 15,
|
|
49
|
+
paddingTop: 5
|
|
50
|
+
}
|
|
51
|
+
}) : null;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}, [props.navigation, props.title]);
|
|
55
|
+
const renderModal = () => {
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativePaper.Portal, null, /*#__PURE__*/_react.default.createElement(_reactNativePaper.Modal, {
|
|
57
|
+
visible: showBackModal,
|
|
58
|
+
dismissable: true,
|
|
59
|
+
contentContainerStyle: _CommonStyles.CommonStyles.modalContent
|
|
60
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
61
|
+
style: _CommonStyles.CommonStyles.modalView
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
63
|
+
style: _CommonStyles.CommonStyles.subText
|
|
64
|
+
}, 'Are you sure you want to go back?'), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
|
|
65
|
+
labelStyle: _CommonStyles.CommonStyles.nextButtonLabel,
|
|
66
|
+
style: {
|
|
67
|
+
..._CommonStyles.CommonStyles.nextButton,
|
|
68
|
+
marginTop: 10
|
|
69
|
+
},
|
|
70
|
+
uppercase: false,
|
|
71
|
+
onPress: async () => {
|
|
72
|
+
props.onSubmitET({
|
|
73
|
+
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.INIT_PAYMENT, false, _constants.GO_BACK_EVENT_CODE, ''))
|
|
74
|
+
});
|
|
75
|
+
setShowBackModal(false);
|
|
76
|
+
}
|
|
77
|
+
}, "Yes"), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
|
|
78
|
+
labelStyle: _CommonStyles.CommonStyles.cancelButtonLabel,
|
|
79
|
+
style: {
|
|
80
|
+
..._CommonStyles.CommonStyles.cancelButton,
|
|
81
|
+
marginTop: 10
|
|
82
|
+
},
|
|
83
|
+
uppercase: false,
|
|
84
|
+
onPress: () => setShowBackModal(false)
|
|
85
|
+
}, "No"))));
|
|
86
|
+
};
|
|
47
87
|
(0, _react.useEffect)(() => {
|
|
48
88
|
if (props.allowedModes && props.allowedModes.length === 1) {
|
|
49
89
|
setPaymentMode(props.allowedModes[0]);
|
|
50
90
|
}
|
|
51
91
|
}, [props.allowedModes]);
|
|
52
|
-
|
|
53
92
|
const renderItem = _ref => {
|
|
54
93
|
let {
|
|
55
94
|
item
|
|
@@ -70,8 +109,7 @@ const InitPaymentET = props => {
|
|
|
70
109
|
}
|
|
71
110
|
}, item));
|
|
72
111
|
};
|
|
73
|
-
|
|
74
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
112
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativePaper.Provider, null, renderModal(), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
75
113
|
style: _CommonStyles.CommonStyles.mainContainer
|
|
76
114
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
77
115
|
style: styles.textStyle1
|
|
@@ -107,10 +145,11 @@ const InitPaymentET = props => {
|
|
|
107
145
|
labelStyle: _CommonStyles.CommonStyles.cancelButtonLabel,
|
|
108
146
|
mode: 'outlined',
|
|
109
147
|
onPress: async () => {
|
|
148
|
+
var _props$applicableReas;
|
|
110
149
|
props.onSubmitET({
|
|
111
150
|
paymentMode: paymentMode,
|
|
112
151
|
transactionId: (0, _PaymentUtils.getUniqueTransactionID)(props.amount.value),
|
|
113
|
-
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.INIT_PAYMENT, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.INIT_PAYMENT, false), ''))
|
|
152
|
+
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.INIT_PAYMENT, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.INIT_PAYMENT, false, (_props$applicableReas = props.applicableReasons) === null || _props$applicableReas === void 0 ? void 0 : _props$applicableReas.failure), ''))
|
|
114
153
|
});
|
|
115
154
|
}
|
|
116
155
|
}, "Cancel"), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
|
|
@@ -123,17 +162,17 @@ const InitPaymentET = props => {
|
|
|
123
162
|
mode: 'contained',
|
|
124
163
|
onPress: async () => {
|
|
125
164
|
if (!(0, _utils.isEmptyOrBlank)(paymentMode)) {
|
|
165
|
+
var _props$applicableReas2;
|
|
126
166
|
setDisableNext(true);
|
|
127
167
|
props.onSubmitET({
|
|
128
168
|
paymentMode: paymentMode,
|
|
129
169
|
transactionId: (0, _PaymentUtils.getUniqueTransactionID)(props.amount.value),
|
|
130
|
-
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.INIT_PAYMENT, true, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.INIT_PAYMENT, true), ''))
|
|
170
|
+
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.INIT_PAYMENT, true, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.INIT_PAYMENT, true, (_props$applicableReas2 = props.applicableReasons) === null || _props$applicableReas2 === void 0 ? void 0 : _props$applicableReas2.success), ''))
|
|
131
171
|
});
|
|
132
172
|
} else (0, _Toaster.showToast)('No payment mode selected');
|
|
133
173
|
}
|
|
134
|
-
}, "Collect"))));
|
|
174
|
+
}, "Collect")))));
|
|
135
175
|
};
|
|
136
|
-
|
|
137
176
|
var _default = InitPaymentET;
|
|
138
177
|
exports.default = _default;
|
|
139
178
|
//# sourceMappingURL=InitPaymentET.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["styles","PaymentStyles","footerMessage","message","textStyle1","messageStyle","InitPaymentET","props","paymentMode","setPaymentMode","useState","disableNext","setDisableNext","useEffect","allowedModes","length","renderItem","item","reasonItemStyle","reasonTextStyle","CommonStyles","mainContainer","amountStyle","amount","currencyCode","getPaymentValue","value","minorUnit","toLocaleString","flex","justifyContent","marginBottom","flexDirection","marginStart","marginEnd","cancelButton","cancelButtonLabel","onSubmitET","transactionId","getUniqueTransactionID","getBaseETResponse","EntityCode","INIT_PAYMENT","getEventCodeByET","ExecutionTaskID","nextButton","nextButtonLabel","isEmptyOrBlank","showToast"],"sources":["InitPaymentET.tsx"],"sourcesContent":["import type { InitPaymentInput } from './InitPaymentSchema';\nimport React, { useEffect, useState } from 'react';\nimport { FlatList, Text, View } from 'react-native';\nimport { Button, RadioButton } from 'react-native-paper';\nimport { isEmptyOrBlank } from '../../../../utils/utils';\nimport { getPaymentValue, getUniqueTransactionID } from '../PaymentUtils';\nimport { getBaseETResponse } from '../../../../utils/ExecTaskUtils';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../../models/execTasks/ETConfig';\nimport { getEventCodeByET } from '../../../../manager/dispatchCodes/EventCodeContainer';\nimport { PaymentStyles } from '../PaymentStyles';\nimport { CommonStyles } from '../../../../styles/executionTasks/CommonStyles';\nimport { showToast } from '../../../widgets/Toaster';\n\nconst styles = PaymentStyles;\n\nconst footerMessage = (message?: string) => {\n if (message)\n return (\n <View>\n <Text style={styles.textStyle1}>MESSAGE</Text>\n <Text style={styles.messageStyle}>{message}</Text>\n </View>\n );\n else return null;\n};\nconst InitPaymentET = (props: InitPaymentInput) => {\n const [paymentMode, setPaymentMode] = useState('');\n const [disableNext, setDisableNext] = useState(false);\n\n useEffect(() => {\n if (props.allowedModes && props.allowedModes.length === 1) {\n setPaymentMode(props.allowedModes[0]);\n }\n }, [props.allowedModes]);\n const renderItem = ({ item }: { item: string }) => {\n return (\n <View style={styles.reasonItemStyle}>\n <RadioButton\n color={'#5B80F7'}\n value={item}\n status={paymentMode === item ? 'checked' : 'unchecked'}\n onPress={() => {\n setPaymentMode(item);\n }}\n />\n <Text\n style={styles.reasonTextStyle}\n onPress={() => {\n setPaymentMode(item);\n }}\n >\n {item}\n </Text>\n </View>\n );\n };\n return (\n <View style={CommonStyles.mainContainer}>\n <Text style={styles.textStyle1}>AMOUNT</Text>\n <Text style={styles.amountStyle}>\n {props.amount.currencyCode +\n ' ' +\n getPaymentValue(\n props.amount.value,\n props.amount.minorUnit\n ).toLocaleString()}\n </Text>\n <Text style={styles.textStyle1}>OPTIONS TO COLLECT PAYMENT</Text>\n <View style={{ flex: 1 }}>\n <FlatList\n data={props.allowedModes}\n renderItem={renderItem}\n keyExtractor={(item) => item}\n ListFooterComponent={footerMessage(props.message)}\n />\n </View>\n <View style={{ justifyContent: 'flex-end', marginBottom: 10 }}>\n <View\n style={{\n flexDirection: 'row',\n marginStart: 10,\n marginEnd: 10,\n }}\n >\n <Button\n style={[\n CommonStyles.cancelButton,\n {\n marginEnd: 5,\n flex: 1,\n },\n ]}\n labelStyle={CommonStyles.cancelButtonLabel}\n mode={'outlined'}\n onPress={async () => {\n props.onSubmitET({\n paymentMode: paymentMode,\n transactionId: getUniqueTransactionID(props.amount.value),\n ...(await getBaseETResponse(\n EntityCode.INIT_PAYMENT,\n false,\n getEventCodeByET(ExecutionTaskID.INIT_PAYMENT, false),\n ''\n )),\n });\n }}\n >\n Cancel\n </Button>\n <Button\n disabled={disableNext}\n style={[\n CommonStyles.nextButton,\n {\n flex: 1,\n marginStart: 5,\n },\n ]}\n labelStyle={CommonStyles.nextButtonLabel}\n mode={'contained'}\n onPress={async () => {\n if (!isEmptyOrBlank(paymentMode)) {\n setDisableNext(true);\n props.onSubmitET({\n paymentMode: paymentMode,\n transactionId: getUniqueTransactionID(props.amount.value),\n ...(await getBaseETResponse(\n EntityCode.INIT_PAYMENT,\n true,\n getEventCodeByET(ExecutionTaskID.INIT_PAYMENT, true),\n ''\n )),\n });\n } else showToast('No payment mode selected');\n }}\n >\n Collect\n </Button>\n </View>\n </View>\n </View>\n );\n};\nexport default InitPaymentET;\n"],"mappings":";;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,MAAM,GAAGC,4BAAf;;AAEA,MAAMC,aAAa,GAAIC,OAAD,IAAsB;EAC1C,IAAIA,OAAJ,EACE,oBACE,6BAAC,iBAAD,qBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEH,MAAM,CAACI;EAApB,aADF,eAEE,6BAAC,iBAAD;IAAM,KAAK,EAAEJ,MAAM,CAACK;EAApB,GAAmCF,OAAnC,CAFF,CADF,CADF,KAOK,OAAO,IAAP;AACN,CATD;;AAUA,MAAMG,aAAa,GAAIC,KAAD,IAA6B;EACjD,MAAM,CAACC,WAAD,EAAcC,cAAd,IAAgC,IAAAC,eAAA,EAAS,EAAT,CAAtC;EACA,MAAM,CAACC,WAAD,EAAcC,cAAd,IAAgC,IAAAF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E,YAAY;MACnB,IAAI,CAAC,IAAAC,qBAAA,EAAevC,WAAf,CAAL,EAAkC;QAChCI,cAAc,CAAC,IAAD,CAAd;QACAL,KAAK,CAAC8B,UAAN,CAAiB;UACf7B,WAAW,EAAEA,WADE;UAEf8B,aAAa,EAAE,IAAAC,oCAAA,EAAuBhC,KAAK,CAACgB,MAAN,CAAaG,KAApC,CAFA;UAGf,IAAI,MAAM,IAAAc,gCAAA,EACRC,oBAAA,CAAWC,YADH,EAER,IAFQ,EAGR,IAAAC,oCAAA,EAAiBC,yBAAA,CAAgBF,YAAjC,EAA+C,IAA/C,CAHQ,EAIR,EAJQ,CAAV;QAHe,CAAjB;MAUD,CAZD,MAYO,IAAAM,kBAAA,EAAU,0BAAV;IACR;EAzBH,aAhCF,CADF,CAnBF,CADF;AAsFD,CArHD;;eAsHe1C,a"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_utils","_PaymentUtils","_ExecTaskUtils","_ETConfig","_EventCodeContainer","_PaymentStyles","_CommonStyles","_Toaster","_reactNativePaper","_MaterialIcons","_interopRequireDefault","_constants","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","styles","PaymentStyles","footerMessage","message","createElement","View","Text","style","textStyle1","messageStyle","InitPaymentET","props","paymentMode","setPaymentMode","useState","disableNext","setDisableNext","showBackModal","setShowBackModal","useLayoutEffect","navigation","setOptions","title","headerLeft","_props$taskMeta","taskMeta","enableGoBack","onPress","name","color","size","paddingRight","paddingTop","renderModal","Portal","Modal","visible","dismissable","contentContainerStyle","CommonStyles","modalContent","modalView","subText","Button","labelStyle","nextButtonLabel","nextButton","marginTop","uppercase","onSubmitET","getBaseETResponse","EntityCode","INIT_PAYMENT","GO_BACK_EVENT_CODE","cancelButtonLabel","cancelButton","useEffect","allowedModes","length","renderItem","_ref","item","reasonItemStyle","RadioButton","value","status","reasonTextStyle","Provider","mainContainer","amountStyle","amount","currencyCode","getPaymentValue","minorUnit","toLocaleString","flex","FlatList","data","keyExtractor","ListFooterComponent","justifyContent","marginBottom","flexDirection","marginStart","marginEnd","mode","_props$applicableReas","transactionId","getUniqueTransactionID","getEventCodeByET","ExecutionTaskID","applicableReasons","failure","disabled","isEmptyOrBlank","_props$applicableReas2","success","showToast","_default","exports"],"sources":["InitPaymentET.tsx"],"sourcesContent":["import type { InitPaymentInput } from './InitPaymentSchema';\nimport React, { useEffect, useState, useLayoutEffect } from 'react';\nimport { FlatList, Text, View } from 'react-native';\nimport { isEmptyOrBlank } from '../../../../utils/utils';\nimport { getPaymentValue, getUniqueTransactionID } from '../PaymentUtils';\nimport { getBaseETResponse } from '../../../../utils/ExecTaskUtils';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../../models/execTasks/ETConfig';\nimport { getEventCodeByET } from '../../../../manager/dispatchCodes/EventCodeContainer';\nimport { PaymentStyles } from '../PaymentStyles';\nimport { CommonStyles } from '../../../../styles/executionTasks/CommonStyles';\nimport { showToast } from '../../../widgets/Toaster';\nimport {\n Button,\n Modal,\n Portal,\n Provider,\n RadioButton,\n} from 'react-native-paper';\nimport Icon from 'react-native-vector-icons/MaterialIcons';\nimport { GO_BACK_EVENT_CODE } from '../../../../constants/constants';\n\nconst styles = PaymentStyles;\n\nconst footerMessage = (message?: string) => {\n if (message)\n return (\n <View>\n <Text style={styles.textStyle1}>MESSAGE</Text>\n <Text style={styles.messageStyle}>{message}</Text>\n </View>\n );\n else return null;\n};\nconst InitPaymentET = (props: InitPaymentInput) => {\n const [paymentMode, setPaymentMode] = useState('');\n const [disableNext, setDisableNext] = useState(false);\n const [showBackModal, setShowBackModal] = useState(false);\n useLayoutEffect(() => {\n props.navigation.setOptions({\n title: props.title,\n headerLeft: () =>\n props.taskMeta?.enableGoBack ? (\n <Icon\n onPress={async () => {\n setShowBackModal(true);\n }}\n name=\"arrow-back\"\n color={'black'}\n size={25}\n style={{\n paddingRight: 15,\n paddingTop: 5,\n }}\n />\n ) : null,\n });\n }, [props.navigation, props.title]);\n\n const renderModal = () => {\n return (\n <Portal>\n <Modal\n visible={showBackModal}\n dismissable={true}\n contentContainerStyle={CommonStyles.modalContent}\n >\n <View style={CommonStyles.modalView}>\n <Text style={CommonStyles.subText}>\n {'Are you sure you want to go back?'}\n </Text>\n <Button\n labelStyle={CommonStyles.nextButtonLabel}\n style={{ ...CommonStyles.nextButton, marginTop: 10 }}\n uppercase={false}\n onPress={async () => {\n props.onSubmitET({\n ...(await getBaseETResponse(\n EntityCode.INIT_PAYMENT,\n false,\n GO_BACK_EVENT_CODE,\n ''\n )),\n });\n setShowBackModal(false);\n }}\n >\n Yes\n </Button>\n <Button\n labelStyle={CommonStyles.cancelButtonLabel}\n style={{ ...CommonStyles.cancelButton, marginTop: 10 }}\n uppercase={false}\n onPress={() => setShowBackModal(false)}\n >\n No\n </Button>\n </View>\n </Modal>\n </Portal>\n );\n };\n\n useEffect(() => {\n if (props.allowedModes && props.allowedModes.length === 1) {\n setPaymentMode(props.allowedModes[0]);\n }\n }, [props.allowedModes]);\n const renderItem = ({ item }: { item: string }) => {\n return (\n <View style={styles.reasonItemStyle}>\n <RadioButton\n color={'#5B80F7'}\n value={item}\n status={paymentMode === item ? 'checked' : 'unchecked'}\n onPress={() => {\n setPaymentMode(item);\n }}\n />\n <Text\n style={styles.reasonTextStyle}\n onPress={() => {\n setPaymentMode(item);\n }}\n >\n {item}\n </Text>\n </View>\n );\n };\n\n return (\n <Provider>\n {renderModal()}\n <View style={CommonStyles.mainContainer}>\n <Text style={styles.textStyle1}>AMOUNT</Text>\n <Text style={styles.amountStyle}>\n {props.amount.currencyCode +\n ' ' +\n getPaymentValue(\n props.amount.value,\n props.amount.minorUnit\n ).toLocaleString()}\n </Text>\n <Text style={styles.textStyle1}>OPTIONS TO COLLECT PAYMENT</Text>\n <View style={{ flex: 1 }}>\n <FlatList\n data={props.allowedModes}\n renderItem={renderItem}\n keyExtractor={(item) => item}\n ListFooterComponent={footerMessage(props.message)}\n />\n </View>\n <View style={{ justifyContent: 'flex-end', marginBottom: 10 }}>\n <View\n style={{\n flexDirection: 'row',\n marginStart: 10,\n marginEnd: 10,\n }}\n >\n <Button\n style={[\n CommonStyles.cancelButton,\n {\n marginEnd: 5,\n flex: 1,\n },\n ]}\n labelStyle={CommonStyles.cancelButtonLabel}\n mode={'outlined'}\n onPress={async () => {\n props.onSubmitET({\n paymentMode: paymentMode,\n transactionId: getUniqueTransactionID(props.amount.value),\n ...(await getBaseETResponse(\n EntityCode.INIT_PAYMENT,\n false,\n getEventCodeByET(\n ExecutionTaskID.INIT_PAYMENT,\n false,\n props.applicableReasons?.failure\n ),\n ''\n )),\n });\n }}\n >\n Cancel\n </Button>\n <Button\n disabled={disableNext}\n style={[\n CommonStyles.nextButton,\n {\n flex: 1,\n marginStart: 5,\n },\n ]}\n labelStyle={CommonStyles.nextButtonLabel}\n mode={'contained'}\n onPress={async () => {\n if (!isEmptyOrBlank(paymentMode)) {\n setDisableNext(true);\n props.onSubmitET({\n paymentMode: paymentMode,\n transactionId: getUniqueTransactionID(props.amount.value),\n ...(await getBaseETResponse(\n EntityCode.INIT_PAYMENT,\n true,\n getEventCodeByET(\n ExecutionTaskID.INIT_PAYMENT,\n true,\n props.applicableReasons?.success\n ),\n ''\n )),\n });\n } else showToast('No payment mode selected');\n }}\n >\n Collect\n </Button>\n </View>\n </View>\n </View>\n </Provider>\n );\n};\nexport default InitPaymentET;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAIA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,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iBAAA,CAAAqE,MAAM;IACLkD,QAAQ,EAAE9E,WAAY;IACtBR,KAAK,EAAE,CACLgC,0BAAY,CAACO,UAAU,EACvB;MACE6B,IAAI,EAAE,CAAC;MACPQ,WAAW,EAAE;IACf,CAAC,CACD;IACFvC,UAAU,EAAEL,0BAAY,CAACM,eAAgB;IACzCwC,IAAI,EAAE,WAAY;IAClB1D,OAAO,EAAE,MAAAA,CAAA,KAAY;MACnB,IAAI,CAAC,IAAAmE,qBAAc,EAAClF,WAAW,CAAC,EAAE;QAAA,IAAAmF,sBAAA;QAChC/E,cAAc,CAAC,IAAI,CAAC;QACpBL,KAAK,CAACsC,UAAU,CAAC;UACfrC,WAAW,EAAEA,WAAW;UACxB2E,aAAa,EAAE,IAAAC,oCAAsB,EAAC7E,KAAK,CAAC2D,MAAM,CAACN,KAAK,CAAC;UACzD,IAAI,MAAM,IAAAd,gCAAiB,EACzBC,oBAAU,CAACC,YAAY,EACvB,IAAI,EACJ,IAAAqC,oCAAgB,EACdC,yBAAe,CAACtC,YAAY,EAC5B,IAAI,GAAA2C,sBAAA,GACJpF,KAAK,CAACgF,iBAAiB,cAAAI,sBAAA,uBAAvBA,sBAAA,CAAyBC,OAAO,CACjC,EACD,EAAE,CACH;QACH,CAAC,CAAC;MACJ,CAAC,MAAM,IAAAC,kBAAS,EAAC,0BAA0B,CAAC;IAC9C;EAAE,GACH,SAED,CAAS,CACJ,CACF,CACF,CACE;AAEf,CAAC;AAAC,IAAAC,QAAA,GACaxF,aAAa;AAAAyF,OAAA,CAAAvH,OAAA,GAAAsH,QAAA"}
|
|
@@ -4,38 +4,88 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _reactNativePaper = require("react-native-paper");
|
|
13
|
-
|
|
14
9
|
var _ExecTaskUtils = require("../../../../utils/ExecTaskUtils");
|
|
15
|
-
|
|
16
10
|
var _EventCodeContainer = require("../../../../manager/dispatchCodes/EventCodeContainer");
|
|
17
|
-
|
|
18
11
|
var _ETConfig = require("../../../../models/execTasks/ETConfig");
|
|
19
|
-
|
|
20
12
|
var _PaymentStyles = require("../PaymentStyles");
|
|
21
|
-
|
|
22
13
|
var _utils = require("../../../../utils/utils");
|
|
23
|
-
|
|
24
14
|
var _CommonStyles = require("../../../../styles/executionTasks/CommonStyles");
|
|
25
|
-
|
|
26
15
|
var _PaymentUtils = require("../PaymentUtils");
|
|
27
|
-
|
|
16
|
+
var _reactNativePaper = require("react-native-paper");
|
|
17
|
+
var _MaterialIcons = _interopRequireDefault(require("react-native-vector-icons/MaterialIcons"));
|
|
18
|
+
var _constants = require("../../../../constants/constants");
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
-
|
|
30
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
|
-
|
|
32
22
|
const styles = _PaymentStyles.PaymentStyles;
|
|
33
|
-
|
|
34
23
|
const ProcessPaymentET = props => {
|
|
35
24
|
const [amountCollected, setAmountCollected] = (0, _react.useState)('');
|
|
36
25
|
const [inputError, setInputError] = (0, _react.useState)('');
|
|
37
26
|
const [disableNext, setDisableNext] = (0, _react.useState)(false);
|
|
38
|
-
|
|
27
|
+
const [showBackModal, setShowBackModal] = (0, _react.useState)(false);
|
|
28
|
+
(0, _react.useLayoutEffect)(() => {
|
|
29
|
+
props.navigation.setOptions({
|
|
30
|
+
title: props.title,
|
|
31
|
+
headerLeft: () => {
|
|
32
|
+
var _props$taskMeta;
|
|
33
|
+
return (_props$taskMeta = props.taskMeta) !== null && _props$taskMeta !== void 0 && _props$taskMeta.enableGoBack ? /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
34
|
+
onPress: async () => {
|
|
35
|
+
setShowBackModal(true);
|
|
36
|
+
},
|
|
37
|
+
name: "arrow-back",
|
|
38
|
+
color: 'black',
|
|
39
|
+
size: 25,
|
|
40
|
+
style: {
|
|
41
|
+
paddingRight: 15,
|
|
42
|
+
paddingTop: 5
|
|
43
|
+
}
|
|
44
|
+
}) : null;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}, [props.navigation, props.title]);
|
|
48
|
+
const renderModal = () => {
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativePaper.Portal, null, /*#__PURE__*/_react.default.createElement(_reactNativePaper.Modal, {
|
|
50
|
+
visible: showBackModal,
|
|
51
|
+
dismissable: true,
|
|
52
|
+
contentContainerStyle: _CommonStyles.CommonStyles.modalContent
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
54
|
+
style: _CommonStyles.CommonStyles.modalView
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
56
|
+
style: _CommonStyles.CommonStyles.subText
|
|
57
|
+
}, 'Are you sure you want to go back?'), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
|
|
58
|
+
labelStyle: _CommonStyles.CommonStyles.nextButtonLabel,
|
|
59
|
+
style: {
|
|
60
|
+
..._CommonStyles.CommonStyles.nextButton,
|
|
61
|
+
marginTop: 10
|
|
62
|
+
},
|
|
63
|
+
uppercase: false,
|
|
64
|
+
onPress: async () => {
|
|
65
|
+
props.onSubmitET({
|
|
66
|
+
paymentMode: props.paymentMode,
|
|
67
|
+
collectedAmount: {
|
|
68
|
+
value: +amountCollected,
|
|
69
|
+
currencyCode: props.amount.currencyCode,
|
|
70
|
+
minorUnit: props.amount.minorUnit
|
|
71
|
+
},
|
|
72
|
+
transactionId: props.transactionId,
|
|
73
|
+
tenantTransactionId: props.transactionId,
|
|
74
|
+
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.PROCESS_PAYMENT, false, _constants.GO_BACK_EVENT_CODE, ''))
|
|
75
|
+
});
|
|
76
|
+
setShowBackModal(false);
|
|
77
|
+
}
|
|
78
|
+
}, "Yes"), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
|
|
79
|
+
labelStyle: _CommonStyles.CommonStyles.cancelButtonLabel,
|
|
80
|
+
style: {
|
|
81
|
+
..._CommonStyles.CommonStyles.cancelButton,
|
|
82
|
+
marginTop: 10
|
|
83
|
+
},
|
|
84
|
+
uppercase: false,
|
|
85
|
+
onPress: () => setShowBackModal(false)
|
|
86
|
+
}, "No"))));
|
|
87
|
+
};
|
|
88
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativePaper.Provider, null, renderModal(), /*#__PURE__*/_react.default.createElement(_reactNative.KeyboardAvoidingView, {
|
|
39
89
|
style: _CommonStyles.CommonStyles.mainContainer
|
|
40
90
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView, {
|
|
41
91
|
style: _CommonStyles.CommonStyles.mainContainer
|
|
@@ -93,6 +143,7 @@ const ProcessPaymentET = props => {
|
|
|
93
143
|
labelStyle: _CommonStyles.CommonStyles.cancelButtonLabel,
|
|
94
144
|
mode: 'outlined',
|
|
95
145
|
onPress: async () => {
|
|
146
|
+
var _props$applicableReas;
|
|
96
147
|
props.onSubmitET({
|
|
97
148
|
paymentMode: props.paymentMode,
|
|
98
149
|
collectedAmount: {
|
|
@@ -102,7 +153,7 @@ const ProcessPaymentET = props => {
|
|
|
102
153
|
},
|
|
103
154
|
transactionId: props.transactionId,
|
|
104
155
|
tenantTransactionId: props.transactionId,
|
|
105
|
-
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.PROCESS_PAYMENT, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.PROCESS_PAYMENT, false), ''))
|
|
156
|
+
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.PROCESS_PAYMENT, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.PROCESS_PAYMENT, false, (_props$applicableReas = props.applicableReasons) === null || _props$applicableReas === void 0 ? void 0 : _props$applicableReas.failure), ''))
|
|
106
157
|
});
|
|
107
158
|
}
|
|
108
159
|
}, "Cancel"), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
|
|
@@ -115,13 +166,12 @@ const ProcessPaymentET = props => {
|
|
|
115
166
|
mode: 'contained',
|
|
116
167
|
onPress: async () => {
|
|
117
168
|
if (!(0, _utils.isEmptyOrBlank)(amountCollected) && !Number.isNaN(+amountCollected)) {
|
|
169
|
+
var _props$applicableReas2;
|
|
118
170
|
const calculatedValue = (0, _PaymentUtils.getPaymentValue)(props.amount.value, props.amount.minorUnit);
|
|
119
|
-
|
|
120
171
|
if (+amountCollected !== calculatedValue) {
|
|
121
172
|
setInputError(`Amount should be equal to ${calculatedValue}`);
|
|
122
173
|
return;
|
|
123
174
|
}
|
|
124
|
-
|
|
125
175
|
setDisableNext(true);
|
|
126
176
|
props.onSubmitET({
|
|
127
177
|
paymentMode: props.paymentMode,
|
|
@@ -132,15 +182,14 @@ const ProcessPaymentET = props => {
|
|
|
132
182
|
},
|
|
133
183
|
transactionId: props.transactionId,
|
|
134
184
|
tenantTransactionId: props.transactionId,
|
|
135
|
-
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.PROCESS_PAYMENT, true, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.PROCESS_PAYMENT, true), ''))
|
|
185
|
+
...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.PROCESS_PAYMENT, true, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.PROCESS_PAYMENT, true, (_props$applicableReas2 = props.applicableReasons) === null || _props$applicableReas2 === void 0 ? void 0 : _props$applicableReas2.success), ''))
|
|
136
186
|
});
|
|
137
187
|
} else {
|
|
138
188
|
setInputError('Please enter valid amount.');
|
|
139
189
|
}
|
|
140
190
|
}
|
|
141
|
-
}, "Next"))));
|
|
191
|
+
}, "Next")))));
|
|
142
192
|
};
|
|
143
|
-
|
|
144
193
|
var _default = ProcessPaymentET;
|
|
145
194
|
exports.default = _default;
|
|
146
195
|
//# sourceMappingURL=ProcessPaymentET.js.map
|