Added the IsAttachmentRequried parameter to ExpensesTypeMaster table

This commit is contained in:
ashutosh.nehete 2025-09-12 12:38:26 +05:30
parent 5105da7b54
commit cf35b8c773
11 changed files with 5984 additions and 15 deletions

View File

@ -628,6 +628,7 @@ namespace Marco.Pms.DataAccess.Data
Description = "Materials, equipment and supplies purchased for site operations.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ExpensesTypeMaster
@ -637,6 +638,7 @@ namespace Marco.Pms.DataAccess.Data
Description = "Vehicle fuel, logistics services and delivery of goods or personnel.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = false,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ExpensesTypeMaster
@ -646,6 +648,7 @@ namespace Marco.Pms.DataAccess.Data
Description = "Delivery of personnel.",
NoOfPersonsRequired = true,
IsActive = true,
IsAttachmentRequried = false,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ExpensesTypeMaster
@ -655,6 +658,7 @@ namespace Marco.Pms.DataAccess.Data
Description = "Site setup costs including equipment deployment and temporary infrastructure.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ExpensesTypeMaster
@ -664,6 +668,7 @@ namespace Marco.Pms.DataAccess.Data
Description = " Worker amenities like snacks, meals, safety gear, accommodation, medical support etc.",
NoOfPersonsRequired = true,
IsActive = true,
IsAttachmentRequried = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ExpensesTypeMaster
@ -673,6 +678,7 @@ namespace Marco.Pms.DataAccess.Data
Description = "Machinery servicing, electricity, water, and temporary office needs.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ExpensesTypeMaster
@ -682,6 +688,7 @@ namespace Marco.Pms.DataAccess.Data
Description = "Scheduled payments for external services or goods.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ExpensesTypeMaster
@ -691,6 +698,7 @@ namespace Marco.Pms.DataAccess.Data
Description = "Government fees, insurance, inspections and safety-related expenditures.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,268 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_IsAttachmentRequried_Parameter_In_ExpensesTypeMaster_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsAttachmentRequried",
table: "ExpensesTypeMaster",
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, 9, 12, 7, 6, 13, 429, DateTimeKind.Utc).AddTicks(3323));
migrationBuilder.UpdateData(
table: "DocumentCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
column: "CreatedAt",
value: new DateTime(2025, 9, 12, 7, 6, 13, 429, DateTimeKind.Utc).AddTicks(3316));
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));
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));
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));
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));
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));
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));
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));
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));
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));
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));
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));
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("1e2d697a-76b4-4be8-bc66-87144561a1a0"),
column: "IsAttachmentRequried",
value: true);
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("2de53163-0dbd-404b-8e60-1b02e6b4886a"),
column: "IsAttachmentRequried",
value: false);
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("4842fa61-64eb-4241-aebd-8282065af9f9"),
column: "IsAttachmentRequried",
value: true);
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("52484820-1b54-4865-8f0f-baa2b1d339b9"),
column: "IsAttachmentRequried",
value: true);
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("5e0c6227-d49d-41ff-9f1f-781f0aee2469"),
column: "IsAttachmentRequried",
value: true);
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("77013784-9324-4d8b-bd36-d6f928e68942"),
column: "IsAttachmentRequried",
value: true);
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("dd120bc4-ab0a-45ba-8450-5cd45ff221ca"),
column: "IsAttachmentRequried",
value: false);
migrationBuilder.UpdateData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("fc59eb90-98ea-481c-b421-54bfa9e42d8f"),
column: "IsAttachmentRequried",
value: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsAttachmentRequried",
table: "ExpensesTypeMaster");
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));
}
}
}

View File

