1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package de.kaiserpfalzedv.commons.core.workflow;
19
20 import java.util.UUID;
21
22 import org.eclipse.microprofile.openapi.annotations.media.Schema;
23
24 import com.fasterxml.jackson.annotation.JsonInclude;
25
26 import de.kaiserpfalzedv.commons.api.workflow.WorkflowInfo;
27 import lombok.AllArgsConstructor;
28 import lombok.Builder;
29 import lombok.EqualsAndHashCode;
30 import lombok.Getter;
31 import lombok.NoArgsConstructor;
32 import lombok.ToString;
33 import lombok.extern.jackson.Jacksonized;
34
35
36
37
38
39
40
41
42
43
44 @Jacksonized
45 @Builder(toBuilder = true)
46 @AllArgsConstructor
47 @NoArgsConstructor
48 @ToString
49 @EqualsAndHashCode
50 @Getter
51 @JsonInclude(JsonInclude.Include.NON_ABSENT)
52 @Schema(name = "WorkflowInfo", description = "Information of a workflow call.")
53 public class WorkflowInfoImpl implements WorkflowInfo {
54 private static final long serialVersionUID = 0L;
55
56 @Builder.Default
57 private final WorkflowDetailInfoImpl workflow = WorkflowDetailInfoImpl.builder().build();
58
59 @Schema(
60 description = "The action within the workflow this call belongs to.",
61 required = true,
62 example = "{\"name\": \"check-duplicate\", \"id\": \"81f76259-e9fa-4af2-bba7-255f7370fe41\", \"created\": \"2022-01-04T14:22:00.023000Z\", \"ttl\": \"2022-01-04T14:22:02.023000Z\"}"
63 )
64 @Builder.Default
65 private final WorkflowDetailInfoImpl action = WorkflowDetailInfoImpl.builder().build();
66
67 @Schema(
68 description = "The actual service call.",
69 required = true,
70 example = "{\"name\": \"get-user\", \"id\": \"69de33eb-6a9d-4010-9fb9-e35a4ac56eb8\", \"created\": \"2022-01-04T14:22:00.028000Z\", \"ttl\": \"2022-01-04T14:22:01.028000Z\"}"
71 )
72 @Builder.Default
73 private final WorkflowDetailInfoImpl call = WorkflowDetailInfoImpl.builder().build();
74
75 @Schema(
76 description = "The owner of this request. Can be an ID, a name or anything else. Please keep GDPR in mind!",
77 example = "klenkes74",
78 defaultValue = "Random UUID",
79 nullable = true,
80 minLength = 1,
81 maxLength = 100
82 )
83 @Builder.Default
84 private final String user = UUID.randomUUID().toString();
85 }