package com.betriebsratkanzlei.legalconsenthub.user

import com.betriebsratkanzlei.legalconsenthub_api.api.UserApi
import com.betriebsratkanzlei.legalconsenthub_api.model.UserDto
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.RestController

@RestController
class UserController(
    private val userService: UserService,
    private val userMapper: UserMapper,
) : UserApi {
    override fun getUserById(id: String): ResponseEntity<UserDto> {
        val user = userService.getUserById(id)
        return ResponseEntity.ok(userMapper.toUserDto(user))
    }

    override fun deleteUser(id: String): ResponseEntity<Unit> {
        userService.deleteUser(id)
        return ResponseEntity.noContent().build()
    }
}
