Преглед на файлове

Save attachment Contents

zinab_elgendy преди 6 месеца
родител
ревизия
2947f8b8ef
променени са 21 файла, в които са добавени 10408 реда и са изтрити 30 реда
  1. 11 4
      MTWorkHR.API/Controllers/UserController.cs
  2. 2 0
      MTWorkHR.Application/Dtos/Identity/AttachmentDto.cs
  3. 11 0
      MTWorkHR.Application/Dtos/Identity/BlobObject.cs
  4. 6 2
      MTWorkHR.Application/Dtos/User/MeetingDto.cs
  5. 4 3
      MTWorkHR.Application/Mapper/MappingProfile.cs
  6. 70 8
      MTWorkHR.Application/Services/Base/BlobFileService.cs
  7. 5 0
      MTWorkHR.Application/Services/Base/FileService.cs
  8. 1 0
      MTWorkHR.Application/Services/Interfaces/IFileService.cs
  9. 1 1
      MTWorkHR.Application/Services/Interfaces/IUserService.cs
  10. 4 2
      MTWorkHR.Application/Services/User/MeetingService.cs
  11. 56 4
      MTWorkHR.Application/Services/User/UserService.cs
  12. 6 2
      MTWorkHR.Core/Entities/User/Meeting.cs
  13. 17 0
      MTWorkHR.Core/Global/Enum/RepeatEnum.cs
  14. 2 0
      MTWorkHR.Infrastructure/Entities/UserAttachment.cs
  15. 3348 0
      MTWorkHR.Infrastructure/Migrations/20240626094811_attachContent.Designer.cs
  16. 29 0
      MTWorkHR.Infrastructure/Migrations/20240626094811_attachContent.cs
  17. 3356 0
      MTWorkHR.Infrastructure/Migrations/20240627085357_altrMeeting.Designer.cs
  18. 73 0
      MTWorkHR.Infrastructure/Migrations/20240627085357_altrMeeting.cs
  19. 3359 0
      MTWorkHR.Infrastructure/Migrations/20240627111332_altrUserAtta.Designer.cs
  20. 28 0
      MTWorkHR.Infrastructure/Migrations/20240627111332_altrUserAtta.cs
  21. 19 4
      MTWorkHR.Infrastructure/Migrations/HRDataContextModelSnapshot.cs

+ 11 - 4
MTWorkHR.API/Controllers/UserController.cs

@@ -1,4 +1,5 @@
-using Microsoft.AspNetCore.Authorization;
+using Countries.NET.Database;
+using Microsoft.AspNetCore.Authorization;
 
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
@@ -48,9 +49,9 @@ namespace MTWorkHR.API.Controllers
         [HttpPost("Update")]
         [Consumes("multipart/form-data")]
         [ProducesResponseType(StatusCodes.Status200OK)]
-        public async Task Update([FromForm] UserUpdateDto input)
+        public async Task<ActionResult<UserDto>> Update([FromForm] UserUpdateDto input)
         {
-            await _userService.Update(input);
+            return Ok(await _userService.Update(input));
         }
 
         [HttpPost("Delete")]
@@ -68,7 +69,13 @@ namespace MTWorkHR.API.Controllers
             return await _userService.ResetPassword(input);
         }
 
+        [HttpGet("GetBlobFile")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+        public async Task<ActionResult> GetBlobFile([FromBody] string filePath)
+        {
+            var res = await _userService.Download(filePath);
+            return File(res.Content, res.ContentType);
+        }
 
-       
     }
 }

+ 2 - 0
MTWorkHR.Application/Dtos/Identity/AttachmentDto.cs

@@ -17,6 +17,8 @@ namespace MTWorkHR.Application.Models
 
         public string? OriginalName { get; set; }
         public string? FilePath { get; set; }
+        public byte[]? Content { get; set; }
+        public string? ContentType { get; set; }
 
     }
 }

+ 11 - 0
MTWorkHR.Application/Dtos/Identity/BlobObject.cs

@@ -0,0 +1,11 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace MTWorkHR.Application.Models
+{
+    public class BlobObject
+    {
+        public Stream? Content{ get; set; }
+
+        public string? ContentType{ get; set; }
+    }
+}

