Skip to content

Commit

Permalink
chore: fixing reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
paulushcgcj committed Dec 20, 2024
1 parent 59d2e40 commit c76085e
Show file tree
Hide file tree
Showing 38 changed files with 122 additions and 96 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,92 @@
package ca.bc.gov.restapi.results.common.configuration;

import ca.bc.gov.restapi.results.common.dto.ForestClientAutocompleteResultDto;
import ca.bc.gov.restapi.results.common.dto.ForestClientDto;
import ca.bc.gov.restapi.results.common.dto.ForestClientLocationDto;
import ca.bc.gov.restapi.results.common.dto.IdNameDto;
import ca.bc.gov.restapi.results.common.dto.OracleLogDto;
import ca.bc.gov.restapi.results.common.dto.WmsLayersWhitelistUserDto;
import ca.bc.gov.restapi.results.common.enums.ForestClientStatusEnum;
import ca.bc.gov.restapi.results.common.enums.ForestClientTypeEnum;
import ca.bc.gov.restapi.results.common.enums.YesNoEnum;
import ca.bc.gov.restapi.results.common.pagination.PaginatedResult;
import ca.bc.gov.restapi.results.common.pagination.PaginationParameters;
import ca.bc.gov.restapi.results.oracle.converter.OpeningCategoryConverter;
import ca.bc.gov.restapi.results.oracle.converter.OpeningStatusConverter;
import ca.bc.gov.restapi.results.oracle.dto.CodeDescriptionDto;
import ca.bc.gov.restapi.results.oracle.dto.OpeningSearchFiltersDto;
import ca.bc.gov.restapi.results.oracle.dto.OpeningSearchResponseDto;
import ca.bc.gov.restapi.results.oracle.dto.RecentOpeningDto;
import ca.bc.gov.restapi.results.oracle.entity.ClientAcronymEntity;
import ca.bc.gov.restapi.results.oracle.entity.CutBlockOpenAdminEntity;
import ca.bc.gov.restapi.results.oracle.entity.OpenCategoryCodeEntity;
import ca.bc.gov.restapi.results.oracle.entity.OpeningAttachmentEntity;
import ca.bc.gov.restapi.results.oracle.entity.OpeningEntity;
import ca.bc.gov.restapi.results.oracle.entity.OrgUnitEntity;
import ca.bc.gov.restapi.results.oracle.entity.ResultsElectronicSubmissionEntity;
import ca.bc.gov.restapi.results.oracle.enums.AuditActionCodeEnum;
import ca.bc.gov.restapi.results.oracle.enums.OpeningCategoryEnum;
import ca.bc.gov.restapi.results.oracle.enums.OpeningStatusEnum;
import ca.bc.gov.restapi.results.postgres.dto.DashboardFiltersDto;
import ca.bc.gov.restapi.results.postgres.dto.FreeGrowingMilestonesDto;
import ca.bc.gov.restapi.results.postgres.dto.MyRecentActionsRequestsDto;
import ca.bc.gov.restapi.results.postgres.dto.OpeningsPerYearDto;
import ca.bc.gov.restapi.results.postgres.dto.UserRecentOpeningDto;
import ca.bc.gov.restapi.results.postgres.entity.OpeningsActivityEntity;
import ca.bc.gov.restapi.results.postgres.entity.OpeningsActivityEntityId;
import ca.bc.gov.restapi.results.postgres.entity.OpeningsLastYearEntity;
import ca.bc.gov.restapi.results.postgres.entity.OracleExtractionLogsEntity;
import ca.bc.gov.restapi.results.postgres.entity.UserOpeningEntity;
import ca.bc.gov.restapi.results.postgres.entity.UserOpeningEntityId;
import ca.bc.gov.restapi.results.postgres.entity.UserRecentOpeningEntity;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;

