FINERACT-2421: Rework code value handling in E2E

This commit is contained in:
Adam Saghy
2026-01-16 17:59:14 +01:00
parent 0f73ae1eb7
commit 0891adb267
18 changed files with 328 additions and 148 deletions
@@ -1257,6 +1257,14 @@ public class CommandWrapperBuilder {
return this;
}
public CommandWrapperBuilder createCodeValue(final Long codeId, String codeName) {
this.actionName = "CREATE";
this.entityName = "CODEVALUE";
this.entityId = codeId;
this.href = "/codes/name/" + codeName + "/codevalues/template";
return this;
}
public CommandWrapperBuilder updateCodeValue(final Long codeId, final Long codeValueId) {
this.actionName = "UPDATE";
this.entityName = "CODEVALUE";
@@ -1266,6 +1274,15 @@ public class CommandWrapperBuilder {
return this;
}
public CommandWrapperBuilder updateCodeValue(String codeName, Long codeId, Long codeValueId) {
this.actionName = "UPDATE";
this.entityName = "CODEVALUE";
this.entityId = codeId;
this.subentityId = codeValueId;
this.href = "/codes/name/" + codeName + "/codevalues/" + codeValueId;
return this;
}
public CommandWrapperBuilder deleteCodeValue(final Long codeId, final Long codeValueId) {
this.actionName = "DELETE";
this.entityName = "CODEVALUE";
@@ -1275,6 +1292,15 @@ public class CommandWrapperBuilder {
return this;
}
public CommandWrapperBuilder deleteCodeValue(String codeName, Long codeId, Long codeValueId) {
this.actionName = "DELETE";
this.entityName = "CODEVALUE";
this.entityId = codeId;
this.subentityId = codeValueId;
this.href = "/codes/name/" + codeName + "/codevalues/" + codeValueId;
return this;
}
public CommandWrapperBuilder createGLClosure() {
this.actionName = "CREATE";
this.entityName = "GLCLOSURE";
@@ -18,6 +18,7 @@
*/
package org.apache.fineract.infrastructure.codes.domain;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
@@ -26,4 +27,6 @@ public interface CodeValueRepository extends JpaRepository<CodeValue, Long>, Jpa
CodeValue findByCodeNameAndId(String codeName, Long id);
CodeValue findByCodeNameAndLabel(String codeName, String label);
List<CodeValue> findByCodeName(String codeName);
}
@@ -27,5 +27,5 @@ public interface CodeReadPlatformService {
CodeData retrieveCode(Long codeId);
CodeData retriveCode(String codeName);
CodeData retrieveCode(String codeName);
}
@@ -46,4 +46,8 @@ public interface CodeValueReadPlatformService {
Collection<CodeValueData> retrieveAllCodeValues(Long codeId);
CodeValueData retrieveCodeValue(Long codeValueId);
List<CodeValueData> retrieveAllCodeValues(String codeName);
CodeValueData retrieveCodeValue(String codeName, Long codeValueId);
}