From 7d37a07e054b23dc4779f4f7452fd9eccfd1cf1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Mon, 25 Aug 2025 21:01:57 +0300 Subject: [PATCH] VirtualClass BackEnd --- .../VirtualClass/ChatMessageDto.cs | 14 + .../VirtualClass/ClassSessionDto.cs | 58 + .../VirtualClass/IVirtualClassAppService.cs | 21 + .../VirtualClass/ParticipantDto.cs | 16 + .../VirtualClass/VirtualClassAppService.cs | 265 + .../VirtualClassAutoMapperProfile.cs | 20 + .../VirtualClass/AttendanceRecord.cs | 50 + .../VirtualClass/ChatMessage.cs | 38 + .../VirtualClass/ClassSession.cs | 89 + .../VirtualClass/Participant.cs | 68 + .../EntityFrameworkCore/PlatformDbContext.cs | 79 + .../20250825175413_VirtualClass.Designer.cs | 7011 +++++++++++++++++ .../Migrations/20250825175413_VirtualClass.cs | 217 + .../PlatformDbContextModelSnapshot.cs | 346 + .../VirtualClass/ClassroomHub.cs | 175 + 15 files changed, 8467 insertions(+) create mode 100644 api/src/Kurs.Platform.Application.Contracts/VirtualClass/ChatMessageDto.cs create mode 100644 api/src/Kurs.Platform.Application.Contracts/VirtualClass/ClassSessionDto.cs create mode 100644 api/src/Kurs.Platform.Application.Contracts/VirtualClass/IVirtualClassAppService.cs create mode 100644 api/src/Kurs.Platform.Application.Contracts/VirtualClass/ParticipantDto.cs create mode 100644 api/src/Kurs.Platform.Application/VirtualClass/VirtualClassAppService.cs create mode 100644 api/src/Kurs.Platform.Application/VirtualClass/VirtualClassAutoMapperProfile.cs create mode 100644 api/src/Kurs.Platform.Domain/VirtualClass/AttendanceRecord.cs create mode 100644 api/src/Kurs.Platform.Domain/VirtualClass/ChatMessage.cs create mode 100644 api/src/Kurs.Platform.Domain/VirtualClass/ClassSession.cs create mode 100644 api/src/Kurs.Platform.Domain/VirtualClass/Participant.cs create mode 100644 api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250825175413_VirtualClass.Designer.cs create mode 100644 api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250825175413_VirtualClass.cs create mode 100644 api/src/Kurs.Platform.HttpApi.Host/VirtualClass/ClassroomHub.cs diff --git a/api/src/Kurs.Platform.Application.Contracts/VirtualClass/ChatMessageDto.cs b/api/src/Kurs.Platform.Application.Contracts/VirtualClass/ChatMessageDto.cs new file mode 100644 index 00000000..9765de1d --- /dev/null +++ b/api/src/Kurs.Platform.Application.Contracts/VirtualClass/ChatMessageDto.cs @@ -0,0 +1,14 @@ +using System; + +namespace Kurs.Platform.VirtualClassrooms; + +public class ChatMessageDto +{ + public Guid Id { get; set; } + public Guid SessionId { get; set; } + public Guid SenderId { get; set; } + public string SenderName { get; set; } + public string Message { get; set; } + public DateTime Timestamp { get; set; } + public bool IsTeacher { get; set; } +} \ No newline at end of file diff --git a/api/src/Kurs.Platform.Application.Contracts/VirtualClass/ClassSessionDto.cs b/api/src/Kurs.Platform.Application.Contracts/VirtualClass/ClassSessionDto.cs new file mode 100644 index 00000000..e79ada9f --- /dev/null +++ b/api/src/Kurs.Platform.Application.Contracts/VirtualClass/ClassSessionDto.cs @@ -0,0 +1,58 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace Kurs.Platform.VirtualClassrooms; + +public class ClassSessionDto : FullAuditedEntityDto +{ + public string Name { get; set; } + public string Description { get; set; } + public string Subject { get; set; } + public Guid TeacherId { get; set; } + public string TeacherName { get; set; } + public DateTime ScheduledStartTime { get; set; } + public DateTime? ActualStartTime { get; set; } + public DateTime? EndTime { get; set; } + public int Duration { get; set; } + public int MaxParticipants { get; set; } + public bool IsActive { get; set; } + public bool IsScheduled { get; set; } + public int ParticipantCount { get; set; } + public bool CanJoin { get; set; } +} + +public class CreateClassSessionDto +{ + public string Name { get; set; } + public string Description { get; set; } + public string Subject { get; set; } + public DateTime ScheduledStartTime { get; set; } + public int Duration { get; set; } = 60; + public int MaxParticipants { get; set; } = 30; +} + +public class UpdateClassSessionDto +{ + public string Name { get; set; } + public string Description { get; set; } + public string Subject { get; set; } + public DateTime ScheduledStartTime { get; set; } + public int Duration { get; set; } + public int MaxParticipants { get; set; } +} + +public class GetClassSessionListDto : PagedAndSortedResultRequestDto +{ + public bool? IsActive { get; set; } + public Guid? TeacherId { get; set; } +} + +public class AttendanceRecordDto : EntityDto +{ + public Guid SessionId { get; set; } + public Guid StudentId { get; set; } + public string StudentName { get; set; } + public DateTime JoinTime { get; set; } + public DateTime? LeaveTime { get; set; } + public int TotalDurationMinutes { get; set; } +} \ No newline at end of file diff --git a/api/src/Kurs.Platform.Application.Contracts/VirtualClass/IVirtualClassAppService.cs b/api/src/Kurs.Platform.Application.Contracts/VirtualClass/IVirtualClassAppService.cs new file mode 100644 index 00000000..9d07fdfa --- /dev/null +++ b/api/src/Kurs.Platform.Application.Contracts/VirtualClass/IVirtualClassAppService.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace Kurs.Platform.VirtualClassrooms; + +public interface IVirtualClassAppService : IApplicationService +{ + Task CreateAsync(CreateClassSessionDto input); + Task> GetListAsync(GetClassSessionListDto input); + Task GetAsync(Guid id); + Task UpdateAsync(Guid id, UpdateClassSessionDto input); + Task DeleteAsync(Guid id); + Task StartClassAsync(Guid id); + Task EndClassAsync(Guid id); + Task JoinClassAsync(Guid id); + Task LeaveClassAsync(Guid id); + Task> GetAttendanceAsync(Guid sessionId); +} \ No newline at end of file diff --git a/api/src/Kurs.Platform.Application.Contracts/VirtualClass/ParticipantDto.cs b/api/src/Kurs.Platform.Application.Contracts/VirtualClass/ParticipantDto.cs new file mode 100644 index 00000000..6b7c852e --- /dev/null +++ b/api/src/Kurs.Platform.Application.Contracts/VirtualClass/ParticipantDto.cs @@ -0,0 +1,16 @@ +using System; + +namespace Kurs.Platform.VirtualClassrooms; + +public class ParticipantDto + { + public Guid Id { get; set; } + public Guid SessionId { get; set; } + public Guid UserId { get; set; } + public string UserName { get; set; } + public string UserEmail { get; set; } + public bool IsTeacher { get; set; } + public bool IsAudioMuted { get; set; } + public bool IsVideoMuted { get; set; } + public DateTime JoinTime { get; set; } + } diff --git a/api/src/Kurs.Platform.Application/VirtualClass/VirtualClassAppService.cs b/api/src/Kurs.Platform.Application/VirtualClass/VirtualClassAppService.cs new file mode 100644 index 00000000..b9328a0f --- /dev/null +++ b/api/src/Kurs.Platform.Application/VirtualClass/VirtualClassAppService.cs @@ -0,0 +1,265 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Kurs.Platform.Entities; +using Microsoft.AspNetCore.Authorization; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Domain.Repositories; + +namespace Kurs.Platform.VirtualClassrooms; + +[Authorize] +public class VirtualClassAppService : PlatformAppService, IVirtualClassAppService +{ + private readonly IRepository _classSessionRepository; + private readonly IRepository _participantRepository; + private readonly IRepository _attendanceRepository; + + public VirtualClassAppService( + IRepository classSessionRepository, + IRepository participantRepository, + IRepository attendanceRepository) + { + _classSessionRepository = classSessionRepository; + _participantRepository = participantRepository; + _attendanceRepository = attendanceRepository; + } + + public async Task CreateAsync(CreateClassSessionDto input) + { + var classSession = new ClassSession( + GuidGenerator.Create(), + input.Name, + input.Description, + input.Subject, + CurrentUser.Id, + CurrentUser.Name, + input.ScheduledStartTime, + input.Duration, + input.MaxParticipants + ); + + await _classSessionRepository.InsertAsync(classSession); + await CurrentUnitOfWork.SaveChangesAsync(); + + return ObjectMapper.Map(classSession); + } + + public async Task> GetListAsync(GetClassSessionListDto input) + { + var query = await _classSessionRepository.GetQueryableAsync(); + + if (input.IsActive.HasValue) + { + query = query.Where(x => x.IsActive == input.IsActive.Value); + } + + if (input.TeacherId.HasValue) + { + query = query.Where(x => x.TeacherId == input.TeacherId.Value); + } + + var totalCount = query.Count(); + var items = query + .OrderBy(x => x.ScheduledStartTime) + .Skip(input.SkipCount) + .Take(input.MaxResultCount) + .ToList(); + + return new PagedResultDto( + totalCount, + ObjectMapper.Map, List>(items) + ); + } + + public async Task GetAsync(Guid id) + { + var classSession = await _classSessionRepository.GetAsync(id); + return ObjectMapper.Map(classSession); + } + + public async Task UpdateAsync(Guid id, UpdateClassSessionDto input) + { + var classSession = await _classSessionRepository.GetAsync(id); + + if (classSession.TeacherId != CurrentUser.Id) + { + throw new UnauthorizedAccessException("Only the teacher can update this class"); + } + + if (classSession.IsActive) + { + throw new InvalidOperationException("Cannot update an active class"); + } + + classSession.Name = input.Name; + classSession.Description = input.Description; + classSession.Subject = input.Subject; + classSession.ScheduledStartTime = input.ScheduledStartTime; + classSession.Duration = input.Duration; + classSession.MaxParticipants = input.MaxParticipants; + + await _classSessionRepository.UpdateAsync(classSession); + return ObjectMapper.Map(classSession); + } + + public async Task DeleteAsync(Guid id) + { + var classSession = await _classSessionRepository.GetAsync(id); + + if (classSession.TeacherId != CurrentUser.Id) + { + throw new UnauthorizedAccessException("Only the teacher can delete this class"); + } + + if (classSession.IsActive) + { + throw new InvalidOperationException("Cannot delete an active class"); + } + + await _classSessionRepository.DeleteAsync(id); + } + + public async Task StartClassAsync(Guid id) + { + var classSession = await _classSessionRepository.GetAsync(id); + + if (classSession.TeacherId != CurrentUser.Id) + { + throw new UnauthorizedAccessException("Only the teacher can start this class"); + } + + if (!classSession.CanJoin()) + { + throw new InvalidOperationException("Class cannot be started at this time"); + } + + classSession.StartClass(); + await _classSessionRepository.UpdateAsync(classSession); + + return ObjectMapper.Map(classSession); + } + + public async Task EndClassAsync(Guid id) + { + var classSession = await _classSessionRepository.GetAsync(id); + + if (classSession.TeacherId != CurrentUser.Id) + { + throw new UnauthorizedAccessException("Only the teacher can end this class"); + } + + classSession.EndClass(); + await _classSessionRepository.UpdateAsync(classSession); + + // Update attendance records + var activeAttendances = await _attendanceRepository.GetListAsync( + x => x.SessionId == id && x.LeaveTime == null + ); + + foreach (var attendance in activeAttendances) + { + attendance.LeaveTime = DateTime.UtcNow; + attendance.CalculateDuration(); + await _attendanceRepository.UpdateAsync(attendance); + } + } + + public async Task JoinClassAsync(Guid id) + { + var classSession = await _classSessionRepository.GetAsync(id); + + if (!classSession.CanJoin()) + { + throw new InvalidOperationException("Cannot join this class at this time"); + } + + if (classSession.ParticipantCount >= classSession.MaxParticipants) + { + throw new InvalidOperationException("Class is full"); + } + + // Check if user is already in the class + var existingParticipant = await _participantRepository.FirstOrDefaultAsync( + x => x.SessionId == id && x.UserId == CurrentUser.Id + ); + + if (existingParticipant == null) + { + // Add participant + var participant = new Participant( + GuidGenerator.Create(), + id, + CurrentUser.Id, + CurrentUser.Name, + CurrentUser.Email, + false // isTeacher + ); + + await _participantRepository.InsertAsync(participant); + + // Create attendance record + var attendance = new AttendanceRecord( + GuidGenerator.Create(), + id, + CurrentUser.Id, + CurrentUser.Name, + DateTime.UtcNow + ); + + await _attendanceRepository.InsertAsync(attendance); + + // Update participant count + classSession.ParticipantCount++; + await _classSessionRepository.UpdateAsync(classSession); + } + + return ObjectMapper.Map(classSession); + } + + public async Task LeaveClassAsync(Guid id) + { + var participant = await _participantRepository.FirstOrDefaultAsync( + x => x.SessionId == id && x.UserId == CurrentUser.Id + ); + + if (participant != null) + { + await _participantRepository.DeleteAsync(participant); + + // Update attendance record + var attendance = await _attendanceRepository.FirstOrDefaultAsync( + x => x.SessionId == id && x.StudentId == CurrentUser.Id && x.LeaveTime == null + ); + + if (attendance != null) + { + attendance.LeaveTime = DateTime.UtcNow; + attendance.CalculateDuration(); + await _attendanceRepository.UpdateAsync(attendance); + } + + // Update participant count + var classSession = await _classSessionRepository.GetAsync(id); + classSession.ParticipantCount = Math.Max(0, classSession.ParticipantCount - 1); + await _classSessionRepository.UpdateAsync(classSession); + } + } + + public async Task> GetAttendanceAsync(Guid sessionId) + { + var classSession = await _classSessionRepository.GetAsync(sessionId); + + if (classSession.TeacherId != CurrentUser.Id) + { + throw new UnauthorizedAccessException("Only the teacher can view attendance"); + } + + var attendanceRecords = await _attendanceRepository.GetListAsync( + x => x.SessionId == sessionId + ); + + return ObjectMapper.Map, List>(attendanceRecords); + } +} \ No newline at end of file diff --git a/api/src/Kurs.Platform.Application/VirtualClass/VirtualClassAutoMapperProfile.cs b/api/src/Kurs.Platform.Application/VirtualClass/VirtualClassAutoMapperProfile.cs new file mode 100644 index 00000000..b0c2a7ab --- /dev/null +++ b/api/src/Kurs.Platform.Application/VirtualClass/VirtualClassAutoMapperProfile.cs @@ -0,0 +1,20 @@ +using AutoMapper; +using Kurs.Platform.Entities; + +namespace Kurs.Platform.VirtualClassrooms; + +public class VirtualClassAutoMapperProfile : Profile +{ + public VirtualClassAutoMapperProfile() + { + CreateMap() + .ForMember(dest => dest.CanJoin, opt => opt.MapFrom(src => src.CanJoin())); + + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + CreateMap(); + } +} diff --git a/api/src/Kurs.Platform.Domain/VirtualClass/AttendanceRecord.cs b/api/src/Kurs.Platform.Domain/VirtualClass/AttendanceRecord.cs new file mode 100644 index 00000000..430f99d2 --- /dev/null +++ b/api/src/Kurs.Platform.Domain/VirtualClass/AttendanceRecord.cs @@ -0,0 +1,50 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; + +namespace Kurs.Platform.Entities; + +public class AttendanceRecord : FullAuditedEntity +{ + public Guid SessionId { get; set; } + public Guid? StudentId { get; set; } + public string StudentName { get; set; } + public DateTime JoinTime { get; set; } + public DateTime? LeaveTime { get; set; } + public int TotalDurationMinutes { get; set; } + + // Navigation properties + public virtual ClassSession Session { get; set; } + + protected AttendanceRecord() + { + } + + public AttendanceRecord( + Guid id, + Guid sessionId, + Guid? studentId, + string studentName, + DateTime joinTime + ) : base(id) + { + SessionId = sessionId; + StudentId = studentId; + StudentName = studentName; + JoinTime = joinTime; + TotalDurationMinutes = 0; + } + + public void CalculateDuration() + { + if (LeaveTime.HasValue) + { + var duration = LeaveTime.Value - JoinTime; + TotalDurationMinutes = (int)duration.TotalMinutes; + } + else + { + var duration = DateTime.UtcNow - JoinTime; + TotalDurationMinutes = (int)duration.TotalMinutes; + } + } +} diff --git a/api/src/Kurs.Platform.Domain/VirtualClass/ChatMessage.cs b/api/src/Kurs.Platform.Domain/VirtualClass/ChatMessage.cs new file mode 100644 index 00000000..df2a9331 --- /dev/null +++ b/api/src/Kurs.Platform.Domain/VirtualClass/ChatMessage.cs @@ -0,0 +1,38 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; + +namespace Kurs.Platform.Entities; + +public class ChatMessage : FullAuditedEntity +{ + public Guid SessionId { get; set; } + public Guid SenderId { get; set; } + public string SenderName { get; set; } + public string Message { get; set; } + public DateTime Timestamp { get; set; } + public bool IsTeacher { get; set; } + + // Navigation properties + public virtual ClassSession Session { get; set; } + + protected ChatMessage() + { + } + + public ChatMessage( + Guid id, + Guid sessionId, + Guid senderId, + string senderName, + string message, + bool isTeacher + ) : base(id) + { + SessionId = sessionId; + SenderId = senderId; + SenderName = senderName; + Message = message; + IsTeacher = isTeacher; + Timestamp = DateTime.UtcNow; + } +} diff --git a/api/src/Kurs.Platform.Domain/VirtualClass/ClassSession.cs b/api/src/Kurs.Platform.Domain/VirtualClass/ClassSession.cs new file mode 100644 index 00000000..b5848b9d --- /dev/null +++ b/api/src/Kurs.Platform.Domain/VirtualClass/ClassSession.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; + +namespace Kurs.Platform.Entities; + +public class ClassSession : FullAuditedEntity +{ + public string Name { get; set; } + public string Description { get; set; } + public string Subject { get; set; } + public Guid? TeacherId { get; set; } + public string TeacherName { get; set; } + public DateTime ScheduledStartTime { get; set; } + public DateTime? ActualStartTime { get; set; } + public DateTime? EndTime { get; set; } + public int Duration { get; set; } // minutes + public int MaxParticipants { get; set; } + public bool IsActive { get; set; } + public bool IsScheduled { get; set; } + public int ParticipantCount { get; set; } + + public virtual ICollection Participants { get; set; } + public virtual ICollection AttendanceRecords { get; set; } + public virtual ICollection ChatMessages { get; set; } + + protected ClassSession() + { + Participants = new HashSet(); + AttendanceRecords = new HashSet(); + ChatMessages = new HashSet(); + } + + public ClassSession( + Guid id, + string name, + string description, + string subject, + Guid? teacherId, + string teacherName, + DateTime scheduledStartTime, + int duration, + int maxParticipants + ) : base(id) + { + Name = name; + Description = description; + Subject = subject; + TeacherId = teacherId; + TeacherName = teacherName; + ScheduledStartTime = scheduledStartTime; + Duration = duration; + MaxParticipants = maxParticipants; + IsActive = false; + IsScheduled = true; + ParticipantCount = 0; + + Participants = new HashSet(); + AttendanceRecords = new HashSet(); + ChatMessages = new HashSet(); + } + + public void StartClass() + { + if (IsActive) + throw new InvalidOperationException("Class is already active"); + + IsActive = true; + ActualStartTime = DateTime.UtcNow; + } + + public void EndClass() + { + if (!IsActive) + throw new InvalidOperationException("Class is not active"); + + IsActive = false; + EndTime = DateTime.UtcNow; + } + + public bool CanJoin() + { + var now = DateTime.UtcNow; + var tenMinutesBefore = ScheduledStartTime.AddMinutes(-10); + var twoHoursAfter = ScheduledStartTime.AddHours(2); + + return now >= tenMinutesBefore && now <= twoHoursAfter && ParticipantCount < MaxParticipants; + } +} diff --git a/api/src/Kurs.Platform.Domain/VirtualClass/Participant.cs b/api/src/Kurs.Platform.Domain/VirtualClass/Participant.cs new file mode 100644 index 00000000..7f424e9f --- /dev/null +++ b/api/src/Kurs.Platform.Domain/VirtualClass/Participant.cs @@ -0,0 +1,68 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; + +namespace Kurs.Platform.Entities; + +public class Participant : FullAuditedEntity +{ + public Guid SessionId { get; set; } + public Guid? UserId { get; set; } + public string UserName { get; set; } + public string UserEmail { get; set; } + public bool IsTeacher { get; set; } + public bool IsAudioMuted { get; set; } + public bool IsVideoMuted { get; set; } + public DateTime JoinTime { get; set; } + public string ConnectionId { get; set; } + + // Navigation properties + public virtual ClassSession Session { get; set; } + + protected Participant() + { + } + + public Participant( + Guid id, + Guid sessionId, + Guid? userId, + string userName, + string userEmail, + bool isTeacher + ) : base(id) + { + SessionId = sessionId; + UserId = userId; + UserName = userName; + UserEmail = userEmail; + IsTeacher = isTeacher; + IsAudioMuted = false; + IsVideoMuted = false; + JoinTime = DateTime.UtcNow; + } + + public void MuteAudio() + { + IsAudioMuted = true; + } + + public void UnmuteAudio() + { + IsAudioMuted = false; + } + + public void MuteVideo() + { + IsVideoMuted = true; + } + + public void UnmuteVideo() + { + IsVideoMuted = false; + } + + public void UpdateConnectionId(string connectionId) + { + ConnectionId = connectionId; + } +} diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index af776b6e..06464469 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -97,6 +97,11 @@ public class PlatformDbContext : public DbSet Demos { get; set; } public DbSet Services { get; set; } + public DbSet ClassSessions { get; set; } + public DbSet Participants { get; set; } + public DbSet AttendanceRecords { get; set; } + public DbSet ChatMessages { get; set; } + #region Entities from the modules /* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext @@ -875,5 +880,79 @@ public class PlatformDbContext : b.Property(x => x.WorkHoursJson).HasColumnType("nvarchar(max)"); b.Property(x => x.MapJson).HasColumnType("nvarchar(max)"); }); + + // ClassSession + builder.Entity(b => + { + b.ToTable(PlatformConsts.DbTablePrefix + nameof(ClassSession), PlatformConsts.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(200); + b.Property(x => x.Description).HasMaxLength(1000); + b.Property(x => x.Subject).HasMaxLength(100); + b.Property(x => x.TeacherName).IsRequired().HasMaxLength(100); + + b.HasIndex(x => x.TeacherId); + b.HasIndex(x => x.ScheduledStartTime); + b.HasIndex(x => x.IsActive); + + // Relationships + b.HasMany(x => x.Participants) + .WithOne(x => x.Session) + .HasForeignKey(x => x.SessionId) + .OnDelete(DeleteBehavior.Cascade); + + b.HasMany(x => x.AttendanceRecords) + .WithOne(x => x.Session) + .HasForeignKey(x => x.SessionId) + .OnDelete(DeleteBehavior.Cascade); + + b.HasMany(x => x.ChatMessages) + .WithOne(x => x.Session) + .HasForeignKey(x => x.SessionId) + .OnDelete(DeleteBehavior.Cascade); + }); + + // Participant + builder.Entity(b => + { + b.ToTable(PlatformConsts.DbTablePrefix + nameof(Participant), PlatformConsts.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.UserName).IsRequired().HasMaxLength(100); + b.Property(x => x.UserEmail).HasMaxLength(200); + b.Property(x => x.ConnectionId).HasMaxLength(100); + + b.HasIndex(x => x.SessionId); + b.HasIndex(x => x.UserId); + b.HasIndex(x => new { x.SessionId, x.UserId }).IsUnique(); + }); + + // AttendanceRecord + builder.Entity(b => + { + b.ToTable(PlatformConsts.DbTablePrefix + nameof(AttendanceRecord), PlatformConsts.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.StudentName).IsRequired().HasMaxLength(100); + + b.HasIndex(x => x.SessionId); + b.HasIndex(x => x.StudentId); + b.HasIndex(x => x.JoinTime); + }); + + // ChatMessage + builder.Entity(b => + { + b.ToTable(PlatformConsts.DbTablePrefix + nameof(ChatMessage), PlatformConsts.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.SenderName).IsRequired().HasMaxLength(100); + b.Property(x => x.Message).IsRequired().HasMaxLength(2000); + + b.HasIndex(x => x.SessionId); + b.HasIndex(x => x.SenderId); + b.HasIndex(x => x.Timestamp); + }); } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250825175413_VirtualClass.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250825175413_VirtualClass.Designer.cs new file mode 100644 index 00000000..c0cab12e --- /dev/null +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250825175413_VirtualClass.Designer.cs @@ -0,0 +1,7011 @@ +// +using System; +using Kurs.Platform.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace Kurs.Platform.Migrations +{ + [DbContext(typeof(PlatformDbContext))] + [Migration("20250825175413_VirtualClass")] + partial class VirtualClass + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "9.0.2") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("ContactTag", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Category") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.ToTable("PContactTag", (string)null); + }); + + modelBuilder.Entity("ContactTitle", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.ToTable("PContactTitle", (string)null); + }); + + modelBuilder.Entity("Kurs.Languages.Entities.Language", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CultureName") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("TwoLetterISOLanguageName") + .HasColumnType("nvarchar(max)"); + + b.Property("UiCultureName") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.HasKey("Id"); + + b.ToTable("PLanguage", (string)null); + }); + + modelBuilder.Entity("Kurs.Languages.Entities.LanguageKey", b => + { + b.Property("ResourceName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Key") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.HasKey("ResourceName", "Key"); + + b.ToTable("PLanguageKey", (string)null); + }); + + modelBuilder.Entity("Kurs.Languages.Entities.LanguageText", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CultureName") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("Key") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ResourceName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.HasKey("Id"); + + b.HasIndex("ResourceName", "Key"); + + b.ToTable("PLanguageText", (string)null); + }); + + modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Attachment") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("AttachmentParameter") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("AwsMessageId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("From") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MailParameter") + .HasMaxLength(8000) + .HasColumnType("nvarchar(max)"); + + b.Property("RelatedRecordId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SendStatus") + .HasColumnType("bit"); + + b.Property("SendTime") + .HasColumnType("datetime2"); + + b.Property("Table") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TableParameter") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("TemplateId") + .HasColumnType("uniqueidentifier"); + + b.Property("To") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.ToTable("PBackgroundWorker_MailQueue", (string)null); + }); + + modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueueEvents", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AwsMessageId") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Event") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MailAddress") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ResponseDescription") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("PBackgroundWorker_MailQueueEvents", (string)null); + }); + + modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueueTableFormat", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Caption") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ColumnName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Css") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DataFormat") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DataType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("FooterCss") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("HeaderCss") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("IsProtected") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("smallint"); + + b.Property("SubTotal") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TableName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Width") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "TableName", "Order" }, "IX_MailQueueTableFormat") + .IsUnique(); + + b.ToTable("PBackgroundWorker_MailQueueTableFormat", (string)null); + }); + + modelBuilder.Entity("Kurs.Notifications.Entities.Notification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Identifier") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsRead") + .HasColumnType("bit"); + + b.Property("IsSent") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Message") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("NotificationChannel") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("NotificationRuleId") + .HasColumnType("uniqueidentifier"); + + b.Property("NotificationType") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ReadTime") + .HasColumnType("datetime2"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("PNotification", (string)null); + }); + + modelBuilder.Entity("Kurs.Notifications.Entities.NotificationRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Channel") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsCustomized") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsFixed") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("NotificationType") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("RecipientId") + .HasColumnType("nvarchar(max)"); + + b.Property("RecipientType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("PNotificationRule", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.About", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DescriptionsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("SectionsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("StatsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("PAbout", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.AiBot", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("BotName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("PAiBot", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ApiEndpoint", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CsharpCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EntityId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Method") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("OperationType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Path") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityId"); + + b.ToTable("PApiEndpoint", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ApiMigration", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AppliedAt") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("EntityId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ErrorMessage") + .HasColumnType("nvarchar(max)"); + + b.Property("FileName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("SqlScript") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityId"); + + b.ToTable("PApiMigration", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.AttendanceRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JoinTime") + .HasColumnType("datetime2"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LeaveTime") + .HasColumnType("datetime2"); + + b.Property("SessionId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TotalDurationMinutes") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("JoinTime"); + + b.HasIndex("SessionId"); + + b.HasIndex("StudentId"); + + b.ToTable("PAttendanceRecord", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.BackgroundWorker", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AfterSp") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("BeforeSp") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Cron") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DataSourceCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Options") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkerType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("PBackgroundWorker", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Bank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AddressLine1") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("AddressLine2") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("City") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Country") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("District") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Email") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IdentifierCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Phone") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PostalCode") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); + + b.HasKey("Id"); + + b.ToTable("Banks"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.BankAccount", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccountNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("AccountOwner") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("BankId") + .HasColumnType("uniqueidentifier"); + + b.Property("CanTransferMoney") + .HasColumnType("bit"); + + b.Property("Company") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CurrencyId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.HasKey("Id"); + + b.HasIndex("BankId"); + + b.HasIndex("CurrencyId"); + + b.ToTable("BankAccounts"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.BlogCategory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("Icon") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("PostCount") + .HasColumnType("int"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Slug"); + + b.ToTable("PBlogCategory", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.BlogPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AuthorId") + .HasColumnType("uniqueidentifier"); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("CommentCount") + .HasColumnType("int"); + + b.Property("ContentEn") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ContentTr") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CoverImage") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LikeCount") + .HasColumnType("int"); + + b.Property("PublishedAt") + .HasColumnType("datetime2"); + + b.Property("ReadTime") + .HasColumnType("nvarchar(max)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Summary") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ViewCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.HasIndex("IsPublished"); + + b.HasIndex("PublishedAt"); + + b.HasIndex("Slug"); + + b.ToTable("PBlogPost", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Branch", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("Address2") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .HasColumnType("nvarchar(max)"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("Country") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("District") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("Fax") + .HasColumnType("bigint"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Mobile") + .HasColumnType("bigint"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("Phone") + .HasColumnType("bigint"); + + b.Property("PostalCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Street") + .HasColumnType("nvarchar(max)"); + + b.Property("TaxOffice") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("VknTckn") + .HasColumnType("bigint"); + + b.Property("Website") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("PBranch", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.BranchUsers", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "BranchId"); + + b.ToTable("PBranchUsers", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Chart", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AdaptiveLayoutJson") + .HasColumnType("nvarchar(max)"); + + b.Property("AnimationJson") + .HasColumnType("nvarchar(max)"); + + b.Property("AnnotationsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("ArgumentAxisJson") + .HasColumnType("nvarchar(max)"); + + b.Property("ChartCode") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CommonAnnotationsSettingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CommonAxisSettingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CommonJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CommonPaneSettingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CommonSeriesSettingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CrosshairJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CultureName") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(max)") + .HasDefaultValue("en"); + + b.Property("DataSourceCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DataSourceJson") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExportJson") + .HasColumnType("nvarchar(max)"); + + b.Property("IsBranch") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsOrganizationUnit") + .HasColumnType("bit"); + + b.Property("IsTenant") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LegendJson") + .HasColumnType("nvarchar(max)"); + + b.Property("MarginJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PanesJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PermissionJson") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(max)"); + + b.Property("ScrollBarJson") + .HasColumnType("nvarchar(max)"); + + b.Property("SeriesJson") + .HasColumnType("nvarchar(max)"); + + b.Property("SizeJson") + .HasColumnType("nvarchar(max)"); + + b.Property("TitleJson") + .HasColumnType("nvarchar(max)"); + + b.Property("TooltipJson") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("nvarchar(max)"); + + b.Property("ValueAxisJson") + .HasColumnType("nvarchar(max)"); + + b.Property("ZoomAndPanJson") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("PChart", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ChatMessage", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsTeacher") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Message") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("SenderId") + .HasColumnType("uniqueidentifier"); + + b.Property("SenderName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SessionId") + .HasColumnType("uniqueidentifier"); + + b.Property("Timestamp") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("SenderId"); + + b.HasIndex("SessionId"); + + b.HasIndex("Timestamp"); + + b.ToTable("PChatMessage", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.City", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); + + b.Property("CountryCode") + .IsRequired() + .HasMaxLength(8) + .HasColumnType("nvarchar(8)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("PlateCode") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.HasKey("Id"); + + b.HasIndex("CountryCode", "Code") + .IsUnique(); + + b.ToTable("PCity", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ClassSession", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActualStartTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Duration") + .HasColumnType("int"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsScheduled") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaxParticipants") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ParticipantCount") + .HasColumnType("int"); + + b.Property("ScheduledStartTime") + .HasColumnType("datetime2"); + + b.Property("Subject") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TeacherId") + .HasColumnType("uniqueidentifier"); + + b.Property("TeacherName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("IsActive"); + + b.HasIndex("ScheduledStartTime"); + + b.HasIndex("TeacherId"); + + b.ToTable("PClassSession", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Contact", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("BankJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Location") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("MapJson") + .HasColumnType("nvarchar(max)"); + + b.Property("Phone") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TaxNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("WorkHoursJson") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("PContact", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Country", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(8) + .HasColumnType("nvarchar(8)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CurrencyCode") + .HasMaxLength(8) + .HasColumnType("nvarchar(8)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("GroupName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("PhoneCode") + .HasMaxLength(16) + .HasColumnType("int"); + + b.Property("StateRequired") + .HasColumnType("bit"); + + b.Property("TaxLabel") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ZipRequired") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("Code") + .IsUnique(); + + b.HasIndex("GroupName"); + + b.ToTable("PCountry", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.CountryGroup", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("PCountryGroup", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Currency", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(8) + .HasColumnType("nvarchar(8)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LastUpdated") + .HasColumnType("datetime2"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Rate") + .HasColumnType("decimal(18,6)"); + + b.Property("Symbol") + .HasMaxLength(8) + .HasColumnType("nvarchar(8)"); + + b.HasKey("Id"); + + b.ToTable("PCurrency", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.CustomComponent", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Dependencies") + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Props") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("PCustomComponent", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.CustomEndpoint", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DataSourceCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Method") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("ParametersJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PermissionsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("Sql") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Url") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("PCustomEndpoint", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.CustomEntity", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("EndpointStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("HasAuditFields") + .HasColumnType("bit"); + + b.Property("HasSoftDelete") + .HasColumnType("bit"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MigrationId") + .HasColumnType("uniqueidentifier"); + + b.Property("MigrationStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TableName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("PCustomEntity", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.CustomEntityField", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DefaultValue") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("EntityId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsRequired") + .HasColumnType("bit"); + + b.Property("IsUnique") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaxLength") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("EntityId"); + + b.ToTable("PCustomEntityField", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.DataSource", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ConnectionString") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DataSourceType") + .HasColumnType("int"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.HasKey("Id"); + + b.ToTable("PDataSource", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Demo", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("FullName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Message") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("NumberOfBranches") + .HasColumnType("int"); + + b.Property("NumberOfUsers") + .HasColumnType("int"); + + b.Property("OrganizationName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Phone") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("PDemo", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.District", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CityCode") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); + + b.Property("CountryCode") + .HasColumnType("nvarchar(8)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Street") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Township") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ZipCode") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); + + b.HasKey("Id"); + + b.HasIndex("CountryCode", "CityCode", "Name", "Township", "Street", "ZipCode") + .IsUnique() + .HasFilter("[CountryCode] IS NOT NULL AND [Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL"); + + b.ToTable("PDistrict", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.GlobalSearch", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Group") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("System") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Term") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasColumnType("nvarchar(max)"); + + b.Property("Weight") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("PGlobalSearch", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.InstallmentOption", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Commission") + .HasPrecision(5, 3) + .HasColumnType("decimal(5,3)"); + + b.Property("Installment") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.HasKey("Id"); + + b.ToTable("PInstallmentOption", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.IpRestriction", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IP") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ResourceId") + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("ResourceType") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("PIpRestriction", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ListForm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ColumnOptionJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CommandColumnJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CultureName") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomJsSourcesJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomStyleSourcesJson") + .HasColumnType("nvarchar(max)"); + + b.Property("DataSourceCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DefaultFilter") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleteCommand") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleteFieldsDefaultValueJson") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleteServiceAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EditingFormJson") + .HasColumnType("nvarchar(max)"); + + b.Property("EditingOptionJson") + .HasColumnType("nvarchar(max)"); + + b.Property("FilterPanelJson") + .HasColumnType("nvarchar(max)"); + + b.Property("FilterRowJson") + .HasColumnType("nvarchar(max)"); + + b.Property("FormFieldsDefaultValueJson") + .HasColumnType("nvarchar(max)"); + + b.Property("GroupPanelJson") + .HasColumnType("nvarchar(max)"); + + b.Property("HeaderFilterJson") + .HasColumnType("nvarchar(max)"); + + b.Property("Height") + .HasColumnType("int"); + + b.Property("InsertCommand") + .HasColumnType("nvarchar(max)"); + + b.Property("InsertFieldsDefaultValueJson") + .HasColumnType("nvarchar(max)"); + + b.Property("InsertServiceAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("IsBranch") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsOrganizationUnit") + .HasColumnType("bit"); + + b.Property("IsSubForm") + .HasColumnType("bit"); + + b.Property("IsTenant") + .HasColumnType("bit"); + + b.Property("KeyFieldDbSourceType") + .HasColumnType("int"); + + b.Property("KeyFieldName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ListFormCode") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("ListFormType") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("PageSize") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(10); + + b.Property("PagerOptionJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PermissionJson") + .HasColumnType("nvarchar(max)"); + + b.Property("SearchPanelJson") + .HasColumnType("nvarchar(max)"); + + b.Property("SelectCommand") + .HasColumnType("nvarchar(max)"); + + b.Property("SelectCommandType") + .HasColumnType("int"); + + b.Property("SelectFieldsDefaultValueJson") + .HasColumnType("nvarchar(max)"); + + b.Property("SelectionJson") + .HasColumnType("nvarchar(max)"); + + b.Property("SortMode") + .HasColumnType("nvarchar(max)"); + + b.Property("StateStoringJson") + .HasColumnType("nvarchar(max)"); + + b.Property("SubFormsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("TableName") + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdateCommand") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdateFieldsDefaultValueJson") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdateServiceAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("Width") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("PListForm", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ListFormCustomization", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomizationData") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomizationType") + .HasColumnType("int"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("FilterName") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ListFormCode") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ListFormCode"); + + b.ToTable("PListFormCustomization", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ListFormField", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Alignment") + .HasColumnType("nvarchar(max)"); + + b.Property("AllowSearch") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("BandName") + .HasColumnType("nvarchar(max)"); + + b.Property("CaptionName") + .HasColumnType("nvarchar(max)"); + + b.Property("ColumnCssClass") + .HasColumnType("nvarchar(max)"); + + b.Property("ColumnCssValue") + .HasColumnType("nvarchar(max)"); + + b.Property("ColumnCustomizationJson") + .HasColumnType("nvarchar(max)"); + + b.Property("ColumnFilterJson") + .HasColumnType("nvarchar(max)"); + + b.Property("ColumnHeaderJson") + .HasColumnType("nvarchar(max)"); + + b.Property("ColumnStylingJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CultureName") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EditingJson") + .HasColumnType("nvarchar(max)"); + + b.Property("EditorOptions") + .HasColumnType("nvarchar(max)"); + + b.Property("FieldName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Format") + .HasColumnType("nvarchar(max)"); + + b.Property("GroupSummaryJson") + .HasColumnType("nvarchar(max)"); + + b.Property("GroupingJson") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JoinTableJson") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ListFormCode") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("ListOrderNo") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(30); + + b.Property("LookupJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PermissionJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PivotSettingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(max)"); + + b.Property("SortDirection") + .HasColumnType("nvarchar(max)"); + + b.Property("SortIndex") + .HasColumnType("int"); + + b.Property("SourceDbType") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(16); + + b.Property("TotalSummaryJson") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("nvarchar(max)"); + + b.Property("ValidationRuleJson") + .HasColumnType("nvarchar(max)"); + + b.Property("Visible") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("Width") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(100); + + b.HasKey("Id"); + + b.HasIndex("ListFormCode"); + + b.ToTable("PListFormField", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ListFormImport", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("BlobName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ListFormCode") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TotalRows") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("PListFormImport", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ListFormImportExecute", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("BlobName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ErrorRows") + .HasColumnType("int"); + + b.Property("ErrorsJson") + .HasColumnType("text"); + + b.Property("ExecRows") + .HasColumnType("int"); + + b.Property("ImportId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Progress") + .HasColumnType("float"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ValidRows") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("PListFormImportExecute", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Menu", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CssClass") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CultureName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ElementId") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Icon") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsDisabled") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("ParentCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RequiredPermissionName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("RoleId") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Target") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Url") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("UserId") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.ToTable("PMenu", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Participant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConnectionId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsAudioMuted") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsTeacher") + .HasColumnType("bit"); + + b.Property("IsVideoMuted") + .HasColumnType("bit"); + + b.Property("JoinTime") + .HasColumnType("datetime2"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("SessionId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserEmail") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("SessionId"); + + b.HasIndex("UserId"); + + b.HasIndex("SessionId", "UserId") + .IsUnique() + .HasFilter("[UserId] IS NOT NULL"); + + b.ToTable("PParticipant", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.PaymentMethod", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("Commission") + .HasPrecision(5, 3) + .HasColumnType("decimal(5,3)"); + + b.Property("Logo") + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.ToTable("PPaymentMethod", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Product", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Category") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("ImageUrl") + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsQuantityBased") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MonthlyPrice") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("YearlyPrice") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("PProduct", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ReportCategory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("Icon") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("PReportCategory", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ReportGenerated", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("GeneratedAt") + .HasColumnType("datetime2"); + + b.Property("GeneratedContent") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Parameters") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("TemplateId") + .HasColumnType("uniqueidentifier"); + + b.Property("TemplateName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TemplateId"); + + b.ToTable("PReportGenerated", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ReportParameter", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DefaultValue") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Placeholder") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ReportTemplateId") + .HasColumnType("uniqueidentifier"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ReportTemplateId"); + + b.ToTable("PReportParameter", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ReportTemplate", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CategoryName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("HtmlContent") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Tags") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("Id"); + + b.HasIndex("CategoryName"); + + b.ToTable("PReportTemplate", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Route", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Authority") + .HasColumnType("nvarchar(max)"); + + b.Property("ComponentPath") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Path") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("RouteType") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("PRoute", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Sector", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("FullName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.ToTable("PSector", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Service", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("Features") + .HasColumnType("nvarchar(max)"); + + b.Property("Icon") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Type") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("PService", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Skill", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("SkillTypeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("SkillTypeId"); + + b.ToTable("PSkill", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SkillLevel", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDefault") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Progress") + .HasColumnType("int"); + + b.Property("SkillTypeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("SkillTypeId"); + + b.ToTable("PSkillLevel", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SkillType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("PSkillType", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Uom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Ratio") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)"); + + b.Property("Rounding") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("UomCategoryId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UomCategoryId"); + + b.ToTable("PUom", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.UomCategory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("PUomCategory", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Forum.ForumCategory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("Icon") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsLocked") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LastPostDate") + .HasColumnType("datetime2"); + + b.Property("LastPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("LastPostUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LastPostUserName") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("PostCount") + .HasColumnType("int"); + + b.Property("Slug") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TopicCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisplayOrder"); + + b.ToTable("PForumCategory", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Forum.ForumPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AuthorId") + .HasColumnType("uniqueidentifier"); + + b.Property("AuthorName") + .HasColumnType("nvarchar(max)"); + + b.Property("Content") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsAcceptedAnswer") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LikeCount") + .HasColumnType("int"); + + b.Property("ParentPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TopicId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ParentPostId"); + + b.HasIndex("TopicId"); + + b.ToTable("PForumPost", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Forum.ForumTopic", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AuthorId") + .HasColumnType("uniqueidentifier"); + + b.Property("AuthorName") + .HasColumnType("nvarchar(max)"); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsLocked") + .HasColumnType("bit"); + + b.Property("IsPinned") + .HasColumnType("bit"); + + b.Property("IsSolved") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LastPostDate") + .HasColumnType("datetime2"); + + b.Property("LastPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("LastPostUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LastPostUserName") + .HasColumnType("nvarchar(max)"); + + b.Property("LikeCount") + .HasColumnType("int"); + + b.Property("ReplyCount") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ViewCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.HasIndex("IsPinned"); + + b.HasIndex("LastPostDate"); + + b.ToTable("PForumTopic", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Orders.Order", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("Address2") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .HasColumnType("nvarchar(max)"); + + b.Property("Commission") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("Country") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("District") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("Fax") + .HasColumnType("bigint"); + + b.Property("Founder") + .HasColumnType("nvarchar(max)"); + + b.Property("InstallmentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Installments") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Mobile") + .HasColumnType("bigint"); + + b.Property("OrganizationName") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDataJson") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("PaymentMethod") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Phone") + .HasColumnType("bigint"); + + b.Property("PostalCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Subtotal") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("TaxOffice") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Total") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("VknTckn") + .HasColumnType("bigint"); + + b.Property("Website") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("POrder", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Orders.OrderItem", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("BillingCycle") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("TotalPrice") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("POrderItem", (string)null); + }); + + modelBuilder.Entity("Kurs.Settings.Entities.SettingDefinition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DataType") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DescriptionKey") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEncrypted") + .HasColumnType("bit"); + + b.Property("IsInherited") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MainGroupKey") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("NameKey") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("Providers") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RequiredPermissionName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("SelectOptions") + .HasColumnType("nvarchar(max)"); + + b.Property("SubGroupKey") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.ToTable("PSettingDefinition", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("nvarchar(max)"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime2") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("nvarchar(max)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique() + .HasFilter("[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL"); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("bit") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("bit") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("bit") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IpAddresses") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("LastAccessed") + .HasColumnType("datetime2"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("SignedIn") + .HasColumnType("datetime2"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("bit") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("IsVerified") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("datetimeoffset"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("LoginEndDate") + .HasColumnType("datetime2"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("RocketUsername") + .HasColumnType("nvarchar(max)"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("bit"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("StartTime") + .HasColumnType("datetime2"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("nvarchar(196)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("nvarchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ClientSecret") + .HasColumnType("nvarchar(max)"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ClientUri") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayNames") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("nvarchar(max)"); + + b.Property("Permissions") + .HasColumnType("nvarchar(max)"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("nvarchar(max)"); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("RedirectUris") + .HasColumnType("nvarchar(max)"); + + b.Property("Requirements") + .HasColumnType("nvarchar(max)"); + + b.Property("Settings") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("Scopes") + .HasColumnType("nvarchar(max)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("nvarchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Descriptions") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayNames") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("Resources") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationId") + .HasColumnType("uniqueidentifier"); + + b.Property("AuthorizationId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("ExpirationDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Payload") + .HasColumnType("nvarchar(max)"); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("RedemptionDate") + .HasColumnType("datetime2"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("nvarchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[TenantId] IS NOT NULL"); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("bit"); + + b.Property("IsInherited") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Address2") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("City") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Country") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("District") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Fax") + .HasColumnType("bigint"); + + b.Property("Founder") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Mobile") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("OrganizationName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Phone") + .HasColumnType("bigint"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Street") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TaxOffice") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("VknTckn") + .HasColumnType("bigint"); + + b.Property("Website") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Kurs.Languages.Entities.LanguageText", b => + { + b.HasOne("Kurs.Languages.Entities.LanguageKey", null) + .WithMany("Texts") + .HasForeignKey("ResourceName", "Key") + .OnDelete(DeleteBehavior.SetNull); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ApiEndpoint", b => + { + b.HasOne("Kurs.Platform.Entities.CustomEntity", "Entity") + .WithMany() + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ApiMigration", b => + { + b.HasOne("Kurs.Platform.Entities.CustomEntity", "Entity") + .WithMany() + .HasForeignKey("EntityId"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.AttendanceRecord", b => + { + b.HasOne("Kurs.Platform.Entities.ClassSession", "Session") + .WithMany("AttendanceRecords") + .HasForeignKey("SessionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Session"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.BankAccount", b => + { + b.HasOne("Kurs.Platform.Entities.Bank", "Bank") + .WithMany() + .HasForeignKey("BankId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Kurs.Platform.Entities.Currency", "Currency") + .WithMany() + .HasForeignKey("CurrencyId"); + + b.Navigation("Bank"); + + b.Navigation("Currency"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.BlogPost", b => + { + b.HasOne("Kurs.Platform.Entities.BlogCategory", "Category") + .WithMany("Posts") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Category"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ChatMessage", b => + { + b.HasOne("Kurs.Platform.Entities.ClassSession", "Session") + .WithMany("ChatMessages") + .HasForeignKey("SessionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Session"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.City", b => + { + b.HasOne("Kurs.Platform.Entities.Country", "Country") + .WithMany("Cities") + .HasForeignKey("CountryCode") + .HasPrincipalKey("Code") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Country"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Country", b => + { + b.HasOne("Kurs.Platform.Entities.CountryGroup", null) + .WithMany() + .HasForeignKey("GroupName") + .HasPrincipalKey("Name") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.CustomEntityField", b => + { + b.HasOne("Kurs.Platform.Entities.CustomEntity", "Entity") + .WithMany("Fields") + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.District", b => + { + b.HasOne("Kurs.Platform.Entities.City", "City") + .WithMany("Districts") + .HasForeignKey("CountryCode", "CityCode") + .HasPrincipalKey("CountryCode", "Code") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("City"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ListFormCustomization", b => + { + b.HasOne("Kurs.Platform.Entities.ListForm", null) + .WithMany() + .HasForeignKey("ListFormCode") + .HasPrincipalKey("ListFormCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ListFormField", b => + { + b.HasOne("Kurs.Platform.Entities.ListForm", null) + .WithMany() + .HasForeignKey("ListFormCode") + .HasPrincipalKey("ListFormCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Participant", b => + { + b.HasOne("Kurs.Platform.Entities.ClassSession", "Session") + .WithMany("Participants") + .HasForeignKey("SessionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Session"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ReportGenerated", b => + { + b.HasOne("Kurs.Platform.Entities.ReportTemplate", "Template") + .WithMany() + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ReportParameter", b => + { + b.HasOne("Kurs.Platform.Entities.ReportTemplate", "ReportTemplate") + .WithMany("Parameters") + .HasForeignKey("ReportTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ReportTemplate"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ReportTemplate", b => + { + b.HasOne("Kurs.Platform.Entities.ReportCategory", "ReportCategory") + .WithMany("ReportTemplates") + .HasForeignKey("CategoryName") + .HasPrincipalKey("Name") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("ReportCategory"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Skill", b => + { + b.HasOne("Kurs.Platform.Entities.SkillType", "SkillType") + .WithMany("Skills") + .HasForeignKey("SkillTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SkillType"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SkillLevel", b => + { + b.HasOne("Kurs.Platform.Entities.SkillType", "SkillType") + .WithMany("Levels") + .HasForeignKey("SkillTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SkillType"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Uom", b => + { + b.HasOne("Kurs.Platform.Entities.UomCategory", "UomCategory") + .WithMany("Uoms") + .HasForeignKey("UomCategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("UomCategory"); + }); + + modelBuilder.Entity("Kurs.Platform.Forum.ForumPost", b => + { + b.HasOne("Kurs.Platform.Forum.ForumPost", "ParentPost") + .WithMany("Replies") + .HasForeignKey("ParentPostId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Kurs.Platform.Forum.ForumTopic", "Topic") + .WithMany("Posts") + .HasForeignKey("TopicId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ParentPost"); + + b.Navigation("Topic"); + }); + + modelBuilder.Entity("Kurs.Platform.Forum.ForumTopic", b => + { + b.HasOne("Kurs.Platform.Forum.ForumCategory", "Category") + .WithMany("Topics") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Category"); + }); + + modelBuilder.Entity("Kurs.Platform.Orders.OrderItem", b => + { + b.HasOne("Kurs.Platform.Orders.Order", "Order") + .WithMany("Items") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Kurs.Languages.Entities.LanguageKey", b => + { + b.Navigation("Texts"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.BlogCategory", b => + { + b.Navigation("Posts"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.City", b => + { + b.Navigation("Districts"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ClassSession", b => + { + b.Navigation("AttendanceRecords"); + + b.Navigation("ChatMessages"); + + b.Navigation("Participants"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.Country", b => + { + b.Navigation("Cities"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.CustomEntity", b => + { + b.Navigation("Fields"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ReportCategory", b => + { + b.Navigation("ReportTemplates"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.ReportTemplate", b => + { + b.Navigation("Parameters"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SkillType", b => + { + b.Navigation("Levels"); + + b.Navigation("Skills"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.UomCategory", b => + { + b.Navigation("Uoms"); + }); + + modelBuilder.Entity("Kurs.Platform.Forum.ForumCategory", b => + { + b.Navigation("Topics"); + }); + + modelBuilder.Entity("Kurs.Platform.Forum.ForumPost", b => + { + b.Navigation("Replies"); + }); + + modelBuilder.Entity("Kurs.Platform.Forum.ForumTopic", b => + { + b.Navigation("Posts"); + }); + + modelBuilder.Entity("Kurs.Platform.Orders.Order", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250825175413_VirtualClass.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250825175413_VirtualClass.cs new file mode 100644 index 00000000..3f6be1a3 --- /dev/null +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250825175413_VirtualClass.cs @@ -0,0 +1,217 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Kurs.Platform.Migrations +{ + /// + public partial class VirtualClass : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "PClassSession", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + Subject = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + TeacherId = table.Column(type: "uniqueidentifier", nullable: true), + TeacherName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + ScheduledStartTime = table.Column(type: "datetime2", nullable: false), + ActualStartTime = table.Column(type: "datetime2", nullable: true), + EndTime = table.Column(type: "datetime2", nullable: true), + Duration = table.Column(type: "int", nullable: false), + MaxParticipants = table.Column(type: "int", nullable: false), + IsActive = table.Column(type: "bit", nullable: false), + IsScheduled = table.Column(type: "bit", nullable: false), + ParticipantCount = table.Column(type: "int", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PClassSession", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "PAttendanceRecord", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + SessionId = table.Column(type: "uniqueidentifier", nullable: false), + StudentId = table.Column(type: "uniqueidentifier", nullable: true), + StudentName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + JoinTime = table.Column(type: "datetime2", nullable: false), + LeaveTime = table.Column(type: "datetime2", nullable: true), + TotalDurationMinutes = table.Column(type: "int", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PAttendanceRecord", x => x.Id); + table.ForeignKey( + name: "FK_PAttendanceRecord_PClassSession_SessionId", + column: x => x.SessionId, + principalTable: "PClassSession", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "PChatMessage", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + SessionId = table.Column(type: "uniqueidentifier", nullable: false), + SenderId = table.Column(type: "uniqueidentifier", nullable: false), + SenderName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Message = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false), + Timestamp = table.Column(type: "datetime2", nullable: false), + IsTeacher = table.Column(type: "bit", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PChatMessage", x => x.Id); + table.ForeignKey( + name: "FK_PChatMessage_PClassSession_SessionId", + column: x => x.SessionId, + principalTable: "PClassSession", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "PParticipant", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + SessionId = table.Column(type: "uniqueidentifier", nullable: false), + UserId = table.Column(type: "uniqueidentifier", nullable: true), + UserName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + UserEmail = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + IsTeacher = table.Column(type: "bit", nullable: false), + IsAudioMuted = table.Column(type: "bit", nullable: false), + IsVideoMuted = table.Column(type: "bit", nullable: false), + JoinTime = table.Column(type: "datetime2", nullable: false), + ConnectionId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PParticipant", x => x.Id); + table.ForeignKey( + name: "FK_PParticipant_PClassSession_SessionId", + column: x => x.SessionId, + principalTable: "PClassSession", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_PAttendanceRecord_JoinTime", + table: "PAttendanceRecord", + column: "JoinTime"); + + migrationBuilder.CreateIndex( + name: "IX_PAttendanceRecord_SessionId", + table: "PAttendanceRecord", + column: "SessionId"); + + migrationBuilder.CreateIndex( + name: "IX_PAttendanceRecord_StudentId", + table: "PAttendanceRecord", + column: "StudentId"); + + migrationBuilder.CreateIndex( + name: "IX_PChatMessage_SenderId", + table: "PChatMessage", + column: "SenderId"); + + migrationBuilder.CreateIndex( + name: "IX_PChatMessage_SessionId", + table: "PChatMessage", + column: "SessionId"); + + migrationBuilder.CreateIndex( + name: "IX_PChatMessage_Timestamp", + table: "PChatMessage", + column: "Timestamp"); + + migrationBuilder.CreateIndex( + name: "IX_PClassSession_IsActive", + table: "PClassSession", + column: "IsActive"); + + migrationBuilder.CreateIndex( + name: "IX_PClassSession_ScheduledStartTime", + table: "PClassSession", + column: "ScheduledStartTime"); + + migrationBuilder.CreateIndex( + name: "IX_PClassSession_TeacherId", + table: "PClassSession", + column: "TeacherId"); + + migrationBuilder.CreateIndex( + name: "IX_PParticipant_SessionId", + table: "PParticipant", + column: "SessionId"); + + migrationBuilder.CreateIndex( + name: "IX_PParticipant_SessionId_UserId", + table: "PParticipant", + columns: new[] { "SessionId", "UserId" }, + unique: true, + filter: "[UserId] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_PParticipant_UserId", + table: "PParticipant", + column: "UserId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "PAttendanceRecord"); + + migrationBuilder.DropTable( + name: "PChatMessage"); + + migrationBuilder.DropTable( + name: "PParticipant"); + + migrationBuilder.DropTable( + name: "PClassSession"); + } + } +} diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index d76562cf..836b9ba1 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -849,6 +849,72 @@ namespace Kurs.Platform.Migrations b.ToTable("PApiMigration", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.AttendanceRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JoinTime") + .HasColumnType("datetime2"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LeaveTime") + .HasColumnType("datetime2"); + + b.Property("SessionId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TotalDurationMinutes") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("JoinTime"); + + b.HasIndex("SessionId"); + + b.HasIndex("StudentId"); + + b.ToTable("PAttendanceRecord", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.BackgroundWorker", b => { b.Property("Id") @@ -1494,6 +1560,74 @@ namespace Kurs.Platform.Migrations b.ToTable("PChart", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.ChatMessage", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsTeacher") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Message") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("SenderId") + .HasColumnType("uniqueidentifier"); + + b.Property("SenderName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SessionId") + .HasColumnType("uniqueidentifier"); + + b.Property("Timestamp") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("SenderId"); + + b.HasIndex("SessionId"); + + b.HasIndex("Timestamp"); + + b.ToTable("PChatMessage", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.City", b => { b.Property("Id") @@ -1556,6 +1690,97 @@ namespace Kurs.Platform.Migrations b.ToTable("PCity", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.ClassSession", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActualStartTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Duration") + .HasColumnType("int"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsScheduled") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaxParticipants") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ParticipantCount") + .HasColumnType("int"); + + b.Property("ScheduledStartTime") + .HasColumnType("datetime2"); + + b.Property("Subject") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TeacherId") + .HasColumnType("uniqueidentifier"); + + b.Property("TeacherName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("IsActive"); + + b.HasIndex("ScheduledStartTime"); + + b.HasIndex("TeacherId"); + + b.ToTable("PClassSession", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Contact", b => { b.Property("Id") @@ -3049,6 +3274,85 @@ namespace Kurs.Platform.Migrations b.ToTable("PMenu", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Participant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConnectionId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsAudioMuted") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsTeacher") + .HasColumnType("bit"); + + b.Property("IsVideoMuted") + .HasColumnType("bit"); + + b.Property("JoinTime") + .HasColumnType("datetime2"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("SessionId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserEmail") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("SessionId"); + + b.HasIndex("UserId"); + + b.HasIndex("SessionId", "UserId") + .IsUnique() + .HasFilter("[UserId] IS NOT NULL"); + + b.ToTable("PParticipant", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.PaymentMethod", b => { b.Property("Id") @@ -6213,6 +6517,17 @@ namespace Kurs.Platform.Migrations b.Navigation("Entity"); }); + modelBuilder.Entity("Kurs.Platform.Entities.AttendanceRecord", b => + { + b.HasOne("Kurs.Platform.Entities.ClassSession", "Session") + .WithMany("AttendanceRecords") + .HasForeignKey("SessionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Session"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.BankAccount", b => { b.HasOne("Kurs.Platform.Entities.Bank", "Bank") @@ -6241,6 +6556,17 @@ namespace Kurs.Platform.Migrations b.Navigation("Category"); }); + modelBuilder.Entity("Kurs.Platform.Entities.ChatMessage", b => + { + b.HasOne("Kurs.Platform.Entities.ClassSession", "Session") + .WithMany("ChatMessages") + .HasForeignKey("SessionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Session"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.City", b => { b.HasOne("Kurs.Platform.Entities.Country", "Country") @@ -6304,6 +6630,17 @@ namespace Kurs.Platform.Migrations .IsRequired(); }); + modelBuilder.Entity("Kurs.Platform.Entities.Participant", b => + { + b.HasOne("Kurs.Platform.Entities.ClassSession", "Session") + .WithMany("Participants") + .HasForeignKey("SessionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Session"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.ReportGenerated", b => { b.HasOne("Kurs.Platform.Entities.ReportTemplate", "Template") @@ -6565,6 +6902,15 @@ namespace Kurs.Platform.Migrations b.Navigation("Districts"); }); + modelBuilder.Entity("Kurs.Platform.Entities.ClassSession", b => + { + b.Navigation("AttendanceRecords"); + + b.Navigation("ChatMessages"); + + b.Navigation("Participants"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Country", b => { b.Navigation("Cities"); diff --git a/api/src/Kurs.Platform.HttpApi.Host/VirtualClass/ClassroomHub.cs b/api/src/Kurs.Platform.HttpApi.Host/VirtualClass/ClassroomHub.cs new file mode 100644 index 00000000..ee1487bd --- /dev/null +++ b/api/src/Kurs.Platform.HttpApi.Host/VirtualClass/ClassroomHub.cs @@ -0,0 +1,175 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.SignalR; +using Volo.Abp.Domain.Repositories; +using Kurs.Platform.Entities; +using Microsoft.Extensions.Logging; +using Volo.Abp.Guids; + +namespace Kurs.Platform.SignalR.Hubs; + +[Authorize] +public class ClassroomHub : Hub +{ + private readonly IRepository _classSessionRepository; + private readonly IRepository _participantRepository; + private readonly IRepository _chatMessageRepository; + private readonly ILogger _logger; + private readonly IGuidGenerator _guidGenerator; + + public ClassroomHub( + IRepository classSessionRepository, + IRepository participantRepository, + IRepository chatMessageRepository, + ILogger logger, + IGuidGenerator guidGenerator) + { + _classSessionRepository = classSessionRepository; + _participantRepository = participantRepository; + _chatMessageRepository = chatMessageRepository; + _logger = logger; + _guidGenerator = guidGenerator; + } + + public async Task JoinClassAsync(Guid sessionId, string userName) + { + var classSession = await _classSessionRepository.GetAsync(sessionId); + + if (!classSession.CanJoin()) + { + await Clients.Caller.SendAsync("Error", "Cannot join this class at this time"); + return; + } + + // Add to SignalR group + await Groups.AddToGroupAsync(Context.ConnectionId, sessionId.ToString()); + + // Update participant connection + var participant = await _participantRepository.FirstOrDefaultAsync( + x => x.SessionId == sessionId && x.UserId == Context.UserIdentifier.To() + ); + + if (participant != null) + { + participant.UpdateConnectionId(Context.ConnectionId); + await _participantRepository.UpdateAsync(participant); + } + + // Notify others + await Clients.Group(sessionId.ToString()) + .SendAsync("ParticipantJoined", Context.UserIdentifier, userName); + _logger.LogInformation($"User {userName} joined class {sessionId}"); + } + + public async Task LeaveClassAsync(Guid sessionId) + { + await Groups.RemoveFromGroupAsync(Context.ConnectionId, sessionId.ToString()); + await Clients.Group(sessionId.ToString()) + .SendAsync("ParticipantLeft", Context.UserIdentifier); + _logger.LogInformation($"User {Context.UserIdentifier} left class {sessionId}"); + } + + public async Task SendSignalingMessageAsync(SignalingMessageDto message) + { + // Forward WebRTC signaling messages + await Clients.User(message.ToUserId) + .SendAsync("ReceiveSignalingMessage", message); + _logger.LogInformation($"Signaling message sent from {message.FromUserId} to {message.ToUserId}"); + } + + public async Task SendChatMessageAsync(Guid sessionId, string message) + { + var userId = Context.UserIdentifier.To(); + var userName = Context.User?.Identity?.Name ?? "Unknown"; + + // Check if user is teacher + var participant = await _participantRepository.FirstOrDefaultAsync( + x => x.SessionId == sessionId && x.UserId == userId + ); + + var isTeacher = participant?.IsTeacher ?? false; + + // Save message to database + var chatMessage = new ChatMessage( + _guidGenerator.Create(), + sessionId, + userId, + userName, + message, + isTeacher + ); + + await _chatMessageRepository.InsertAsync(chatMessage); + + // Send to all participants + await Clients.Group(sessionId.ToString()) + .SendAsync("ChatMessage", new + { + Id = chatMessage.Id, + SenderId = chatMessage.SenderId, + SenderName = chatMessage.SenderName, + Message = chatMessage.Message, + Timestamp = chatMessage.Timestamp, + IsTeacher = chatMessage.IsTeacher + }); + } + + public async Task MuteParticipantAsync(Guid sessionId, Guid participantId, bool isMuted) + { + var teacherParticipant = await _participantRepository.FirstOrDefaultAsync( + x => x.SessionId == sessionId && x.UserId == Context.UserIdentifier.To() + ); + + if (teacherParticipant?.IsTeacher != true) + { + await Clients.Caller.SendAsync("Error", "Only teachers can mute participants"); + return; + } + + var participant = await _participantRepository.FirstOrDefaultAsync( + x => x.SessionId == sessionId && x.UserId == participantId + ); + + if (participant != null) + { + if (isMuted) + participant.MuteAudio(); + else + participant.UnmuteAudio(); + + await _participantRepository.UpdateAsync(participant); + + // Notify the participant and others + await Clients.Group(sessionId.ToString()) + .SendAsync("ParticipantMuted", participantId, isMuted); + } + } + + public override async Task OnDisconnectedAsync(Exception exception) + { + // Handle cleanup when user disconnects + var userId = Context.UserIdentifier?.To(); + if (userId.HasValue) + { + var participants = await _participantRepository.GetListAsync( + x => x.UserId == userId.Value && x.ConnectionId == Context.ConnectionId + ); + foreach (var participant in participants) + { + await Clients.Group(participant.SessionId.ToString()) + .SendAsync("ParticipantLeft", userId.Value); + } + } + + await base.OnDisconnectedAsync(exception); + } +} + +public class SignalingMessageDto +{ + public string Type { get; set; } // offer, answer, ice-candidate + public string FromUserId { get; set; } + public string ToUserId { get; set; } + public object Data { get; set; } +}