Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,43 @@ public void getGpsEnableFlag(@NonNull GlobalConfigSettingsPigeon.Result<String>
}
result.success(gpsFlag);
}

@Override
public void getPRIDLength(@NonNull GlobalConfigSettingsPigeon.Result<Long> result) {
int pridLength = 0;
try {
pridLength = globalParamRepository.getCachedIntegerPRIDLength();
} catch (Exception e) {
Log.e(getClass().getSimpleName(), "Error fetching PRID length", e);
result.error(e);
}
result.success((long) pridLength);
}

@Override
public void getUINLength(@NonNull GlobalConfigSettingsPigeon.Result<Long> result) {
int uinLength = 0;
try {
uinLength = globalParamRepository.getCachedIntegerUINLength();
} catch (Exception e) {
Log.e(getClass().getSimpleName(), "Error fetching UIN length", e);
result.error(e);
}
result.success((long) uinLength);
}

@Override
public void getVIDLength(@NonNull GlobalConfigSettingsPigeon.Result<Long> result) {
int vidLength = 0;
try {
vidLength = globalParamRepository.getCachedIntegerVIDLength();
} catch (Exception e) {
Log.e(getClass().getSimpleName(), "Error fetching VID length", e);
result.error(e);
}
result.success((long) vidLength);

}


}
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ public class RegistrationConstants {
public static final String REG_PAK_MAX_CNT_OFFLINE_FREQ = "mosip.registration.packet.maximum.count.offline.frequency";
public static final String INVALID_LOGIN_COUNT = "mosip.registration.invalid_login_count";
public static final String INVALID_LOGIN_TIME = "mosip.registration.invalid_login_time";
public static final String DISK_SPACE = "mosip.registration.disk_space_size";
public static final String PRID_LENGTH = "mosip.kernel.prid.length";
public static final String UIN_LENGTH = "mosip.kernel.uin.length";
public static final String VID_LENGTH = "mosip.kernel.vid.length";
public static final String SUPERVISOR_APPROVAL_CONFIG_FLAG = "mosip.registration.supervisor_approval_config_flag";
public static final String DOC_TYPE = "mosip.registration.document_scanner_doctype";
public static final String APP_NAME = "mosip.registration.audit_application_name";
public static final String APP_ID = "mosip.registration.audit_application_id";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,21 @@ public String getCachedStringInvalidLoginTime() {
return globalParamMap.get(RegistrationConstants.INVALID_LOGIN_TIME);
}

public int getCachedIntegerDiskSpaceSize() {
return getCachedIntegerGlobalParam(RegistrationConstants.DISK_SPACE);
}

public int getCachedIntegerPRIDLength(){
return getCachedIntegerGlobalParam(RegistrationConstants.PRID_LENGTH);
}

public int getCachedIntegerUINLength(){
return getCachedIntegerGlobalParam(RegistrationConstants.UIN_LENGTH);
}

public int getCachedIntegerVIDLength(){
return getCachedIntegerGlobalParam(RegistrationConstants.VID_LENGTH);
}
Comment thread
This conversation was marked as resolved.
public String getCachedStringDocType() {
return globalParamMap.get(RegistrationConstants.DOC_TYPE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import io.mosip.registration.clientmanager.R;
import io.mosip.registration.clientmanager.config.SessionManager;
import io.mosip.registration.clientmanager.constant.Modality;
import io.mosip.registration.clientmanager.constant.PacketClientStatus;
import io.mosip.registration.clientmanager.constant.RegistrationConstants;
import io.mosip.registration.clientmanager.dto.CenterMachineDto;
import io.mosip.registration.clientmanager.dto.ResponseDto;
Expand Down Expand Up @@ -97,7 +98,7 @@ public class RegistrationServiceImpl implements RegistrationService {

private static final String TAG = RegistrationServiceImpl.class.getSimpleName();
private static final String SOURCE = "REGISTRATION_CLIENT";
private static final int MIN_SPACE_REQUIRED_MB = 50;
private static final int DEFAULT_MIN_SPACE_REQUIRED_MB = 50;

private Context context;
private RegistrationDto registrationDto;
Expand Down Expand Up @@ -320,6 +321,14 @@ public void submitRegistrationDto(String makerName) throws Exception {
registrationRepository.insertRegistration(this.registrationDto.getPacketId(), containerPath,
centerMachineDto.getCenterId(), this.registrationDto.getProcess(), additionalInfo, this.registrationDto.getAdditionalInfoRequestId(), this.registrationDto.getRId(), this.registrationDto.getApplicationId());

// Auto-approve when supervisor approval is disabled (flag not "Y")
String supervisorApprovalFlag = globalParamRepository.getCachedStringGlobalParam(
RegistrationConstants.SUPERVISOR_APPROVAL_CONFIG_FLAG);
if (supervisorApprovalFlag != null && !RegistrationConstants.ENABLE.equalsIgnoreCase(supervisorApprovalFlag.trim())) {
registrationRepository.updateStatus(this.registrationDto.getPacketId(), null,
Comment thread
MadhuMosip marked this conversation as resolved.
PacketClientStatus.APPROVED.name());
}

// Delete pre-registration record after successful packet creation
if (this.registrationDto.getPreRegistrationId() != null
&& !this.registrationDto.getPreRegistrationId().trim().isEmpty()) {
Expand Down Expand Up @@ -634,8 +643,13 @@ public List<Map<String, String>> getAudits() {

private void doPreChecksBeforeRegistration(CenterMachineDto centerMachineDto) throws Exception {
//free space validation
int minSpaceRequiredMB = globalParamRepository.getCachedIntegerDiskSpaceSize();
if (minSpaceRequiredMB == 0) {
minSpaceRequiredMB = DEFAULT_MIN_SPACE_REQUIRED_MB;
}

long externalSpace = context.getExternalCacheDir().getUsableSpace();
if ((externalSpace / (1024 * 1024)) < MIN_SPACE_REQUIRED_MB)
if ((externalSpace / (1024 * 1024)) < minSpaceRequiredMB)
Comment thread
This conversation was marked as resolved.
throw new ClientCheckedException(context, R.string.err_006);

//is machine and center active
Expand Down
8 changes: 8 additions & 0 deletions assets/l10n/app_ar.arb
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,14 @@
"application_id_not_exist": "معرف التطبيق غير موجود!",
"correct_application_id": "يرجى التحقق من معرف التطبيق الذي تم إدخاله أو إدخال معرف صحيح ومحاولة جلبه مرة أخرى.",
"enter_application_id": "الرجاء إدخال معرف التطبيق",
"prid_length_greater": "يجب أن يتكون معرف التطبيق من أرقام {length} بالضبط",
"@prid_length_greater": {
"placeholders": {
"length": {
"type": "int"
}
}
},
"okay": "تمام",
"no_internet_connection": "لا يوجد اتصال بالإنترنت!",
"connect_and_retry": "يرجى الاتصال بالإنترنت وإعادة المحاولة.",
Expand Down
8 changes: 8 additions & 0 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,14 @@
"application_id_not_exist": "Application ID does not exist!",
"correct_application_id": "Please check the entered Application ID or enter a correct ID and try to fetch it again.",
"enter_application_id": "Please Enter Application ID",
"prid_length_greater": "Application ID must be exactly {length} digits.",
"@prid_length_greater": {
"placeholders": {
"length": {
"type": "int"
}
}
},
"okay": "OKAY",
"no_internet_connection": "No Internet Connection!",
"connect_and_retry": "Please connect with internet and retry.",
Expand Down
8 changes: 8 additions & 0 deletions assets/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,14 @@
"application_id_not_exist": "L'ID de l'application n'existe pas!",
"correct_application_id": "Veuillez vérifier l'ID d'application saisi ou saisir un ID correct et essayer de le récupérer à nouveau.",
"enter_application_id": "Veuillez saisir l'ID de la demande",
"prid_length_greater": "L'ID de l'application doit contenir exactement {length} chiffres",
"@prid_length_greater": {
"placeholders": {
"length": {
"type": "int"
}
}
},
"okay": "D'ACCORD",
"no_internet_connection": "Pas de connexion Internet!",
"connect_and_retry": "Veuillez vous connecter à Internet et réessayer.",
Expand Down
8 changes: 8 additions & 0 deletions assets/l10n/app_hi.arb
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,14 @@
"application_id_not_exist": "एप्लिकेशन आईडी मौजूद नहीं है!",
"correct_application_id": "कृपया दर्ज की गई एप्लिकेशन आईडी की जांच करें या सही आईडी दर्ज करें और इसे दोबारा लाने का प्रयास करें।",
"enter_application_id": "कृपया आवेदन आईडी दर्ज करें",
"prid_length_greater": "एप्लिकेशन आईडी बिल्कुल {length} अंकों की होनी चाहिए।",
"@prid_length_greater": {
"placeholders": {
"length": {
"type": "int"
}
}
},
"okay": "ठीक है",
"no_internet_connection": "कोई इंटरनेट कनेक्शन नहीं!",
"connect_and_retry": "कृपया इंटरनेट से जुड़ें और पुनः प्रयास करें।",
Expand Down
8 changes: 8 additions & 0 deletions assets/l10n/app_kn.arb
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,14 @@
"application_id_not_exist": "ಅಪ್ಲಿಕೇಶನ್ ಐಡಿ ಅಸ್ತಿತ್ವದಲ್ಲಿಲ್ಲ!",
"correct_application_id": "ದಯವಿಟ್ಟು ನಮೂದಿಸಿದ ಅಪ್ಲಿಕೇಶನ್ ಐಡಿಯನ್ನು ಪರಿಶೀಲಿಸಿ ಅಥವಾ ಸರಿಯಾದ ಐಡಿಯನ್ನು ನಮೂದಿಸಿ ಮತ್ತು ಅದನ್ನು ಮತ್ತೆ ಪಡೆಯಲು ಪ್ರಯತ್ನಿಸಿ.",
"enter_application_id": "ದಯವಿಟ್ಟು ಅಪ್ಲಿಕೇಶನ್ ಐಡಿಯನ್ನು ನಮೂದಿಸಿ",
"prid_length_greater": "ಅಪ್ಲಿಕೇಶನ್ ID ನಿಖರವಾಗಿ {length} ಅಂಕೆಗಳಾಗಿರಬೇಕು.",
"@prid_length_greater": {
"placeholders": {
"length": {
"type": "int"
}
}
},
"okay": "ಸರಿ",
"no_internet_connection": "ಇಂಟರ್ನೆಟ್ ಸಂಪರ್ಕವಿಲ್ಲ!",
"connect_and_retry": "ದಯವಿಟ್ಟು ಇಂಟರ್ನೆಟ್\u200Cನೊಂದಿಗೆ ಸಂಪರ್ಕಿಸಿ ಮತ್ತು ಮರುಪ್ರಯತ್ನಿಸಿ.",
Expand Down
8 changes: 8 additions & 0 deletions assets/l10n/app_ta.arb
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,14 @@
"application_id_not_exist": "விண்ணப்ப ஐடி இல்லை",
"correct_application_id": "உள்ளிட்ட விண்ணப்ப ஐடியைச் சரிபார்க்கவும் அல்லது சரியான ஐடியை உள்ளிட்டு, அதை மீண்டும் பெற முயற்சிக்கவும்.",
"enter_application_id": "விண்ணப்ப ஐடியை உள்ளிடவும்",
"prid_length_greater": "விண்ணப்ப ஐடி சரியாக {length} இலக்கங்களாக இருக்க வேண்டும்.",
"@prid_length_greater": {
"placeholders": {
"length": {
"type": "int"
}
}
},
"okay": "சரி",
"no_internet_connection": "இணைய இணைப்பு இல்லை!",
"connect_and_retry": "இணையத்துடன் இணைத்து மீண்டும் முயற்சிக்கவும்.",
Expand Down
39 changes: 39 additions & 0 deletions lib/platform_android/global_config_service_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,45 @@ class GlobalConfigServiceImpl implements GlobalConfigService {
return gpsEnableFlag;
}

@override
Future<int> getPRIDLength() async {
int pridLength = 0;
try {
pridLength = await GlobalConfigSettingsApi().getPRIDLength();
} on PlatformException {
debugPrint("PRID Length Api failed!");
} catch (e) {
debugPrint("PRID Length fetch error: $e");
}
return pridLength;
}

@override
Future<int> getUINLength() async {
int uinLength = 0;
try {
uinLength = await GlobalConfigSettingsApi().getUINLength();
} on PlatformException {
debugPrint("UIN Length Api failed!");
} catch (e) {
debugPrint("UIN Length fetch error: $e");
}
return uinLength;
}

@override
Future<int> getVIDLength() async {
int vidLength = 0;
try {
vidLength = await GlobalConfigSettingsApi().getVIDLength();
} on PlatformException {
debugPrint("VID Length Api failed!");
} catch (e) {
debugPrint("VID Length fetch error: $e");
}
return vidLength;
}

}

GlobalConfigService getGlobalConfigServiceImpl() => GlobalConfigServiceImpl();
6 changes: 6 additions & 0 deletions lib/platform_spi/global_config_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ abstract class GlobalConfigService {

Future<String> getGpsEnableFlag();

Future<int> getPRIDLength();

Future<int> getUINLength();

Future<int> getVIDLength();

factory GlobalConfigService() => getGlobalConfigServiceImpl();
}
26 changes: 26 additions & 0 deletions lib/provider/global_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ class GlobalProvider with ChangeNotifier {
_checkAgeGroupChange = value;
}

int? _pridLength;
int? _uinLength;
int? _vidLength;

//GettersSetters
setScannedPages(String field, List<Uint8List?> value) {
_scannedPages[field] = value;
Expand All @@ -146,6 +150,10 @@ class GlobalProvider with ChangeNotifier {

String get ageGroup => _ageGroup;

int? get pridLength => _pridLength;
int? get uinLength => _uinLength;
int? get vidLength => _vidLength;

set scannedPages(Map<String, List<Uint8List?>> value) {
_scannedPages = value;
notifyListeners();
Expand Down Expand Up @@ -500,6 +508,24 @@ class GlobalProvider with ChangeNotifier {
}
}

getPRIDLength() async {
int length = await globalConfigService.getPRIDLength();
_pridLength = length == 0 ? 14 : length;
notifyListeners();
}

getUINLength() async {
int length = await globalConfigService.getUINLength();
_uinLength = length == 0 ? 10 : length;
notifyListeners();
}

getVIDLength() async {
int length = await globalConfigService.getVIDLength();
_vidLength = length == 0 ? 16 : length;
notifyListeners();
}
Comment thread
MadhuMosip marked this conversation as resolved.

chooseLanguage(Map<String, String> label) {
String x = '';
for (var i in chosenLang) {
Expand Down
Loading