@ -931,7 +931,7 @@ namespace Marco.Pms.DataAccess.Migrations
new
{
Id = new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6226),
CreatedAt = new DateTime(2025, 9, 12, 7, 6, 13, 429, DateTimeKind.Utc).AddTicks(3316),
Description = "Project documents are formal records that outline the plans, progress, and details necessary to execute and manage a project effectively.",
EntityTypeId = new Guid("c8fe7115-aa27-43bc-99f4-7b05fabe436e"),
Name = "Project Documents",
@ -940,7 +940,7 @@ namespace Marco.Pms.DataAccess.Migrations
new
{
Id = new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6233),
CreatedAt = new DateTime(2025, 9, 12, 7, 6, 13, 429, DateTimeKind.Utc).AddTicks(3323),
Description = "Employment details along with legal IDs like passports or drivers licenses to verify identity and work authorization.",
EntityTypeId = new Guid("dbb9555a-7a0c-40f2-a9ed-f0463f1ceed7"),
Name = "Employee Documents",
@ -1026,7 +1026,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
AllowedContentType = "application/pdf,image/jpeg",
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6275),
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
DocumentCategoryId = new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
IsActive = true,
IsMandatory = true,
@ -1041,7 +1041,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
AllowedContentType = "application/pdf,image/jpeg",
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6282),
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
DocumentCategoryId = new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
IsActive = true,
IsMandatory = true,
@ -1056,7 +1056,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
AllowedContentType = "application/pdf,image/jpeg",
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6286),
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
DocumentCategoryId = new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
IsActive = true,
IsMandatory = true,
@ -1071,7 +1071,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
AllowedContentType = "application/pdf,image/jpeg",
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6290),
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
DocumentCategoryId = new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
IsActive = true,
IsMandatory = true,
@ -1086,7 +1086,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
AllowedContentType = "application/pdf,image/jpeg",
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6295),
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
DocumentCategoryId = new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
IsActive = true,
IsMandatory = true,
@ -1101,7 +1101,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6298),
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
DocumentCategoryId = new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
IsActive = true,
IsMandatory = false,
@ -1115,7 +1115,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6302),
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
DocumentCategoryId = new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
IsActive = true,
IsMandatory = false,
@ -1129,7 +1129,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6307),
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
DocumentCategoryId = new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
IsActive = true,
IsMandatory = false,
@ -1143,7 +1143,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6311),
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
DocumentCategoryId = new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
IsActive = true,
IsMandatory = false,
@ -1157,7 +1157,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6314),
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
DocumentCategoryId = new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
IsActive = true,
IsMandatory = false,
@ -1171,7 +1171,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
AllowedContentType = "application/pdf,image/vnd.dwg,application/acad",
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6319),
CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
DocumentCategoryId = new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
IsActive = true,
IsMandatory = false,
@ -2606,6 +2606,9 @@ namespace Marco.Pms.DataAccess.Migrations
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsAttachmentRequried")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
@ -2628,6 +2631,7 @@ namespace Marco.Pms.DataAccess.Migrations
Id = new Guid("5e0c6227-d49d-41ff-9f1f-781f0aee2469"),
Description = "Materials, equipment and supplies purchased for site operations.",
IsActive = true,
IsAttachmentRequried = true,
Name = "Procurement",
NoOfPersonsRequired = false,
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
@ -2637,6 +2641,7 @@ namespace Marco.Pms.DataAccess.Migrations
Id = new Guid("2de53163-0dbd-404b-8e60-1b02e6b4886a"),
Description = "Vehicle fuel, logistics services and delivery of goods or personnel.",
IsActive = true,
IsAttachmentRequried = false,
Name = "Transport",
NoOfPersonsRequired = false,
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
@ -2646,6 +2651,7 @@ namespace Marco.Pms.DataAccess.Migrations
Id = new Guid("dd120bc4-ab0a-45ba-8450-5cd45ff221ca"),
Description = "Delivery of personnel.",
IsActive = true,
IsAttachmentRequried = false,
Name = "Travelling",
NoOfPersonsRequired = true,
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
@ -2655,6 +2661,7 @@ namespace Marco.Pms.DataAccess.Migrations
Id = new Guid("52484820-1b54-4865-8f0f-baa2b1d339b9"),
Description = "Site setup costs including equipment deployment and temporary infrastructure.",
IsActive = true,
IsAttachmentRequried = true,
Name = "Mobilization",
NoOfPersonsRequired = false,
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
@ -2664,6 +2671,7 @@ namespace Marco.Pms.DataAccess.Migrations
Id = new Guid("fc59eb90-98ea-481c-b421-54bfa9e42d8f"),
Description = " Worker amenities like snacks, meals, safety gear, accommodation, medical support etc.",
IsActive = true,
IsAttachmentRequried = true,
Name = "Employee Welfare",
NoOfPersonsRequired = true,
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
@ -2673,6 +2681,7 @@ namespace Marco.Pms.DataAccess.Migrations
Id = new Guid("77013784-9324-4d8b-bd36-d6f928e68942"),
Description = "Machinery servicing, electricity, water, and temporary office needs.",
IsActive = true,
IsAttachmentRequried = true,
Name = "Maintenance & Utilities",
NoOfPersonsRequired = false,
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
@ -2682,6 +2691,7 @@ namespace Marco.Pms.DataAccess.Migrations
Id = new Guid("1e2d697a-76b4-4be8-bc66-87144561a1a0"),
Description = "Scheduled payments for external services or goods.",
IsActive = true,
IsAttachmentRequried = true,
Name = "Vendor/Supplier Payments",
NoOfPersonsRequired = false,
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
@ -2691,6 +2701,7 @@ namespace Marco.Pms.DataAccess.Migrations
Id = new Guid("4842fa61-64eb-4241-aebd-8282065af9f9"),
Description = "Government fees, insurance, inspections and safety-related expenditures.",
IsActive = true,
IsAttachmentRequried = true,
Name = "Compliance & Safety",
NoOfPersonsRequired = false,
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
@ -5480,7 +5491,7 @@ namespace Marco.Pms.DataAccess.Migrations
modelBuilder.Entity("Marco.Pms.Model.Utilities.FCMTokenMapping", b =>
{
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")
b.HasOne("Marco.Pms.Model.TenantModels.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)

View File

@ -1,4 +1,5 @@
using Marco.Pms.Model.MongoDBModels.Utility;
using Marco.Pms.Model.MongoDBModels;
using Marco.Pms.Model.MongoDBModels.Utility;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using MongoDB.Bson;
@ -146,5 +147,86 @@ namespace Marco.Pms.Helpers.Utility
}
#endregion
#region =================================================================== NotificatioBody Helper Functions ===================================================================
public async Task AddNotificationAsync(NotificationMongoDB notification)
{
try
{
var collection = _mongoDatabase.GetCollection<NotificationMongoDB>("NotificatioBody");
var indexKeys = Builders<NotificationMongoDB>.IndexKeys
.Ascending(doc => doc.TenantId)
.Ascending(doc => doc.Name);
// Define index options with unique constraint
var indexOptions = new CreateIndexOptions { Unique = true };
// Create the index model
var indexModel = new CreateIndexModel<NotificationMongoDB>(indexKeys, indexOptions);
// Create the index on the collection (this operation is idempotent)
collection.Indexes.CreateOne(indexModel);
await collection.InsertOneAsync(notification);
}
catch (Exception ex)
{
_logger.LogError(ex, "Exception occured while adding the Notification body {NotificationName} for tenant {TenantId}", notification.Name, notification.TenantId);
}
}
public async Task<NotificationMongoDB> GetNotificationBodyAsync(string name, Guid tenantId)
{
var rootTenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26");
NotificationMongoDB? result = null;
NotificationMongoDB? defaultNotification = new NotificationMongoDB
{
Name = "default",
Title = "Error: Something Went Wrong",
Body = " An unexpected error occurred. Please try again. If the problem persists, contact support",
Parameters = "",
TenantId = rootTenantId
};
var collection = _mongoDatabase.GetCollection<NotificationMongoDB>("NotificatioBody");
try
{
var filter = Builders<NotificationMongoDB>.Filter.And(
Builders<NotificationMongoDB>.Filter.Eq(n => n.Name, name),
Builders<NotificationMongoDB>.Filter.Eq(n => n.TenantId, tenantId)
);
result = await collection
.Find(filter)
.FirstOrDefaultAsync();
}
catch (Exception ex)
{
_logger.LogError(ex, "Exception occured while fetching the Notification body {NotificationName} for tenant {TenantId}", name, tenantId);
}
if (result == null)
{
try
{
var filter = Builders<NotificationMongoDB>.Filter.And(
Builders<NotificationMongoDB>.Filter.Eq(n => n.Name, name),
Builders<NotificationMongoDB>.Filter.Eq(n => n.TenantId, rootTenantId)
);
result = await collection.Find(filter).FirstOrDefaultAsync();
}
catch (Exception ex)
{
_logger.LogError(ex, "Exception occured while fetching the Notification body {NotificationName} for tenant {TenantId}", name, rootTenantId);
return defaultNotification;
}
}
return result;
}
#endregion
}
}