+ 6 - 2
MTWorkHR.Application/Dtos/User/MeetingDto.cs

@@ -1,6 +1,7 @@
 using Microsoft.AspNetCore.Http;
 using MTWorkHR.Core.Entities;
 using MTWorkHR.Core.Entities.Base;
+using MTWorkHR.Core.Global;
 using System.ComponentModel.DataAnnotations;
 using System.ComponentModel.DataAnnotations.Schema;
 
@@ -16,8 +17,11 @@ namespace MTWorkHR.Application.Models
         [MaxLength(500)]
         [Filter]
         public string? Description { get; set; }
-        public DateTime StartDate { get; set; }
-        public DateTime EndDate { get; set; }
+        public DateTime MeetingDate { get; set; }
+        public string StartTime { get; set; }
+        public string EndTime { get; set; }
+        public RepeatEnum RepeatId { get; set; } = 0;
+
         [MaxLength(250)]
         public string? Location { get; set; }
         [MaxLength(250)]

+ 4 - 3
MTWorkHR.Application/Mapper/MappingProfile.cs

@@ -44,11 +44,12 @@ namespace MTWorkHR.Application.Mapper
             
             CreateMap<UserUpdateDto, ApplicationUser>()
                 .ForMember(m => m.UserRoles, op => op.Ignore())
-                .ForMember(m => m.UserAttachments, op => op.Ignore())
-                .ForMember(m => m.UserAddress, op => op.Ignore())
+              //  .ForMember(m => m.UserAttachments, op => op.Ignore())
+              //  .ForMember(m => m.UserAddress, op => op.Ignore())
                 .ForMember(m => m.Id, op => op.Ignore());
 
-            CreateMap<ApplicationUser, UserUpdateDto>();
+            CreateMap<ApplicationUser, UserUpdateDto>().ForMember(m => m.Password, op => op.Ignore());
+            CreateMap<UserDto, UserUpdateDto>().ReverseMap();
 
             CreateMap<AttachmentDto, UserAttachment>().ReverseMap();
             CreateMap<UserAddress, UserAddressDto>()

+ 70 - 8
MTWorkHR.Application/Services/Base/BlobFileService.cs

@@ -1,11 +1,13 @@
 using AutoMapper;
 using Azure.Storage.Blobs;
+using Azure.Storage.Blobs.Models;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.StaticFiles;
 using MTWorkHR.Application.Models;
 using MTWorkHR.Application.Services.Interfaces;
 using MTWorkHR.Core.Global;
+using System.IO;
 using System.Net.Http.Headers;
 
 namespace MTWorkHR.Application.Services
@@ -39,7 +41,61 @@ namespace MTWorkHR.Application.Services
                 return "";
             }
         }
-       
+        public async Task<string> UploadFileCloud(AttachmentDto file)
+        {
+            try
+            {
+                var blobClient = _containerClient.GetBlobClient(file.FileName);
+                //var stream = file.FileData.OpenReadStream();
+                using (Stream fs = file.FileData.OpenReadStream())
+                {
+                    var status = await blobClient.UploadAsync(fs, true);
+                    fs.Position = 0;
+                    using (BinaryReader br = new BinaryReader(fs))
+                    {
+                        byte[] bytes = br.ReadBytes((Int32)fs.Length);
+                        var Headers = file.FileData.Headers;
+                        file.Content = bytes;
+                        file.ContentType = file.FileData.ContentType;
+                        file.FilePath = blobClient.Uri.AbsoluteUri;
+                    }
+                }
+                //if(status.Value == "201")
+                return blobClient.Uri.AbsoluteUri;
+            }
+            catch (Exception ex)
+            {
+                return "";
+            }
+        }
+
+        public async Task<BlobObject> Download(string url)
+        {
+            try
+            {
+                var fileName = new Uri(url).Segments.LastOrDefault();
+                var blobClient = _containerClient.GetBlobClient(fileName);
+                if(await blobClient.ExistsAsync())
+                {
+                    BlobDownloadResult content = await blobClient.DownloadContentAsync();
+                    var downloadedData = content.Content.ToStream();
+                    if (ImageExtensions.Contains(Path.GetExtension(fileName.ToUpperInvariant())))
+                    {
+                        var extension = Path.GetExtension(fileName);
+                        return new BlobObject { Content = downloadedData, ContentType = "image/"+extension.Remove(0,1) };
+                    }
+                    else
+                    {
+                        return new BlobObject { Content = downloadedData, ContentType = content.Details.ContentType };
+                    }
+                }
+                return null;
+            }
+            catch (Exception ex)
+            {
+                return null;
+            }
+        }
         public async Task<List<string>> UploadFiles(List<IFormFile> files)
         {
             List<string> msgs = new List<string>();
@@ -72,10 +128,7 @@ namespace MTWorkHR.Application.Services
             return msgs;
         }
 
