Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -129,6 +129,7 @@ public class RegistrationConstants {
public static final String PWORD_LENGTH = "mosip.registration.username_pwd_length";
public static final String DOC_SIZE = "mosip.registration.document_size";
public static final String MAX_AGE = "mosip.registration.max_age";
public static final String FIELDS_TO_RETAIN_ON_PRID_FETCH = "mosip.registration.fields.to.retain.post.prid.fetch";
public static final String HTTP_API_READ_TIMEOUT = "mosip.registration.HTTP_API_READ_TIMEOUT";
public static final String HTTP_API_WRITE_TIMEOUT = "mosip.registration.HTTP_API_WRITE_TIMEOUT";
public static final String REG_PAK_MAX_TIME_APPRV_LIMIT = "mosip.registration.reg_pak_max_time_apprv_limit";
Expand All @@ -146,4 +147,5 @@ public class RegistrationConstants {
public static final String APP_ID = "mosip.registration.audit_application_id";
public static final String DEFAULT_HOST_IP = "mosip.registration.audit_default_host_ip";
public static final String DEFAULT_HOST_NAME = "mosip.registration.audit_default_host_name";
public static final String REG_PAK_MAX_CNT_APPRV_LIMIT = "mosip.registration.reg_pak_max_cnt_apprv_limit";
}
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,30 @@ public List<String> getSelectedLanguages() {

public OperatorDto getMaker() { return maker; }

public void retainConfiguredFields(String config) {
List<String> keysToRetain = config == null ? Collections.EMPTY_LIST : List.of(config.split(RegistrationConstants.COMMA));

// If no fields are configured to retain, clear all fields
if (keysToRetain.isEmpty()) {
this.demographics.clear();
this.documents.clear();
this.biometrics.clear();
return;
}

// Remove fields that are NOT in the configured list to retain
Set<String> allKeys = new HashSet<>();
allKeys.addAll(this.demographics.keySet());
allKeys.addAll(this.documents.keySet());

for (String key : allKeys) {
if (!keysToRetain.contains(key)) {
this.demographics.remove(key);
this.documents.remove(key);
}
}
}

public void cleanup() {
this.demographics.clear();
this.documents.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ public String getCachedStringDefaultHostName() {
return globalParamMap.get(RegistrationConstants.DEFAULT_HOST_NAME);
}

public String getCachedStringFieldsToRetainOnPridFetch(){
return globalParamMap.get(RegistrationConstants.FIELDS_TO_RETAIN_ON_PRID_FETCH);
}

public int getCachedIntRegMaxCountApproveLimit(){
return getCachedIntegerGlobalParam(RegistrationConstants.REG_PAK_MAX_CNT_APPRV_LIMIT);
}
/**
* Refresh configuration cache by merging global params with local preferences
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,24 @@ public boolean isMaxPacketCountLimitReached() {
}
}

@Override
public boolean validatingRegisteredPacketNotApproveCount() {
try {
int maxCount = globalParamRepository.getCachedIntRegMaxCountApproveLimit();
if (maxCount <= 0) {
return false;
}

int registeredPacketCount = registrationRepository.getAllRegistrationByStatus(PacketClientStatus.CREATED.name());

return registeredPacketCount >= maxCount;

} catch (Exception ex) {
Log.e(TAG, "Failed to validate registered packet count", ex);
return false;
}
}

@Override
public void deleteRegistrationPackets() {
Log.i(TAG, "Starting registration packet deletion job");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,11 @@ private void doPreChecksBeforeRegistration(CenterMachineDto centerMachineDto) th
if (packetService != null && packetService.isMaxPacketCountLimitReached()) {
throw new ClientCheckedException("PAK_UPLOAD_MAX_COUNT");
}

// validate registered packet not approved count
if (packetService != null && packetService.validatingRegisteredPacketNotApproveCount()) {
throw new ClientCheckedException("REG_PKT_APPRVL_CNT_EXCEED");
}
}

private byte[] convertImageToPDF(List<byte[]> images) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,7 @@ private void parseDemographicJson(String jsonString) throws RegBaseCheckedExcept
//Always use latest schema, ignoring missing / removed fields
RegistrationDto registrationDto = this.registrationService.getRegistrationDto();
List<FieldSpecDto> fieldList = this.identitySchemaService.getAllFieldSpec(appContext, registrationDto.getSchemaVersion());
this.registrationService.getRegistrationDto().getDocuments().clear();
this.registrationService.getRegistrationDto().getDemographics().clear();
this.registrationService.getRegistrationDto().retainConfiguredFields(globalParamRepository.getCachedStringFieldsToRetainOnPridFetch());

for(FieldSpecDto field : fieldList) {
if(field.getId().equalsIgnoreCase("IDSchemaVersion"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,11 @@ public interface PacketService {
*/
boolean isMaxPacketCountLimitReached();

/**
* Validate if the count of registered packets pending approval has reached the configured maximum limit.
* @return true if maximum registered packet count limit is reached, otherwise false.
*/
boolean validatingRegisteredPacketNotApproveCount();

void deleteRegistrationPackets();
}
2 changes: 1 addition & 1 deletion assets/l10n/app_ar.arb
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
"logout_success": "لقد تم تسجيل بنجاح!",
"logout_failure": "حدث خطأ ما، يرجى المحاولة مرة أخرى بعد مرور بعض الوقت",
"go_to_home": "اذهب إلى المنزل",
"errors": "{messages, select, REG_TRY_AGAIN{فشل تسجيل الدخول. حاول مرة أخرى!} REG_INVALID_REQUEST{كلمة المرور غير صحيحة!} REG_MACHINE_NOT_FOUND{لم يتم تسجيل هذا الجهاز بعد. يرجى التواصل مع المسؤول للحصول على المساعدة!} REG_NETWORK_ERROR{فشل تسجيل الدخول. تحقق من اتصال الشبكة!} REG_CRED_EXPIRED{لم يتم العثور على بيانات الاعتماد أو انتهت صلاحيتها. يرجى محاولة تسجيل الدخول عبر الإنترنت!} REG_MACHINE_INACTIVE{الآلة غير نشطة!} REG_CENTER_INACTIVE{المركز غير نشط!} REG_LOGIN_LOCKED{تم الوصول إلى الحد الأقصى لمحاولة تسجيل الدخول. حاول مرة أخرى لاحقا!} KER_SYN_AUTH_001{تعذر الحصول على رمز المصادقة!} PAK_APPRVL_MAX_TIME{الإجراء المطلوب: لقد تجاوزت الحزم المسجلة المعلقة وقت الموافقة المسموح به. يرجى مسح التراكم للمتابعة.} PAK_UPLOAD_MAX_TIME{الإجراء المطلوب: تحميل الحزم أو تصديرها إلى الخادم قبل متابعة التسجيل.} PAK_UPLOAD_MAX_COUNT{الإجراء المطلوب: تم الوصول إلى الحد الأقصى للحزمة. الرجاء تصدير أو تحميل الحزم الموجودة قبل إنشاء تسجيلات جديدة.} other{'Some error occurred!'}}",
"errors": "{messages, select, REG_TRY_AGAIN{فشل تسجيل الدخول. حاول مرة أخرى!} REG_INVALID_REQUEST{كلمة المرور غير صحيحة!} REG_MACHINE_NOT_FOUND{لم يتم تسجيل هذا الجهاز بعد. يرجى التواصل مع المسؤول للحصول على المساعدة!} REG_NETWORK_ERROR{فشل تسجيل الدخول. تحقق من اتصال الشبكة!} REG_CRED_EXPIRED{لم يتم العثور على بيانات الاعتماد أو انتهت صلاحيتها. يرجى محاولة تسجيل الدخول عبر الإنترنت!} REG_MACHINE_INACTIVE{الآلة غير نشطة!} REG_CENTER_INACTIVE{المركز غير نشط!} REG_LOGIN_LOCKED{تم الوصول إلى الحد الأقصى لمحاولة تسجيل الدخول. حاول مرة أخرى لاحقا!} KER_SYN_AUTH_001{تعذر الحصول على رمز المصادقة!} PAK_APPRVL_MAX_TIME{الإجراء المطلوب: لقد تجاوزت الحزم المسجلة المعلقة وقت الموافقة المسموح به. يرجى مسح التراكم للمتابعة.} PAK_UPLOAD_MAX_TIME{الإجراء المطلوب: تحميل الحزم أو تصديرها إلى الخادم قبل متابعة التسجيل.} PAK_UPLOAD_MAX_COUNT{الإجراء المطلوب: تم الوصول إلى الحد الأقصى للحزمة. الرجاء تصدير أو تحميل الحزم الموجودة قبل إنشاء تسجيلات جديدة.} REG_PKT_APPRVL_CNT_EXCEED{تم الوصول إلى الحد الأقصى لعدد حزم التسجيل المعلقة للموافقة على العميل. يرجى الموافقة على الحزم أو رفضها قبل متابعة هذا التسجيل.} other{'Some error occurred!'}}",
"@errors": {
"description": "Error messages",
"placeholders": {
Expand Down
2 changes: 1 addition & 1 deletion assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
"logout_success": "You have been successfully logged out!",
"logout_failure": "Something went wrong, please try again after some time",
"go_to_home": "Go To Home",
"errors": "{messages, select, REG_TRY_AGAIN{Login Failed. Try Again!} REG_INVALID_REQUEST{Password incorrect!} REG_MACHINE_NOT_FOUND{This device has not been onboarded yet. Please reach out to your administrator for assistance!} REG_NETWORK_ERROR{Login failed. Check network connection!} REG_CRED_EXPIRED{Credentials not found or are expired. Please try online login!} REG_MACHINE_INACTIVE{Machine is not active!} REG_CENTER_INACTIVE{Center is not active!} REG_LOGIN_LOCKED{Maximum login attempt limit reached. Try again later!} KER_SYN_AUTH_001{Unable to get Authentication Token!} PAK_APPRVL_MAX_TIME{Action required: Pending registered packets have exceeded the allowed approval time. Please clear the backlog to continue.} PAK_UPLOAD_MAX_TIME{Action required: Upload or export the packets to the server before proceeding with registration.} PAK_UPLOAD_MAX_COUNT{Action required: Packet limit reached. Please export or upload existing packets before creating new registrations.} other{'Some error occurred!'}}",
"errors": "{messages, select, REG_TRY_AGAIN{Login Failed. Try Again!} REG_INVALID_REQUEST{Password incorrect!} REG_MACHINE_NOT_FOUND{This device has not been onboarded yet. Please reach out to your administrator for assistance!} REG_NETWORK_ERROR{Login failed. Check network connection!} REG_CRED_EXPIRED{Credentials not found or are expired. Please try online login!} REG_MACHINE_INACTIVE{Machine is not active!} REG_CENTER_INACTIVE{Center is not active!} REG_LOGIN_LOCKED{Maximum login attempt limit reached. Try again later!} KER_SYN_AUTH_001{Unable to get Authentication Token!} PAK_APPRVL_MAX_TIME{Action required: Pending registered packets have exceeded the allowed approval time. Please clear the backlog to continue.} PAK_UPLOAD_MAX_TIME{Action required: Upload or export the packets to the server before proceeding with registration.} PAK_UPLOAD_MAX_COUNT{Action required: Packet limit reached. Please export or upload existing packets before creating new registrations.} REG_PKT_APPRVL_CNT_EXCEED{Maximum number of registration packets pending approval on client reached. Please approve or reject packets before proceeding with this registration.} other{'Some error occurred!'}}",
"@errors": {
"description": "Error messages",
"placeholders": {
Expand Down
2 changes: 1 addition & 1 deletion assets/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
"logout_success": "Vous avez été déconnecté avec succès!",
"logout_failure": "Quelque chose s'est mal passé, veuillez réessayer après un certain temps",
"go_to_home": "Aller à la maison",
"errors": "{messages, select, REG_TRY_AGAIN{Echec de la connexion.. Réessayez!} REG_INVALID_REQUEST{Mot de passe incorrect!} REG_MACHINE_NOT_FOUND{Cet appareil n’a pas encore été intégré. Veuillez contacter votre administrateur pour obtenir de l’aide !} REG_NETWORK_ERROR{Échec de la connexion. Vérifiez la connexion réseau!} REG_CRED_EXPIRED{Les informations d’identification sont introuvables ou ont expiré. S’il vous plaît essayer la connexion en ligne!} REG_MACHINE_INACTIVE{La machine n'est pas active!} REG_CENTER_INACTIVE{Le centre n'est pas actif!} REG_LOGIN_LOCKED{Limite maximale de tentatives de connexion atteinte. Réessayez plus tard!} KER_SYN_AUTH_001{Impossible d’obtenir le jeton d’authentification!} PAK_APPRVL_MAX_TIME{Action requise : les paquets enregistrés en attente ont dépassé le délai d'approbation autorisé. Veuillez éliminer l'arriéré pour continuer.} PAK_UPLOAD_MAX_TIME{Action requise : Téléchargez ou exportez les paquets vers le serveur avant de procéder à l'enregistrement.} PAK_UPLOAD_MAX_COUNT{Action requise : limite de paquets atteinte. Veuillez exporter ou télécharger les paquets existants avant de créer de nouvelles inscriptions.} other{'Some error occurred!'}}",
"errors": "{messages, select, REG_TRY_AGAIN{Echec de la connexion.. Réessayez!} REG_INVALID_REQUEST{Mot de passe incorrect!} REG_MACHINE_NOT_FOUND{Cet appareil n’a pas encore été intégré. Veuillez contacter votre administrateur pour obtenir de l’aide !} REG_NETWORK_ERROR{Échec de la connexion. Vérifiez la connexion réseau!} REG_CRED_EXPIRED{Les informations d’identification sont introuvables ou ont expiré. S’il vous plaît essayer la connexion en ligne!} REG_MACHINE_INACTIVE{La machine n'est pas active!} REG_CENTER_INACTIVE{Le centre n'est pas actif!} REG_LOGIN_LOCKED{Limite maximale de tentatives de connexion atteinte. Réessayez plus tard!} KER_SYN_AUTH_001{Impossible d’obtenir le jeton d’authentification!} PAK_APPRVL_MAX_TIME{Action requise : les paquets enregistrés en attente ont dépassé le délai d'approbation autorisé. Veuillez éliminer l'arriéré pour continuer.} PAK_UPLOAD_MAX_TIME{Action requise : Téléchargez ou exportez les paquets vers le serveur avant de procéder à l'enregistrement.} PAK_UPLOAD_MAX_COUNT{Action requise : limite de paquets atteinte. Veuillez exporter ou télécharger les paquets existants avant de créer de nouvelles inscriptions.} REG_PKT_APPRVL_CNT_EXCEED{Le nombre maximum de paquets d'enregistrement en attente d'approbation sur le client a été atteint. Veuillez approuver ou rejeter les paquets avant de procéder à cette inscription.} other{'Some error occurred!'}}",
"@errors": {
"description": "Error messages",
"placeholders": {
Expand Down
2 changes: 1 addition & 1 deletion assets/l10n/app_hi.arb
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
"logout_success": "आप सफलता पूर्वक लॉगआउट कर चुके हैं!",
"logout_failure": "कुछ गलती हो गई है, कृपया कुछ समय बाद पुनः प्रयास करें",
"go_to_home": "होम पर जाएं",
"errors": "{messages, select, REG_TRY_AGAIN{लॉगिन विफल रहा। फिर कोशिश करो!} REG_INVALID_REQUEST{पासवर्ड गलत है!} REG_MACHINE_NOT_FOUND{इस डिवाइस का ऑनबोर्डिंग अभी तक नहीं हुआ है। सहायता के लिए कृपया अपने प्रशासक से संपर्क करें!} REG_NETWORK_ERROR{लॉगिन विफल रहा। नेटवर्क कनेक्शन की जाँच करें!} REG_CRED_EXPIRED{क्रेडेंशियल्स नहीं मिले या समय सीमा समाप्त हो गई है. ऑनलाइन लॉगिन का प्रयास करें!} REG_MACHINE_INACTIVE{मशीन सक्रिय नहीं है!} REG_CENTER_INACTIVE{केंद्र सक्रिय नहीं है!} REG_LOGIN_LOCKED{अधिकतम लॉगिन प्रयास सीमा पूरी हो गई. बाद में पुन: प्रयास!} KER_SYN_AUTH_001{प्रमाणीकरण टोकन प्राप्त करने में असमर्थ!} PAK_APPRVL_MAX_TIME{कार्रवाई आवश्यक: लंबित पंजीकृत पैकेट स्वीकृत अनुमोदन समय से अधिक हो गए हैं। कृपया जारी रखने के लिए बैकलॉग साफ़ करें।} PAK_UPLOAD_MAX_TIME{कार्रवाई आवश्यक: पंजीकरण के साथ आगे बढ़ने से पहले पैकेट को सर्वर पर अपलोड या निर्यात करें।} PAK_UPLOAD_MAX_COUNT{कार्रवाई आवश्यक: पैकेट की सीमा पूरी हो गई. कृपया नए पंजीकरण बनाने से पहले मौजूदा पैकेट निर्यात या अपलोड करें।} other{'Some error occurred!'}}",
"errors": "{messages, select, REG_TRY_AGAIN{लॉगिन विफल रहा। फिर कोशिश करो!} REG_INVALID_REQUEST{पासवर्ड गलत है!} REG_MACHINE_NOT_FOUND{इस डिवाइस का ऑनबोर्डिंग अभी तक नहीं हुआ है। सहायता के लिए कृपया अपने प्रशासक से संपर्क करें!} REG_NETWORK_ERROR{लॉगिन विफल रहा। नेटवर्क कनेक्शन की जाँच करें!} REG_CRED_EXPIRED{क्रेडेंशियल्स नहीं मिले या समय सीमा समाप्त हो गई है. ऑनलाइन लॉगिन का प्रयास करें!} REG_MACHINE_INACTIVE{मशीन सक्रिय नहीं है!} REG_CENTER_INACTIVE{केंद्र सक्रिय नहीं है!} REG_LOGIN_LOCKED{अधिकतम लॉगिन प्रयास सीमा पूरी हो गई. बाद में पुन: प्रयास!} KER_SYN_AUTH_001{प्रमाणीकरण टोकन प्राप्त करने में असमर्थ!} PAK_APPRVL_MAX_TIME{कार्रवाई आवश्यक: लंबित पंजीकृत पैकेट स्वीकृत अनुमोदन समय से अधिक हो गए हैं। कृपया जारी रखने के लिए बैकलॉग साफ़ करें।} PAK_UPLOAD_MAX_TIME{कार्रवाई आवश्यक: पंजीकरण के साथ आगे बढ़ने से पहले पैकेट को सर्वर पर अपलोड या निर्यात करें।} PAK_UPLOAD_MAX_COUNT{कार्रवाई आवश्यक: पैकेट की सीमा पूरी हो गई. कृपया नए पंजीकरण बनाने से पहले मौजूदा पैकेट निर्यात या अपलोड करें।} REG_PKT_APPRVL_CNT_EXCEED{क्लाइंट पर अनुमोदन के लिए लंबित पंजीकरण पैकेट की अधिकतम संख्या पूरी हो गई है। कृपया इस पंजीकरण के साथ आगे बढ़ने से पहले पैकेट को स्वीकृत या अस्वीकार करें।} other{'Some error occurred!'}}",
"@errors": {
"description": "Error messages",
"placeholders": {
Expand Down
Loading