Skip to content

Commit

Permalink
notice-types: Check reference to business entities (TEDEFO-3225)
Browse files Browse the repository at this point in the history
  • Loading branch information
bertrand-lorentz committed May 15, 2024
1 parent a33a5e9 commit 8ddad4c
Show file tree
Hide file tree
Showing 10 changed files with 22,887 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,14 @@ then
results.add(new ValidationResult($nt, "Field " + $fieldId + " is missing the privacy field " + $privacyField + " under " + $unpublishGroupId, ValidationStatusEnum.ERROR));
end

rule "Business entity of the group is consistent with the node"
when
$group : /noticeTypes[ $nt: this ]/groups[ $groupId: id, $nodeId: nodeId, $businessEntityId: businessEntityId, businessEntityId != null ]
not (exists /businessEntities[ id == $businessEntityId, repeatsWithNodeId == $nodeId ])
then
results.add(new ValidationResult($nt, "Group " + $groupId + " references business entity " + $businessEntityId + " which does not correspond to the same node", ValidationStatusEnum.ERROR));
end

// TEDEFO-1845: Warning
// For every field in a notice type definition, all its repeatable ancestor should be in this notice type definition
rule "All repeatable ancestors of a field are in the notice type definition"
Expand Down
2,424 changes: 2,424 additions & 0 deletions src/test/resources/eforms-sdk-tests/tedefo-3225/invalid/fields/fields.json

Large diffs are not rendered by default.

Loading

0 comments on commit 8ddad4c

Please sign in to comment.