Initial commit
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
namespace MetaCourse.Api.Entities;
|
||||
|
||||
public enum CourseStatus { Draft, Published }
|
||||
|
||||
public class Course
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public CourseStatus Status { get; set; } = CourseStatus.Draft;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public Guid CreatorId { get; set; }
|
||||
public User Creator { get; set; } = null!;
|
||||
|
||||
public ICollection<Topic> Topics { get; set; } = new List<Topic>();
|
||||
public ICollection<UserCourse> UserCourses { get; set; } = new List<UserCourse>();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace MetaCourse.Api.Entities;
|
||||
|
||||
public enum ResourceType { Url, Video, Text, File }
|
||||
|
||||
public class Resource
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public ResourceType Type { get; set; }
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string Content { get; set; } = string.Empty;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public ICollection<TopicResource> TopicResources { get; set; } = new List<TopicResource>();
|
||||
public ICollection<UserResourceProgress> UserProgresses { get; set; } = new List<UserResourceProgress>();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace MetaCourse.Api.Entities;
|
||||
|
||||
public class Topic
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string? Description { get; set; }
|
||||
public int Position { get; set; }
|
||||
|
||||
public Guid CourseId { get; set; }
|
||||
public Course Course { get; set; } = null!;
|
||||
|
||||
public ICollection<TopicResource> TopicResources { get; set; } = new List<TopicResource>();
|
||||
public ICollection<UserTopicProgress> UserProgresses { get; set; } = new List<UserTopicProgress>();
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace MetaCourse.Api.Entities;
|
||||
|
||||
public class TopicResource
|
||||
{
|
||||
public Guid TopicId { get; set; }
|
||||
public Topic Topic { get; set; } = null!;
|
||||
|
||||
public Guid ResourceId { get; set; }
|
||||
public Resource Resource { get; set; } = null!;
|
||||
|
||||
public int Position { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace MetaCourse.Api.Entities;
|
||||
|
||||
public class User
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public string PasswordHash { get; set; } = string.Empty;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public ICollection<Course> CreatedCourses { get; set; } = new List<Course>();
|
||||
public ICollection<UserCourse> UserCourses { get; set; } = new List<UserCourse>();
|
||||
public ICollection<UserTopicProgress> TopicProgresses { get; set; } = new List<UserTopicProgress>();
|
||||
public ICollection<UserResourceProgress> ResourceProgresses { get; set; } = new List<UserResourceProgress>();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace MetaCourse.Api.Entities;
|
||||
|
||||
public class UserCourse
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public User User { get; set; } = null!;
|
||||
|
||||
public Guid CourseId { get; set; }
|
||||
public Course Course { get; set; } = null!;
|
||||
|
||||
public DateTime EnrolledAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? CompletedAt { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace MetaCourse.Api.Entities;
|
||||
|
||||
public class UserResourceProgress
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public User User { get; set; } = null!;
|
||||
|
||||
public Guid ResourceId { get; set; }
|
||||
public Resource Resource { get; set; } = null!;
|
||||
|
||||
public bool Completed { get; set; }
|
||||
public DateTime? CompletedAt { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace MetaCourse.Api.Entities;
|
||||
|
||||
public class UserTopicProgress
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public User User { get; set; } = null!;
|
||||
|
||||
public Guid TopicId { get; set; }
|
||||
public Topic Topic { get; set; } = null!;
|
||||
|
||||
public bool Completed { get; set; }
|
||||
public DateTime? CompletedAt { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user