diff --git a/DotnetGRPC/Model/DTO/Email.cs b/DotnetGRPC/Model/DTO/Email.cs new file mode 100644 index 0000000..3d0c57c --- /dev/null +++ b/DotnetGRPC/Model/DTO/Email.cs @@ -0,0 +1,14 @@ +using System.IO; + +namespace DotnetGRPC.Model.DTO +{ + public class Email + { + public string[] To { get; set; } + public string[] Cc { get; set; } + public string[] Bcc { get; set; } + public string Subject { get; set; } + public string HtmlBody { get; set; } + public FileInfo FileAttachment { get; set; } + } +} \ No newline at end of file diff --git a/DotnetGRPC/Model/DTO/EmailSettings.cs b/DotnetGRPC/Model/DTO/EmailSettings.cs new file mode 100644 index 0000000..2b82960 --- /dev/null +++ b/DotnetGRPC/Model/DTO/EmailSettings.cs @@ -0,0 +1,11 @@ +namespace DotnetGRPC.Model.DTO +{ + public class EmailSettings + { + public string Host { get; set; } + public int Port { get; set; } + public string Username { get; set; } + public string Password { get; set; } + public bool EnableSsl { get; set; } + } +} \ No newline at end of file diff --git a/DotnetGRPC/Model/Faculty.cs b/DotnetGRPC/Model/Faculty.cs new file mode 100644 index 0000000..907a046 --- /dev/null +++ b/DotnetGRPC/Model/Faculty.cs @@ -0,0 +1,25 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace DotnetGRPC.Model +{ + [Table("faculty")] + public class Faculty + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long Id { get; set; } + + [Required] + public string Name { get; set; } + + [Required] + [Column("created_at")] + public DateTime CreatedAt { get; set; } + + [Required] + [Column("updated_at")] + public DateTime UpdatedAt { get; set; } + } +} \ No newline at end of file diff --git a/DotnetGRPC/Model/Notification.cs b/DotnetGRPC/Model/Notification.cs new file mode 100644 index 0000000..49b6f37 --- /dev/null +++ b/DotnetGRPC/Model/Notification.cs @@ -0,0 +1,42 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace DotnetGRPC.Model +{ + [Table("notification")] + public class Notification + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Column("id")] + public long Id { get; set; } + + [ForeignKey("UserId")] + public User User { get; set; } + + [Required] + [Column("user_id")] + public long UserId { get; set; } + + + [Required] + [Column("with_email")] + public bool WithEmail { get; set; } + + [Required] + [Column("content")] + public string Content { get; set; } + + [Column("url")] + public string? Url { get; set; } + + [Required] + [Column("seen")] + public bool Seen { get; set; } + + [Required] + [Column("created_at")] + public DateTime CreatedAt { get; set; } + } +} \ No newline at end of file diff --git a/DotnetGRPC/Model/Template.cs b/DotnetGRPC/Model/Template.cs new file mode 100644 index 0000000..c413b2e --- /dev/null +++ b/DotnetGRPC/Model/Template.cs @@ -0,0 +1,39 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace DotnetGRPC.Model +{ + [Table("template")] + public class Template + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Column("id")] + public long Id { get; set; } + + [Required] + [Column("template_code")] + public string TemplateCode { get; set; } + + [Required] + [Column("template_name")] + public string TemplateName { get; set; } + + [Required] + [Column("template_description")] + public string TemplateDescription { get; set; } + + [Required] + [Column("template_content")] + public string TemplateContent { get; set; } + + [Required] + [Column("created_at")] + public DateTime CreatedAt { get; set; } + + [Required] + [Column("updated_at")] + public DateTime UpdatedAt { get; set; } + } +} \ No newline at end of file diff --git a/DotnetGRPC/Model/User.cs b/DotnetGRPC/Model/User.cs new file mode 100644 index 0000000..748bea7 --- /dev/null +++ b/DotnetGRPC/Model/User.cs @@ -0,0 +1,68 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace DotnetGRPC.Model +{ + [Table("user")] + public class User + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Column("id")] + public long Id { get; set; } + + [Required] + [Column("username")] + public string Username { get; set; } + + [Required] + [Column("password")] + public string Password { get; set; } + + [Required] + [Column("secret")] + public string Secret { get; set; } + + [Required] + [Column("role")] + public RoleType Role { get; set; } + + public enum RoleType + { + Administrator, Student, Guest + } + + [Required] + [Column("email")] + public string Email { get; set; } + + [Required] + [Column("first_name")] + public string FirstName { get; set; } + + [Required] + [Column("last_name")] + public string LastName { get; set; } + + [Required] + [Column("account_status")] + public AccountType AccountStatus { get; set; } + + public enum AccountType + { + Active, Locked, Inactive + } + + [Required] + [Column("created_at")] + public DateTime CreatedAt { get; set; } + + [Required] + [Column("updated_at")] + public DateTime UpdatedAt { get; set; } + + [ForeignKey("FacultyId")] + public Faculty Faculty { get; set; } + } +} \ No newline at end of file