package de.tsschulz.timeclock.data.admin

import de.tsschulz.timeclock.data.api.HolidayCreateRequest
import de.tsschulz.timeclock.data.api.HolidayStateDto
import de.tsschulz.timeclock.data.api.HolidaysResponse
import de.tsschulz.timeclock.data.api.RoleUserDto
import de.tsschulz.timeclock.data.api.TimeClockApiClient

class AdminRepository(
    private val api: TimeClockApiClient,
) {
    suspend fun getHolidayStates(): List<HolidayStateDto> = api.getHolidayStates()
    suspend fun getHolidays(): HolidaysResponse = api.getHolidays()
    suspend fun createHoliday(date: String, hours: Double, description: String, stateIds: List<String>) =
        api.createHoliday(HolidayCreateRequest(date, hours, description, stateIds))
    suspend fun deleteHoliday(id: String) = api.deleteHoliday(id)

    suspend fun getRoleUsers(): List<RoleUserDto> = api.getRoleUsers()
    suspend fun updateUserRole(id: String, role: Int) = api.updateUserRole(id, role)
}
