2022-03-19 07:00:15 +00:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
|
|
|
|
namespace BirthdayBot.Data;
|
|
|
|
|
|
|
|
|
|
[Table("user_birthdays")]
|
|
|
|
|
public class UserEntry {
|
|
|
|
|
[Key]
|
2022-11-23 07:19:37 +00:00
|
|
|
|
public ulong GuildId { get; set; }
|
2022-03-19 07:00:15 +00:00
|
|
|
|
[Key]
|
2022-11-23 07:19:37 +00:00
|
|
|
|
public ulong UserId { get; set; }
|
|
|
|
|
|
2022-03-19 07:00:15 +00:00
|
|
|
|
public int BirthMonth { get; set; }
|
2022-11-23 07:19:37 +00:00
|
|
|
|
|
2022-03-19 07:00:15 +00:00
|
|
|
|
public int BirthDay { get; set; }
|
2022-11-23 07:19:37 +00:00
|
|
|
|
|
2022-03-19 07:00:15 +00:00
|
|
|
|
public string? TimeZone { get; set; }
|
2022-11-23 07:19:37 +00:00
|
|
|
|
|
2022-03-19 07:00:15 +00:00
|
|
|
|
public DateTimeOffset LastSeen { get; set; }
|
|
|
|
|
|
|
|
|
|
[ForeignKey(nameof(GuildConfig.GuildId))]
|
|
|
|
|
[InverseProperty(nameof(GuildConfig.UserEntries))]
|
|
|
|
|
public GuildConfig Guild { get; set; } = null!;
|
2022-03-20 01:10:10 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets if this instance is new and does not (yet) exist in the database.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[NotMapped]
|
|
|
|
|
public bool IsNew { get; set; }
|
2022-03-19 07:00:15 +00:00
|
|
|
|
}
|