using System.ComponentModel.DataAnnotations;

namespace Knots.Models;

public class Message
{
    [Key] public int Id { get; set; }
    [Required, MaxLength(1000)] public string? Contenu { get; set; }
    [Required] public DateTime Date { get; set; }
    [Required] public Boolean Type { get; set; }
    
    public int UserId { get; set; }       
    public User User { get; set; } = null!;
    
    public int DiscussionId { get; set; }  // ← ajouté
    public Discussion Discussion { get; set; } = null!;
    
    public Group? Group { get; set; }
    public Key? Key { get; set; }
}