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

import kotlinx.serialization.Serializable

@Serializable
data class BillingTemplateDto(
    val id: Int,
    val clubId: Int? = null,
    val name: String = "",
    val description: String? = null,
    val version: Int = 1,
)

@Serializable
data class BillingTemplatesEnvelope(
    val success: Boolean = false,
    val templates: List<BillingTemplateDto> = emptyList(),
)

@Serializable
data class BillingRunDto(
    val id: Int,
    val clubId: Int? = null,
    val templateId: Int? = null,
    val name: String? = null,
    val periodStart: String? = null,
    val periodEnd: String? = null,
    val selfRecipientName: String? = null,
    val hourlyRate: Double = 0.0,
    val computedHoursTotal: Double? = null,
    val status: String? = null,
)

@Serializable
data class BillingRunsEnvelope(
    val success: Boolean = false,
    val runs: List<BillingRunDto> = emptyList(),
)

@Serializable
data class BillingUserSettingsDto(
    val lastHourlyRate: Double? = null,
    val lastSelfRecipientName: String? = null,
    val lastLocationText: String? = null,
)

@Serializable
data class BillingSettingsEnvelope(
    val success: Boolean = false,
    val settings: BillingUserSettingsDto? = null,
)

@Serializable
data class BillingSessionPreviewDto(
    val date: String? = null,
    val startTime: String? = null,
    val endTime: String? = null,
    val durationHours: Double? = null,
)

@Serializable
data class BillingHoursPreviewEnvelope(
    val success: Boolean = false,
    val computedHoursTotal: Double? = null,
    val sessions: List<BillingSessionPreviewDto> = emptyList(),
)

@Serializable
data class BillingCreateRunBody(
    val templateId: Int,
    val monthFrom: String,
    val monthTo: String,
    val selfRecipientName: String? = null,
    val iban: String? = null,
    val ibanWithoutCountry: Boolean = false,
    val hourlyRate: Double,
    val sessionLabel: String? = null,
    val sameAccountCheckbox: Boolean = false,
    val omitSelfRecipientName: Boolean = false,
    val omitIban: Boolean = false,
    val omitLocationText: Boolean = false,
    val omitDocumentDate: Boolean = false,
    val omitSessionLabel: Boolean = false,
    val locationText: String? = null,
    val documentDate: String? = null,
)

@Serializable
data class BillingCreateRunEnvelope(
    val success: Boolean = false,
    val run: BillingRunDto? = null,
    val error: String? = null,
)

@Serializable
data class BillingGenerateBody(
    val locale: String = "de-DE",
)

@Serializable
data class BillingGenerateEnvelope(
    val success: Boolean = false,
    val error: String? = null,
)