-       
-
-
-
+    
         
         public async Task<bool> Delete(string fileName)
         {
@@ -97,9 +150,9 @@ namespace MTWorkHR.Application.Services
             {
                 if (attach.FileData != null)
                 {
-                    var resPath = UploadFile(attach.FileData).Result;
-                    if (resPath != "")
-                        attach.FilePath = resPath;
+                    var resPath = UploadFileCloud(attach).Result;
+                    //if (resPath != "")
+                    //    attach.FilePath = resPath;
                 }
                 
             }
@@ -134,5 +187,14 @@ namespace MTWorkHR.Application.Services
         {
             throw new NotImplementedException();
         }
+
+
+        string[] ImageExtensions = new string[]
+           {
+                ".JPEG"
+                , ".JPG"
+                , ".PNG"
+              
+           };
     }
 }

+ 5 - 0
MTWorkHR.Application/Services/Base/FileService.cs

@@ -210,5 +210,10 @@ namespace MTWorkHR.Application.Services
         {
             throw new NotImplementedException();
         }
+
+        public Task<BlobObject> Download(string url)
+        {
+            throw new NotImplementedException();
+        }
     }
 }

+ 1 - 0
MTWorkHR.Application/Services/Interfaces/IFileService.cs

@@ -19,5 +19,6 @@ namespace MTWorkHR.Application.Services.Interfaces
         string GetTempAttachmentPath();
         string GetActualAttachmentPath();
         Task<Tuple<MemoryStream, string, string>> GetFileDownloadInfo(string fileUrl);
+        Task<BlobObject> Download(string url);
     }
 }

+ 1 - 1
MTWorkHR.Application/Services/Interfaces/IUserService.cs

@@ -28,6 +28,6 @@ namespace MTWorkHR.Application.Identity
         Task<bool> VerifyOTP(VerifyOTPDto input);
 
         Task<List<UserAllDto>> GetAllCompanyEmployees();
-
+        Task<BlobObject> Download(string filePath);
     }
 }

+ 4 - 2
MTWorkHR.Application/Services/User/MeetingService.cs

@@ -57,8 +57,10 @@ namespace MTWorkHR.Application.Services
             entity.Location = input.Location;
             entity.Title = input.Title;
             entity.MeetingLink = input.MeetingLink;
-            entity.StartDate = input.StartDate;
-            entity.EndDate = input.EndDate;
+            entity.MeetingDate = input.MeetingDate;
+            entity.StartTime = input.StartTime;
+            entity.EndTime = input.EndTime;
+            entity.RepeatId = input.RepeatId;
             var oldUsers = entity.MeetingUsers?.Select(s => s.AssignedUserId);
 
             var NewItems = input.MeetingUserIds?.Where(u => !oldUsers.Contains(u));

+ 56 - 4
MTWorkHR.Application/Services/User/UserService.cs

@@ -21,6 +21,8 @@ using System.Linq.Dynamic.Core;
 using MTWorkHR.Core.Entities.Base;
 using MTWorkHR.Infrastructure.EmailService;
 using Countries.NET.Database;
