@os1-platform/dispatch-mobile 2.1.2 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (628) hide show
  1. package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
  2. package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
  3. package/android/.gradle/6.8/gc.properties +0 -0
  4. package/android/.gradle/checksums/checksums.lock +0 -0
  5. package/android/.gradle/configuration-cache/gc.properties +0 -0
  6. package/android/.gradle/vcs-1/gc.properties +0 -0
  7. package/android/.idea/gradle.xml +13 -0
  8. package/android/.idea/misc.xml +10 -0
  9. package/android/.idea/vcs.xml +6 -0
  10. package/dispatch-mobile.podspec +35 -0
  11. package/ios/DispatchSdk-Bridging-Header.h +3 -0
  12. package/ios/DispatchSdk.m +9 -0
  13. package/ios/DispatchSdk.swift +8 -0
  14. package/ios/DispatchSdk.xcodeproj/project.pbxproj +317 -0
  15. package/ios/EventEmitter.swift +21 -0
  16. package/ios/EventsConstant.swift +13 -0
  17. package/ios/RNEventEmitter.m +15 -0
  18. package/ios/RNEventEmitter.swift +24 -0
  19. package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +3 -4
  20. package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
  21. package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +13 -8
  22. package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
  23. package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +3 -4
  24. package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
  25. package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +3 -4
  26. package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
  27. package/lib/commonjs/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
  28. package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +112 -27
  29. package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
  30. package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +7 -8
  31. package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
  32. package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +113 -48
  33. package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
  34. package/lib/commonjs/components/executiontasks/doodle/SignatureSchema.js.map +1 -1
  35. package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +3 -4
  36. package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
  37. package/lib/commonjs/components/executiontasks/dropCash/DropCashSchema.js.map +1 -1
  38. package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +7 -8
  39. package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
  40. package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +23 -24
  41. package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
  42. package/lib/commonjs/components/executiontasks/forms/FormSchema.js.map +1 -1
  43. package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +4 -5
  44. package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
  45. package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +3 -4
  46. package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -1
  47. package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +3 -4
  48. package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
  49. package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +3 -4
  50. package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
  51. package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +3 -4
  52. package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
  53. package/lib/commonjs/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
  54. package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +138 -25
  55. package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
  56. package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +228 -132
  57. package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
  58. package/lib/commonjs/components/executiontasks/imageCapture/camera.svg +3 -0
  59. package/lib/commonjs/components/executiontasks/imageCapture/circle-xmark.svg +5 -0
  60. package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js +6 -7
  61. package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js.map +1 -1
  62. package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +6 -7
  63. package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
  64. package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentSchema.js.map +1 -1
  65. package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +4 -5
  66. package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
  67. package/lib/commonjs/components/executiontasks/payments/init/InitPaymentSchema.js.map +1 -1
  68. package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +4 -5
  69. package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
  70. package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentSchema.js.map +1 -1
  71. package/lib/commonjs/components/executiontasks/pickup/PickpSchema.js.map +1 -1
  72. package/lib/commonjs/components/executiontasks/pickup/PickupET.js +3 -4
  73. package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
  74. package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +89 -17
  75. package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
  76. package/lib/commonjs/components/executiontasks/scan/ScanET.js +14 -15
  77. package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -1
  78. package/lib/commonjs/components/executiontasks/scan/ScanSchema.js +1 -2
  79. package/lib/commonjs/components/executiontasks/scan/ScanSchema.js.map +1 -1
  80. package/lib/commonjs/components/executiontasks/scan/constants.js +6 -12
  81. package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -1
  82. package/lib/commonjs/components/executiontasks/scan/interfaces.js +4 -8
  83. package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -1
  84. package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +4 -5
  85. package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
  86. package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +5 -6
  87. package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
  88. package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +8 -9
  89. package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
  90. package/lib/commonjs/components/executiontasks/scan/utils.js +2 -2
  91. package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -1
  92. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +8 -9
  93. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
  94. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js +1 -2
  95. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -1
  96. package/lib/commonjs/components/executiontasks/validateOTP/constants.js +6 -12
  97. package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -1
  98. package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +5 -6
  99. package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
  100. package/lib/commonjs/components/executiontasks/validateOTP/utils.js +2 -2
  101. package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -1
  102. package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +2 -2
  103. package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
  104. package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +3 -4
  105. package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
  106. package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +3 -4
  107. package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
  108. package/lib/commonjs/components/widgets/AlertDisplay.js +14 -9
  109. package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
  110. package/lib/commonjs/components/widgets/CancelOrderDialog.js +5 -6
  111. package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
  112. package/lib/commonjs/components/widgets/Card.js +2 -3
  113. package/lib/commonjs/components/widgets/Card.js.map +1 -1
  114. package/lib/commonjs/components/widgets/GoBackModal.js +1 -2
  115. package/lib/commonjs/components/widgets/GoBackModal.js.map +1 -1
  116. package/lib/commonjs/components/widgets/IconButton.js +1 -2
  117. package/lib/commonjs/components/widgets/IconButton.js.map +1 -1
  118. package/lib/commonjs/components/widgets/ModalWidget.js +3 -4
  119. package/lib/commonjs/components/widgets/ModalWidget.js.map +1 -1
  120. package/lib/commonjs/components/widgets/ProgressDialog.js +2 -3
  121. package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
  122. package/lib/commonjs/components/widgets/SearchBar.js +1 -2
  123. package/lib/commonjs/components/widgets/SearchBar.js.map +1 -1
  124. package/lib/commonjs/components/widgets/SnackBarCustom.js +3 -5
  125. package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
  126. package/lib/commonjs/components/widgets/SplitTextInput.js +3 -4
  127. package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -1
  128. package/lib/commonjs/components/widgets/TabsComponent.js +3 -4
  129. package/lib/commonjs/components/widgets/TabsComponent.js.map +1 -1
  130. package/lib/commonjs/config/DispatchSDKConfig.js +1 -2
  131. package/lib/commonjs/config/DispatchSDKConfig.js.map +1 -1
  132. package/lib/commonjs/constants/apiConstants.js +2 -4
  133. package/lib/commonjs/constants/apiConstants.js.map +1 -1
  134. package/lib/commonjs/constants/constants.js +11 -22
  135. package/lib/commonjs/constants/constants.js.map +1 -1
  136. package/lib/commonjs/constants/statuscode.js +1 -2
  137. package/lib/commonjs/constants/statuscode.js.map +1 -1
  138. package/lib/commonjs/errors/ErrorCodes.js +7 -14
  139. package/lib/commonjs/errors/ErrorCodes.js.map +1 -1
  140. package/lib/commonjs/events/EventDispatcher.js +5 -3
  141. package/lib/commonjs/events/EventDispatcher.js.map +1 -1
  142. package/lib/commonjs/events/EventListener.js +1 -2
  143. package/lib/commonjs/events/EventListener.js.map +1 -1
  144. package/lib/commonjs/events/constants.js +1 -2
  145. package/lib/commonjs/events/constants.js.map +1 -1
  146. package/lib/commonjs/events/index.js +1 -2
  147. package/lib/commonjs/events/index.js.map +1 -1
  148. package/lib/commonjs/icons/ScanIcon.js +1 -2
  149. package/lib/commonjs/icons/ScanIcon.js.map +1 -1
  150. package/lib/commonjs/icons/circleMark.svg +3 -0
  151. package/lib/commonjs/icons/file.js +1 -2
  152. package/lib/commonjs/icons/file.js.map +1 -1
  153. package/lib/commonjs/index.js +15 -2
  154. package/lib/commonjs/index.js.map +1 -1
  155. package/lib/commonjs/locale/Str.js +21 -0
  156. package/lib/commonjs/locale/Str.js.map +1 -0
  157. package/lib/commonjs/locale/en.json +7 -0
  158. package/lib/commonjs/locale/i18n.js +32 -0
  159. package/lib/commonjs/locale/i18n.js.map +1 -0
  160. package/lib/commonjs/locale/util.js +27 -0
  161. package/lib/commonjs/locale/util.js.map +1 -0
  162. package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +5 -3
  163. package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
  164. package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +2 -0
  165. package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
  166. package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +4 -2
  167. package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
  168. package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +4 -2
  169. package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  170. package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +4 -2
  171. package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
  172. package/lib/commonjs/manager/location/LocationManager.js +7 -4
  173. package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
  174. package/lib/commonjs/manager/sdk/DispatchSDKManager.js +4 -2
  175. package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
  176. package/lib/commonjs/manager/sdk/DispatchSdkCache.js +2 -0
  177. package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
  178. package/lib/commonjs/manager/sdk/callbacksHandler.js +1 -2
  179. package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -1
  180. package/lib/commonjs/manager/syncmanager/AppSyncManager.js +4 -2
  181. package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
  182. package/lib/commonjs/manager/syncmanager/DBConfig.js +15 -26
  183. package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
  184. package/lib/commonjs/manager/syncmanager/NativeSyncManager.js +1 -2
  185. package/lib/commonjs/manager/syncmanager/NativeSyncManager.js.map +1 -1
  186. package/lib/commonjs/manager/syncmanager/constants.js +5 -10
  187. package/lib/commonjs/manager/syncmanager/constants.js.map +1 -1
  188. package/lib/commonjs/manager/syncmanager/database.js +2 -2
  189. package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
  190. package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +5 -4
  191. package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
  192. package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +4 -2
  193. package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
  194. package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +4 -2
  195. package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
  196. package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +15 -3
  197. package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  198. package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +4 -2
  199. package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  200. package/lib/commonjs/models/DispatchModels.js +1 -2
  201. package/lib/commonjs/models/DispatchModels.js.map +1 -1
  202. package/lib/commonjs/models/execTasks/ETConfig.js +6 -12
  203. package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
  204. package/lib/commonjs/models/fcm.js.map +1 -1
  205. package/lib/commonjs/models/sdk.js +1 -2
  206. package/lib/commonjs/models/sdk.js.map +1 -1
  207. package/lib/commonjs/native/signature/SignatureCapture.js +1 -2
  208. package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
  209. package/lib/commonjs/network/GraphQLClient.js +48 -4
  210. package/lib/commonjs/network/GraphQLClient.js.map +1 -1
  211. package/lib/commonjs/network/Queries.js +5 -10
  212. package/lib/commonjs/network/Queries.js.map +1 -1
  213. package/lib/commonjs/res/strings.js +1 -2
  214. package/lib/commonjs/res/strings.js.map +1 -1
  215. package/lib/commonjs/resources/Login.js +1 -2
  216. package/lib/commonjs/resources/Login.js.map +1 -1
  217. package/lib/commonjs/resources/network.js +1 -2
  218. package/lib/commonjs/resources/network.js.map +1 -1
  219. package/lib/commonjs/styles/SdkColors.js +2 -4
  220. package/lib/commonjs/styles/SdkColors.js.map +1 -1
  221. package/lib/commonjs/styles/executionTasks/CommonStyles.js +8 -11
  222. package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
  223. package/lib/commonjs/ui/screens/CancellationScreen.js +3 -4
  224. package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
  225. package/lib/commonjs/ui/screens/CaptureInputScreen.js +5 -5
  226. package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
  227. package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +3 -4
  228. package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
  229. package/lib/commonjs/ui/screens/DeliverScreen.js +36 -10
  230. package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
  231. package/lib/commonjs/ui/screens/DisplayScreen.js +3 -4
  232. package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
  233. package/lib/commonjs/ui/screens/DoodleScreen.js +27 -6
  234. package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
  235. package/lib/commonjs/ui/screens/DropCashScreen.js +29 -10
  236. package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
  237. package/lib/commonjs/ui/screens/FormsScreen.js +25 -5
  238. package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
  239. package/lib/commonjs/ui/screens/GeofenceScreen.js +3 -4
  240. package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
  241. package/lib/commonjs/ui/screens/HttpRequestScreen.js +1 -2
  242. package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
  243. package/lib/commonjs/ui/screens/ImageCaptureScreen.js +27 -9
  244. package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
  245. package/lib/commonjs/ui/screens/PaymentScreen.js +31 -10
  246. package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
  247. package/lib/commonjs/ui/screens/PickupScreen.js +38 -10
  248. package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
  249. package/lib/commonjs/ui/screens/ScanScreen.js +3 -4
  250. package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -1
  251. package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +8 -7
  252. package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
  253. package/lib/commonjs/ui/screens/ValidateOTPScreen.js +3 -4
  254. package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -1
  255. package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +4 -4
  256. package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
  257. package/lib/commonjs/ui/uiConfig/RouteParams.js +1 -2
  258. package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
  259. package/lib/commonjs/utils/ApiUtils.js +2 -4
  260. package/lib/commonjs/utils/ApiUtils.js.map +1 -1
  261. package/lib/commonjs/utils/Logger.js +10 -9
  262. package/lib/commonjs/utils/Logger.js.map +1 -1
  263. package/lib/commonjs/utils/NetworkUtil.js +1 -2
  264. package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
  265. package/lib/commonjs/utils/SdkUtils.js +12 -8
  266. package/lib/commonjs/utils/SdkUtils.js.map +1 -1
  267. package/lib/commonjs/utils/SyncManagerUtils.js +2 -2
  268. package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
  269. package/lib/commonjs/utils/fcm/FCM.js +3 -4
  270. package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
  271. package/lib/commonjs/utils/fcm/FcmUtils.js +14 -2
  272. package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
  273. package/lib/commonjs/utils/helper.js +46 -4
  274. package/lib/commonjs/utils/helper.js.map +1 -1
  275. package/lib/commonjs/utils/hooks/useModal.js +3 -4
  276. package/lib/commonjs/utils/hooks/useModal.js.map +1 -1
  277. package/lib/commonjs/utils/hooks/useTimer.js +1 -2
  278. package/lib/commonjs/utils/hooks/useTimer.js.map +1 -1
  279. package/lib/commonjs/utils/loginHelper.js +1 -2
  280. package/lib/commonjs/utils/loginHelper.js.map +1 -1
  281. package/lib/commonjs/utils/storage.js +71 -13
  282. package/lib/commonjs/utils/storage.js.map +1 -1
  283. package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
  284. package/lib/module/components/executiontasks/cancellation/CancelET.js +11 -5
  285. package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
  286. package/lib/module/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
  287. package/lib/module/components/executiontasks/deliver/SLDeliverET.js +112 -25
  288. package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
  289. package/lib/module/components/executiontasks/display/DisplayModalET.js +5 -5
  290. package/lib/module/components/executiontasks/display/DisplayModalET.js.map +1 -1
  291. package/lib/module/components/executiontasks/doodle/SignatureET.js +111 -45
  292. package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
  293. package/lib/module/components/executiontasks/doodle/SignatureSchema.js.map +1 -1
  294. package/lib/module/components/executiontasks/dropCash/DropCashSchema.js.map +1 -1
  295. package/lib/module/components/executiontasks/dropCash/SLDropCash.js +5 -5
  296. package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
  297. package/lib/module/components/executiontasks/forms/FormGenerator.js +21 -21
  298. package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
  299. package/lib/module/components/executiontasks/forms/FormSchema.js.map +1 -1
  300. package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +1 -1
  301. package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
  302. package/lib/module/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
  303. package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js +133 -21
  304. package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
  305. package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +226 -130
  306. package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
  307. package/lib/module/components/executiontasks/imageCapture/camera.svg +3 -0
  308. package/lib/module/components/executiontasks/imageCapture/circle-xmark.svg +5 -0
  309. package/lib/module/components/executiontasks/payments/PaymentStyles.js +6 -6
  310. package/lib/module/components/executiontasks/payments/PaymentStyles.js.map +1 -1
  311. package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js +4 -4
  312. package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
  313. package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentSchema.js.map +1 -1
  314. package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +1 -1
  315. package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
  316. package/lib/module/components/executiontasks/payments/init/InitPaymentSchema.js.map +1 -1
  317. package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +1 -1
  318. package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
  319. package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentSchema.js.map +1 -1
  320. package/lib/module/components/executiontasks/pickup/PickpSchema.js.map +1 -1
  321. package/lib/module/components/executiontasks/pickup/SLPickupET.js +89 -16
  322. package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
  323. package/lib/module/components/executiontasks/scan/ScanET.js +12 -12
  324. package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
  325. package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +2 -2
  326. package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
  327. package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +3 -3
  328. package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
  329. package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +6 -6
  330. package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
  331. package/lib/module/components/executiontasks/scan/utils.js.map +1 -1
  332. package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js +6 -6
  333. package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
  334. package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js +3 -3
  335. package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
  336. package/lib/module/components/widgets/AlertDisplay.js +12 -7
  337. package/lib/module/components/widgets/AlertDisplay.js.map +1 -1
  338. package/lib/module/components/widgets/CancelOrderDialog.js +3 -3
  339. package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
  340. package/lib/module/components/widgets/Card.js +1 -1
  341. package/lib/module/components/widgets/Card.js.map +1 -1
  342. package/lib/module/components/widgets/ModalWidget.js +3 -3
  343. package/lib/module/components/widgets/ModalWidget.js.map +1 -1
  344. package/lib/module/components/widgets/ProgressDialog.js +2 -2
  345. package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
  346. package/lib/module/components/widgets/SnackBarCustom.js +2 -2
  347. package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
  348. package/lib/module/constants/constants.js +1 -1
  349. package/lib/module/constants/constants.js.map +1 -1
  350. package/lib/module/events/EventDispatcher.js +5 -2
  351. package/lib/module/events/EventDispatcher.js.map +1 -1
  352. package/lib/module/icons/circleMark.svg +3 -0
  353. package/lib/module/index.js +4 -2
  354. package/lib/module/index.js.map +1 -1
  355. package/lib/module/locale/Str.js +15 -0
  356. package/lib/module/locale/Str.js.map +1 -0
  357. package/lib/module/locale/en.json +7 -0
  358. package/lib/module/locale/i18n.js +25 -0
  359. package/lib/module/locale/i18n.js.map +1 -0
  360. package/lib/module/locale/util.js +18 -0
  361. package/lib/module/locale/util.js.map +1 -0
  362. package/lib/module/manager/dispatch/DispatchStateContainer.js +3 -1
  363. package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
  364. package/lib/module/manager/dispatchCodes/EventCodeContainer.js +2 -0
  365. package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
  366. package/lib/module/manager/dispatchCodes/EventCodeRepo.js +2 -0
  367. package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
  368. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +2 -0
  369. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  370. package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +2 -0
  371. package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
  372. package/lib/module/manager/location/LocationManager.js +2 -0
  373. package/lib/module/manager/location/LocationManager.js.map +1 -1
  374. package/lib/module/manager/sdk/DispatchSDKManager.js +2 -0
  375. package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
  376. package/lib/module/manager/sdk/DispatchSdkCache.js +2 -0
  377. package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
  378. package/lib/module/manager/syncmanager/AppSyncManager.js +2 -0
  379. package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
  380. package/lib/module/manager/syncmanager/DBConfig.js +1 -0
  381. package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
  382. package/lib/module/manager/syncmanager/document/DocumentManager.js +2 -0
  383. package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
  384. package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +2 -0
  385. package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
  386. package/lib/module/manager/syncmanager/events/ETEventsManager.js +13 -1
  387. package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  388. package/lib/module/manager/syncmanager/events/EventsSyncManager.js +2 -0
  389. package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  390. package/lib/module/models/fcm.js.map +1 -1
  391. package/lib/module/network/GraphQLClient.js +48 -3
  392. package/lib/module/network/GraphQLClient.js.map +1 -1
  393. package/lib/module/styles/executionTasks/CommonStyles.js +2 -1
  394. package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
  395. package/lib/module/ui/screens/CaptureInputScreen.js +2 -1
  396. package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
  397. package/lib/module/ui/screens/DeliverScreen.js +33 -6
  398. package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
  399. package/lib/module/ui/screens/DoodleScreen.js +24 -2
  400. package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
  401. package/lib/module/ui/screens/DropCashScreen.js +26 -6
  402. package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
  403. package/lib/module/ui/screens/FormsScreen.js +22 -1
  404. package/lib/module/ui/screens/FormsScreen.js.map +1 -1
  405. package/lib/module/ui/screens/ImageCaptureScreen.js +24 -5
  406. package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
  407. package/lib/module/ui/screens/PaymentScreen.js +28 -6
  408. package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
  409. package/lib/module/ui/screens/PickupScreen.js +35 -6
  410. package/lib/module/ui/screens/PickupScreen.js.map +1 -1
  411. package/lib/module/ui/screens/StartWorkFlowScreen.js +6 -4
  412. package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
  413. package/lib/module/ui/screens/WithBaseDispatchScreen.js +1 -0
  414. package/lib/module/ui/screens/WithBaseDispatchScreen.js.map +1 -1
  415. package/lib/module/utils/Logger.js +2 -0
  416. package/lib/module/utils/Logger.js.map +1 -1
  417. package/lib/module/utils/SdkUtils.js +11 -7
  418. package/lib/module/utils/SdkUtils.js.map +1 -1
  419. package/lib/module/utils/fcm/FcmUtils.js +11 -0
  420. package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
  421. package/lib/module/utils/helper.js +46 -4
  422. package/lib/module/utils/helper.js.map +1 -1
  423. package/lib/module/utils/storage.js +69 -10
  424. package/lib/module/utils/storage.js.map +1 -1
  425. package/lib/typescript/components/executiontasks/deliver/DeliverETInput.d.ts +5 -0
  426. package/lib/typescript/components/executiontasks/doodle/SignatureSchema.d.ts +1 -0
  427. package/lib/typescript/components/executiontasks/dropCash/DropCashSchema.d.ts +1 -0
  428. package/lib/typescript/components/executiontasks/forms/FormSchema.d.ts +1 -0
  429. package/lib/typescript/components/executiontasks/imageCapture/CaptureSchema.d.ts +1 -0
  430. package/lib/typescript/components/executiontasks/imageCapture/CaptureUtils.d.ts +6 -1
  431. package/lib/typescript/components/executiontasks/imageCapture/ImageCapture.d.ts +1 -2
  432. package/lib/typescript/components/executiontasks/payments/PaymentStyles.d.ts +4 -5
  433. package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +1 -0
  434. package/lib/typescript/components/executiontasks/payments/init/InitPaymentSchema.d.ts +1 -0
  435. package/lib/typescript/components/executiontasks/payments/processPayment/ProcessPaymentSchema.d.ts +1 -0
  436. package/lib/typescript/components/executiontasks/pickup/PickpSchema.d.ts +2 -0
  437. package/lib/typescript/components/widgets/SnackBarCustom.d.ts +1 -1
  438. package/lib/typescript/constants/constants.d.ts +1 -1
  439. package/lib/typescript/index.d.ts +4 -2
  440. package/lib/typescript/locale/Str.d.ts +13 -0
  441. package/lib/typescript/locale/i18n.d.ts +3 -0
  442. package/lib/typescript/locale/util.d.ts +2 -0
  443. package/lib/typescript/manager/syncmanager/DBConfig.d.ts +2 -1
  444. package/lib/typescript/models/fcm.d.ts +3 -0
  445. package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +1 -0
  446. package/lib/typescript/utils/fcm/FcmUtils.d.ts +2 -1
  447. package/lib/typescript/utils/helper.d.ts +4 -3
  448. package/lib/typescript/utils/storage.d.ts +3 -2
  449. package/package.json +22 -7
  450. package/src/@types/assets/index.d.ts +6 -0
  451. package/src/components/dispatch/DispatchExecNavigator.tsx +273 -0
  452. package/src/components/executiontasks/CompletedWFSchema.ts +24 -0
  453. package/src/components/executiontasks/ExecutionTasksIndex.ts +137 -0
  454. package/src/components/executiontasks/cancellation/CancelET.tsx +281 -0
  455. package/src/components/executiontasks/cancellation/CancellationSchema.ts +30 -0
  456. package/src/components/executiontasks/captureInput/CaptureInputSchema.ts +52 -0
  457. package/src/components/executiontasks/captureInput/CaptureText.tsx +172 -0
  458. package/src/components/executiontasks/captureInput/utils.ts +9 -0
  459. package/src/components/executiontasks/deliver/DeliverET.tsx +124 -0
  460. package/src/components/executiontasks/deliver/DeliverETInput.ts +52 -0
  461. package/src/components/executiontasks/deliver/SLDeliverET.tsx +522 -0
  462. package/src/components/executiontasks/display/DisplayModalET.tsx +174 -0
  463. package/src/components/executiontasks/display/DisplaySchema.ts +29 -0
  464. package/src/components/executiontasks/doodle/SignatureET.tsx +325 -0
  465. package/src/components/executiontasks/doodle/SignatureSchema.ts +52 -0
  466. package/src/components/executiontasks/dropCash/DropCashET.tsx +145 -0
  467. package/src/components/executiontasks/dropCash/DropCashSchema.ts +23 -0
  468. package/src/components/executiontasks/dropCash/SLDropCash.tsx +286 -0
  469. package/src/components/executiontasks/forms/FormGenerator.tsx +277 -0
  470. package/src/components/executiontasks/forms/FormSchema.ts +30 -0
  471. package/src/components/executiontasks/forms/widgets/DateTimeWidget.tsx +144 -0
  472. package/src/components/executiontasks/forms/widgets/DropdownWidget.tsx +52 -0
  473. package/src/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.tsx +158 -0
  474. package/src/components/executiontasks/forms/widgets/TimeRangeSelector.tsx +38 -0
  475. package/src/components/executiontasks/httpRequest/HttpEtUtils.ts +49 -0
  476. package/src/components/executiontasks/httpRequest/HttpRequestET.tsx +59 -0
  477. package/src/components/executiontasks/httpRequest/HttpRequestETSchema.ts +42 -0
  478. package/src/components/executiontasks/imageCapture/CaptureSchema.ts +94 -0
  479. package/src/components/executiontasks/imageCapture/CaptureUtils.ts +321 -0
  480. package/src/components/executiontasks/imageCapture/ImageCapture.tsx +457 -0
  481. package/src/components/executiontasks/imageCapture/camera.svg +3 -0
  482. package/src/components/executiontasks/imageCapture/circle-xmark.svg +5 -0
  483. package/src/components/executiontasks/payments/PaymentStyles.ts +93 -0
  484. package/src/components/executiontasks/payments/PaymentUtils.ts +7 -0
  485. package/src/components/executiontasks/payments/completePayment/CompletePaymentET.tsx +238 -0
  486. package/src/components/executiontasks/payments/completePayment/CompletePaymentSchema.ts +24 -0
  487. package/src/components/executiontasks/payments/init/InitPaymentET.tsx +246 -0
  488. package/src/components/executiontasks/payments/init/InitPaymentSchema.ts +38 -0
  489. package/src/components/executiontasks/payments/processPayment/ProcessPaymentET.tsx +273 -0
  490. package/src/components/executiontasks/payments/processPayment/ProcessPaymentSchema.ts +39 -0
  491. package/src/components/executiontasks/pickup/PickpSchema.ts +30 -0
  492. package/src/components/executiontasks/pickup/PickupET.tsx +126 -0
  493. package/src/components/executiontasks/pickup/SLPickupET.tsx +372 -0
  494. package/src/components/executiontasks/scan/ScanET.tsx +1059 -0
  495. package/src/components/executiontasks/scan/ScanSchema.ts +121 -0
  496. package/src/components/executiontasks/scan/constants.ts +6 -0
  497. package/src/components/executiontasks/scan/interfaces.ts +109 -0
  498. package/src/components/executiontasks/scan/modalConstant.ts +120 -0
  499. package/src/components/executiontasks/scan/sub_components/CScanner.tsx +107 -0
  500. package/src/components/executiontasks/scan/sub_components/DropDownUtils.ts +119 -0
  501. package/src/components/executiontasks/scan/sub_components/ERDropDown.tsx +134 -0
  502. package/src/components/executiontasks/scan/sub_components/SummaryPage.tsx +1296 -0
  503. package/src/components/executiontasks/scan/utils.ts +1108 -0
  504. package/src/components/executiontasks/validateOTP/ValidateOTPET.tsx +436 -0
  505. package/src/components/executiontasks/validateOTP/ValidateOTPSchema.ts +68 -0
  506. package/src/components/executiontasks/validateOTP/constants.ts +24 -0
  507. package/src/components/executiontasks/validateOTP/sub-components/OTPInput.tsx +83 -0
  508. package/src/components/executiontasks/validateOTP/utils.ts +180 -0
  509. package/src/components/executiontasks/verifyInput/VerifyInputSchema.ts +49 -0
  510. package/src/components/executiontasks/verifyLocation/GeofenceUtils.ts +55 -0
  511. package/src/components/executiontasks/verifyLocation/VerifyLocSchema.ts +56 -0
  512. package/src/components/executiontasks/verifyLocation/VerifyLocationET.tsx +69 -0
  513. package/src/components/executiontasks/verifyOtp/VerifyOtpET.tsx +96 -0
  514. package/src/components/executiontasks/verifyOtp/VerifyOtpSchema.ts +27 -0
  515. package/src/components/utils/index.ts +18 -0
  516. package/src/components/widgets/AlertDisplay.tsx +38 -0
  517. package/src/components/widgets/CancelOrderDialog.tsx +112 -0
  518. package/src/components/widgets/Card.tsx +99 -0
  519. package/src/components/widgets/GoBackModal.tsx +49 -0
  520. package/src/components/widgets/IconButton.tsx +32 -0
  521. package/src/components/widgets/ModalWidget.tsx +157 -0
  522. package/src/components/widgets/ProgressDialog.tsx +54 -0
  523. package/src/components/widgets/SearchBar.tsx +71 -0
  524. package/src/components/widgets/SnackBarCustom.tsx +212 -0
  525. package/src/components/widgets/SplitTextInput.tsx +116 -0
  526. package/src/components/widgets/TabsComponent.tsx +84 -0
  527. package/src/components/widgets/Toaster.ts +8 -0
  528. package/src/config/DispatchSDKConfig.ts +4 -0
  529. package/src/constants/apiConstants.ts +11 -0
  530. package/src/constants/constants.ts +12 -0
  531. package/src/constants/statuscode.ts +8 -0
  532. package/src/errors/BaseError.ts +16 -0
  533. package/src/errors/ErrorCodes.ts +38 -0
  534. package/src/events/EventDispatcher.ts +22 -0
  535. package/src/events/EventListener.ts +14 -0
  536. package/src/events/constants.ts +7 -0
  537. package/src/events/index.ts +3 -0
  538. package/src/events/interface.ts +1 -0
  539. package/src/icons/ScanIcon.tsx +24 -0
  540. package/src/icons/circleMark.svg +3 -0
  541. package/src/icons/file.tsx +24 -0
  542. package/src/icons/interface.ts +5 -0
  543. package/src/index.tsx +82 -0
  544. package/src/locale/Str.ts +15 -0
  545. package/src/locale/en.json +7 -0
  546. package/src/locale/i18n.ts +26 -0
  547. package/src/locale/util.ts +20 -0
  548. package/src/manager/dispatch/DispatchStateContainer.tsx +842 -0
  549. package/src/manager/dispatchCodes/EventCodeContainer.ts +75 -0
  550. package/src/manager/dispatchCodes/EventCodeRepo.ts +82 -0
  551. package/src/manager/dispatchCodes/ReasonCodeContainer.ts +121 -0
  552. package/src/manager/dispatchCodes/ReasonCodeRepo.ts +90 -0
  553. package/src/manager/dispatchCodes/reasonCodes.json +137 -0
  554. package/src/manager/jobRemoval/JobRemovalManager.ts +21 -0
  555. package/src/manager/location/LocationManager.ts +77 -0
  556. package/src/manager/sdk/DispatchSDKManager.ts +99 -0
  557. package/src/manager/sdk/DispatchSdkCache.ts +47 -0
  558. package/src/manager/sdk/callbacksHandler.ts +25 -0
  559. package/src/manager/syncmanager/AppSyncManager.ts +187 -0
  560. package/src/manager/syncmanager/DBConfig.ts +181 -0
  561. package/src/manager/syncmanager/NativeSyncManager.ts +14 -0
  562. package/src/manager/syncmanager/constants.ts +5 -0
  563. package/src/manager/syncmanager/database.ts +93 -0
  564. package/src/manager/syncmanager/document/DocumentHttpClient.ts +111 -0
  565. package/src/manager/syncmanager/document/DocumentManager.ts +143 -0
  566. package/src/manager/syncmanager/document/DocumentSyncManager.ts +233 -0
  567. package/src/manager/syncmanager/document/models.ts +4 -0
  568. package/src/manager/syncmanager/events/ETEventsManager.ts +647 -0
  569. package/src/manager/syncmanager/events/EventsGraphQLClient.ts +0 -0
  570. package/src/manager/syncmanager/events/EventsSyncManager.ts +490 -0
  571. package/src/manager/syncmanager/events/SyncHttpClient.ts +202 -0
  572. package/src/models/DispatchModels.ts +97 -0
  573. package/src/models/ReasonCodes.ts +12 -0
  574. package/src/models/auth.ts +43 -0
  575. package/src/models/execTasks/ETBaseModels.ts +113 -0
  576. package/src/models/execTasks/ETConfig.ts +94 -0
  577. package/src/models/execution.ts +9 -0
  578. package/src/models/fcm.ts +6 -0
  579. package/src/models/sdk.ts +35 -0
  580. package/src/native/signature/SignatureCapture.tsx +110 -0
  581. package/src/network/GraphQLClient.ts +147 -0
  582. package/src/network/NetworkClient.ts +58 -0
  583. package/src/network/NetworkUtils.ts +41 -0
  584. package/src/network/Queries.ts +46 -0
  585. package/src/network/client.ts +61 -0
  586. package/src/res/strings.ts +1 -0
  587. package/src/resources/Login.ts +36 -0
  588. package/src/resources/network.ts +13 -0
  589. package/src/styles/SdkColors.ts +24 -0
  590. package/src/styles/executionTasks/CommonStyles.ts +189 -0
  591. package/src/ui/screens/CancellationScreen.tsx +144 -0
  592. package/src/ui/screens/CaptureInputScreen.tsx +79 -0
  593. package/src/ui/screens/CompleteObjectiveScreen.tsx +72 -0
  594. package/src/ui/screens/DeliverScreen.tsx +136 -0
  595. package/src/ui/screens/DisplayScreen.tsx +52 -0
  596. package/src/ui/screens/DoodleScreen.tsx +107 -0
  597. package/src/ui/screens/DropCashScreen.tsx +132 -0
  598. package/src/ui/screens/ETScreensIndex.ts +35 -0
  599. package/src/ui/screens/FormsScreen.tsx +186 -0
  600. package/src/ui/screens/GeofenceScreen.tsx +54 -0
  601. package/src/ui/screens/HttpRequestScreen.tsx +47 -0
  602. package/src/ui/screens/ImageCaptureScreen.tsx +95 -0
  603. package/src/ui/screens/PaymentScreen.tsx +213 -0
  604. package/src/ui/screens/PickupScreen.tsx +112 -0
  605. package/src/ui/screens/ScanScreen.tsx +159 -0
  606. package/src/ui/screens/StartWorkFlowScreen.tsx +233 -0
  607. package/src/ui/screens/ValidateOTPScreen.tsx +62 -0
  608. package/src/ui/screens/WithBaseDispatchScreen.tsx +33 -0
  609. package/src/ui/uiConfig/RouteParams.ts +28 -0
  610. package/src/utils/ApiUtils.ts +157 -0
  611. package/src/utils/ExecTaskUtils.ts +214 -0
  612. package/src/utils/Logger.ts +110 -0
  613. package/src/utils/NetworkUtil.ts +50 -0
  614. package/src/utils/SdkUtils.ts +155 -0
  615. package/src/utils/SyncManagerUtils.ts +223 -0
  616. package/src/utils/fcm/FCM.ts +118 -0
  617. package/src/utils/fcm/FcmUtils.ts +130 -0
  618. package/src/utils/helper.ts +67 -0
  619. package/src/utils/hooks/useModal.tsx +67 -0
  620. package/src/utils/hooks/useTimer.ts +44 -0
  621. package/src/utils/loginHelper.ts +51 -0
  622. package/src/utils/storage.ts +292 -0
  623. package/src/utils/test.json +17 -0
  624. package/src/utils/utils.ts +30 -0
  625. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  626. package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  627. package/android/gradlew +0 -185
  628. package/android/gradlew.bat +0 -89
