using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace Spacebar.Models.Db.Models;

[Table("members")]
[Index("Id", "GuildId", Name = "IDX_bb2bf9386ac443afbbbf9f12d3", IsUnique = true)]
public partial class Member
{
    [Key]
    [Column("index")]
    public int Index { get; set; }

    [Column("id")]
    public long Id { get; set; }

    [Column("guild_id")]
    public long GuildId { get; set; }

    [Column("nick", TypeName = "character varying")]
    public string? Nick { get; set; }

    [Column("joined_at", TypeName = "timestamp without time zone")]
    public DateTime JoinedAt { get; set; }

    [Column("premium_since")]
    public long? PremiumSince { get; set; }

    [Column("deaf")]
    public bool Deaf { get; set; }

    [Column("mute")]
    public bool Mute { get; set; }

    [Column("pending")]
    public bool Pending { get; set; }

    [Column("settings", TypeName = "jsonb")]
    public string Settings { get; set; } = null!;

    [Column("last_message_id")]
    public long? LastMessageId { get; set; }

    [Column("joined_by", TypeName = "character varying")]
    public string? JoinedBy { get; set; }

    [Column("avatar", TypeName = "character varying")]
    public string? Avatar { get; set; }

    [Column("banner", TypeName = "character varying")]
    public string? Banner { get; set; }

    [Column("bio", TypeName = "character varying")]
    public string Bio { get; set; } = null!;

    [Column("theme_colors")]
    public List<int>? ThemeColors { get; set; }

    [Column("pronouns", TypeName = "character varying")]
    public string? Pronouns { get; set; }

    [Column("communication_disabled_until", TypeName = "timestamp without time zone")]
    public DateTime? CommunicationDisabledUntil { get; set; }

    [Column("avatar_decoration_data", TypeName = "jsonb")]
    public string? AvatarDecorationData { get; set; }

    [Column("display_name_styles", TypeName = "jsonb")]
    public string? DisplayNameStyles { get; set; }

    [Column("collectibles", TypeName = "jsonb")]
    public string? Collectibles { get; set; }

    [Column("flags")]
    public int Flags { get; set; }

    [ForeignKey("GuildId")]
    [InverseProperty("Members")]
    public virtual Guild Guild { get; set; } = null!;

    [ForeignKey("Id")]
    [InverseProperty("Members")]
    public virtual User IdNavigation { get; set; } = null!;

    [InverseProperty("MemberIdxNavigation")]
    public virtual ICollection<ThreadMember> ThreadMembers { get; set; } = new List<ThreadMember>();

    [ForeignKey("Index")]
    [InverseProperty("Indices")]
    public virtual ICollection<Role> Roles { get; set; } = new List<Role>();
}
