chore: entferne nicht mehr genutzten Code und Backup-Dateien aus shared-Modul
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
package at.mocode.shared.core
|
|
||||||
|
|
||||||
data class AppConfig(
|
|
||||||
val gatewayUrl: String,
|
|
||||||
val isDebug: Boolean
|
|
||||||
)
|
|
||||||
|
|
||||||
// Standard-Config für Local Development
|
|
||||||
val devConfig = AppConfig(
|
|
||||||
gatewayUrl = "http://localhost:8081",
|
|
||||||
isDebug = true
|
|
||||||
)
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
package at.mocode.shared.core
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shared application configuration constants for clients.
|
|
||||||
* These defaults target local development environments.
|
|
||||||
*/
|
|
||||||
object AppConstants {
|
|
||||||
// Gateway base URL (reverse proxy / API gateway)
|
|
||||||
// Used by NetworkConfig via PlatformConfig
|
|
||||||
const val GATEWAY_URL: String = "http://localhost:8081"
|
|
||||||
|
|
||||||
// Keycloak configuration
|
|
||||||
const val KEYCLOAK_URL: String = "http://localhost:8180"
|
|
||||||
const val KEYCLOAK_REALM: String = "meldestelle"
|
|
||||||
|
|
||||||
// Use 'postman-client' for Desktop App Password Flow (Direct Access Grants enabled)
|
|
||||||
// 'web-app' is for Browser Flow (PKCE)
|
|
||||||
// TODO: Make this platform-dependent (Desktop vs Web)
|
|
||||||
const val KEYCLOAK_CLIENT_ID: String = "web-app"
|
|
||||||
|
|
||||||
// DEV ONLY: Client Secret for 'postman-client' (Confidential Client)
|
|
||||||
// In Production, this should NEVER be in the frontend code.
|
|
||||||
// For the Desktop App Pilot, we use this to simulate a secure client.
|
|
||||||
// For 'web-app' (Public Client), this is not needed/used if configured correctly,
|
|
||||||
// but our AuthApiClient might be sending it.
|
|
||||||
const val KEYCLOAK_CLIENT_SECRET: String = "postman-secret-123"
|
|
||||||
|
|
||||||
// Removed unused browser flow URLs (registerUrl, loginUrl, etc.) as we focus on Desktop App.
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package at.mocode.shared.domain.model
|
|
||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generischer Wrapper für API-Antworten.
|
|
||||||
*/
|
|
||||||
@Serializable
|
|
||||||
data class ApiResponse<T>(
|
|
||||||
val success: Boolean,
|
|
||||||
val data: T? = null,
|
|
||||||
val error: ApiError? = null
|
|
||||||
)
|
|
||||||
|
|
||||||
@Serializable
|
|
||||||
data class ApiError(
|
|
||||||
val code: String,
|
|
||||||
val message: String,
|
|
||||||
val details: Map<String, String> = emptyMap()
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Das Ergebnis eines Repository-Aufrufs.
|
|
||||||
* Die UI kennt nur das hier, keine HTTP-Exceptions!
|
|
||||||
*/
|
|
||||||
sealed class Resource<out T> {
|
|
||||||
data class Success<T>(val data: T) : Resource<T>()
|
|
||||||
data class Error(val message: String, val code: String? = null) : Resource<Nothing>()
|
|
||||||
data object Loading : Resource<Nothing>()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Datenmodell für den Ping.
|
|
||||||
*/
|
|
||||||
@Serializable
|
|
||||||
data class PingData(
|
|
||||||
val status: String,
|
|
||||||
val timestamp: String,
|
|
||||||
val service: String
|
|
||||||
)
|
|
||||||
|
|
||||||
-37
@@ -1,37 +0,0 @@
|
|||||||
package at.mocode.shared.presentation.actions
|
|
||||||
|
|
||||||
import at.mocode.shared.presentation.state.Notification
|
|
||||||
import at.mocode.frontend.core.domain.models.User
|
|
||||||
import at.mocode.frontend.core.domain.models.AuthToken
|
|
||||||
|
|
||||||
sealed class AppAction {
|
|
||||||
// Auth Actions
|
|
||||||
sealed class Auth : AppAction() {
|
|
||||||
data class LoginStart(val username: String, val password: String) : Auth()
|
|
||||||
data class LoginSuccess(val user: User, val token: AuthToken) : Auth()
|
|
||||||
data class LoginFailure(val error: String) : Auth()
|
|
||||||
object Logout : Auth()
|
|
||||||
data class RefreshToken(val newToken: AuthToken) : Auth()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Navigation Actions
|
|
||||||
sealed class Navigation : AppAction() {
|
|
||||||
data class NavigateTo(val route: String) : Navigation()
|
|
||||||
object NavigateBack : Navigation()
|
|
||||||
data class UpdateHistory(val route: String) : Navigation()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UI Actions
|
|
||||||
sealed class UI : AppAction() {
|
|
||||||
object ToggleDarkMode : UI()
|
|
||||||
data class SetLoading(val isLoading: Boolean) : UI()
|
|
||||||
data class ShowNotification(val notification: Notification) : UI()
|
|
||||||
data class DismissNotification(val id: String) : UI()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Network Actions
|
|
||||||
sealed class Network : AppAction() {
|
|
||||||
data class SetOnlineStatus(val isOnline: Boolean) : Network()
|
|
||||||
data class UpdateLastSync(val timestamp: String) : Network()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user