[#1580] Software Module & Distribution Set lock: add lock at rest level (#1646)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-02-15 11:46:06 +02:00
committed by GitHub
parent e535420065
commit 850fa3507f
17 changed files with 123 additions and 35 deletions

View File

@@ -285,6 +285,10 @@ public class JpaDistributionSetManagement implements DistributionSetManagement {
update.getDescription().ifPresent(set::setDescription);
update.getVersion().ifPresent(set::setVersion);
if (Boolean.TRUE.equals(update.getLocked()) && !set.isLocked()) {
set.lock();
}
if (update.isRequiredMigrationStep() != null
&& !update.isRequiredMigrationStep().equals(set.isRequiredMigrationStep())) {
assertDistributionSetIsNotAssignedToTargets(update.getId());

View File

@@ -142,6 +142,9 @@ public class JpaSoftwareModuleManagement implements SoftwareModuleManagement {
update.getDescription().ifPresent(module::setDescription);
update.getVendor().ifPresent(module::setVendor);
if (Boolean.TRUE.equals(update.getLocked()) && !module.isLocked()) {
module.lock();
}
return softwareModuleRepository.save(module);
}