added new fields inside workItem- parentTaskId and Description

This commit is contained in:
Pramod Mahajan 2025-06-18 17:34:33 +05:30
parent 1f56143142
commit 1c58265a9f
7 changed files with 3441 additions and 3 deletions

View File

@ -0,0 +1,41 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class EnhancedWorkItemForParentId_Description : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Description",
table: "WorkItems",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<Guid>(
name: "ParentTaskId",
table: "WorkItems",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Description",
table: "WorkItems");
migrationBuilder.DropColumn(
name: "ParentTaskId",
table: "WorkItems");
}
}
}

View File

@ -2176,6 +2176,12 @@ namespace Marco.Pms.DataAccess.Migrations
b.Property<double>("CompletedWork") b.Property<double>("CompletedWork")
.HasColumnType("double"); .HasColumnType("double");
b.Property<string>("Description")
.HasColumnType("longtext");
b.Property<Guid?>("ParentTaskId")
.HasColumnType("char(36)");
b.Property<double>("PlannedWork") b.Property<double>("PlannedWork")
.HasColumnType("double"); .HasColumnType("double");

View File

@ -11,5 +11,7 @@ namespace Marco.Pms.Model.Dtos.Project
public Guid ActivityID { get; set; } public Guid ActivityID { get; set; }
public int PlannedWork { get; set; } public int PlannedWork { get; set; }
public int CompletedWork { get; set; } public int CompletedWork { get; set; }
public Guid? ParentTaskId { get; set; }
public string? Comment { get; set; }
} }
} }

View File

@ -59,7 +59,9 @@ namespace Marco.Pms.Model.Mapper
WorkCategoryId = model.WorkCategoryId, WorkCategoryId = model.WorkCategoryId,
TaskDate = DateTime.Now, TaskDate = DateTime.Now,
TenantId = tenantId, TenantId = tenantId,
WorkAreaId = model.WorkAreaID WorkAreaId = model.WorkAreaID,
ParentTaskId = model.ParentTaskId,
Description = model.Comment
}; };
} }

View File

@ -20,11 +20,17 @@ namespace Marco.Pms.Model.Projects
[ValidateNever] [ValidateNever]
public ActivityMaster? ActivityMaster { get; set; } public ActivityMaster? ActivityMaster { get; set; }
[ForeignKey("WorkCategoryId")] [ForeignKey("WorkCategoryId")]
[ValidateNever] [ValidateNever]
public WorkCategoryMaster? WorkCategoryMaster { get; set; } public WorkCategoryMaster? WorkCategoryMaster { get; set; }
public Guid? ParentTaskId { get; set; }
public double PlannedWork { get; set; } public double PlannedWork { get; set; }
public double CompletedWork { get; set; } public double CompletedWork { get; set; }
public string? Description { get; set; }
public DateTime TaskDate { get; set; } public DateTime TaskDate { get; set; }
} }
} }

View File

@ -903,11 +903,11 @@ namespace Marco.Pms.Services.Helpers
List<ContactNote> notes = new List<ContactNote>(); List<ContactNote> notes = new List<ContactNote>();
if (active) if (active)
{ {
notes = await _context.ContactNotes.Where(n => n.ContactId == contact.Id && n.IsActive && n.TenantId == tenantId).ToListAsync(); notes = await _context.ContactNotes.Include(n => n.Createdby).Where(n => n.ContactId == contact.Id && n.IsActive && n.TenantId == tenantId).ToListAsync();
} }
else else
{ {
notes = await _context.ContactNotes.Where(n => n.ContactId == contact.Id && n.TenantId == tenantId).ToListAsync(); notes = await _context.ContactNotes.Include(n => n.Createdby).Where(n => n.ContactId == contact.Id && n.TenantId == tenantId).ToListAsync();
} }
var noteIds = notes.Select(n => n.Id).ToList(); var noteIds = notes.Select(n => n.Id).ToList();
List<DirectoryUpdateLog>? updateLogs = await _context.DirectoryUpdateLogs.Include(l => l.Employee).Where(l => noteIds.Contains(l.RefereanceId)).ToListAsync(); List<DirectoryUpdateLog>? updateLogs = await _context.DirectoryUpdateLogs.Include(l => l.Employee).Where(l => noteIds.Contains(l.RefereanceId)).ToListAsync();