@@ -0,0 +1,1296 @@
1
+ import { View, Text, Dimensions, Platform } from 'react-native';
2
+ import React, { useState, useEffect } from 'react';
3
+ import { Button } from 'react-native-paper';
4
+ import { Entypo } from '@expo/vector-icons';
5
+ import {
6
+ CommonStyles,
7
+ Fonts,
8
+ } from '../../../../styles/executionTasks/CommonStyles';
9
+ import {
10
+ DisplaySummary,
11
+ ListItem,
12
+ PROCEED_STATUS,
13
+ SummaryPageTabs,
14
+ } from '../interfaces';
15
+ import { StyleSheet } from 'react-native';
16
+ import { TouchableOpacity } from 'react-native';
17
+ import ERDropDown, { ercItem } from './ERDropDown';
18
+ import { getErcDropDownItems } from './DropDownUtils';
19
+ import { ERCode, ScannerInput, ScannerOutput } from '../ScanSchema';
20
+ import SdkColors, { ColorTheme } from '../../../../styles/SdkColors';
21
+ import {
22
+ BaseDataProvider,
23
+ DataProvider,
24
+ LayoutProvider,
25
+ RecyclerListView,
26
+ } from 'recyclerlistview';
27
+ import SnackBarCustom, { SnackBarType } from '../../../widgets/SnackBarCustom';
28
+ import TabsComponent, { Tab } from '../../../widgets/TabsComponent';
29
+ import Card from '../../../widgets/Card';
30
+ import {
31
+ addScans,
32
+ filterERCItems,
33
+ getScanData,
34
+ getTabCount,
35
+ removeScan,
36
+ } from '../utils';
37
+ import { AntDesign } from '@expo/vector-icons';
38
+ import ModalWidget from '../../../widgets/ModalWidget';
39
+ import SearchBar from '../../../widgets/SearchBar';
40
+ import { debounce } from 'lodash';
41
+ import { RouteParams } from '../../../../ui/uiConfig/RouteParams';
42
+ import { IDispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';
43
+ import FileIcon from '../../../../icons/file';
44
+
45
+ const dimensionsForScreen = Dimensions.get('screen');
46
+
47
+ const createNewDataProvider = () => {
48
+ return new DataProvider((r1, r2) => r1.scanId !== r2.scanId);
49
+ };
50
+
51
+ interface SummaryPageProps {
52
+ shipmentCount: { scannedCount: number; totalCount: number };
53
+ updateShipmentCount: (
54
+ scannedCountChanged: number,
55
+ totalCountChanged: number,
56
+ type?: 'SCAN' | 'REMOVE'
57
+ ) => any;
58
+ handleSubmitET: (
59
+ status: PROCEED_STATUS,
60
+ count: number,
61
+ erc?: {
62
+ ec: string;
63
+ rc: string;
64
+ }
65
+ ) => void;
66
+ ercSelector: ERCode[];
67
+ eventCodeItems: ercItem[];
68
+ scanProps: ScannerInput;
69
+ mergedScanETOutput: ScannerOutput;
70
+ }
71
+
72
+ const INITIAL_TABS = [
73
+ { title: SummaryPageTabs.ALL, count: 0 },
74
+ { title: SummaryPageTabs.PENDING, count: 0 },
75
+ { title: SummaryPageTabs.DELIVERED, count: 0 },
76
+ { title: SummaryPageTabs.UNDELIVERED, count: 0 },
77
+ ];
78
+
79
+ const INITIAL_SEARCH_PARAMS = {
80
+ hasNextPage: true,
81
+ offset: 0,
82
+ limit: 10,
83
+ };
84
+
85
+ const SummaryPage = (props: SummaryPageProps) => {
86
+ const [snackBar, setSnackBar] = useState({
87
+ show: false,
88
+ type: SnackBarType.SUCCESS,
89
+ message: '',
90
+ });
91
+ const [tabs, setTabs] = useState(INITIAL_TABS);
92
+
93
+ // START: Modal Handling for Summary Page
94
+
95
+ const [showUnscannedShipmentModal, setShowUnscannedShipmentModal] =
96
+ useState(false);
97
+ const [showERCModal, setShowERCModal] = useState(false);
98
+ const [showRemoveShipmentModal, setShowRemoveShipmentModal] = useState(false);
99
+
100
+ const [selectedEventCode, setSelectedEventCode] = useState<ercItem>();
101
+ const [selectedReason, setSelectedReason] = useState<ercItem>(); // reason code from ercSelector
102
+ const [reasonItems, setReasonItems] = useState<ercItem[]>(); // list of reason codes
103
+ const [editedReasonItems, setEditedReasonItems] = useState<ercItem[]>(); // list of reason codes
104
+ let { scannedCount, totalCount } = props.shipmentCount;
105
+ useEffect(() => {
106
+ props.ercSelector &&
107
+ (async () => {
108
+ setSelectedEventCode(props.eventCodeItems[0]);
109
+ setEditedEventCode(props.eventCodeItems[0]);
110
+ })();
111
+ }, [props.eventCodeItems]);
112
+ useEffect(() => {
113
+ selectedEventCode?.code &&
114
+ (async () => {
115
+ let response = await getErcDropDownItems(
116
+ 'REASON',
117
+ props.ercSelector || [],
118
+ selectedEventCode?.code
119
+ );
120
+ if (response.length) {
121
+ setReasonItems(response);
122
+ setSelectedReason(response[0]);
123
+ } else {
124
+ setReasonItems([]);
125
+ setSelectedReason(undefined);
126
+ }
127
+ })();
128
+ }, [selectedEventCode?.code]);
129
+
130
+ const renderActionButtons = () => {
131
+ return (
132
+ <View
133
+ style={{ borderTopWidth: 1, borderTopColor: '#E0E3EB', padding: 10 }}
134
+ >
135
+ <Button
136
+ labelStyle={CommonStyles.nextButtonLabel}
137
+ style={CommonStyles.nextButton}
138
+ uppercase={false}
139
+ onPress={() => {
140
+ if (scannedCount < totalCount) {
141
+ setShowUnscannedShipmentModal(true);
142
+ } else {
143
+ props.handleSubmitET(PROCEED_STATUS.DELIVER_NOW, tabs[1].count);
144
+ }
145
+ }}
146
+ >
147
+ {`Proceed`}
148
+ </Button>
149
+ </View>
150
+ );
151
+ };
152
+ // END: Modal Handling for Summary Page
153
+
154
+ // START: Summary List Handling
155
+ const [searchParams, setSearchParams] = useState(INITIAL_SEARCH_PARAMS);
156
+ const [dataProvider, setDataProvider] = React.useState<BaseDataProvider>(
157
+ createNewDataProvider()
158
+ );
159
+ const _layoutProvider = new LayoutProvider(
160
+ (index: any) => 0,
161
+ (type: any, dim: any) => {
162
+ dim.width = dimensionsForScreen.width / 1;
163
+ dim.height = 180; //dimensionsForScreen.height / 1;
164
+ }
165
+ );
166
+ const [activeTab, setActiveTab] = useState(SummaryPageTabs.PENDING);
167
+ const [scanList, setScanList] = useState<DisplaySummary[]>([]);
168
+ const [isLoading, setIsLoading] = useState(false);
169
+ const [isLoadingMore, setIsLoadingMore] = useState(false);
170
+ const [showEditModal, setShowEditModal] = useState(false);
171
+ const [selectedEditItem, setSelectedEditItem] = useState<ListItem>();
172
+ const [editedEventCode, setEditedEventCode] = useState<ercItem>();
173
+ const [editedReason, setEditedReason] = useState<ercItem>(); // reason code from ercSelector
174
+ const [selectedItems, setSelectedItems] = useState<{
175
+ [id: string]: ListItem;
176
+ }>({});
177
+ const [searchText, setSearchText] = useState('');
178
+ const [searchQuery, setSearchQuery] = React.useState('');
179
+ const [isSearchCleared, setIsSearchCleared] = React.useState<boolean>(false);
180
+ const [isRemoved, setIsRemoved] = useState(false);
181
+ const onChangeSearch = (query: string) => {
182
+ setSearchQuery((oldQuery) => {
183
+ if (oldQuery.length > 1 && query.length === 0) {
184
+ setIsSearchCleared(true);
185
+ }
186
+ // RESET Search Params
187
+ setSearchParams(INITIAL_SEARCH_PARAMS);
188
+ return query;
189
+ });
190
+ };
191
+ const debouncedChangeSearch = debounce(onChangeSearch, 500);
192
+
193
+ const updateScanList = async (query: string = '') => {
194
+ try {
195
+ if (searchParams.hasNextPage) {
196
+ const { data: result, totalCount } = await getScanData(
197
+ activeTab,
198
+ props.scanProps,
199
+ searchParams.limit,
200
+ searchParams.offset,
201
+ query
202
+ );
203
+
204
+ if (query) {
205
+ setSearchParams((searchParams) => ({
206
+ hasNextPage: Boolean(
207
+ totalCount - (searchParams.offset + searchParams.limit) > 0
208
+ ),
209
+ offset: searchParams.offset + result.length,
210
+ limit: searchParams.limit,
211
+ }));
212
+ setScanList((scanList) => {
213
+ const updatedScanList = result;
214
+ setDataProvider((dataProvider) => {
215
+ return createNewDataProvider().cloneWithRows(updatedScanList);
216
+ });
217
+ return updatedScanList;
218
+ });
219
+ } else {
220
+ setSearchParams((searchParams) => ({
221
+ hasNextPage: Boolean(
222
+ totalCount - (searchParams.offset + searchParams.limit) > 0
223
+ ),
224
+ offset: searchParams.offset + result.length,
225
+ limit: searchParams.limit,
226
+ }));
227
+ setScanList((scanList: DisplaySummary[]) => {
228
+ let updatedScanList: DisplaySummary[] = [];
229
+ if (isSearchCleared) updatedScanList = [...result];
230
+ else updatedScanList = dataProvider.getAllData().concat(result);
231
+
232
+ setIsSearchCleared(false);
233
+ setDataProvider((dataProvider) => {
234
+ if (dataProvider)
235
+ return dataProvider.cloneWithRows(updatedScanList);
236
+ else return dataProvider;
237
+ });
238
+ return updatedScanList;
239
+ });
240
+ }
241
+ }
242
+ } catch (error) {
243
+ } finally {
244
+ props.scanProps.showProgress(false);
245
+ }
246
+ };
247
+
248
+ useEffect(() => {
249
+ (async () => {
250
+ const count = await getTabCount(props.scanProps);
251
+ setTabs([
252
+ { title: SummaryPageTabs.ALL, count: count[SummaryPageTabs.ALL] },
253
+ {
254
+ title: SummaryPageTabs.PENDING,
255
+ count: count[SummaryPageTabs.PENDING],
256
+ },
257
+ {
258
+ title: SummaryPageTabs.DELIVERED,
259
+ count: count[SummaryPageTabs.DELIVERED],
260
+ },
261
+ {
262
+ title: SummaryPageTabs.UNDELIVERED,
263
+ count: count[SummaryPageTabs.UNDELIVERED],
264
+ },
265
+ ]);
266
+ })();
267
+ }, []);
268
+
269
+ useEffect(() => {
270
+ (async () => {
271
+ props.scanProps.showProgress(true);
272
+
273
+ setIsLoading(true);
274
+ await updateScanList(searchQuery);
275
+ setIsLoading(false);
276
+
277
+ props.scanProps.showProgress(false);
278
+
279
+ if (isRemoved) setIsRemoved(false);
280
+ })();
281
+ }, [isRemoved, activeTab, searchQuery]);
282
+
283
+ useEffect(() => {
284
+ editedEventCode?.code &&
285
+ (async () => {
286
+ let response = await getErcDropDownItems(
287
+ 'REASON',
288
+ props.ercSelector || [],
289
+ editedEventCode?.code
290
+ );
291
+ if (response.length) {
292
+ // setReasonItems(response);
293
+ setEditedReasonItems(response);
294
+ setEditedReason(response[0]);
295
+ } else {
296
+ // setReasonItems([]);
297
+ setEditedReasonItems([]);
298
+ setEditedReason(undefined);
299
+ }
300
+ })();
301
+ }, [editedEventCode?.code]);
302
+
303
+ // Triggered when the user reaches the end of the list
304
+ const onEndReached = async () => {
305
+ if (searchParams.hasNextPage === false || searchQuery.length > 0) return;
306
+
307
+ // Fetch more data when the user reaches the end of the list
308
+ setIsLoadingMore(true);
309
+ await updateScanList();
310
+ setIsLoadingMore(false);
311
+ };
312
+
313
+ const renderEditERCModal = () => {
314
+ return (
315
+ <ModalWidget
316
+ showModal={showEditModal}
317
+ contentContainerStyle={{ marginStart: 40, marginEnd: 40 }}
318
+ title={{ label: 'Update' }}
319
+ renderChildren={() => {
320
+ return (
321
+ <View style={{ marginHorizontal: 16, marginBottom: 20 }}>
322
+ <View style={{ marginBottom: 16 }}>
323
+ <ERDropDown
324
+ title={'Event'}
325
+ style={{ height: 50 }}
326
+ selectedReason={editedEventCode}
327
+ items={props.eventCodeItems}
328
+ onItemChange={(eventItem: ercItem | null) => {
329
+ if (eventItem !== null) setEditedEventCode(eventItem);
330
+ }}
331
+ />
332
+ </View>
333
+ <View style={{ marginVertical: 20 }}>
334
+ <ERDropDown
335
+ title={'Reason'}
336
+ style={{ height: 50 }}
337
+ selectedReason={editedReason}
338
+ disabled={
339
+ !editedReasonItems || !editedReasonItems?.length
340
+ ? true
341
+ : false
342
+ }
343
+ items={editedReasonItems ?? []}
344
+ onItemChange={(reasonItem: ercItem | null) => {
345
+ if (reasonItem !== null) setEditedReason(reasonItem);
346
+ }}
347
+ />
348
+ </View>
349
+ </View>
350
+ );
351
+ }}
352
+ buttonStyle={modalStyles.buttonStyles}
353
+ primaryButton={{
354
+ label: 'Update',
355
+ styles: { ...modalStyles.editERCButton, marginStart: 5 },
356
+ onPress: async () => {
357
+ const scan = selectedEditItem;
358
+
359
+ props.scanProps.showProgress(true);
360
+ if (scan && editedEventCode && editedEventCode.code) {
361
+ // UPDATE OUTPUT
362
+
363
+ try {
364
+ const {
365
+ status,
366
+ message,
367
+ type,
368
+ data: scanResult,
369
+ } = await addScans(
370
+ scan.scanId,
371
+ props.scanProps,
372
+ props.mergedScanETOutput,
373
+ props.eventCodeItems,
374
+ editedEventCode,
375
+ editedReason
376
+ );
377
+ if (status === true) {
378
+ // UPDATE COUNT OF TABS
379
+ const count = await getTabCount(props.scanProps);
380
+ setTabs([
381
+ {
382
+ title: SummaryPageTabs.ALL,
383
+ count: count[SummaryPageTabs.ALL],
384
+ },
385
+ {
386
+ title: SummaryPageTabs.PENDING,
387
+ count: count[SummaryPageTabs.PENDING],
388
+ },
389
+ {
390
+ title: SummaryPageTabs.DELIVERED,
391
+ count: count[SummaryPageTabs.DELIVERED],
392
+ },
393
+ {
394
+ title: SummaryPageTabs.UNDELIVERED,
395
+ count: count[SummaryPageTabs.UNDELIVERED],
396
+ },
397
+ ]);
398
+
399
+ // UPDATE THE Count
400
+ props.updateShipmentCount(
401
+ scanResult.shipmentCount.scannedCount,
402
+ scanResult.shipmentCount.totalCount
403
+ );
404
+
405
+ if (activeTab === SummaryPageTabs.ALL) {
406
+ setScanList((scanList) => {
407
+ const updatedScanList = [...scanList];
408
+ updatedScanList[scan.index] = {
409
+ scanId: scan.scanId,
410
+ orderId: scan.orderId || '--',
411
+ clientName: scan.clientName || '--',
412
+ eventCode: editedEventCode.text,
413
+ reasonCode: editedReason?.text || '--',
414
+ prefixedMergedObjectiveId:
415
+ scan.prefixedMergedObjectiveId,
416
+ lastStatus: scan.lastStatus,
417
+ };
418
+ setDataProvider((dataProvider) => {
419
+ if (dataProvider)
420
+ return dataProvider.cloneWithRows(updatedScanList);
421
+ else return dataProvider;
422
+ });
423
+
424
+ return updatedScanList;
425
+ });
426
+ } else if (activeTab === SummaryPageTabs.PENDING) {
427
+ setSearchParams({
428
+ ...searchParams,
429
+ offset: searchParams.offset - 1,
430
+ });
431
+
432
+ setScanList((scanList) => {
433
+ let updatedScanList = dataProvider.getAllData();
434
+ updatedScanList = updatedScanList.filter(
435
+ (scanItem) => scanItem.scanId !== scan.scanId
436
+ );
437
+ // updatedScanList.splice(scan.index, 1);
438
+
439
+ setDataProvider((dataProvider) => {
440
+ if (dataProvider)
441
+ return dataProvider.cloneWithRows(updatedScanList);
442
+ else return dataProvider;
443
+ });
444
+
445
+ return updatedScanList;
446
+ });
447
+ } else if (activeTab === SummaryPageTabs.DELIVERED) {
448
+ setScanList((scanList) => {
449
+ let updatedScanList = dataProvider.getAllData();
450
+ const successEvent = Boolean(editedEventCode.success);
451
+ if (successEvent) {
452
+ updatedScanList[scan.index] = {
453
+ scanId: scan.scanId,
454
+ orderId: scan.orderId || '--',
455
+ clientName: scan.clientName || '--',
456
+ eventCode: editedEventCode.text,
457
+ reasonCode: editedReason?.text || '--',
458
+ prefixedMergedObjectiveId:
459
+ scan.prefixedMergedObjectiveId,
460
+ lastStatus: scan.lastStatus,
461
+ };
462
+ } else {
463
+ setSearchParams({
464
+ ...searchParams,
465
+ offset: searchParams.offset - 1,
466
+ });
467
+ updatedScanList = updatedScanList.filter(
468
+ (scanItem) => scanItem.scanId !== scan.scanId
469
+ );
470
+ }
471
+ setDataProvider((dataProvider) => {
472
+ if (dataProvider)
473
+ return dataProvider.cloneWithRows(updatedScanList);
474
+ else return dataProvider;
475
+ });
476
+
477
+ return updatedScanList;
478
+ });
479
+ } else if (activeTab === SummaryPageTabs.UNDELIVERED) {
480
+ setScanList((scanList) => {
481
+ let updatedScanList = dataProvider.getAllData();
482
+ const successEvent = Boolean(editedEventCode.success);
483
+ if (!successEvent) {
484
+ updatedScanList[scan.index] = {
485
+ scanId: scan.scanId,
486
+ orderId: scan.orderId || '--',
487
+ clientName: scan.clientName || '--',
488
+ eventCode: editedEventCode.text,
489
+ reasonCode: editedReason?.text || '--',
490
+ prefixedMergedObjectiveId:
491
+ scan.prefixedMergedObjectiveId,
492
+ lastStatus: scan.lastStatus,
493
+ };
494
+ } else {
495
+ setSearchParams({
496
+ ...searchParams,
497
+ offset: searchParams.offset - 1,
498
+ });
499
+
500
+ updatedScanList = updatedScanList.filter(
501
+ (scanItem) => scanItem.scanId !== scan.scanId
502
+ );
503
+ }
504
+ setDataProvider((dataProvider) => {
505
+ if (dataProvider)
506
+ return dataProvider.cloneWithRows(updatedScanList);
507
+ else return dataProvider;
508
+ });
509
+
510
+ return updatedScanList;
511
+ });
512
+ }
513
+
514
+ setSnackBar({
515
+ show: true,
516
+ message:
517
+ scan.eventCode !== '--'
518
+ ? `#${scan.scanId}\nShipment updated successfully!`
519
+ : message,
520
+ type,
521
+ });
522
+ } else {
523
+ setSnackBar({
524
+ show: true,
525
+ message,
526
+ type,
527
+ });
528
+ }
529
+ } catch (error) {
530
+ setSnackBar({
531
+ show: true,
532
+ message: 'Some error occurred',
533
+ type: SnackBarType.FAILURE,
534
+ });
535
+ }
536
+ } else {
537
+ setSnackBar({
538
+ show: true,
539
+ message: 'Some error occurred',
540
+ type: SnackBarType.FAILURE,
541
+ });
542
+ }
543
+
544
+ // RESET KEYS
545
+ props.scanProps.showProgress(false);
546
+ setSelectedEditItem(undefined);
547
+ setShowEditModal(false);
548
+ return;
549
+ },
550
+ }}
551
+ secondaryButton={{
552
+ label: 'Cancel',
553
+ styles: { ...modalStyles.editERCButton, marginEnd: 5 },
554
+ onPress: () => {
555
+ setShowEditModal(false);
556
+ setSelectedEditItem(undefined);
557
+ },
558
+ }}
559
+ />
560
+ );
561
+ };
562
+
563
+ const renderUnscannedShipmentModal = () => {
564
+ return (
565
+ <ModalWidget
566
+ showModal={showUnscannedShipmentModal}
567
+ title={{ label: 'Pending Shipments' }}
568
+ subTitle={{
569
+ label: `You still have ${tabs[1].count} unscanned shipment!`,
570
+ styles: { textAlign: 'center' },
571
+ }}
572
+ primaryButton={{
573
+ label: 'Continue without Scanning',
574
+ styles: modalStyles.primaryButtonStyles,
575
+ onPress: () => {
576
+ props.handleSubmitET(PROCEED_STATUS.DELIVER_LATER, tabs[1].count);
577
+ },
578
+ }}
579
+ secondaryButton={{
580
+ label: `Keep Scanning`,
581
+ styles: modalStyles.secondaryButtonStyles,
582
+ onPress: () => setShowUnscannedShipmentModal(false),
583
+ }}
584
+ // OLD CODE: When you wanted to update Undelivered shipments with a particular ERC got removed after: https://dev.azure.com/DelhiveryPlatform/Solutions/_workitems/edit/15669
585
+ // secondaryButton={{
586
+ // label: `Mark as Undelivered`,
587
+ // styles: modalStyles.secondaryButtonStyles,
588
+ // onPress: () => {
589
+ // setShowUnscannedShipmentModal(false);
590
+ // setShowERCModal(true);
591
+ // },
592
+ // }}
593
+ // renderAdditionalButtons={() => {
594
+ // return (
595
+ // <TouchableOpacity
596
+ // style={{
597
+ // marginBottom: 16,
598
+ // height: 40,
599
+ // borderRadius: 6,
600
+ // justifyContent: 'center',
601
+ // alignItems: 'center',
602
+ // }}
603
+ // onPress={() => setShowUnscannedShipmentModal(false)}
604
+ // >
605
+ // <Text
606
+ // style={[
607
+ // CommonStyles.cancelButtonLabel,
608
+ // { color: SdkColors[ColorTheme.LIGHT].primaryButton },
609
+ // ]}
610
+ // >
611
+ // Continue Scanning
612
+ // </Text>
613
+ // </TouchableOpacity>
614
+ // );
615
+ // }}
616
+ />
617
+ );
618
+ };
619
+
620
+ const renderERCModal = () => {
621
+ return (
622
+ <ModalWidget
623
+ showModal={showERCModal}
624
+ contentContainerStyle={{ marginStart: 40, marginEnd: 40 }}
625
+ title={{ label: 'Mark as Undelivered' }}
626
+ subTitle={{
627
+ label: `The shipments shall be updated with the following:`,
628
+ }}
629
+ renderChildren={() => {
630
+ return (
631
+ <View style={{ marginHorizontal: 16, marginBottom: 20 }}>
632
+ <View style={{ marginBottom: 16 }}>
633
+ <ERDropDown
634
+ title={'Event'}
635
+ style={{ height: 50 }}
636
+ selectedReason={selectedEventCode}
637
+ items={filterERCItems(props.eventCodeItems, 'FAILURE')}
638
+ onItemChange={(eventItem: ercItem | null) => {
639
+ if (eventItem !== null) setSelectedEventCode(eventItem);
640
+ }}
641
+ />
642
+ </View>
643
+ <View style={{ marginVertical: 20 }}>
644
+ <ERDropDown
645
+ title={'Reason'}
646
+ style={{ height: 50 }}
647
+ selectedReason={selectedReason}
648
+ disabled={!reasonItems || !reasonItems?.length ? true : false}
649
+ items={reasonItems ?? []}
650
+ onItemChange={(reasonItem: ercItem | null) => {
651
+ if (reasonItem !== null) setSelectedReason(reasonItem);
652
+ }}
653
+ />
654
+ </View>
655
+ </View>
656
+ );
657
+ }}
658
+ buttonStyle={{ zIndex: -1 }}
659
+ primaryButton={{
660
+ label: 'Proceed',
661
+ styles: modalStyles.primaryButtonStyles,
662
+ onPress: () => {
663
+ props.handleSubmitET(PROCEED_STATUS.DELIVER_NOW, tabs[1].count, {
664
+ ec: selectedEventCode?.code || '',
665
+ rc: selectedReason?.code || '',
666
+ });
667
+ setShowERCModal(false);
668
+ },
669
+ }}
670
+ secondaryButton={{
671
+ label: `Cancel`,
672
+ styles: modalStyles.secondaryButtonStyles,
673
+ onPress: () => {
674
+ setShowERCModal(false);
675
+ },
676
+ }}
677
+ />
678
+ );
679
+ };
680
+
681
+ const renderRemoveShipmentModal = () => {
682
+ return (
683
+ <ModalWidget
684
+ showModal={showRemoveShipmentModal}
685
+ contentContainerStyle={{ marginStart: 40, marginEnd: 40 }}
686
+ title={{ label: 'Remove Shipment' }}
687
+ subTitle={{
688
+ label: `${
689
+ Object.keys(selectedItems).length > 1
690
+ ? `Are you sure you want to remove the ${
691
+ Object.keys(selectedItems).length
692
+ } shipments?`
693
+ : 'Are you sure you want to remove this shipment?'
694
+ }`,
695
+ styles: modalStyles.subTitleStyles,
696
+ }}
697
+ primaryButton={{
698
+ label: 'Proceed to Remove',
699
+ styles: modalStyles.primaryButtonStyles,
700
+ onPress: async () => {
701
+ props.scanProps.showProgress(true);
702
+
703
+ const prefixedMergedObjectiveId =
704
+ props.scanProps.route.params[RouteParams.ROOT_META_DATA]
705
+ .prefixedMergedObjectiveId;
706
+
707
+ try {
708
+ // REMOVE SCAN
709
+ await removeScan(
710
+ props.scanProps.taskName || '',
711
+ Object.keys(selectedItems),
712
+ props.scanProps.route,
713
+ props.mergedScanETOutput
714
+ );
715
+
716
+ // UPDATE THE Count
717
+ props.updateShipmentCount(
718
+ -Object.keys(selectedItems).length,
719
+ 0,
720
+ 'REMOVE'
721
+ );
722
+
723
+ // UPDATE COUNT OF TABS
724
+ const count = await getTabCount(props.scanProps);
725
+
726
+ setSearchParams({
727
+ ...searchParams,
728
+ offset: searchParams.offset - Object.keys(selectedItems).length,
729
+ });
730
+
731
+ // RESET SCAN LIST
732
+ setScanList((scanList: any) => {
733
+ let updatedScanList: any;
734
+ const itemsRemoved: string[] = [];
735
+
736
+ if (activeTab === SummaryPageTabs.ALL) {
737
+ updatedScanList = [...scanList];
738
+
739
+ Object.keys(selectedItems).forEach((scanId) => {
740
+ const item = selectedItems[scanId]; // returns Display Summary with Index
741
+
742
+ if (
743
+ item.prefixedMergedObjectiveId !==
744
+ prefixedMergedObjectiveId ||
745
+ item.lastStatus ===
746
+ IDispatchExecutor.ExecutionStatus.COMPLETED_FAILURE
747
+ ) {
748
+ itemsRemoved.push(item.scanId);
749
+ } else {
750
+ updatedScanList[item.index] = {
751
+ scanId: item.scanId,
752
+ orderId: item.orderId || '--',
753
+ clientName: item.clientName || '--',
754
+ eventCode: '--',
755
+ reasonCode: '--',
756
+ };
757
+ }
758
+ });
759
+ } else if (
760
+ activeTab === SummaryPageTabs.DELIVERED ||
761
+ activeTab === SummaryPageTabs.UNDELIVERED
762
+ ) {
763
+ const indexes = Object.keys(selectedItems).map((scanId) => {
764
+ const item: any = selectedItems[scanId];
765
+ return item.index;
766
+ });
767
+ updatedScanList = scanList.filter(
768
+ (value: any, index: number) => !indexes.includes(index)
769
+ );
770
+ } else {
771
+ updatedScanList = scanList;
772
+ }
773
+ setDataProvider((dataProvider: any) => {
774
+ return dataProvider.cloneWithRows(updatedScanList);
775
+ });
776
+
777
+ setTabs([
778
+ {
779
+ title: SummaryPageTabs.ALL,
780
+ count: count[SummaryPageTabs.ALL],
781
+ },
782
+ {
783
+ title: SummaryPageTabs.PENDING,
784
+ count: count[SummaryPageTabs.PENDING],
785
+ },
786
+ {
787
+ title: SummaryPageTabs.DELIVERED,
788
+ count: count[SummaryPageTabs.DELIVERED],
789
+ },
790
+ {
791
+ title: SummaryPageTabs.UNDELIVERED,
792
+ count: count[SummaryPageTabs.UNDELIVERED],
793
+ },
794
+ ]);
795
+
796
+ // RESET MODAL
797
+ setShowRemoveShipmentModal(false);
798
+
799
+ // RESET SELECTED ITEMS
800
+ setSelectedItems({});
801
+
802
+ updatedScanList = updatedScanList.filter(
803
+ (scan: DisplaySummary) => !itemsRemoved.includes(scan.scanId)
804
+ );
805
+
806
+ setDataProvider((dataProvider) => {
807
+ if (dataProvider)
808
+ return dataProvider.cloneWithRows(updatedScanList);
809
+ else return dataProvider;
810
+ });
811
+
812
+ return updatedScanList;
813
+ });
814
+
815
+ // RESET MODAL
816
+ setShowRemoveShipmentModal(false);
817
+
818
+ // RESET SELECTED ITEMS
819
+ setSelectedItems({});
820
+
821
+ // RESET Loader
822
+ props.scanProps.showProgress(false);
823
+
824
+ // Show Success Message
825
+ setSnackBar({
826
+ show: true,
827
+ message: 'Selected items removed successfully!',
828
+ type: SnackBarType.SUCCESS,
829
+ });
830
+ } catch (error) {
831
+ // RESET MODAL
832
+ setShowRemoveShipmentModal(false);
833
+
834
+ setSnackBar({
835
+ show: true,
836
+ message: 'Some error occurred',
837
+ type: SnackBarType.FAILURE,
838
+ });
839
+ } finally {
840
+ props.scanProps.showProgress(false);
841
+ }
842
+ },
843
+ }}
844
+ secondaryButton={{
845
+ label: `Cancel`,
846
+ styles: modalStyles.secondaryButtonStyles,
847
+ onPress: () => {
848
+ setShowRemoveShipmentModal(false);
849
+ },
850
+ }}
851
+ />
852
+ );
853
+ };
854
+
855
+ const rowRenderer = (_: any, scan: DisplaySummary, index: number) => {
856
+ const prefixedMergedObjectiveId =
857
+ props.scanProps.route.params[RouteParams.ROOT_META_DATA]
858
+ .prefixedMergedObjectiveId;
859
+
860
+ return (
861
+ <Card
862
+ key={scan.scanId}
863
+ title={`#${scan.scanId}`}
864
+ renderAdditionalHeader={() => {
865
+ if (
866
+ scan.prefixedMergedObjectiveId &&
867
+ prefixedMergedObjectiveId !== scan.prefixedMergedObjectiveId
868
+ )
869
+ return (
870
+ <AntDesign name="exclamationcircleo" size={16} color="#EA580C" />
871
+ );
872
+ else return <></>;
873
+ }}
874
+ Body={
875
+ <View style={{ marginVertical: 10 }}>
876
+ <Text style={styles.cardField}>
877
+ <Text style={styles.cardFieldSubText}>Order ID:</Text>{' '}
878
+ {scan.orderId}
879
+ </Text>
880
+ <Text style={styles.cardField}>
881
+ <Text style={styles.cardFieldSubText}>Client Name:</Text>
882
+ {scan.clientName}
883
+ </Text>
884
+ <Text style={styles.cardField}>
885
+ <Text style={styles.cardFieldSubText}>Event:</Text>{' '}
886
+ {scan.eventCode}
887
+ </Text>
888
+ <Text>
889
+ <Text style={styles.cardFieldSubText}>Reason:</Text>
890
+ {scan.reasonCode || ''}
891
+ </Text>
892
+ </View>
893
+ }
894
+ editConfig={{
895
+ onEdit: (props: any) => {
896
+ if (selectedItems && Object.keys(selectedItems).length > 1) {
897
+ setSnackBar({
898
+ show: true,
899
+ message: 'Cannot Edit Multiple Items',
900
+ type: SnackBarType.FAILURE,
901
+ });
902
+ } else {
903
+ setSelectedItems({});
904
+ setShowEditModal(true);
905
+ setSelectedEditItem({ ...props, index });
906
+ }
907
+ },
908
+ props: scan,
909
+ }}
910
+ selectConfig={{
911
+ isSelected: selectedItems[scan.scanId] ? true : false,
912
+ onSelect: (props: DisplaySummary) => {
913
+ setSelectedItems((selectedItems) => {
914
+ // Unselect
915
+ if (selectedItems[props.scanId]) {
916
+ const _selectedItems = { ...selectedItems };
917
+ delete _selectedItems[props.scanId];
918
+ return _selectedItems;
919
+ } else {
920
+ return {
921
+ ...selectedItems,
922
+ [props.scanId]: { ...props, index },
923
+ };
924
+ }
925
+ });
926
+ },
927
+ props: scan,
928
+ }}
929
+ />
930
+ );
931
+ };
932
+
933
+ const renderBody = (currentTab: string) => {
934
+ return (
935
+ <View style={{ flex: 1 }}>
936
+ <View style={styles.searchBar}>
937
+ <SearchBar
938
+ searchText={searchText}
939
+ setSearchText={setSearchText}
940
+ placeholder="Shipment ID"
941
+ onChangeSearch={(searchText) => debouncedChangeSearch(searchText)}
942
+ onClear={() => {
943
+ setSearchQuery(() => {
944
+ setIsSearchCleared(true);
945
+ setSearchParams(INITIAL_SEARCH_PARAMS);
946
+ return '';
947
+ });
948
+ }}
949
+ />
950
+ </View>
951
+ {!isLoading && scanList && scanList.length > 0 ? (
952
+ <RecyclerListView
953
+ layoutProvider={_layoutProvider}
954
+ dataProvider={dataProvider}
955
+ rowRenderer={(type: any, scanData: any, index: number) =>
956
+ rowRenderer(type, scanData, index)
957
+ }
958
+ onEndReached={async () => await onEndReached()}
959
+ onEndReachedThreshold={0.5}
960
+ renderFooter={() => {
961
+ return (
962
+ <>
963
+ {isLoadingMore ? (
964
+ <Text
965
+ style={{
966
+ padding: 10,
967
+ fontWeight: 'bold',
968
+ textAlign: 'center',
969
+ }}
970
+ >
971
+ Loading
972
+ </Text>
973
+ ) : null}
974
+ </>
975
+ );
976
+ }}
977
+ />
978
+ ) : null}
979
+ {!isLoading && scanList.length === 0 ? (
980
+ <View
981
+ style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}
982
+ >
983
+ <FileIcon />
984
+ <Text
985
+ style={{
986
+ color: '#3D445C',
987
+ fontFamily:
988
+ Platform.OS === 'android'
989
+ ? Fonts.IBMPlexSans_500Medium
990
+ : 'IBMPlexSans-Medium',
991
+ fontStyle: 'normal',
992
+ fontWeight: '500',
993
+ fontSize: 16,
994
+ marginTop: 24,
995
+ }}
996
+ >{`You do not have any ${activeTab.toLowerCase()} shipments`}</Text>
997
+ {activeTab === SummaryPageTabs.PENDING ? (
998
+ <Text
999
+ style={{
1000
+ color: '#525B7A',
1001
+ fontFamily:
1002
+ Platform.OS === 'android'
1003
+ ? Fonts.IBMPlexSans_400Regular
1004
+ : 'IBMPlexSans-Regular',
1005
+ fontStyle: 'normal',
1006
+ fontWeight: '400',
1007
+ fontSize: 14,
1008
+ }}
1009
+ >
1010
+ You can proceed to the next step now
1011
+ </Text>
1012
+ ) : null}
1013
+ </View>
1014
+ ) : null}
1015
+ </View>
1016
+ );
1017
+ };
1018
+
1019
+ const renderTabItem = (tab: Tab) => {
1020
+ return (
1021
+ <View style={styles.tabItem}>
1022
+ <View style={styles.tabText}>
1023
+ <Text
1024
+ style={activeTab === tab.title ? { color: '#5B80F7' } : {}}
1025
+ >{`${tab.title}`}</Text>
1026
+ </View>
1027
+ <View
1028
+ style={
1029
+ activeTab !== tab.title
1030
+ ? styles.tabCount
1031
+ : [styles.tabCount, { backgroundColor: '#ECF0FF' }]
1032
+ }
1033
+ >
1034
+ <Text>{`${tab.count}`}</Text>
1035
+ </View>
1036
+ </View>
1037
+ );
1038
+ };
1039
+ // END: Summary List Handling
1040
+
1041
+ return (
1042
+ <>
1043
+ {renderERCModal()}
1044
+ {renderUnscannedShipmentModal()}
1045
+ {renderEditERCModal()}
1046
+ {renderRemoveShipmentModal()}
1047
+ <View style={{ flex: 1 }}>
1048
+ <TabsComponent
1049
+ tabs={tabs}
1050
+ initialTab={tabs[1]}
1051
+ onTabChange={(currentTab: string) => {
1052
+ if (activeTab === currentTab) {
1053
+ return;
1054
+ }
1055
+ // @ts-ignore
1056
+ setActiveTab((activeTab) => {
1057
+ // RESET Search TEXT
1058
+ setSearchText('');
1059
+ setSearchQuery('');
1060
+
1061
+ // RESET SEARCH PARAMS
1062
+ setSearchParams(INITIAL_SEARCH_PARAMS);
1063
+
1064
+ // RESET SCAN LIST
1065
+ setScanList((scanList: any) => {
1066
+ const updatedScanList: any = [];
1067
+ setDataProvider((dataProvider) => {
1068
+ if (dataProvider)
1069
+ return dataProvider.cloneWithRows(updatedScanList);
1070
+ else return dataProvider;
1071
+ });
1072
+ return updatedScanList;
1073
+ });
1074
+
1075
+ // RESET SELECTED ITEMS
1076
+ setSelectedItems({});
1077
+
1078
+ return currentTab;
1079
+ });
1080
+ }}
1081
+ renderTabItem={renderTabItem}
1082
+ renderBody={renderBody}
1083
+ />
1084
+ </View>
1085
+ <View style={{ justifyContent: 'flex-end' }}>
1086
+ <SnackBarCustom
1087
+ type={snackBar.type}
1088
+ message={`${snackBar.message}`}
1089
+ visible={snackBar.show}
1090
+ onDismiss={() => {
1091
+ setSnackBar({
1092
+ show: false,
1093
+ message: '',
1094
+ type: SnackBarType.SUCCESS,
1095
+ });
1096
+ }}
1097
+ customBottom={20}
1098
+ />
1099
+ </View>
1100
+ {!selectedItems || Object.keys(selectedItems).length === 0 ? (
1101
+ <View style={styles.bottomView}>{renderActionButtons()}</View>
1102
+ ) : null}
1103
+ {selectedItems &&
1104
+ Object.keys(selectedItems).length &&
1105
+ activeTab !== SummaryPageTabs.PENDING ? (
1106
+ <View style={styles.removeBtnContainer}>
1107
+ <View
1108
+ style={{
1109
+ flexDirection: 'row',
1110
+ alignItems: 'center',
1111
+ marginLeft: 10,
1112
+ }}
1113
+ >
1114
+ <TouchableOpacity
1115
+ onPress={() => setSelectedItems({})}
1116
+ style={styles.removeSelection}
1117
+ >
1118
+ <Entypo name="cross" size={24} color="#3D445C" />
1119
+ </TouchableOpacity>
1120
+ <Text>{`${Object.keys(selectedItems).length} Selected`}</Text>
1121
+ </View>
1122
+ <Button
1123
+ labelStyle={CommonStyles.mainExitButtonLabel}
1124
+ style={[CommonStyles.mainExitButton, styles.removeBtn]}
1125
+ onPress={() => {
1126
+ if (canRemove(selectedItems)) setShowRemoveShipmentModal(true);
1127
+ else {
1128
+ setSnackBar({
1129
+ show: true,
1130
+ message: 'Cannot Remove unscanned shipment(s)',
1131
+ type: SnackBarType.FAILURE,
1132
+ });
1133
+ }
1134
+ }}
1135
+ >
1136
+ Remove
1137
+ </Button>
1138
+ </View>
1139
+ ) : null}
1140
+ </>
1141
+ );
1142
+ };
1143
+
1144
+ export default SummaryPage;
1145
+
1146
+ const styles = StyleSheet.create({
1147
+ bottomView: {
1148
+ paddingBottom: 16,
1149
+ justifyContent: 'flex-end',
1150
+ marginVertical: 10,
1151
+ marginHorizontal: 16,
1152
+ },
1153
+ modalContent: {
1154
+ marginStart: 60,
1155
+ marginEnd: 60,
1156
+ flex: 1,
1157
+ marginBottom: 60,
1158
+ },
1159
+ modalView: {
1160
+ backgroundColor: 'white',
1161
+ padding: 15,
1162
+ borderRadius: 9,
1163
+ },
1164
+ titleText: {
1165
+ justifyContent: 'center',
1166
+ fontFamily:
1167
+ Platform.OS === 'android'
1168
+ ? Fonts.IBMPlexSans_600SemiBold
1169
+ : 'IBMPlexSans-SemiBold',
1170
+ fontStyle: 'normal',
1171
+ fontSize: 14,
1172
+ lineHeight: 20,
1173
+ textAlign: 'center',
1174
+ color: '#111111',
1175
+ marginBottom: 10,
1176
+ },
1177
+ subText: {
1178
+ justifyContent: 'center',
1179
+ fontFamily:
1180
+ Platform.OS === 'android'
1181
+ ? Fonts.IBMPlexSans_400Regular
1182
+ : 'IBMPlexSans-Regular',
1183
+ fontStyle: 'normal',
1184
+ fontSize: 14,
1185
+ letterSpacing: 0.25,
1186
+ lineHeight: 20,
1187
+ textAlign: 'center',
1188
+ color: '#000000',
1189
+ marginBottom: 10,
1190
+ },
1191
+ bottomButtons: {
1192
+ justifyContent: 'space-between',
1193
+ flexDirection: 'row',
1194
+ marginTop: 8,
1195
+ },
1196
+ unscannedShipmentModalSubText: {
1197
+ justifyContent: 'center',
1198
+ fontFamily:
1199
+ Platform.OS === 'android'
1200
+ ? Fonts.IBMPlexSans_400Regular
1201
+ : 'IBMPlexSans-Regular',
1202
+ fontStyle: 'normal',
1203
+ fontSize: 14,
1204
+ letterSpacing: 0.25,
1205
+ lineHeight: 20,
1206
+ color: '#000000',
1207
+ marginBottom: 10,
1208
+ },
1209
+ tabItem: {
1210
+ // width: 200,
1211
+ flexDirection: 'row',
1212
+ justifyContent: 'center',
1213
+ alignItems: 'center',
1214
+ paddingVertical: 5,
1215
+ marginHorizontal: 10,
1216
+ },
1217
+ activeTab: {
1218
+ borderBottomWidth: 2,
1219
+ borderBottomColor: 'blue',
1220
+ },
1221
+ tabText: {
1222
+ fontSize: 16,
1223
+ fontWeight: '400',
1224
+ color: '#3D445C',
1225
+ marginRight: 12,
1226
+ },
1227
+ tabCount: {
1228
+ borderRadius: 50,
1229
+ backgroundColor: '#E0E3EB',
1230
+ paddingHorizontal: 15,
1231
+ textAlign: 'center',
1232
+ },
1233
+ removeBtnContainer: {
1234
+ borderTopWidth: 1,
1235
+ borderTopColor: '#E0E3EB',
1236
+ padding: 10,
1237
+ flexDirection: 'row',
1238
+ alignItems: 'center',
1239
+ justifyContent: 'space-between',
1240
+ },
1241
+ removeSelection: {
1242
+ marginRight: 20,
1243
+ },
1244
+ removeBtn: {
1245
+ marginRight: 10,
1246
+ },
1247
+ searchBar: {
1248
+ marginTop: 16,
1249
+ },
1250
+ cardField: {
1251
+ marginBottom: 8,
1252
+ },
1253
+ cardFieldSubText: {
1254
+ color: '#A3AAC2',
1255
+ },
1256
+ });
1257
+
1258
+ const modalStyles = StyleSheet.create({
1259
+ primaryButtonStyles: {
1260
+ marginTop: 16,
1261
+ height: 40,
1262
+ borderRadius: 6,
1263
+ justifyContent: 'center',
1264
+ alignItems: 'center',
1265
+ },
1266
+ secondaryButtonStyles: {
1267
+ marginVertical: 16,
1268
+ height: 40,
1269
+ borderRadius: 6,
1270
+ justifyContent: 'center',
1271
+ alignItems: 'center',
1272
+ },
1273
+ subTitleStyles: { textAlign: 'center' },
1274
+ buttonStyles: {
1275
+ justifyContent: 'space-between',
1276
+ flexDirection: 'row-reverse',
1277
+ marginTop: 20,
1278
+ zIndex: -1,
1279
+ },
1280
+ editERCButton: {
1281
+ justifyContent: 'center',
1282
+ alignItems: 'center',
1283
+ flex: 1,
1284
+ height: 40,
1285
+ borderRadius: 6,
1286
+ },
1287
+ });
1288
+
1289
+ function canRemove(scans: { [scanId: string]: DisplaySummary }): boolean {
1290
+ for (const scanId in scans) {
1291
+ const item = scans[scanId];
1292
+ if (item.eventCode && item.eventCode !== '--') continue;
1293
+ else return false;
1294
+ }
1295
+ return true;
1296
+ }