Firebase_Implementation #135

Merged
ashutosh.nehete merged 62 commits from Firebase_Implementation into main 2025-09-20 12:11:54 +00:00
154 changed files with 74700 additions and 2739 deletions
Showing only changes of commit 5105da7b54 - Show all commits

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,37 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_New_Parameter_In_Tenant_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "OfficeNumber",
table: "Tenants",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Tenants",
keyColumn: "Id",
keyValue: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"),
column: "OfficeNumber",
value: null);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "OfficeNumber",
table: "Tenants");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Fixed_Spelling_Mistake_In_Tenant_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "OragnizationSize",
table: "Tenants",
newName: "OrganizationSize");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "OrganizationSize",
table: "Tenants",
newName: "OragnizationSize");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,207 @@
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_Subscription_Related_Tables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "SubscriptionStatus",
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")
},
constraints: table =>
{
table.PrimaryKey("PK_SubscriptionStatus", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "SubscriptionPlans",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PlanName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
PriceQuarterly = table.Column<double>(type: "double", nullable: false),
PriceMonthly = table.Column<double>(type: "double", nullable: false),
PriceHalfMonthly = table.Column<double>(type: "double", nullable: false),
PriceYearly = table.Column<double>(type: "double", nullable: false),
TrialDays = table.Column<int>(type: "int", nullable: false),
MaxUser = table.Column<double>(type: "double", nullable: false),
MaxStorage = table.Column<double>(type: "double", nullable: false),
FeaturesId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreateAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdateAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CurrencyId = 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"),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SubscriptionPlans", x => x.Id);
table.ForeignKey(
name: "FK_SubscriptionPlans_CurrencyMaster_CurrencyId",
column: x => x.CurrencyId,
principalTable: "CurrencyMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_SubscriptionPlans_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_SubscriptionPlans_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "TenantSubscriptions",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PlanId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
StartDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
EndDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
IsTrial = table.Column<bool>(type: "tinyint(1)", nullable: false),
StatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CurrencyId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
NextBillingDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CancellationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
AutoRemew = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdateAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_TenantSubscriptions", x => x.Id);
table.ForeignKey(
name: "FK_TenantSubscriptions_CurrencyMaster_CurrencyId",
column: x => x.CurrencyId,
principalTable: "CurrencyMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_TenantSubscriptions_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_TenantSubscriptions_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_TenantSubscriptions_SubscriptionPlans_PlanId",
column: x => x.PlanId,
principalTable: "SubscriptionPlans",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_TenantSubscriptions_SubscriptionStatus_StatusId",
column: x => x.StatusId,
principalTable: "SubscriptionStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_TenantSubscriptions_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "SubscriptionStatus",
columns: new[] { "Id", "Name" },
values: new object[,]
{
{ new Guid("1c0e422e-01b6-412f-b72a-1db004cc8a7f"), "Suspended" },
{ new Guid("4ed487b1-af22-4e25-aecd-b63fd850cf2d"), "InActive" },
{ new Guid("cd3a68ea-41fd-42f0-bd0c-c871c7337727"), "Active" }
});
migrationBuilder.CreateIndex(
name: "IX_SubscriptionPlans_CreatedById",
table: "SubscriptionPlans",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_SubscriptionPlans_CurrencyId",
table: "SubscriptionPlans",
column: "CurrencyId");
migrationBuilder.CreateIndex(
name: "IX_SubscriptionPlans_UpdatedById",
table: "SubscriptionPlans",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_TenantSubscriptions_CreatedById",
table: "TenantSubscriptions",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_TenantSubscriptions_CurrencyId",
table: "TenantSubscriptions",
column: "CurrencyId");
migrationBuilder.CreateIndex(
name: "IX_TenantSubscriptions_PlanId",
table: "TenantSubscriptions",
column: "PlanId");
migrationBuilder.CreateIndex(
name: "IX_TenantSubscriptions_StatusId",
table: "TenantSubscriptions",
column: "StatusId");
migrationBuilder.CreateIndex(
name: "IX_TenantSubscriptions_TenantId",
table: "TenantSubscriptions",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_TenantSubscriptions_UpdatedById",
table: "TenantSubscriptions",
column: "UpdatedById");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "TenantSubscriptions");
migrationBuilder.DropTable(
name: "SubscriptionPlans");
migrationBuilder.DropTable(
name: "SubscriptionStatus");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Corrected_Typo_In_Subscription_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "AutoRemew",
table: "TenantSubscriptions",
newName: "AutoRenew");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "AutoRenew",
table: "TenantSubscriptions",
newName: "AutoRemew");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Corrected_Typo_In_SubscriptionPlan_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "PriceHalfMonthly",
table: "SubscriptionPlans",
newName: "PriceHalfYearly");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "PriceHalfYearly",
table: "SubscriptionPlans",
newName: "PriceHalfMonthly");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,411 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Seprated_SubscriptionPlan_And_SubscriptionPlanDetails : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_StatusMasters_Tenants_TenantId",
table: "StatusMasters");
migrationBuilder.DropForeignKey(
name: "FK_SubscriptionPlans_CurrencyMaster_CurrencyId",
table: "SubscriptionPlans");
migrationBuilder.DropForeignKey(
name: "FK_SubscriptionPlans_Employees_CreatedById",
table: "SubscriptionPlans");
migrationBuilder.DropForeignKey(
name: "FK_SubscriptionPlans_Employees_UpdatedById",
table: "SubscriptionPlans");
migrationBuilder.DropForeignKey(
name: "FK_TenantSubscriptions_SubscriptionPlans_PlanId",
table: "TenantSubscriptions");
migrationBuilder.DropIndex(
name: "IX_SubscriptionPlans_CreatedById",
table: "SubscriptionPlans");
migrationBuilder.DropIndex(
name: "IX_SubscriptionPlans_CurrencyId",
table: "SubscriptionPlans");
migrationBuilder.DropIndex(
name: "IX_SubscriptionPlans_UpdatedById",
table: "SubscriptionPlans");
migrationBuilder.DropIndex(
name: "IX_StatusMasters_TenantId",
table: "StatusMasters");
migrationBuilder.DropColumn(
name: "CreateAt",
table: "SubscriptionPlans");
migrationBuilder.DropColumn(
name: "CreatedById",
table: "SubscriptionPlans");
migrationBuilder.DropColumn(
name: "CurrencyId",
table: "SubscriptionPlans");
migrationBuilder.DropColumn(
name: "FeaturesId",
table: "SubscriptionPlans");
migrationBuilder.DropColumn(
name: "MaxStorage",
table: "SubscriptionPlans");
migrationBuilder.DropColumn(
name: "MaxUser",
table: "SubscriptionPlans");
migrationBuilder.DropColumn(
name: "PriceHalfYearly",
table: "SubscriptionPlans");
migrationBuilder.DropColumn(
name: "PriceMonthly",
table: "SubscriptionPlans");
migrationBuilder.DropColumn(
name: "PriceQuarterly",
table: "SubscriptionPlans");
migrationBuilder.DropColumn(
name: "PriceYearly",
table: "SubscriptionPlans");
migrationBuilder.DropColumn(
name: "TrialDays",
table: "SubscriptionPlans");
migrationBuilder.DropColumn(
name: "UpdateAt",
table: "SubscriptionPlans");
migrationBuilder.DropColumn(
name: "UpdatedById",
table: "SubscriptionPlans");
migrationBuilder.DropColumn(
name: "TenantId",
table: "StatusMasters");
migrationBuilder.AddColumn<bool>(
name: "IsCancelled",
table: "TenantSubscriptions",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<double>(
name: "MaxUsers",
table: "TenantSubscriptions",
type: "double",
nullable: false,
defaultValue: 0.0);
migrationBuilder.CreateTable(
name: "SubscriptionPlanDetails",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Price = table.Column<double>(type: "double", nullable: false),
Frequency = table.Column<int>(type: "int", nullable: false),
TrialDays = table.Column<int>(type: "int", nullable: false),
MaxUser = table.Column<double>(type: "double", nullable: false),
MaxStorage = table.Column<double>(type: "double", nullable: false),
FeaturesId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreateAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdateAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
PlanId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CurrencyId = 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"),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SubscriptionPlanDetails", x => x.Id);
table.ForeignKey(
name: "FK_SubscriptionPlanDetails_CurrencyMaster_CurrencyId",
column: x => x.CurrencyId,
principalTable: "CurrencyMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_SubscriptionPlanDetails_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_SubscriptionPlanDetails_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_SubscriptionPlanDetails_SubscriptionPlans_PlanId",
column: x => x.PlanId,
principalTable: "SubscriptionPlans",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_SubscriptionPlanDetails_CreatedById",
table: "SubscriptionPlanDetails",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_SubscriptionPlanDetails_CurrencyId",
table: "SubscriptionPlanDetails",
column: "CurrencyId");
migrationBuilder.CreateIndex(
name: "IX_SubscriptionPlanDetails_PlanId",
table: "SubscriptionPlanDetails",
column: "PlanId");
migrationBuilder.CreateIndex(
name: "IX_SubscriptionPlanDetails_UpdatedById",
table: "SubscriptionPlanDetails",
column: "UpdatedById");
migrationBuilder.AddForeignKey(
name: "FK_TenantSubscriptions_SubscriptionPlanDetails_PlanId",
table: "TenantSubscriptions",
column: "PlanId",
principalTable: "SubscriptionPlanDetails",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_TenantSubscriptions_SubscriptionPlanDetails_PlanId",
table: "TenantSubscriptions");
migrationBuilder.DropTable(
name: "SubscriptionPlanDetails");
migrationBuilder.DropColumn(
name: "IsCancelled",
table: "TenantSubscriptions");
migrationBuilder.DropColumn(
name: "MaxUsers",
table: "TenantSubscriptions");
migrationBuilder.AddColumn<DateTime>(
name: "CreateAt",
table: "SubscriptionPlans",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<Guid>(
name: "CreatedById",
table: "SubscriptionPlans",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "CurrencyId",
table: "SubscriptionPlans",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "FeaturesId",
table: "SubscriptionPlans",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.AddColumn<double>(
name: "MaxStorage",
table: "SubscriptionPlans",
type: "double",
nullable: false,
defaultValue: 0.0);
migrationBuilder.AddColumn<double>(
name: "MaxUser",
table: "SubscriptionPlans",
type: "double",
nullable: false,
defaultValue: 0.0);
migrationBuilder.AddColumn<double>(
name: "PriceHalfYearly",
table: "SubscriptionPlans",
type: "double",
nullable: false,
defaultValue: 0.0);
migrationBuilder.AddColumn<double>(
name: "PriceMonthly",
table: "SubscriptionPlans",
type: "double",
nullable: false,
defaultValue: 0.0);
migrationBuilder.AddColumn<double>(
name: "PriceQuarterly",
table: "SubscriptionPlans",
type: "double",
nullable: false,
defaultValue: 0.0);
migrationBuilder.AddColumn<double>(
name: "PriceYearly",
table: "SubscriptionPlans",
type: "double",
nullable: false,
defaultValue: 0.0);
migrationBuilder.AddColumn<int>(
name: "TrialDays",
table: "SubscriptionPlans",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<DateTime>(
name: "UpdateAt",
table: "SubscriptionPlans",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "UpdatedById",
table: "SubscriptionPlans",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "TenantId",
table: "StatusMasters",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "StatusMasters",
keyColumn: "Id",
keyValue: new Guid("33deaef9-9af1-4f2a-b443-681ea0d04f81"),
column: "TenantId",
value: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"));
migrationBuilder.UpdateData(
table: "StatusMasters",
keyColumn: "Id",
keyValue: new Guid("603e994b-a27f-4e5d-a251-f3d69b0498ba"),
column: "TenantId",
value: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"));
migrationBuilder.UpdateData(
table: "StatusMasters",
keyColumn: "Id",
keyValue: new Guid("b74da4c2-d07e-46f2-9919-e75e49b12731"),
column: "TenantId",
value: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"));
migrationBuilder.UpdateData(
table: "StatusMasters",
keyColumn: "Id",
keyValue: new Guid("cdad86aa-8a56-4ff4-b633-9c629057dfef"),
column: "TenantId",
value: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"));
migrationBuilder.UpdateData(
table: "StatusMasters",
keyColumn: "Id",
keyValue: new Guid("ef1c356e-0fe0-42df-a5d3-8daee355492d"),
column: "TenantId",
value: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"));
migrationBuilder.CreateIndex(
name: "IX_SubscriptionPlans_CreatedById",
table: "SubscriptionPlans",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_SubscriptionPlans_CurrencyId",
table: "SubscriptionPlans",
column: "CurrencyId");
migrationBuilder.CreateIndex(
name: "IX_SubscriptionPlans_UpdatedById",
table: "SubscriptionPlans",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_StatusMasters_TenantId",
table: "StatusMasters",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_StatusMasters_Tenants_TenantId",
table: "StatusMasters",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_SubscriptionPlans_CurrencyMaster_CurrencyId",
table: "SubscriptionPlans",
column: "CurrencyId",
principalTable: "CurrencyMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_SubscriptionPlans_Employees_CreatedById",
table: "SubscriptionPlans",
column: "CreatedById",
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_SubscriptionPlans_Employees_UpdatedById",
table: "SubscriptionPlans",
column: "UpdatedById",
principalTable: "Employees",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_TenantSubscriptions_SubscriptionPlans_PlanId",
table: "TenantSubscriptions",
column: "PlanId",
principalTable: "SubscriptionPlans",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,488 @@
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_Document_Manager_Tables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DocumentTagMasters",
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"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DocumentTagMasters", x => x.Id);
table.ForeignKey(
name: "FK_DocumentTagMasters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "EntityTypeMasters",
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")
},
constraints: table =>
{
table.PrimaryKey("PK_EntityTypeMasters", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DocumentCategoryMasters",
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"),
EntityTypeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DocumentCategoryMasters", x => x.Id);
table.ForeignKey(
name: "FK_DocumentCategoryMasters_EntityTypeMasters_EntityTypeId",
column: x => x.EntityTypeId,
principalTable: "EntityTypeMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentCategoryMasters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DocumentTypeMasters",
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"),
RegexExpression = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
AllowedContentType = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
MaxSizeAllowedInMB = table.Column<double>(type: "double", nullable: false),
IsValidationRequired = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsMandatory = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsSystem = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
DocumentCategoryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DocumentTypeMasters", x => x.Id);
table.ForeignKey(
name: "FK_DocumentTypeMasters_DocumentCategoryMasters_DocumentCategory~",
column: x => x.DocumentCategoryId,
principalTable: "DocumentCategoryMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentTypeMasters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DocumentAttachments",
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"),
DocumentId = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UploadedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UploadedById = 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: true, collation: "ascii_general_ci"),
VerifiedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
IsVerified = table.Column<bool>(type: "tinyint(1)", nullable: true),
VerifiedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
EntityId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DocumentTypeId = 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_DocumentAttachments", x => x.Id);
table.ForeignKey(
name: "FK_DocumentAttachments_DocumentTypeMasters_DocumentTypeId",
column: x => x.DocumentTypeId,
principalTable: "DocumentTypeMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentAttachments_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_DocumentAttachments_Employees_UploadedById",
column: x => x.UploadedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentAttachments_Employees_VerifiedById",
column: x => x.VerifiedById,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_DocumentAttachments_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AttachmentTagMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DocumentTagId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
AttachmentId = 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_AttachmentTagMappings", x => x.Id);
table.ForeignKey(
name: "FK_AttachmentTagMappings_DocumentAttachments_AttachmentId",
column: x => x.AttachmentId,
principalTable: "DocumentAttachments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttachmentTagMappings_DocumentTagMasters_DocumentTagId",
column: x => x.DocumentTagId,
principalTable: "DocumentTagMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttachmentTagMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AttachmentVersionMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ParentAttachmentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Version = table.Column<int>(type: "int", nullable: false),
ChildAttachmentId = 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_AttachmentVersionMappings", x => x.Id);
table.ForeignKey(
name: "FK_AttachmentVersionMappings_DocumentAttachments_ChildAttachmen~",
column: x => x.ChildAttachmentId,
principalTable: "DocumentAttachments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttachmentVersionMappings_DocumentAttachments_ParentAttachme~",
column: x => x.ParentAttachmentId,
principalTable: "DocumentAttachments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttachmentVersionMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DocumentAttachmentMappings",
columns: table => new
{
Id = 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"),
AttachmentId = 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_DocumentAttachmentMappings", x => x.Id);
table.ForeignKey(
name: "FK_DocumentAttachmentMappings_DocumentAttachments_AttachmentId",
column: x => x.AttachmentId,
principalTable: "DocumentAttachments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentAttachmentMappings_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentAttachmentMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "EntityTypeMasters",
columns: new[] { "Id", "Description", "Name" },
values: new object[,]
{
{ new Guid("c8fe7115-aa27-43bc-99f4-7b05fabe436e"), "Emtities related to project.", "Project Entity" },
{ new Guid("dbb9555a-7a0c-40f2-a9ed-f0463f1ceed7"), "Employee related entitie", "Employee Entity" }
});
migrationBuilder.InsertData(
table: "Features",
columns: new[] { "Id", "Description", "IsActive", "ModuleId", "Name" },
values: new object[] { new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), "Manage Document", true, new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), "Document Management" });
migrationBuilder.InsertData(
table: "DocumentCategoryMasters",
columns: new[] { "Id", "CreatedAt", "Description", "EntityTypeId", "Name", "TenantId" },
values: new object[,]
{
{ new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8157), "Employment details along with legal IDs like passports or drivers licenses to verify identity and work authorization.", new Guid("dbb9555a-7a0c-40f2-a9ed-f0463f1ceed7"), "Employee Documents", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8150), "Project documents are formal records that outline the plans, progress, and details necessary to execute and manage a project effectively.", new Guid("c8fe7115-aa27-43bc-99f4-7b05fabe436e"), "Project Documents", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.InsertData(
table: "FeaturePermissions",
columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" },
values: new object[,]
{
{ new Guid("13a1f30f-38d1-41bf-8e7a-b75189aab8e0"), "Grants a user the authority to verify the document", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "Verify Document" },
{ new Guid("3f6d1f67-6fa5-4b7c-b17b-018d4fe4aab8"), "Grants a user the authority to upload the document", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "Upload Document" },
{ new Guid("40863a13-5a66-469d-9b48-135bc5dbf486"), "Grants a user the authority to delete the document", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "Delete Document" },
{ new Guid("71189504-f1c8-4ca5-8db6-810497be2854"), "Grants a user the authority to view all documents related to employees and projects", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "View Document" },
{ new Guid("c423fd81-6273-4b9d-bb5e-76a0fb343833"), "Grants a user the authority to modify document", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "Mofify Document" }
});
migrationBuilder.InsertData(
table: "DocumentTypeMasters",
columns: new[] { "Id", "AllowedContentType", "CreatedAt", "DocumentCategoryId", "IsActive", "IsMandatory", "IsSystem", "IsValidationRequired", "MaxSizeAllowedInMB", "Name", "RegexExpression", "TenantId" },
values: new object[,]
{
{ new Guid("07ca7182-9ac0-4407-b988-59901170cb86"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8229), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Letter of Agreement", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8216), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Passport", "^[A-PR-WY][1-9]\\d\\s?\\d{4}[1-9]$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8222), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Bill of Quantities (BOQ)", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8212), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Voter Card", "^[A-Z]{3}[0-9]{7}$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8204), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Aadhaar card", "^[2-9][0-9]{11}$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"), "application/pdf,image/vnd.dwg,application/acad", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8238), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 20.0, "Drawings", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8209), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Pan Card", "^[A-Z]{5}[0-9]{4}[A-Z]{1}$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("7cc41c91-23cb-442b-badd-f932138d149f"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8235), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Standard Operating Procedure (SOP)", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8232), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Health and Safety Document", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8226), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Work Order", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8219), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Bank Passbook", "^\\d{9,18}$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.CreateIndex(
name: "IX_AttachmentTagMappings_AttachmentId",
table: "AttachmentTagMappings",
column: "AttachmentId");
migrationBuilder.CreateIndex(
name: "IX_AttachmentTagMappings_DocumentTagId",
table: "AttachmentTagMappings",
column: "DocumentTagId");
migrationBuilder.CreateIndex(
name: "IX_AttachmentTagMappings_TenantId",
table: "AttachmentTagMappings",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_AttachmentVersionMappings_ChildAttachmentId",
table: "AttachmentVersionMappings",
column: "ChildAttachmentId");
migrationBuilder.CreateIndex(
name: "IX_AttachmentVersionMappings_ParentAttachmentId",
table: "AttachmentVersionMappings",
column: "ParentAttachmentId");
migrationBuilder.CreateIndex(
name: "IX_AttachmentVersionMappings_TenantId",
table: "AttachmentVersionMappings",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachmentMappings_AttachmentId",
table: "DocumentAttachmentMappings",
column: "AttachmentId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachmentMappings_DocumentId",
table: "DocumentAttachmentMappings",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachmentMappings_TenantId",
table: "DocumentAttachmentMappings",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachments_DocumentTypeId",
table: "DocumentAttachments",
column: "DocumentTypeId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachments_TenantId",
table: "DocumentAttachments",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachments_UpdatedById",
table: "DocumentAttachments",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachments_UploadedById",
table: "DocumentAttachments",
column: "UploadedById");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachments_VerifiedById",
table: "DocumentAttachments",
column: "VerifiedById");
migrationBuilder.CreateIndex(
name: "IX_DocumentCategoryMasters_EntityTypeId",
table: "DocumentCategoryMasters",
column: "EntityTypeId");
migrationBuilder.CreateIndex(
name: "IX_DocumentCategoryMasters_TenantId",
table: "DocumentCategoryMasters",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_DocumentTagMasters_TenantId",
table: "DocumentTagMasters",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_DocumentTypeMasters_DocumentCategoryId",
table: "DocumentTypeMasters",
column: "DocumentCategoryId");
migrationBuilder.CreateIndex(
name: "IX_DocumentTypeMasters_TenantId",
table: "DocumentTypeMasters",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AttachmentTagMappings");
migrationBuilder.DropTable(
name: "AttachmentVersionMappings");
migrationBuilder.DropTable(
name: "DocumentAttachmentMappings");
migrationBuilder.DropTable(
name: "DocumentTagMasters");
migrationBuilder.DropTable(
name: "DocumentAttachments");
migrationBuilder.DropTable(
name: "DocumentTypeMasters");
migrationBuilder.DropTable(
name: "DocumentCategoryMasters");
migrationBuilder.DropTable(
name: "EntityTypeMasters");
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("13a1f30f-38d1-41bf-8e7a-b75189aab8e0"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("3f6d1f67-6fa5-4b7c-b17b-018d4fe4aab8"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("40863a13-5a66-469d-9b48-135bc5dbf486"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("71189504-f1c8-4ca5-8db6-810497be2854"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("c423fd81-6273-4b9d-bb5e-76a0fb343833"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"));
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,285 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Removed_DocumentAttachmentyMapping_And_Added : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DocumentAttachmentMappings");
migrationBuilder.AddColumn<Guid>(
name: "DocumentDataId",
table: "DocumentAttachments",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7895));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7887));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7995));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf,image/jpeg", new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7975) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7984));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf,image/jpeg", new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7971) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf,image/jpeg", new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7958) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(8008));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf,image/jpeg", new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7966) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(8004));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(8000));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7991));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf,image/jpeg", new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7980) });
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachments_DocumentDataId",
table: "DocumentAttachments",
column: "DocumentDataId");
migrationBuilder.AddForeignKey(
name: "FK_DocumentAttachments_Documents_DocumentDataId",
table: "DocumentAttachments",
column: "DocumentDataId",
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_DocumentAttachments_Documents_DocumentDataId",
table: "DocumentAttachments");
migrationBuilder.DropIndex(
name: "IX_DocumentAttachments_DocumentDataId",
table: "DocumentAttachments");
migrationBuilder.DropColumn(
name: "DocumentDataId",
table: "DocumentAttachments");
migrationBuilder.CreateTable(
name: "DocumentAttachmentMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
AttachmentId = 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_DocumentAttachmentMappings", x => x.Id);
table.ForeignKey(
name: "FK_DocumentAttachmentMappings_DocumentAttachments_AttachmentId",
column: x => x.AttachmentId,
principalTable: "DocumentAttachments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentAttachmentMappings_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DocumentAttachmentMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8157));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8150));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8229));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8216) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8222));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8212) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8204) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8238));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8209) });
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8235));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8232));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8226));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
columns: new[] { "AllowedContentType", "CreatedAt" },
values: new object[] { "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8219) });
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachmentMappings_AttachmentId",
table: "DocumentAttachmentMappings",
column: "AttachmentId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachmentMappings_DocumentId",
table: "DocumentAttachmentMappings",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_DocumentAttachmentMappings_TenantId",
table: "DocumentAttachmentMappings",
column: "TenantId");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,212 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_IsCurrentVersion_Field_In_Document_Attachment : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsCurrentVersion",
table: "DocumentAttachments",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1227));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1217));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1308));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1293));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1300));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1289));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1275));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1391));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1284));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1388));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1384));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1305));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1297));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsCurrentVersion",
table: "DocumentAttachments");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7895));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7887));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7995));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7975));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7984));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7971));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7958));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(8008));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7966));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(8004));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(8000));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7991));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 9, 22, 46, 902, DateTimeKind.Utc).AddTicks(7980));
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,237 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Modified_UpdatedAt_And_VerifiedAt_To_Nullable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "VerifiedAt",
table: "DocumentAttachments",
type: "datetime(6)",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime(6)");
migrationBuilder.AlterColumn<DateTime>(
name: "UpdatedAt",
table: "DocumentAttachments",
type: "datetime(6)",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime(6)");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(8988));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(8981));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9059));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9042));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9051));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9038));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9028));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9072));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9034));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9068));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9063));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9055));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9046));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "VerifiedAt",
table: "DocumentAttachments",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "UpdatedAt",
table: "DocumentAttachments",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true);
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1227));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1217));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1308));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1293));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1300));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1289));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1275));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1391));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1284));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1388));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1384));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1305));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 11, 44, 468, DateTimeKind.Utc).AddTicks(1297));
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,211 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_New_Permission_To_Download_Document : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2627));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2617));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2718));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2700));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2710));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2695));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2684));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2731));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2690));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2727));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2722));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2714));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2705));
migrationBuilder.InsertData(
table: "FeaturePermissions",
columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" },
values: new object[] { new Guid("404373d0-860f-490e-a575-1c086ffbce1d"), "Grants a user the authority to download the document", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "Download Document" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("404373d0-860f-490e-a575-1c086ffbce1d"));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(8988));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(8981));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9059));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9042));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9051));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9038));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9028));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9072));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9034));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9068));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9063));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9055));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 28, 11, 18, 55, 873, DateTimeKind.Utc).AddTicks(9046));
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,264 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Project_Level_Permssion_Mapping_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ProjectLevelPermissionMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
EmployeeId = 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"),
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_ProjectLevelPermissionMappings", x => x.Id);
table.ForeignKey(
name: "FK_ProjectLevelPermissionMappings_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectLevelPermissionMappings_FeaturePermissions_Permission~",
column: x => x.PermissionId,
principalTable: "FeaturePermissions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectLevelPermissionMappings_Projects_ProjectId",
column: x => x.ProjectId,
principalTable: "Projects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectLevelPermissionMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6233));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6226));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6307));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6290));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6298));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6286));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6275));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6319));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6282));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6314));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6311));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6302));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6295));
migrationBuilder.CreateIndex(
name: "IX_ProjectLevelPermissionMappings_EmployeeId",
table: "ProjectLevelPermissionMappings",
column: "EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_ProjectLevelPermissionMappings_PermissionId",
table: "ProjectLevelPermissionMappings",
column: "PermissionId");
migrationBuilder.CreateIndex(
name: "IX_ProjectLevelPermissionMappings_ProjectId",
table: "ProjectLevelPermissionMappings",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_ProjectLevelPermissionMappings_TenantId",
table: "ProjectLevelPermissionMappings",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ProjectLevelPermissionMappings");
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2627));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2617));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2718));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2700));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2710));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2695));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2684));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2731));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2690));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2727));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2722));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2714));
migrationBuilder.UpdateData(
table: "DocumentTypeMasters",
keyColumn: "Id",
keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
column: "CreatedAt",
value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2705));
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,7 @@
using Marco.Pms.Model.MongoDBModels.Employees;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using MongoDB.Driver;
namespace Marco.Pms.Helpers.CacheHelper
@ -8,8 +9,11 @@ namespace Marco.Pms.Helpers.CacheHelper
public class EmployeeCache
{
private readonly IMongoCollection<EmployeePermissionMongoDB> _collection;
public EmployeeCache(IConfiguration configuration)
private readonly ILogger<EmployeeCache> _logger;
public EmployeeCache(IConfiguration configuration, ILogger<EmployeeCache> logger)
{
_logger = logger;
var connectionString = configuration["MongoDB:ConnectionString"];
var mongoUrl = new MongoUrl(connectionString);
var client = new MongoClient(mongoUrl); // Your MongoDB connection string
@ -185,6 +189,25 @@ namespace Marco.Pms.Helpers.CacheHelper
return true;
}
public async Task<bool> ClearAllEmployeesFromCacheByEmployeeIds(List<string> employeeIds)
{
try
{
var filter = Builders<EmployeePermissionMongoDB>.Filter.In(x => x.Id, employeeIds);
var result = await _collection.DeleteManyAsync(filter);
if (result.DeletedCount == 0)
return false;
return true;
}
catch (Exception ex)
{
_logger.LogError(ex, "Error occured while deleting employee profile");
return false;
}
}
// A private method to handle the one-time setup of the collection's indexes.
private async Task InitializeCollectionAsync()

View File

@ -0,0 +1,53 @@
using Marco.Pms.Model.TenantModels.MongoDBModel;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using MongoDB.Driver;
namespace Marco.Pms.Helpers.Utility
{
public class FeatureDetailsHelper
{
private readonly IMongoCollection<FeatureDetails> _collection;
private readonly ILogger<FeatureDetailsHelper> _logger;
public FeatureDetailsHelper(IConfiguration configuration, ILogger<FeatureDetailsHelper> logger)
{
_logger = logger;
var connectionString = configuration["MongoDB:ModificationConnectionString"];
var mongoUrl = new MongoUrl(connectionString);
var client = new MongoClient(mongoUrl); // Your MongoDB connection string
var mongoDB = client.GetDatabase(mongoUrl.DatabaseName); // Your MongoDB Database name
_collection = mongoDB.GetCollection<FeatureDetails>("FeatureDetails");
}
public async Task<FeatureDetails?> GetFeatureDetails(Guid Id)
{
try
{
var filter = Builders<FeatureDetails>.Filter.Eq(e => e.Id, Id);
var result = await _collection
.Find(filter)
.FirstOrDefaultAsync();
return result;
}
catch (Exception ex)
{
_logger.LogError(ex, "Exception occured while fetchig features for subscription plan");
return null;
}
}
public async Task<bool> AddFeatureDetails(FeatureDetails featureDetails)
{
try
{
await _collection.InsertOneAsync(featureDetails);
return true;
}
catch (Exception ex)
{
_logger.LogError(ex, "Exception occured while fetchig features for subscription plan");
return false;
}
}
}
}

View File

@ -0,0 +1,224 @@
using Marco.Pms.Model.AppMenu;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using MongoDB.Bson;
using MongoDB.Driver;
namespace Marco.Pms.CacheHelper
{
public class SidebarMenuHelper
{
private readonly IMongoCollection<MenuSection> _collection;
private readonly ILogger<SidebarMenuHelper> _logger;
public SidebarMenuHelper(IConfiguration configuration, ILogger<SidebarMenuHelper> logger)
{
_logger = logger;
var connectionString = configuration["MongoDB:ModificationConnectionString"];
var mongoUrl = new MongoUrl(connectionString);
var client = new MongoClient(mongoUrl);
var database = client.GetDatabase(mongoUrl.DatabaseName);
_collection = database.GetCollection<MenuSection>("Menus");
}
public async Task<MenuSection?> CreateMenuSectionAsync(MenuSection section)
{
try
{
await _collection.InsertOneAsync(section);
return section;
}
catch (Exception ex)
{
_logger.LogError(ex, "Error occurred while adding MenuSection.");
return null;
}
}
public async Task<MenuSection?> UpdateMenuSectionAsync(Guid sectionId, MenuSection updatedSection)
{
try
{
var filter = Builders<MenuSection>.Filter.Eq(s => s.Id, sectionId);
var update = Builders<MenuSection>.Update
.Set(s => s.Header, updatedSection.Header)
.Set(s => s.Title, updatedSection.Title)
.Set(s => s.Items, updatedSection.Items);
var result = await _collection.UpdateOneAsync(filter, update);
if (result.ModifiedCount > 0)
{
return await _collection.Find(s => s.Id == sectionId).FirstOrDefaultAsync();
}
return null;
}
catch (Exception ex)
{
_logger.LogError(ex, "Error updating MenuSection.");
return null;
}
}
public async Task<MenuSection?> AddMenuItemAsync(Guid sectionId, MenuItem newItem)
{
try
{
newItem.Id = Guid.NewGuid();
var filter = Builders<MenuSection>.Filter.Eq(s => s.Id, sectionId);
var update = Builders<MenuSection>.Update.Push(s => s.Items, newItem);
var result = await _collection.UpdateOneAsync(filter, update);
if (result.ModifiedCount > 0)
{
return await _collection.Find(s => s.Id == sectionId).FirstOrDefaultAsync();
}
return null;
}
catch (Exception ex)
{
_logger.LogError(ex, "Error adding menu item.");
return null;
}
}
public async Task<MenuItem?> UpdateMenuItemAsync(Guid sectionId, Guid itemId, MenuItem updatedItem)
{
try
{
var filter = Builders<MenuSection>.Filter.And(
Builders<MenuSection>.Filter.Eq(s => s.Id, sectionId),
Builders<MenuSection>.Filter.ElemMatch(s => s.Items, i => i.Id == itemId)
);
var update = Builders<MenuSection>.Update
.Set("Items.$.Text", updatedItem.Text)
.Set("Items.$.Icon", updatedItem.Icon)
.Set("Items.$.Available", updatedItem.Available)
.Set("Items.$.Link", updatedItem.Link)
.Set("Items.$.PermissionIds", updatedItem.PermissionIds);
var result = await _collection.UpdateOneAsync(filter, update);
if (result.ModifiedCount > 0)
{
// Re-fetch section and return the updated item
var section = await _collection.Find(s => s.Id == sectionId).FirstOrDefaultAsync();
return section?.Items.FirstOrDefault(i => i.Id == itemId);
}
return null;
}
catch (Exception ex)
{
_logger.LogError(ex, "Error updating MenuItem.");
return null;
}
}
public async Task<MenuSection?> AddSubMenuItemAsync(Guid sectionId, Guid itemId, SubMenuItem newSubItem)
{
try
{
newSubItem.Id = Guid.NewGuid();
// Match the MenuSection and the specific MenuItem inside it
var filter = Builders<MenuSection>.Filter.And(
Builders<MenuSection>.Filter.Eq(s => s.Id, sectionId),
Builders<MenuSection>.Filter.ElemMatch(s => s.Items, i => i.Id == itemId)
);
// Use positional operator `$` to target matched MenuItem and push into its Submenu
var update = Builders<MenuSection>.Update.Push("Items.$.Submenu", newSubItem);
var result = await _collection.UpdateOneAsync(filter, update);
if (result.ModifiedCount > 0)
{
return await _collection.Find(s => s.Id == sectionId).FirstOrDefaultAsync();
}
return null;
}
catch (Exception ex)
{
_logger.LogError(ex, "Error adding submenu item.");
return null;
}
}
public async Task<SubMenuItem?> UpdateSubmenuItemAsync(Guid sectionId, Guid itemId, Guid subItemId, SubMenuItem updatedSub)
{
try
{
var filter = Builders<MenuSection>.Filter.Eq(s => s.Id, sectionId);
var arrayFilters = new List<ArrayFilterDefinition>
{
new BsonDocumentArrayFilterDefinition<BsonDocument>(
new BsonDocument("item._id", itemId.ToString())),
new BsonDocumentArrayFilterDefinition<BsonDocument>(
new BsonDocument("sub._id", subItemId.ToString()))
};
var update = Builders<MenuSection>.Update
.Set("Items.$[item].Submenu.$[sub].Text", updatedSub.Text)
.Set("Items.$[item].Submenu.$[sub].Available", updatedSub.Available)
.Set("Items.$[item].Submenu.$[sub].Link", updatedSub.Link)
.Set("Items.$[item].Submenu.$[sub].PermissionKeys", updatedSub.PermissionIds);
var options = new UpdateOptions { ArrayFilters = arrayFilters };
var result = await _collection.UpdateOneAsync(filter, update, options);
if (result.ModifiedCount == 0)
return null;
var updatedSection = await _collection.Find(x => x.Id == sectionId).FirstOrDefaultAsync();
var subItem = updatedSection?.Items
.FirstOrDefault(i => i.Id == itemId)?
.Submenu
.FirstOrDefault(s => s.Id == subItemId);
return subItem;
}
catch (Exception ex)
{
_logger.LogError(ex, "Error updating SubMenuItem.");
return null;
}
}
public async Task<List<MenuSection>> GetAllMenuSectionsAsync(Guid tenantId)
{
var filter = Builders<MenuSection>.Filter.Eq(e => e.TenantId, tenantId);
var result = await _collection
.Find(filter)
.ToListAsync();
if (result.Any())
{
return result;
}
tenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26");
filter = Builders<MenuSection>.Filter.Eq(e => e.TenantId, tenantId);
result = await _collection
.Find(filter)
.ToListAsync();
return result;
}
}
}

View File

@ -25,8 +25,30 @@ namespace Marco.Pms.Helpers.Utility
#region =================================================================== Update Log Helper Functions ===================================================================
public async Task PushToUpdateLogsAsync(UpdateLogsObject oldObject, string collectionName)
{
var collection = _mongoDatabase.GetCollection<UpdateLogsObject>(collectionName);
await collection.InsertOneAsync(oldObject);
try
{
var collection = _mongoDatabase.GetCollection<UpdateLogsObject>(collectionName);
await collection.InsertOneAsync(oldObject);
}
catch (Exception ex)
{
_logger.LogError(ex, "Exception occured while saving object of update logs in collection: {Collection}", collectionName);
}
}
public async Task PushListToUpdateLogsAsync(List<UpdateLogsObject> oldObjects, string collectionName)
{
try
{
var collection = _mongoDatabase.GetCollection<UpdateLogsObject>(collectionName);
if (oldObjects.Any())
{
await collection.InsertManyAsync(oldObjects);
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Exception occured while saving list of update logs in collection: {Collection}", collectionName);
}
}
public async Task<List<UpdateLogsObject>> GetFromUpdateLogsByEntityIdAsync(Guid entityId, string collectionName)

View File

@ -0,0 +1,23 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Marco.Pms.Model.AppMenu
{
public class MenuItem
{
[BsonId]
[BsonRepresentation(BsonType.String)]
public Guid Id { get; set; } = Guid.NewGuid();
public string? Text { get; set; }
public string? Icon { get; set; }
public bool Available { get; set; } = true;
public string? Link { get; set; }
// Changed from string → List<string>
public List<string> PermissionIds { get; set; } = new List<string>();
public List<SubMenuItem> Submenu { get; set; } = new List<SubMenuItem>();
}
}

View File

@ -0,0 +1,21 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Marco.Pms.Model.AppMenu
{
public class MenuSection
{
[BsonId]
[BsonRepresentation(BsonType.String)]
public Guid Id { get; set; } = Guid.NewGuid();
public string? Header { get; set; }
public string? Title { get; set; }
public List<MenuItem> Items { get; set; } = new List<MenuItem>();
[BsonRepresentation(BsonType.String)]
public Guid TenantId { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Marco.Pms.Model.AppMenu
{
public class SubMenuItem
{
[BsonId]
[BsonRepresentation(BsonType.String)]
public Guid Id { get; set; } = Guid.NewGuid();
public string? Text { get; set; }
public bool Available { get; set; } = true;
public string Link { get; set; } = string.Empty;
// Changed from string → List<string>
public List<string> PermissionIds { get; set; } = new List<string>();
}
}

View File

@ -1,6 +1,6 @@
using System.ComponentModel;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Directory
{

View File

@ -1,6 +1,6 @@
using System.ComponentModel;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Directory
{

View File

@ -0,0 +1,22 @@
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.DocumentManager
{
public class AttachmentTagMapping : TenantRelation
{
public Guid Id { get; set; }
public Guid DocumentTagId { get; set; }
[ValidateNever]
[ForeignKey("DocumentTagId")]
public DocumentTagMaster? DocumentTag { get; set; }
public Guid AttachmentId { get; set; }
[ValidateNever]
[ForeignKey("AttachmentId")]
public DocumentAttachment? Attachment { get; set; }
}
}

View File

@ -0,0 +1,22 @@
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.DocumentManager
{
public class AttachmentVersionMapping : TenantRelation
{
public Guid Id { get; set; }
public Guid ParentAttachmentId { get; set; }
[ValidateNever]
[ForeignKey("ParentAttachmentId")]
public DocumentAttachment? ParentAttachment { get; set; }
public int Version { get; set; } = 1;
public Guid ChildAttachmentId { get; set; }
[ValidateNever]
[ForeignKey("ChildAttachmentId")]
public DocumentAttachment? ChildAttachment { get; set; }
}
}

View File

@ -0,0 +1,48 @@
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.DocumentManager
{
public class DocumentAttachment : TenantRelation
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? DocumentId { get; set; }
public string Description { get; set; } = string.Empty;
public bool IsCurrentVersion { get; set; } = true;
public DateTime UploadedAt { get; set; }
public Guid UploadedById { get; set; } // References the employee who uploaded the document
[ValidateNever]
[ForeignKey("UploadedById")]
public Employee? UploadedBy { get; set; }
public DateTime? UpdatedAt { get; set; }
public Guid? UpdatedById { get; set; } // References the employee who updates the document
[ValidateNever]
[ForeignKey("UpdatedById")]
public Employee? UpdatedBy { get; set; }
public DateTime? VerifiedAt { get; set; }
public bool? IsVerified { get; set; }
public Guid? VerifiedById { get; set; } // Associates the document with a specific employee, if applicable
[ValidateNever]
[ForeignKey("VerifiedById")]
public Employee? VerifiedBy { get; set; }
public Guid EntityId { get; set; } // Associates the document with a specific project, if applicable
public Guid DocumentTypeId { get; set; }
[ValidateNever]
[ForeignKey("DocumentTypeId")]
public DocumentTypeMaster? DocumentType { get; set; }
public Guid DocumentDataId { get; set; }
[ValidateNever]
[ForeignKey("DocumentDataId")]
public Document? Document { get; set; }
public bool IsActive { get; set; } = true;
}
}

View File

@ -0,0 +1,17 @@
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.DocumentManager
{
public class DocumentAttachmentMapping : TenantRelation
{
public Guid Id { get; set; }
public Guid AttachmentId { get; set; }
[ValidateNever]
[ForeignKey("AttachmentId")]
public DocumentAttachment? Attachment { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using Marco.Pms.Model.Master;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.DocumentManager
{
public class DocumentCategoryMaster : TenantRelation
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public Guid EntityTypeId { get; set; }
[ValidateNever]
[ForeignKey("EntityTypeId")]
public EntityTypeMaster? EntityTypeMaster { get; set; }
public DateTime CreatedAt { get; set; }
}
}

View File

@ -0,0 +1,11 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.DocumentManager
{
public class DocumentTagMaster : TenantRelation
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,26 @@
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.DocumentManager
{
public class DocumentTypeMaster : TenantRelation
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? RegexExpression { get; set; }
public string AllowedContentType { get; set; } = string.Empty;
public double MaxSizeAllowedInMB { get; set; } = 2;
public bool IsValidationRequired { get; set; } = true;
public bool IsMandatory { get; set; } = true;
public bool IsSystem { get; set; } = false;
public bool IsActive { get; set; } = true;
public Guid DocumentCategoryId { get; set; }
[ValidateNever]
[ForeignKey("DocumentCategoryId")]
public DocumentCategoryMaster? DocumentCategory { get; set; }
public DateTime CreatedAt { get; set; }
}
}

View File

@ -0,0 +1,16 @@
namespace Marco.Pms.Model.Dtos.AppMenu
{
public class CreateMenuItemDto
{
public required string Text { get; set; }
public required string Icon { get; set; }
public bool Available { get; set; } = true;
public required string Link { get; set; }
// Changed from string → List<string>
public List<string> PermissionIds { get; set; } = new List<string>();
public List<CreateSubMenuItemDto> Submenu { get; set; } = new List<CreateSubMenuItemDto>();
}
}

View File

@ -0,0 +1,9 @@
namespace Marco.Pms.Model.Dtos.AppMenu
{
public class CreateMenuSectionDto
{
public required string Header { get; set; }
public required string Title { get; set; }
public List<CreateMenuItemDto> Items { get; set; } = new List<CreateMenuItemDto>();
}
}

View File

@ -0,0 +1,13 @@
namespace Marco.Pms.Model.Dtos.AppMenu
{
public class CreateSubMenuItemDto
{
public required string Text { get; set; }
public bool Available { get; set; } = true;
public required string Link { get; set; } = string.Empty;
// Changed from string → List<string>
public List<string> PermissionIds { get; set; } = new List<string>();
}
}

View File

@ -0,0 +1,16 @@
namespace Marco.Pms.Model.Dtos.AppMenu
{
public class UpdateMenuItemDto
{
public required Guid Id { get; set; }
public required string Text { get; set; }
public required string Icon { get; set; }
public bool Available { get; set; } = true;
public required string Link { get; set; }
// Changed from string → List<string>
public List<string> PermissionIds { get; set; } = new List<string>();
}
}

View File

@ -0,0 +1,9 @@
namespace Marco.Pms.Model.Dtos.AppMenu
{
public class UpdateMenuSectionDto
{
public required Guid Id { get; set; }
public required string Header { get; set; }
public required string Title { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace Marco.Pms.Model.Dtos.AppMenu
{
public class UpdateSubMenuItemDto
{
public Guid Id { get; set; }
public string? Text { get; set; }
public bool Available { get; set; } = true;
public string Link { get; set; } = string.Empty;
// Changed from string → List<string>
public List<string> PermissionIds { get; set; } = new List<string>();
}
}

View File

@ -4,6 +4,7 @@
{
public string? Label { get; set; }
public string? EmailAddress { get; set; }
public bool IsPrimary { get; set; } = false;
}
}

View File

@ -4,5 +4,6 @@
{
public string? Label { get; set; }
public string? PhoneNumber { get; set; }
public bool IsPrimary { get; set; } = false;
}
}

View File

@ -0,0 +1,10 @@
namespace Marco.Pms.Model.Dtos.DocumentManager
{
public class CreateDocumentCategoryDto
{
public Guid? Id { get; set; }
public required string Name { get; set; }
public required string Description { get; set; }
public required Guid EntityTypeId { get; set; }
}
}

View File

@ -0,0 +1,14 @@
namespace Marco.Pms.Model.Dtos.DocumentManager
{
public class CreateDocumentTypeDto
{
public Guid? Id { get; set; }
public required string Name { get; set; } = string.Empty;
public string? RegexExpression { get; set; }
public required string AllowedContentType { get; set; }
public required double MaxSizeAllowedInMB { get; set; } = 2;
public bool IsValidationRequired { get; set; }
public bool IsMandatory { get; set; }
public required Guid DocumentCategoryId { get; set; }
}
}

View File

@ -0,0 +1,26 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.Dtos.DocumentManager
{
public class DocumentAttachmentDto
{
public required string Name { get; set; }
public string? DocumentId { get; set; }
public required string Description { get; set; }
public required Guid EntityId { get; set; }
public required Guid DocumentTypeId { get; set; } // References the type of the document
public required FileUploadModel Attachment { get; set; }
public List<DocumentTagDto>? Tags { get; set; }
}
public class UpdateDocumentAttachmentDto
{
public required Guid Id { get; set; }
public required string Name { get; set; }
public string? DocumentId { get; set; }
public required string Description { get; set; }
public FileUploadModel? Attachment { get; set; }
public List<DocumentTagDto>? Tags { get; set; }
}
}

View File

@ -0,0 +1,8 @@
namespace Marco.Pms.Model.Dtos.DocumentManager
{
public class DocumentTagDto
{
public required string Name { get; set; }
public required bool IsActive { get; set; }
}
}

View File

@ -0,0 +1,12 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class AddSubscriptionDto
{
public Guid TenantId { get; set; }
public Guid PlanId { get; set; }
public Guid CurrencyId { get; set; }
public double MaxUsers { get; set; }
public bool IsTrial { get; set; } = false;
public bool AutoRenew { get; set; } = true;
}
}

View File

@ -0,0 +1,12 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class AttendanceDetailsDto
{
public List<Guid>? FeatureId { get; set; }
public string Name { get; set; } = "Attendance Management";
public bool Enabled { get; set; } = false;
public bool ManualEntry { get; set; } = true;
public bool LocationTracking { get; set; } = true;
public bool ShiftManagement { get; set; } = false;
}
}

View File

@ -0,0 +1,21 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class CreateTenantDto
{
public required string FirstName { get; set; }
public required string LastName { get; set; }
public required string Email { get; set; }
public string? Description { get; set; }
public string? DomainName { get; set; }
public required string BillingAddress { get; set; }
public string? TaxId { get; set; }
public string? logoImage { get; set; }
public required string OrganizationName { get; set; }
public string? OfficeNumber { get; set; }
public required string ContactNumber { get; set; }
public required DateTime OnBoardingDate { get; set; }
public required string OrganizationSize { get; set; }
public required Guid IndustryId { get; set; }
public required string Reference { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class DirectoryDetailsDto
{
public List<Guid>? FeatureId { get; set; }
public string Name { get; set; } = "Directory Management";
public bool Enabled { get; set; } = false;
public int BucketLimit { get; set; } = 25;
public bool OrganizationChart { get; set; } = false;
}
}

View File

@ -0,0 +1,9 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class ExpenseModuleDetailsDto
{
public List<Guid>? FeatureId { get; set; }
public string Name { get; set; } = "Expense Management";
public bool Enabled { get; set; } = false;
}
}

View File

@ -0,0 +1,10 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class FeatureDetailsDto
{
public ModulesDetailsDto? Modules { get; set; }
public ReportDetailsDto? Reports { get; set; }
public SupportDetailsDto? Supports { get; set; }
public List<SubscriptionCheckListDto> SubscriptionCheckList { get; set; } = new List<SubscriptionCheckListDto>();
}
}

View File

@ -0,0 +1,10 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class ModulesDetailsDto
{
public ProjectManagementDetailsDto? ProjectManagement { get; set; }
public AttendanceDetailsDto? Attendance { get; set; }
public DirectoryDetailsDto? Directory { get; set; }
public ExpenseModuleDetailsDto? Expense { get; set; }
}
}

View File

@ -0,0 +1,13 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class ProjectManagementDetailsDto
{
public List<Guid>? FeatureId { get; set; }
public string Name { get; set; } = "Project Management";
public bool Enabled { get; set; } = false;
public int MaxProject { get; set; } = 10;
public double MaxTaskPerProject { get; set; } = 100000;
public bool GanttChart { get; set; } = false;
public bool ResourceAllocation { get; set; } = false;
}
}

View File

@ -0,0 +1,9 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class ReportDetailsDto
{
public bool BasicReports { get; set; } = true;
public bool CustomReports { get; set; } = false;
public List<string> ExportData { get; set; } = new List<string>();
}
}

View File

@ -0,0 +1,8 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class SubscriptionCheckListDto
{
public string Name { get; set; } = string.Empty;
public bool IsActive { get; set; } = true;
}
}

View File

@ -0,0 +1,13 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class SubscriptionPlanDetailsDto
{
public Guid? Id { get; set; }
public double Price { get; set; }
public required int TrialDays { get; set; }
public required double MaxUser { get; set; }
public double MaxStorage { get; set; }
public required FeatureDetailsDto Features { get; set; }
public Guid CurrencyId { get; set; }
}
}

View File

@ -0,0 +1,13 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class SubscriptionPlanDto
{
public Guid? Id { get; set; }
public required string PlanName { get; set; }
public required string Description { get; set; }
public SubscriptionPlanDetailsDto? MonthlyPlan { get; set; }
public SubscriptionPlanDetailsDto? QuarterlyPlan { get; set; }
public SubscriptionPlanDetailsDto? HalfYearlyPlan { get; set; }
public SubscriptionPlanDetailsDto? YearlyPlan { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class SupportDetailsDto
{
public bool EmailSupport { get; set; } = true;
public bool PhoneSupport { get; set; } = false;
public bool PrioritySupport { get; set; } = false;
}
}

View File

@ -0,0 +1,10 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class UpdateSubscriptionDto
{
public Guid TenantId { get; set; }
public Guid PlanId { get; set; }
public Guid CurrencyId { get; set; }
public double? MaxUsers { get; set; }
}
}

View File

@ -0,0 +1,19 @@
namespace Marco.Pms.Model.Dtos.Tenant
{
public class UpdateTenantDto
{
public Guid Id { get; set; }
public required string FirstName { get; set; }
public required string LastName { get; set; }
public string? Description { get; set; }
public string? DomainName { get; set; }
public required string BillingAddress { get; set; }
public string? TaxId { get; set; }
public string? logoImage { get; set; }
public string? OfficeNumber { get; set; }
public required string ContactNumber { get; set; }
public required string OrganizationSize { get; set; }
public required Guid IndustryId { get; set; }
public required string Reference { get; set; }
}
}

View File

@ -0,0 +1,11 @@
using Marco.Pms.Model.Dtos.Roles;
namespace Marco.Pms.Model.Dtos.Util
{
public class ProjctLevelPermissionDto
{
public required Guid EmployeeId { get; set; }
public required Guid ProjectId { get; set; }
public required List<FeaturesPermissionDto> Permission { get; set; }
}
}

View File

@ -1,25 +0,0 @@
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Master;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Entitlements
{
public class Tenant
{
public Guid Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public string? DomainName { get; set; }
public string? ContactName { get; set; }
public string? ContactNumber { get; set; }
public DateTime OnBoardingDate { get; set; }
public string? OragnizationSize { get; set; }
public Guid? IndustryId { get; set; }
[ForeignKey("IndustryId")]
[ValidateNever]
public Industry? Industry { get; set; }
public bool IsActive { get; set; } = true;
}
}

View File

@ -2,9 +2,14 @@
{
public static class PermissionsMaster
{
public static readonly Guid ManageTenants = Guid.Parse("d032cb1a-3f30-462c-bef0-7ace73a71c0b");
public static readonly Guid ModifyTenant = Guid.Parse("00e20637-ce8d-4417-bec4-9b31b5e65092");
public static readonly Guid ViewTenant = Guid.Parse("647145c6-2108-4c98-aab4-178602236e55");
public static readonly Guid DirectoryAdmin = Guid.Parse("4286a13b-bb40-4879-8c6d-18e9e393beda");
public static readonly Guid DirectoryManager = Guid.Parse("62668630-13ce-4f52-a0f0-db38af2230c5");
public static readonly Guid DirectoryUser = Guid.Parse("0f919170-92d4-4337-abd3-49b66fc871bb");
public static readonly Guid ViewProject = Guid.Parse("6ea44136-987e-44ba-9e5d-1cf8f5837ebc");
public static readonly Guid ManageProject = Guid.Parse("172fc9b6-755b-4f62-ab26-55c34a330614");
public static readonly Guid ManageTeam = Guid.Parse("b94802ce-0689-4643-9e1d-11c86950c35b");
@ -14,15 +19,19 @@
public static readonly Guid AddAndEditTask = Guid.Parse("08752f33-3b29-4816-b76b-ea8a968ed3c5");
public static readonly Guid AssignAndReportProgress = Guid.Parse("6a32379b-8b3f-49a6-8c48-4b7ac1b55dc2");
public static readonly Guid ApproveTask = Guid.Parse("db4e40c5-2ba9-4b6d-b8a6-a16a250ff99c");
public static readonly Guid ViewAllEmployees = Guid.Parse("60611762-7f8a-4fb5-b53f-b1139918796b");
public static readonly Guid ViewTeamMembers = Guid.Parse("b82d2b7e-0d52-45f3-997b-c008ea460e7f");
public static readonly Guid AddAndEditEmployee = Guid.Parse("a97d366a-c2bb-448d-be93-402bd2324566");
public static readonly Guid AssignRoles = Guid.Parse("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3");
public static readonly Guid TeamAttendance = Guid.Parse("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e");
public static readonly Guid RegularizeAttendance = Guid.Parse("57802c4a-00aa-4a1f-a048-fd2f70dd44b6");
public static readonly Guid SelfAttendance = Guid.Parse("ccb0589f-712b-43de-92ed-5b6088e7dc4e");
public static readonly Guid ViewMasters = Guid.Parse("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d");
public static readonly Guid ManageMasters = Guid.Parse("588a8824-f924-4955-82d8-fc51956cf323");
public static readonly Guid ExpenseViewSelf = Guid.Parse("385be49f-8fde-440e-bdbc-3dffeb8dd116");
public static readonly Guid ExpenseViewAll = Guid.Parse("01e06444-9ca7-4df4-b900-8c3fa051b92f");
public static readonly Guid ExpenseUpload = Guid.Parse("0f57885d-bcb2-4711-ac95-d841ace6d5a7");
@ -30,6 +39,13 @@
public static readonly Guid ExpenseApprove = Guid.Parse("eaafdd76-8aac-45f9-a530-315589c6deca");
public static readonly Guid ExpenseProcess = Guid.Parse("ea5a1529-4ee8-4828-80ea-0e23c9d4dd11");
public static readonly Guid ExpenseManage = Guid.Parse("bdee29a2-b73b-402d-8dd1-c4b1f81ccbc3");
public static readonly Guid ViewDocument = Guid.Parse("71189504-f1c8-4ca5-8db6-810497be2854");
public static readonly Guid UploadDocument = Guid.Parse("3f6d1f67-6fa5-4b7c-b17b-018d4fe4aab8");
public static readonly Guid MofifyDocument = Guid.Parse("c423fd81-6273-4b9d-bb5e-76a0fb343833");
public static readonly Guid DeleteDocument = Guid.Parse("40863a13-5a66-469d-9b48-135bc5dbf486");
public static readonly Guid DownloadDocument = Guid.Parse("404373d0-860f-490e-a575-1c086ffbce1d");
public static readonly Guid VerifyDocument = Guid.Parse("13a1f30f-38d1-41bf-8e7a-b75189aab8e0");
}
}

View File

@ -0,0 +1,28 @@
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Projects;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.Entitlements
{
public class ProjectLevelPermissionMapping : TenantRelation
{
public Guid Id { get; set; }
public Guid EmployeeId { get; set; }
[ValidateNever]
[ForeignKey("EmployeeId")]
public Employee? Employee { get; set; }
public Guid ProjectId { get; set; }
[ValidateNever]
[ForeignKey("ProjectId")]
public Project? Project { get; set; }
public Guid PermissionId { get; set; }
[ValidateNever]
[ForeignKey("PermissionId")]
public FeaturePermission? Permission { get; set; }
}
}

View File

@ -0,0 +1,14 @@
namespace Marco.Pms.Model.Filters
{
public class DocumentFilter
{
public List<Guid>? UploadedByIds { get; set; }
public List<Guid>? DocumentCategoryIds { get; set; }
public List<Guid>? DocumentTypeIds { get; set; }
public List<Guid>? DocumentTagIds { get; set; }
public bool IsUploadedAt { get; set; } = true;
public bool? IsVerified { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
}
}

View File

@ -1,4 +1,4 @@
namespace Marco.Pms.Model.Utilities
namespace Marco.Pms.Model.Filters
{
public class ImageFilter
{

View File

@ -0,0 +1,12 @@
namespace Marco.Pms.Model.Filters
{
public class TenantFilter
{
public List<Guid>? IndustryIds { get; set; }
public List<Guid>? CreatedByIds { get; set; }
public List<Guid>? TenantStatusIds { get; set; }
public List<string>? References { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
}
}

View File

@ -35,8 +35,10 @@ namespace Marco.Pms.Model.Mapper
PhoneNumber = model.PhoneNumber,
Photo = base64String,
IsActive = model.IsActive,
IsRootUser = model.ApplicationUser?.IsRootUser ?? false,
IsSystem = model.IsSystem,
JoiningDate = model.JoiningDate
JoiningDate = model.JoiningDate,
TenantId = model.TenantId
};
}
public static BasicEmployeeVM ToBasicEmployeeVMFromEmployee(this Employee employee)

View File

@ -0,0 +1,9 @@
namespace Marco.Pms.Model.Master
{
public class EntityTypeMaster
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
}
}

View File

@ -1,8 +1,6 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.Master
namespace Marco.Pms.Model.Master
{
public class StatusMaster : TenantRelation
public class StatusMaster
{
public Guid Id { get; set; }
public string? Status { get; set; }

View File

@ -0,0 +1,8 @@
namespace Marco.Pms.Model.Master
{
public class SubscriptionStatus
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,8 @@
namespace Marco.Pms.Model.Master
{
public class TenantStatus
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,12 @@
namespace Marco.Pms.Model.Logs
{
public class LogStructure
{
public string LogLevel { get; set; } = "Info";
public string Message { get; set; } = string.Empty;
public DateTime TimeStamp { get; set; }
public string? IpAddress { get; set; }
public string? UserAgent { get; set; }
public string? Details { get; set; } // json serialized string
}
}

View File

@ -0,0 +1,20 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Marco.Pms.Model.TenantModels.MongoDBModel
{
public class AttendanceDetails
{
[BsonId]
[BsonRepresentation(BsonType.String)]
public Guid Id { get; set; } = Guid.NewGuid();
public string? Name { get; set; }
[BsonRepresentation(BsonType.String)]
public List<Guid> FeatureId { get; set; } = new List<Guid>();
public bool Enabled { get; set; } = false;
public bool ManualEntry { get; set; } = true;
public bool LocationTracking { get; set; } = true;
public bool ShiftManagement { get; set; } = false;
}
}

View File

@ -0,0 +1,19 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Marco.Pms.Model.TenantModels.MongoDBModel
{
public class DirectoryDetails
{
[BsonId]
[BsonRepresentation(BsonType.String)]
public Guid Id { get; set; } = Guid.NewGuid();
public string? Name { get; set; }
[BsonRepresentation(BsonType.String)]
public List<Guid> FeatureId { get; set; } = new List<Guid>();
public bool Enabled { get; set; } = false;
public int BucketLimit { get; set; } = 25;
public bool OrganizationChart { get; set; } = false;
}
}

View File

@ -0,0 +1,17 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Marco.Pms.Model.TenantModels.MongoDBModel
{
public class ExpenseModuleDetails
{
[BsonId]
[BsonRepresentation(BsonType.String)]
public Guid Id { get; set; } = Guid.NewGuid();
public string? Name { get; set; }
[BsonRepresentation(BsonType.String)]
public List<Guid> FeatureId { get; set; } = new List<Guid>();
public bool Enabled { get; set; } = false;
}
}

View File

@ -0,0 +1,18 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Marco.Pms.Model.TenantModels.MongoDBModel
{
public class FeatureDetails
{
[BsonId]
[BsonRepresentation(BsonType.String)]
public Guid Id { get; set; } = Guid.NewGuid();
public ModulesDetails? Modules { get; set; }
public ReportDetails? Reports { get; set; }
public SupportDetails? Supports { get; set; }
public List<SubscriptionCheckList> SubscriptionCheckList { get; set; } = new List<SubscriptionCheckList>();
}
}

View File

@ -0,0 +1,16 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Marco.Pms.Model.TenantModels.MongoDBModel
{
public class ModulesDetails
{
[BsonId]
[BsonRepresentation(BsonType.String)]
public Guid Id { get; set; } = Guid.NewGuid();
public ProjectManagementDetails? ProjectManagement { get; set; }
public AttendanceDetails? Attendance { get; set; }
public DirectoryDetails? Directory { get; set; }
public ExpenseModuleDetails? Expense { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Marco.Pms.Model.TenantModels.MongoDBModel
{
public class ProjectManagementDetails
{
[BsonId]
[BsonRepresentation(BsonType.String)]
public Guid Id { get; set; } = Guid.NewGuid();
public string? Name { get; set; }
[BsonRepresentation(BsonType.String)]
public List<Guid> FeatureId { get; set; } = new List<Guid>();
public bool Enabled { get; set; } = false;
public int MaxProject { get; set; } = 10;
public double MaxTaskPerProject { get; set; } = 100000000;
public bool GanttChart { get; set; } = false;
public bool ResourceAllocation { get; set; } = false;
}
}

View File

@ -0,0 +1,15 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Marco.Pms.Model.TenantModels.MongoDBModel
{
public class ReportDetails
{
[BsonId]
[BsonRepresentation(BsonType.String)]
public Guid Id { get; set; } = Guid.NewGuid();
public bool BasicReports { get; set; } = true;
public bool CustomReports { get; set; } = false;
public List<string> ExportData { get; set; } = new List<string>();
}
}

View File

@ -0,0 +1,14 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Marco.Pms.Model.TenantModels.MongoDBModel
{
public class SubscriptionCheckList
{
[BsonId]
[BsonRepresentation(BsonType.String)]
public Guid Id { get; set; } = Guid.NewGuid();
public string Name { get; set; } = string.Empty;
public bool IsActive { get; set; } = true;
}
}

View File

@ -0,0 +1,15 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Marco.Pms.Model.TenantModels.MongoDBModel
{
public class SupportDetails
{
[BsonId]
[BsonRepresentation(BsonType.String)]
public Guid Id { get; set; } = Guid.NewGuid();
public bool EmailSupport { get; set; } = true;
public bool PhoneSupport { get; set; } = false;
public bool PrioritySupport { get; set; } = false;
}
}

View File

@ -0,0 +1,15 @@
namespace Marco.Pms.Model.TenantModels
{
public class SubscriptionPlan
{
public Guid Id { get; set; }
public string PlanName { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public bool IsActive { get; set; } = true;
}
public enum PLAN_FREQUENCY
{
MONTHLY = 0, QUARTERLY = 1, HALF_YEARLY = 2, YEARLY = 3
}
}

View File

@ -0,0 +1,41 @@
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Master;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.TenantModels
{
public class SubscriptionPlanDetails
{
public Guid Id { get; set; }
public double Price { get; set; }
public PLAN_FREQUENCY Frequency { get; set; }
public int TrialDays { get; set; } = 30;
public double MaxUser { get; set; } = 10;
public double MaxStorage { get; set; }
public Guid FeaturesId { get; set; }
public DateTime CreateAt { get; set; }
public DateTime? UpdateAt { get; set; }
public Guid PlanId { get; set; }
[ForeignKey("PlanId")]
[ValidateNever]
public SubscriptionPlan? Plan { get; set; }
public Guid CurrencyId { get; set; }
[ForeignKey("CurrencyId")]
[ValidateNever]
public CurrencyMaster? Currency { get; set; }
public Guid CreatedById { get; set; }
[ForeignKey("CreatedById")]
[ValidateNever]
public Employee? CreatedBy { get; set; }
public Guid? UpdatedById { get; set; }
[ForeignKey("UpdatedById")]
[ValidateNever]
public Employee? UpdatedBy { get; set; }
public bool IsActive { get; set; } = true;
}
}

View File

@ -0,0 +1,38 @@
using Marco.Pms.Model.Master;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.TenantModels
{
public class Tenant
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public string? Description { get; set; }
public string? DomainName { get; set; }
public string ContactName { get; set; } = string.Empty;
public string ContactNumber { get; set; } = string.Empty;
public string? OfficeNumber { get; set; }
public string BillingAddress { get; set; } = string.Empty;
public string? TaxId { get; set; }
public string? logoImage { get; set; } // Base64
public DateTime OnBoardingDate { get; set; }
public string? OrganizationSize { get; set; }
public Guid? IndustryId { get; set; }
[ForeignKey("IndustryId")]
[ValidateNever]
public Industry? Industry { get; set; }
public Guid? CreatedById { get; set; } // EmployeeId
public Guid TenantStatusId { get; set; }
[ForeignKey("TenantStatusId")]
[ValidateNever]
public TenantStatus? TenantStatus { get; set; }
public string Reference { get; set; } = string.Empty;
public bool IsActive { get; set; } = true;
public bool IsSuperTenant { get; set; } = false;
}
}

View File

@ -0,0 +1,48 @@
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Master;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.TenantModels
{
public class TenantSubscriptions : TenantRelation
{
public Guid Id { get; set; }
public Guid PlanId { get; set; }
[ForeignKey("PlanId")]
[ValidateNever]
public SubscriptionPlanDetails? Plan { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public bool IsTrial { get; set; }
public double MaxUsers { get; set; }
public Guid StatusId { get; set; }
[ForeignKey("StatusId")]
[ValidateNever]
public SubscriptionStatus? Status { get; set; }
public Guid CurrencyId { get; set; }
[ForeignKey("CurrencyId")]
[ValidateNever]
public CurrencyMaster? Currency { get; set; }
public DateTime NextBillingDate { get; set; }
public DateTime? CancellationDate { get; set; }
public bool AutoRenew { get; set; } = true;
public bool IsCancelled { get; set; } = false;
public DateTime CreatedAt { get; set; }
public DateTime? UpdateAt { get; set; }
public Guid CreatedById { get; set; }
[ForeignKey("CreatedById")]
[ValidateNever]
public Employee? CreatedBy { get; set; }
public Guid? UpdatedById { get; set; }
[ForeignKey("UpdatedById")]
[ValidateNever]
public Employee? UpdatedBy { get; set; }
}
}

View File

@ -0,0 +1,8 @@
namespace Marco.Pms.Model.Utilities
{
public class ContactNoteFilter
{
public List<Guid>? CreatedByIds { get; set; }
public List<string>? Organizations { get; set; }
}
}

View File

@ -3,9 +3,9 @@
public class FileUploadModel
{
public Guid? DocumentId { get; set; }
public string? FileName { get; set; } // Name of the file (e.g., "image1.png")
public string? Base64Data { get; set; } // Base64-encoded string of the file
public string? ContentType { get; set; } // MIME type (e.g., "image/png", "application/pdf")
public required string FileName { get; set; } // Name of the file (e.g., "image1.png")
public required string Base64Data { get; set; } // Base64-encoded string of the file
public required string ContentType { get; set; } // MIME type (e.g., "image/png", "application/pdf")
public long FileSize { get; set; } // File size in bytes
public string? Description { get; set; } // Optional: Description or purpose of the file
public bool IsActive { get; set; } = true;

Some files were not shown because too many files have changed in this diff Show More