package com.betriebsratkanzlei.legalconsenthub.user

import com.betriebsratkanzlei.legalconsenthub_api.model.UserDto
import org.springframework.stereotype.Component

@Component
class UserMapper {
    fun toUserDto(user: User): UserDto =
        UserDto(
            keycloakId = user.keycloakId,
            name = user.name,
            organizationId = user.organizationId,
        )

    fun toUser(userDto: UserDto): User {
        val user =
            User(
                keycloakId = userDto.keycloakId,
                name = userDto.name,
                organizationId = userDto.organizationId,
            )

        return user
    }
}
