added new fields inside workItem- parentTaskId and Description

This commit is contained in:
Pramod Mahajan 2025-06-18 17:34:33 +05:30 committed by ashutosh.nehete
parent 99818c42b0
commit f20b4a42a1
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

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

View File

@ -11,5 +11,7 @@ namespace Marco.Pms.Model.Dtos.Project
public Guid ActivityID { get; set; }
public int PlannedWork { 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,
TaskDate = DateTime.Now,
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]
public ActivityMaster? ActivityMaster { get; set; }
[ForeignKey("WorkCategoryId")]
[ValidateNever]
public WorkCategoryMaster? WorkCategoryMaster { get; set; }
public Guid? ParentTaskId { get; set; }
public double PlannedWork { get; set; }
public double CompletedWork { get; set; }
public string? Description { get; set; }
public DateTime TaskDate { get; set; }
}
}

View File

@ -903,11 +903,11 @@ namespace Marco.Pms.Services.Helpers
List<ContactNote> notes = new List<ContactNote>();
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
{
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();
List<DirectoryUpdateLog>? updateLogs = await _context.DirectoryUpdateLogs.Include(l => l.Employee).Where(l => noteIds.Contains(l.RefereanceId)).ToListAsync();