-
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.
- Loading branch information
Showing
8 changed files
with
294 additions
and
0 deletions.
There are no files selected for viewing
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
37 changes: 37 additions & 0 deletions
37
...vice/src/main/java/io/mosip/preregistration/application/repository/LostUINRepository.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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package io.mosip.preregistration.application.repository; | ||
|
||
import java.util.List; | ||
|
||
import javax.transaction.Transactional; | ||
|
||
import org.springframework.data.jpa.repository.Modifying; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import io.mosip.kernel.core.dataaccess.spi.repository.BaseRepository; | ||
import io.mosip.preregistration.core.common.entity.LostUINEntity; | ||
|
||
|
||
/** | ||
* | ||
** This repository interface is used to define the JPA methods for LostUINRepository | ||
* | ||
* @author Joel K | ||
* @since 1.0.0 | ||
* | ||
*/ | ||
@Repository | ||
@Transactional | ||
public interface LostUINRepository extends BaseRepository<LostUINEntity, String> { | ||
|
||
@Query("SELECT e FROM LostUINEntity e WHERE e.crBy= ?1 order by e.crDtime desc") | ||
public List<LostUINEntity> findByCreatedBy(String userId); | ||
|
||
@Modifying | ||
@Query("DELETE FROM ApplicationEntity e WHERE e.applicationId = ?1") | ||
public void deleteById(int applicationId); | ||
|
||
@Modifying | ||
@Query(value = "INSERT INTO application_replacements (replacement_id, demographic_id, application_id, lang_code, cr_by) VALUES (?, ?, ?, ?, ?)", nativeQuery = true) | ||
LostUINEntity save(Integer replacementId, String demographicId, String applicationId, String langCode, String userId); | ||
} |
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
37 changes: 37 additions & 0 deletions
37
...ration-core/src/main/java/io/mosip/preregistration/application/dto/LostUINRequestDTO.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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package io.mosip.preregistration.application.dto; | ||
|
||
import java.io.Serializable; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
|
||
/** | ||
* This DTO class defines the variables to accept the input parameter from | ||
* request. | ||
* | ||
* @author Joel K | ||
* @since 1.2.0 | ||
* | ||
*/ | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@ToString | ||
public class LostUINRequestDTO implements Serializable { | ||
|
||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 686366342082625076L; | ||
/** | ||
* language code | ||
*/ | ||
private String langCode; | ||
|
||
// pre pre registration ID | ||
private String preregistrationId; | ||
|
||
} |
64 changes: 64 additions & 0 deletions
64
...ation-core/src/main/java/io/mosip/preregistration/application/dto/LostUINResponseDTO.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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package io.mosip.preregistration.application.dto; | ||
|
||
import java.io.Serializable; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
/** | ||
* | ||
* The Class LostUINResponseDTO. | ||
* | ||
* @author Joel K | ||
* @since 1.2.0 | ||
* | ||
*/ | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@ToString | ||
public class LostUINResponseDTO implements Serializable { | ||
|
||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = -667562552980002417L; | ||
|
||
/** The application-Id. */ | ||
private String applicationId; | ||
|
||
/** The created by. */ | ||
private String createdBy; | ||
|
||
/** The create date time. */ | ||
private String createdDateTime; | ||
|
||
/** The updated by. */ | ||
private String updatedBy; | ||
|
||
/** The update date time. */ | ||
private String updatedDateTime; | ||
|
||
/** | ||
* application status code | ||
*/ | ||
private String applicationStatusCode; | ||
|
||
/** | ||
* booking status code | ||
*/ | ||
private String bookingStatusCode; | ||
|
||
/** | ||
* language code | ||
*/ | ||
private String langCode; | ||
|
||
/** | ||
* the booking type | ||
*/ | ||
private String bookingType; | ||
|
||
} |
77 changes: 77 additions & 0 deletions
77
...tration-core/src/main/java/io/mosip/preregistration/core/common/entity/LostUINEntity.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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright | ||
* | ||
*/ | ||
package io.mosip.preregistration.core.common.entity; | ||
|
||
import java.io.Serializable; | ||
import java.time.LocalDateTime; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
|
||
import org.hibernate.annotations.NamedQuery; | ||
import org.springframework.stereotype.Component; | ||
|
||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* This entity class defines the database table details for LostUINEntity. | ||
* | ||
* @author Joel K | ||
* @since 1.0.0 | ||
* | ||
*/ | ||
@Component | ||
@Entity | ||
@Table(name = "application_replacements", schema = "prereg") | ||
@NoArgsConstructor | ||
@NamedQuery(name = "LostUINEntity.findByCreatedByOrderByCreateDateTime", query = "SELECT e FROM LostUINEntity e WHERE e.crBy=:userId order by e.crDtime desc") | ||
@NamedQuery(name = "LostUINEntity.findByCreatedBy", query = "SELECT e FROM LostUINEntity e WHERE e.crBy=:userId order by e.crDtime desc") | ||
public class LostUINEntity implements Serializable { | ||
|
||
/** The Constant serialVersionUID. */ | ||
private static final long serialVersionUID = 6705845720255847210L; | ||
|
||
@Id | ||
@Column(name = "application_id") | ||
private String applicationId; | ||
|
||
@Column(name = "demographic_id", nullable = false) | ||
private String demographicId; | ||
|
||
@Column(name = "lang_code", nullable = false) | ||
private String langCode; | ||
|
||
@Column(name = "created_by") | ||
private String crBy; | ||
|
||
@Column(name = "created_at") | ||
private LocalDateTime crDtime; | ||
|
||
public static long getSerialversionuid() { | ||
return serialVersionUID; | ||
} | ||
|
||
public void setDemographicId(String demographicId) { | ||
this.demographicId = demographicId; | ||
} | ||
|
||
public void setApplicationId(String applicationId) { | ||
this.applicationId = applicationId; | ||
} | ||
|
||
public void setCrBy(String crBy) { | ||
this.crBy = crBy; | ||
} | ||
|
||
public void setCrDtime(LocalDateTime crDtime) { | ||
this.crDtime = crDtime; | ||
} | ||
|
||
public void setLangCode(String langCode) { | ||
this.langCode = langCode; | ||
} | ||
} |