Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable KYC based on the consumption on tfchain #614

Merged
merged 34 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5394515
Fix getting identity full name
AhmedHanafy725 Jun 20, 2024
7f623c7
Fix identity card colors
AhmedHanafy725 Jun 20, 2024
d17990a
Update the user table to have new columns for twin_id, phone, and ide…
AhmedHanafy725 Jun 25, 2024
20b6f65
Fix migration script
AhmedHanafy725 Jun 25, 2024
47d9740
Add method to update the user data on the database
AhmedHanafy725 Jun 25, 2024
e563978
Add route for updating the user data
AhmedHanafy725 Jun 25, 2024
4562bef
Add method for updating the user data in the app
AhmedHanafy725 Jun 25, 2024
4112f84
Use the user update method to update email, phone, and identity after…
AhmedHanafy725 Jun 25, 2024
64e718d
Add tfchain and stellar clients to the app
AhmedHanafy725 Sep 4, 2024
27858cc
Add method for getting the user twin ID
AhmedHanafy725 Sep 4, 2024
8f67692
Add mehtods for setting and getting the twinId from the device storage
AhmedHanafy725 Sep 4, 2024
37a1430
Load twin details while staring the app
AhmedHanafy725 Sep 4, 2024
803bd81
Add chain url to flagsmith
AhmedHanafy725 Sep 4, 2024
f2a501e
Fix casting while saving the twin ID in the device storage
AhmedHanafy725 Sep 4, 2024
f7fa84c
Fix the condition of loading the twin ID
AhmedHanafy725 Sep 4, 2024
ee79c8e
Add spending limit to the flagsmith flags
AhmedHanafy725 Sep 5, 2024
7a3f9fb
Add gridproxy client to the app
AhmedHanafy725 Sep 8, 2024
888894e
Fix loading twin id
AhmedHanafy725 Sep 8, 2024
155f50b
Add method to get the user consumption on tfchain
AhmedHanafy725 Sep 8, 2024
43d691c
Add catch block with error snackbar for loading the twin
AhmedHanafy725 Sep 8, 2024
c2fd97e
Show the phone and identity verification based on the user spending
AhmedHanafy725 Sep 8, 2024
f6d11e4
Add grid proxy url to flagsmith
AhmedHanafy725 Sep 8, 2024
5f0644a
Format the snack bar
AhmedHanafy725 Sep 8, 2024
9236bf5
Use compute to not block the main thread and the ui
AhmedHanafy725 Sep 9, 2024
9f7ebbe
Increase the snackbar duration
AhmedHanafy725 Sep 9, 2024
52ec109
Only update the UI if the spending limit > 0
AhmedHanafy725 Sep 9, 2024
5a2c3e8
Add build runner package and upgrade the packages
AhmedHanafy725 Sep 9, 2024
64ac3a9
Fix opening file helper
AhmedHanafy725 Sep 9, 2024
4ca7b2e
Add the reflectable initializer in gridproxy service
AhmedHanafy725 Sep 9, 2024
8f2a9f5
Fix app config initialized globals
AhmedHanafy725 Sep 9, 2024
743d56b
Make the ui more smoother while getting the user spendings
AhmedHanafy725 Sep 9, 2024
be5ec4c
Remove unnecessairly global variable
AhmedHanafy725 Sep 9, 2024
dc99ee3
Fix check on string from null to isNotEmpty
AhmedHanafy725 Sep 11, 2024
427d5b8
Use symmetric instead of LTRB
AhmedHanafy725 Sep 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -347,4 +347,10 @@ backend/services/__pycache__/productkeys.cpython-39.pyc
backend/services/__pycache__/socket.cpython-39.pyc

*.pyc
.vscode
.vscode

# reflected files
app/lib/main.reflectable.dart

# pubSpec override
app/pubspec_overrides.yaml
3 changes: 3 additions & 0 deletions app/lib/app_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,7 @@ void setFallbackConfigs() {
Globals().redoIdentityVerification = false;
Globals().timeOutSeconds = 10;
Globals().phoneVerification = false;
Globals().chainUrl = '';
Globals().gridproxyUrl = '';
Globals().spendingLimit = 0;
}
4 changes: 3 additions & 1 deletion app/lib/helpers/download_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import 'package:path_provider/path_provider.dart';

// https://www.youtube.com/watch?v=6tfBflFUO7s
Future openFile(File? file) async {
OpenFilex.open(file?.path);
if (file != null && file.path.isNotEmpty) {
OpenFilex.open(file.path);
}
}

Future<File?> downloadFile(String url, String name) async {
Expand Down
6 changes: 6 additions & 0 deletions app/lib/helpers/flags.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ class Flags {
await Flags().hasFlagValueByFeatureName('redo-identity-verification');
Globals().phoneVerification =
await Flags().hasFlagValueByFeatureName('phone-verification');
Globals().chainUrl =
(await Flags().getFlagValueByFeatureName('chain-url'))!;
Globals().gridproxyUrl =
(await Flags().getFlagValueByFeatureName('gridproxy-url'))!;
Globals().spendingLimit = int.parse(
(await Flags().getFlagValueByFeatureName('spending-limit')).toString());
}

Future<bool> hasFlagValueByFeatureName(String name) async {
Expand Down
3 changes: 3 additions & 0 deletions app/lib/helpers/globals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ class Globals {
String tosUrl = '';
bool maintenance = false;
bool phoneVerification = false;
String chainUrl = '';
String gridproxyUrl = '';

bool isCacheClearedWallet = false;
bool isCacheClearedFarmer = false;

int smsSentOn = 0;
int smsMinutesCoolDown = 5;
int spendingLimit = 0;

ValueNotifier<bool> hidePhoneButton = ValueNotifier(false);

Expand Down
3 changes: 2 additions & 1 deletion app/lib/helpers/kyc_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ Future<void> handleKYCData(Map<dynamic, dynamic> emailData,
jsonDecode(identityData['identityDocumentMeta']),
identityData['signedIdentityDocumentMetaIdentifier'],
identityData['identityGender'],
identityData['signedIdentityGenderIdentifier']);
identityData['signedIdentityGenderIdentifier'],
identityData['referenceId']);
}
}

Expand Down
Loading