Importing core models

Models/POJOs of the dependent service can be imported from digit-core-models library (work on creating library is ongoing). These models will be used in integration with the dependent services.

<dependency> <groupId>org.egov.services</groupId> <artifactId>tracer</artifactId> <version>2.0.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.egov.services</groupId> <artifactId>services-common</artifactId> <version>1.0.1-SNAPSHOT</version> </dependency> <repositories> <repository> <id>repo.egovernments.org</id> <name>eGov ERP Releases Repository</name> <url>https://nexus-repo.egovernments.org/nexus/content/repositories/releases/</url> </repository> <repository> <id>repo.egovernments.org.snapshots</id> <name>eGov ERP Releases Repository</name> <url>https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/</url> </repository> <repository> <id>repo.egovernments.org.public</id> <name>eGov Public Repository Group</name> <url>https://nexus-repo.egovernments.org/nexus/content/groups/public/</url> </repository> </repositories>

These are pre-written libraries which contain tracer support, common models like MDMS, Auth and Auth and capability to raise custom exceptions.

Once these core models are imported, it is safe to delete the RequestInfo, ResponseInfo classes from the models folder and use the ones present under common contract which we just imported.

 

Before starting development, create/update the following classes -

a) Under models folder, create RequestInfoWrapper POJO -

@Getter @Setter @AllArgsConstructor @NoArgsConstructor @Builder public class RequestInfoWrapper { @JsonProperty("RequestInfo") private RequestInfo requestInfo; }

Update the Applicant POJO to have the following content -

@Getter @Setter @AllArgsConstructor @NoArgsConstructor @Builder public class Applicant { @JsonProperty("id") private String id = null; @JsonProperty("userName") private String userName = null; @JsonProperty("password") private String password = null; @JsonProperty("salutation") private String salutation = null; @JsonProperty("name") private String name = null; @JsonProperty("gender") private String gender = null; @JsonProperty("mobileNumber") private String mobileNumber = null; @JsonProperty("emailId") private String emailId = null; @JsonProperty("altContactNumber") private String altContactNumber = null; @JsonProperty("pan") private String pan = null; @JsonProperty("aadhaarNumber") private String aadhaarNumber = null; @JsonProperty("permanentAddress") private String permanentAddress = null; @JsonProperty("permanentCity") private String permanentCity = null; @JsonProperty("permanentPincode") private String permanentPincode = null; @JsonProperty("correspondenceCity") private String correspondenceCity = null; @JsonProperty("correspondencePincode") private String correspondencePincode = null; @JsonProperty("correspondenceAddress") private String correspondenceAddress = null; @JsonProperty("active") private Boolean active = null; @JsonProperty("locale") private String locale = null; @JsonProperty("type") private String type = null; @JsonProperty("signature") private String signature = null; @JsonProperty("accountLocked") private Boolean accountLocked = null; @JsonProperty("roles") @Valid private List<Role> roles = null; @JsonProperty("fatherOrHusbandName") private String fatherOrHusbandName = null; @JsonProperty("bloodGroup") private String bloodGroup = null; @JsonProperty("identificationMark") private String identificationMark = null; @JsonProperty("photo") private String photo = null; @JsonProperty("createdBy") private Long createdBy = null; @JsonProperty("createdDate") private LocalDate createdDate = null; @JsonProperty("lastModifiedBy") private Long lastModifiedBy = null; @JsonProperty("lastModifiedDate") private LocalDate lastModifiedDate = null; @JsonProperty("otpReference") private String otpReference = null; @JsonProperty("tenantId") private String tenantId = null; public Applicant addRolesItem(Role rolesItem) { if (this.roles == null) { this.roles = new ArrayList<>(); } this.roles.add(rolesItem); return this; } }

b) Under config folder, create VTRConfiguration and MainConfiguration classes -