View File

@ -5,6 +5,7 @@
public Guid? Id { get; set; }
public required string Name { get; set; }
public required bool NoOfPersonsRequired { get; set; }
public required bool IsAttachmentRequried { get; set; }
public string? Description { get; set; }
}
}

View File

@ -9,5 +9,6 @@ namespace Marco.Pms.Model.Master
public bool NoOfPersonsRequired { get; set; }
public string Description { get; set; } = string.Empty;
public bool IsActive { get; set; } = true;
public bool IsAttachmentRequried { get; set; } = true;
}
}

View File

@ -0,0 +1,19 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Marco.Pms.Model.MongoDBModels
{
public class NotificationMongoDB
{
[BsonId]
[BsonRepresentation(BsonType.String)]
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public string Body { get; set; } = string.Empty;
public string Parameters { get; set; } = string.Empty; // Comma seprated variable needed for dynamic notifications
[BsonRepresentation(BsonType.String)]
public Guid TenantId { get; set; }
}
}

View File

@ -5,6 +5,7 @@
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public bool NoOfPersonsRequired { get; set; }
public bool IsAttachmentRequried { get; set; }
public string Description { get; set; } = string.Empty;
}
}

View File

@ -525,6 +525,7 @@ namespace Marco.Pms.Services.Service
if (expenseType == null) validationErrors.Add("Expense Type not found.");
if (paymentMode == null) validationErrors.Add("Payment Mode not found.");
if (statusMapping == null) validationErrors.Add("Default status 'Draft' not found.");
if ((expenseType?.IsAttachmentRequried ?? true) && !(dto.BillAttachments?.Any() ?? false)) validationErrors.Add("Bill Attachment is requried, but not found");
if (validationErrors.Any())
{

View File

@ -222,6 +222,7 @@ namespace Marco.Pms.Services.Service
Description = "Materials, equipment and supplies purchased for site operations.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = tenantId
},
new ExpensesTypeMaster
@ -231,6 +232,7 @@ namespace Marco.Pms.Services.Service
Description = "Vehicle fuel, logistics services and delivery of goods or personnel.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = false,
TenantId = tenantId
},
new ExpensesTypeMaster
@ -240,6 +242,7 @@ namespace Marco.Pms.Services.Service
Description = "Delivery of personnel.",
NoOfPersonsRequired = true,
IsActive = true,
IsAttachmentRequried = false,
TenantId = tenantId
},
new ExpensesTypeMaster
@ -249,6 +252,7 @@ namespace Marco.Pms.Services.Service
Description = "Site setup costs including equipment deployment and temporary infrastructure.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = tenantId
},
new ExpensesTypeMaster
@ -258,6 +262,7 @@ namespace Marco.Pms.Services.Service
Description = " Worker amenities like snacks, meals, safety gear, accommodation, medical support etc.",
NoOfPersonsRequired = true,
IsActive = true,
IsAttachmentRequried = true,
TenantId = tenantId
},
new ExpensesTypeMaster
@ -267,6 +272,7 @@ namespace Marco.Pms.Services.Service
Description = "Machinery servicing, electricity, water, and temporary office needs.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = tenantId
},
new ExpensesTypeMaster
@ -276,6 +282,7 @@ namespace Marco.Pms.Services.Service
Description = "Scheduled payments for external services or goods.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = tenantId
},
new ExpensesTypeMaster
@ -285,6 +292,7 @@ namespace Marco.Pms.Services.Service
Description = "Government fees, insurance, inspections and safety-related expenditures.",
NoOfPersonsRequired = false,
IsActive = true,
IsAttachmentRequried = true,
TenantId = tenantId
}
};