-
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.
Merge pull request #27 from bcgov/feature/schoolCodes
Added pull of all school funding group codes
- Loading branch information
Showing
10 changed files
with
220 additions
and
7 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
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
24 changes: 24 additions & 0 deletions
24
api/src/main/java/ca/bc/gov/educ/api/school/mapper/v1/SchoolFundingGroupMapper.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,24 @@ | ||
package ca.bc.gov.educ.api.school.mapper.v1; | ||
|
||
import ca.bc.gov.educ.api.school.mapper.LocalDateTimeMapper; | ||
import ca.bc.gov.educ.api.school.mapper.StringMapper; | ||
import ca.bc.gov.educ.api.school.model.v1.SchoolFundingGroupEntity; | ||
import ca.bc.gov.educ.api.school.struct.v1.SchoolFundingGroup; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.mapstruct.factory.Mappers; | ||
|
||
@Mapper(uses = {LocalDateTimeMapper.class, StringMapper.class}) | ||
@SuppressWarnings("squid:S1214") | ||
public interface SchoolFundingGroupMapper { | ||
|
||
SchoolFundingGroupMapper mapper = Mappers.getMapper(SchoolFundingGroupMapper.class); | ||
|
||
@Mapping(target = "distNo", source = "schoolFundingGroupEntity.schoolFundingGroupID.distNo") | ||
@Mapping(target = "schlNo", source = "schoolFundingGroupEntity.schoolFundingGroupID.schlNo") | ||
@Mapping(target = "fundingGroupCode", source = "schoolFundingGroupEntity.schoolFundingGroupID.fundingGroupCode") | ||
@Mapping(target = "fundingGroupSubCode", source = "schoolFundingGroupEntity.schoolFundingGroupID.fundingGroupSubCode") | ||
@Mapping(target = "mincode", expression = "java(org.apache.commons.lang3.StringUtils.trimToEmpty(schoolFundingGroupEntity.getSchoolFundingGroupID().getDistNo()).concat(org.apache.commons.lang3.StringUtils.trimToEmpty(schoolFundingGroupEntity.getSchoolFundingGroupID().getSchlNo())))") | ||
SchoolFundingGroup toStructure(SchoolFundingGroupEntity schoolFundingGroupEntity); | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
api/src/main/java/ca/bc/gov/educ/api/school/model/v1/SchoolFundingGroupEntity.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,49 @@ | ||
package ca.bc.gov.educ.api.school.model.v1; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.EmbeddedId; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Table; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* The type School entity. | ||
*/ | ||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Entity | ||
@Table(name = "SCHOOL_FUNDING_MASTER") | ||
public class SchoolFundingGroupEntity { | ||
@EmbeddedId | ||
private SchoolFundingGroupID schoolFundingGroupID; | ||
|
||
@Column(name = "FORM_ID") | ||
private String formID; | ||
|
||
@Column(name = "ARCHIVE_STATUS") | ||
private String archiveStatus; | ||
|
||
@Column(name = "CREATE_DATE") | ||
private String createDate; | ||
|
||
@Column(name = "CREATE_TIME") | ||
private String createTime; | ||
|
||
@Column(name = "CREATE_USERNAME") | ||
private String createUsername; | ||
|
||
@Column(name = "EDIT_DATE") | ||
private String editDate; | ||
|
||
@Column(name = "EDIT_TIME") | ||
private String editTime; | ||
|
||
@Column(name = "EDIT_USERNAME") | ||
private String editUsername; | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
api/src/main/java/ca/bc/gov/educ/api/school/model/v1/SchoolFundingGroupID.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,30 @@ | ||
package ca.bc.gov.educ.api.school.model.v1; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Embeddable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.io.Serializable; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Embeddable | ||
public class SchoolFundingGroupID implements Serializable { | ||
|
||
@Column(name = "DISTNO", nullable = false, length = 3) | ||
protected String distNo; | ||
|
||
@Column(name = "SCHLNO", nullable = false, length = 5) | ||
protected String schlNo; | ||
|
||
@Column(name = "FUNDING_GROUP_CODE") | ||
private String fundingGroupCode; | ||
|
||
@Column(name = "FUNDING_GROUP_SUBCODE") | ||
private String fundingGroupSubCode; | ||
} |
11 changes: 11 additions & 0 deletions
11
api/src/main/java/ca/bc/gov/educ/api/school/repository/v1/SchoolFundingGroupRepository.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,11 @@ | ||
package ca.bc.gov.educ.api.school.repository.v1; | ||
|
||
import ca.bc.gov.educ.api.school.model.v1.Mincode; | ||
import ca.bc.gov.educ.api.school.model.v1.SchoolFundingGroupEntity; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface SchoolFundingGroupRepository extends JpaRepository<SchoolFundingGroupEntity, Mincode> { | ||
|
||
} |
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
51 changes: 51 additions & 0 deletions
51
api/src/main/java/ca/bc/gov/educ/api/school/struct/v1/SchoolFundingGroup.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,51 @@ | ||
package ca.bc.gov.educ.api.school.struct.v1; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Size; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* The type School entity. | ||
*/ | ||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class SchoolFundingGroup { | ||
|
||
@Size(max = 3) | ||
@NotNull(message = "distNo can not be null.") | ||
private String distNo; | ||
|
||
@Size(max = 5) | ||
@NotNull(message = "schlNo can not be null.") | ||
private String schlNo; | ||
|
||
private String mincode; | ||
|
||
private String fundingGroupCode; | ||
|
||
private String fundingGroupSubCode; | ||
|
||
private String formID; | ||
|
||
private String archiveStatus; | ||
|
||
private String createDate; | ||
|
||
private String createTime; | ||
|
||
private String createUsername; | ||
|
||
private String editDate; | ||
|
||
private String editTime; | ||
|
||
private String editUsername; | ||
|
||
} |
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 @@ | ||
CREATE SYNONYM SCHOOL_FUNDING_MASTER FOR SCHOOL_FUNDING_MASTER@SPMLINK.WORLD; |
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