refactored to make use of the ServiceType enum throughout backend and frontend for typesafety

This commit is contained in:
2026-06-24 23:25:18 +02:00
parent 38c72d1bb8
commit fb64a7787f
24 changed files with 278 additions and 263 deletions
@@ -3,9 +3,10 @@ package com.vaessl.app.connection;
import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
public record ConnectionRequest(@NotBlank(message = "App URL is mandatory") String appUrl,
@NotBlank(message = "Service type is mandatory") String serviceType,
@NotNull(message = "Service type is mandatory") ServiceType serviceType,
String username, String password, String apiKey,
@JsonProperty(defaultValue = "false") Boolean stayLoggedIn) {
@@ -15,7 +16,7 @@ public record ConnectionRequest(@NotBlank(message = "App URL is mandatory") Stri
}
}
public ConnectionRequest(String appUrl, String serviceType, String username,
public ConnectionRequest(String appUrl, ServiceType serviceType, String username,
String password, Boolean stayLoggedIn) {
this(appUrl, serviceType, username, password, null, stayLoggedIn);
}