+using Microsoft.AspNetCore.Http;
+using System.Collections;
 
 namespace MTWorkHR.Application.Services
 {
@@ -66,7 +68,37 @@ namespace MTWorkHR.Application.Services
                 .Include(x => x.Qualification)
                 .FirstOrDefaultAsync(x => x.Id == id);
             var response = MapperObject.Mapper.Map<UserDto>(entity);
-
+            if (response.UserAttachments != null)
+                foreach (var attach in response.UserAttachments.Where(a => a.Content != null))
+                {
+                    //var stream = new MemoryStream(attach.Content);
+                    //IFormFile file = new FormFile(stream, 0, stream.Length, Path.GetFileNameWithoutExtension(attach.FileName), attach.FileName);
+
+                    using (var stream = new MemoryStream(attach.Content))
+                    {
+                        var file = new FormFile(stream, 0, stream.Length, Path.GetFileNameWithoutExtension(attach.FileName), attach.FileName)
+                        {
+                            Headers = new HeaderDictionary(),
+                            ContentType = attach.ContentType,
+                        };
+
+                        System.Net.Mime.ContentDisposition cd = new System.Net.Mime.ContentDisposition
+                        {
+                            FileName = file.FileName
+                        };
+                        file.ContentDisposition = cd.ToString();
+                        switch (attach.AttachmentTypeId)
+                        {
+                            case 1:
+                                response.CVAttach = file;
+                                break;
+                            case 2:
+                                response.PassportAttach = file;
+                                break;
+                        }
+                    }
+                   
+                }
             return response;
         }
         public async Task<UserDto> GetUserById(string id)
@@ -304,6 +336,12 @@ namespace MTWorkHR.Application.Services
 
             return input;
         }
