forked from mosip/resident-services
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOSIP-26844 & fixed code for notification and track service (mosip#878)
* fixed id version for document APIs * update constant names * used constant file_text * added validation on req credential API * added validation for req credential API * removed duplicate code * fixed rid status issue * removed name from enum * code fix for rid status issue * update validate request body method * fixed registration center issue * added notification in validate otp API * fixed authentication request description * removed space * removed validate otp from auth request service type * added notification to get my uin API * added notification in personalised card API * fixed null check * refactor code * fixed code for notify * code refactoring * fixed test case failure * take templatetype code from properties --------- Co-authored-by: Ritik Jain <[email protected]> Signed-off-by: kameshsr <[email protected]>
- Loading branch information
Showing
5 changed files
with
52 additions
and
63 deletions.
There are no files selected for viewing
35 changes: 21 additions & 14 deletions
35
resident/resident-service/src/main/java/io/mosip/resident/constant/AttributeNameEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,39 @@ | ||
package io.mosip.resident.constant; | ||
|
||
import org.springframework.core.env.Environment; | ||
|
||
/** | ||
* @author Kamesh Shekhar Prasad | ||
*/ | ||
public enum AttributeNameEnum { | ||
FULL_NAME("fullName", "mosip.full.name.template.property"), | ||
DATE_OF_BIRTH("dateOfBirth", "mosip.date.of.birth.template.property"), | ||
UIN("UIN", "mosip.uin.template.property"), | ||
PERPETUAL_VID("perpetualVID", "mosip.perpetual.vid.template.property"), | ||
PHONE("phone", "mosip.phone.template.property"), | ||
EMAIL("email", "mosip.email.template.property"), | ||
ADDRESS("addressLine1", "mosip.address.template.property"), | ||
GENDER("gender", "mosip.gender.template.property"), | ||
DEFAULT("Default", "mosip.defualt.template.property"); | ||
FULL_NAME("fullName", "mosip.full.name.template.property.attribute.list"), | ||
DATE_OF_BIRTH("dateOfBirth", "mosip.date.of.birth.template.property.attribute.list"), | ||
UIN("UIN", "mosip.uin.template.property.attribute.list"), | ||
PERPETUAL_VID("perpetualVID", "mosip.perpetual.vid.template.property.attribute.list"), | ||
PHONE("phone", "mosip.phone.template.property.attribute.list"), | ||
EMAIL("email", "mosip.email.template.property.attribute.list"), | ||
ADDRESS("addressLine1", "mosip.address.template.property.attribute.list"), | ||
PROVINCE("province", "mosip.province.template.property.attribute.list"), | ||
CITY("city", "mosip.city.template.property.attribute.list"), | ||
ZONE("zone", "mosip.zone.template.property.attribute.list"), | ||
POSTAL_CODE("postalCode", "mosip.postal.code.template.property.attribute.list"), | ||
REGION("region", "mosip.region.template.property.attribute.list"), | ||
GENDER("gender", "mosip.gender.template.property.attribute.list"), | ||
DEFAULT("Default", "mosip.defualt.template.property.attribute.list"); | ||
private String attributeValue; | ||
private String templatePropertyName; | ||
AttributeNameEnum(String name, String templatePropertyName){ | ||
this.attributeValue = name; | ||
this.templatePropertyName = templatePropertyName; | ||
} | ||
|
||
public static String getTemplatePropertyName(String attributeName) { | ||
for (AttributeNameEnum authenticationModeEnum : values()) { | ||
if (authenticationModeEnum.attributeValue.equalsIgnoreCase(attributeName)) { | ||
return authenticationModeEnum.templatePropertyName; | ||
public static String getTemplatePropertyName(String attributeName, Environment env) { | ||
for (AttributeNameEnum attributeNameEnum : values()) { | ||
if (attributeNameEnum.attributeValue.equalsIgnoreCase(attributeName)) { | ||
return env.getProperty(attributeNameEnum.templatePropertyName); | ||
} | ||
} | ||
return AttributeNameEnum.DEFAULT.templatePropertyName; | ||
return env.getProperty(AttributeNameEnum.DEFAULT.templatePropertyName); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters