Added the status Mapping table in database
This commit is contained in:
parent
448d586b94
commit
741acb194e
@ -99,6 +99,7 @@ namespace Marco.Pms.DataAccess.Data
|
||||
public DbSet<ExpensesReimburse> ExpensesReimburse { get; set; }
|
||||
public DbSet<ExpensesReimburseMapping> ExpensesReimburseMapping { get; set; }
|
||||
public DbSet<StatusPermissionMapping> StatusPermissionMapping { get; set; }
|
||||
public DbSet<ExpensesStatusMapping> ExpensesStatusMapping { get; set; }
|
||||
|
||||
|
||||
|
||||
@ -444,9 +445,9 @@ namespace Marco.Pms.DataAccess.Data
|
||||
}
|
||||
);
|
||||
|
||||
modelBuilder.Entity<StatusMapping>().HasData(
|
||||
modelBuilder.Entity<ExpensesStatusMapping>().HasData(
|
||||
// Process to processed
|
||||
new StatusMapping
|
||||
new ExpensesStatusMapping
|
||||
{
|
||||
Id = Guid.Parse("5cf7f1df-9d1f-4289-add0-1775ad614f25"),
|
||||
StatusId = Guid.Parse("f18c5cfd-7815-4341-8da2-2c2d65778e27"),
|
||||
@ -454,7 +455,7 @@ namespace Marco.Pms.DataAccess.Data
|
||||
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
|
||||
},
|
||||
// Approve to Rejected
|
||||
new StatusMapping
|
||||
new ExpensesStatusMapping
|
||||
{
|
||||
Id = Guid.Parse("36c00548-241c-43ec-bc95-cacebedb925c"),
|
||||
StatusId = Guid.Parse("4068007f-c92f-4f37-a907-bc15fe57d4d8"),
|
||||
@ -462,7 +463,7 @@ namespace Marco.Pms.DataAccess.Data
|
||||
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
|
||||
},
|
||||
// Approve to Process
|
||||
new StatusMapping
|
||||
new ExpensesStatusMapping
|
||||
{
|
||||
Id = Guid.Parse("1fca1700-1266-477d-bba4-9ac3753aa33c"),
|
||||
StatusId = Guid.Parse("4068007f-c92f-4f37-a907-bc15fe57d4d8"),
|
||||
@ -470,7 +471,7 @@ namespace Marco.Pms.DataAccess.Data
|
||||
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
|
||||
},
|
||||
// Review to Rejected
|
||||
new StatusMapping
|
||||
new ExpensesStatusMapping
|
||||
{
|
||||
Id = Guid.Parse("fddaaf20-4ccc-4f4e-a724-dd310272b356"),
|
||||
StatusId = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7"),
|
||||
@ -478,7 +479,7 @@ namespace Marco.Pms.DataAccess.Data
|
||||
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
|
||||
},
|
||||
// Review to Aprrove
|
||||
new StatusMapping
|
||||
new ExpensesStatusMapping
|
||||
{
|
||||
Id = Guid.Parse("ef1fcfbc-60e0-4f17-9308-c583a05d48fd"),
|
||||
StatusId = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7"),
|
||||
@ -486,7 +487,7 @@ namespace Marco.Pms.DataAccess.Data
|
||||
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
|
||||
},
|
||||
// Draft to Review
|
||||
new StatusMapping
|
||||
new ExpensesStatusMapping
|
||||
{
|
||||
Id = Guid.Parse("af1e4492-98ee-4451-8ab7-fd8323f29c32"),
|
||||
StatusId = Guid.Parse("297e0d8f-f668-41b5-bfea-e03b354251c8"),
|
||||
|
4243
Marco.Pms.DataAccess/Migrations/20250719113715_Added_ExpensesStatusMaping_Table.Designer.cs
generated
Normal file
4243
Marco.Pms.DataAccess/Migrations/20250719113715_Added_ExpensesStatusMaping_Table.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,149 @@
|
||||
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_ExpensesStatusMaping_Table : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "StatusMapping");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ExpensesStatusMapping",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
StatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
ExpeStatusIdnsesId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
NextStatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ExpensesStatusMapping", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ExpensesStatusMapping_ExpensesStatusMaster_ExpeStatusIdnsesId",
|
||||
column: x => x.ExpeStatusIdnsesId,
|
||||
principalTable: "ExpensesStatusMaster",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_ExpensesStatusMapping_ExpensesStatusMaster_NextStatusId",
|
||||
column: x => x.NextStatusId,
|
||||
principalTable: "ExpensesStatusMaster",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_ExpensesStatusMapping_Tenants_TenantId",
|
||||
column: x => x.TenantId,
|
||||
principalTable: "Tenants",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "ExpensesStatusMapping",
|
||||
columns: new[] { "Id", "ExpeStatusIdnsesId", "NextStatusId", "StatusId", "TenantId" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("1fca1700-1266-477d-bba4-9ac3753aa33c"), null, new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
||||
{ new Guid("36c00548-241c-43ec-bc95-cacebedb925c"), null, new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
||||
{ new Guid("5cf7f1df-9d1f-4289-add0-1775ad614f25"), null, new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
||||
{ new Guid("af1e4492-98ee-4451-8ab7-fd8323f29c32"), null, new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("297e0d8f-f668-41b5-bfea-e03b354251c8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
||||
{ new Guid("ef1fcfbc-60e0-4f17-9308-c583a05d48fd"), null, new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
||||
{ new Guid("fddaaf20-4ccc-4f4e-a724-dd310272b356"), null, new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ExpensesStatusMapping_ExpeStatusIdnsesId",
|
||||
table: "ExpensesStatusMapping",
|
||||
column: "ExpeStatusIdnsesId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ExpensesStatusMapping_NextStatusId",
|
||||
table: "ExpensesStatusMapping",
|
||||
column: "NextStatusId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ExpensesStatusMapping_TenantId",
|
||||
table: "ExpensesStatusMapping",
|
||||
column: "TenantId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ExpensesStatusMapping");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "StatusMapping",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
ExpeStatusIdnsesId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
NextStatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
StatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_StatusMapping", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_StatusMapping_ExpensesStatusMaster_ExpeStatusIdnsesId",
|
||||
column: x => x.ExpeStatusIdnsesId,
|
||||
principalTable: "ExpensesStatusMaster",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_StatusMapping_ExpensesStatusMaster_NextStatusId",
|
||||
column: x => x.NextStatusId,
|
||||
principalTable: "ExpensesStatusMaster",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_StatusMapping_Tenants_TenantId",
|
||||
column: x => x.TenantId,
|
||||
principalTable: "Tenants",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "StatusMapping",
|
||||
columns: new[] { "Id", "ExpeStatusIdnsesId", "NextStatusId", "StatusId", "TenantId" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("1fca1700-1266-477d-bba4-9ac3753aa33c"), null, new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
||||
{ new Guid("36c00548-241c-43ec-bc95-cacebedb925c"), null, new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
||||
{ new Guid("5cf7f1df-9d1f-4289-add0-1775ad614f25"), null, new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
||||
{ new Guid("af1e4492-98ee-4451-8ab7-fd8323f29c32"), null, new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("297e0d8f-f668-41b5-bfea-e03b354251c8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
||||
{ new Guid("ef1fcfbc-60e0-4f17-9308-c583a05d48fd"), null, new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
||||
{ new Guid("fddaaf20-4ccc-4f4e-a724-dd310272b356"), null, new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_StatusMapping_ExpeStatusIdnsesId",
|
||||
table: "StatusMapping",
|
||||
column: "ExpeStatusIdnsesId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_StatusMapping_NextStatusId",
|
||||
table: "StatusMapping",
|
||||
column: "NextStatusId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_StatusMapping_TenantId",
|
||||
table: "StatusMapping",
|
||||
column: "TenantId");
|
||||
}
|
||||
}
|
||||
}
|
@ -1450,7 +1450,7 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
b.ToTable("ExpensesReimburseMapping");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Marco.Pms.Model.Expenses.StatusMapping", b =>
|
||||
modelBuilder.Entity("Marco.Pms.Model.Expenses.ExpensesStatusMapping", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@ -1476,7 +1476,7 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
|
||||
b.HasIndex("TenantId");
|
||||
|
||||
b.ToTable("StatusMapping");
|
||||
b.ToTable("ExpensesStatusMapping");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
@ -3801,7 +3801,7 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
b.Navigation("ExpensesReimburse");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Marco.Pms.Model.Expenses.StatusMapping", b =>
|
||||
modelBuilder.Entity("Marco.Pms.Model.Expenses.ExpensesStatusMapping", b =>
|
||||
{
|
||||
b.HasOne("Marco.Pms.Model.Master.ExpensesStatusMaster", "Status")
|
||||
.WithMany()
|
||||
|
@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Marco.Pms.Model.Expenses
|
||||
{
|
||||
public class StatusMapping : TenantRelation
|
||||
public class ExpensesStatusMapping : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid StatusId { get; set; }
|
Loading…
x
Reference in New Issue
Block a user