Skip to content

Commit 09617cc

Browse files
committed
chore(notification): add new validation layer
1 parent f7b0f0d commit 09617cc

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/main/java/net/onelitefeather/vulpes/backend/domain/notification/NotificationModelDTO.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
import io.micronaut.core.annotation.Introspected;
66
import io.micronaut.serde.annotation.Serdeable;
77
import io.swagger.v3.oas.annotations.media.Schema;
8+
import jakarta.validation.constraints.NotBlank;
9+
import jakarta.validation.constraints.NotEmpty;
810
import jakarta.validation.constraints.NotNull;
911
import net.onelitefeather.vulpes.api.model.NotificationEntity;
1012

1113
@Schema(requiredProperties = {
1214
"uiName",
1315
"variableName",
14-
"description",
16+
"comment",
1517
"material",
1618
"frameType",
1719
"title"
@@ -20,12 +22,12 @@
2022
@Serdeable
2123
public record NotificationModelDTO(
2224
@Schema(description = "ID of the notification", requiredMode = Schema.RequiredMode.NOT_REQUIRED) UUID id,
23-
@Schema(description = "Model variableName for the UI", requiredMode = Schema.RequiredMode.REQUIRED) String uiName,
24-
@Schema(description = "Name in the UI", requiredMode = Schema.RequiredMode.REQUIRED) String variableName,
25-
@Schema(description = "Description of the notification", requiredMode = Schema.RequiredMode.REQUIRED) String description,
26-
@Schema(description = "Material identifier", requiredMode = Schema.RequiredMode.REQUIRED) String material,
27-
@Schema(description = "Type of frame", requiredMode = Schema.RequiredMode.REQUIRED) String frameType,
28-
@Schema(description = "Title of the notification", requiredMode = Schema.RequiredMode.REQUIRED) String title
25+
@Schema(description = "Model variableName for the UI", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank @NotEmpty String uiName,
26+
@Schema(description = "Name in the UI", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank @NotEmpty String variableName,
27+
@Schema(description = "Comment of the notification", requiredMode = Schema.RequiredMode.REQUIRED) String comment,
28+
@Schema(description = "Material identifier", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank @NotEmpty String material,
29+
@Schema(description = "Type of frame", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank @NotEmpty String frameType,
30+
@Schema(description = "Title of the notification", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank @NotEmpty String title
2931
) {
3032

3133
/**
@@ -37,7 +39,7 @@ public record NotificationModelDTO(
3739
this.id,
3840
uiName,
3941
variableName,
40-
description,
42+
comment,
4143
material,
4244
frameType,
4345
title

0 commit comments

Comments
 (0)