@Configuration
@RegisterReflectionForBinding({
ForestClientAutocompleteResultDto.class,
ForestClientDto.class,
ForestClientLocationDto.class,
IdNameDto.class,
OracleLogDto.class,
WmsLayersWhitelistUserDto.class,
ForestClientStatusEnum.class,
ForestClientTypeEnum.class,
YesNoEnum.class,
PaginatedResult.class,
PaginationParameters.class,
OpeningCategoryConverter.class,
OpeningStatusConverter.class,
CodeDescriptionDto.class,
OpeningSearchFiltersDto.class,
OpeningSearchResponseDto.class,
RecentOpeningDto.class,
ClientAcronymEntity.class,
CutBlockOpenAdminEntity.class,
OpenCategoryCodeEntity.class,
OpeningAttachmentEntity.class,
OpeningEntity.class,
OrgUnitEntity.class,
ResultsElectronicSubmissionEntity.class,
AuditActionCodeEnum.class,
OpeningCategoryEnum.class,
OpeningStatusEnum.class,
DashboardFiltersDto.class,
FreeGrowingMilestonesDto.class,
MyRecentActionsRequestsDto.class,
OpeningsPerYearDto.class,
UserRecentOpeningDto.class,
OpeningsActivityEntity.class,
OpeningsActivityEntityId.class,
OpeningsLastYearEntity.class,
OracleExtractionLogsEntity.class,
UserOpeningEntity.class,
UserOpeningEntityId.class,
UserRecentOpeningEntity.class,
})
public class SilvaGlobalConfiguration {

@Bean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package ca.bc.gov.restapi.results.common.dto;

import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

@RegisterReflectionForBinding
@With
public record ForestClientAutocompleteResultDto(
String id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
import java.util.stream.Stream;
import lombok.Builder;
import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;
import org.springframework.data.annotation.Transient;

/**
* This record represents a Forest Client object.
*/
@RegisterReflectionForBinding
@Builder
@With
public record ForestClientDto(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import ca.bc.gov.restapi.results.common.enums.YesNoEnum;
import java.time.LocalDate;
import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

@RegisterReflectionForBinding
@With
public record ForestClientLocationDto(
String clientNumber,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package ca.bc.gov.restapi.results.common.dto;

import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

@RegisterReflectionForBinding
@With
public record IdNameDto(
String id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
import java.time.LocalDateTime;
import lombok.Builder;
import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/**
* This record holds messages and its local date time when it happened.
*/
@RegisterReflectionForBinding
@Builder
@With
public record OracleLogDto(String message, LocalDateTime eventTime) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

import lombok.Builder;
import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/**
* This record represents a user in the whitelist.
*/
@RegisterReflectionForBinding
@Builder
@With
public record WmsLayersWhitelistUserDto(String userName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/** This enum contains all forest client statuses codes and descriptions. */
/**
* This enum contains all forest client statuses codes and descriptions.
*/
@Getter
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@RegisterReflectionForBinding
public enum ForestClientStatusEnum {
@JsonProperty("ACT")
ACTIVE("ACT", "Active"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/** This enum contains all forest client types codes and descriptions. */
/**
* This enum contains all forest client types codes and descriptions.
*/
@Getter
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@RegisterReflectionForBinding
public enum ForestClientTypeEnum {
@JsonProperty("A")
ASSOCIATION('A', "Association"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

@RegisterReflectionForBinding
public enum YesNoEnum {
YES("Y"),
NO("N");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import jakarta.persistence.AttributeConverter;
import jakarta.persistence.Converter;
import java.util.Objects;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/** This class represents a column converter for the opening category column. */
/**
* This class represents a column converter for the opening category column.
*/
@Converter(autoApply = true)
@RegisterReflectionForBinding
public class OpeningCategoryConverter implements AttributeConverter<OpeningCategoryEnum, String> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import jakarta.persistence.AttributeConverter;
import jakarta.persistence.Converter;
import java.util.Objects;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/** This class represents a column converter for the opening status column. */
/**
* This class represents a column converter for the opening status column.
*/
@Converter(autoApply = true)
@RegisterReflectionForBinding
public class OpeningStatusConverter implements AttributeConverter<OpeningStatusEnum, String> {

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package ca.bc.gov.restapi.results.oracle.dto;

import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

@RegisterReflectionForBinding
@With
public record CodeDescriptionDto(
String code,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.BooleanUtils;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;
import org.springframework.util.CollectionUtils;

/**
* This record contains all possible filters when using the Opening Search API.
*/
@RegisterReflectionForBinding
@Slf4j
@Getter
@ToString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/**
* This class represents a record of the opening search api response.
*/
@RegisterReflectionForBinding
@Data
@Builder
@With
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
import java.time.LocalDateTime;
import lombok.Builder;
import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/**
* Represents a Recent Opening in the Home screen.
*/
@RegisterReflectionForBinding
@Builder
@With
public record RecentOpeningDto(
Expand All @@ -28,4 +26,5 @@ public record RecentOpeningDto(
LocalDateTime entryTimestamp,
LocalDateTime updateTimestamp
) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/**
* This class represents a Client Acronym in the database.
*/
@RegisterReflectionForBinding
@Data
@Builder
@With
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/**
* This class represents a CUT_BLOCK_OPEN_ADMIN entity in the database.
*/
@RegisterReflectionForBinding
@Data
@Builder
@With
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/**
* This class represents an Opening Category in the database.
*/
@RegisterReflectionForBinding
@Data
@Builder
@With
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/**
* This class represents an Opening Attachment in the database.
*/
@RegisterReflectionForBinding
@Data
@Builder
@With
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/**
* This class represents an Opening in the database.
*/
@RegisterReflectionForBinding
@Data
@Builder
@With
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/**
* This class represents an Organization Unity in the database.
*/
@RegisterReflectionForBinding
@Data
@Builder
@With
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.With;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

/**
* This class represents an Electronic Submission for the Openings in the database.
*/
@RegisterReflectionForBinding
@Data
@Builder
@With
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;

@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
@RegisterReflectionForBinding
public enum AuditActionCodeEnum {
UPD("UPD", "Update"),
COR("COR", "Correction"),
Expand Down
Loading

0 comments on commit c76085e

Please sign in to comment.