Feature/policies speichern verwalten - #15
Conversation
…nce" This reverts commit 5eb5a98.
…lten' into feature/policies-speichern-verwalten
| import java.util.List; | ||
| import java.util.UUID; | ||
|
|
||
| @Tag( |
There was a problem hiding this comment.
Für mich wäre es besser lesbar, wenn ihr die Swagger Annotationen in einer anderen Datei auslagert, z. B. PolicyApi als Interface.
| @UpdateTimestamp | ||
| @Column(name = "updated_at", nullable = false) | ||
| private Instant updatedAt; | ||
| private Instant updatedAt;; |
| import java.util.UUID; | ||
|
|
||
| @Service | ||
| public class PolicyService { |
There was a problem hiding this comment.
Für diese Klasse fehlen noch die Tests
| description = "Policies returned successfully" | ||
| ) | ||
| @GetMapping | ||
| public ResponseEntity<List<PolicyResponse>> getAllPolicies() { |
There was a problem hiding this comment.
Ich würde lieber für diese Methode Pagination anweden.
There was a problem hiding this comment.
Meinst du mit Pagination, dass sich auch der API-Response auf ein paginiertes Format wie Page<PolicyResponse> ändern soll? Dann müsste soweit ich das sehen kann noch was im Frontend angepasst werden, da dort noch Policy[] erwartet wird. Oder wäre es für dich ausreichend, intern mit Pageable zu arbeiten und nach außen weiterhin die Liste zurückzugeben?
There was a problem hiding this comment.
Ja, genau, so meinte ich das mit Page<PolicyResponse>. Frontend wird dann eventuell entsprechend angepasst
|
|
||
| private final PolicyService policyService; | ||
|
|
||
| public PolicyController(PolicyService policyService) { |
There was a problem hiding this comment.
Hier könnte man auch die Lombok Annotation anwenden
| private final OdrlPolicyMapper odrlPolicyService; | ||
|
|
||
| public PolicyService(PolicyRepository policyRepository, PolicyMapper policyMapper) { | ||
| public PolicyService( |
There was a problem hiding this comment.
Hier könnte man die Lombok Annotation anwenden
| @@ -0,0 +1,8 @@ | |||
| package org.constructx.policyhub.policies.domain; | |||
|
|
|||
| public enum ConstraintType { | |||
There was a problem hiding this comment.
Für mich wäre es doch besser, wenn ihr eine kurze Beschreibung über diesen Konstanten einfügt. Ggf. Verweis auf die entsprechende Doku.
| @@ -0,0 +1,6 @@ | |||
| package org.constructx.policyhub.policies.domain; | |||
|
|
|||
| public enum PolicyCategory { | |||
There was a problem hiding this comment.
Hier auch eine kurze Beschreibung, was diese beiden Policy Kategorien sind.
| @Schema( | ||
| description = """ | ||
| Ordered list of policy constraints. Supported types are | ||
| MEMBERSHIP, USE_CASE, END_DATE and FRAMEWORK_AGREEMENT. |
There was a problem hiding this comment.
Es wurde erkannt, dass bei PolicyValidator.SUPPORTED_TYPES kein Typ wie "END_DATE" nicht existiert. Vielleicht meint ihr "DATE_RANGE"?
| private final PolicyRepository policyRepository; | ||
| private final PolicyMapper policyMapper; | ||
| private final PolicyValidator policyValidator; | ||
| private final OdrlPolicyMapper odrlPolicyService; |
There was a problem hiding this comment.
Bitte hier den Attributnamen auf odrlPolicyMapper umbenennen
Description
Adds the backend foundation for centrally storing, managing, validating, and retrieving policies.
This includes:
Linked Issue(s)