Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/3.4.0 #45

Merged
merged 17 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
7d6367c
PIM-1627: Merge Forage Inventory Rollover updates from feature/3.3.2.
dpitk2222 Aug 28, 2024
a893e01
PIM-1627: Updates to Forage Inventory Rollover from code review.
dpitk2222 Aug 28, 2024
3580f92
Merge pull request #34 from bcgov/feature/PIM-1627-forage-inv-rollover
dpitk2222 Aug 29, 2024
dac4a8b
PIM-1600: Dependency Injection fix for Grain Unseeded and Seeded comp…
dpitk2222 Aug 30, 2024
9705434
PIM-1600: Pass etag back with InventoryContract PUT request for Add a…
dpitk2222 Sep 3, 2024
51e01f5
Merge pull request #35 from bcgov/feature/PIM-1600-etag-issue-linking…
dpitk2222 Sep 3, 2024
abaeb94
Merge pull request #36 from bcgov/feature/3.4.0
dpitk2222 Sep 4, 2024
c4e52c7
Disable underwriting-api-ci.yml for release branches
dpitk2222 Sep 9, 2024
bc2de99
Disable underwriting-api-ci.yml for release branches
dpitk2222 Sep 9, 2024
fbacfac
Change cirras-underwriting-api to release version 3.4.0.
dpitk2222 Sep 9, 2024
bce2edd
Changed cirras-underwriting-war to release version 3.4.0.
dpitk2222 Sep 9, 2024
5dcffdd
Update parameters for CPU/memory usage
vivid-cpreston Sep 9, 2024
177e890
Merge pull request #38 from bcgov/feature/memory-cpu-update
vivid-cpreston Sep 9, 2024
263b297
Setting to release version 3.4.0.
dpitk2222 Sep 10, 2024
213ad35
Merge remaining updates from cirras-underwriting-reports-jrs release/…
dpitk2222 Sep 10, 2024
9215e70
Merge pull request #39 from bcgov/feature/3.4.0
dpitk2222 Sep 11, 2024
f098f1d
Set jasper to recreate instead of rollingupdate
vivid-cpreston Sep 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/openshift-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
TAG: ${{ inputs.TAG }}
SID: ${{ github.run_id }}
LOG_LEVEL: ${{ vars.LOG_LEVEL }}
MAX_APP_COUNT: ${{ vars.MAX_APP_COUNT }}


WEBADE_CHECK_TOKEN_URL: ${{ vars.WEBADE_CHECK_TOKEN_URL }}
WEBADE_GET_TOKEN_URL: ${{ vars.WEBADE_GET_TOKEN_URL }}
Expand All @@ -83,6 +83,12 @@ jobs:


#API variables
API_CPU_REQUEST: ${{ vars.API_CPU_REQUEST }}
API_CPU_LIMIT: ${{ vars.API_CPU_LIMIT }}
API_MEMORY_REQUEST: ${{ vars.API_MEMORY_REQUEST }}
API_MEMORY_LIMIT: ${{ vars.API_MEMORY_LIMIT }}
MAX_API_COUNT: ${{ vars.MAX_APP_COUNT }}

POSTGRES_RESOURCE_NAME: ${{ vars.POSTGRES_RESOURCE_NAME }}

MAX_THREADS: ${{ vars.MAX_THREADS }}
Expand All @@ -108,6 +114,7 @@ jobs:


