react-native-timacare 3.3.14 → 3.3.16

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 (37) hide show
  1. package/lib/commonjs/screens/home/DigitalTopupItem.js +1 -1
  2. package/lib/commonjs/screens/home/DigitalTopupItem.js.flow +595 -425
  3. package/lib/commonjs/screens/home/DigitalTopupItem.js.map +1 -1
  4. package/lib/commonjs/screens/home/index.js +1 -1
  5. package/lib/commonjs/screens/home/index.js.flow +5 -1
  6. package/lib/commonjs/screens/home/index.js.map +1 -1
  7. package/lib/commonjs/screens/mrz-scanner/index.js +1 -1
  8. package/lib/commonjs/screens/mrz-scanner/index.js.flow +40 -40
  9. package/lib/commonjs/screens/mrz-scanner/index.js.map +1 -1
  10. package/lib/commonjs/screens/toan-trinh-so/VehicleRegistrationBack.js +1 -1
  11. package/lib/commonjs/screens/toan-trinh-so/VehicleRegistrationBack.js.flow +17 -4
  12. package/lib/commonjs/screens/toan-trinh-so/VehicleRegistrationBack.js.map +1 -1
  13. package/lib/commonjs/services/api/api.js +1 -1
  14. package/lib/commonjs/services/api/api.js.flow +16 -0
  15. package/lib/commonjs/services/api/api.js.map +1 -1
  16. package/lib/module/screens/home/DigitalTopupItem.js +1 -1
  17. package/lib/module/screens/home/DigitalTopupItem.js.map +1 -1
  18. package/lib/module/screens/home/index.js +1 -1
  19. package/lib/module/screens/home/index.js.map +1 -1
  20. package/lib/module/screens/mrz-scanner/index.js +1 -1
  21. package/lib/module/screens/mrz-scanner/index.js.map +1 -1
  22. package/lib/module/screens/toan-trinh-so/VehicleRegistrationBack.js +1 -1
  23. package/lib/module/screens/toan-trinh-so/VehicleRegistrationBack.js.map +1 -1
  24. package/lib/module/services/api/api.js +1 -1
  25. package/lib/module/services/api/api.js.map +1 -1
  26. package/lib/typescript/screens/home/DigitalTopupItem.d.ts +2 -1
  27. package/lib/typescript/screens/home/DigitalTopupItem.d.ts.map +1 -1
  28. package/lib/typescript/screens/home/index.d.ts.map +1 -1
  29. package/lib/typescript/screens/toan-trinh-so/VehicleRegistrationBack.d.ts.map +1 -1
  30. package/lib/typescript/services/api/api.d.ts +16 -0
  31. package/lib/typescript/services/api/api.d.ts.map +1 -1
  32. package/package.json +1 -1
  33. package/src/screens/home/DigitalTopupItem.tsx +595 -425
  34. package/src/screens/home/index.tsx +5 -1
  35. package/src/screens/mrz-scanner/index.tsx +40 -40
  36. package/src/screens/toan-trinh-so/VehicleRegistrationBack.tsx +17 -4
  37. package/src/services/api/api.ts +16 -0
