Skip to content

Commit

Permalink
GRAD2-3176 - updates for new district report table
Browse files Browse the repository at this point in the history
  • Loading branch information
mightycox committed Jan 30, 2025
1 parent fb58937 commit c4263e1
Show file tree
Hide file tree
Showing 38 changed files with 1,472 additions and 827 deletions.
6 changes: 6 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@
<artifactId>mapstruct</artifactId>
<version>${org.mapstruct.version}</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>1.5.2.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package ca.bc.gov.educ.api.graduation.constants;

import lombok.Getter;

@Getter
public enum AddressTypeCodes {
MAILING("MAILING"),
PHYSICAL("PHYSICAL");

private final String code;

AddressTypeCodes(String code) {this.code = code;}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package ca.bc.gov.educ.api.graduation.constants;

import lombok.Getter;

@Getter
public enum DistrictContactTypeCodes {
OL_LEARN("OL_LEARN"),
SUPER("SUPER"),
CHAIR("CHAIR"),
SECRETARY("SECRETARY"),
ADMN_ASSIS("ADMN_ASSIS"),
INDIGENOUS("INDIGENOUS"),
CUSTORDER("CUSTORDER"),
EARL_LEARN("EARL_LEARN"),
FACILITIES("FACILITIES"),
FINANCIAL("FINANCIAL"),
FRENCH("FRENCH"),
INTERNAT("INTERNAT"),
LITERACY("LITERACY"),
MYED("MYED"),
INCLUSIVE("INCLUSIVE"),
TRANSPORT("TRANSPORT"),
DATA_COLLECTION_1701("1701"),
STUDREGIS("STUDREGIS");


private final String code;

DistrictContactTypeCodes(String code) {this.code = code;}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package ca.bc.gov.educ.api.graduation.constants;

import lombok.Getter;

@Getter
public enum ReportTypeCodes {
TVRGRAD("TVRGRAD"),
TVRNONGRAD("TVRNONGRAD"),
GRADREGARC("GRADREGARC"),
NONGRADREGARC("NONGRADREGARC"),
NONGRADPRJARC("NONGRADPRJARC"),
NONGRADPRJ("NONGRADPRJ"),
ACHV("ACHV"),
GRADREG("GRADREG"),
DISTREP_SC("DISTREP_SC"),
DISTREP_YE_SC("DISTREP_YE_SC"),
DISTREP_YE_SD("DISTREP_YE_SD"),
NONGRADDISTREP_SC("NONGRADDISTREP_SC"),
NONGRADDISTREP_SD("NONGRADDISTREP_SD"),
GRADPRJ("GRADPRJ"),
GRADPRJARC("GRADPRJARC"),
ADDRESS_LABEL_SCHL("ADDRESS_LABEL_SCHL"),
ADDRESS_LABEL_YE("ADDRESS_LABEL_YE"),
ADDRESS_LABEL_PSI("ADDRESS_LABEL_PSI"),
NONGRADREG("NONGRADREG"),
DISTREP_SD("DISTREP_SD");

private final String code;

ReportTypeCodes(String code) {this.code = code;}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package ca.bc.gov.educ.api.graduation.constants;

import lombok.Getter;

/**
* The enum for school category codes
*/
@Getter
public enum SchoolCategoryCodes {
IMM_DATA("IMM_DATA"),
CHILD_CARE("CHILD_CARE"),
MISC("MISC"),
PUBLIC("PUBLIC"),
INDEPEND("INDEPEND"),
FED_BAND("FED_BAND"),
OFFSHORE("OFFSHORE"),
EAR_LEARN("EAR_LEARN"),
YUKON("YUKON"),
POST_SEC("POST_SEC"),
INDP_FNS("INDP_FNS");

private final String code;
SchoolCategoryCodes(String code) { this.code = code; }
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package ca.bc.gov.educ.api.graduation.mapper;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
* The type Local date time mapper.
*/
public class LocalDateTimeMapper {

/**
* Map string.
*
* @param dateTime the date time
* @return the string
*/
public String map(LocalDateTime dateTime) {
if (dateTime == null) {
return null;
}
return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(dateTime);
}

/**
* Map local date time.
*
* @param dateTime the date time
* @return the local date time
*/
public LocalDateTime map(String dateTime) {
if (dateTime == null) {
return null;
}
return LocalDateTime.parse(dateTime);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ca.bc.gov.educ.api.graduation.mapper;

import ca.bc.gov.educ.api.graduation.model.dto.institute.School;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper(uses = {UUIDMapper.class, LocalDateTimeMapper.class, StringMapper.class})
@SuppressWarnings("squid:S1214")
public interface SchoolMapper {

SchoolMapper mapper = Mappers.getMapper(SchoolMapper.class);

@Mapping(target = "name", source = "displayName")
ca.bc.gov.educ.api.graduation.model.report.School toSchoolReport(School entity);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package ca.bc.gov.educ.api.graduation.mapper;

import org.apache.commons.lang3.StringUtils;

/**
* The type String mapper.
*/
public class StringMapper {

/**
* Map string.
*
* @param value the value
* @return the string
*/
public String map(String value) {
if (StringUtils.isNotEmpty(value)) {
return value.trim();
}
return value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package ca.bc.gov.educ.api.graduation.mapper;

import org.apache.commons.lang3.StringUtils;

import java.util.UUID;

public class UUIDMapper {

public UUID map(String value) {
if (StringUtils.isBlank(value)) {
return null;
}
return UUID.fromString(value);
}

public String map(UUID value) {
if (value == null) {
return null;
}
return value.toString();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ca.bc.gov.educ.api.graduation.model.dto;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.UUID;

@Data
@EqualsAndHashCode(callSuper = false)
public class DistrictReport extends BaseModel {

private UUID id;
private String report;
private String reportTypeCode;
private String reportTypeLabel;
private UUID districtId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class GraduationData {
private GradSearchStudent gradStudent;
private GradAlgorithmGraduationStudentRecord gradStatus;
private List<GradAlgorithmOptionalStudentProgram> optionalGradStatus;
private School school;
private SchoolClob school;
private StudentCourses studentCourses;
private StudentAssessments studentAssessments;
private StudentExams studentExams;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
package ca.bc.gov.educ.api.graduation.model.dto;

import ca.bc.gov.educ.api.graduation.model.report.NonGradReason;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Builder;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;

@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
public class ReportGradStudentData implements Serializable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@Data
@Component
public class School {
public class SchoolClob {

private String minCode;
private String schoolId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ public class SchoolReports extends BaseModel {
private String report;
private String reportTypeCode;
private String reportTypeLabel;
private String schoolOfRecord;
private UUID schoolOfRecordId;
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
package ca.bc.gov.educ.api.graduation.model.dto;
package ca.bc.gov.educ.api.graduation.model.dto.institute;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import ca.bc.gov.educ.api.graduation.model.dto.BaseModel;
import lombok.*;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
@Component
@NoArgsConstructor
@AllArgsConstructor
public class District extends BaseModel {
@Builder
public class District extends BaseModel implements Serializable {
private static final long serialVersionUID = 2L;

private String districtId;
private String districtNumber;
Expand All @@ -22,6 +25,8 @@ public class District extends BaseModel {
private String displayName;
private String districtRegionCode;
private String districtStatusCode;
private List<DistrictContact> contacts;
private List<DistrictAddress> addresses;

public String getDistrictName() {
return displayName;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package ca.bc.gov.educ.api.graduation.model.dto.institute;

import ca.bc.gov.educ.api.graduation.model.dto.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

@Data
@EqualsAndHashCode(callSuper = true)
public class DistrictAddress extends BaseModel implements Serializable {
/**
* The constant serialVersionUID.
*/
private static final long serialVersionUID = 1L;

private String districtAddressId;
private String districtId;
private String addressTypeCode;
private String addressLine1;
private String addressLine2;
private String city;
private String postal;
private String provinceCode;
private String countryCode;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package ca.bc.gov.educ.api.graduation.model.dto.institute;

import ca.bc.gov.educ.api.graduation.model.dto.BaseModel;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

@Data
@EqualsAndHashCode(callSuper = true)
@JsonIgnoreProperties(ignoreUnknown = true)
public class DistrictContact extends BaseModel implements Serializable {

/**
* The constant serialVersionUID.
*/
private static final long serialVersionUID = 1L;

private String districtContactId;
private String districtId;
private String districtContactTypeCode;
private String phoneNumber;
private String jobTitle;
private String phoneExtension;
private String alternatePhoneNumber;
private String alternatePhoneExtension;
private String email;
private String firstName;
private String lastName;
private String effectiveDate;
private String expiryDate;
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package ca.bc.gov.educ.api.graduation.model.dto.institute;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.stereotype.Component;
import lombok.*;

@Data
@EqualsAndHashCode
@Component("instituteSchool")
@Builder
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class School {

Expand Down
Loading

0 comments on commit c4263e1

Please sign in to comment.