marco.pms.api/Marco.Pms.DataAccess/Migrations/20250721124928_Added_Expense_Related_Tables.cs

665 lines
38 KiB
C#

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_Expense_Related_Tables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ExpensesReimburse",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ReimburseTransactionId = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ReimburseDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ReimburseById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ReimburseNote = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ExpensesReimburse", x => x.Id);
table.ForeignKey(
name: "FK_ExpensesReimburse_Employees_ReimburseById",
column: x => x.ReimburseById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ExpensesReimburse_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ExpensesStatusMaster",
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"),
DisplayName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Color = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsSystem = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsActive = 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_ExpensesStatusMaster", x => x.Id);
table.ForeignKey(
name: "FK_ExpensesStatusMaster_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ExpensesTypeMaster",
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"),
NoOfPersonsRequired = table.Column<bool>(type: "tinyint(1)", nullable: false),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = 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_ExpensesTypeMaster", x => x.Id);
table.ForeignKey(
name: "FK_ExpensesTypeMaster_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "PaymentModeMatser",
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"),
IsActive = 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_PaymentModeMatser", x => x.Id);
table.ForeignKey(
name: "FK_PaymentModeMatser_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
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"),
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_NextStatusId",
column: x => x.NextStatusId,
principalTable: "ExpensesStatusMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ExpensesStatusMapping_ExpensesStatusMaster_StatusId",
column: x => x.StatusId,
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.CreateTable(
name: "StatusPermissionMapping",
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"),
PermissionId = 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_StatusPermissionMapping", x => x.Id);
table.ForeignKey(
name: "FK_StatusPermissionMapping_ExpensesStatusMaster_StatusId",
column: x => x.StatusId,
principalTable: "ExpensesStatusMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_StatusPermissionMapping_FeaturePermissions_PermissionId",
column: x => x.PermissionId,
principalTable: "FeaturePermissions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_StatusPermissionMapping_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Expenses",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ProjectId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ExpensesTypeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PaymentModeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PaidById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TransactionDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
TransactionId = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Location = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
GSTNumber = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SupplerName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Amount = table.Column<double>(type: "double", nullable: false),
NoOfPersons = table.Column<int>(type: "int", nullable: true),
StatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PreApproved = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsActive = 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_Expenses", x => x.Id);
table.ForeignKey(
name: "FK_Expenses_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Expenses_Employees_PaidById",
column: x => x.PaidById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Expenses_ExpensesStatusMaster_StatusId",
column: x => x.StatusId,
principalTable: "ExpensesStatusMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Expenses_ExpensesTypeMaster_ExpensesTypeId",
column: x => x.ExpensesTypeId,
principalTable: "ExpensesTypeMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Expenses_PaymentModeMatser_PaymentModeId",
column: x => x.PaymentModeId,
principalTable: "PaymentModeMatser",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Expenses_Projects_ProjectId",
column: x => x.ProjectId,
principalTable: "Projects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Expenses_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "BillAttachments",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ExpensesId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DocumentId = 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_BillAttachments", x => x.Id);
table.ForeignKey(
name: "FK_BillAttachments_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_BillAttachments_Expenses_ExpensesId",
column: x => x.ExpensesId,
principalTable: "Expenses",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_BillAttachments_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ExpenseLogs",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ExpenseId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Action = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Comment = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ExpenseLogs", x => x.Id);
table.ForeignKey(
name: "FK_ExpenseLogs_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ExpenseLogs_Expenses_ExpenseId",
column: x => x.ExpenseId,
principalTable: "Expenses",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ExpenseLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ExpensesReimburseMapping",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ExpensesId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ExpensesReimburseId = 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_ExpensesReimburseMapping", x => x.Id);
table.ForeignKey(
name: "FK_ExpensesReimburseMapping_ExpensesReimburse_ExpensesReimburse~",
column: x => x.ExpensesReimburseId,
principalTable: "ExpensesReimburse",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ExpensesReimburseMapping_Expenses_ExpensesId",
column: x => x.ExpensesId,
principalTable: "Expenses",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ExpensesReimburseMapping_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "ExpensesStatusMaster",
columns: new[] { "Id", "Color", "Description", "DisplayName", "IsActive", "IsSystem", "Name", "TenantId" },
values: new object[,]
{
{ new Guid("297e0d8f-f668-41b5-bfea-e03b354251c8"), "#8592a3", "Expense has been created but not yet submitted.", "Draft", true, true, "Draft", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), "#03c3ec", "Review is completed, waiting for action of approver.", "Reviewed", true, true, "Approval Pending", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("61578360-3a49-4c34-8604-7b35a3787b95"), "#71dd37", "Expense has been settled.", "Paid", true, true, "Paid", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), "#696cff", "Reviewer is currently reviewing the expense.", "Submit", true, true, "Review Pending", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), "#ff3e1d", "Expense was declined, often with a reason(either review rejected or approval rejected.", "Reject", true, true, "Rejected", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), "#ffab00", "Approved expense is awaiting final payment.", "Process", true, true, "Process Pending", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.InsertData(
table: "ExpensesTypeMaster",
columns: new[] { "Id", "Description", "IsActive", "Name", "NoOfPersonsRequired", "TenantId" },
values: new object[,]
{
{ new Guid("1e2d697a-76b4-4be8-bc66-87144561a1a0"), "Scheduled payments for external services or goods.", true, "Vendor/Supplier Payments", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("2de53163-0dbd-404b-8e60-1b02e6b4886a"), "Vehicle fuel, logistics services and delivery of goods or personnel.", true, "Transport", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("4842fa61-64eb-4241-aebd-8282065af9f9"), "Government fees, insurance, inspections and safety-related expenditures.", true, "Compliance & Safety", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("52484820-1b54-4865-8f0f-baa2b1d339b9"), "Site setup costs including equipment deployment and temporary infrastructure.", true, "Mobilization", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("5e0c6227-d49d-41ff-9f1f-781f0aee2469"), "Materials, equipment and supplies purchased for site operations.", true, "Procurement", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("77013784-9324-4d8b-bd36-d6f928e68942"), "Machinery servicing, electricity, water, and temporary office needs.", true, "Maintenance & Utilities", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("dd120bc4-ab0a-45ba-8450-5cd45ff221ca"), "Delivery of personnel.", true, "Travelling", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("fc59eb90-98ea-481c-b421-54bfa9e42d8f"), " Worker amenities like snacks, meals, safety gear, accommodation, medical support etc.", true, "Employee Welfare", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.InsertData(
table: "Features",
columns: new[] { "Id", "Description", "IsActive", "ModuleId", "Name" },
values: new object[] { new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), "Expense Management is the systematic process of tracking, controlling, and reporting business-related expenditures.", true, new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), "Expense Management" });
migrationBuilder.InsertData(
table: "PaymentModeMatser",
columns: new[] { "Id", "Description", "IsActive", "Name", "TenantId" },
values: new object[,]
{
{ new Guid("24e6b0df-7929-47d2-88a3-4cf14c1f28f9"), "Physical currency; still used for small or informal transactions.", true, "Cash", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("2e919e94-694c-41d9-9489-0a2b4208a027"), "Real-time bank-to-bank transfer using mobile apps; widely used for peer-to-peer and merchant payments.", true, "UPI", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("48d9b462-5d87-4dec-8dec-2bc943943172"), "Paper-based payment order; less common now due to processing delays and fraud risks.", true, "Cheque", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("ed667353-8eea-4fd1-8750-719405932480"), "Online banking portals used to transfer funds directly between accounts", true, "NetBanking", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.InsertData(
table: "ExpensesStatusMapping",
columns: new[] { "Id", "NextStatusId", "StatusId", "TenantId" },
values: new object[,]
{
{ new Guid("1fca1700-1266-477d-bba4-9ac3753aa33c"), 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"), 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"), new Guid("61578360-3a49-4c34-8604-7b35a3787b95"), new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("75bbda6a-6a53-47d1-ad71-5f5f9446a11e"), new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("af1e4492-98ee-4451-8ab7-fd8323f29c32"), 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"), 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"), new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.InsertData(
table: "FeaturePermissions",
columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" },
values: new object[,]
{
{ new Guid("01e06444-9ca7-4df4-b900-8c3fa051b92f"), "Allows a user to view all expense records across the organization or project, regardless of who submitted or paid them", new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), true, "View All" },
{ new Guid("0f57885d-bcb2-4711-ac95-d841ace6d5a7"), "Allows a user to create and submit new expense records, including attaching relevant documents like receipts or invoices.", new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), true, "Upload" },
{ new Guid("1f4bda08-1873-449a-bb66-3e8222bd871b"), "Allows a user to examine submitted expenses for accuracy, completeness, and policy compliance before they are approved or rejected.", new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), true, "Review" },
{ new Guid("385be49f-8fde-440e-bdbc-3dffeb8dd116"), "Allows a user to view only the expense records that they have personally submitted", new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), true, "View Self" },
{ new Guid("bdee29a2-b73b-402d-8dd1-c4b1f81ccbc3"), "Allows a user to configure and control system settings, such as managing expense types, payment modes, permissions, and overall workflow rules.", new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), true, "Manage" },
{ new Guid("ea5a1529-4ee8-4828-80ea-0e23c9d4dd11"), "Allows a user to handle post-approval actions such as recording payments, updating financial records, or marking expenses as reimbursed or settled.", new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), true, "Process" },
{ new Guid("eaafdd76-8aac-45f9-a530-315589c6deca"), "Allows a user to authorize or reject submitted expenses, making them officially accepted or declined within the system.", new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), true, "Approve" }
});
migrationBuilder.InsertData(
table: "StatusPermissionMapping",
columns: new[] { "Id", "PermissionId", "StatusId", "TenantId" },
values: new object[,]
{
{ new Guid("214354e5-daad-4569-ad69-eb5bf4e87fbc"), new Guid("ea5a1529-4ee8-4828-80ea-0e23c9d4dd11"), new Guid("61578360-3a49-4c34-8604-7b35a3787b95"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("4652d73f-fc71-4fe1-9f2f-1e48b342d741"), new Guid("1f4bda08-1873-449a-bb66-3e8222bd871b"), new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("cd15f9b9-be45-4deb-9c71-2f23f872dbcd"), new Guid("eaafdd76-8aac-45f9-a530-315589c6deca"), new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("ed893799-1a5f-4311-a077-de93c86ca8fd"), new Guid("1f4bda08-1873-449a-bb66-3e8222bd871b"), new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("f6f26b2f-2fa6-40b7-8601-cbd4bcdda0cc"), new Guid("eaafdd76-8aac-45f9-a530-315589c6deca"), new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.CreateIndex(
name: "IX_BillAttachments_DocumentId",
table: "BillAttachments",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_BillAttachments_ExpensesId",
table: "BillAttachments",
column: "ExpensesId");
migrationBuilder.CreateIndex(
name: "IX_BillAttachments_TenantId",
table: "BillAttachments",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ExpenseLogs_ExpenseId",
table: "ExpenseLogs",
column: "ExpenseId");
migrationBuilder.CreateIndex(
name: "IX_ExpenseLogs_TenantId",
table: "ExpenseLogs",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ExpenseLogs_UpdatedById",
table: "ExpenseLogs",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_Expenses_CreatedById",
table: "Expenses",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Expenses_ExpensesTypeId",
table: "Expenses",
column: "ExpensesTypeId");
migrationBuilder.CreateIndex(
name: "IX_Expenses_PaidById",
table: "Expenses",
column: "PaidById");
migrationBuilder.CreateIndex(
name: "IX_Expenses_PaymentModeId",
table: "Expenses",
column: "PaymentModeId");
migrationBuilder.CreateIndex(
name: "IX_Expenses_ProjectId",
table: "Expenses",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_Expenses_StatusId",
table: "Expenses",
column: "StatusId");
migrationBuilder.CreateIndex(
name: "IX_Expenses_TenantId",
table: "Expenses",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ExpensesReimburse_ReimburseById",
table: "ExpensesReimburse",
column: "ReimburseById");
migrationBuilder.CreateIndex(
name: "IX_ExpensesReimburse_TenantId",
table: "ExpensesReimburse",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ExpensesReimburseMapping_ExpensesId",
table: "ExpensesReimburseMapping",
column: "ExpensesId");
migrationBuilder.CreateIndex(
name: "IX_ExpensesReimburseMapping_ExpensesReimburseId",
table: "ExpensesReimburseMapping",
column: "ExpensesReimburseId");
migrationBuilder.CreateIndex(
name: "IX_ExpensesReimburseMapping_TenantId",
table: "ExpensesReimburseMapping",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ExpensesStatusMapping_NextStatusId",
table: "ExpensesStatusMapping",
column: "NextStatusId");
migrationBuilder.CreateIndex(
name: "IX_ExpensesStatusMapping_StatusId",
table: "ExpensesStatusMapping",
column: "StatusId");
migrationBuilder.CreateIndex(
name: "IX_ExpensesStatusMapping_TenantId",
table: "ExpensesStatusMapping",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ExpensesStatusMaster_TenantId",
table: "ExpensesStatusMaster",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ExpensesTypeMaster_TenantId",
table: "ExpensesTypeMaster",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_PaymentModeMatser_TenantId",
table: "PaymentModeMatser",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_StatusPermissionMapping_PermissionId",
table: "StatusPermissionMapping",
column: "PermissionId");
migrationBuilder.CreateIndex(
name: "IX_StatusPermissionMapping_StatusId",
table: "StatusPermissionMapping",
column: "StatusId");
migrationBuilder.CreateIndex(
name: "IX_StatusPermissionMapping_TenantId",
table: "StatusPermissionMapping",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "BillAttachments");
migrationBuilder.DropTable(
name: "ExpenseLogs");
migrationBuilder.DropTable(
name: "ExpensesReimburseMapping");
migrationBuilder.DropTable(
name: "ExpensesStatusMapping");
migrationBuilder.DropTable(
name: "StatusPermissionMapping");
migrationBuilder.DropTable(
name: "ExpensesReimburse");
migrationBuilder.DropTable(
name: "Expenses");
migrationBuilder.DropTable(
name: "ExpensesStatusMaster");
migrationBuilder.DropTable(
name: "ExpensesTypeMaster");
migrationBuilder.DropTable(
name: "PaymentModeMatser");
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("01e06444-9ca7-4df4-b900-8c3fa051b92f"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("0f57885d-bcb2-4711-ac95-d841ace6d5a7"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("1f4bda08-1873-449a-bb66-3e8222bd871b"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("385be49f-8fde-440e-bdbc-3dffeb8dd116"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("bdee29a2-b73b-402d-8dd1-c4b1f81ccbc3"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("ea5a1529-4ee8-4828-80ea-0e23c9d4dd11"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("eaafdd76-8aac-45f9-a530-315589c6deca"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"));
}
}
}