diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/Audit.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/Audit.java new file mode 100644 index 000000000..1fde094f7 --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/Audit.java @@ -0,0 +1,103 @@ +package io.mosip.registration.clientmanager.entity; + +import androidx.room.ColumnInfo; +import androidx.room.Entity; + +import java.time.LocalDateTime; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * The Audit Entity class with required fields to be captured and recorded + * + * @author Anshul Vanawat + * + */ +@Entity(tableName = "app_audit_log") +//schema = "audit" +@Data +@EqualsAndHashCode(callSuper = true) +@NoArgsConstructor +@AllArgsConstructor +public class Audit extends BaseAudit { + + @NotNull + @Size(min = 1, max = 64) + @ColumnInfo(name = "event_id")//, nullable = false, updatable = false, length = 64) + @NotNull + private String eventId; + + @NotNull + @Size(min = 1, max = 128) + @ColumnInfo(name = "event_name")//, nullable = false, updatable = false, length = 128) + private String eventName; + + @NotNull + @Size(min = 1, max = 64) + @ColumnInfo(name = "event_type")//, nullable = false, updatable = false, length = 64) + private String eventType; + + @NotNull + @ColumnInfo(name = "action_dtimes")//, nullable = false, updatable = false) + private LocalDateTime actionTimeStamp; + + @NotNull + @Size(min = 1, max = 128) + @ColumnInfo(name = "host_name")//, nullable = false, updatable = false, length = 128) + private String hostName; + + @NotNull + @Size(min = 1, max = 256) + @ColumnInfo(name = "host_ip")//, nullable = false, updatable = false, length = 256) + private String hostIp; + + @NotNull + @Size(min = 1, max = 64) + @ColumnInfo(name = "app_id")//, nullable = false, updatable = false, length = 64) + private String applicationId; + + @NotNull + @Size(min = 1, max = 128) + @ColumnInfo(name = "app_name")//, nullable = false, updatable = false, length = 128) + private String applicationName; + + @NotNull + @Size(min = 1, max = 256) + @ColumnInfo(name = "session_user_id")//, nullable = false, updatable = false, length = 256) + private String sessionUserId; + + @Size(max = 128) + @ColumnInfo(name = "session_user_name")//, updatable = false, length = 128) + private String sessionUserName; + + @Size( max = 64) + @ColumnInfo(name = "ref_id")//, nullable = true, updatable = false, length = 64) + private String id; + + @Size(max = 64) + @ColumnInfo(name = "ref_id_type")//, nullable = true, updatable = false, length = 64) + private String idType; + + @NotNull + @Size(min = 1, max = 256) + @ColumnInfo(name = "cr_by")//, nullable = false, updatable = false, length = 256) + private String createdBy; + + @Size(max = 128) + @ColumnInfo(name = "module_name")//, updatable = false, length = 128) + private String moduleName; + + @Size(max = 64) + @ColumnInfo(name = "module_id")//, updatable = false, length = 64) + private String moduleId; + + @Size(max = 2048) + @ColumnInfo(name = "log_desc")//, updatable = false, length = 2048) + private String description; +} \ No newline at end of file diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/BaseAudit.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/BaseAudit.java new file mode 100644 index 000000000..c450a3d0b --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/BaseAudit.java @@ -0,0 +1,45 @@ +package io.mosip.registration.clientmanager.entity; + +import androidx.room.ColumnInfo; +import androidx.room.PrimaryKey; + +import java.time.LocalDateTime; +import java.util.UUID; + +import javax.validation.constraints.NotNull; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * Base class for {@link Audit} with {@link #uuid} and {@link #createdAt} + * + * @author Anshul vanawat + */ +//@MappedSuperclass +@Data +@AllArgsConstructor +public class BaseAudit { + + /** + * Field for immutable universally unique identifier (UUID) + */ + @PrimaryKey + @ColumnInfo(name = "log_id") + @NotNull + //@Updateable = false + private String uuid; + + @ColumnInfo(name = "log_dtimes") + @NotNull + //@Updateable = false + private LocalDateTime createdAt; + + /** + * Constructor to initialize {@link BaseAudit} with uuid and timestamp + */ + public BaseAudit() { + uuid = UUID.randomUUID().toString(); + createdAt = LocalDateTime.now(); + } +} \ No newline at end of file diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/DynamicField.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/DynamicField.java new file mode 100644 index 000000000..ab1e4d13d --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/DynamicField.java @@ -0,0 +1,44 @@ +package io.mosip.registration.clientmanager.entity; + + +import androidx.room.ColumnInfo; +import androidx.room.Entity; +import androidx.room.PrimaryKey; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * This Entity Class contains list of dynamic fields + * which will be displayed in UI with respect to language code. + * The data for this table will come through sync from server master table + * + * @author Anshul vanawat + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Entity(tableName = "dynamic_field") +public class DynamicField { + + @PrimaryKey + @ColumnInfo(name="id") + private String id; + + @ColumnInfo(name="name") + private String name; + + @ColumnInfo(name="description") + private String description; + + @ColumnInfo(name="lang_code") + private String langCode; + + @ColumnInfo(name="data_type") + private String dataType; + + @ColumnInfo(name="value_json") + private String valueJson; + + @ColumnInfo(name="is_active") + private boolean isActive; +} + diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/FileSignature.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/FileSignature.java new file mode 100644 index 000000000..71960300a --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/FileSignature.java @@ -0,0 +1,29 @@ +package io.mosip.registration.clientmanager.entity; + +import androidx.room.ColumnInfo; +import androidx.room.Entity; +import androidx.room.PrimaryKey; + +import lombok.Data; + +/** + * @author Anshul vanawat + */ + +@Entity(tableName = "file_signature") +@Data +public class FileSignature { + + @PrimaryKey + @ColumnInfo(name = "file_name") + private String fileName; + + @ColumnInfo(name = "signature") + private String signature; + + @ColumnInfo(name = "content_length") + private Integer contentLength; + + @ColumnInfo(name = "encrypted") + private Boolean encrypted; +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/Location.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/Location.java new file mode 100644 index 000000000..0564fad53 --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/Location.java @@ -0,0 +1,40 @@ +package io.mosip.registration.clientmanager.entity; + +import androidx.room.ColumnInfo; +import androidx.room.Entity; + +import java.io.Serializable; + +import lombok.Data; + +/** + * This Entity Class contains list of locations that are being used in Registration with respect to language code. + * The data for this table will come through sync from server master table . + * + * @author Anshul Vanawat + */ + +@Data + @Entity(tableName = "location", primaryKeys = {"code", "langCode"}) +public class Location extends RegistrationCommonFields implements Serializable { + + private static final long serialVersionUID = -5585825705521742941L; + + @ColumnInfo(name = "code") + private String code; + + @ColumnInfo(name = "lang_code") + private String langCode; + + @ColumnInfo(name = "name") + private String name; + + @ColumnInfo(name = "hierarchy_level") + private int hierarchyLevel; + + @ColumnInfo(name = "hierarchy_level_name") + private String hierarchyName; + + @ColumnInfo(name = "parent_loc_code") + private String parentLocCode; +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/LocationHierarchy.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/LocationHierarchy.java new file mode 100644 index 000000000..802b661c6 --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/LocationHierarchy.java @@ -0,0 +1,36 @@ +package io.mosip.registration.clientmanager.entity; + +import androidx.room.ColumnInfo; +import androidx.room.Entity; +import androidx.room.PrimaryKey; + +import lombok.Data; + +import java.io.Serializable; + +import javax.validation.constraints.NotNull; + +/** + * @author Anshul vanawat + */ + +@Entity(tableName = "loc_hierarchy_list", primaryKeys = {"hierarchyLevel", "hierarchyLevelName", "langCode"}) +@Data +public class LocationHierarchy extends RegistrationCommonFields implements Serializable { + + @PrimaryKey + @NotNull + @ColumnInfo(name = "hierarchy_level") + //length = 36 + private Integer hierarchyLevel; + + @NotNull + @ColumnInfo(name = "hierarchy_level_name") + //length=64 + private String hierarchyLevelName; + + @NotNull + @ColumnInfo(name = "lang_code") + //length=3 + private String langCode; +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/MachineMaster.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/MachineMaster.java new file mode 100644 index 000000000..9f1f233d4 --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/MachineMaster.java @@ -0,0 +1,59 @@ +package io.mosip.registration.clientmanager.entity; + +import androidx.room.ColumnInfo; +import androidx.room.Entity; +import androidx.room.PrimaryKey; + +import java.io.Serializable; +import java.time.LocalDateTime; + +import lombok.Data; + +/** + * This Entity Class contains list of machine related data[mac address, serial number, machine name...] + * with respect to language code. + * The data for this table will come through sync from server master table. + * + * @author Anshul Vanawat + */ + +@Entity(tableName = "machine_master") +@Data +public class MachineMaster extends RegistrationCommonFields implements Serializable { + + private static final long serialVersionUID = -5585825705521742941L; + + @PrimaryKey + @ColumnInfo(name = "id") + private String id; + + @ColumnInfo(name = "lang_code") + private String langCode; + + @ColumnInfo(name = "name") + private String name; + + @ColumnInfo(name = "serial_num") + private String serialNum; + + @ColumnInfo(name = "ip_address") + private String ipAddress; + + @ColumnInfo(name = "mac_address") + private String macAddress; + + @ColumnInfo(name = "mspec_id") + private String machineSpecId; + + @ColumnInfo(name = "validity_end_dtimes") + private LocalDateTime validityDateTime; + + @ColumnInfo(name = "public_key" /*, columnDefinition = "CLOB"*/) + private String publicKey; + + @ColumnInfo(name = "key_index") + private String keyIndex; + + @ColumnInfo(name = "reg_cntr_id") + private String regCenterId; +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/MachineType.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/MachineType.java new file mode 100644 index 000000000..6e0977217 --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/MachineType.java @@ -0,0 +1,32 @@ +package io.mosip.registration.clientmanager.entity; + +import androidx.room.ColumnInfo; +import androidx.room.Entity; +import androidx.room.PrimaryKey; + +import java.io.Serializable; + +import lombok.Data; + +/** + * This Entity Class contains list of machine types[Desktop,Laptop...] with respect to language code. + * The data for this table will come through sync from server master table. + * + * @author Anshul Vanawat + */ +@Entity(tableName = "machine_type") +@Data +public class MachineType extends RegistrationCommonFields implements Serializable { + + private static final long serialVersionUID = -8541947587557590379L; + + @PrimaryKey + @ColumnInfo(name = "code") + private String code; + + @ColumnInfo(name = "name") + private String name; + + @ColumnInfo(name = "descr") + private String description; +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/Registration.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/Registration.java new file mode 100644 index 000000000..47ecb4369 --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/Registration.java @@ -0,0 +1,148 @@ +package io.mosip.registration.clientmanager.entity; + +import androidx.room.ColumnInfo; +import androidx.room.Entity; +import androidx.room.PrimaryKey; + +import java.sql.Timestamp; + +import lombok.Data; + +/** + * The Entity Class for Registration details + * + * @author Anshul Vanawat + */ +@Entity(tableName = "REGISTRATION") +@Data +public class Registration extends RegistrationCommonFields { + + @PrimaryKey + @ColumnInfo(name = "PACKET_ID") + private String packetId; + + @ColumnInfo(name = "ID") + private String id; + + @ColumnInfo(name = "usr_id") + private String usrId; + + @ColumnInfo(name = "REG_TYPE") + private String regType; + + @ColumnInfo(name = "REF_REG_ID") + private String refRegId; + + @ColumnInfo(name = "PREREG_ID") + private String preRegId; + + @ColumnInfo(name = "STATUS_CODE") + private String statusCode; + + @ColumnInfo(name = "LANG_CODE") + private String langCode; + + @ColumnInfo(name = "STATUS_COMMENT") + private String statusComment; + + @ColumnInfo(name = "STATUS_DTIMES") + private Timestamp statusTimestamp; + + @ColumnInfo(name = "ACK_FILENAME") + private String ackFilename; + + @ColumnInfo(name = "CLIENT_STATUS_CODE") + private String clientStatusCode; + + @ColumnInfo(name = "SERVER_STATUS_CODE") + private String serverStatusCode; + + @ColumnInfo(name = "CLIENT_STATUS_DTIME") + private Timestamp clientStatusTimestamp; + + @ColumnInfo(name = "SERVER_STATUS_DTIME") + private Timestamp serverStatusTimestamp; + + @ColumnInfo(name = "CLIENT_STATUS_COMMENT") + private String clientStatusComments; + + @ColumnInfo(name = "SERVER_STATUS_COMMENT") + private String serverStatusComments; + + @ColumnInfo(name = "REG_USR_ID") + private String regUsrId; + + @ColumnInfo(name = "REGCNTR_ID") + private String regCntrId; + + @ColumnInfo(name = "APPROVER_USR_ID") + private String approverUsrId; + + @ColumnInfo(name = "APPROVER_ROLE_CODE") + private String approverRoleCode; + + @ColumnInfo(name = "FILE_UPLOAD_STATUS") + private String fileUploadStatus; + + @ColumnInfo(name = "UPLOAD_COUNT") + private Short uploadCount; + + @ColumnInfo(name = "UPLOAD_DTIMES") + private Timestamp uploadTimestamp; + + @ColumnInfo(name = "LATEST_REGTRN_ID") + private String latestRegTrnId; + + @ColumnInfo(name = "LATEST_TRN_TYPE_CODE") + private String latestTrnTypeCode; + + @ColumnInfo(name = "LATEST_TRN_STATUS_CODE") + private String latestTrnStatusCode; + + @ColumnInfo(name = "LATEST_TRN_LANG_CODE") + private String latestTrnLangCode; + + @ColumnInfo(name = "LATEST_REGTRN_DTIMES") + private Timestamp latestRegTrnTimestamp; + + @ColumnInfo(name = "ADDITIONAL_INFO") + private byte[] additionalInfo; + + @ColumnInfo(name = "APP_ID") + private String appId; + + @ColumnInfo(name = "ADDITIONAL_INFO_REQ_ID") + private String additionalInfoReqId; + + @ColumnInfo(name = "ACK_SIGNATURE") + private String ackSignature; + + @ColumnInfo(name = "HAS_BWORDS") + private Boolean hasBwords; + + +// @ManyToOne +// @JoinColumn(name = "CR_BY", referencedColumnName = "id", insertable = false, updatable = false) +// private UserDetail userdetail; + +// public void setStatusTimestamp(Timestamp statusTimestamp) { +// this.statusTimestamp = Timestamp.valueOf(DateUtils.getUTCCurrentDateTime()); +// } + +// public void setClientStatusTimestamp(Timestamp clientStatusTimestamp) { +// this.clientStatusTimestamp = Timestamp.valueOf(DateUtils.getUTCCurrentDateTime()); +// } + +// public void setServerStatusTimestamp(Timestamp serverStatusTimestamp) { +// this.serverStatusTimestamp = Timestamp.valueOf(DateUtils.getUTCCurrentDateTime()); +// } + +// public void setUploadTimestamp(Timestamp uploadTimestamp) { +// this.uploadTimestamp = Timestamp.valueOf(DateUtils.getUTCCurrentDateTime()); +// } + + +// public void setLatestRegTrnTimestamp(Timestamp latestRegTrnTimestamp) { +// this.latestRegTrnTimestamp = Timestamp.valueOf(DateUtils.getUTCCurrentDateTime()); +// } +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/RegistrationAuditDates.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/RegistrationAuditDates.java new file mode 100644 index 000000000..c6d50dcda --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/RegistrationAuditDates.java @@ -0,0 +1,9 @@ +package io.mosip.registration.clientmanager.entity; + +import java.sql.Timestamp; + +public interface RegistrationAuditDates { + Timestamp getAuditLogFromDateTime(); + + Timestamp getAuditLogToDateTime(); +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/RegistrationCenter.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/RegistrationCenter.java new file mode 100644 index 000000000..14328a633 --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/RegistrationCenter.java @@ -0,0 +1,72 @@ +package io.mosip.registration.clientmanager.entity; + +import androidx.room.ColumnInfo; +import androidx.room.Embedded; +import androidx.room.Entity; +import androidx.room.PrimaryKey; + +import java.sql.Time; +import java.sql.Timestamp; + +import io.mosip.registration.clientmanager.entity.id.RegistrationCenterId; +import lombok.Data; +import lombok.Getter; +import lombok.Setter; + +/** + * The Entity Class for Registration Center details + * + * @author Anshul Vanawat + */ +@Entity(tableName = "registration_center") +@Data +public class RegistrationCenter extends RegistrationCommonFields { + + @Embedded + @PrimaryKey + private RegistrationCenterId registrationCenterId; + + @ColumnInfo(name = "name") + private String name; + @ColumnInfo(name = "cntrtyp_code") + private String centerTypeCode; + @ColumnInfo(name = "addr_line1") + private String addressLine1; + @ColumnInfo(name = "addr_line2") + private String addressLine2; + @ColumnInfo(name = "addr_line3") + private String addressLine3; + @ColumnInfo(name = "latitude") + private String latitude; + @ColumnInfo(name = "longitude") + private String longitude; + @ColumnInfo(name = "location_Code") + private String locationCode; + @ColumnInfo(name = "contact_phone") + private String contactPhone; + @ColumnInfo(name = "contact_person") + private String contactPerson; + @ColumnInfo(name = "number_of_kiosks") + private Integer numberOfKiosks; + @ColumnInfo(name = "working_hours") + private String workingHours; + @ColumnInfo(name = "per_kiosk_process_time") + private Time perKioskProcessTime; + @ColumnInfo(name = "center_start_time") + private Time centerStartTime; + @ColumnInfo(name = "center_end_time") + private Time centerEndTime; + @ColumnInfo(name = "lunch_start_time") + private Time lunchStartTime; + @ColumnInfo(name = "lunch_end_time") + private Time lunchEndTime; + @ColumnInfo(name = "time_zone") + private String timeZone; + @ColumnInfo(name = "holiday_loc_code") + private String holidayLocationCode; + @ColumnInfo(name = "is_deleted") + private Boolean isDeleted; + @ColumnInfo(name = "del_dtimes") + private Timestamp delDtimes; + +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/RegistrationCenterType.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/RegistrationCenterType.java new file mode 100644 index 000000000..8cf601dc8 --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/RegistrationCenterType.java @@ -0,0 +1,34 @@ +package io.mosip.registration.clientmanager.entity; + +import androidx.room.ColumnInfo; +import androidx.room.Entity; +import androidx.room.PrimaryKey; + +import lombok.Data; + +/** + * This Entity class contains list of center types with respect to language code. + * The data for this table will come through sync from server master table. + * + * @author Anshul Vanawat + */ + +@Entity(tableName = "reg_center_type", primaryKeys = {"code", "langCode"}) +@Data +public class RegistrationCenterType extends RegistrationCommonFields { + + private static final long serialVersionUID = 7869240207930949234L; + + @PrimaryKey + @ColumnInfo(name = "code") + private String code; + + @ColumnInfo(name = "lang_code") + private String langCode; + + @ColumnInfo(name = "name") + private String name; + + @ColumnInfo(name = "descr") + private String descr; +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/RegistrationCommonFields.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/RegistrationCommonFields.java new file mode 100644 index 000000000..d79fe5255 --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/RegistrationCommonFields.java @@ -0,0 +1,37 @@ +package io.mosip.registration.clientmanager.entity; + +import androidx.room.ColumnInfo; + +import java.sql.Timestamp; + +import lombok.Data; + +/** + * The Entity Class for RegistrationCommonFields. + * + * @author Anshul vanawat + */ + +//@MappedSuperclass +@Data +public class RegistrationCommonFields { + + @ColumnInfo(name = "IS_ACTIVE") + private Boolean isActive; + @ColumnInfo(name = "CR_BY") + protected String crBy; + @ColumnInfo(name = "CR_DTIMES") + protected Timestamp crDtime; + @ColumnInfo(name = "UPD_BY") + protected String updBy; + @ColumnInfo(name = "UPD_DTIMES") + protected Timestamp updDtimes; + +// public void setCrDtime(Timestamp crDtime) { +// this.crDtime = Timestamp.valueOf(DateUtils.getUTCCurrentDateTime()); +// } +// +// public void setUpdDtimes(Timestamp updDtimes) { +// this.updDtimes = Timestamp.valueOf(DateUtils.getUTCCurrentDateTime()); +// } +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/UserBiometric.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/UserBiometric.java new file mode 100644 index 000000000..6240fd1c3 --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/UserBiometric.java @@ -0,0 +1,47 @@ +package io.mosip.registration.clientmanager.entity; + +import androidx.room.ColumnInfo; +import androidx.room.Embedded; +import androidx.room.Entity; +import androidx.room.PrimaryKey; + +import java.sql.Timestamp; + +import io.mosip.registration.clientmanager.entity.id.UserBiometricId; +import lombok.Data; +/** + * The Entity Class for UserBiometric details + * + * @author Anshul Vanawat + */ +@Entity(tableName = "user_biometric") +@Data +public class UserBiometric extends RegistrationCommonFields { + + @Embedded + @PrimaryKey + private UserBiometricId userBiometricId; + + //@Lob + @ColumnInfo(name = "bio_raw_image") + private byte[] bioRawImage; + + @ColumnInfo(name = "bio_minutia") + private String bioMinutia; + + //@Lob + @ColumnInfo(name = "bio_iso_image") + private byte[] bioIsoImage; + + @ColumnInfo(name = "quality_score") + private Integer qualityScore; + + @ColumnInfo(name = "no_of_retry") + private Integer numberOfRetry; + + @ColumnInfo(name = "is_deleted") + private Boolean isDeleted; + + @ColumnInfo(name = "del_dtimes") + private Timestamp delDtimes; +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/UserDetail.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/UserDetail.java new file mode 100644 index 000000000..7703cbe3b --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/UserDetail.java @@ -0,0 +1,102 @@ +package io.mosip.registration.clientmanager.entity; + +import androidx.room.ColumnInfo; +import androidx.room.Entity; +import androidx.room.PrimaryKey; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Set; + +import lombok.Data; +/** + * The Entity Class for User Detail details + * + * @author Anshul Vanawat + */ +@Entity(tableName = "user_detail") +@Data +public class UserDetail extends RegistrationCommonFields implements Serializable { + private static final long serialVersionUID = 1L; + + @PrimaryKey + @ColumnInfo(name = "id") + private String id; + + @ColumnInfo(name = "reg_id") + private String regid; + + @ColumnInfo(name = "salt") + private String salt; + + @ColumnInfo(name = "name") + private String name; + + @ColumnInfo(name = "email") + private String email; + + @ColumnInfo(name = "mobile") + private String mobile; + + @ColumnInfo(name = "status_code") + private String statusCode; + + @ColumnInfo(name = "lang_code") + private String langCode; + + @ColumnInfo(name = "last_login_dtimes") + private Timestamp lastLoginDtimes; + + @ColumnInfo(name = "last_login_method") + private String lastLoginMethod; + + @ColumnInfo(name = "unsuccessful_login_count") + private Integer unsuccessfulLoginCount; + + @ColumnInfo(name = "userlock_till_dtimes") + private Timestamp userlockTillDtimes; + + @ColumnInfo(name = "is_deleted") + private Boolean isDeleted; + + @ColumnInfo(name = "del_dtimes") + private Timestamp delDtimes; + + @ColumnInfo(name = "reg_cntr_id") + private String regCenterId; + + @ColumnInfo(name = "token") + private String token; + + @ColumnInfo(name = "refresh_token") + private String refreshToken; + + @ColumnInfo(name = "token_expiry") + private long tokenExpiry; + + @ColumnInfo(name = "rtoken_expiry") + private long rtokenExpiry; + + @ColumnInfo(name = "is_onboarded") + private boolean isOnboarded; + + //Usr ID added In UserRole Table for mapping +// @OneToMany(fetch = FetchType.EAGER, mappedBy = "userDetail", orphanRemoval = true, cascade = CascadeType.ALL) +// private Set userRole; + + //NOT REQUIRED +// @OneToMany(fetch = FetchType.EAGER, mappedBy = "userDetail", cascade = CascadeType.ALL) +// private Set userMachineMapping; + + //Usr ID added In UserRole Table for mapping +// @OneToMany(fetch = FetchType.EAGER, mappedBy = "userDetail", cascade = CascadeType.ALL) +// private Set userBiometric; + + //NOT REQUIRED +// @OneToOne(fetch = FetchType.EAGER, mappedBy = "userDetail", cascade = CascadeType.ALL) +// private UserPassword userPassword; + + //All Fields moved into User Details table +// @OneToOne(fetch = FetchType.EAGER, mappedBy = "userDetail", optional = true, cascade = CascadeType.ALL) +// private UserToken userToken; +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/UserRole.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/UserRole.java new file mode 100644 index 000000000..0104877cb --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/UserRole.java @@ -0,0 +1,28 @@ +package io.mosip.registration.clientmanager.entity; + +import androidx.room.ColumnInfo; +import androidx.room.Embedded; +import androidx.room.Entity; +import androidx.room.PrimaryKey; + +import io.mosip.registration.clientmanager.entity.id.UserRoleId; +import lombok.Data; +import lombok.Getter; +import lombok.Setter; + +/** + * The Entity Class for User Role details + * + * @author Anshul Vanawat + */ +@Entity(tableName = "user_role") +@Data +public class UserRole extends RegistrationCommonFields { + + @Embedded + @PrimaryKey + private UserRoleId userRoleId; + + @ColumnInfo(name = "lang_code") + private String langCode; +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/id/RegistrationCenterId.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/id/RegistrationCenterId.java new file mode 100644 index 000000000..f63bbbf15 --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/id/RegistrationCenterId.java @@ -0,0 +1,24 @@ +package io.mosip.registration.clientmanager.entity.id; + +import androidx.room.ColumnInfo; + +import java.io.Serializable; + +import lombok.Data; + +/** + * composite key for {@link io.mosip.registration.clientmanager.entity.RegistrationCenter} + * + * @author Anshul Vanawat + */ +@Data +public class RegistrationCenterId implements Serializable { + + private static final long serialVersionUID = -7306845601917592413L; + + @ColumnInfo(name = "id") + private String id; + + @ColumnInfo(name = "lang_code") + private String langCode; +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/id/UserBiometricId.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/id/UserBiometricId.java new file mode 100644 index 000000000..06a3172a9 --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/id/UserBiometricId.java @@ -0,0 +1,25 @@ +package io.mosip.registration.clientmanager.entity.id; + +import androidx.room.ColumnInfo; + +import java.io.Serializable; + +import lombok.Data; + +/** + * composite key for {@link io.mosip.registration.clientmanager.entity.UserBiometric} + * + * @author Anshul Vanawat + */ +@Data +public class UserBiometricId implements Serializable { + + private static final long serialVersionUID = 4356301394048825993L; + + @ColumnInfo(name = "usr_id") + private String usrId; + @ColumnInfo(name = "bmtyp_code") + private String bioTypeCode; + @ColumnInfo(name = "bmatt_code") + private String bioAttributeCode; +} diff --git a/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/id/UserRoleId.java b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/id/UserRoleId.java new file mode 100644 index 000000000..a9571ecf2 --- /dev/null +++ b/client/clientmanager/src/main/java/io/mosip/registration/clientmanager/entity/id/UserRoleId.java @@ -0,0 +1,23 @@ +package io.mosip.registration.clientmanager.entity.id; + +import androidx.room.ColumnInfo; + +import java.io.Serializable; +import lombok.Data; + +/** + * composite key for {@link io.mosip.registration.clientmanager.entity.UserRole} + * + * @author Anshul Vanawat + */ +@Data +public class UserRoleId implements Serializable { + + private static final long serialVersionUID = -8072043172665654382L; + + @ColumnInfo(name = "usr_id") + private String usrId; + @ColumnInfo(name = "role_code") + private String roleCode; + +}