+
+        public async Task<BlobObject> Download(string filePath)
+        {
+            var file = await _fileService.Download(filePath);
+                return file;
+        }
         public async Task<bool> ConfirmEmail(ConfirmEmailDto input)
         {
             var user = await _userManager.FindByIdAsync(input.UserId);
@@ -348,34 +386,47 @@ namespace MTWorkHR.Application.Services
         {
             try
             {
-                var entity = await _userManager.FindByIdAsync(input.Id);
+                var entity =  _userManager.Users.Include(x => x.UserAttachments).FirstOrDefault(x=> x.Id == input.Id);
 
                 if (entity == null)
                     throw new AppException(ExceptionEnum.RecordNotExist);
                 if (input.UserAttachments == null)
                     input.UserAttachments = new List<AttachmentDto>();
+                var oldAttachList = entity.UserAttachments;
                 if (input.ProfileImage != null)
                 {
+                    var oldAttach = oldAttachList.Where(x => x.AttachmentTypeId == 9 || x.OriginalName == input.ProfileImage?.Name).FirstOrDefault();
+                    if(oldAttach != null) entity.UserAttachments.Remove(oldAttach);
                     input.UserAttachments.Add(new AttachmentDto { FileData = input.ProfileImage, OriginalName = input.ProfileImage?.Name, FileName = input.ProfileImage?.FileName, AttachmentTypeId = 9 });
                 }
                 if (input.CVAttach != null)
                 {
+                    var oldAttach = oldAttachList.Where(x => x.AttachmentTypeId == 1 || x.OriginalName == input.CVAttach?.Name).FirstOrDefault();
+                    if (oldAttach != null) entity.UserAttachments.Remove(oldAttach);
                     input.UserAttachments.Add(new AttachmentDto { FileData = input.CVAttach, OriginalName = input.CVAttach?.Name, FileName = input.CVAttach?.FileName, AttachmentTypeId = 1 });
                 }
                 if (input.PassportAttach != null)
                 {
+                    var oldAttach = oldAttachList.Where(x => x.AttachmentTypeId == 2 || x.OriginalName == input.PassportAttach?.Name).FirstOrDefault();
+                    if (oldAttach != null) entity.UserAttachments.Remove(oldAttach);
                     input.UserAttachments.Add(new AttachmentDto { FileData = input.PassportAttach, OriginalName = input.PassportAttach?.Name, FileName = input.PassportAttach?.FileName, AttachmentTypeId = 2 });
                 }
                 if (input.EduCertificateAttach != null)
                 {
+                    var oldAttach = oldAttachList.Where(x => x.AttachmentTypeId == 3 || x.OriginalName == input.EduCertificateAttach?.Name).FirstOrDefault();
+                    if (oldAttach != null) entity.UserAttachments.Remove(oldAttach);
                     input.UserAttachments.Add(new AttachmentDto { FileData = input.EduCertificateAttach, OriginalName = input.EduCertificateAttach?.Name, FileName = input.EduCertificateAttach?.FileName, AttachmentTypeId = 3 });
                 }
                 if (input.ExperienceCertificateAttach != null)
                 {
+                    var oldAttach = oldAttachList.Where(x => x.AttachmentTypeId == 4 || x.OriginalName == input.ExperienceCertificateAttach?.Name).FirstOrDefault();
+                    if (oldAttach != null) entity.UserAttachments.Remove(oldAttach);
                     input.UserAttachments.Add(new AttachmentDto { FileData = input.ExperienceCertificateAttach, OriginalName = input.ExperienceCertificateAttach?.Name, FileName = input.ExperienceCertificateAttach?.FileName, AttachmentTypeId = 4 });
                 }
                 if (input.ProfCertificateAttach != null)
                 {
+                    var oldAttach = oldAttachList.Where(x => x.AttachmentTypeId == 5 || x.OriginalName == input.ProfCertificateAttach?.Name).FirstOrDefault();
+                    if (oldAttach != null) entity.UserAttachments.Remove(oldAttach);
                     input.UserAttachments.Add(new AttachmentDto { FileData = input.ProfCertificateAttach, OriginalName = input.ProfCertificateAttach?.Name, FileName = input.ProfCertificateAttach?.FileName, AttachmentTypeId = 5 });
                 }
                 List<AttachmentDto> attachs = input.UserAttachments.ToList();
@@ -418,8 +469,9 @@ namespace MTWorkHR.Application.Services
             {
                 throw e;
             }
-
-            return input;
+            var userResponse = await GetById(input.Id);
+            var user = MapperObject.Mapper.Map<UserUpdateDto>(userResponse);
+            return user;
         }
 
 

+ 6 - 2
MTWorkHR.Core/Entities/User/Meeting.cs

@@ -5,6 +5,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using MTWorkHR.Core.Entities.Base;
+using MTWorkHR.Core.Global;
 
 namespace MTWorkHR.Core.Entities
 {
@@ -18,14 +19,17 @@ namespace MTWorkHR.Core.Entities
         [MaxLength(500)]
         [Filter]
         public string? Description { get; set; }
-        public DateTime StartDate { get; set; }
-        public DateTime EndDate { get; set; }
+        public DateTime MeetingDate { get; set; }
+        public string StartTime{ get; set; }
+        public string EndTime { get; set; }
         [MaxLength(250)]
         [Filter]
         public string? Location { get; set; }
         [MaxLength(250)]
         public string? MeetingLink { get; set; }
         public long CompanyId { get; set; }
+        public RepeatEnum RepeatId { get; set; }
+
         public List<MeetingUser>? MeetingUsers{ get; set; }
     }
 }

+ 17 - 0
MTWorkHR.Core/Global/Enum/RepeatEnum.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MTWorkHR.Core.Global
+{
+    public enum RepeatEnum
+    {
+        Daily = 1,
+        Weekly = 2,
+        Monthly = 3,
+        Yearly = 4,
+        Custom = 5
+    }
+}

+ 2 - 0
MTWorkHR.Infrastructure/Entities/UserAttachment.cs

@@ -17,10 +17,12 @@ namespace MTWorkHR.Infrastructure.Entities
 
         [MaxLength(250)]
         public string FileName { get; set; }
+        public byte[] Content { get; set; }
 
         [MaxLength(250)]
         public string OriginalName { get; set; }
         public string? FilePath { get; set; }
+        public string? ContentType { get; set; }
 
     }
 }

Файловите разлики са ограничени, защото са твърде много
+ 3348 - 0
MTWorkHR.Infrastructure/Migrations/20240626094811_attachContent.Designer.cs


+ 29 - 0
MTWorkHR.Infrastructure/Migrations/20240626094811_attachContent.cs

@@ -0,0 +1,29 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class attachContent : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.AddColumn<byte[]>(
+                name: "Content",
+                table: "UserAttachments",
+                type: "varbinary(max)",
+                nullable: false,
+                defaultValue: new byte[0]);
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropColumn(
+                name: "Content",
+                table: "UserAttachments");
+        }
+    }
+}

