-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from bentran1vn/revert-2-revert-1-Entity
Revert "Revert "Add new entities and update EF Core migration""
- Loading branch information
Showing
25 changed files
with
1,979 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
2024-09-27 16:52:10.778 +07:00 [WRN] Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data; this mode should only be enabled during development. | ||
2024-09-27 16:52:29.724 +07:00 [WRN] Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data; this mode should only be enabled during development. | ||
2024-09-27 16:52:30.787 +07:00 [ERR] Failed executing DbCommand (43ms) [Parameters=[], CommandType='"Text"', CommandTimeout='30'] | ||
CREATE TABLE [Users] ( | ||
[Id] uniqueidentifier NOT NULL, | ||
[Email] nvarchar(max) NOT NULL, | ||
[FullName] nvarchar(max) NULL, | ||
[Password] nvarchar(max) NOT NULL, | ||
[Gender] bit NOT NULL, | ||
[Phonenumber] nvarchar(max) NOT NULL, | ||
[Role] int NOT NULL, | ||
[Points] int NOT NULL, | ||
[Status] int NOT NULL, | ||
[MentorId] uniqueidentifier NULL, | ||
[CreatedOnUtc] datetimeoffset NOT NULL, | ||
[ModifiedOnUtc] datetimeoffset NULL, | ||
[IsDeleted] bit NOT NULL, | ||
CONSTRAINT [PK_Users] PRIMARY KEY ([Id]), | ||
CONSTRAINT [FK_Users_Users_MentorId] FOREIGN KEY ([MentorId]) REFERENCES [Users] ([Id]) | ||
); | ||
2024-09-27 16:53:37.481 +07:00 [WRN] Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data; this mode should only be enabled during development. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
namespace MBS_COMMAND.Domain.Abstractions.Entities; | ||
|
||
public interface IEntity<T> | ||
{ | ||
|
||
} | ||
public interface IEntity<T>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using MBS_COMMAND.Domain.Abstractions.Entities; | ||
|
||
namespace MBS_COMMAND.Domain.Entities; | ||
|
||
public class Category : Entity<Guid>, IAuditableEntity | ||
{ | ||
public string Name { get; set; } | ||
public DateTimeOffset CreatedOnUtc { get; set; } | ||
public DateTimeOffset? ModifiedOnUtc { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using MBS_COMMAND.Domain.Abstractions.Entities; | ||
|
||
namespace MBS_COMMAND.Domain.Entities; | ||
|
||
public class Certificate : Entity<Guid>,IAuditableEntity | ||
{ | ||
public string Name { get; set; } | ||
public string Description { get; set; } | ||
public string ImageUrl { get; set; } | ||
public Guid CategoryId { get; set; } | ||
public virtual Category? Category { get; set; } | ||
public DateTimeOffset CreatedOnUtc { get ; set ; } | ||
public DateTimeOffset? ModifiedOnUtc { get ; set ; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace MBS_COMMAND.Domain.Entities; | ||
|
||
public class Config | ||
{ | ||
[Key] | ||
public string Key { get; set; } | ||
public int Value { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using MBS_COMMAND.Domain.Abstractions.Entities; | ||
|
||
namespace MBS_COMMAND.Domain.Entities; | ||
|
||
public class Feedback : Entity<Guid>, IAuditableEntity | ||
{ | ||
|
||
public string? Content { get; set; } | ||
public int Rating { get; set; } | ||
public Guid? SlotId { get; set; } | ||
public virtual Slot? Slot { get; set; } | ||
public bool IsMentor { get; set; } | ||
public DateTimeOffset CreatedOnUtc { get; set; } | ||
public DateTimeOffset? ModifiedOnUtc { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using MBS_AUTHORIZATION.Domain.Entities; | ||
using MBS_COMMAND.Domain.Abstractions.Entities; | ||
|
||
namespace MBS_COMMAND.Domain.Entities; | ||
|
||
public class Group : Entity<Guid>, IAuditableEntity | ||
{ | ||
public string Name { get; set; } | ||
public Guid? MentorId { get; set; } | ||
public virtual User? Mentor { get; set; } | ||
public string Stack { get; set; } | ||
public Guid? ProjectId { get; set; } | ||
public virtual Project? Project { get; set; } | ||
public DateTimeOffset CreatedOnUtc { get ; set ; } | ||
public DateTimeOffset? ModifiedOnUtc { get ; set ; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using MBS_AUTHORIZATION.Domain.Entities; | ||
|
||
namespace MBS_COMMAND.Domain.Entities; | ||
|
||
public class Group_Student_Mapping | ||
{ | ||
public Guid GroupId { get; set; } | ||
public virtual Group Group { get; set; } | ||
public Guid StudentId { get; set; } | ||
public virtual User Student { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using MBS_COMMAND.Domain.Abstractions.Entities; | ||
|
||
namespace MBS_COMMAND.Domain.Entities; | ||
|
||
public class Project : Entity<Guid>, IAuditableEntity | ||
{ | ||
public string Name { get ; set ; } | ||
public string Description { get ; set ; } | ||
|
||
|
||
|
||
|
||
public DateTimeOffset CreatedOnUtc { get ; set ; } | ||
public DateTimeOffset? ModifiedOnUtc { get ; set ; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using MBS_AUTHORIZATION.Domain.Entities; | ||
using MBS_COMMAND.Domain.Abstractions.Entities; | ||
|
||
namespace MBS_COMMAND.Domain.Entities; | ||
|
||
public class Schedule : Entity<Guid>, IAuditableEntity | ||
{ | ||
public Guid MentorId { get; set; } | ||
public virtual User? Mentor { get; set; } | ||
|
||
public Guid GroupId { get; set; } | ||
public virtual Group? Group { get; set; } | ||
public TimeOnly StartTime { get; set; } | ||
public TimeOnly EndTime { get; set; } | ||
public DateOnly Date { get; set; } | ||
public Guid SubjectId { get; set; } | ||
public virtual Subject? Subject { get; set; } | ||
public DateTimeOffset CreatedOnUtc { get ; set ; } | ||
public DateTimeOffset? ModifiedOnUtc { get ; set ; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using MBS_COMMAND.Domain.Abstractions.Entities; | ||
|
||
namespace MBS_COMMAND.Domain.Entities; | ||
|
||
public class Semester : Entity<Guid>, IAuditableEntity | ||
{ | ||
public string Name { get; set; } | ||
public DateOnly From { get; set; } | ||
public DateOnly To { get; set; } | ||
public DateTimeOffset CreatedOnUtc { get; set; } | ||
public DateTimeOffset? ModifiedOnUtc { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using MBS_COMMAND.Domain.Abstractions.Entities; | ||
|
||
namespace MBS_COMMAND.Domain.Entities; | ||
|
||
public class Skill : Entity<Guid>, IAuditableEntity | ||
{ | ||
|
||
public Guid? CategoryId { get; set; } | ||
public virtual Category? Category { get; set; } | ||
public string Name { get; set; } | ||
public string Description { get; set; } | ||
public DateTimeOffset CreatedOnUtc { get; set; } | ||
public DateTimeOffset? ModifiedOnUtc { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using MBS_AUTHORIZATION.Domain.Entities; | ||
using MBS_COMMAND.Domain.Abstractions.Entities; | ||
|
||
namespace MBS_COMMAND.Domain.Entities; | ||
|
||
public class Slot : Entity<Guid>, IAuditableEntity | ||
{ | ||
public Guid? MentorId { get; set; } | ||
public virtual User? Mentor { get; set; } | ||
public TimeOnly StartTime { get; set; } | ||
public TimeOnly EndTime { get; set; } | ||
public DateOnly Date { get; set; } | ||
public int Status { get; set; } | ||
public DateTimeOffset CreatedOnUtc { get; set; } | ||
public DateTimeOffset? ModifiedOnUtc { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using MBS_COMMAND.Domain.Abstractions.Entities; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace MBS_COMMAND.Domain.Entities; | ||
|
||
public class Subject : Entity<Guid>, IAuditableEntity | ||
{ | ||
public string Name { get ; set ; } | ||
public int Status { get ; set ; } | ||
public Guid SemesterId { get; set; } | ||
public virtual Semester? Semester { get; set; } | ||
|
||
|
||
public DateTimeOffset CreatedOnUtc { get ; set ; } | ||
public DateTimeOffset? ModifiedOnUtc { get ; set ; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using MBS_AUTHORIZATION.Domain.Entities; | ||
using MBS_COMMAND.Domain.Abstractions.Entities; | ||
|
||
namespace MBS_COMMAND.Domain.Entities; | ||
|
||
public class Transaction : Entity<Guid>, IAuditableEntity | ||
{ | ||
public Guid? UserId { get; set; } | ||
public virtual User? User { get; set; } | ||
public Guid? SlotId { get; set; } | ||
public virtual Slot? Slot { get; set; } | ||
public DateOnly Date { get; set; } | ||
public int Status { get; set; } | ||
|
||
public DateTimeOffset CreatedOnUtc { get; set; } | ||
public DateTimeOffset? ModifiedOnUtc { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using MBS_COMMAND.Domain.Abstractions.Entities; | ||
|
||
namespace MBS_AUTHORIZATION.Domain.Entities; | ||
|
||
public class User : Entity<Guid>, IAuditableEntity | ||
{ | ||
public string Email { get; set; } | ||
public string? FullName { get; set; } | ||
public string Password { get; set; } | ||
public bool Gender { get; set; } | ||
public string Phonenumber { get; set; } | ||
public int Role { get; set; } | ||
public int Points { get; set; } | ||
public int Status { get; set; } | ||
public Guid? MentorId { get; set; } | ||
|
||
public virtual User? Mentor { get; set; } | ||
public DateTimeOffset CreatedOnUtc { get; set; } | ||
public DateTimeOffset? ModifiedOnUtc { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
MBS_COMMAND.Persistence/Configurations/Group_Student_MappingConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using MBS_COMMAND.Domain.Entities; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace MBS_COMMAND.Persistence.Configurations; | ||
|
||
public class Group_Student_MappingConfiguration : IEntityTypeConfiguration<Group_Student_Mapping> | ||
{ | ||
public void Configure(EntityTypeBuilder<Group_Student_Mapping> builder) | ||
{ | ||
builder.HasKey(x => new { x.GroupId, x.StudentId }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.