#Frontend variables
MAX_UI_COUNT: ${{ vars.MAX_UI_COUNT }}
BASE_URL: https://cirras-underwriting-ui-route-${{ inputs.ENVIRONMENT_NAME }}-${{inputs.NAMESPACE}}.apps.silver.devops.gov.bc.ca/pub/cirras-underwriting/
CIRRAS_UNDERWRITING_REST_URI: https://cirras-underwriting-api-route-${{ inputs.ENVIRONMENT_NAME }}-${{inputs.NAMESPACE}}.apps.silver.devops.gov.bc.ca/cirras-underwriting-api/v1
WEBADE_CIRRAS_UNDERWRITING_UI_SECRET: ${{secrets.WEBADE_CIRRAS_UNDERWRITING_UI_SECRET}}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/underwriting-api-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request_target:
branches:
- main
- release/*
paths:
- cirras-underwriting-api/**

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ compose.yaml
local-config
cirras-underwriting-api/cirras-underwriting-api-rest-endpoints/src/test/resources/static.properties
cirras-underwriting-api/cirras-underwriting-persistence/src/test/resources/static.properties
cirras-underwriting-war/cirras-underwriting-war/src/main/angular/package-lock.json
2 changes: 1 addition & 1 deletion cirras-underwriting-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM tomcat:9.0.86-jre17

COPY ./cirras-underwriting-api-rest-endpoints/target/cirras-underwriting-api-rest-endpoints-3.4.0-SNAPSHOT.war .
COPY ./cirras-underwriting-api-rest-endpoints/target/cirras-underwriting-api-rest-endpoints-3.4.0.war .
COPY ./deploy-tools ./deploy-tools

RUN ls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>ca.bc.gov.mal.cirras.underwriting</groupId>
<artifactId>cirras-underwriting-api-parent</artifactId>
<version>3.4.0-SNAPSHOT</version>
<version>3.4.0</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>ca.bc.gov.mal.cirras.underwriting</groupId>
<artifactId>cirras-underwriting-api-parent</artifactId>
<version>3.4.0-SNAPSHOT</version>
<version>3.4.0</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>ca.bc.gov.mal.cirras.underwriting</groupId>
<artifactId>cirras-underwriting-api-parent</artifactId>
<version>3.4.0-SNAPSHOT</version>
<version>3.4.0</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>ca.bc.gov.mal.cirras.underwriting</groupId>
<artifactId>cirras-underwriting-api-parent</artifactId>
<version>3.4.0-SNAPSHOT</version>
<version>3.4.0</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ public AnnualFieldRsrc addRolloverAnnualField(Integer insurancePlanId, Contracte
//
// //return model;
// }

private void populateDefaultResource(InventoryContractRsrc resource, PolicyDto dto) {

resource.setContractId(dto.getContractId());
Expand Down Expand Up @@ -593,15 +593,21 @@ private InventoryField createRolloverInventoryField(Integer insurancePlanId, Con
if (insurancePlanId.equals(InventoryServiceEnums.InsurancePlans.GRAIN.getInsurancePlanId())) {
model.setInventoryUnseeded(createRolloverInventoryUnseeded(ifDto.getAcresToBeSeeded(), ifDto.getLastYearCropVarietyId(), ifDto.getIsGrainUnseededDefaultInd()));
}

//Inventory seeded Forage
if (insurancePlanId.equals(InventoryServiceEnums.InsurancePlans.FORAGE.getInsurancePlanId())) {

List<InventorySeededForage> inventorySeededForageList = new ArrayList<InventorySeededForage>();
inventorySeededForageList.add(createRolloverInventorySeedeForage());
if ( ifDto.getInventorySeededForages() != null && ifDto.getInventorySeededForages().size() > 0 ) {
InventorySeededForageDto isfDto = ifDto.getInventorySeededForages().get(0);
inventorySeededForageList.add(createRolloverInventorySeededForage(isfDto));
} else {
inventorySeededForageList.add(createDefaultInventorySeededForage());
}

model.setInventorySeededForages(inventorySeededForageList);
}


return model;
}

Expand Down Expand Up @@ -631,14 +637,65 @@ private InventoryField createDefaultInventoryField(Integer insurancePlanId, Cont
//Inventory seeded Forage
if (insurancePlanId.equals(InventoryServiceEnums.InsurancePlans.FORAGE.getInsurancePlanId())) {
List<InventorySeededForage> inventorySeededForageList = new ArrayList<InventorySeededForage>();
inventorySeededForageList.add(createRolloverInventorySeedeForage());
inventorySeededForageList.add(createDefaultInventorySeededForage());
model.setInventorySeededForages(inventorySeededForageList);
}

return model;
}

private InventorySeededForage createRolloverInventorySeedeForage() {
private InventorySeededForage createRolloverInventorySeededForage(InventorySeededForageDto dto) {
InventorySeededForage model = new InventorySeededForage();

if ( "PERENNIAL".equals(dto.getCommodityTypeCode()) || "Pasture".equals(dto.getCommodityTypeCode()) || "Native Wetland".equals(dto.getCommodityTypeCode()) || "Forage Seed".equals(dto.getCommodityTypeCode())) {
model.setCropCommodityId(dto.getCropCommodityId());
model.setCropVarietyId(dto.getCropVarietyId());
model.setCropVarietyName(dto.getCropVarietyName());
model.setCommodityTypeCode(dto.getCommodityTypeCode());
model.setSeedingYear(dto.getSeedingYear());
model.setIsQuantityInsurableInd(dto.getIsQuantityInsurableInd());

// Calculate new Plant Insurability
String prevPlanIns = dto.getPlantInsurabilityTypeCode();
String rolloverPlantIns = null;

if ("E1".equals(prevPlanIns) ) {
rolloverPlantIns = "E2";
}
else if ("E2".equals(prevPlanIns) ) {
rolloverPlantIns = null;
}
else if ("W1".equals(prevPlanIns) ) {
rolloverPlantIns = "W2";
}
else if ("W2".equals(prevPlanIns) ) {
rolloverPlantIns = "W3";
}
else if ("W3".equals(prevPlanIns) ) {
rolloverPlantIns = null;
}

model.setPlantInsurabilityTypeCode(rolloverPlantIns);

} else {
model.setCropCommodityId(null);
model.setCropVarietyId(null);
model.setCropVarietyName(null);
model.setCommodityTypeCode(null);
model.setSeedingYear(null);
model.setIsQuantityInsurableInd(false);
model.setPlantInsurabilityTypeCode(null);
}

model.setFieldAcres(dto.getFieldAcres());
model.setSeedingDate(null); // Does not rollover.
model.setIsIrrigatedInd(dto.getIsIrrigatedInd());
model.setIsAwpEligibleInd(dto.getIsAwpEligibleInd());

return model;
}

private InventorySeededForage createDefaultInventorySeededForage() {
InventorySeededForage model = new InventorySeededForage();

model.setCropCommodityId(null);
Expand All @@ -651,11 +708,12 @@ private InventorySeededForage createRolloverInventorySeedeForage() {
model.setIsIrrigatedInd(null);
model.setIsQuantityInsurableInd(null);
model.setPlantInsurabilityTypeCode(null);
model.setIsAwpEligibleInd(true); //Default = true
model.setIsAwpEligibleInd(true); // Default true.

return model;
}



private InventoryUnseeded createRolloverInventoryUnseeded(Double acresToBeSeeded, Integer lastYearVarietyId, Boolean isGrainUnseededDefault) {
InventoryUnseeded model = new InventoryUnseeded();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public class AnnualFieldRolloverInvEndpointTest extends EndpointsTest {
};




@Test
public void testAnnualFieldsRolloverInventoryFromPreviousYear() throws CirrasUnderwritingServiceException, Oauth2ClientException {
logger.debug("<testAnnualFieldsRolloverInventoryFromPreviousYear");
Expand Down
Loading
Loading