package dev.dinauer.maven.maven.token;

import jakarta.persistence.*;

import java.time.LocalDate;
import java.time.ZonedDateTime;

@Entity
@Table(name = "token")
public class TokenEntity
{
    @Id
    @GeneratedValue(strategy = GenerationType.UUID)
    private String id;

    private String name;

    @Column(name = "user_id")
    private String userId;

    private String token;

    @Column(name = "expires_at")
    private LocalDate expiresAt;

    @Column(name = "created_at")
    private ZonedDateTime createdAt;

    public String getId()
    {
        return id;
    }

    public TokenEntity setId(String id)
    {
        this.id = id;
        return this;
    }

    public String getName()
    {
        return name;
    }

    public TokenEntity setName(String name)
    {
        this.name = name;
        return this;
    }

    public String getUserId()
    {
        return userId;
    }

    public TokenEntity setUserId(String userId)
    {
        this.userId = userId;
        return this;
    }

    public String getToken()
    {
        return token;
    }

    public TokenEntity setToken(String token)
    {
        this.token = token;
        return this;
    }

    public LocalDate getExpiresAt()
    {
        return expiresAt;
    }

    public TokenEntity setExpiresAt(LocalDate expiresAt)
    {
        this.expiresAt = expiresAt;
        return this;
    }

    public ZonedDateTime getCreatedAt()
    {
        return createdAt;
    }

    public TokenEntity setCreatedAt(ZonedDateTime createdAt)
    {
        this.createdAt = createdAt;
        return this;
    }
}