Файловите разлики са ограничени, защото са твърде много
+ 3356 - 0
MTWorkHR.Infrastructure/Migrations/20240627085357_altrMeeting.Designer.cs


+ 73 - 0
MTWorkHR.Infrastructure/Migrations/20240627085357_altrMeeting.cs

@@ -0,0 +1,73 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class altrMeeting : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropColumn(
+                name: "EndDate",
+                table: "Meetings");
+
+            migrationBuilder.RenameColumn(
+                name: "StartDate",
+                table: "Meetings",
+                newName: "MeetingDate");
+
+            migrationBuilder.AddColumn<string>(
+                name: "EndTime",
+                table: "Meetings",
+                type: "nvarchar(max)",
+                nullable: false,
+                defaultValue: "");
+
+            migrationBuilder.AddColumn<int>(
+                name: "RepeatId",
+                table: "Meetings",
+                type: "int",
+                nullable: false,
+                defaultValue: 0);
+
+            migrationBuilder.AddColumn<string>(
+                name: "StartTime",
+                table: "Meetings",
+                type: "nvarchar(max)",
+                nullable: false,
+                defaultValue: "");
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropColumn(
+                name: "EndTime",
+                table: "Meetings");
+
+            migrationBuilder.DropColumn(
+                name: "RepeatId",
+                table: "Meetings");
+
+            migrationBuilder.DropColumn(
+                name: "StartTime",
+                table: "Meetings");
+
+            migrationBuilder.RenameColumn(
+                name: "MeetingDate",
+                table: "Meetings",
+                newName: "StartDate");
+
+            migrationBuilder.AddColumn<DateTime>(
+                name: "EndDate",
+                table: "Meetings",
+                type: "datetime2",
+                nullable: false,
+                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
+        }
+    }
+}

Файловите разлики са ограничени, защото са твърде много
+ 3359 - 0
MTWorkHR.Infrastructure/Migrations/20240627111332_altrUserAtta.Designer.cs


+ 28 - 0
MTWorkHR.Infrastructure/Migrations/20240627111332_altrUserAtta.cs

@@ -0,0 +1,28 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class altrUserAtta : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.AddColumn<string>(
+                name: "ContentType",
+                table: "UserAttachments",
+                type: "nvarchar(max)",
+                nullable: true);
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropColumn(
+                name: "ContentType",
+                table: "UserAttachments");
+        }
+    }
+}

+ 19 - 4
MTWorkHR.Infrastructure/Migrations/HRDataContextModelSnapshot.cs

@@ -1113,8 +1113,9 @@ namespace MTWorkHR.Infrastructure.Migrations
                         .HasMaxLength(500)
                         .HasColumnType("nvarchar(500)");
 
-                    b.Property<DateTime>("EndDate")
-                        .HasColumnType("datetime2");
+                    b.Property<string>("EndTime")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
 
                     b.Property<bool>("IsDeleted")
                         .HasColumnType("bit")
@@ -1124,12 +1125,19 @@ namespace MTWorkHR.Infrastructure.Migrations
                         .HasMaxLength(250)
                         .HasColumnType("nvarchar(250)");
 
+                    b.Property<DateTime>("MeetingDate")
+                        .HasColumnType("datetime2");
+
                     b.Property<string>("MeetingLink")
                         .HasMaxLength(250)
                         .HasColumnType("nvarchar(250)");
 
-                    b.Property<DateTime>("StartDate")
-                        .HasColumnType("datetime2");
+                    b.Property<int>("RepeatId")
+                        .HasColumnType("int");
+
+                    b.Property<string>("StartTime")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
 
                     b.Property<string>("Title")
                         .IsRequired()
@@ -2860,6 +2868,13 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Property<long>("AttachmentTypeId")
                         .HasColumnType("bigint");
 
+                    b.Property<byte[]>("Content")
+                        .IsRequired()
+                        .HasColumnType("varbinary(max)");
+
+                    b.Property<string>("ContentType")
+                        .HasColumnType("nvarchar(max)");
+
                     b.Property<DateTime>("CreateDate")
                         .HasColumnType("datetime2")
                         .HasColumnOrder(3);