Made StatusId Nullable In StatusUpdateLog Table
This commit is contained in:
parent
f22f6c4ad9
commit
381723d785
7494
Marco.Pms.DataAccess/Migrations/20251108065039_Made_StatusId_Nullable_In_StatusUpdateLog_Table.Designer.cs
generated
Normal file
7494
Marco.Pms.DataAccess/Migrations/20251108065039_Made_StatusId_Nullable_In_StatusUpdateLog_Table.Designer.cs
generated
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Marco.Pms.DataAccess.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Made_StatusId_Nullable_In_StatusUpdateLog_Table : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "StatusId",
|
||||
table: "StatusUpdateLogs",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)")
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "StatusId",
|
||||
table: "StatusUpdateLogs",
|
||||
type: "char(36)",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)",
|
||||
oldNullable: true)
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4003,7 +4003,7 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
b.Property<Guid>("NextStatusId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid>("StatusId")
|
||||
b.Property<Guid?>("StatusId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid>("TenantId")
|
||||
|
||||
@ -8,7 +8,7 @@ namespace Marco.Pms.Model.Master
|
||||
public class StatusUpdateLog : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid StatusId { get; set; }
|
||||
public Guid? StatusId { get; set; }
|
||||
public Guid NextStatusId { get; set; }
|
||||
public Guid EntityId { get; set; }
|
||||
public string? Comment { get; set; }
|
||||
|
||||
@ -1559,7 +1559,7 @@ namespace Marco.Pms.Services.Service
|
||||
var attachmentVMs = documentTask.Result;
|
||||
var updateLogs = updateLogsTask.Result;
|
||||
|
||||
var statusIds = updateLogs.Select(sul => sul.StatusId).ToList();
|
||||
var statusIds = updateLogs.Where(sul => sul.StatusId.HasValue).Select(sul => sul.StatusId!.Value).ToList();
|
||||
statusIds.AddRange(updateLogs.Select(sul => sul.NextStatusId).ToList());
|
||||
|
||||
statusIds = statusIds.Distinct().ToList();
|
||||
@ -1748,7 +1748,7 @@ namespace Marco.Pms.Services.Service
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
EntityId = paymentRequest.Id,
|
||||
StatusId = Draft,
|
||||
//StatusId = Draft,
|
||||
NextStatusId = Draft,
|
||||
UpdatedById = loggedInEmployee.Id,
|
||||
UpdatedAt = DateTime.UtcNow,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user