Renamed columns in ActivityChecklist

This commit is contained in:
Vikas Nale 2025-04-15 18:05:42 +05:30
parent f906e8f7d0
commit c7304dc80b
9 changed files with 19 additions and 19 deletions

View File

@ -325,8 +325,8 @@ namespace Marco.Pms.DataAccess.Migrations
{ {
Id = table.Column<int>(type: "int", nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ActivityMasterId = table.Column<int>(type: "int", nullable: false), ActivityId = table.Column<int>(type: "int", nullable: false),
Check = table.Column<string>(type: "longtext", nullable: true) Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
IsChecked = table.Column<bool>(type: "tinyint(1)", nullable: false), IsChecked = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsMandatory = table.Column<bool>(type: "tinyint(1)", nullable: false), IsMandatory = table.Column<bool>(type: "tinyint(1)", nullable: false),

View File

@ -15,7 +15,7 @@ namespace Marco.Pms.Model.Activities
public TaskAllocation? TaskAllocation { get; set; } public TaskAllocation? TaskAllocation { get; set; }
public DateTime CommentDate { get; set; } public DateTime CommentDate { get; set; }
public string Comment { get; set; } public string Comment { get; set; } = string.Empty;
public int CommentedBy { get; set; } public int CommentedBy { get; set; }
[ForeignKey("CommentedBy")] [ForeignKey("CommentedBy")]
[ValidateNever] [ValidateNever]

View File

@ -3,7 +3,7 @@
public class CreateCheckListDto public class CreateCheckListDto
{ {
public int Id { get; set; } public int Id { get; set; }
public string? Check { get; set; } public string? Description { get; set; }
public bool IsMandatory { get; set; } public bool IsMandatory { get; set; }
} }
} }

View File

@ -3,7 +3,7 @@
public class ReportCheckListDto public class ReportCheckListDto
{ {
public int Id { get; set; } public int Id { get; set; }
public string? Check { get; set; } public string Description { get; set; }= string.Empty;
public bool IsMandatory { get; set; } public bool IsMandatory { get; set; }
public bool IsChecked { get; set; } public bool IsChecked { get; set; }
} }

View File

@ -3,8 +3,8 @@
public class ActivityCheckList public class ActivityCheckList
{ {
public int Id { get; set; } public int Id { get; set; }
public int ActivityMasterId { get; set; } public int ActivityId { get; set; }
public string? Check { get; set; } public string? Description { get; set; } = string.Empty;
public bool IsChecked { get; set; } = false; public bool IsChecked { get; set; } = false;
public bool IsMandatory { get; set; } public bool IsMandatory { get; set; }
public int TenantId { get; set; } public int TenantId { get; set; }

View File

@ -138,8 +138,8 @@ namespace Marco.Pms.Model.Mapper
return new CheckListVM return new CheckListVM
{ {
Id = checkList.Id, Id = checkList.Id,
Check = checkList.Check, Description = checkList.Description,
ActivityMasterId = activityId, ActivityId = activityId,
IsChecked = IsChecked, IsChecked = IsChecked,
IsMandatory = checkList.IsMandatory, IsMandatory = checkList.IsMandatory,
}; };
@ -149,8 +149,8 @@ namespace Marco.Pms.Model.Mapper
return new ActivityCheckList return new ActivityCheckList
{ {
Id = checkListDto.Id, Id = checkListDto.Id,
Check = checkListDto.Check, Description = checkListDto.Description,
ActivityMasterId = activityId, ActivityId = activityId,
IsMandatory = checkListDto.IsMandatory, IsMandatory = checkListDto.IsMandatory,
TenantId = tenantId TenantId = tenantId
}; };
@ -160,8 +160,8 @@ namespace Marco.Pms.Model.Mapper
return new CheckListVM return new CheckListVM
{ {
Id = checkListDto.Id, Id = checkListDto.Id,
Check = checkListDto.Check, Description = checkListDto.Description,
ActivityMasterId = activityId, ActivityId = activityId,
IsChecked = checkListDto.IsChecked, IsChecked = checkListDto.IsChecked,
IsMandatory = checkListDto.IsMandatory, IsMandatory = checkListDto.IsMandatory,
}; };

View File

@ -3,8 +3,8 @@
public class CheckListVM public class CheckListVM
{ {
public int Id { get; set; } public int Id { get; set; }
public int ActivityMasterId { get; set; } public int ActivityId { get; set; }
public string? Check { get; set; } public string? Description { get; set; }
public bool IsChecked { get; set; } public bool IsChecked { get; set; }
public bool IsMandatory { get; set; } public bool IsMandatory { get; set; }
} }

View File

@ -31,7 +31,7 @@ namespace Marco.Pms.Services.Controllers
var activities = await _context.ActivityMasters.Where(c => c.TenantId == tenantId && c.IsActive == true).ToListAsync(); var activities = await _context.ActivityMasters.Where(c => c.TenantId == tenantId && c.IsActive == true).ToListAsync();
List<ActivityVM> activitiesVM = new List<ActivityVM>(); List<ActivityVM> activitiesVM = new List<ActivityVM>();
foreach (var activity in activities) { foreach (var activity in activities) {
var checkList = await _context.ActivityCheckLists.Where(c => c.TenantId == tenantId && c.ActivityMasterId == activity.Id).ToListAsync(); var checkList = await _context.ActivityCheckLists.Where(c => c.TenantId == tenantId && c.ActivityId == activity.Id).ToListAsync();
List<CheckListVM> checkListVM = new List<CheckListVM>(); List<CheckListVM> checkListVM = new List<CheckListVM>();
if(checkList != null) if(checkList != null)
{ {

View File

@ -235,18 +235,18 @@ namespace MarcoBMS.Services.Controllers
{ {
commentVM.Add(comment.ToCommentVMFromTaskComment()); commentVM.Add(comment.ToCommentVMFromTaskComment());
} }
List<ActivityCheckList> checkLists = await _context.ActivityCheckLists.Where(x => x.ActivityMasterId == taskAllocation.WorkItem.ActivityId).ToListAsync(); List<ActivityCheckList> checkLists = await _context.ActivityCheckLists.Where(x => x.ActivityId == taskAllocation.WorkItem.ActivityId).ToListAsync();
List<CheckListMappings> checkListMappings = await _context.CheckListMappings.Where(c => c.TaskAllocationId == taskAllocation.Id).ToListAsync(); List<CheckListMappings> checkListMappings = await _context.CheckListMappings.Where(c => c.TaskAllocationId == taskAllocation.Id).ToListAsync();
List<CheckListVM>checkList = new List<CheckListVM>(); List<CheckListVM>checkList = new List<CheckListVM>();
foreach (var check in checkLists) { foreach (var check in checkLists) {
var checkListMapping = checkListMappings.Find(c => c.CheckListId == check.Id); var checkListMapping = checkListMappings.Find(c => c.CheckListId == check.Id);
if(checkListMapping != null) if(checkListMapping != null)
{ {
checkList.Add(check.ToCheckListVMFromActivityCheckList(check.ActivityMasterId, true)); checkList.Add(check.ToCheckListVMFromActivityCheckList(check.ActivityId, true));
} }
else else
{ {
checkList.Add(check.ToCheckListVMFromActivityCheckList(check.ActivityMasterId, false)); checkList.Add(check.ToCheckListVMFromActivityCheckList(check.ActivityId, false));
} }
} }
response.comments = commentVM; response.comments = commentVM;