package de.oaa.xxx.gruppe.entity;

import de.oaa.xxx.gruppe.GruppenRolle;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;
import java.util.UUID;

@Getter
@Setter
@Entity
@Table(name = "gruppe_mitglied",
        uniqueConstraints = @UniqueConstraint(columnNames = {"gruppeId", "userId"}))
public class GruppenmitgliedEntity {

    @Id
    @Column
    private UUID mitgliedId;

    @Column(nullable = false)
    private UUID gruppeId;

    @Column(nullable = false)
    private UUID userId;

    @Enumerated(EnumType.STRING)
    @Column(nullable = false, length = 10)
    private GruppenRolle rolle;

    @Column(nullable = false)
    private LocalDateTime joinedAt;
}
