|
3 | 3 | import io.micronaut.core.annotation.Introspected; |
4 | 4 | import io.micronaut.serde.annotation.Serdeable; |
5 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | +import jakarta.validation.constraints.NotBlank; |
| 7 | +import jakarta.validation.constraints.NotEmpty; |
| 8 | +import jakarta.validation.constraints.Positive; |
| 9 | +import jakarta.validation.constraints.PositiveOrZero; |
6 | 10 | import net.onelitefeather.vulpes.api.model.AttributeEntity; |
7 | 11 |
|
8 | 12 | import java.util.UUID; |
|
13 | 17 | public record AttributeModelDTO( |
14 | 18 | @Schema(description = "ID of the attribute", requiredMode = Schema.RequiredMode.NOT_REQUIRED) UUID id, |
15 | 19 | @Schema(description = "The name for the ui", requiredMode = Schema.RequiredMode.REQUIRED) String uiName, |
16 | | - @Schema(description = "The name which represents the variable after the generation", requiredMode = Schema.RequiredMode.REQUIRED) String variableName, |
17 | | - @Schema(description = "Default value of the attribute", requiredMode = Schema.RequiredMode.REQUIRED) double defaultValue, |
18 | | - @Schema(description = "Maximum value of the attribute", requiredMode = Schema.RequiredMode.REQUIRED) double maximumValue |
| 20 | + @Schema(description = "The name which represents the variable after the generation", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty @NotBlank String variableName, |
| 21 | + @Schema(description = "Default value of the attribute", requiredMode = Schema.RequiredMode.REQUIRED) @PositiveOrZero double defaultValue, |
| 22 | + @Schema(description = "Maximum value of the attribute", requiredMode = Schema.RequiredMode.REQUIRED) @Positive double maximumValue |
19 | 23 | ) { |
20 | 24 | public AttributeEntity toAttributeModel() { |
21 | 25 | return new AttributeEntity(id, uiName, variableName, defaultValue, maximumValue); |
|
0 commit comments