package com.betriebsratkanzlei.legalconsenthub.user

import jakarta.persistence.Column
import jakarta.persistence.Entity
import jakarta.persistence.EntityListeners
import jakarta.persistence.Id
import jakarta.persistence.Table
import org.springframework.data.annotation.CreatedDate
import org.springframework.data.annotation.LastModifiedDate
import org.springframework.data.jpa.domain.support.AuditingEntityListener
import java.time.LocalDateTime

@Entity
@EntityListeners(AuditingEntityListener::class)
@Table(name = "app_user")
class User(
    @Id
    @Column(nullable = false)
    var keycloakId: String,
    @Column(nullable = false)
    var name: String,
    @Column(nullable = true)
    var organizationId: String? = null,
    @CreatedDate
    @Column(nullable = false)
    var createdAt: LocalDateTime? = null,
    @LastModifiedDate
    @Column(nullable = false)
    var modifiedAt: LocalDateTime? = null,
)
