package com.atridad.ascently.data.sync

import com.atridad.ascently.data.format.BackupAttempt
import com.atridad.ascently.data.format.BackupClimbSession
import com.atridad.ascently.data.format.BackupGym
import com.atridad.ascently.data.format.BackupProblem
import com.atridad.ascently.data.format.DeletedItem
import kotlinx.serialization.Serializable

/** Request structure for delta sync - sends only changes since last sync */
@Serializable
data class DeltaSyncRequest(
    val lastSyncTime: String,
    val gyms: List<BackupGym>,
    val problems: List<BackupProblem>,
    val sessions: List<BackupClimbSession>,
    val attempts: List<BackupAttempt>,
    val deletedItems: List<DeletedItem>,
)

/** Response structure for delta sync - receives only changes from server */
@Serializable
data class DeltaSyncResponse(
    val serverTime: String,
    val gyms: List<BackupGym>,
    val problems: List<BackupProblem>,
    val sessions: List<BackupClimbSession>,
    val attempts: List<BackupAttempt>,
    val deletedItems: List<DeletedItem>,
)