@@ -529,7 +529,11 @@ export const Home = observer(function Home() {
529
529
  <ItemTimaOneV3 item={item} navigation={navigation} />
530
530
  </View>
531
531
  ) : item?.typeLoan === 4 && !item?.isPipelineCIMB ? (
532
- <DigitalTopupItem item={item} navigation={navigation} />
532
+ <DigitalTopupItem
533
+ item={item}
534
+ navigation={navigation}
535
+ callback={() => onRefresh()}
536
+ />
533
537
  ) : (
534
538
  <View>
535
539
  {/* // luồng CIMB */}
@@ -8,7 +8,6 @@ import {
8
8
  PermissionsAndroid,
9
9
  Platform,
10
10
  Alert,
11
- SafeAreaView,
12
11
  TouchableOpacity,
13
12
  NativeModules,
14
13
  } from 'react-native';
@@ -27,10 +26,12 @@ import { IconBackWhite } from '../../assets/icons';
27
26
  import { commonStyles } from '../CommonStyles';
28
27
  import nfcStore from './store';
29
28
  import { ScreenNames } from '../../navigation';
29
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
30
30
 
31
31
  const { NFCReader } = NativeModules;
32
32
 
33
33
  const MRZScanner = (props: any) => {
34
+ const insets = useSafeAreaInsets();
34
35
  const navigation = useNavigation();
35
36
  const loan = props?.route?.params?.loan;
36
37
 
@@ -247,49 +248,48 @@ const MRZScanner = (props: any) => {
247
248
  <View style={styles.overlayBottom} />
248
249
  </View>
249
250
 
250
- <View style={{ position: 'absolute', top: 0, left: 0 }}>
251
- <SafeAreaView style={{ flex: 1 }}>
252
- <View
253
- style={[
254
- commonStyles.row,
255
- commonStyles.alignCenter,
256
- { height: 56, paddingHorizontal: 16 },
257
- ]}
251
+ <View
252
+ style={{ position: 'absolute', top: insets.top, left: 0, right: 0 }}
253
+ >
254
+ <View
255
+ style={[
256
+ commonStyles.row,
257
+ commonStyles.alignCenter,
258
+ { height: 56, paddingHorizontal: 16 },
259
+ ]}
260
+ >
261
+ <MButton
262
+ onPress={() => {
263
+ navigation.goBack();
264
+ }}
265
+ style={[{ width: 48, height: 48, justifyContent: 'center' }]}
258
266
  >
259
- <MButton
260
- onPress={() => {
261
- navigation.goBack();
267
+ <IconBackWhite />
268
+ </MButton>
269
+ <View style={{ flex: 1, paddingRight: 48 }}>
270
+ <MText
271
+ style={{
272
+ color: 'white',
273
+ fontSize: 16,
274
+ textAlign: 'center',
275
+ padding: 16,
276
+ fontWeight: '600',
262
277
  }}
263
- style={[{ width: 48, height: 48, justifyContent: 'center' }]}
264
278
  >
265
- <IconBackWhite />
266
- </MButton>
267
- <View style={{ flex: 1, paddingRight: 48 }}>
268
- <MText
269
- style={{
270
- color: 'white',
271
- fontSize: 16,
272
- textAlign: 'center',
273
- padding: 16,
274
- fontWeight: '600',
275
- }}
276
- >
277
- EKYC
278
- </MText>
279
- </View>
279
+ EKYC
280
+ </MText>
280
281
  </View>
281
- <MText
282
- style={{
283
- color: 'white',
284
- fontSize: 16,
285
- textAlign: 'center',
286
- padding: 16,
287
- }}
288
- >
289
- Dùng camera để quét chuỗi ký tự mặt sau thẻ CCCD gắn chip ở phía
290
- dưới
291
- </MText>
292
- </SafeAreaView>
282
+ </View>
283
+ <MText
284
+ style={{
285
+ color: 'white',
286
+ fontSize: 16,
287
+ textAlign: 'center',
288
+ padding: 16,
289
+ }}
290
+ >
291
+ Dùng camera để quét chuỗi ký tự mặt sau thẻ CCCD gắn chip ở phía dưới
292
+ </MText>
293
293
  </View>
294
294
  <View style={styles.buttonContainer}>
295
295
  <MText
@@ -74,10 +74,23 @@ export default function VehicleRegistrationBack(props: any) {
74
74
  setIsLoading(false);
75
75
  if (response.kind === 'ok') {
76
76
  if (response.data?.meta?.errorCode === 200) {
77
- navigation.push(ScreenNames.RegisterCamera, {
78
- loan: props?.route?.params?.loan,
79
- front: true,
80
- });
77
+ // navigation.push(ScreenNames.RegisterCamera, {
78
+ // loan: props?.route?.params?.loan,
79
+ // front: true,
80
+ // });
81
+ navigation.dispatch(
82
+ CommonActions.reset({
83
+ index: 1,
84
+ routes: [
85
+ {
86
+ name: ScreenNames.AssetInformation,
87
+ params: {
88
+ loan: props?.route?.params?.loan,
89
+ },
90
+ },
91
+ ],
92
+ })
93
+ );
81
94
  } else {
82
95
  Alert.alert('Thông báo', response.data?.meta?.errorMessage);
83
96
  }
@@ -3311,4 +3311,20 @@ export class Api {
3311
3311
  return { kind: "bad-data" }
3312
3312
  }
3313
3313
  }
3314
+
3315
+ async confirmLoanDigitalTopup(body) {
3316
+ // make the api call
3317
+ const response: ApiResponse<any> = await this.apisauce.post(`api/v2.0/autodev2/confirm_loan`, body)
3318
+ // the typical ways to die when calling an api
3319
+ if (!response.ok) {
3320
+ const problem = getGeneralApiProblem(response)
3321
+ if (problem) return problem
3322
+ }
3323
+ // transform the data into the format we are expecting
3324
+ try {
3325
+ return { kind: "ok", data: response.data }
3326
+ } catch {
3327
+ return { kind: "bad-data" }
3328
+ }
3329
+ }
3314
3330
  }