Feature_Directory #90

Merged
vikas.nale merged 501 commits from Feature_Directory into main 2025-06-10 14:44:36 +00:00
5 changed files with 3923 additions and 1 deletions
Showing only changes of commit 73df47e540 - Show all commits

View File

@ -2,6 +2,7 @@
using Marco.Pms.Model.Activities;
using Marco.Pms.Model.AttendanceModule;
using Marco.Pms.Model.Authentication;
using Marco.Pms.Model.Directory;
using Marco.Pms.Model.DocumentManager;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Entitlements;
@ -67,6 +68,18 @@ namespace Marco.Pms.DataAccess.Data
public DbSet<Document> Documents { get; set; }
public DbSet<TicketTag> TicketTags { get; set; }
public DbSet<WorkCategoryMaster> WorkCategoryMasters { get; set; }
public DbSet<Contact> Contacts { get; set; }
public DbSet<ContactCategoryMaster> ContactCategoryMasters { get; set; }
public DbSet<ContactEmail> ContactsEmails { get; set; }
public DbSet<ContactPhone> ContactsPhones { get; set; }
public DbSet<ContactNote> ContactNotes { get; set; }
public DbSet<Bucket> Buckets { get; set; }
public DbSet<ContactTagMaster> ContactTagMasters { get; set; }
public DbSet<ContactTagMapping> ContactTagMappings { get; set; }
public DbSet<EmployeeBucketMapping> EmployeeBucketMappings { get; set; }
public DbSet<ContactBucketMapping> ContactBucketMappings { get; set; }
public DbSet<DirectoryUpdateLog> DirectoryUpdateLogs { get; set; }
public DbSet<MailingList> MailingList { get; set; }
public DbSet<MailDetails> MailDetails { get; set; }
public DbSet<MailLog> MailLogs { get; set; }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,440 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Directory_Related_Tables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Buckets",
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_Buckets", x => x.Id);
table.ForeignKey(
name: "FK_Buckets_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ContactCategoryMasters",
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_ContactCategoryMasters", x => x.Id);
table.ForeignKey(
name: "FK_ContactCategoryMasters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ContactTagMasters",
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_ContactTagMasters", x => x.Id);
table.ForeignKey(
name: "FK_ContactTagMasters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DirectoryUpdateLogs",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RefereanceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UpdateAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DirectoryUpdateLogs", x => x.Id);
table.ForeignKey(
name: "FK_DirectoryUpdateLogs_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "EmployeeBucketMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
BucketId = 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")
},
constraints: table =>
{
table.PrimaryKey("PK_EmployeeBucketMappings", x => x.Id);
table.ForeignKey(
name: "FK_EmployeeBucketMappings_Buckets_BucketId",
column: x => x.BucketId,
principalTable: "Buckets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_EmployeeBucketMappings_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Contacts",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ProjectId = table.Column<Guid>(type: "char(36)", nullable: true, 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"),
Organization = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Address = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ContactCategoryId = table.Column<Guid>(type: "char(36)", nullable: true, 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_Contacts", x => x.Id);
table.ForeignKey(
name: "FK_Contacts_ContactCategoryMasters_ContactCategoryId",
column: x => x.ContactCategoryId,
principalTable: "ContactCategoryMasters",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Contacts_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Contacts_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ContactBucketMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
BucketId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ContactId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ContactBucketMappings", x => x.Id);
table.ForeignKey(
name: "FK_ContactBucketMappings_Buckets_BucketId",
column: x => x.BucketId,
principalTable: "Buckets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ContactBucketMappings_Contacts_ContactId",
column: x => x.ContactId,
principalTable: "Contacts",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ContactNotes",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Note = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ContactId = 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_ContactNotes", x => x.Id);
table.ForeignKey(
name: "FK_ContactNotes_Contacts_ContactId",
column: x => x.ContactId,
principalTable: "Contacts",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ContactNotes_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ContactNotes_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ContactsEmails",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Label = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
EmailAddress = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ContactId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsPrimary = 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_ContactsEmails", x => x.Id);
table.ForeignKey(
name: "FK_ContactsEmails_Contacts_ContactId",
column: x => x.ContactId,
principalTable: "Contacts",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ContactsPhones",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Label = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
PhoneNumber = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ContactId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsPrimary = 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_ContactsPhones", x => x.Id);
table.ForeignKey(
name: "FK_ContactsPhones_Contacts_ContactId",
column: x => x.ContactId,
principalTable: "Contacts",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ContactTagMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ContactId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ContactTagtId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ContactTagId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ContactTagMappings", x => x.Id);
table.ForeignKey(
name: "FK_ContactTagMappings_ContactTagMasters_ContactTagId",
column: x => x.ContactTagId,
principalTable: "ContactTagMasters",
principalColumn: "Id");
table.ForeignKey(
name: "FK_ContactTagMappings_Contacts_ContactId",
column: x => x.ContactId,
principalTable: "Contacts",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_Buckets_TenantId",
table: "Buckets",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ContactBucketMappings_BucketId",
table: "ContactBucketMappings",
column: "BucketId");
migrationBuilder.CreateIndex(
name: "IX_ContactBucketMappings_ContactId",
table: "ContactBucketMappings",
column: "ContactId");
migrationBuilder.CreateIndex(
name: "IX_ContactCategoryMasters_TenantId",
table: "ContactCategoryMasters",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ContactNotes_ContactId",
table: "ContactNotes",
column: "ContactId");
migrationBuilder.CreateIndex(
name: "IX_ContactNotes_CreatedById",
table: "ContactNotes",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_ContactNotes_TenantId",
table: "ContactNotes",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_Contacts_ContactCategoryId",
table: "Contacts",
column: "ContactCategoryId");
migrationBuilder.CreateIndex(
name: "IX_Contacts_CreatedById",
table: "Contacts",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Contacts_TenantId",
table: "Contacts",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ContactsEmails_ContactId",
table: "ContactsEmails",
column: "ContactId");
migrationBuilder.CreateIndex(
name: "IX_ContactsPhones_ContactId",
table: "ContactsPhones",
column: "ContactId");
migrationBuilder.CreateIndex(
name: "IX_ContactTagMappings_ContactId",
table: "ContactTagMappings",
column: "ContactId");
migrationBuilder.CreateIndex(
name: "IX_ContactTagMappings_ContactTagId",
table: "ContactTagMappings",
column: "ContactTagId");
migrationBuilder.CreateIndex(
name: "IX_ContactTagMasters_TenantId",
table: "ContactTagMasters",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_DirectoryUpdateLogs_UpdatedById",
table: "DirectoryUpdateLogs",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_EmployeeBucketMappings_BucketId",
table: "EmployeeBucketMappings",
column: "BucketId");
migrationBuilder.CreateIndex(
name: "IX_EmployeeBucketMappings_EmployeeId",
table: "EmployeeBucketMappings",
column: "EmployeeId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ContactBucketMappings");
migrationBuilder.DropTable(
name: "ContactNotes");
migrationBuilder.DropTable(
name: "ContactsEmails");
migrationBuilder.DropTable(
name: "ContactsPhones");
migrationBuilder.DropTable(
name: "ContactTagMappings");
migrationBuilder.DropTable(
name: "DirectoryUpdateLogs");
migrationBuilder.DropTable(
name: "EmployeeBucketMappings");
migrationBuilder.DropTable(
name: "ContactTagMasters");
migrationBuilder.DropTable(
name: "Contacts");
migrationBuilder.DropTable(
name: "Buckets");
migrationBuilder.DropTable(
name: "ContactCategoryMasters");
}
}
}

View File

@ -325,6 +325,312 @@ namespace Marco.Pms.DataAccess.Migrations
b.ToTable("RefreshTokens");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.Bucket", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId");
b.ToTable("Buckets");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.Contact", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Address")
.HasColumnType("longtext");
b.Property<Guid?>("ContactCategoryId")
.HasColumnType("char(36)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<Guid>("CreatedById")
.HasColumnType("char(36)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Organization")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid?>("ProjectId")
.HasColumnType("char(36)");
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("ContactCategoryId");
b.HasIndex("CreatedById");
b.HasIndex("TenantId");
b.ToTable("Contacts");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.ContactBucketMapping", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<Guid>("BucketId")
.HasColumnType("char(36)");
b.Property<Guid>("ContactId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("BucketId");
b.HasIndex("ContactId");
b.ToTable("ContactBucketMappings");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.ContactCategoryMaster", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId");
b.ToTable("ContactCategoryMasters");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.ContactEmail", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<Guid>("ContactId")
.HasColumnType("char(36)");
b.Property<string>("EmailAddress")
.IsRequired()
.HasColumnType("longtext");
b.Property<bool>("IsPrimary")
.HasColumnType("tinyint(1)");
b.Property<string>("Label")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("ContactId");
b.ToTable("ContactsEmails");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.ContactNote", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<Guid>("ContactId")
.HasColumnType("char(36)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<Guid>("CreatedById")
.HasColumnType("char(36)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<string>("Note")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("ContactId");
b.HasIndex("CreatedById");
b.HasIndex("TenantId");
b.ToTable("ContactNotes");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.ContactPhone", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<Guid>("ContactId")
.HasColumnType("char(36)");
b.Property<bool>("IsPrimary")
.HasColumnType("tinyint(1)");
b.Property<string>("Label")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("PhoneNumber")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("ContactId");
b.ToTable("ContactsPhones");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.ContactTagMapping", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<Guid>("ContactId")
.HasColumnType("char(36)");
b.Property<Guid?>("ContactTagId")
.HasColumnType("char(36)");
b.Property<Guid>("ContactTagtId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("ContactId");
b.HasIndex("ContactTagId");
b.ToTable("ContactTagMappings");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.ContactTagMaster", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId");
b.ToTable("ContactTagMasters");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.DirectoryUpdateLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<Guid>("RefereanceId")
.HasColumnType("char(36)");
b.Property<DateTime>("UpdateAt")
.HasColumnType("datetime(6)");
b.Property<Guid>("UpdatedById")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("UpdatedById");
b.ToTable("DirectoryUpdateLogs");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.EmployeeBucketMapping", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<Guid>("BucketId")
.HasColumnType("char(36)");
b.Property<Guid>("EmployeeId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("BucketId");
b.HasIndex("EmployeeId");
b.ToTable("EmployeeBucketMappings");
});
modelBuilder.Entity("Marco.Pms.Model.DocumentManager.Document", b =>
{
b.Property<Guid>("Id")
@ -2212,6 +2518,179 @@ namespace Marco.Pms.DataAccess.Migrations
b.Navigation("User");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.Bucket", b =>
{
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Tenant");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.Contact", b =>
{
b.HasOne("Marco.Pms.Model.Directory.ContactCategoryMaster", "ContactCategory")
.WithMany()
.HasForeignKey("ContactCategoryId");
b.HasOne("Marco.Pms.Model.Employees.Employee", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ContactCategory");
b.Navigation("CreatedBy");
b.Navigation("Tenant");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.ContactBucketMapping", b =>
{
b.HasOne("Marco.Pms.Model.Directory.Bucket", "Bucket")
.WithMany()
.HasForeignKey("BucketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Directory.Contact", "Contact")
.WithMany()
.HasForeignKey("ContactId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Bucket");
b.Navigation("Contact");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.ContactCategoryMaster", b =>
{
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Tenant");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.ContactEmail", b =>
{
b.HasOne("Marco.Pms.Model.Directory.Contact", "Contact")
.WithMany()
.HasForeignKey("ContactId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Contact");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.ContactNote", b =>
{
b.HasOne("Marco.Pms.Model.Directory.Contact", "Contact")
.WithMany()
.HasForeignKey("ContactId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Employees.Employee", "Createdby")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Contact");
b.Navigation("Createdby");
b.Navigation("Tenant");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.ContactPhone", b =>
{
b.HasOne("Marco.Pms.Model.Directory.Contact", "Contact")
.WithMany()
.HasForeignKey("ContactId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Contact");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.ContactTagMapping", b =>
{
b.HasOne("Marco.Pms.Model.Directory.Contact", "Contact")
.WithMany()
.HasForeignKey("ContactId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Directory.ContactTagMaster", "ContactTag")
.WithMany()
.HasForeignKey("ContactTagId");
b.Navigation("Contact");
b.Navigation("ContactTag");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.ContactTagMaster", b =>
{
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Tenant");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.DirectoryUpdateLog", b =>
{
b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Employee");
});
modelBuilder.Entity("Marco.Pms.Model.Directory.EmployeeBucketMapping", b =>
{
b.HasOne("Marco.Pms.Model.Directory.Bucket", "Bucket")
.WithMany()
.HasForeignKey("BucketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee")
.WithMany()
.HasForeignKey("EmployeeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Bucket");
b.Navigation("Employee");
});
modelBuilder.Entity("Marco.Pms.Model.DocumentManager.Document", b =>
{
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")

View File

@ -44,7 +44,7 @@ namespace Marco.Pms.Model.Mapper
Id = contact.Id,
ProjectId = contact.ProjectId,
Name = contact.Name,
ContactType = contact.ContactCategory != null ? contact.ContactCategory.ToContactTypeVMFromContactTypeMaster() : new ContactCategoryVM(),
ContactType = contact.ContactCategory != null ? contact.ContactCategory.ToContactCategoryVMFromContactCategoryMaster() : new ContactCategoryVM(),
Description = contact.Description ?? string.Empty,
Organization = contact.Organization ?? string.Empty,
Address = contact.Address ?? string.Empty