Added Functionality for approving the reported task
This commit is contained in:
parent
3dfde6d9a5
commit
5d5579882f
@ -69,6 +69,7 @@ namespace Marco.Pms.DataAccess.Data
|
|||||||
public DbSet<Document> Documents { get; set; }
|
public DbSet<Document> Documents { get; set; }
|
||||||
public DbSet<TicketTag> TicketTags { get; set; }
|
public DbSet<TicketTag> TicketTags { get; set; }
|
||||||
public DbSet<WorkCategoryMaster> WorkCategoryMasters { get; set; }
|
public DbSet<WorkCategoryMaster> WorkCategoryMasters { get; set; }
|
||||||
|
public DbSet<WorkStatusMaster> WorkStatusMasters { get; set; }
|
||||||
public DbSet<Contact> Contacts { get; set; }
|
public DbSet<Contact> Contacts { get; set; }
|
||||||
public DbSet<ContactCategoryMaster> ContactCategoryMasters { get; set; }
|
public DbSet<ContactCategoryMaster> ContactCategoryMasters { get; set; }
|
||||||
public DbSet<ContactEmail> ContactsEmails { get; set; }
|
public DbSet<ContactEmail> ContactsEmails { get; set; }
|
||||||
@ -434,6 +435,32 @@ namespace Marco.Pms.DataAccess.Data
|
|||||||
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
|
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
modelBuilder.Entity<WorkStatusMaster>().HasData(
|
||||||
|
new WorkStatusMaster
|
||||||
|
{
|
||||||
|
Id = new Guid("030bb085-e230-4370-aec7-9a74d652864e"),
|
||||||
|
Name = "Approve",
|
||||||
|
Description = "Confirm the tasks are actually finished as reported",
|
||||||
|
IsSystem = true,
|
||||||
|
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
|
||||||
|
},
|
||||||
|
new WorkStatusMaster
|
||||||
|
{
|
||||||
|
Id = new Guid("2a1a5b96-cf93-4111-b4b1-76c19d6333b4"),
|
||||||
|
Name = "Partially Approve",
|
||||||
|
Description = "Not all tasks are actually finished as reported",
|
||||||
|
IsSystem = true,
|
||||||
|
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
|
||||||
|
},
|
||||||
|
new WorkStatusMaster
|
||||||
|
{
|
||||||
|
Id = new Guid("00a062e6-62e6-42c5-b6b1-024328651b72"),
|
||||||
|
Name = "NCR",
|
||||||
|
Description = "Tasks are not finished as reported or have any issues in al the tasks",
|
||||||
|
IsSystem = true,
|
||||||
|
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3375
Marco.Pms.DataAccess/Migrations/20250616064217_Added_Apporved_By_In_TaskAllocation_Table.Designer.cs
generated
Normal file
3375
Marco.Pms.DataAccess/Migrations/20250616064217_Added_Apporved_By_In_TaskAllocation_Table.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,188 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||||
|
|
||||||
|
namespace Marco.Pms.DataAccess.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class Added_Apporved_By_In_TaskAllocation_Table : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "ApprovedById",
|
||||||
|
table: "TaskAllocations",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<DateTime>(
|
||||||
|
name: "ApprovedDate",
|
||||||
|
table: "TaskAllocations",
|
||||||
|
type: "datetime(6)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "ParentTaskId",
|
||||||
|
table: "TaskAllocations",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "ReportedById",
|
||||||
|
table: "TaskAllocations",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<double>(
|
||||||
|
name: "ReportedTask",
|
||||||
|
table: "TaskAllocations",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0.0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "WorkStatusId",
|
||||||
|
table: "TaskAllocations",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "WorkStatusMasters",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||||
|
Name = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
Description = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
IsSystem = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||||
|
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_WorkStatusMasters", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_WorkStatusMasters_Tenants_TenantId",
|
||||||
|
column: x => x.TenantId,
|
||||||
|
principalTable: "Tenants",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.InsertData(
|
||||||
|
table: "WorkStatusMasters",
|
||||||
|
columns: new[] { "Id", "Description", "IsSystem", "Name", "TenantId" },
|
||||||
|
values: new object[,]
|
||||||
|
{
|
||||||
|
{ new Guid("00a062e6-62e6-42c5-b6b1-024328651b72"), "Tasks are not finished as reported or have any issues in al the tasks", true, "NCR", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
||||||
|
{ new Guid("030bb085-e230-4370-aec7-9a74d652864e"), "Confirm the tasks are actually finished as reported", true, "Approve", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
||||||
|
{ new Guid("2a1a5b96-cf93-4111-b4b1-76c19d6333b4"), "Not all tasks are actually finished as reported", true, "Partially Approve", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_TaskAllocations_ApprovedById",
|
||||||
|
table: "TaskAllocations",
|
||||||
|
column: "ApprovedById");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_TaskAllocations_ReportedById",
|
||||||
|
table: "TaskAllocations",
|
||||||
|
column: "ReportedById");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_TaskAllocations_WorkStatusId",
|
||||||
|
table: "TaskAllocations",
|
||||||
|
column: "WorkStatusId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_WorkStatusMasters_TenantId",
|
||||||
|
table: "WorkStatusMasters",
|
||||||
|
column: "TenantId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_TaskAllocations_Employees_ApprovedById",
|
||||||
|
table: "TaskAllocations",
|
||||||
|
column: "ApprovedById",
|
||||||
|
principalTable: "Employees",
|
||||||
|
principalColumn: "Id");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_TaskAllocations_Employees_ReportedById",
|
||||||
|
table: "TaskAllocations",
|
||||||
|
column: "ReportedById",
|
||||||
|
principalTable: "Employees",
|
||||||
|
principalColumn: "Id");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_TaskAllocations_WorkStatusMasters_WorkStatusId",
|
||||||
|
table: "TaskAllocations",
|
||||||
|
column: "WorkStatusId",
|
||||||
|
principalTable: "WorkStatusMasters",
|
||||||
|
principalColumn: "Id");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_TaskAllocations_Employees_ApprovedById",
|
||||||
|
table: "TaskAllocations");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_TaskAllocations_Employees_ReportedById",
|
||||||
|
table: "TaskAllocations");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_TaskAllocations_WorkStatusMasters_WorkStatusId",
|
||||||
|
table: "TaskAllocations");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "WorkStatusMasters");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_TaskAllocations_ApprovedById",
|
||||||
|
table: "TaskAllocations");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_TaskAllocations_ReportedById",
|
||||||
|
table: "TaskAllocations");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_TaskAllocations_WorkStatusId",
|
||||||
|
table: "TaskAllocations");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ApprovedById",
|
||||||
|
table: "TaskAllocations");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ApprovedDate",
|
||||||
|
table: "TaskAllocations");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ParentTaskId",
|
||||||
|
table: "TaskAllocations");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ReportedById",
|
||||||
|
table: "TaskAllocations");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ReportedTask",
|
||||||
|
table: "TaskAllocations");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "WorkStatusId",
|
||||||
|
table: "TaskAllocations");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -28,6 +28,12 @@ namespace Marco.Pms.DataAccess.Migrations
|
|||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("char(36)");
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ApprovedById")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("ApprovedDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
b.Property<Guid>("AssignedBy")
|
b.Property<Guid>("AssignedBy")
|
||||||
.HasColumnType("char(36)");
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
@ -40,26 +46,44 @@ namespace Marco.Pms.DataAccess.Migrations
|
|||||||
b.Property<string>("Description")
|
b.Property<string>("Description")
|
||||||
.HasColumnType("longtext");
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ParentTaskId")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
b.Property<double>("PlannedTask")
|
b.Property<double>("PlannedTask")
|
||||||
.HasColumnType("double");
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ReportedById")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
b.Property<DateTime?>("ReportedDate")
|
b.Property<DateTime?>("ReportedDate")
|
||||||
.HasColumnType("datetime(6)");
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<double>("ReportedTask")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
b.Property<Guid>("TenantId")
|
b.Property<Guid>("TenantId")
|
||||||
.HasColumnType("char(36)");
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
b.Property<Guid>("WorkItemId")
|
b.Property<Guid>("WorkItemId")
|
||||||
.HasColumnType("char(36)");
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
|
b.Property<Guid?>("WorkStatusId")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ApprovedById");
|
||||||
|
|
||||||
b.HasIndex("AssignedBy");
|
b.HasIndex("AssignedBy");
|
||||||
|
|
||||||
|
b.HasIndex("ReportedById");
|
||||||
|
|
||||||
b.HasIndex("TenantId");
|
b.HasIndex("TenantId");
|
||||||
|
|
||||||
b.HasIndex("WorkItemId");
|
b.HasIndex("WorkItemId");
|
||||||
|
|
||||||
|
b.HasIndex("WorkStatusId");
|
||||||
|
|
||||||
b.ToTable("TaskAllocations");
|
b.ToTable("TaskAllocations");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1926,6 +1950,59 @@ namespace Marco.Pms.DataAccess.Migrations
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Marco.Pms.Model.Master.WorkStatusMaster", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<bool>("IsSystem")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<Guid>("TenantId")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("TenantId");
|
||||||
|
|
||||||
|
b.ToTable("WorkStatusMasters");
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("030bb085-e230-4370-aec7-9a74d652864e"),
|
||||||
|
Description = "Confirm the tasks are actually finished as reported",
|
||||||
|
IsSystem = true,
|
||||||
|
Name = "Approve",
|
||||||
|
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("2a1a5b96-cf93-4111-b4b1-76c19d6333b4"),
|
||||||
|
Description = "Not all tasks are actually finished as reported",
|
||||||
|
IsSystem = true,
|
||||||
|
Name = "Partially Approve",
|
||||||
|
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("00a062e6-62e6-42c5-b6b1-024328651b72"),
|
||||||
|
Description = "Tasks are not finished as reported or have any issues in al the tasks",
|
||||||
|
IsSystem = true,
|
||||||
|
Name = "NCR",
|
||||||
|
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b =>
|
modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
@ -2435,12 +2512,20 @@ namespace Marco.Pms.DataAccess.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b =>
|
modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b =>
|
||||||
{
|
{
|
||||||
|
b.HasOne("Marco.Pms.Model.Employees.Employee", "ApprovedBy")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ApprovedById");
|
||||||
|
|
||||||
b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee")
|
b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("AssignedBy")
|
.HasForeignKey("AssignedBy")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Marco.Pms.Model.Employees.Employee", "ReportedBy")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ReportedById");
|
||||||
|
|
||||||
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")
|
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("TenantId")
|
.HasForeignKey("TenantId")
|
||||||
@ -2453,11 +2538,21 @@ namespace Marco.Pms.DataAccess.Migrations
|
|||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Marco.Pms.Model.Master.WorkStatusMaster", "WorkStatus")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("WorkStatusId");
|
||||||
|
|
||||||
|
b.Navigation("ApprovedBy");
|
||||||
|
|
||||||
b.Navigation("Employee");
|
b.Navigation("Employee");
|
||||||
|
|
||||||
|
b.Navigation("ReportedBy");
|
||||||
|
|
||||||
b.Navigation("Tenant");
|
b.Navigation("Tenant");
|
||||||
|
|
||||||
b.Navigation("WorkItem");
|
b.Navigation("WorkItem");
|
||||||
|
|
||||||
|
b.Navigation("WorkStatus");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b =>
|
modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b =>
|
||||||
@ -3058,6 +3153,17 @@ namespace Marco.Pms.DataAccess.Migrations
|
|||||||
b.Navigation("Tenant");
|
b.Navigation("Tenant");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Marco.Pms.Model.Master.WorkStatusMaster", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("TenantId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Tenant");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b =>
|
modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")
|
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using Marco.Pms.Model.Employees;
|
using Marco.Pms.Model.Employees;
|
||||||
|
using Marco.Pms.Model.Master;
|
||||||
using Marco.Pms.Model.Projects;
|
using Marco.Pms.Model.Projects;
|
||||||
using Marco.Pms.Model.Utilities;
|
using Marco.Pms.Model.Utilities;
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||||
@ -10,29 +11,43 @@ namespace Marco.Pms.Model.Activities
|
|||||||
public class TaskAllocation : TenantRelation
|
public class TaskAllocation : TenantRelation
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
public Guid? ParentTaskId { get; set; }
|
||||||
|
|
||||||
public DateTime AssignmentDate { get; set; }
|
public DateTime AssignmentDate { get; set; }
|
||||||
public double PlannedTask { get; set; }
|
public double PlannedTask { get; set; }
|
||||||
public double CompletedTask { get; set; }
|
public double CompletedTask { get; set; }
|
||||||
|
public double ReportedTask { get; set; }
|
||||||
public DateTime? ReportedDate { get; set; }
|
public DateTime? ReportedDate { get; set; }
|
||||||
|
public DateTime? ApprovedDate { get; set; }
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
|
|
||||||
//public int? WorkItemMappingId { get; set; }
|
|
||||||
//[ForeignKey("WorkItemMappingId")]
|
|
||||||
//[ValidateNever]
|
|
||||||
//public WorkItemMapping? WorkItemMapping { get; set; }
|
|
||||||
|
|
||||||
public Guid AssignedBy { get; set; } //Employee Id
|
public Guid AssignedBy { get; set; } //Employee Id
|
||||||
|
|
||||||
[ForeignKey("AssignedBy")]
|
[ForeignKey("AssignedBy")]
|
||||||
[ValidateNever]
|
[ValidateNever]
|
||||||
public Employee? Employee { get; set; }
|
public Employee? Employee { get; set; }
|
||||||
|
|
||||||
|
public Guid? ReportedById { get; set; } //Employee Id
|
||||||
|
|
||||||
|
[ForeignKey("ReportedById")]
|
||||||
|
[ValidateNever]
|
||||||
|
public Employee? ReportedBy { get; set; }
|
||||||
|
|
||||||
|
public Guid? ApprovedById { get; set; } //Employee Id
|
||||||
|
|
||||||
|
[ForeignKey("ApprovedById")]
|
||||||
|
[ValidateNever]
|
||||||
|
public Employee? ApprovedBy { get; set; }
|
||||||
|
|
||||||
public Guid WorkItemId { get; set; }
|
public Guid WorkItemId { get; set; }
|
||||||
|
|
||||||
[ForeignKey("WorkItemId")]
|
[ForeignKey("WorkItemId")]
|
||||||
[ValidateNever]
|
[ValidateNever]
|
||||||
public WorkItem? WorkItem { get; set; }
|
public WorkItem? WorkItem { get; set; }
|
||||||
|
|
||||||
|
public Guid? WorkStatusId { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey("WorkStatusId")]
|
||||||
|
[ValidateNever]
|
||||||
|
public WorkStatusMaster? WorkStatus { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
Marco.Pms.Model/Activities/WorkStatusMaster.cs
Normal file
12
Marco.Pms.Model/Activities/WorkStatusMaster.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using Marco.Pms.Model.Utilities;
|
||||||
|
|
||||||
|
namespace Marco.Pms.Model.Master
|
||||||
|
{
|
||||||
|
public class WorkStatusMaster : TenantRelation
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
public string Name { get; set; } = string.Empty;
|
||||||
|
public string Description { get; set; } = string.Empty;
|
||||||
|
public bool IsSystem { get; set; } = false;
|
||||||
|
}
|
||||||
|
}
|
13
Marco.Pms.Model/Dtos/Activities/ApproveTaskDto.cs
Normal file
13
Marco.Pms.Model/Dtos/Activities/ApproveTaskDto.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using Marco.Pms.Model.Utilities;
|
||||||
|
|
||||||
|
namespace Marco.Pms.Model.Dtos.Activities
|
||||||
|
{
|
||||||
|
public class ApproveTaskDto
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
public Guid WorkStatus { get; set; }
|
||||||
|
public long ApprovedTask { get; set; }
|
||||||
|
public string? Comment { get; set; }
|
||||||
|
public List<FileUploadModel>? Images { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,7 @@
|
|||||||
public class AssignTaskDto
|
public class AssignTaskDto
|
||||||
{
|
{
|
||||||
public DateTime AssignmentDate { get; set; }
|
public DateTime AssignmentDate { get; set; }
|
||||||
|
public Guid? ParentTaskId { get; set; }
|
||||||
public double PlannedTask { get; set; }
|
public double PlannedTask { get; set; }
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
public List<Guid>? TaskTeam { get; set; } //Employee Ids
|
public List<Guid>? TaskTeam { get; set; } //Employee Ids
|
||||||
|
@ -5,6 +5,7 @@ namespace Marco.Pms.Model.Dtos.Activities
|
|||||||
public class ReportTaskDto
|
public class ReportTaskDto
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
public Guid? ParentTaskId { get; set; }
|
||||||
public double CompletedTask { get; set; }
|
public double CompletedTask { get; set; }
|
||||||
public DateTime ReportedDate { get; set; }
|
public DateTime ReportedDate { get; set; }
|
||||||
public string? Comment { get; set; }
|
public string? Comment { get; set; }
|
||||||
|
@ -13,6 +13,7 @@ namespace Marco.Pms.Model.Mapper
|
|||||||
return new TaskAllocation
|
return new TaskAllocation
|
||||||
{
|
{
|
||||||
AssignmentDate = assignTask.AssignmentDate,
|
AssignmentDate = assignTask.AssignmentDate,
|
||||||
|
ParentTaskId = assignTask.ParentTaskId,
|
||||||
PlannedTask = assignTask.PlannedTask,
|
PlannedTask = assignTask.PlannedTask,
|
||||||
CompletedTask = 0,
|
CompletedTask = 0,
|
||||||
Description = assignTask.Description,
|
Description = assignTask.Description,
|
||||||
@ -43,18 +44,23 @@ namespace Marco.Pms.Model.Mapper
|
|||||||
TenantId = tenantId
|
TenantId = tenantId
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public static TaskVM TaskAllocationToTaskVM(this TaskAllocation taskAllocation, string employeeName)
|
public static TaskVM TaskAllocationToTaskVM(this TaskAllocation taskAllocation)
|
||||||
{
|
{
|
||||||
return new TaskVM
|
return new TaskVM
|
||||||
{
|
{
|
||||||
Id = taskAllocation.Id,
|
Id = taskAllocation.Id,
|
||||||
AssignmentDate = taskAllocation.AssignmentDate,
|
AssignmentDate = taskAllocation.AssignmentDate,
|
||||||
|
ReportedDate = taskAllocation.ReportedDate,
|
||||||
|
ApprovedDate = taskAllocation.ApprovedDate,
|
||||||
PlannedTask = taskAllocation.PlannedTask,
|
PlannedTask = taskAllocation.PlannedTask,
|
||||||
CompletedTask = taskAllocation.CompletedTask,
|
CompletedTask = taskAllocation.CompletedTask,
|
||||||
ReportedDate = taskAllocation.ReportedDate,
|
NotApprovedTask = taskAllocation.ApprovedById == null ? taskAllocation.CompletedTask : (taskAllocation.ReportedTask - taskAllocation.CompletedTask),
|
||||||
Description = taskAllocation.Description,
|
Description = taskAllocation.Description,
|
||||||
AssignBy = employeeName,
|
AssignedBy = taskAllocation.Employee?.ToBasicEmployeeVMFromEmployee(),
|
||||||
WorkItem = taskAllocation.WorkItem
|
ReportedBy = taskAllocation.ReportedBy?.ToBasicEmployeeVMFromEmployee(),
|
||||||
|
ApprovedBy = taskAllocation.ApprovedBy?.ToBasicEmployeeVMFromEmployee(),
|
||||||
|
WorkItem = taskAllocation.WorkItem,
|
||||||
|
WorkStatus = taskAllocation.WorkStatus
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public static AssignedTaskVM ToAssignTaskVMFromTaskAllocation(this TaskAllocation taskAllocation)
|
public static AssignedTaskVM ToAssignTaskVMFromTaskAllocation(this TaskAllocation taskAllocation)
|
||||||
@ -100,12 +106,18 @@ namespace Marco.Pms.Model.Mapper
|
|||||||
return new ListTaskVM
|
return new ListTaskVM
|
||||||
{
|
{
|
||||||
Id = taskAllocation.Id,
|
Id = taskAllocation.Id,
|
||||||
|
ParentTaskId = taskAllocation.ParentTaskId,
|
||||||
AssignmentDate = taskAllocation.AssignmentDate,
|
AssignmentDate = taskAllocation.AssignmentDate,
|
||||||
|
ApprovedDate = taskAllocation.ApprovedDate,
|
||||||
Description = taskAllocation.Description,
|
Description = taskAllocation.Description,
|
||||||
PlannedTask = taskAllocation.PlannedTask,
|
PlannedTask = taskAllocation.PlannedTask,
|
||||||
ReportedDate = taskAllocation.ReportedDate,
|
ReportedDate = taskAllocation.ReportedDate,
|
||||||
|
WorkStatus = taskAllocation.WorkStatus,
|
||||||
CompletedTask = taskAllocation.CompletedTask,
|
CompletedTask = taskAllocation.CompletedTask,
|
||||||
AssignedBy = taskAllocation.Employee != null ? taskAllocation.Employee.ToBasicEmployeeVMFromEmployee() : new BasicEmployeeVM(),
|
NotApprovedTask = taskAllocation.ApprovedById == null ? taskAllocation.CompletedTask : (taskAllocation.ReportedTask - taskAllocation.CompletedTask),
|
||||||
|
AssignedBy = taskAllocation.Employee?.ToBasicEmployeeVMFromEmployee(),
|
||||||
|
ReportedBy = taskAllocation.ReportedBy?.ToBasicEmployeeVMFromEmployee(),
|
||||||
|
ApprovedBy = taskAllocation.ApprovedBy?.ToBasicEmployeeVMFromEmployee(),
|
||||||
WorkItemId = taskAllocation.WorkItemId,
|
WorkItemId = taskAllocation.WorkItemId,
|
||||||
WorkItem = taskAllocation.WorkItem
|
WorkItem = taskAllocation.WorkItem
|
||||||
};
|
};
|
||||||
|
@ -1,15 +1,22 @@
|
|||||||
using Marco.Pms.Model.Projects;
|
using Marco.Pms.Model.Master;
|
||||||
|
using Marco.Pms.Model.Projects;
|
||||||
|
|
||||||
namespace Marco.Pms.Model.ViewModels.Activities
|
namespace Marco.Pms.Model.ViewModels.Activities
|
||||||
{
|
{
|
||||||
public class ListTaskVM
|
public class ListTaskVM
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
public Guid? ParentTaskId { get; set; }
|
||||||
public DateTime AssignmentDate { get; set; }
|
public DateTime AssignmentDate { get; set; }
|
||||||
public DateTime? ReportedDate { get; set; }
|
public DateTime? ReportedDate { get; set; }
|
||||||
|
public DateTime? ApprovedDate { get; set; }
|
||||||
public double PlannedTask { get; set; }
|
public double PlannedTask { get; set; }
|
||||||
public double CompletedTask { get; set; }
|
public double CompletedTask { get; set; }
|
||||||
|
public double NotApprovedTask { get; set; }
|
||||||
public BasicEmployeeVM? AssignedBy { get; set; }
|
public BasicEmployeeVM? AssignedBy { get; set; }
|
||||||
|
public BasicEmployeeVM? ReportedBy { get; set; }
|
||||||
|
public BasicEmployeeVM? ApprovedBy { get; set; }
|
||||||
|
public WorkStatusMaster? WorkStatus { get; set; }
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
public Guid WorkItemId { get; set; }
|
public Guid WorkItemId { get; set; }
|
||||||
public List<string>? ReportedPreSignedUrls { get; set; }
|
public List<string>? ReportedPreSignedUrls { get; set; }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
using Marco.Pms.Model.Projects;
|
using Marco.Pms.Model.Master;
|
||||||
using Marco.Pms.Model.ViewModels.Employee;
|
using Marco.Pms.Model.Projects;
|
||||||
|
|
||||||
namespace Marco.Pms.Model.ViewModels.Activities
|
namespace Marco.Pms.Model.ViewModels.Activities
|
||||||
{
|
{
|
||||||
@ -7,14 +7,19 @@ namespace Marco.Pms.Model.ViewModels.Activities
|
|||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public DateTime AssignmentDate { get; set; }
|
public DateTime AssignmentDate { get; set; }
|
||||||
|
public DateTime? ReportedDate { get; set; }
|
||||||
|
public DateTime? ApprovedDate { get; set; }
|
||||||
public double PlannedTask { get; set; }
|
public double PlannedTask { get; set; }
|
||||||
public double CompletedTask { get; set; }
|
public double CompletedTask { get; set; }
|
||||||
public DateTime? ReportedDate { get; set; }
|
public double NotApprovedTask { get; set; }
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
public string? AssignBy { get; set; }
|
public BasicEmployeeVM? AssignedBy { get; set; }
|
||||||
|
public BasicEmployeeVM? ReportedBy { get; set; }
|
||||||
|
public BasicEmployeeVM? ApprovedBy { get; set; }
|
||||||
|
public WorkStatusMaster? WorkStatus { get; set; }
|
||||||
public WorkItem? WorkItem { get; set; }
|
public WorkItem? WorkItem { get; set; }
|
||||||
public List<string>? PreSignedUrls { get; set; }
|
public List<string>? PreSignedUrls { get; set; }
|
||||||
public List<CommentVM>? Comments { get; set; }
|
public List<CommentVM>? Comments { get; set; }
|
||||||
public List<EmployeeVM>? TeamMembers { get; set; }
|
public List<BasicEmployeeVM>? TeamMembers { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user