mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 16:56:56 +00:00
bugfix: Dynamic Entity Delete Cascade 2
This commit is contained in:
parent
4be926eda5
commit
f718168ea5
@ -783,6 +783,7 @@ object ErrorMessages {
|
||||
|
||||
// Cascade Deletion Exceptions (OBP-8XXXX)
|
||||
val CouldNotDeleteCascade = "OBP-80001: Could not delete cascade."
|
||||
val CannotDeleteCascadePersonalEntity = "OBP-80002: Cannot delete cascade for personal entities (hasPersonalEntity=true). Please delete the records and definition separately."
|
||||
|
||||
///////////
|
||||
|
||||
|
||||
@ -4062,11 +4062,16 @@ trait APIMethods600 {
|
||||
|1. Deletes all data records associated with the dynamic entity
|
||||
|2. Deletes the dynamic entity definition itself
|
||||
|
|
||||
|This operation is only allowed for non-personal entities (hasPersonalEntity=false).
|
||||
|For personal entities (hasPersonalEntity=true), you must delete the records and definition separately.
|
||||
|
|
||||
|Use with caution - this operation cannot be undone.
|
||||
|
|
||||
|For more information see ${Glossary.getGlossaryItemLink(
|
||||
"Dynamic-Entities"
|
||||
)}/
|
||||
|
|
||||
|${userAuthenticationMessage(true)}
|
||||
|
|
||||
|""",
|
||||
EmptyBody,
|
||||
@ -4099,6 +4104,10 @@ trait APIMethods600 {
|
||||
dynamicEntityId,
|
||||
cc.callContext
|
||||
)
|
||||
// Check if this is a personal entity - cascade delete not allowed for personal entities
|
||||
_ <- Helper.booleanToFuture(failMsg = CannotDeleteCascadePersonalEntity, cc = cc.callContext) {
|
||||
!entity.hasPersonalEntity
|
||||
}
|
||||
// Get all data records for this entity
|
||||
(box, _) <- NewStyle.function.invokeDynamicConnector(
|
||||
GET_ALL,
|
||||
@ -4108,7 +4117,7 @@ trait APIMethods600 {
|
||||
entity.bankId,
|
||||
None,
|
||||
None,
|
||||
entity.hasPersonalEntity,
|
||||
false,
|
||||
cc.callContext
|
||||
)
|
||||
resultList: JArray = unboxResult(
|
||||
@ -4126,7 +4135,7 @@ trait APIMethods600 {
|
||||
entity.entityName,
|
||||
recordId,
|
||||
None,
|
||||
entity.hasPersonalEntity
|
||||
false
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user