package de.tsschulz.tt_tagebuch.shared.api.models

import kotlinx.serialization.Serializable

@Serializable
data class MyTischtennisAccountDto(
    val id: Int? = null,
    val userId: Int? = null,
    val email: String? = null,
    val savePassword: Boolean? = null,
    val autoUpdateRatings: Boolean? = null,
    val lastLoginAttempt: String? = null,
    val lastLoginSuccess: String? = null,
    val lastUpdateRatings: String? = null,
    val expiresAt: Long? = null,
    val clubId: String? = null,
    val clubName: String? = null,
    val fedNickname: String? = null,
    val createdAt: String? = null,
    val updatedAt: String? = null,
)

@Serializable
data class MyTischtennisAccountEnvelope(
    val account: MyTischtennisAccountDto? = null,
)

@Serializable
data class MyTischtennisStatusDto(
    val exists: Boolean = false,
    val hasEmail: Boolean = false,
    val hasPassword: Boolean = false,
    val hasValidSession: Boolean = false,
    val needsConfiguration: Boolean = false,
    val needsPassword: Boolean = false,
)

@Serializable
data class MyTischtennisAccountUpsertBody(
    val email: String,
    val password: String? = null,
    val savePassword: Boolean = false,
    val autoUpdateRatings: Boolean = false,
    val userPassword: String? = null,
)

@Serializable
data class MyTischtennisVerifyBody(
    val password: String? = null,
)

@Serializable
data class MyTischtennisVerifyResponseDto(
    val message: String? = null,
    val success: Boolean? = null,
    val accessToken: String? = null,
    val expiresAt: Long? = null,
    val clubId: String? = null,
    val clubName: String? = null,
)

@Serializable
data class MyTischtennisAccountSaveResponse(
    val message: String? = null,
    val account: MyTischtennisAccountDto? = null,
)

@Serializable
data class ClickTtAccountDto(
    val id: Int? = null,
    val userId: Int? = null,
    val username: String? = null,
    val savePassword: Boolean? = null,
    val lastLoginAttempt: String? = null,
    val lastLoginSuccess: String? = null,
    val createdAt: String? = null,
    val updatedAt: String? = null,
)

@Serializable
data class ClickTtAccountEnvelope(
    val account: ClickTtAccountDto? = null,
)

@Serializable
data class ClickTtAccountStatusDto(
    val exists: Boolean = false,
    val hasUsername: Boolean = false,
    val hasPassword: Boolean = false,
    val hasValidSession: Boolean = false,
    val needsConfiguration: Boolean = false,
    val needsPassword: Boolean = false,
)

@Serializable
data class ClickTtAccountUpsertBody(
    val username: String,
    val password: String? = null,
    val savePassword: Boolean = false,
    val userPassword: String? = null,
)

@Serializable
data class ClickTtVerifyBody(
    val password: String? = null,
)

@Serializable
data class ClickTtAccountSaveResponse(
    val message: String? = null,
    val account: ClickTtAccountDto? = null,
)

@Serializable
data class ClickTtVerifyResponseDto(
    val success: Boolean? = null,
    val message: String? = null,
)
