Added the expense related migrations

This commit is contained in:
ashutosh.nehete 2025-11-01 12:05:41 +05:30
parent b4677aacf3
commit 18cd1efafa
8 changed files with 15396 additions and 16 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,438 @@
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_PaymentRequest_RecurringPayment_AdvancePayment_Related_Tables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PaymentModeMatser_Tenants_TenantId",
table: "PaymentModeMatser");
migrationBuilder.DropIndex(
name: "IX_PaymentModeMatser_TenantId",
table: "PaymentModeMatser");
migrationBuilder.DropColumn(
name: "TenantId",
table: "PaymentModeMatser");
migrationBuilder.CreateTable(
name: "AdvancePaymentTransactions",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FinanceUIdPrefix = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
FinanceUIdPostfix = table.Column<int>(type: "int", nullable: false),
EmployeeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Amount = table.Column<double>(type: "double", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
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_AdvancePaymentTransactions", x => x.Id);
table.ForeignKey(
name: "FK_AdvancePaymentTransactions_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AdvancePaymentTransactions_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AdvancePaymentTransactions_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RecurringPayments",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Title = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UIDPrefix = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UIDPostfix = table.Column<int>(type: "int", nullable: false),
Payee = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
NotifyTo = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CurrencyId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Amount = table.Column<double>(type: "double", nullable: false),
StrikeDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LatestPRGeneratedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
PaymentBufferDays = table.Column<int>(type: "int", nullable: false),
NumberOfIteration = table.Column<int>(type: "int", nullable: false),
ExpenseCategoryId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ExpenseStatusId = 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"),
Frequency = table.Column<int>(type: "int", nullable: false),
IsVariable = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedById = 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_RecurringPayments", x => x.Id);
table.ForeignKey(
name: "FK_RecurringPayments_CurrencyMaster_CurrencyId",
column: x => x.CurrencyId,
principalTable: "CurrencyMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RecurringPayments_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RecurringPayments_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RecurringPayments_ExpensesStatusMaster_ExpenseStatusId",
column: x => x.ExpenseStatusId,
principalTable: "ExpensesStatusMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RecurringPayments_ExpensesStatusMaster_StatusId",
column: x => x.StatusId,
principalTable: "ExpensesStatusMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RecurringPayments_ExpensesTypeMaster_ExpenseCategoryId",
column: x => x.ExpenseCategoryId,
principalTable: "ExpensesTypeMaster",
principalColumn: "Id");
table.ForeignKey(
name: "FK_RecurringPayments_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "StatusUpdateLogs",
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"),
EntityId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Comment = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedById = 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_StatusUpdateLogs", x => x.Id);
table.ForeignKey(
name: "FK_StatusUpdateLogs_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_StatusUpdateLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "PaymentRequests",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Title = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UIDPrefix = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UIDPostfix = table.Column<int>(type: "int", nullable: false),
Payee = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CurrencyId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Amount = table.Column<double>(type: "double", nullable: false),
DueDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
RecurringPaymentId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ExpenseCategoryId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ExpenseStatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedById = 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_PaymentRequests", x => x.Id);
table.ForeignKey(
name: "FK_PaymentRequests_CurrencyMaster_CurrencyId",
column: x => x.CurrencyId,
principalTable: "CurrencyMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PaymentRequests_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PaymentRequests_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PaymentRequests_ExpensesStatusMaster_ExpenseStatusId",
column: x => x.ExpenseStatusId,
principalTable: "ExpensesStatusMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PaymentRequests_ExpensesTypeMaster_ExpenseCategoryId",
column: x => x.ExpenseCategoryId,
principalTable: "ExpensesTypeMaster",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PaymentRequests_RecurringPayments_RecurringPaymentId",
column: x => x.RecurringPaymentId,
principalTable: "RecurringPayments",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PaymentRequests_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "PaymentModeMatser",
columns: new[] { "Id", "Description", "IsActive", "Name" },
values: new object[,]
{
{ new Guid("95697409-baf6-4f78-86ab-42d93d9569a8"), "A debit card is a payment card that deducts funds directly from the cardholder's bank account when a purchase is made.", true, "Debit Card" },
{ new Guid("a820f240-5e9a-4ae9-9091-8a7aa7720cea"), "A credit card is a payment card that allows you to borrow funds from a financial institution to pay for goods and services", true, "Credit card" },
{ new Guid("f67beee6-6763-4108-922c-03bd86b9178d"), "When a bill is paid using the amount received in advance from a company.", true, "Advance Payment" }
});
migrationBuilder.CreateIndex(
name: "IX_AdvancePaymentTransactions_CreatedById",
table: "AdvancePaymentTransactions",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_AdvancePaymentTransactions_EmployeeId",
table: "AdvancePaymentTransactions",
column: "EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_AdvancePaymentTransactions_TenantId",
table: "AdvancePaymentTransactions",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_CreatedById",
table: "PaymentRequests",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_CurrencyId",
table: "PaymentRequests",
column: "CurrencyId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_ExpenseCategoryId",
table: "PaymentRequests",
column: "ExpenseCategoryId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_ExpenseStatusId",
table: "PaymentRequests",
column: "ExpenseStatusId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_RecurringPaymentId",
table: "PaymentRequests",
column: "RecurringPaymentId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_TenantId",
table: "PaymentRequests",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_UpdatedById",
table: "PaymentRequests",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_CreatedById",
table: "RecurringPayments",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_CurrencyId",
table: "RecurringPayments",
column: "CurrencyId");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_ExpenseCategoryId",
table: "RecurringPayments",
column: "ExpenseCategoryId");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_ExpenseStatusId",
table: "RecurringPayments",
column: "ExpenseStatusId");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_StatusId",
table: "RecurringPayments",
column: "StatusId");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_TenantId",
table: "RecurringPayments",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_UpdatedById",
table: "RecurringPayments",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_StatusUpdateLogs_TenantId",
table: "StatusUpdateLogs",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_StatusUpdateLogs_UpdatedById",
table: "StatusUpdateLogs",
column: "UpdatedById");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AdvancePaymentTransactions");
migrationBuilder.DropTable(
name: "PaymentRequests");
migrationBuilder.DropTable(
name: "StatusUpdateLogs");
migrationBuilder.DropTable(
name: "RecurringPayments");
migrationBuilder.DeleteData(
table: "PaymentModeMatser",
keyColumn: "Id",
keyValue: new Guid("95697409-baf6-4f78-86ab-42d93d9569a8"));
migrationBuilder.DeleteData(
table: "PaymentModeMatser",
keyColumn: "Id",
keyValue: new Guid("a820f240-5e9a-4ae9-9091-8a7aa7720cea"));
migrationBuilder.DeleteData(
table: "PaymentModeMatser",
keyColumn: "Id",
keyValue: new Guid("f67beee6-6763-4108-922c-03bd86b9178d"));
migrationBuilder.AddColumn<Guid>(
name: "TenantId",
table: "PaymentModeMatser",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "PaymentModeMatser",
keyColumn: "Id",
keyValue: new Guid("24e6b0df-7929-47d2-88a3-4cf14c1f28f9"),
column: "TenantId",
value: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"));
migrationBuilder.UpdateData(
table: "PaymentModeMatser",
keyColumn: "Id",
keyValue: new Guid("2e919e94-694c-41d9-9489-0a2b4208a027"),
column: "TenantId",
value: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"));
migrationBuilder.UpdateData(
table: "PaymentModeMatser",
keyColumn: "Id",
keyValue: new Guid("48d9b462-5d87-4dec-8dec-2bc943943172"),
column: "TenantId",
value: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"));
migrationBuilder.UpdateData(
table: "PaymentModeMatser",
keyColumn: "Id",
keyValue: new Guid("ed667353-8eea-4fd1-8750-719405932480"),
column: "TenantId",
value: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"));
migrationBuilder.CreateIndex(
name: "IX_PaymentModeMatser_TenantId",
table: "PaymentModeMatser",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_PaymentModeMatser_Tenants_TenantId",
table: "PaymentModeMatser",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,81 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_ProjectId_In_PaymentRequest_RecurringPayment_Tables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "ProjectId",
table: "RecurringPayments",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "ProjectId",
table: "PaymentRequests",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_ProjectId",
table: "RecurringPayments",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_ProjectId",
table: "PaymentRequests",
column: "ProjectId");
migrationBuilder.AddForeignKey(
name: "FK_PaymentRequests_Projects_ProjectId",
table: "PaymentRequests",
column: "ProjectId",
principalTable: "Projects",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_RecurringPayments_Projects_ProjectId",
table: "RecurringPayments",
column: "ProjectId",
principalTable: "Projects",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PaymentRequests_Projects_ProjectId",
table: "PaymentRequests");
migrationBuilder.DropForeignKey(
name: "FK_RecurringPayments_Projects_ProjectId",
table: "RecurringPayments");
migrationBuilder.DropIndex(
name: "IX_RecurringPayments_ProjectId",
table: "RecurringPayments");
migrationBuilder.DropIndex(
name: "IX_PaymentRequests_ProjectId",
table: "PaymentRequests");
migrationBuilder.DropColumn(
name: "ProjectId",
table: "RecurringPayments");
migrationBuilder.DropColumn(
name: "ProjectId",
table: "PaymentRequests");
}
}
}

View File

@ -2066,6 +2066,48 @@ namespace Marco.Pms.DataAccess.Migrations
b.ToTable("RolePermissionMappings");
});
modelBuilder.Entity("Marco.Pms.Model.Expenses.AdvancePaymentTransaction", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<double>("Amount")
.HasColumnType("double");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<Guid>("CreatedById")
.HasColumnType("char(36)");
b.Property<Guid>("EmployeeId")
.HasColumnType("char(36)");
b.Property<int>("FinanceUIdPostfix")
.HasColumnType("int");
b.Property<string>("FinanceUIdPrefix")
.IsRequired()
.HasColumnType("longtext");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("EmployeeId");
b.HasIndex("TenantId");
b.ToTable("AdvancePaymentTransactions");
});
modelBuilder.Entity("Marco.Pms.Model.Expenses.BillAttachments", b =>
{
b.Property<Guid>("Id")
@ -2357,6 +2399,195 @@ namespace Marco.Pms.DataAccess.Migrations
});
});
modelBuilder.Entity("Marco.Pms.Model.Expenses.PaymentRequest", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<double>("Amount")
.HasColumnType("double");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<Guid>("CreatedById")
.HasColumnType("char(36)");
b.Property<Guid>("CurrencyId")
.HasColumnType("char(36)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("DueDate")
.HasColumnType("datetime(6)");
b.Property<Guid?>("ExpenseCategoryId")
.HasColumnType("char(36)");
b.Property<Guid>("ExpenseStatusId")
.HasColumnType("char(36)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<string>("Payee")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid?>("ProjectId")
.HasColumnType("char(36)");
b.Property<Guid?>("RecurringPaymentId")
.HasColumnType("char(36)");
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("UIDPostfix")
.HasColumnType("int");
b.Property<string>("UIDPrefix")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime(6)");
b.Property<Guid>("UpdatedById")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("CurrencyId");
b.HasIndex("ExpenseCategoryId");
b.HasIndex("ExpenseStatusId");
b.HasIndex("ProjectId");
b.HasIndex("RecurringPaymentId");
b.HasIndex("TenantId");
b.HasIndex("UpdatedById");
b.ToTable("PaymentRequests");
});
modelBuilder.Entity("Marco.Pms.Model.Expenses.RecurringPayment", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<double>("Amount")
.HasColumnType("double");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<Guid>("CreatedById")
.HasColumnType("char(36)");
b.Property<Guid>("CurrencyId")
.HasColumnType("char(36)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid?>("ExpenseCategoryId")
.HasColumnType("char(36)");
b.Property<Guid>("ExpenseStatusId")
.HasColumnType("char(36)");
b.Property<int>("Frequency")
.HasColumnType("int");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsVariable")
.HasColumnType("tinyint(1)");
b.Property<DateTime>("LatestPRGeneratedAt")
.HasColumnType("datetime(6)");
b.Property<string>("NotifyTo")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("NumberOfIteration")
.HasColumnType("int");
b.Property<string>("Payee")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("PaymentBufferDays")
.HasColumnType("int");
b.Property<Guid?>("ProjectId")
.HasColumnType("char(36)");
b.Property<Guid>("StatusId")
.HasColumnType("char(36)");
b.Property<DateTime>("StrikeDate")
.HasColumnType("datetime(6)");
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("UIDPostfix")
.HasColumnType("int");
b.Property<string>("UIDPrefix")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime(6)");
b.Property<Guid>("UpdatedById")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("CurrencyId");
b.HasIndex("ExpenseCategoryId");
b.HasIndex("ExpenseStatusId");
b.HasIndex("ProjectId");
b.HasIndex("StatusId");
b.HasIndex("TenantId");
b.HasIndex("UpdatedById");
b.ToTable("RecurringPayments");
});
modelBuilder.Entity("Marco.Pms.Model.Expenses.StatusPermissionMapping", b =>
{
b.Property<Guid>("Id")
@ -3409,13 +3640,8 @@ namespace Marco.Pms.DataAccess.Migrations
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId");
b.ToTable("PaymentModeMatser");
b.HasData(
@ -3424,32 +3650,49 @@ namespace Marco.Pms.DataAccess.Migrations
Id = new Guid("24e6b0df-7929-47d2-88a3-4cf14c1f28f9"),
Description = "Physical currency; still used for small or informal transactions.",
IsActive = true,
Name = "Cash",
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
Name = "Cash"
},
new
{
Id = new Guid("48d9b462-5d87-4dec-8dec-2bc943943172"),
Description = "Paper-based payment order; less common now due to processing delays and fraud risks.",
IsActive = true,
Name = "Cheque",
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
Name = "Cheque"
},
new
{
Id = new Guid("ed667353-8eea-4fd1-8750-719405932480"),
Description = "Online banking portals used to transfer funds directly between accounts",
IsActive = true,
Name = "NetBanking",
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
Name = "NetBanking"
},
new
{
Id = new Guid("2e919e94-694c-41d9-9489-0a2b4208a027"),
Description = "Real-time bank-to-bank transfer using mobile apps; widely used for peer-to-peer and merchant payments.",
IsActive = true,
Name = "UPI",
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
Name = "UPI"
},
new
{
Id = new Guid("a820f240-5e9a-4ae9-9091-8a7aa7720cea"),
Description = "A credit card is a payment card that allows you to borrow funds from a financial institution to pay for goods and services",
IsActive = true,
Name = "Credit card"
},
new
{
Id = new Guid("95697409-baf6-4f78-86ab-42d93d9569a8"),
Description = "A debit card is a payment card that deducts funds directly from the cardholder's bank account when a purchase is made.",
IsActive = true,
Name = "Debit Card"
},
new
{
Id = new Guid("f67beee6-6763-4108-922c-03bd86b9178d"),
Description = "When a bill is paid using the amount received in advance from a company.",
IsActive = true,
Name = "Advance Payment"
});
});
@ -3524,6 +3767,39 @@ namespace Marco.Pms.DataAccess.Migrations
});
});
modelBuilder.Entity("Marco.Pms.Model.Master.StatusUpdateLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Comment")
.HasColumnType("longtext");
b.Property<Guid>("EntityId")
.HasColumnType("char(36)");
b.Property<Guid>("StatusId")
.HasColumnType("char(36)");
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime(6)");
b.Property<Guid>("UpdatedById")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId");
b.HasIndex("UpdatedById");
b.ToTable("StatusUpdateLogs");
});
modelBuilder.Entity("Marco.Pms.Model.Master.SubscriptionStatus", b =>
{
b.Property<Guid>("Id")
@ -5853,6 +6129,33 @@ namespace Marco.Pms.DataAccess.Migrations
.IsRequired();
});
modelBuilder.Entity("Marco.Pms.Model.Expenses.AdvancePaymentTransaction", b =>
{
b.HasOne("Marco.Pms.Model.Employees.Employee", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee")
.WithMany()
.HasForeignKey("EmployeeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.TenantModels.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreatedBy");
b.Navigation("Employee");
b.Navigation("Tenant");
});
modelBuilder.Entity("Marco.Pms.Model.Expenses.BillAttachments", b =>
{
b.HasOne("Marco.Pms.Model.DocumentManager.Document", "Document")
@ -6049,6 +6352,130 @@ namespace Marco.Pms.DataAccess.Migrations
b.Navigation("Status");
});
modelBuilder.Entity("Marco.Pms.Model.Expenses.PaymentRequest", b =>
{
b.HasOne("Marco.Pms.Model.Employees.Employee", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Master.CurrencyMaster", "Currency")
.WithMany()
.HasForeignKey("CurrencyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Master.ExpensesTypeMaster", "ExpenseCategory")
.WithMany()
.HasForeignKey("ExpenseCategoryId");
b.HasOne("Marco.Pms.Model.Master.ExpensesStatusMaster", "ExpenseStatus")
.WithMany()
.HasForeignKey("ExpenseStatusId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Projects.Project", "Project")
.WithMany()
.HasForeignKey("ProjectId");
b.HasOne("Marco.Pms.Model.Expenses.RecurringPayment", "RecurringPayment")
.WithMany()
.HasForeignKey("RecurringPaymentId");
b.HasOne("Marco.Pms.Model.TenantModels.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Employees.Employee", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreatedBy");
b.Navigation("Currency");
b.Navigation("ExpenseCategory");
b.Navigation("ExpenseStatus");
b.Navigation("Project");
b.Navigation("RecurringPayment");
b.Navigation("Tenant");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("Marco.Pms.Model.Expenses.RecurringPayment", b =>
{
b.HasOne("Marco.Pms.Model.Employees.Employee", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Master.CurrencyMaster", "Currency")
.WithMany()
.HasForeignKey("CurrencyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Master.ExpensesTypeMaster", "ExpenseCategory")
.WithMany()
.HasForeignKey("ExpenseCategoryId");
b.HasOne("Marco.Pms.Model.Master.ExpensesStatusMaster", "ExpenseStatus")
.WithMany()
.HasForeignKey("ExpenseStatusId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Projects.Project", "Project")
.WithMany()
.HasForeignKey("ProjectId");
b.HasOne("Marco.Pms.Model.Master.ExpensesStatusMaster", "Status")
.WithMany()
.HasForeignKey("StatusId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.TenantModels.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Employees.Employee", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreatedBy");
b.Navigation("Currency");
b.Navigation("ExpenseCategory");
b.Navigation("ExpenseStatus");
b.Navigation("Project");
b.Navigation("Status");
b.Navigation("Tenant");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("Marco.Pms.Model.Expenses.StatusPermissionMapping", b =>
{
b.HasOne("Marco.Pms.Model.Entitlements.FeaturePermission", "Permission")
@ -6241,7 +6668,7 @@ namespace Marco.Pms.DataAccess.Migrations
b.Navigation("ActivityGroup");
});
modelBuilder.Entity("Marco.Pms.Model.Master.PaymentModeMatser", b =>
modelBuilder.Entity("Marco.Pms.Model.Master.ServiceMaster", b =>
{
b.HasOne("Marco.Pms.Model.TenantModels.Tenant", "Tenant")
.WithMany()
@ -6252,7 +6679,7 @@ namespace Marco.Pms.DataAccess.Migrations
b.Navigation("Tenant");
});
modelBuilder.Entity("Marco.Pms.Model.Master.ServiceMaster", b =>
modelBuilder.Entity("Marco.Pms.Model.Master.StatusUpdateLog", b =>
{
b.HasOne("Marco.Pms.Model.TenantModels.Tenant", "Tenant")
.WithMany()
@ -6260,7 +6687,15 @@ namespace Marco.Pms.DataAccess.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Employees.Employee", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Tenant");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("Marco.Pms.Model.Master.WorkCategoryMaster", b =>

View File

@ -1,5 +1,6 @@
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Master;
using Marco.Pms.Model.Projects;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
@ -21,6 +22,11 @@ namespace Marco.Pms.Model.Expenses
public CurrencyMaster? Currency { get; set; }
public double Amount { get; set; }
public DateTime DueDate { get; set; }
public Guid? ProjectId { get; set; }
[ValidateNever]
[ForeignKey("ProjectId")]
public Project? Project { get; set; }
public Guid? RecurringPaymentId { get; set; }
[ValidateNever]

View File

@ -1,5 +1,6 @@
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Master;
using Marco.Pms.Model.Projects;
using Marco.Pms.Model.TenantModels;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
@ -24,6 +25,11 @@ namespace Marco.Pms.Model.Expenses
public double Amount { get; set; }
public DateTime StrikeDate { get; set; }
public DateTime LatestPRGeneratedAt { get; set; }
public Guid? ProjectId { get; set; }
[ValidateNever]
[ForeignKey("ProjectId")]
public Project? Project { get; set; }
public int PaymentBufferDays { get; set; }
public int NumberOfIteration { get; set; }
public Guid? ExpenseCategoryId { get; set; }

View File

@ -9,7 +9,7 @@
"Title": "Dev"
},
"ConnectionStrings": {
"DefaultConnectionString": "Server=147.93.98.152;User ID=devuser;Password=AppUser@123$;Database=MarcoBMS1"
"DefaultConnectionString": "Server=147.93.98.152;User ID=devuser;Password=AppUser@123$;Database=MarcoBMSOFW"
},
"SmtpSettings": {
"SmtpServer": "smtp.gmail.com",