Skip to content

Commit

Permalink
PR Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilDigitalJustice committed Feb 2, 2024
1 parent 25d7a0d commit 2f8923d
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public ResponseEntity<ProceedingDetails> getProceedings(
final Boolean larScopeFlag,
final Pageable pageable) {

if (lead != null && lead) {

if (Boolean.TRUE.equals(lead)) {
return ResponseEntity.ok(proceedingService.getLeadProceedings(
categoryOfLaw,
matterType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public class LevelOfServiceId implements Serializable {
@Column(name = "PROCEEDING_CODE")
private String proceedingCode;

/**
* The level of service code.
*/
@Column(name = "LEVEL_OF_SERVICE_CODE")
private String levelOfServiceCode;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,22 @@
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public class MatterType {

/**
* The unique identifier for the matter type.
*/
@Id
@Column(name = "MATTER_TYPE")
private String matterType;

/**
* The matter type's description.
*/
@Column(name = "DESCRIPTION")
private String description;

/**
* The category of law code.
*/
@Column(name = "CATEGORY_OF_LAW_CODE")
private String categoryOfLawCode;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ProceedingClientInvolvementTypeId implements Serializable {
private String proceedingCode;

/**
* The stage end value.
* The client involvement type.
*/
@Column(name = "CLIENT_INVOLVEMENT_TYPE")
private String clientInvolvementType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public interface ProceedingRepository extends ReadOnlyRepository<Proceeding, Str
Page<Proceeding> findAllLeadProceedings(
@Param("categoryOfLaw") String categoryOfLaw,
@Param("matterType") String matterType,
@Param("amendmentOnly") String amendmentOnly,
@Param("enabled") String enabled,
@Param("larScopeFlag") String larScopeFlag,
@Param("amendmentOnly") Character amendmentOnly,
@Param("enabled") Character enabled,
@Param("larScopeFlag") Character larScopeFlag,
@Param("appOrCertType") String appOrCertType,
Pageable pageable);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import uk.gov.laa.ccms.data.entity.BooleanConverter;
import uk.gov.laa.ccms.data.entity.Proceeding;
import uk.gov.laa.ccms.data.mapper.ProceedingMapper;
import uk.gov.laa.ccms.data.model.ProceedingDetail;
Expand All @@ -31,6 +32,7 @@ public class ProceedingService extends AbstractEbsDataService {

private final ProceedingMapper proceedingMapper;


/**
* Get Proceedings which match the provided category of law, matter type,
* amendment only, and enabled values.
Expand Down Expand Up @@ -78,17 +80,15 @@ public ProceedingDetails getLeadProceedings(
Boolean larScopeFlag,
Pageable pageable) {

String amendmentOnlyString = (amendmentOnly != null) ? (amendmentOnly ? "Y" : "N") : null;
String enabledString = (enabled != null) ? (enabled ? "Y" : "N") : null;
String larScopeFlagString = (larScopeFlag != null) ? (larScopeFlag ? "Y" : "N") : null;
BooleanConverter booleanConverter = new BooleanConverter();

return proceedingMapper.toProceedingDetails(
proceedingRepository.findAllLeadProceedings(
categoryOfLaw,
matterType,
amendmentOnlyString,
enabledString,
larScopeFlagString,
booleanConverter.convertToDatabaseColumn(amendmentOnly),
booleanConverter.convertToDatabaseColumn(enabled),
booleanConverter.convertToDatabaseColumn(larScopeFlag),
applicationType,
pageable));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ void getProceedings_returnsPageOfProceeding() {
}, nullValues = "null")
void getLeadProceedings_returnsPageOfLeadProceeding(
Boolean amendmentOnly,
String expectedAmendmentOnlyString,
Character expectedAmendmentOnlyString,
Boolean enabled,
String expectedEnabledString,
Character expectedEnabledString,
Boolean larScope,
String expectedLarScopeString) {
Character expectedLarScopeString) {
String categoryOfLaw = "CAT1";
String matterType = "MAT1";
String appOrCertType = "APP1";
Expand Down

0 comments on commit 2f8923d

Please sign in to comment.