Skip to content

Commit

Permalink
chore: added more entities
Browse files Browse the repository at this point in the history
  • Loading branch information
mishraomp committed Jan 27, 2025
1 parent a8b7f10 commit 018e27b
Show file tree
Hide file tree
Showing 79 changed files with 5,220 additions and 58 deletions.
12 changes: 4 additions & 8 deletions backend-el/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<java.version>21</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
Expand All @@ -25,14 +29,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
package ca.bc.gov.nrs.environment.fta.el;

import ca.bc.gov.nrs.environment.fta.el.services.ApplicationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableScheduling
@EnableRetry
public class FtaRstExporterApplication {
public class FtaRstExporterApplication implements CommandLineRunner {

public static void main(String[] args) {
SpringApplication.run(FtaRstExporterApplication.class, args);
}
private final ApplicationService applicationService;
private static final Logger logger = LoggerFactory
.getLogger(FtaRstExporterApplication.class);

public FtaRstExporterApplication(ApplicationService applicationService) {
this.applicationService = applicationService;
}

public static void main(String[] args) {
SpringApplication.run(FtaRstExporterApplication.class, args);
}

@Override
public void run(String... args) {
this.applicationService.extractAndUploadCSVToS3();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
package ca.bc.gov.nrs.environment.fta.el.entities;

import jakarta.persistence.*;
import org.hibernate.annotations.ColumnDefault;
import org.springframework.data.annotation.Immutable;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Entity
@Table(name = "RECREATION_COMMENT", schema = "THE")
@Immutable
@IdClass(RecreationCommentId.class)
public class RecreationComment {
@Id
@Column(name = "RECREATION_COMMENT_ID", nullable = false)
private Long recreationCommentId;

@Id
@Column(name = "FOREST_FILE_ID", nullable = false, length = 10)
private String forestFileId;


@ColumnDefault("'N'")
@Column(name = "CLOSURE_IND", nullable = false, length = 1)
private String closureInd;

@Column(name = "PROJECT_COMMENT", nullable = false, length = 2000)
private String projectComment;

@Column(name = "COMMENT_DATE")
private LocalDateTime commentDate;

@Column(name = "REVISION_COUNT", nullable = false)
private Integer revisionCount;

@Column(name = "ENTRY_USERID", nullable = false, length = 30)
private String entryUserid;

@Column(name = "ENTRY_TIMESTAMP", nullable = false)
private LocalDateTime entryTimestamp;

@Column(name = "UPDATE_USERID", nullable = false, length = 30)
private String updateUserid;

@Column(name = "UPDATE_TIMESTAMP", nullable = false)
private LocalDateTime updateTimestamp;

public Long getRecreationCommentId() {
return recreationCommentId;
}

public void setRecreationCommentId(Long recreationCommentId) {
this.recreationCommentId = recreationCommentId;
}

public String getForestFileId() {
return forestFileId;
}

public void setForestFileId(String forestFileId) {
this.forestFileId = forestFileId;
}

public String getClosureInd() {
return closureInd;
}

public void setClosureInd(String closureInd) {
this.closureInd = closureInd;
}

public String getProjectComment() {
return projectComment;
}

public void setProjectComment(String projectComment) {
this.projectComment = projectComment;
}

public LocalDateTime getCommentDate() {
return commentDate;
}

public void setCommentDate(LocalDateTime commentDate) {
this.commentDate = commentDate;
}

public Integer getRevisionCount() {
return revisionCount;
}

public void setRevisionCount(Integer revisionCount) {
this.revisionCount = revisionCount;
}

public String getEntryUserid() {
return entryUserid;
}

public void setEntryUserid(String entryUserid) {
this.entryUserid = entryUserid;
}

public LocalDateTime getEntryTimestamp() {
return entryTimestamp;
}

public void setEntryTimestamp(LocalDateTime entryTimestamp) {
this.entryTimestamp = entryTimestamp;
}

public String getUpdateUserid() {
return updateUserid;
}

public void setUpdateUserid(String updateUserid) {
this.updateUserid = updateUserid;
}

public LocalDateTime getUpdateTimestamp() {
return updateTimestamp;
}

public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
this.updateTimestamp = updateTimestamp;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package ca.bc.gov.nrs.environment.fta.el.entities;

import org.hibernate.Hibernate;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

public class RecreationCommentId implements Serializable {
@Serial
private static final long serialVersionUID = -3501419533934602098L;
private Long recreationCommentId;

private String forestFileId;

public Long getRecreationCommentId() {
return recreationCommentId;
}

public void setRecreationCommentId(Long recreationCommentId) {
this.recreationCommentId = recreationCommentId;
}

public String getForestFileId() {
return forestFileId;
}

public void setForestFileId(String forestFileId) {
this.forestFileId = forestFileId;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
RecreationCommentId entity = (RecreationCommentId) o;
return Objects.equals(this.forestFileId, entity.forestFileId) &&
Objects.equals(this.recreationCommentId, entity.recreationCommentId);
}

@Override
public int hashCode() {
return Objects.hash(forestFileId, recreationCommentId);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package ca.bc.gov.nrs.environment.fta.el.entities;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import org.springframework.data.annotation.Immutable;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Entity
@Table(name = "RECREATION_CONTROL_ACCESS_CODE", schema = "THE")
@Immutable
public class RecreationControlAccessCode {
@Id
@Column(name = "RECREATION_CONTROL_ACCESS_CODE", nullable = false, length = 1)
private String recreationControlAccessCode;

@Column(name = "DESCRIPTION", nullable = false, length = 120)
private String description;

@Column(name = "EFFECTIVE_DATE", nullable = false)
private LocalDateTime effectiveDate;

@Column(name = "EXPIRY_DATE", nullable = false)
private LocalDateTime expiryDate;

@Column(name = "UPDATE_TIMESTAMP", nullable = false)
private LocalDateTime updateTimestamp;

public String getRecreationControlAccessCode() {
return recreationControlAccessCode;
}

public void setRecreationControlAccessCode(String recreationControlAccessCode) {
this.recreationControlAccessCode = recreationControlAccessCode;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public LocalDateTime getEffectiveDate() {
return effectiveDate;
}

public void setEffectiveDate(LocalDateTime effectiveDate) {
this.effectiveDate = effectiveDate;
}

public LocalDateTime getExpiryDate() {
return expiryDate;
}

public void setExpiryDate(LocalDateTime expiryDate) {
this.expiryDate = expiryDate;
}

public LocalDateTime getUpdateTimestamp() {
return updateTimestamp;
}

public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
this.updateTimestamp = updateTimestamp;
}
}
Loading

0 comments on commit 018e27b

Please sign in to comment.