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;
using Marco.Pms.Model.Expenses;
using Marco.Pms.Model.Forum;
using Marco.Pms.Model.Mail;
using Marco.Pms.Model.Master;
using Marco.Pms.Model.OrganizationModel;
using Marco.Pms.Model.Projects;
using Marco.Pms.Model.Roles;
using Marco.Pms.Model.TenantModels;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using System.Globalization;

namespace Marco.Pms.DataAccess.Data
{
    public class ApplicationDbContext : IdentityDbContext<IdentityUser>
    {
        private readonly IHttpContextAccessor _httpContextAccessor;

        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options, IHttpContextAccessor httpContextAccessor) : base(options)
        {
            _httpContextAccessor = httpContextAccessor;

        }

        public DbSet<RefreshToken> RefreshTokens { get; set; }
        public DbSet<TenantStatus> TenantStatus { get; set; }
        public DbSet<SubscriptionStatus> SubscriptionStatus { get; set; }
        public DbSet<Tenant> Tenants { get; set; }
        public DbSet<SubscriptionPlan> SubscriptionPlans { get; set; }
        public DbSet<SubscriptionPlanDetails> SubscriptionPlanDetails { get; set; }
        public DbSet<TenantSubscriptions> TenantSubscriptions { get; set; }
        public DbSet<ApplicationUser> ApplicationUsers { get; set; }
        public DbSet<ServiceMaster> ServiceMasters { get; set; }
        public DbSet<ActivityGroupMaster> ActivityGroupMasters { get; set; }
        public DbSet<ActivityMaster> ActivityMasters { get; set; }
        public DbSet<Project> Projects { get; set; }
        public DbSet<ProjectAllocation> ProjectAllocations { get; set; }
        public DbSet<StatusMaster> StatusMasters { get; set; }
        public DbSet<Building> Buildings { get; set; }
        public DbSet<Floor> Floor { get; set; }
        public DbSet<WorkArea> WorkAreas { get; set; }
        public DbSet<WorkItem> WorkItems { get; set; }
        public DbSet<WorkShift> WorkShifts { get; set; }
        public DbSet<TaskAllocation> TaskAllocations { get; set; }
        public DbSet<TaskComment> TaskComments { get; set; }
        public DbSet<TaskMembers> TaskMembers { get; set; }
        public DbSet<TaskAttachment> TaskAttachments { get; set; }
        public DbSet<Attendance> Attendes { get; set; }
        public DbSet<AttendanceLog> AttendanceLogs { get; set; }
        public DbSet<Employee> Employees { get; set; }
        public DbSet<EmployeeRoleMapping> EmployeeRoleMappings { get; set; }
        public DbSet<Module> Modules { get; set; }
        public DbSet<Feature> Features { get; set; }
        public DbSet<FeaturePermission> FeaturePermissions { get; set; }
        public DbSet<ProjectLevelPermissionMapping> ProjectLevelPermissionMappings { get; set; }
        public DbSet<CurrencyMaster> CurrencyMaster { get; set; }
        public DbSet<ApplicationRole> ApplicationRoles { get; set; }
        public DbSet<JobRole> JobRoles { get; set; }
        public DbSet<RolePermissionMappings> RolePermissionMappings { get; set; }
        public DbSet<Industry> Industries { get; set; }
        public DbSet<ActivityCheckList> ActivityCheckLists { get; set; }
        public DbSet<CheckListMappings> CheckListMappings { get; set; }
        public DbSet<Inquiries> Inquiries { get; set; }
        public DbSet<TicketForum> Tickets { get; set; }
        public DbSet<TicketAttachment> TicketAttachments { get; set; }
        public DbSet<TicketComment> TicketComments { get; set; }
        public DbSet<TicketStatusMaster> TicketStatusMasters { get; set; }
        public DbSet<TicketTypeMaster> TicketTypeMasters { get; set; }
        public DbSet<TicketPriorityMaster> TicketPriorityMasters { get; set; }
        public DbSet<TicketTagMaster> TicketTagMasters { get; set; }
        public DbSet<Document> Documents { get; set; }
        public DbSet<TicketTag> TicketTags { get; set; }
        public DbSet<WorkCategoryMaster> WorkCategoryMasters { get; set; }
        public DbSet<WorkStatusMaster> WorkStatusMasters { 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<ContactProjectMapping> ContactProjectMappings { 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; }
        public DbSet<OTPDetails> OTPDetails { get; set; }
        public DbSet<MPINDetails> MPINDetails { get; set; }

        public DbSet<Expenses> Expenses { get; set; }
        public DbSet<ExpenseLog> ExpenseLogs { get; set; }
        public DbSet<ExpensesTypeMaster> ExpensesTypeMaster { get; set; }
        public DbSet<PaymentModeMatser> PaymentModeMatser { get; set; }
        public DbSet<ExpensesStatusMaster> ExpensesStatusMaster { get; set; }
        public DbSet<BillAttachments> BillAttachments { get; set; }
        public DbSet<ExpensesReimburse> ExpensesReimburse { get; set; }
        public DbSet<ExpensesReimburseMapping> ExpensesReimburseMapping { get; set; }
        public DbSet<StatusPermissionMapping> StatusPermissionMapping { get; set; }
        public DbSet<ExpensesStatusMapping> ExpensesStatusMapping { get; set; }

        public DbSet<FCMTokenMapping> FCMTokenMappings { get; set; }

        public DbSet<EntityTypeMaster> EntityTypeMasters { get; set; }
        public DbSet<DocumentTypeMaster> DocumentTypeMasters { get; set; }
        public DbSet<DocumentCategoryMaster> DocumentCategoryMasters { get; set; }
        public DbSet<DocumentTagMaster> DocumentTagMasters { get; set; }
        public DbSet<DocumentAttachment> DocumentAttachments { get; set; }
        public DbSet<AttachmentVersionMapping> AttachmentVersionMappings { get; set; }
        public DbSet<AttachmentTagMapping> AttachmentTagMappings { get; set; }

        public DbSet<GlobalServiceMaster> GlobalServiceMasters { get; set; }
        public DbSet<GlobalActivityGroupMaster> GlobalActivityGroupMasters { get; set; }
        public DbSet<GlobalActivityMaster> GlobalActivityMasters { get; set; }

        public DbSet<Organization> Organizations { get; set; }
        public DbSet<OrgTypeMaster> OrgTypeMasters { get; set; }
        public DbSet<TenantOrgMapping> TenantOrgMappings { get; set; }
        public DbSet<OrgServiceMapping> OrgServiceMappings { get; set; }
        public DbSet<ProjectServiceMapping> ProjectServiceMappings { get; set; }
        public DbSet<ProjectOrgMapping> ProjectOrgMappings { get; set; }


        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            ManageApplicationStructure(modelBuilder);

            modelBuilder.Entity<RefreshToken>(entity =>
            {
                entity.HasKey(e => e.Id);
                entity.HasOne(e => e.User)
                      .WithMany()
                      .HasForeignKey(e => e.UserId)
                      .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity<TenantStatus>().HasData(
                new TenantStatus
                {
                    Id = Guid.Parse("62b05792-5115-4f99-8ff5-e8374859b191"),
                    Name = "Active"
                },
                new TenantStatus
                {
                    Id = Guid.Parse("35d7840a-164a-448b-95e6-efb2ec84a751"),
                    Name = "Suspended"
                },
                new TenantStatus
                {
                    Id = Guid.Parse("c0b5def8-087e-4235-b3a4-8e2f0ed91b94"),
                    Name = "In Active"
                }
                );

            modelBuilder.Entity<Organization>().HasData(
                new Organization
                {
                    Id = Guid.Parse("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea"),
                    Name = "MarcoBMS",
                    ContactPerson = "Admin",
                    Email = "admin@marcoaiot.com",
                    ContactNumber = "123456789",
                    Address = "2nd Floor, Fullora Building, Tejas CHS, behind Kothrud Stand, Tejas Society, Dahanukar Colony, Kothrud, Pune, Maharashtra 411038",
                    CreatedAt = DateTime.MinValue,
                    SPRID = 5400,
                    IsActive = true
                }
                );

            modelBuilder.Entity<Tenant>().HasData(
                new Tenant
                {
                    Id = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26"),
                    OrganizationSize = "100-200",
                    Email = "admin@marcoaiot.com",
                    Name = "MarcoBMS",
                    ContactName = "Admin",
                    ContactNumber = "123456789",
                    Description = "",
                    DomainName = "www.marcobms.org",
                    TenantStatusId = Guid.Parse("62b05792-5115-4f99-8ff5-e8374859b191"),
                    IndustryId = Guid.Parse("15436ee3-a650-469e-bfc2-59993f7514bb"),
                    OrganizationId = Guid.Parse("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea"),
                    BillingAddress = "2nd Floor, Fullora Building, Tejas CHS, behind Kothrud Stand, Tejas Society, Dahanukar Colony, Kothrud, Pune, Maharashtra 411038",
                    OnBoardingDate = DateTime.MinValue,
                    IsSuperTenant = true,
                    logoImage = "data:image/jpeg;base64,[encoded data, 213816 characters]",
                    Reference = "Root Tenant"
                }
                );

            modelBuilder.Entity<StatusMaster>().HasData(
                new StatusMaster
                {
                    Id = new Guid("b74da4c2-d07e-46f2-9919-e75e49b12731"),
                    Status = "Active"
                },
                 new StatusMaster
                 {
                     Id = new Guid("cdad86aa-8a56-4ff4-b633-9c629057dfef"),
                     Status = "In Progress"
                 }, new StatusMaster
                 {
                     Id = new Guid("603e994b-a27f-4e5d-a251-f3d69b0498ba"),
                     Status = "On Hold"
                 },
                  new StatusMaster
                  {
                      Id = new Guid("ef1c356e-0fe0-42df-a5d3-8daee355492d"),
                      Status = "In Active"
                  },
                   new StatusMaster
                   {
                       Id = new Guid("33deaef9-9af1-4f2a-b443-681ea0d04f81"),
                       Status = "Completed"
                   }
                );

            modelBuilder.Entity<Project>().HasData(
                new Project
                {
                    Id = new Guid("85bf587b-7ca9-4685-b77c-d817f5847e85"),
                    Name = "Project 1",
                    ProjectAddress = "Project 1 Address",
                    ContactPerson = "Project 1 Contact Person",
                    StartDate = DateTime.ParseExact("2025-04-20 10:11:17.588000", "yyyy-MM-dd HH:mm:ss.ffffff", CultureInfo.InvariantCulture),
                    EndDate = DateTime.ParseExact("2026-04-20 10:11:17.588000", "yyyy-MM-dd HH:mm:ss.ffffff", CultureInfo.InvariantCulture),
                    ProjectStatusId = new Guid("b74da4c2-d07e-46f2-9919-e75e49b12731"),
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                }
                );


            var tenantId = _httpContextAccessor.HttpContext?.Items["TenantId"]?.ToString();

            modelBuilder.Entity<Industry>().HasData(
                new Industry { Id = Guid.Parse("15436ee3-a650-469e-bfc2-59993f7514bb"), Name = "Information Technology (IT) Services" },
                new Industry { Id = Guid.Parse("0a63e657-2c5f-49b5-854b-42c978293154"), Name = "Manufacturing & Production" },
                new Industry { Id = Guid.Parse("bdc61e3b-69ea-4394-bab6-079ec135b5bd"), Name = "Energy & Resources" },
                new Industry { Id = Guid.Parse("5ca200ac-00d7-415e-a410-b948e27ac9d2"), Name = "Finance & Professional Services" },
                new Industry { Id = Guid.Parse("d5621700-cd87-441f-8cdb-6051ddfc83b4"), Name = "Hospitals and Healthcare Services" },
                new Industry { Id = Guid.Parse("23608891-657e-40f0-bbd4-2b0a2ec1a76f"), Name = "Social Services" },
                new Industry { Id = Guid.Parse("a493f4e3-16b1-4411-be3c-6bf2987a3168"), Name = "Retail & Consumer Services" },
                new Industry { Id = Guid.Parse("e9d8ce92-9371-4ed9-9831-83c07f78edec"), Name = "Transportation & Logistics" },
                new Industry { Id = Guid.Parse("8a0d6134-2dbe-4e0a-b250-ff34cb7b9df0"), Name = "Education & Training" }

                );

            modelBuilder.Entity<TicketStatusMaster>().HasData(
                new TicketStatusMaster
                {
                    Id = new Guid("6b0c409b-3e80-4165-8b39-f3fcacb4c797"),
                    Name = "New",
                    Description = "This is a newly created issue.",
                    ColorCode = "#FFCC99",
                    IsDefault = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new TicketStatusMaster
                {
                    Id = new Guid("6c5ac37d-5b7d-40f3-adec-2dabaa5cca86"),
                    Name = "Assigned",
                    Description = "Assigned to employee or team of employees",
                    ColorCode = "#E6FF99",
                    IsDefault = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new TicketStatusMaster
                {
                    Id = new Guid("7f96bcd5-0c66-411b-8a1d-9d1a4785194e"),
                    Name = "In Progress",
                    Description = "These issues are currently in progress",
                    ColorCode = "#99E6FF",
                    IsDefault = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new TicketStatusMaster
                {
                    Id = new Guid("5c72b630-6923-4215-bf2c-b1622afd76e7"),
                    Name = "In Review",
                    Description = "These issues are currently under review",
                    ColorCode = "#8592a3",
                    IsDefault = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new TicketStatusMaster
                {
                    Id = new Guid("8ff85685-a875-4f21-aa95-d99551315fcc"),
                    Name = "Done",
                    Description = "The following issues are resolved and closed",
                    ColorCode = "#B399FF",
                    IsDefault = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                }
            );

            modelBuilder.Entity<TicketTypeMaster>().HasData(
                new TicketTypeMaster
                {
                    Id = new Guid("c74e5480-2b71-483c-8f4a-1a9c69c32603"),
                    Name = "Quality Issue",
                    Description = "An identified problem that affects the performance, reliability, or standards of a product or service",
                    IsDefault = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new TicketTypeMaster
                {
                    Id = new Guid("d1f55eab-9898-4e46-9f03-b263e33e5d38"),
                    Name = "Help Desk",
                    Description = "A support service that assists users with technical issues, requests, or inquiries.",
                    IsDefault = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                }
                );

            modelBuilder.Entity<TicketPriorityMaster>().HasData(
                new TicketPriorityMaster
                {
                    Id = new Guid("188d29b3-10f3-42d0-9587-1a46ae7a0320"),
                    Name = "Low",
                    ColorCode = "008000",
                    Level = 1,
                    IsDefault = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new TicketPriorityMaster
                {
                    Id = new Guid("0919bc84-9f82-4ecf-98c7-962755dd9a97"),
                    Name = "Medium",
                    ColorCode = "FFFF00",
                    Level = 2,
                    IsDefault = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new TicketPriorityMaster
                {
                    Id = new Guid("a13b7e59-16fd-4665-b5cf-a97399e8445a"),
                    Name = "High",
                    ColorCode = "#FFA500",
                    Level = 3,
                    IsDefault = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new TicketPriorityMaster
                {
                    Id = new Guid("f340fbc3-c9fd-46aa-b063-0093418830e4"),
                    Name = "Critical",
                    ColorCode = "#FFA500",
                    Level = 4,
                    IsDefault = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new TicketPriorityMaster
                {
                    Id = new Guid("44a7b91d-a0dd-45d1-8616-4d2f71e16401"),
                    Name = "Urgent",
                    ColorCode = "#FF0000",
                    Level = 5,
                    IsDefault = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                }
                );

            modelBuilder.Entity<TicketTagMaster>().HasData(
                new TicketTagMaster
                {
                    Id = new Guid("ef6c2a65-f61d-4537-9650-a7ab7f8d98db"),
                    Name = "Quality Issue",
                    ColorCode = "#e59866",
                    IsDefault = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new TicketTagMaster
                {
                    Id = new Guid("5a168569-8ad7-4422-8db6-51ef25caddeb"),
                    Name = "Help Desk",
                    ColorCode = "#85c1e9",
                    IsDefault = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                }
                );

            modelBuilder.Entity<WorkCategoryMaster>().HasData(
                new WorkCategoryMaster
                {
                    Id = new Guid("86bb2cc8-f6b5-4fdd-bbee-c389c713a44b"),
                    Name = "Fresh Work",
                    Description = "Created new task in a professional or creative context",
                    IsSystem = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new WorkCategoryMaster
                {
                    Id = new Guid("9ebfa19c-53b9-481b-b863-c25d2f843201"),
                    Name = "Rework",
                    Description = "Revising, modifying, or correcting a task to improve its quality or fix issues",
                    IsSystem = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new WorkCategoryMaster
                {
                    Id = new Guid("11a79929-1d07-42dc-9e98-82d0d2f4a240"),
                    Name = "Quality Issue",
                    Description = "Any defect, deviation, or non-conformance in a task that fails to meet established standards or customer expectations.",
                    IsSystem = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                }
                );

            modelBuilder.Entity<WorkStatusMaster>().HasData(
                new WorkStatusMaster
                {
                    Id = new Guid("030bb085-e230-4370-aec7-9a74d652864e"),
                    Name = "Approve",
                    Description = "Confirm the tasks are actually finished as reported",
                    IsSystem = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new WorkStatusMaster
                {
                    Id = new Guid("2a1a5b96-cf93-4111-b4b1-76c19d6333b4"),
                    Name = "Partially Approve",
                    Description = "Not all tasks are actually finished as reported",
                    IsSystem = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new WorkStatusMaster
                {
                    Id = new Guid("00a062e6-62e6-42c5-b6b1-024328651b72"),
                    Name = "NCR",
                    Description = "Tasks are not finished as reported or have any issues in al the tasks",
                    IsSystem = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                }
                );

        }

        private static void ManageApplicationStructure(ModelBuilder modelBuilder)
        {
            // Configure ApplicationRole to Tenant relationship (if Tenant exists)
            modelBuilder.Entity<ApplicationRole>()
                .HasOne<Tenant>() // No navigation property in ApplicationRole
                .WithMany()
                .HasForeignKey(ar => ar.TenantId);
            // Configure the relationship between ApplicationRole and FeaturePermission via a join table
            modelBuilder.Entity<RolePermissionMappings>(entity =>
            {
                entity.HasKey(rfp => new { rfp.ApplicationRoleId, rfp.FeaturePermissionId });

                entity.HasOne<ApplicationRole>()
                    .WithMany()
                    .HasForeignKey(rfp => rfp.ApplicationRoleId);

                entity.HasOne<FeaturePermission>()
                    .WithMany()
                    .HasForeignKey(rfp => rfp.FeaturePermissionId);
            });



            modelBuilder.Entity<ExpensesStatusMaster>().HasData(
                new ExpensesStatusMaster
                {
                    Id = Guid.Parse("297e0d8f-f668-41b5-bfea-e03b354251c8"),
                    Name = "Draft",
                    DisplayName = "Draft",
                    Description = "Expense has been created but not yet submitted.",
                    Color = "#8592a3",
                    IsSystem = true,
                    IsActive = true
                },
                new ExpensesStatusMaster
                {
                    Id = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7"),
                    Name = "Review Pending",
                    DisplayName = "Submit",
                    Description = "Reviewer is currently reviewing the expense.",
                    Color = "#696cff",
                    IsSystem = true,
                    IsActive = true
                },
                new ExpensesStatusMaster
                {
                    Id = Guid.Parse("965eda62-7907-4963-b4a1-657fb0b2724b"),
                    Name = "Rejected by Reviewer",
                    DisplayName = "Reject",
                    Description = "Expense was declined, often with a reason(review rejected).",
                    Color = "#ff3e1d",
                    IsSystem = true,
                    IsActive = true
                },
                new ExpensesStatusMaster
                {
                    Id = Guid.Parse("4068007f-c92f-4f37-a907-bc15fe57d4d8"),
                    Name = "Approval Pending",
                    DisplayName = "Mark as Reviewed",
                    Description = "Review is completed, waiting for action of approver.",
                    Color = "#03c3ec",
                    IsSystem = true,
                    IsActive = true
                },
                new ExpensesStatusMaster
                {
                    Id = Guid.Parse("d1ee5eec-24b6-4364-8673-a8f859c60729"),
                    Name = "Rejected by Approver",
                    DisplayName = "Reject",
                    Description = "Expense was declined, often with a reason(approval rejected).",
                    Color = "#ff3e1d",
                    IsSystem = true,
                    IsActive = true
                },
                new ExpensesStatusMaster
                {
                    Id = Guid.Parse("f18c5cfd-7815-4341-8da2-2c2d65778e27"),
                    Name = "Payment Pending",
                    DisplayName = "Mark as Approved",
                    Description = "Approved expense is awaiting final payment.",
                    Color = "#ffab00",
                    IsSystem = true,
                    IsActive = true
                },
                new ExpensesStatusMaster
                {
                    Id = Guid.Parse("61578360-3a49-4c34-8604-7b35a3787b95"),
                    Name = "Processed",
                    DisplayName = "Mark as Processed",
                    Description = "Expense has been settled.",
                    Color = "#71dd37",
                    IsSystem = true,
                    IsActive = true
                }
                );

            modelBuilder.Entity<ExpensesStatusMapping>().HasData(
                // Process to processed
                new ExpensesStatusMapping
                {
                    Id = Guid.Parse("5cf7f1df-9d1f-4289-add0-1775ad614f25"),
                    StatusId = Guid.Parse("f18c5cfd-7815-4341-8da2-2c2d65778e27"),
                    NextStatusId = Guid.Parse("61578360-3a49-4c34-8604-7b35a3787b95")
                },
                // Rejected by Approver to Review
                new ExpensesStatusMapping
                {
                    Id = Guid.Parse("4ddddc10-0ffd-4884-accf-d4fa0bd97f54"),
                    StatusId = Guid.Parse("d1ee5eec-24b6-4364-8673-a8f859c60729"),
                    NextStatusId = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7")
                },
                // Approve to Rejected by Approver
                new ExpensesStatusMapping
                {
                    Id = Guid.Parse("36c00548-241c-43ec-bc95-cacebedb925c"),
                    StatusId = Guid.Parse("4068007f-c92f-4f37-a907-bc15fe57d4d8"),
                    NextStatusId = Guid.Parse("d1ee5eec-24b6-4364-8673-a8f859c60729")
                },
                // Approve to Process
                new ExpensesStatusMapping
                {
                    Id = Guid.Parse("1fca1700-1266-477d-bba4-9ac3753aa33c"),
                    StatusId = Guid.Parse("4068007f-c92f-4f37-a907-bc15fe57d4d8"),
                    NextStatusId = Guid.Parse("f18c5cfd-7815-4341-8da2-2c2d65778e27")
                },
                // Rejected by Reviewer to Review
                new ExpensesStatusMapping
                {
                    Id = Guid.Parse("9e2ec648-1ca2-4747-9329-e911b18edb3e"),
                    StatusId = Guid.Parse("965eda62-7907-4963-b4a1-657fb0b2724b"),
                    NextStatusId = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7")
                },
                // Review to Rejected by Reviewer
                new ExpensesStatusMapping
                {
                    Id = Guid.Parse("6b867bec-66e6-42a7-9611-f4595af9b9ce"),
                    StatusId = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7"),
                    NextStatusId = Guid.Parse("965eda62-7907-4963-b4a1-657fb0b2724b")
                },
                // Review to Aprrove
                new ExpensesStatusMapping
                {
                    Id = Guid.Parse("ef1fcfbc-60e0-4f17-9308-c583a05d48fd"),
                    StatusId = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7"),
                    NextStatusId = Guid.Parse("4068007f-c92f-4f37-a907-bc15fe57d4d8")
                },
                // Draft to Review
                new ExpensesStatusMapping
                {
                    Id = Guid.Parse("af1e4492-98ee-4451-8ab7-fd8323f29c32"),
                    StatusId = Guid.Parse("297e0d8f-f668-41b5-bfea-e03b354251c8"),
                    NextStatusId = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7")
                }
                );

            modelBuilder.Entity<StatusPermissionMapping>().HasData(
                // Draft Permission Mapping
                new StatusPermissionMapping
                {
                    Id = Guid.Parse("722b0c3c-5a78-456d-b9bb-b6ba1b21d59b"),
                    PermissionId = Guid.Parse("0f57885d-bcb2-4711-ac95-d841ace6d5a7"),
                    StatusId = Guid.Parse("297e0d8f-f668-41b5-bfea-e03b354251c8")
                },
                // Review Permission Mapping
                new StatusPermissionMapping
                {
                    Id = Guid.Parse("7deb0945-e1c9-411f-8b3c-c9bdbe3c3c2d"),
                    PermissionId = Guid.Parse("0f57885d-bcb2-4711-ac95-d841ace6d5a7"),
                    StatusId = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7")
                },
                // Rejected by Reviewer Permission Mapping
                new StatusPermissionMapping
                {
                    Id = Guid.Parse("9e2ec648-1ca2-4747-9329-e911b18edb3e"),
                    PermissionId = Guid.Parse("1f4bda08-1873-449a-bb66-3e8222bd871b"),
                    StatusId = Guid.Parse("965eda62-7907-4963-b4a1-657fb0b2724b")
                },
                // Approval Pending Permission Mapping
                new StatusPermissionMapping
                {
                    Id = Guid.Parse("0b7926fc-a34b-4a5b-8c7d-1003480cf0fa"),
                    PermissionId = Guid.Parse("1f4bda08-1873-449a-bb66-3e8222bd871b"),
                    StatusId = Guid.Parse("4068007f-c92f-4f37-a907-bc15fe57d4d8")
                },
                // Rejected by Approver Permission Mapping
                new StatusPermissionMapping
                {
                    Id = Guid.Parse("cd15f9b9-be45-4deb-9c71-2f23f872dbcd"),
                    PermissionId = Guid.Parse("eaafdd76-8aac-45f9-a530-315589c6deca"),
                    StatusId = Guid.Parse("d1ee5eec-24b6-4364-8673-a8f859c60729")
                },
                // Payment Pending Permission Mapping
                new StatusPermissionMapping
                {
                    Id = Guid.Parse("f6f26b2f-2fa6-40b7-8601-cbd4bcdda0cc"),
                    PermissionId = Guid.Parse("eaafdd76-8aac-45f9-a530-315589c6deca"),
                    StatusId = Guid.Parse("f18c5cfd-7815-4341-8da2-2c2d65778e27")
                },
                // Processed Permission Mapping
                new StatusPermissionMapping
                {
                    Id = Guid.Parse("214354e5-daad-4569-ad69-eb5bf4e87fbc"),
                    PermissionId = Guid.Parse("ea5a1529-4ee8-4828-80ea-0e23c9d4dd11"),
                    StatusId = Guid.Parse("61578360-3a49-4c34-8604-7b35a3787b95")
                });

            modelBuilder.Entity<ExpensesTypeMaster>().HasData(
                new ExpensesTypeMaster
                {
                    Id = Guid.Parse("5e0c6227-d49d-41ff-9f1f-781f0aee2469"),
                    Name = "Procurement",
                    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
                {
                    Id = Guid.Parse("2de53163-0dbd-404b-8e60-1b02e6b4886a"),
                    Name = "Transport",
                    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
                {
                    Id = Guid.Parse("dd120bc4-ab0a-45ba-8450-5cd45ff221ca"),
                    Name = "Travelling",
                    Description = "Delivery of personnel.",
                    NoOfPersonsRequired = true,
                    IsActive = true,
                    IsAttachmentRequried = false,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new ExpensesTypeMaster
                {
                    Id = Guid.Parse("52484820-1b54-4865-8f0f-baa2b1d339b9"),
                    Name = "Mobilization",
                    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
                {
                    Id = Guid.Parse("fc59eb90-98ea-481c-b421-54bfa9e42d8f"),
                    Name = "Employee Welfare",
                    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
                {
                    Id = Guid.Parse("77013784-9324-4d8b-bd36-d6f928e68942"),
                    Name = "Maintenance & Utilities",
                    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
                {
                    Id = Guid.Parse("1e2d697a-76b4-4be8-bc66-87144561a1a0"),
                    Name = "Vendor/Supplier Payments",
                    Description = "Scheduled payments for external services or goods.",
                    NoOfPersonsRequired = false,
                    IsActive = true,
                    IsAttachmentRequried = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new ExpensesTypeMaster
                {
                    Id = Guid.Parse("4842fa61-64eb-4241-aebd-8282065af9f9"),
                    Name = "Compliance & Safety",
                    Description = "Government fees, insurance, inspections and safety-related expenditures.",
                    NoOfPersonsRequired = false,
                    IsActive = true,
                    IsAttachmentRequried = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                }
                );

            modelBuilder.Entity<PaymentModeMatser>().HasData(
                new PaymentModeMatser
                {
                    Id = Guid.Parse("24e6b0df-7929-47d2-88a3-4cf14c1f28f9"),
                    Name = "Cash",
                    Description = "Physical currency; still used for small or informal transactions.",
                    IsActive = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new PaymentModeMatser
                {
                    Id = Guid.Parse("48d9b462-5d87-4dec-8dec-2bc943943172"),
                    Name = "Cheque",
                    Description = "Paper-based payment order; less common now due to processing delays and fraud risks.",
                    IsActive = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new PaymentModeMatser
                {
                    Id = Guid.Parse("ed667353-8eea-4fd1-8750-719405932480"),
                    Name = "NetBanking",
                    Description = "Online banking portals used to transfer funds directly between accounts",
                    IsActive = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new PaymentModeMatser
                {
                    Id = Guid.Parse("2e919e94-694c-41d9-9489-0a2b4208a027"),
                    Name = "UPI",
                    Description = "Real-time bank-to-bank transfer using mobile apps; widely used for peer-to-peer and merchant payments.",
                    IsActive = true,
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                }
                );

            modelBuilder.Entity<EntityTypeMaster>().HasData(
                new EntityTypeMaster
                {
                    Id = Guid.Parse("c8fe7115-aa27-43bc-99f4-7b05fabe436e"),
                    Name = "Project Entity",
                    Description = "Emtities related to project."
                },
                new EntityTypeMaster
                {
                    Id = Guid.Parse("dbb9555a-7a0c-40f2-a9ed-f0463f1ceed7"),
                    Name = "Employee Entity",
                    Description = "Employee related entitie",
                }
                );

            modelBuilder.Entity<DocumentCategoryMaster>().HasData(
                new DocumentCategoryMaster
                {
                    Id = Guid.Parse("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
                    Name = "Project Documents",
                    Description = "Project documents are formal records that outline the plans, progress, and details necessary to execute and manage a project effectively.",
                    EntityTypeId = Guid.Parse("c8fe7115-aa27-43bc-99f4-7b05fabe436e"),
                    CreatedAt = new DateTime(2025, 9, 15, 12, 42, 3, 202, DateTimeKind.Utc),
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new DocumentCategoryMaster
                {
                    Id = Guid.Parse("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
                    Name = "Employee Documents",
                    Description = "Employment details along with legal IDs like passports or driver’s licenses to verify identity and work authorization.",
                    EntityTypeId = Guid.Parse("dbb9555a-7a0c-40f2-a9ed-f0463f1ceed7"),
                    CreatedAt = new DateTime(2025, 9, 15, 12, 42, 3, 202, DateTimeKind.Utc),
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                }
             );

            modelBuilder.Entity<DocumentTypeMaster>().HasData(
                new DocumentTypeMaster
                {
                    Id = Guid.Parse("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
                    Name = "Aadhaar card",
                    RegexExpression = "^[2-9][0-9]{11}$",
                    AllowedContentType = "application/pdf,image/jpeg",
                    MaxSizeAllowedInMB = 2,
                    IsValidationRequired = true,
                    IsMandatory = true,
                    CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
                    IsSystem = true,
                    IsActive = true,
                    DocumentCategoryId = Guid.Parse("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new DocumentTypeMaster
                {
                    Id = Guid.Parse("6344393b-9bb1-45f8-b620-9f6e279d012c"),
                    Name = "Pan Card",
                    RegexExpression = "^[A-Z]{5}[0-9]{4}[A-Z]{1}$",
                    AllowedContentType = "application/pdf,image/jpeg",
                    MaxSizeAllowedInMB = 2,
                    IsValidationRequired = true,
                    IsMandatory = true,
                    CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
                    IsSystem = true,
                    IsActive = true,
                    DocumentCategoryId = Guid.Parse("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new DocumentTypeMaster
                {
                    Id = Guid.Parse("2d1d7441-46a8-425e-9395-94d0956f8e91"),
                    Name = "Voter Card",
                    RegexExpression = "^[A-Z]{3}[0-9]{7}$",
                    AllowedContentType = "application/pdf,image/jpeg",
                    MaxSizeAllowedInMB = 2,
                    IsValidationRequired = true,
                    IsMandatory = true,
                    CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
                    IsSystem = true,
                    IsActive = true,
                    DocumentCategoryId = Guid.Parse("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new DocumentTypeMaster
                {
                    Id = Guid.Parse("16c40b80-c207-4a0c-a4d3-381414afe35a"),
                    Name = "Passport",
                    RegexExpression = "^[A-PR-WY][1-9]\\d\\s?\\d{4}[1-9]$",
                    AllowedContentType = "application/pdf,image/jpeg",
                    MaxSizeAllowedInMB = 2,
                    IsValidationRequired = true,
                    IsMandatory = true,
                    CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
                    IsSystem = true,
                    IsActive = true,
                    DocumentCategoryId = Guid.Parse("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new DocumentTypeMaster
                {
                    Id = Guid.Parse("f76d8215-d399-4f0e-b414-12e427f50be3"),
                    Name = "Bank Passbook",
                    RegexExpression = "^\\d{9,18}$",
                    AllowedContentType = "application/pdf,image/jpeg",
                    MaxSizeAllowedInMB = 2,
                    IsValidationRequired = true,
                    IsMandatory = true,
                    CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
                    IsSystem = true,
                    IsActive = true,
                    DocumentCategoryId = Guid.Parse("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },

                new DocumentTypeMaster
                {
                    Id = Guid.Parse("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
                    Name = "Bill of Quantities (BOQ)",
                    AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
                    MaxSizeAllowedInMB = 1,
                    IsValidationRequired = false,
                    IsMandatory = false,
                    CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
                    IsSystem = true,
                    IsActive = true,
                    DocumentCategoryId = Guid.Parse("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new DocumentTypeMaster
                {
                    Id = Guid.Parse("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
                    Name = "Work Order",
                    AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
                    MaxSizeAllowedInMB = 1,
                    IsValidationRequired = false,
                    IsMandatory = false,
                    CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
                    IsSystem = true,
                    IsActive = true,
                    DocumentCategoryId = Guid.Parse("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new DocumentTypeMaster
                {
                    Id = Guid.Parse("07ca7182-9ac0-4407-b988-59901170cb86"),
                    Name = "Letter of Agreement",
                    AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
                    MaxSizeAllowedInMB = 1,
                    IsValidationRequired = false,
                    IsMandatory = false,
                    CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
                    IsSystem = true,
                    IsActive = true,
                    DocumentCategoryId = Guid.Parse("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new DocumentTypeMaster
                {
                    Id = Guid.Parse("846e89a9-5735-45ec-a21d-c97f85a94ada"),
                    Name = "Health and Safety Document",
                    AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
                    MaxSizeAllowedInMB = 1,
                    IsValidationRequired = false,
                    IsMandatory = false,
                    CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
                    IsSystem = true,
                    IsActive = true,
                    DocumentCategoryId = Guid.Parse("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new DocumentTypeMaster
                {
                    Id = Guid.Parse("7cc41c91-23cb-442b-badd-f932138d149f"),
                    Name = "Standard Operating Procedure (SOP)",
                    AllowedContentType = "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
                    MaxSizeAllowedInMB = 1,
                    IsValidationRequired = false,
                    IsMandatory = false,
                    CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
                    IsSystem = true,
                    IsActive = true,
                    DocumentCategoryId = Guid.Parse("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                },
                new DocumentTypeMaster
                {
                    Id = Guid.Parse("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
                    Name = "Drawings",
                    AllowedContentType = "application/pdf,image/vnd.dwg,application/acad",
                    MaxSizeAllowedInMB = 20,
                    IsValidationRequired = false,
                    IsMandatory = false,
                    CreatedAt = new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc),
                    IsSystem = true,
                    IsActive = true,
                    DocumentCategoryId = Guid.Parse("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
                    TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
                }
                );

            modelBuilder.Entity<SubscriptionStatus>().HasData(
                new SubscriptionStatus
                {
                    Id = Guid.Parse("cd3a68ea-41fd-42f0-bd0c-c871c7337727"),
                    Name = "Active"
                },
                new SubscriptionStatus
                {
                    Id = Guid.Parse("4ed487b1-af22-4e25-aecd-b63fd850cf2d"),
                    Name = "InActive"
                },
                new SubscriptionStatus
                {
                    Id = Guid.Parse("1c0e422e-01b6-412f-b72a-1db004cc8a7f"),
                    Name = "Suspended"
                }
                );

            modelBuilder.Entity<OrgTypeMaster>().HasData(
               new OrgTypeMaster
               {
                   Id = Guid.Parse("5ee49bcd-b6d3-482f-9aaf-484afe04abec"),
                   Name = "Service Provider"
               },
               new OrgTypeMaster
               {
                   Id = Guid.Parse("a283356a-9b02-4029-afb7-e65c703efdd4"),
                   Name = "Sub-Contractor"
               }
           );

            modelBuilder.Entity<Module>().HasData(
                new Module
                {
                    Id = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"),
                    Name = "Project",
                    Description = "Project Module",
                    Key = "b04da7e9-0406-409c-ac7f-b97256e6ea02"
                },
                new Module
                {
                    Id = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"),
                    Name = "Employee",
                    Description = "Employee Module",
                    Key = "0971c7fb-6ce1-458a-ae3f-8d3205893637"
                },
                new Module
                {
                    Id = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"),
                    Name = "Masters",
                    Description = "Masters Module",
                    Key = "504ec132-e6a9-422f-8f85-050602cfce05"
                },
                new Module
                {
                    Id = new Guid("f482a079-4dec-4f2d-9867-6baf2a4f23d9"),
                    Name = "Tenant",
                    Description = "Tenant Module",
                    Key = "504ec132-e6a9-422f-8f85-050602cfce05"
                });

            modelBuilder.Entity<Feature>().HasData(
                // Project Module
                new Feature { Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), Description = "Manage Project", Name = "Project Management", ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), IsActive = true },
                new Feature { Id = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), Description = "Expense Management is the systematic process of tracking, controlling, and reporting business-related expenditures.", Name = "Expense Management", ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), IsActive = true },
                new Feature { Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), Description = "Manage Tasks", Name = "Task Management", ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), IsActive = true },

                // Employee Module
                new Feature { Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), Description = "Manage Employee", Name = "Employee Management", ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), IsActive = true },
                new Feature { Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), Description = "Attendance", Name = "Attendance Management", ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), IsActive = true },
                new Feature { Id = new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), Description = "Manage Document", Name = "Document Management", ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), IsActive = true },

                // Master Module
                new Feature { Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), Description = "Global Masters", Name = "Masters", ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), IsActive = true },
                new Feature { Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), Description = "Managing all directory related rights", Name = "Directory Management", ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), IsActive = true },
                new Feature { Id = new Guid("6d4c82d6-dbce-48ab-b8b8-f785f4d8c914"), Description = "Managing all organization related rights", Name = "Organization Management", ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), IsActive = true },

                // Tenant Module
                new Feature { Id = new Guid("2f3509b7-160d-410a-b9b6-daadd96c986d"), Description = "Managing all tenant related rights", Name = "Tenant Management", ModuleId = new Guid("f482a079-4dec-4f2d-9867-6baf2a4f23d9"), IsActive = true }
             );

            modelBuilder.Entity<FeaturePermission>().HasData(
                new FeaturePermission { Id = new Guid("d032cb1a-3f30-462c-bef0-7ace73a71c0b"), FeatureId = new Guid("2f3509b7-160d-410a-b9b6-daadd96c986d"), IsEnabled = true, Name = "Manage Tenants", Description = "Able add, modify and suspend any tenant." },
                new FeaturePermission { Id = new Guid("00e20637-ce8d-4417-bec4-9b31b5e65092"), FeatureId = new Guid("2f3509b7-160d-410a-b9b6-daadd96c986d"), IsEnabled = true, Name = "Modify Tenant", Description = "Modify only his tenant." },
                new FeaturePermission { Id = new Guid("647145c6-2108-4c98-aab4-178602236e55"), FeatureId = new Guid("2f3509b7-160d-410a-b9b6-daadd96c986d"), IsEnabled = true, Name = "View Tenant", Description = "Asscess information related to tenant." },

                // Project Management Feature
                new FeaturePermission { Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "View Project", Description = "Access all information related to the project." },
                new FeaturePermission { Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "Manage Project", Description = "Potentially edit the project name, description, start/end dates, or status." },
                new FeaturePermission { Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "Manage Team", Description = "The \"Manage Team\" feature allows authorized users to organize project personnel by adding, removing, and assigning employee to projects." },
                new FeaturePermission { Id = new Guid("8d7cc6e3-9147-41f7-aaa7-fa507e450bd4"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "View Project Infra", Description = "Grants a user comprehensive read-only access to all details concerning the project's underlying systems, technologies, resources, and configurations" },
                new FeaturePermission { Id = new Guid("cf2825ad-453b-46aa-91d9-27c124d63373"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "Manage Project Infra", Description = "This allows them to create, modify, and manage all aspects of the supporting infrastructure." },

                // Task Management Feature
                new FeaturePermission { Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), IsEnabled = true, Name = "View Task", Description = "Grants a user comprehensive read-only access to all details associated with tasks within a project. This includes task descriptions, statuses, assignees, due dates, dependencies, progress, history, and any related attachments or discussions." },
                new FeaturePermission { Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), IsEnabled = true, Name = "Add/Edit Task", Description = "This allows them to create new tasks, modify existing task attributes (description, status, assignee, due date, etc.)," },
                new FeaturePermission { Id = new Guid("6a32379b-8b3f-49a6-8c48-4b7ac1b55dc2"), FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), IsEnabled = true, Name = "Assign/Report Progress", Description = "Grants a user the ability to designate team members responsible for specific tasks and to update the completion status or provide progress updates for those tasks" },
                new FeaturePermission { Id = new Guid("db4e40c5-2ba9-4b6d-b8a6-a16a250ff99c"), FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), IsEnabled = true, Name = "Approve Task", Description = "Grants a user the authority to officially confirm the completion or acceptance of a task, often signifying that it meets the required standards or criteria" },

                // Employee Management Feature
                new FeaturePermission { Id = new Guid("60611762-7f8a-4fb5-b53f-b1139918796b"), FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), IsEnabled = true, Name = "View All Employees", Description = "Grants a user read-only access to details about the all individuals within the system. This typically includes names, contact information, roles, departments, and potentially other relevant employee data" },
                new FeaturePermission { Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), IsEnabled = true, Name = "View Team Members", Description = "Grants a user read-only access to details about the individuals within the system which are is assigned to same projects as user. This typically includes names, contact information, roles, departments, and potentially other relevant employee data" },
                new FeaturePermission { Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), IsEnabled = true, Name = "Add/Edit Employee", Description = "Grants a user the authority to create new employee profiles and modify existing employee details within the system. This typically includes adding or updating information such as names, contact details, roles, departments, skills, and potentially other personal or professional data" },
                new FeaturePermission { Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), IsEnabled = true, Name = "Assign Roles", Description = "Grants a user the authority to manage employee application roles, enabling them to assign or revoke access privileges within the system." },

                // Attendance Management Feature
                new FeaturePermission { Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), IsEnabled = true, Name = "Team Attendance ", Description = "Team Attendance refers to tracking and managing the attendance of all team members collectively, often monitored by a team lead or manager." },
                new FeaturePermission { Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), IsEnabled = true, Name = "Regularize Attendance", Description = "Grants a user the authority to approve requests from employees to adjust or correct their recorded attendance. This typically involves reviewing the reason for the regularization, verifying any supporting documentation, and then officially accepting the changes to the employee's attendance records" },
                new FeaturePermission { Id = new Guid("ccb0589f-712b-43de-92ed-5b6088e7dc4e"), FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), IsEnabled = true, Name = "Self Attendance", Description = "Team Attendance refers to tracking and managing the attendance of all team members collectively, often monitored by a team lead or manager." },

                // Masters Feature
                new FeaturePermission { Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), IsEnabled = true, Name = "View Masters", Description = "Grants a user read-only access to foundational or reference data within the system. \"Masters\" typically refer to predefined lists, categories, or templates that are used throughout the application to standardize information and maintain consistency" },
                new FeaturePermission { Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), IsEnabled = true, Name = "Manage Masters", Description = "Grants a user the authority to create, modify, and delete foundational or reference data within the system. These \"masters\" are typically the core lists, categories, and configurations that other data and functionalities rely upon, such as departments, job titles, product categories" },

                //Document Management Feature
                new FeaturePermission { Id = new Guid("71189504-f1c8-4ca5-8db6-810497be2854"), FeatureId = new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), IsEnabled = true, Name = "View Document", Description = "Grants a user the authority to view all documents related to employees and projects" },
                new FeaturePermission { Id = new Guid("3f6d1f67-6fa5-4b7c-b17b-018d4fe4aab8"), FeatureId = new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), IsEnabled = true, Name = "Upload Document", Description = "Grants a user the authority to upload the document" },
                new FeaturePermission { Id = new Guid("c423fd81-6273-4b9d-bb5e-76a0fb343833"), FeatureId = new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), IsEnabled = true, Name = "Mofify Document", Description = "Grants a user the authority to modify document" },
                new FeaturePermission { Id = new Guid("40863a13-5a66-469d-9b48-135bc5dbf486"), FeatureId = new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), IsEnabled = true, Name = "Delete Document", Description = "Grants a user the authority to delete the document" },
                new FeaturePermission { Id = new Guid("404373d0-860f-490e-a575-1c086ffbce1d"), FeatureId = new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), IsEnabled = true, Name = "Download Document", Description = "Grants a user the authority to download the document" },
                new FeaturePermission { Id = new Guid("13a1f30f-38d1-41bf-8e7a-b75189aab8e0"), FeatureId = new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), IsEnabled = true, Name = "Verify Document", Description = "Grants a user the authority to verify the document" },

                // Directory Management Feature
                new FeaturePermission { Id = new Guid("4286a13b-bb40-4879-8c6d-18e9e393beda"), FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), IsEnabled = true, Name = "Directory Admin", Description = "Full control over all directories, including the ability to manage permissions for all directories in the system." },
                new FeaturePermission { Id = new Guid("62668630-13ce-4f52-a0f0-db38af2230c5"), FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), IsEnabled = true, Name = "Directory Manager", Description = "Full control over directories they created or have been assigned. Can also manage permissions for those directories." },
                new FeaturePermission { Id = new Guid("0f919170-92d4-4337-abd3-49b66fc871bb"), FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), IsEnabled = true, Name = "Directory User", Description = "Full control over directories they created. Can view contacts in directories they either created or were assigned to. Can manage permissions only for directories they created." },

                // Expense Management Feature
                new FeaturePermission { Id = new Guid("385be49f-8fde-440e-bdbc-3dffeb8dd116"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "View Self", Description = "Allows a user to view only the expense records that they have personally submitted" },
                new FeaturePermission { Id = new Guid("01e06444-9ca7-4df4-b900-8c3fa051b92f"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "View All", Description = "Allows a user to view all expense records across the organization or project, regardless of who submitted or paid them" },
                new FeaturePermission { Id = new Guid("0f57885d-bcb2-4711-ac95-d841ace6d5a7"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Upload", Description = "Allows a user to create and submit new expense records, including attaching relevant documents like receipts or invoices." },
                new FeaturePermission { Id = new Guid("1f4bda08-1873-449a-bb66-3e8222bd871b"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Review", Description = "Allows a user to examine submitted expenses for accuracy, completeness, and policy compliance before they are approved or rejected." },
                new FeaturePermission { Id = new Guid("eaafdd76-8aac-45f9-a530-315589c6deca"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Approve", Description = "Allows a user to authorize or reject submitted expenses, making them officially accepted or declined within the system." },
                new FeaturePermission { Id = new Guid("ea5a1529-4ee8-4828-80ea-0e23c9d4dd11"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Process", Description = "Allows a user to handle post-approval actions such as recording payments, updating financial records, or marking expenses as reimbursed or settled." },
                new FeaturePermission { Id = new Guid("bdee29a2-b73b-402d-8dd1-c4b1f81ccbc3"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Manage", Description = "Allows a user to configure and control system settings, such as managing expense types, payment modes, permissions, and overall workflow rules." },

                // Organization Management Feature
                new FeaturePermission { Id = new Guid("068cb3c1-49c5-4746-9f29-1fce16e820ac"), FeatureId = new Guid("6d4c82d6-dbce-48ab-b8b8-f785f4d8c914"), IsEnabled = true, Name = "Add Organization", Description = "Allow user to create new organization" },
                new FeaturePermission { Id = new Guid("c1ae1363-ab8a-4bd9-a9d1-8c2c6083873a"), FeatureId = new Guid("6d4c82d6-dbce-48ab-b8b8-f785f4d8c914"), IsEnabled = true, Name = "Edit Organization", Description = "Allow the user to update the basic information of the organization" },
                new FeaturePermission { Id = new Guid("7a6cf830-0008-4e03-b31d-0d050cb634f4"), FeatureId = new Guid("6d4c82d6-dbce-48ab-b8b8-f785f4d8c914"), IsEnabled = true, Name = "View Organization", Description = "Allow the user to view information of the organization" }

            );

            modelBuilder.Entity<CurrencyMaster>().HasData(
                new CurrencyMaster
                {
                    Id = Guid.Parse("78e96e4a-7ce0-4164-ae3a-c833ad45ec2c"),
                    CurrencyCode = "INR",
                    CurrencyName = "Indian Rupee",
                    Symbol = "₹",
                    IsActive = true
                },
                new CurrencyMaster
                {
                    Id = Guid.Parse("2f672568-a67b-4961-acb2-a8c7834e1762"),
                    CurrencyCode = "USD",
                    CurrencyName = "US Dollar",
                    Symbol = "$",
                    IsActive = true
                },
                new CurrencyMaster
                {
                    Id = Guid.Parse("4d1155bb-1448-4d97-a732-96c92eb99c45"),
                    CurrencyCode = "EUR",
                    CurrencyName = "Euro",
                    Symbol = "€",
                    IsActive = true
                },
                new CurrencyMaster
                {
                    Id = Guid.Parse("3e456237-ef06-4ea1-a261-188c9b0c6df6"),
                    CurrencyCode = "GBP",
                    CurrencyName = "Pound Sterling",
                    Symbol = "£",
                    IsActive = true
                },
                new CurrencyMaster
                {
                    Id = Guid.Parse("297e237a-56d3-48f6-b39d-ec3991dea8bf"),
                    CurrencyCode = "JPY",
                    CurrencyName = "Japanese Yen",
                    Symbol = "¥",
                    IsActive = true
                },
                new CurrencyMaster
                {
                    Id = Guid.Parse("efe9b4f6-64d6-446e-a42d-1c7aaf6dd70d"),
                    CurrencyCode = "RUB",
                    CurrencyName = "Russian Ruble",
                    Symbol = "₽",
                    IsActive = true
                },
                new CurrencyMaster
                {
                    Id = Guid.Parse("b960166a-f7e9-49e3-bb4b-28511f126c08"),
                    CurrencyCode = "CNY",
                    CurrencyName = "Chinese Yuan (Renminbi)",
                    Symbol = "¥",
                    IsActive = true
                }
                );
        }
    }
}