[CLAUDE] Domain+Infra: Migration 18 PE workflow inner steps + User.PositionLevel (Chunk A)
Some checks failed
Deploy SOLUTION_ERP / build-deploy (push) Has been cancelled
Some checks failed
Deploy SOLUTION_ERP / build-deploy (push) Has been cancelled
N-stage workflow approval — mỗi WorkflowStep cha (= 1 phase) cấu hình
được chuỗi InnerSteps con theo Department × PositionLevel với Order
sequential. Phase 9+ feature, mở rộng từ 2-stage Mig 16.
Schema:
- enum PositionLevel { NhanVien=1, PhoPhong=2, TruongPhong=3 } (Domain/Identity)
- ALTER Users + PositionLevel int? NULL (admin/system user vẫn null)
- CREATE TABLE PurchaseEvaluationWorkflowStepInnerSteps:
Id PK, PurchaseEvaluationWorkflowStepId FK Cascade,
Order int, DepartmentId FK Restrict, PositionLevel int,
Name nvarchar(200), SlaDays int?, IsRequired bit
- ALTER PurchaseEvaluationDepartmentApprovals + InnerStepId Guid? FK Restrict
(null cho data legacy 2-stage Review/Confirm Mig 16)
Backward compat: step KHÔNG có InnerSteps → service fallback logic
2-stage Stage=Review|Confirm cũ (Chunk C). Data Mig 16 hiện có giữ
nguyên, InnerStepId=null.
Verify:
- dotnet build SolutionErp.slnx pass (0 error, 2 pre-existing warning DocxRenderer)
- dotnet ef database update LocalDB applied OK
- dotnet test SolutionErp.slnx 83 pass (54 Domain + 29 Infra) — no regression
- 3-file rule: Migration.cs + Designer.cs + Snapshot updated
Pending Chunk B: Application CQRS — extend CreatePeWorkflowDefinitionCommand
với InnerSteps DTO + UpdateUserPositionLevelCommand.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
16
src/Backend/SolutionErp.Domain/Identity/PositionLevel.cs
Normal file
16
src/Backend/SolutionErp.Domain/Identity/PositionLevel.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
namespace SolutionErp.Domain.Identity;
|
||||||
|
|
||||||
|
// Cấp chức danh trong phòng ban — phục vụ N-stage workflow inner step (Mig 18).
|
||||||
|
// Mỗi WorkflowStep cha (= 1 phase) có thể cấu hình 1 chuỗi inner step
|
||||||
|
// con (Order asc) khớp Department × PositionLevel. Ai đúng phòng + đúng cấp
|
||||||
|
// (+ Order tiếp theo chưa duyệt) thì duyệt được.
|
||||||
|
//
|
||||||
|
// Default null cho admin/system/external user không thuộc cấp cụ thể.
|
||||||
|
// CanBypassReview=true ở User cho phép cấp cao hơn (TP) skip cấp dưới
|
||||||
|
// (NV+PP) cùng Department khi duyệt 1 inner step block.
|
||||||
|
public enum PositionLevel
|
||||||
|
{
|
||||||
|
NhanVien = 1, // NV
|
||||||
|
PhoPhong = 2, // PP
|
||||||
|
TruongPhong = 3, // TP
|
||||||
|
}
|
||||||
@ -18,6 +18,13 @@ public class User : IdentityUser<Guid>
|
|||||||
|
|
||||||
// 2-stage department approval (Phase 9 — Migration 16): khi true, NV
|
// 2-stage department approval (Phase 9 — Migration 16): khi true, NV
|
||||||
// được quyền duyệt thay TPB (skip Stage Review, đẩy thẳng Stage Confirm).
|
// được quyền duyệt thay TPB (skip Stage Review, đẩy thẳng Stage Confirm).
|
||||||
|
// Cũng dùng cho N-stage inner step (Mig 18) — TP có CanBypassReview
|
||||||
|
// skip NV+PP cùng Department.
|
||||||
// Mặc định false (an toàn). Admin set ở UserManager UI.
|
// Mặc định false (an toàn). Admin set ở UserManager UI.
|
||||||
public bool CanBypassReview { get; set; }
|
public bool CanBypassReview { get; set; }
|
||||||
|
|
||||||
|
// Cấp chức danh trong phòng — phục vụ N-stage workflow inner step (Mig 18).
|
||||||
|
// Mỗi inner step yêu cầu user khớp DepartmentId + PositionLevel mới duyệt
|
||||||
|
// được sub-step đó. Null cho admin/system/external user.
|
||||||
|
public PositionLevel? PositionLevel { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,12 +15,18 @@ public class PurchaseEvaluationDepartmentApproval : AuditableEntity
|
|||||||
public Guid PurchaseEvaluationId { get; set; }
|
public Guid PurchaseEvaluationId { get; set; }
|
||||||
public int PhaseAtApproval { get; set; } // snapshot PurchaseEvaluationPhase int
|
public int PhaseAtApproval { get; set; } // snapshot PurchaseEvaluationPhase int
|
||||||
public Guid DepartmentId { get; set; }
|
public Guid DepartmentId { get; set; }
|
||||||
public ApprovalStage Stage { get; set; } // 1=Review (NV), 2=Confirm (TPB)
|
public ApprovalStage Stage { get; set; } // 1=Review (NV), 2=Confirm (TPB) — legacy 2-stage Mig 16
|
||||||
public Guid ApproverUserId { get; set; }
|
public Guid ApproverUserId { get; set; }
|
||||||
public string? ApproverRoleSnapshot { get; set; }
|
public string? ApproverRoleSnapshot { get; set; }
|
||||||
public string? Comment { get; set; }
|
public string? Comment { get; set; }
|
||||||
public DateTime ApprovedAt { get; set; }
|
public DateTime ApprovedAt { get; set; }
|
||||||
public bool IsBypassed { get; set; }
|
public bool IsBypassed { get; set; }
|
||||||
|
|
||||||
|
// N-stage inner step link (Mig 18) — null cho data legacy 2-stage Review/Confirm.
|
||||||
|
// Có giá trị khi step cha có InnerSteps configured → mỗi sub-step approve =
|
||||||
|
// 1 row riêng với InnerStepId set. Cùng Stage=Confirm (legacy field giữ nguyên
|
||||||
|
// cho backward compat — N-stage không dùng Review/Confirm semantics).
|
||||||
|
public Guid? InnerStepId { get; set; }
|
||||||
|
|
||||||
public PurchaseEvaluation? PurchaseEvaluation { get; set; }
|
public PurchaseEvaluation? PurchaseEvaluation { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using SolutionErp.Domain.Common;
|
using SolutionErp.Domain.Common;
|
||||||
using SolutionErp.Domain.Contracts; // reuse WorkflowApproverKind
|
using SolutionErp.Domain.Contracts; // reuse WorkflowApproverKind
|
||||||
|
using SolutionErp.Domain.Identity; // reuse PositionLevel
|
||||||
|
|
||||||
namespace SolutionErp.Domain.PurchaseEvaluations;
|
namespace SolutionErp.Domain.PurchaseEvaluations;
|
||||||
|
|
||||||
@ -34,6 +35,12 @@ public class PurchaseEvaluationWorkflowStep : BaseEntity
|
|||||||
|
|
||||||
public PurchaseEvaluationWorkflowDefinition? Definition { get; set; }
|
public PurchaseEvaluationWorkflowDefinition? Definition { get; set; }
|
||||||
public List<PurchaseEvaluationWorkflowStepApprover> Approvers { get; set; } = new();
|
public List<PurchaseEvaluationWorkflowStepApprover> Approvers { get; set; } = new();
|
||||||
|
|
||||||
|
// Inner steps (Mig 18) — N-stage approval cấu hình động trong cùng 1 phase.
|
||||||
|
// Empty list → fallback logic 2-stage Review/Confirm legacy (Mig 16) per dept.
|
||||||
|
// Có item → service loop theo Order: user khớp Department × PositionLevel
|
||||||
|
// duyệt sub-step. Tất cả required InnerSteps Done → cho phase transition.
|
||||||
|
public List<PurchaseEvaluationWorkflowStepInnerStep> InnerSteps { get; set; } = new();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PurchaseEvaluationWorkflowStepApprover : BaseEntity
|
public class PurchaseEvaluationWorkflowStepApprover : BaseEntity
|
||||||
@ -44,3 +51,24 @@ public class PurchaseEvaluationWorkflowStepApprover : BaseEntity
|
|||||||
|
|
||||||
public PurchaseEvaluationWorkflowStep? Step { get; set; }
|
public PurchaseEvaluationWorkflowStep? Step { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Inner step (Mig 18 — Phase 9+) — sub-step level con cấu hình bên trong 1
|
||||||
|
// WorkflowStep cha (= 1 phase). Cho phép admin định nghĩa thứ tự duyệt N-stage
|
||||||
|
// theo Department × PositionLevel: NV.A → PP.A → TP.A → NV.B → PP.B → TP.B → ...
|
||||||
|
//
|
||||||
|
// User khớp DepartmentId + PositionLevel + Order tiếp theo chưa duyệt = approver
|
||||||
|
// hợp lệ. CanBypassReview ở User cho TP skip NV+PP cùng dept (audit IsBypassed).
|
||||||
|
//
|
||||||
|
// IsRequired=false → cho phép skip không cần row approval (vd "PP optional").
|
||||||
|
public class PurchaseEvaluationWorkflowStepInnerStep : BaseEntity
|
||||||
|
{
|
||||||
|
public Guid PurchaseEvaluationWorkflowStepId { get; set; }
|
||||||
|
public int Order { get; set; } // thứ tự sequential trong cùng step cha
|
||||||
|
public Guid DepartmentId { get; set; }
|
||||||
|
public PositionLevel PositionLevel { get; set; } // NV / PP / TP
|
||||||
|
public string? Name { get; set; } // hiển thị FE — vd "NV.PRO duyệt"
|
||||||
|
public int? SlaDays { get; set; } // override step.SlaDays nếu set
|
||||||
|
public bool IsRequired { get; set; } = true; // false → optional skip không cần row
|
||||||
|
|
||||||
|
public PurchaseEvaluationWorkflowStep? Step { get; set; }
|
||||||
|
}
|
||||||
|
|||||||
@ -59,6 +59,7 @@ public class ApplicationDbContext
|
|||||||
public DbSet<PurchaseEvaluationWorkflowDefinition> PurchaseEvaluationWorkflowDefinitions => Set<PurchaseEvaluationWorkflowDefinition>();
|
public DbSet<PurchaseEvaluationWorkflowDefinition> PurchaseEvaluationWorkflowDefinitions => Set<PurchaseEvaluationWorkflowDefinition>();
|
||||||
public DbSet<PurchaseEvaluationWorkflowStep> PurchaseEvaluationWorkflowSteps => Set<PurchaseEvaluationWorkflowStep>();
|
public DbSet<PurchaseEvaluationWorkflowStep> PurchaseEvaluationWorkflowSteps => Set<PurchaseEvaluationWorkflowStep>();
|
||||||
public DbSet<PurchaseEvaluationWorkflowStepApprover> PurchaseEvaluationWorkflowStepApprovers => Set<PurchaseEvaluationWorkflowStepApprover>();
|
public DbSet<PurchaseEvaluationWorkflowStepApprover> PurchaseEvaluationWorkflowStepApprovers => Set<PurchaseEvaluationWorkflowStepApprover>();
|
||||||
|
public DbSet<PurchaseEvaluationWorkflowStepInnerStep> PurchaseEvaluationWorkflowStepInnerSteps => Set<PurchaseEvaluationWorkflowStepInnerStep>();
|
||||||
public DbSet<PurchaseEvaluationCodeSequence> PurchaseEvaluationCodeSequences => Set<PurchaseEvaluationCodeSequence>();
|
public DbSet<PurchaseEvaluationCodeSequence> PurchaseEvaluationCodeSequences => Set<PurchaseEvaluationCodeSequence>();
|
||||||
public DbSet<PurchaseEvaluationDepartmentOpinion> PurchaseEvaluationDepartmentOpinions => Set<PurchaseEvaluationDepartmentOpinion>();
|
public DbSet<PurchaseEvaluationDepartmentOpinion> PurchaseEvaluationDepartmentOpinions => Set<PurchaseEvaluationDepartmentOpinion>();
|
||||||
public DbSet<PurchaseEvaluationDepartmentApproval> PurchaseEvaluationDepartmentApprovals => Set<PurchaseEvaluationDepartmentApproval>();
|
public DbSet<PurchaseEvaluationDepartmentApproval> PurchaseEvaluationDepartmentApprovals => Set<PurchaseEvaluationDepartmentApproval>();
|
||||||
|
|||||||
@ -59,11 +59,19 @@ public class PurchaseEvaluationDepartmentApprovalConfiguration
|
|||||||
b.HasIndex(x => x.PurchaseEvaluationId);
|
b.HasIndex(x => x.PurchaseEvaluationId);
|
||||||
b.HasIndex(x => x.DepartmentId);
|
b.HasIndex(x => x.DepartmentId);
|
||||||
b.HasIndex(x => x.ApproverUserId);
|
b.HasIndex(x => x.ApproverUserId);
|
||||||
|
b.HasIndex(x => x.InnerStepId); // Mig 18 — query rows by sub-step
|
||||||
|
|
||||||
b.HasOne(x => x.PurchaseEvaluation)
|
b.HasOne(x => x.PurchaseEvaluation)
|
||||||
.WithMany(c => c.DepartmentApprovals)
|
.WithMany(c => c.DepartmentApprovals)
|
||||||
.HasForeignKey(x => x.PurchaseEvaluationId)
|
.HasForeignKey(x => x.PurchaseEvaluationId)
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
|
// FK InnerStepId nullable — Restrict (không xóa InnerStep nếu còn approval row).
|
||||||
|
// Cấu hình không nav để giữ nhẹ entity (1 chiều, query qua join nếu cần).
|
||||||
|
b.HasOne<PurchaseEvaluationWorkflowStepInnerStep>()
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey(x => x.InnerStepId)
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -209,6 +209,37 @@ public class PurchaseEvaluationWorkflowStepApproverConfiguration : IEntityTypeCo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Inner step (Mig 18) — N-stage approval cấu hình động trong cùng 1 phase.
|
||||||
|
// FK Cascade từ Step cha. Index theo (StepId, Order) cho query ordered list.
|
||||||
|
// Index riêng DepartmentId để lookup khi service compute next pending sub-step.
|
||||||
|
public class PurchaseEvaluationWorkflowStepInnerStepConfiguration
|
||||||
|
: IEntityTypeConfiguration<PurchaseEvaluationWorkflowStepInnerStep>
|
||||||
|
{
|
||||||
|
public void Configure(EntityTypeBuilder<PurchaseEvaluationWorkflowStepInnerStep> e)
|
||||||
|
{
|
||||||
|
e.ToTable("PurchaseEvaluationWorkflowStepInnerSteps");
|
||||||
|
e.HasKey(x => x.Id);
|
||||||
|
|
||||||
|
e.Property(x => x.PositionLevel).HasConversion<int>();
|
||||||
|
e.Property(x => x.Name).HasMaxLength(200);
|
||||||
|
|
||||||
|
e.HasOne(x => x.Step)
|
||||||
|
.WithMany(s => s.InnerSteps)
|
||||||
|
.HasForeignKey(x => x.PurchaseEvaluationWorkflowStepId)
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
|
// FK Department — Restrict (không xóa dept nếu còn inner step assigned).
|
||||||
|
// Không cấu hình nav trên Department để tránh circular collection bloat.
|
||||||
|
e.HasOne<SolutionErp.Domain.Master.Department>()
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey(x => x.DepartmentId)
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
|
e.HasIndex(x => new { x.PurchaseEvaluationWorkflowStepId, x.Order });
|
||||||
|
e.HasIndex(x => x.DepartmentId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Mirror ContractCodeSequenceConfiguration — Prefix là PK, atomic UPDATE qua
|
// Mirror ContractCodeSequenceConfiguration — Prefix là PK, atomic UPDATE qua
|
||||||
// SERIALIZABLE transaction trong PurchaseEvaluationCodeGenerator.
|
// SERIALIZABLE transaction trong PurchaseEvaluationCodeGenerator.
|
||||||
public class PurchaseEvaluationCodeSequenceConfiguration
|
public class PurchaseEvaluationCodeSequenceConfiguration
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,107 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace SolutionErp.Infrastructure.Persistence.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddPeWorkflowInnerStepsAndPositionLevel : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "PositionLevel",
|
||||||
|
table: "Users",
|
||||||
|
type: "int",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "InnerStepId",
|
||||||
|
table: "PurchaseEvaluationDepartmentApprovals",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "PurchaseEvaluationWorkflowStepInnerSteps",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
PurchaseEvaluationWorkflowStepId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
Order = table.Column<int>(type: "int", nullable: false),
|
||||||
|
DepartmentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
PositionLevel = table.Column<int>(type: "int", nullable: false),
|
||||||
|
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||||
|
SlaDays = table.Column<int>(type: "int", nullable: true),
|
||||||
|
IsRequired = table.Column<bool>(type: "bit", nullable: false),
|
||||||
|
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
|
CreatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
|
UpdatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_PurchaseEvaluationWorkflowStepInnerSteps", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_PurchaseEvaluationWorkflowStepInnerSteps_Departments_DepartmentId",
|
||||||
|
column: x => x.DepartmentId,
|
||||||
|
principalTable: "Departments",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_PurchaseEvaluationWorkflowStepInnerSteps_PurchaseEvaluationWorkflowSteps_PurchaseEvaluationWorkflowStepId",
|
||||||
|
column: x => x.PurchaseEvaluationWorkflowStepId,
|
||||||
|
principalTable: "PurchaseEvaluationWorkflowSteps",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_PurchaseEvaluationDepartmentApprovals_InnerStepId",
|
||||||
|
table: "PurchaseEvaluationDepartmentApprovals",
|
||||||
|
column: "InnerStepId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_PurchaseEvaluationWorkflowStepInnerSteps_DepartmentId",
|
||||||
|
table: "PurchaseEvaluationWorkflowStepInnerSteps",
|
||||||
|
column: "DepartmentId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_PurchaseEvaluationWorkflowStepInnerSteps_PurchaseEvaluationWorkflowStepId_Order",
|
||||||
|
table: "PurchaseEvaluationWorkflowStepInnerSteps",
|
||||||
|
columns: new[] { "PurchaseEvaluationWorkflowStepId", "Order" });
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_PurchaseEvaluationDepartmentApprovals_PurchaseEvaluationWorkflowStepInnerSteps_InnerStepId",
|
||||||
|
table: "PurchaseEvaluationDepartmentApprovals",
|
||||||
|
column: "InnerStepId",
|
||||||
|
principalTable: "PurchaseEvaluationWorkflowStepInnerSteps",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_PurchaseEvaluationDepartmentApprovals_PurchaseEvaluationWorkflowStepInnerSteps_InnerStepId",
|
||||||
|
table: "PurchaseEvaluationDepartmentApprovals");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "PurchaseEvaluationWorkflowStepInnerSteps");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_PurchaseEvaluationDepartmentApprovals_InnerStepId",
|
||||||
|
table: "PurchaseEvaluationDepartmentApprovals");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "PositionLevel",
|
||||||
|
table: "Users");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "InnerStepId",
|
||||||
|
table: "PurchaseEvaluationDepartmentApprovals");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1809,6 +1809,9 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
|
|||||||
.HasMaxLength(200)
|
.HasMaxLength(200)
|
||||||
.HasColumnType("nvarchar(200)");
|
.HasColumnType("nvarchar(200)");
|
||||||
|
|
||||||
|
b.Property<int?>("PositionLevel")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<string>("RefreshToken")
|
b.Property<string>("RefreshToken")
|
||||||
.HasMaxLength(512)
|
.HasMaxLength(512)
|
||||||
.HasColumnType("nvarchar(512)");
|
.HasColumnType("nvarchar(512)");
|
||||||
@ -2656,6 +2659,9 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
|
|||||||
b.Property<Guid>("DepartmentId")
|
b.Property<Guid>("DepartmentId")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<Guid?>("InnerStepId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<bool>("IsBypassed")
|
b.Property<bool>("IsBypassed")
|
||||||
.HasColumnType("bit");
|
.HasColumnType("bit");
|
||||||
|
|
||||||
@ -2683,6 +2689,8 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
|
|||||||
|
|
||||||
b.HasIndex("DepartmentId");
|
b.HasIndex("DepartmentId");
|
||||||
|
|
||||||
|
b.HasIndex("InnerStepId");
|
||||||
|
|
||||||
b.HasIndex("PurchaseEvaluationId");
|
b.HasIndex("PurchaseEvaluationId");
|
||||||
|
|
||||||
b.HasIndex("PurchaseEvaluationId", "PhaseAtApproval", "DepartmentId", "Stage")
|
b.HasIndex("PurchaseEvaluationId", "PhaseAtApproval", "DepartmentId", "Stage")
|
||||||
@ -3072,6 +3080,55 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
|
|||||||
b.ToTable("PurchaseEvaluationWorkflowStepApprovers", (string)null);
|
b.ToTable("PurchaseEvaluationWorkflowStepApprovers", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SolutionErp.Domain.PurchaseEvaluations.PurchaseEvaluationWorkflowStepInnerStep", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid?>("CreatedBy")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<Guid>("DepartmentId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRequired")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasColumnType("nvarchar(200)");
|
||||||
|
|
||||||
|
b.Property<int>("Order")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("PositionLevel")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<Guid>("PurchaseEvaluationWorkflowStepId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<int?>("SlaDays")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("UpdatedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid?>("UpdatedBy")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DepartmentId");
|
||||||
|
|
||||||
|
b.HasIndex("PurchaseEvaluationWorkflowStepId", "Order");
|
||||||
|
|
||||||
|
b.ToTable("PurchaseEvaluationWorkflowStepInnerSteps", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("SolutionErp.Domain.Identity.Role", null)
|
b.HasOne("SolutionErp.Domain.Identity.Role", null)
|
||||||
@ -3393,6 +3450,11 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("SolutionErp.Domain.PurchaseEvaluations.PurchaseEvaluationDepartmentApproval", b =>
|
modelBuilder.Entity("SolutionErp.Domain.PurchaseEvaluations.PurchaseEvaluationDepartmentApproval", b =>
|
||||||
{
|
{
|
||||||
|
b.HasOne("SolutionErp.Domain.PurchaseEvaluations.PurchaseEvaluationWorkflowStepInnerStep", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("InnerStepId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
b.HasOne("SolutionErp.Domain.PurchaseEvaluations.PurchaseEvaluation", "PurchaseEvaluation")
|
b.HasOne("SolutionErp.Domain.PurchaseEvaluations.PurchaseEvaluation", "PurchaseEvaluation")
|
||||||
.WithMany("DepartmentApprovals")
|
.WithMany("DepartmentApprovals")
|
||||||
.HasForeignKey("PurchaseEvaluationId")
|
.HasForeignKey("PurchaseEvaluationId")
|
||||||
@ -3480,6 +3542,23 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
|
|||||||
b.Navigation("Step");
|
b.Navigation("Step");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SolutionErp.Domain.PurchaseEvaluations.PurchaseEvaluationWorkflowStepInnerStep", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("SolutionErp.Domain.Master.Department", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("DepartmentId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("SolutionErp.Domain.PurchaseEvaluations.PurchaseEvaluationWorkflowStep", "Step")
|
||||||
|
.WithMany("InnerSteps")
|
||||||
|
.HasForeignKey("PurchaseEvaluationWorkflowStepId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Step");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("SolutionErp.Domain.Budgets.Budget", b =>
|
modelBuilder.Entity("SolutionErp.Domain.Budgets.Budget", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Approvals");
|
b.Navigation("Approvals");
|
||||||
@ -3567,6 +3646,8 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
|
|||||||
modelBuilder.Entity("SolutionErp.Domain.PurchaseEvaluations.PurchaseEvaluationWorkflowStep", b =>
|
modelBuilder.Entity("SolutionErp.Domain.PurchaseEvaluations.PurchaseEvaluationWorkflowStep", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Approvers");
|
b.Navigation("Approvers");
|
||||||
|
|
||||||
|
b.Navigation("InnerSteps");
|
||||||
});
|
});
|
||||||
#pragma warning restore 612, 618
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user