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

fix: orchard null bec zone code and draft timestamp #1477

Merged
merged 2 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ public RevisionCountDto saveFormClassA(
entityToSave.setProgressStatus(parsedProgressStatus);
}

relatedSeedlot.setAuditInformation(loggedUserService.createAuditCurrentUser());

seedlotRepository.save(relatedSeedlot);

SaveSeedlotProgressEntityClassA saved = saveSeedlotProgressRepositoryClassA.save(entityToSave);

SparLog.info("A-class seedlot progress for seedlot number {} saved!", seedlotNumber);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,16 @@ public Optional<OrchardDto> findNotRetiredOrchardValidLotType(String id) {
}

List<String> bacZones = new ArrayList<>(1);
bacZones.add(orchardEntity.getBecZoneCode());
if (orchardEntity.getBecZoneCode() != null) {
bacZones.add(orchardEntity.getBecZoneCode());
}

Map<String, String> becZoneDescMap =
sparBecCatalogueService.getBecDescriptionsByCode(bacZones);

String becZoneDescription =
becZoneDescMap.isEmpty() ? null : becZoneDescMap.get(orchardEntity.getBecZoneCode());

OrchardDto orchardDto =
new OrchardDto(
orchardEntity.getId(),
Expand All @@ -75,7 +81,7 @@ public Optional<OrchardDto> findNotRetiredOrchardValidLotType(String id) {
orchardLotTypeCode.getDescription(),
orchardEntity.getStageCode(),
orchardEntity.getBecZoneCode(),
becZoneDescMap.get(orchardEntity.getBecZoneCode()),
becZoneDescription,
orchardEntity.getBecSubzoneCode(),
orchardEntity.getVariant(),
orchardEntity.getBecVersionId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public class SparBecCatalogueService {
* null.
*/
public Map<String, String> getBecDescriptionsByCode(List<String> becZoneCodes) {
SparLog.info("Begin service request to find the description of a given BEC zone code");
SparLog.info(
"Begin service request to find the description of a given BEC zone code {}", becZoneCodes);

if (becZoneCodes.isEmpty()) {
SparLog.info("No BEC Zone code param, returning empty values for BEC zone descriptions");
Expand Down
Loading