From 0feba76fb4c557252c8d8df3fc6b8c1a048a0350 Mon Sep 17 00:00:00 2001 From: SamSys Date: Sat, 4 Jan 2025 18:00:04 +0330 Subject: [PATCH] seedPermiision for subAcount --- .../Application/SubAccountPermissionHelper.cs | 914 +++++++++ .../AccountContext.cs | 4 +- ...ountMangement.Infrastructure.EFCore.csproj | 2 +- .../SubAccountPermissionSubtitle1Mapping.cs | 5 +- .../20250104133725_SeedPermission.Designer.cs | 1737 +++++++++++++++++ .../20250104133725_SeedPermission.cs | 408 ++++ .../Migrations/AccountContextModelSnapshot.cs | 486 +++++ ...SubAccountPermissionSubtitle1Repository.cs | 60 +- .../Seed/SubAccountPermissionSeeder.cs | 45 + .../Pages/Company/SubAccounts/Index.cshtml | 2 +- .../SubAccounts/ModalCreateRole.cshtml | 93 +- .../Company/SubAccounts/ModalEditRole.cshtml | 93 +- .../Areas/Client/Pages/Shared/_Menu.cshtml | 321 ++- .../Pages/Shared/_headerAndFooter.cshtml | 6 +- ServiceHost/Program.cs | 2 +- ServiceHost/SecurityPageFilter.cs | 36 +- .../pages/SubAccounts/css/ModalCreateRole.css | 88 +- .../pages/SubAccounts/js/ModalCreateRole.js | 54 +- .../pages/SubAccounts/js/ModalEditRole.js | 51 +- 19 files changed, 3963 insertions(+), 444 deletions(-) create mode 100644 0_Framework/Application/SubAccountPermissionHelper.cs create mode 100644 AccountMangement.Infrastructure.EFCore/Migrations/20250104133725_SeedPermission.Designer.cs create mode 100644 AccountMangement.Infrastructure.EFCore/Migrations/20250104133725_SeedPermission.cs create mode 100644 AccountMangement.Infrastructure.EFCore/Seed/SubAccountPermissionSeeder.cs diff --git a/0_Framework/Application/SubAccountPermissionHelper.cs b/0_Framework/Application/SubAccountPermissionHelper.cs new file mode 100644 index 00000000..9162b744 --- /dev/null +++ b/0_Framework/Application/SubAccountPermissionHelper.cs @@ -0,0 +1,914 @@ +namespace _0_Framework.Application +{ + public static class SubAccountPermissionHelper + { + #region تعریف های مجوز ها + + + + #region عملیات کارگاه + /// + /// عملیات کارگاه + /// + public const int WorkshopOperationsPermissionCode = 102; + + /// + /// لیست قرارداد + /// + public const int ContractListPermissionCode = 10201; + + /// + /// لیست فیش حقوقی + /// + public const int CheckoutListPermissionCode = 10202; + + /// + /// لیست بیمه + /// + public const int InsuranceListPermissionCode = 10203; + + /// + /// گزارش وضعیت پرسنل به صورت گروهی + /// + public const int PersonnelStatusGroupReportPermissionCode = 10204; + + /// + /// گزارش وضعیت پرسنل به صورت انفرادی + /// + public const int PersonnelStatusIndividualReportPermissionCode = 10205; + + /// + /// لیست کل پرسنل + /// + public const int PersonnelListPermissionCode = 10206; + + #endregion + + + #region عملیات پرسنل + + /// + /// عملیات پرسنل + /// + public const int PersonnelOperationsPermissionCode = 103; + + /// + /// ثبت مرخصی + /// + public const int LeaveCreatePermissionCode = 10301; + + /// + /// لیست کل مرخصی + /// + public const int LeaveListPermissionCode = 10302; + + /// + /// عملیات مدارک پرسنل + /// + public const int EmployeeDocumentsOperationsPermissionCode = 10303; + + /// + /// عملیات پرداخت حقوق پرسنل + /// + public const int PaymentToEmployeePermissionCode = 10304; + + #region عملیات وام + /// + /// عملیات وام + /// + public const int LoanOperationsPermissionCode = 10305; + + /// + /// ایجاد وام + /// + public const int CreateLoanPermissionCode = 1030501; + + /// + /// ویرایش وام + /// + public const int EditLoanPermissionCode = 1030502; + + /// + /// حذف وام + /// + public const int DeleteLoanPermissionCode = 1030503; + #endregion + + #region عملیات پاداش + /// + /// عملیات پاداش + /// + public const int RewardOperationsPermissionCode = 10306; + + /// + /// ایجاد پاداش + /// + public const int CreateRewardPermissionCode = 1030601; + + /// + /// ویرایش پاداش + /// + public const int EditRewardPermissionCode = 1030602; + + /// + /// حذف پاداش + /// + public const int DeleteRewardPermissionCode = 1030603; + + #endregion + + #region عملیات مساعده + /// + /// عملیات مساعده + /// + public const int SalaryAidOperationsPermissionCode = 10307; + + /// + /// ایجاد مساعده + /// + public const int CreateSalaryAidPermissionCode = 1030701; + + /// + /// ویرایش مساعده + /// + public const int EditSalaryAidPermissionCode = 1030702; + + /// + /// حذف مساعده + /// + public const int DeleteSalaryAidPermissionCode = 1030703; + #endregion + + #region عملیات جرایم + /// + /// عملیات جرایم + /// + public const int FineOperationsPermissionCode = 10308; + + /// + /// ایجاد جریمه + /// + public const int CreateFinePermissionCode = 1030801; + + /// + /// ایجاد عنوان جریمه + /// + public const int CreateFineTitlePermissionCode = 1030802; + + /// + /// ویرایش + /// + public const int EditFinePermissionCode = 1030803; + + /// + /// حذف جریمه + /// + public const int DeleteFinePermissionCode = 1030804; + #endregion + + #endregion + + + #region فیش حقوقی غیر رسمی + + /// + /// عملیات فیش حقوقی غیر رسمی + /// + public const int CustomizeCheckoutOperationsPermissionCode = 104; + + + #region تنظیم گروهبندی و حقوق پرسنل + + /// + /// تنظیم گروهبندی و حقوق پرسنل + /// + public const int CustomizeCheckoutSetGroupAndSalaryPermissionCode = 10402; + /// + /// تنظیمات محاسبه فیش حقوقی غیر رسمی + /// + public const int CustomizeCheckoutSettingsPermissionCode = 1040201; + + #endregion + + + #region فیش حقوقی غیر رسمی موقت + /// + /// لیست فیش حقوقی غیر رسمی موقت + /// + public const int CustomizeCheckoutTempListPermissionCode = 10403; + + /// + /// ایجاد فیش حقوقی غیر رسمی موقت + /// + public const int CreateCustomizeCheckoutTempPermissionCode = 1040301; + /// + /// پرینت فیش حقوقی غیر رسمی موقت + /// + public const int PrintCustomizeCheckoutTempPermissionCode = 1040302; + + /// + /// حذف فیش حقوقی غیر رسمی موقت + /// + public const int DeleteCustomizeCheckoutTempPermissionCode = 1040303; + + #endregion + + #region فیش حقوقی غیر رسمی نهایی + /// + /// لیست فیش حقوقی غیر رسمی نهایی + /// + public const int CustomizeCheckoutListPermissionCode = 10404; + + /// + /// ایجاد فیش حقوقی غیر رسمی نهایی + /// + public const int CreateCustomizeCheckoutPermissionCode = 1040401; + + /// + /// پرینت فیش حقوقی غیر رسمی نهایی + /// + public const int PrintCustomizeCheckoutPermissionCode = 1040402; + + /// + /// حذف فیش حقوقی غیر رسمی نهایی + /// + public const int DeleteCustomizeCheckoutPermissionCode = 1040403; + + #endregion + + + + #endregion + + + + #region گزارشات + /// + /// بخش گزارشات + /// + public const int ReportsAreaPermissionCode = 113; + /// + /// گزارشات تجمیع حقوق پرسنل + /// + public const int CheckoutReportPermissionCode = 11301; + + + #endregion + + #region حضور و غیاب + + /// + /// عملیات حضور غیاب + /// + public const int RollCallOperationsPermissionCode = 106; + + + /// + /// ارتقا یا تغییر سرویس حضور غیاب + /// + public const int UpgradeOrChangeRollCallServicePermissionCode = 10601; + + #region آپلود عکس پرسنل + + /// + /// آپلود عکس پرسنل + /// + public const int UploadEmployeePicturePermissionCode = 10602; + + /// + /// ویرایش عکس پرسنل + /// + public const int EditEmployeePicturePermissionCode = 1060201; + + /// + /// فعال و غیر فعال کردن حضور غیاب پرسنل + /// + public const int ToggleRollCallEmployeeStatusPermissionCode = 1060202; + /// + /// ویرایش نام مستعار + /// + public const int EditEmployeeSurnamePermissionCode = 1060203; + #endregion + + /// + /// لیست حضور و غیاب روز جاری + /// + public const int ListCurrentDayRollCallsPermissionCode = 10603; + + + + #region سوابق حضور غیاب + /// + /// لیست سوابق حضور غیاب + /// + public const int ListRollCallHistoryPermissionCode = 10604; + + + /// + /// ویرایش و افزودن سوابق حضور غیاب + /// + public const int AddOrEditRollCallHistoryPermissionCode = 1060401; + + /// + /// حذف حضور غیاب از سوابق + /// + public const int DeleteRollCallHistoryPermissionCode = 1060402; + #endregion + + + + + /// + /// عملیات گروه بندی + /// + public const int GroupingOperationsPermissionCode = 10605; + + /// + /// تنظیم ساعت مجموعه + /// + public const int SetWorkshopWorkingHoursPermissionCode = 10606; + + /// + /// تنظیمات حساب کاربری دوربین + /// + public const int CameraAccountSettingsPermissionCode = 10607; + + #endregion + + #region کارپوشه + /// + /// عملیات کارپوشه + /// + public const int WorkFlowOperationsPermissionCode = 110; + + /// + /// حضور غیاب کارپوشه + /// + public const int WorkFlowRollCallsPermissionCode = 11001; + + /// + /// قرارداد ها و فیش های حقوقی کارپوشه + /// + public const int WorkFlowContractsAndCheckoutsPermissionCode = 11002; + + /// + /// بیمه کارپوشه + /// + public const int WorkFlowInsurancesPermissionCode = 11003; + #endregion + + /// + /// لیست صورت حساب های مالی + /// + public const int FinancialStatementsListPermissionCode = 111; + + /// + /// بخش مدیریت کاربران + /// + public const int UserManagementOperationsPermissionCode = 112; + + + + /// + /// بخش تیکت + /// + // public const int TicketOperationsPermissionCode = 114; + + #endregion + + + #region تعریف اشیا برای ثبت در دیتابیس + + #region Level 1 Permissions + public static SubAccountPermissionDto WorkshopOperationsPermission + { get; } = new() + { + Id = WorkshopOperationsPermissionCode, + Code = WorkshopOperationsPermissionCode, + Name = "عملیات کارگاه", + ParentId = 0 + }; + public static SubAccountPermissionDto PersonnelOperationsPermission { get; } = new() + { + Id = PersonnelOperationsPermissionCode, + Name = "عملیات پرسنل", + Code = PersonnelOperationsPermissionCode, + ParentId = 0 + }; + public static SubAccountPermissionDto CustomizeCheckoutOperationsPermission { get; } = new() + { + Id = CustomizeCheckoutOperationsPermissionCode, + Name = "فیش حقوقی غیر رسمی", + Code = CustomizeCheckoutOperationsPermissionCode, + ParentId = 0 + }; + + public static SubAccountPermissionDto ReportsAreaPermission { get; } = new() + { + Id = ReportsAreaPermissionCode, + Name = "گزارشات", + Code = ReportsAreaPermissionCode, + ParentId = 0 + }; + + public static SubAccountPermissionDto RollCallOperationsPermission { get; } = new() + { + Id = RollCallOperationsPermissionCode, + Code = RollCallOperationsPermissionCode, + Name = "حضور و غیاب", + ParentId = 0 + }; + + public static SubAccountPermissionDto WorkFlowOperationsPermission { get; } = new() + { + Id = WorkFlowOperationsPermissionCode, + Code = WorkFlowOperationsPermissionCode, + Name = "کارپوشه", + ParentId = 0 + }; + public static SubAccountPermissionDto FinancialStatementsListPermission { get; } = new() + { + Id = FinancialStatementsListPermissionCode, + Name = "صورت حساب های مالی", + Code = FinancialStatementsListPermissionCode, + ParentId = 0 + }; + public static SubAccountPermissionDto UserManagementOperationsPermission { get; } = new() + { + Id = UserManagementOperationsPermissionCode, + Name = "مدیریت کاربران", + Code = UserManagementOperationsPermissionCode, + ParentId = 0 + }; + //public static SubAccountPermissionDto TicketOperationsPermission { get; } = new() + //{ + // Id = 12, + // Name = "تیکت", + // Code = TicketOperationsPermissionCode, + // ParentId = 0 + //}; + + #endregion + + #region Level 2 Permissions + + + + #region عملیات کارگاه, ParentId = WorkshopOperationsPermissionCode + public static SubAccountPermissionDto ContractListPermission { get; } = new() + { + Id = ContractListPermissionCode, + Name = "لیست قرارداد", + Code = ContractListPermissionCode, + ParentId = WorkshopOperationsPermissionCode + }; + + public static SubAccountPermissionDto CheckoutListPermission { get; } = new() + { + Id = CheckoutListPermissionCode, + Name = "لیست فیش حقوقی", + Code = CheckoutListPermissionCode, + ParentId = WorkshopOperationsPermissionCode + }; + + public static SubAccountPermissionDto InsuranceListPermission { get; } = new() + { + Id = InsuranceListPermissionCode, + Name = "لیست بیمه", + Code = InsuranceListPermissionCode, + ParentId = WorkshopOperationsPermissionCode + }; + public static SubAccountPermissionDto PersonnelStatusGroupReportPermission { get; } = new() + { + Id = PersonnelStatusGroupReportPermissionCode, + Name = "گزارش وضعیت پرسنل به صورت گروهی", + Code = PersonnelStatusGroupReportPermissionCode, + ParentId = WorkshopOperationsPermissionCode + }; + public static SubAccountPermissionDto PersonnelStatusIndividualReportPermission { get; } = new() + { + Id = PersonnelStatusIndividualReportPermissionCode, + Name = "گزارش وضعیت پرسنل به صورت انفرادی", + Code = PersonnelStatusIndividualReportPermissionCode, + ParentId = WorkshopOperationsPermissionCode + }; + public static SubAccountPermissionDto PersonnelListPermission { get; } = new() + { + Id = PersonnelListPermissionCode, + Name = "لیست کل پرسنل", + Code = PersonnelListPermissionCode, + ParentId = WorkshopOperationsPermissionCode + }; + #endregion + + #region عملیات پرسنل, ParentId = PersonnelOperationsPermissionCode + public static SubAccountPermissionDto LeaveCreatePermission { get; } = new() + { + Id = LeaveCreatePermissionCode, + Name = "ثبت مرخصی", + Code = LeaveCreatePermissionCode, + ParentId = PersonnelOperationsPermissionCode + }; + + public static SubAccountPermissionDto LeaveListPermission { get; } = new() + { + Id = LeaveListPermissionCode, + Name = "لیست کل مرخصی", + Code = LeaveListPermissionCode, + ParentId = PersonnelOperationsPermissionCode + }; + + public static SubAccountPermissionDto EmployeeDocumentsOperationsPermission { get; } = new() + { + Id = EmployeeDocumentsOperationsPermissionCode, + Name = "عملیات مدارک پرسنل", + Code = EmployeeDocumentsOperationsPermissionCode, + ParentId = PersonnelOperationsPermissionCode + }; + + public static SubAccountPermissionDto PaymentToEmployeePermission { get; } = new() + { + Id = PaymentToEmployeePermissionCode, + Name = "عملیات پرداخت حقوق پرسنل", + Code = PaymentToEmployeePermissionCode, + ParentId = PersonnelOperationsPermissionCode + }; + + public static SubAccountPermissionDto LoanOperationsPermission { get; } = new() + { + Id = LoanOperationsPermissionCode, + Name = "عملیات وام", + Code = LoanOperationsPermissionCode, + ParentId = PersonnelOperationsPermissionCode + }; + + public static SubAccountPermissionDto RewardOperationsPermission { get; } = new() + { + Id = RewardOperationsPermissionCode, + Name = "عملیات پاداش", + Code = RewardOperationsPermissionCode, + ParentId = PersonnelOperationsPermissionCode + }; + + public static SubAccountPermissionDto SalaryAidOperationsPermission { get; } = new() + { + Id = SalaryAidOperationsPermissionCode, + Name = "عملیات مساعده", + Code = SalaryAidOperationsPermissionCode, + ParentId = PersonnelOperationsPermissionCode + }; + + public static SubAccountPermissionDto FineOperationsPermission { get; } = new() + { + Id = FineOperationsPermissionCode, + Name = "عملیات جرایم", + Code = FineOperationsPermissionCode, + ParentId = PersonnelOperationsPermissionCode + }; + + #endregion + + #region فیش حقوقی غیر رسمی,ParentId = CustomizeCheckoutOperationsPermissionCode + + + public static SubAccountPermissionDto CustomizeCheckoutSetGroupAndSalaryPermission { get; } = new() + { + Id = CustomizeCheckoutSetGroupAndSalaryPermissionCode, + Name = "تنظیم گروه بندی و حقوق پرسنل", + Code = CustomizeCheckoutSetGroupAndSalaryPermissionCode, + ParentId = CustomizeCheckoutOperationsPermissionCode + }; + + + public static SubAccountPermissionDto CustomizeCheckoutTempListPermission { get; } = new() + { + Id = CustomizeCheckoutTempListPermissionCode, + Name = "لیست فیش حقوقی موقت", + Code = CustomizeCheckoutTempListPermissionCode, + ParentId = CustomizeCheckoutOperationsPermissionCode + }; + + + public static SubAccountPermissionDto CustomizeCheckoutListPermission { get; } = new() + { + Id = CustomizeCheckoutListPermissionCode, + Name = "لیست فیش حقوقی نهایی", + Code = CustomizeCheckoutListPermissionCode, + ParentId = CustomizeCheckoutOperationsPermissionCode + }; + #endregion + + #region گزارشات ,ParentId = ReportsAreaPermissionCode + + public static SubAccountPermissionDto CheckoutReportPermission { get; } = new() + { + Id = CheckoutReportPermissionCode, + Name = "گزارشات تجمیع حقوق پرسنل", + Code = CheckoutReportPermissionCode, + ParentId = ReportsAreaPermissionCode + }; + + #endregion + + #region حضور و غیاب, ParentId = RollCallOperationsPermissionCode + public static SubAccountPermissionDto UpgradeOrChangeRollCallServicePermission { get; } = new() + { + Id = UpgradeOrChangeRollCallServicePermissionCode, + Name = "ارتقا یا تغییر سرویس حضور غیاب", + Code = UpgradeOrChangeRollCallServicePermissionCode, + ParentId = RollCallOperationsPermissionCode + }; + public static SubAccountPermissionDto UploadEmployeePicturePermission { get; } = new() + { + Id = UploadEmployeePicturePermissionCode, + Name = "آپلود عکس پرسنل", + Code = UploadEmployeePicturePermissionCode, + ParentId = RollCallOperationsPermissionCode + }; + public static SubAccountPermissionDto RollCallHistoryListPermission { get; } = new() + { + Id = ListRollCallHistoryPermissionCode, + Name = "سوابق حضور و غیاب", + Code = ListRollCallHistoryPermissionCode, + ParentId = RollCallOperationsPermissionCode + }; + public static SubAccountPermissionDto CurrentDayRollCallsListPermission { get; } = new() + { + Id = ListCurrentDayRollCallsPermissionCode, + Name = "حضور و غیاب جاری", + Code = ListCurrentDayRollCallsPermissionCode, + ParentId = RollCallOperationsPermissionCode + }; + + public static SubAccountPermissionDto GroupingOperationsPermission { get; } = new() + { + Id = GroupingOperationsPermissionCode, + Name = "عملیات گروهبندی", + Code = GroupingOperationsPermissionCode, + ParentId = RollCallOperationsPermissionCode + }; + public static SubAccountPermissionDto SetWorkshopWorkingHoursPermission { get; } = new() + { + Id = SetWorkshopWorkingHoursPermissionCode, + Name = "تنظیم ساعت فعالیت مجموعه", + Code = SetWorkshopWorkingHoursPermissionCode, + ParentId = RollCallOperationsPermissionCode + }; + public static SubAccountPermissionDto CameraAccountSettingsPermission { get; } = new() + { + Id = CameraAccountSettingsPermissionCode, + Name = "تنظیمات حساب کاربری دوربین", + Code = CameraAccountSettingsPermissionCode, + ParentId = RollCallOperationsPermissionCode + }; + #endregion + + #region کارپوشه,ParentId = WorkFlowOperationsPermissionCode + public static SubAccountPermissionDto WorkFlowRollCallsPermission { get; } = new() + { + Id = WorkFlowRollCallsPermissionCode, + Name = "حضور و غیاب کارپوشه", + Code = WorkFlowRollCallsPermissionCode, + ParentId = WorkFlowOperationsPermissionCode + }; + public static SubAccountPermissionDto WorkFlowContractsAndCheckoutsPermission { get; } = new() + { + Id = WorkFlowContractsAndCheckoutsPermissionCode, + Name = "قرارداد و فیش حقوقی کارپوشه", + Code = WorkFlowContractsAndCheckoutsPermissionCode, + ParentId = WorkFlowOperationsPermissionCode + }; + public static SubAccountPermissionDto WorkFlowInsurancesPermission { get; } = new() + { + Id = WorkFlowInsurancesPermissionCode, + Name = "بیمه کارپوشه", + Code = WorkFlowInsurancesPermissionCode, + ParentId = WorkFlowOperationsPermissionCode + }; + #endregion + + #endregion + + #region Level 3 Permissions + + #region عملیات وام در بخش عملیات پرسنل, ParentId = LoanOperationsPermissionCode + public static SubAccountPermissionDto CreateLoanPermission { get; } = new() + { + Id = CreateLoanPermissionCode, + Name = "ایجاد وام", + Code = CreateLoanPermissionCode, + ParentId = LoanOperationsPermissionCode + }; + public static SubAccountPermissionDto EditLoanPermission { get; } = new() + { + Id = EditLoanPermissionCode, + Name = "ویرایش وام", + Code = EditLoanPermissionCode, + ParentId = LoanOperationsPermissionCode + }; + public static SubAccountPermissionDto DeleteLoanPermission { get; } = new() + { + Id = DeleteLoanPermissionCode, + Name = "حذف وام", + Code = DeleteLoanPermissionCode, + ParentId = LoanOperationsPermissionCode + }; + #endregion + + #region عملیات پاداش در بخش عملیات پرسنل, ParentId = RewardOperationsPermissionCode + public static SubAccountPermissionDto CreateRewardPermission { get; } = new() + { + Id = CreateRewardPermissionCode, + Name = "ایجاد پاداش", + Code = CreateRewardPermissionCode, + ParentId = RewardOperationsPermissionCode + }; + public static SubAccountPermissionDto EditRewardPermission { get; } = new() + { + Id = EditRewardPermissionCode, + Name = "ویرایش پاداش", + Code = EditRewardPermissionCode, + ParentId = RewardOperationsPermissionCode + }; + public static SubAccountPermissionDto DeleteRewardPermission { get; } = new() + { + Id = DeleteRewardPermissionCode, + Name = "حذف پاداش", + Code = DeleteRewardPermissionCode, + ParentId = RewardOperationsPermissionCode + }; + #endregion + + #region عملیات مساعده در بخش عملیات پرسنل, ParentId = SalaryAidOperationsPermissionCode + public static SubAccountPermissionDto CreateSalaryAidPermission { get; } = new() + { + Id = CreateSalaryAidPermissionCode, + Name = "ایجاد مساعده", + Code = CreateSalaryAidPermissionCode, + ParentId = SalaryAidOperationsPermissionCode + }; + public static SubAccountPermissionDto EditSalaryAidPermission { get; } = new() + { + Id = EditSalaryAidPermissionCode, + Name = "ویرایش مساعده", + Code = EditSalaryAidPermissionCode, + ParentId = SalaryAidOperationsPermissionCode + }; + public static SubAccountPermissionDto DeleteSalaryAidPermission { get; } = new() + { + Id = DeleteSalaryAidPermissionCode, + Name = "حذف مساعده", + Code = DeleteSalaryAidPermissionCode, + ParentId = SalaryAidOperationsPermissionCode + }; + #endregion + + #region عملیات جرایم در بخش عملیات پرسنل, ParentId = FineOperationsPermissionCode + public static SubAccountPermissionDto CreateFinePermission { get; } = new() + { + Id = CreateFinePermissionCode, + Name = "ایجاد جریمه", + Code = CreateFinePermissionCode, + ParentId = FineOperationsPermissionCode + }; + public static SubAccountPermissionDto CreateFineTitlePermission { get; } = new() + { + Id = CreateFineTitlePermissionCode, + Name = "ایجاد عنوان جریمه", + Code = CreateFineTitlePermissionCode, + ParentId = FineOperationsPermissionCode + }; + public static SubAccountPermissionDto EditFinePermission { get; } = new() + { + Id = EditFinePermissionCode, + Name = "ویرایش جریمه", + Code = EditFinePermissionCode, + ParentId = FineOperationsPermissionCode + }; + public static SubAccountPermissionDto DeleteFinePermission { get; } = new() + { + Id = DeleteFinePermissionCode, + Name = "حذف جریمه", + Code = DeleteFinePermissionCode, + ParentId = FineOperationsPermissionCode + }; + #endregion + + #region لیست فیش حقوقی موقت در بخش فیش حقوقی غیر رسمی, ParentId = CustomizeCheckoutTempListPermissionCode + public static SubAccountPermissionDto CreateCustomizeCheckoutTempPermission { get; } = new() + { + Id = CreateCustomizeCheckoutTempPermissionCode, + Name = "ایجاد فیش حقوقی غیر رسمی موقت", + Code = CreateCustomizeCheckoutTempPermissionCode, + ParentId = CustomizeCheckoutTempListPermissionCode + }; + public static SubAccountPermissionDto PrintCustomizeCheckoutTempPermission { get; } = new() + { + Id = PrintCustomizeCheckoutTempPermissionCode, + Name = "پرینت فیش حقوقی غیر رسمی موقت", + Code = PrintCustomizeCheckoutTempPermissionCode, + ParentId = CustomizeCheckoutTempListPermissionCode + }; + public static SubAccountPermissionDto DeleteCustomizeCheckoutTempPermission { get; } = new() + { + Id = DeleteCustomizeCheckoutTempPermissionCode, + Name = "حذف فیش حقوقی غیر رسمی موقت", + Code = DeleteCustomizeCheckoutTempPermissionCode, + ParentId = CustomizeCheckoutTempListPermissionCode + }; + #endregion + + #region لیست فیش حقوقی نهایی در بخش فیش حقوقی غیر رسمی, ParentId = CustomizeCheckoutListPermissionCode + public static SubAccountPermissionDto CreateCustomizeCheckoutPermission { get; } = new() + { + Id = CreateCustomizeCheckoutPermissionCode, + Name = "ایجاد فیش حقوقی غیر رسمی نهایی", + Code = CreateCustomizeCheckoutPermissionCode, + ParentId = CustomizeCheckoutListPermissionCode + }; + public static SubAccountPermissionDto PrintCustomizeCheckoutPermission { get; } = new() + { + Id = PrintCustomizeCheckoutPermissionCode, + Name = "پرینت فیش حقوقی غیر رسمی نهایی", + Code = PrintCustomizeCheckoutPermissionCode, + ParentId = CustomizeCheckoutListPermissionCode + }; + public static SubAccountPermissionDto DeleteCustomizeCheckoutPermission { get; } = new() + { + Id = DeleteCustomizeCheckoutPermissionCode, + Name = "حذف فیش حقوقی غیر رسمی نهایی", + Code = DeleteCustomizeCheckoutPermissionCode, + ParentId = CustomizeCheckoutListPermissionCode + }; + #endregion + + #region تنظیمات محاسبه فیش حقوقی در بخش تنظیمات گروهبندی و حقوق پرسنل, ParentId = CustomizeCheckoutSetGroupAndSalaryPermissionCode + public static SubAccountPermissionDto CustomizeCheckoutSettingsPermission { get; } = new() + { + Id = CustomizeCheckoutSettingsPermissionCode, + Name = "تنظیمات محاسبه فیش حقوقی", + Code = CustomizeCheckoutSettingsPermissionCode, + ParentId = CustomizeCheckoutSetGroupAndSalaryPermissionCode + }; + + + #endregion + + #region آپلود عکس در بخش حضور و غیاب, ParentId = UploadEmployeePicturePermissionCode + public static SubAccountPermissionDto EditEmployeePicturePermission { get; } = new() + { + Id = EditEmployeePicturePermissionCode, + Name = "ویرایش عکس پرسنل", + Code = EditEmployeePicturePermissionCode, + ParentId = UploadEmployeePicturePermissionCode + }; + public static SubAccountPermissionDto ToggleRollCallEmployeeStatusPermission { get; } = new() + { + Id = ToggleRollCallEmployeeStatusPermissionCode, + Name = "فعال و غیر فعال کردن پرسنل", + Code = ToggleRollCallEmployeeStatusPermissionCode, + ParentId = UploadEmployeePicturePermissionCode + }; + + public static SubAccountPermissionDto EditEmployeeSurnamePermission{ get; } = new() + { + Id = EditEmployeeSurnamePermissionCode, + Name = "ویرایش نام مستعار", + Code = EditEmployeeSurnamePermissionCode, + ParentId = UploadEmployeePicturePermissionCode + }; + + #endregion + + #region سوابق حضور و غیاب در بخش حضور و غیاب, ParentId = ListRollCallHistoryPermissionCode + public static SubAccountPermissionDto AddOrEditRollCallHistoryPermission { get; } = new() + { + Id = AddOrEditRollCallHistoryPermissionCode, + Name = "ویرایش و افزودن سوابق حضور و غیاب", + Code = AddOrEditRollCallHistoryPermissionCode, + ParentId = ListRollCallHistoryPermissionCode + }; + public static SubAccountPermissionDto DeleteRollCallHistoryPermission { get; } = new() + { + Id = DeleteRollCallHistoryPermissionCode, + Name = "حذف سوابق حضور و غیاب", + Code = DeleteRollCallHistoryPermissionCode, + ParentId = ListRollCallHistoryPermissionCode + }; + + #endregion + + + + #endregion + #endregion + + } + public class SubAccountPermissionDto + { + public long Id { get; set; } + public int Code { get; set; } + public string Name { get; set; } + public long ParentId { get; set; } + } +} diff --git a/AccountMangement.Infrastructure.EFCore/AccountContext.cs b/AccountMangement.Infrastructure.EFCore/AccountContext.cs index 2eed36f9..28dfdfe1 100644 --- a/AccountMangement.Infrastructure.EFCore/AccountContext.cs +++ b/AccountMangement.Infrastructure.EFCore/AccountContext.cs @@ -26,6 +26,7 @@ using AccountManagement.Domain.SubAccountPermissionSubtitle2Agg; using AccountManagement.Domain.SubAccountPermissionSubtitle3Agg; using AccountManagement.Domain.SubAccountPermissionSubtitle4Agg; using AccountManagement.Domain.SubAccountRoleAgg; +using AccountMangement.Infrastructure.EFCore.Seed; namespace AccountMangement.Infrastructure.EFCore { @@ -76,7 +77,8 @@ namespace AccountMangement.Infrastructure.EFCore { var assembly = typeof(AccountMapping).Assembly; modelBuilder.ApplyConfigurationsFromAssembly(assembly); - base.OnModelCreating(modelBuilder); + SubAccountPermissionSeeder.Seed(modelBuilder); + base.OnModelCreating(modelBuilder); } } } diff --git a/AccountMangement.Infrastructure.EFCore/AccountMangement.Infrastructure.EFCore.csproj b/AccountMangement.Infrastructure.EFCore/AccountMangement.Infrastructure.EFCore.csproj index 6f1cb1ed..7899acfa 100644 --- a/AccountMangement.Infrastructure.EFCore/AccountMangement.Infrastructure.EFCore.csproj +++ b/AccountMangement.Infrastructure.EFCore/AccountMangement.Infrastructure.EFCore.csproj @@ -1,4 +1,4 @@ - + net8.0 diff --git a/AccountMangement.Infrastructure.EFCore/Mappings/SubAccountPermissionSubtitle1Mapping.cs b/AccountMangement.Infrastructure.EFCore/Mappings/SubAccountPermissionSubtitle1Mapping.cs index 7663e7ca..c0738223 100644 --- a/AccountMangement.Infrastructure.EFCore/Mappings/SubAccountPermissionSubtitle1Mapping.cs +++ b/AccountMangement.Infrastructure.EFCore/Mappings/SubAccountPermissionSubtitle1Mapping.cs @@ -8,11 +8,10 @@ namespace AccountMangement.Infrastructure.EFCore.Mappings { public void Configure(EntityTypeBuilder builder) { - builder.HasKey(x => x.id); + builder.HasKey(x => x.id); builder.ToTable("SubAccountPermissionSubtitle1"); - builder.Property(x => x.Code).HasMaxLength(15).IsRequired(); + builder.Property(x => x.Code).HasMaxLength(15).IsRequired(); builder.Property(x => x.Title).HasMaxLength(50).IsRequired(); - builder.HasMany(x => x.Children).WithOne(x => x.Parent).HasForeignKey(x => x.ParentId); } } diff --git a/AccountMangement.Infrastructure.EFCore/Migrations/20250104133725_SeedPermission.Designer.cs b/AccountMangement.Infrastructure.EFCore/Migrations/20250104133725_SeedPermission.Designer.cs new file mode 100644 index 00000000..cd8ecbae --- /dev/null +++ b/AccountMangement.Infrastructure.EFCore/Migrations/20250104133725_SeedPermission.Designer.cs @@ -0,0 +1,1737 @@ +// +using System; +using AccountMangement.Infrastructure.EFCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace AccountMangement.Infrastructure.EFCore.Migrations +{ + [DbContext(typeof(AccountContext))] + [Migration("20250104133725_SeedPermission")] + partial class SeedPermission + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("AccountManagement.Domain.AccountAgg.Account", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AdminAreaPermission") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("ClientAriaPermission") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Email") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Fullname") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("IsActiveString") + .HasMaxLength(6) + .HasColumnType("nvarchar(6)"); + + b.Property("Mobile") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("NationalCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Password") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("PositionId") + .HasMaxLength(10) + .HasColumnType("bigint"); + + b.Property("PositionIsActive") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("ProfilePhoto") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("RoleId") + .HasColumnType("bigint"); + + b.Property("RoleName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("VerifyCode") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.HasKey("id"); + + b.HasIndex("PositionId"); + + b.HasIndex("RoleId"); + + b.ToTable("Accounts", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.AccountLeftWorkAgg.AccountLeftWork", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("LeftWorkGr") + .HasColumnType("datetime2"); + + b.Property("StartWorkGr") + .HasColumnType("datetime2"); + + b.HasKey("id"); + + b.HasIndex("AccountId"); + + b.ToTable("AccountLeftWork", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.AdminResponseAgg.AdminResponse", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AdminAccountId") + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("IsActiveString") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("Response") + .HasColumnType("ntext"); + + b.Property("TicketId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("TicketId"); + + b.ToTable("AdminResponses", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.AdminResponseMediaAgg.AdminResponseMedia", b => + { + b.Property("AdminResponseId") + .HasColumnType("bigint"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.HasKey("AdminResponseId", "MediaId"); + + b.HasIndex("MediaId"); + + b.ToTable("AdminResponseMedias", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.AssignAgg.Assign", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AcceptedTimeRequest") + .HasColumnType("int"); + + b.Property("AssignedId") + .HasColumnType("bigint"); + + b.Property("AssignedName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("AssignedPositionValue") + .HasColumnType("int"); + + b.Property("AssignerId") + .HasColumnType("bigint"); + + b.Property("AssignerPositionValue") + .HasColumnType("int"); + + b.Property("CancelDescription") + .HasColumnType("ntext"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DoneDescription") + .HasColumnType("ntext"); + + b.Property("EndTaskDate") + .HasColumnType("datetime2"); + + b.Property("FirstTimeCreation") + .HasColumnType("bit"); + + b.Property("IsCancel") + .HasColumnType("bit"); + + b.Property("IsCanceledRequest") + .HasColumnType("bit"); + + b.Property("IsDone") + .HasColumnType("bit"); + + b.Property("IsDoneRequest") + .HasColumnType("bit"); + + b.Property("RequestDate") + .HasColumnType("datetime2"); + + b.Property("TaskId") + .HasColumnType("bigint"); + + b.Property("TimeRequest") + .HasColumnType("bit"); + + b.Property("TimeRequestDescription") + .HasColumnType("ntext"); + + b.HasKey("id"); + + b.HasIndex("TaskId"); + + b.ToTable("Assigns", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.CameraAccountAgg.CameraAccount", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("IsActiveSting") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("Mobile") + .HasMaxLength(11) + .HasColumnType("nvarchar(11)"); + + b.Property("Password") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("WorkshopName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("id"); + + b.HasIndex("AccountId"); + + b.ToTable("CameraAccounts", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.ClientResponseAgg.ClientResponse", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Response") + .HasColumnType("ntext"); + + b.Property("TicketId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("TicketId"); + + b.ToTable("ClientResponses", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.ClientResponseMediaAgg.ClientResponseMedia", b => + { + b.Property("ClientResponseId") + .HasColumnType("bigint"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.HasKey("ClientResponseId", "MediaId"); + + b.HasIndex("MediaId"); + + b.ToTable("ClientResponseMedias", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.MediaAgg.Media", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Category") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Path") + .HasColumnType("ntext"); + + b.Property("Type") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.HasKey("id"); + + b.ToTable("Medias", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.RoleAgg.Role", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("id"); + + b.ToTable("Roles", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountAgg.SubAccount", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("FName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsActive") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.Property("LName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("NationalCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Password") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("PhoneNumber") + .IsRequired() + .HasMaxLength(11) + .HasColumnType("nvarchar(11)"); + + b.Property("ProfilePhoto") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("SubAccountRoleId") + .HasColumnType("bigint"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("VerifyCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.HasKey("id"); + + b.HasIndex("SubAccountRoleId"); + + b.ToTable("SubAccounts", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountPermissionSubtitle1Agg.SubAccountPermissionSubtitle1", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Code") + .HasMaxLength(15) + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("id"); + + b.ToTable("SubAccountPermissionSubtitle1", (string)null); + + b.HasData( + new + { + id = 102L, + Code = 102, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2250), + Title = "عملیات کارگاه" + }, + new + { + id = 103L, + Code = 103, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2262), + Title = "عملیات پرسنل" + }, + new + { + id = 104L, + Code = 104, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2263), + Title = "فیش حقوقی غیر رسمی" + }, + new + { + id = 113L, + Code = 113, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2264), + Title = "گزارشات" + }, + new + { + id = 106L, + Code = 106, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2265), + Title = "حضور و غیاب" + }, + new + { + id = 110L, + Code = 110, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2267), + Title = "کارپوشه" + }, + new + { + id = 111L, + Code = 111, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2268), + Title = "صورت حساب های مالی" + }, + new + { + id = 112L, + Code = 112, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2268), + Title = "مدیریت کاربران" + }); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountPermissionSubtitle2Agg.SubAccountPermissionSubtitle2", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Code") + .HasMaxLength(15) + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("id"); + + b.HasIndex("ParentId"); + + b.ToTable("SubAccountPermissionSubtitle2", (string)null); + + b.HasData( + new + { + id = 10201L, + Code = 10201, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2358), + ParentId = 102L, + Title = "لیست قرارداد" + }, + new + { + id = 10202L, + Code = 10202, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2361), + ParentId = 102L, + Title = "لیست فیش حقوقی" + }, + new + { + id = 10203L, + Code = 10203, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2363), + ParentId = 102L, + Title = "لیست بیمه" + }, + new + { + id = 10204L, + Code = 10204, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2365), + ParentId = 102L, + Title = "گزارش وضعیت پرسنل به صورت گروهی" + }, + new + { + id = 10205L, + Code = 10205, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2366), + ParentId = 102L, + Title = "گزارش وضعیت پرسنل به صورت انفرادی" + }, + new + { + id = 10206L, + Code = 10206, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2368), + ParentId = 102L, + Title = "لیست کل پرسنل" + }, + new + { + id = 10301L, + Code = 10301, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2370), + ParentId = 103L, + Title = "ثبت مرخصی" + }, + new + { + id = 10302L, + Code = 10302, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2372), + ParentId = 103L, + Title = "لیست کل مرخصی" + }, + new + { + id = 10303L, + Code = 10303, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2374), + ParentId = 103L, + Title = "عملیات مدارک پرسنل" + }, + new + { + id = 10304L, + Code = 10304, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2377), + ParentId = 103L, + Title = "عملیات پرداخت حقوق پرسنل" + }, + new + { + id = 10305L, + Code = 10305, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2378), + ParentId = 103L, + Title = "عملیات وام" + }, + new + { + id = 10306L, + Code = 10306, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2380), + ParentId = 103L, + Title = "عملیات پاداش" + }, + new + { + id = 10307L, + Code = 10307, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2382), + ParentId = 103L, + Title = "عملیات مساعده" + }, + new + { + id = 10308L, + Code = 10308, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2383), + ParentId = 103L, + Title = "عملیات جرایم" + }, + new + { + id = 10402L, + Code = 10402, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2385), + ParentId = 104L, + Title = "تنظیم گروه بندی و حقوق پرسنل" + }, + new + { + id = 10403L, + Code = 10403, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2387), + ParentId = 104L, + Title = "لیست فیش حقوقی موقت" + }, + new + { + id = 10404L, + Code = 10404, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2388), + ParentId = 104L, + Title = "لیست فیش حقوقی نهایی" + }, + new + { + id = 11301L, + Code = 11301, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2391), + ParentId = 113L, + Title = "گزارشات تجمیع حقوق پرسنل" + }, + new + { + id = 10601L, + Code = 10601, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2394), + ParentId = 106L, + Title = "ارتقا یا تغییر سرویس حضور غیاب" + }, + new + { + id = 10602L, + Code = 10602, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2395), + ParentId = 106L, + Title = "آپلود عکس پرسنل" + }, + new + { + id = 10604L, + Code = 10604, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2398), + ParentId = 106L, + Title = "سوابق حضور و غیاب" + }, + new + { + id = 10603L, + Code = 10603, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2400), + ParentId = 106L, + Title = "حضور و غیاب جاری" + }, + new + { + id = 10605L, + Code = 10605, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2401), + ParentId = 106L, + Title = "عملیات گروهبندی" + }, + new + { + id = 10606L, + Code = 10606, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2404), + ParentId = 106L, + Title = "تنظیم ساعت فعالیت مجموعه" + }, + new + { + id = 10607L, + Code = 10607, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2406), + ParentId = 106L, + Title = "تنظیمات حساب کاربری دوربین" + }, + new + { + id = 11001L, + Code = 11001, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2408), + ParentId = 110L, + Title = "حضور و غیاب کارپوشه" + }, + new + { + id = 11002L, + Code = 11002, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2411), + ParentId = 110L, + Title = "قرارداد و فیش حقوقی کارپوشه" + }, + new + { + id = 11003L, + Code = 11003, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2413), + ParentId = 110L, + Title = "بیمه کارپوشه" + }); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountPermissionSubtitle3Agg.SubAccountPermissionSubtitle3", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Code") + .HasMaxLength(15) + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("id"); + + b.HasIndex("ParentId"); + + b.ToTable("SubAccountPermissionSubtitle3", (string)null); + + b.HasData( + new + { + id = 1030501L, + Code = 1030501, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2701), + ParentId = 10305L, + Title = "ایجاد وام" + }, + new + { + id = 1030502L, + Code = 1030502, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2706), + ParentId = 10305L, + Title = "ویرایش وام" + }, + new + { + id = 1030503L, + Code = 1030503, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2710), + ParentId = 10305L, + Title = "حذف وام" + }, + new + { + id = 1030601L, + Code = 1030601, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2713), + ParentId = 10306L, + Title = "ایجاد پاداش" + }, + new + { + id = 1030602L, + Code = 1030602, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2716), + ParentId = 10306L, + Title = "ویرایش پاداش" + }, + new + { + id = 1030603L, + Code = 1030603, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2748), + ParentId = 10306L, + Title = "حذف پاداش" + }, + new + { + id = 1030701L, + Code = 1030701, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2751), + ParentId = 10307L, + Title = "ایجاد مساعده" + }, + new + { + id = 1030702L, + Code = 1030702, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2755), + ParentId = 10307L, + Title = "ویرایش مساعده" + }, + new + { + id = 1030703L, + Code = 1030703, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2759), + ParentId = 10307L, + Title = "حذف مساعده" + }, + new + { + id = 1030801L, + Code = 1030801, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2763), + ParentId = 10308L, + Title = "ایجاد جریمه" + }, + new + { + id = 1030802L, + Code = 1030802, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2766), + ParentId = 10308L, + Title = "ایجاد عنوان جریمه" + }, + new + { + id = 1030803L, + Code = 1030803, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2770), + ParentId = 10308L, + Title = "ویرایش جریمه" + }, + new + { + id = 1030804L, + Code = 1030804, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2773), + ParentId = 10308L, + Title = "حذف جریمه" + }, + new + { + id = 1040301L, + Code = 1040301, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2776), + ParentId = 10403L, + Title = "ایجاد فیش حقوقی غیر رسمی موقت" + }, + new + { + id = 1040302L, + Code = 1040302, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2780), + ParentId = 10403L, + Title = "پرینت فیش حقوقی غیر رسمی موقت" + }, + new + { + id = 1040303L, + Code = 1040303, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2784), + ParentId = 10403L, + Title = "حذف فیش حقوقی غیر رسمی موقت" + }, + new + { + id = 1040401L, + Code = 1040401, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2788), + ParentId = 10404L, + Title = "ایجاد فیش حقوقی غیر رسمی نهایی" + }, + new + { + id = 1040402L, + Code = 1040402, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2792), + ParentId = 10404L, + Title = "پرینت فیش حقوقی غیر رسمی نهایی" + }, + new + { + id = 1040403L, + Code = 1040403, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2796), + ParentId = 10404L, + Title = "حذف فیش حقوقی غیر رسمی نهایی" + }, + new + { + id = 1040201L, + Code = 1040201, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2799), + ParentId = 10402L, + Title = "تنظیمات محاسبه فیش حقوقی" + }, + new + { + id = 1060201L, + Code = 1060201, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2804), + ParentId = 10602L, + Title = "ویرایش عکس پرسنل" + }, + new + { + id = 1060202L, + Code = 1060202, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2808), + ParentId = 10602L, + Title = "فعال و غیر فعال کردن پرسنل" + }, + new + { + id = 1060203L, + Code = 1060203, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2812), + ParentId = 10602L, + Title = "ویرایش نام مستعار" + }, + new + { + id = 1060401L, + Code = 1060401, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2816), + ParentId = 10604L, + Title = "ویرایش و افزودن سوابق حضور و غیاب" + }, + new + { + id = 1060402L, + Code = 1060402, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2821), + ParentId = 10604L, + Title = "حذف سوابق حضور و غیاب" + }); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountPermissionSubtitle4Agg.SubAccountPermissionSubtitle4", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Code") + .HasMaxLength(15) + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("id"); + + b.HasIndex("ParentId"); + + b.ToTable("SubAccountPermissionSubtitle4", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountRoleAgg.SubAccountRole", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Title") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.HasKey("id"); + + b.ToTable("SubAccountRoles", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.TaskAgg.Tasks", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ContractingPartyName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("ntext"); + + b.Property("IsActiveString") + .HasMaxLength(7) + .HasColumnType("nvarchar(7)"); + + b.Property("SenderId") + .HasColumnType("bigint"); + + b.Property("StartTaskDate") + .HasColumnType("datetime2"); + + b.Property("TaskScheduleId") + .HasColumnType("bigint"); + + b.Property("TicketId") + .HasColumnType("bigint"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("id"); + + b.HasIndex("TaskScheduleId"); + + b.ToTable("TasksManager", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.TaskMediaAgg.TaskMedia", b => + { + b.Property("MediaId") + .HasColumnType("bigint"); + + b.Property("TaskId") + .HasColumnType("bigint"); + + b.HasKey("MediaId", "TaskId"); + + b.HasIndex("TaskId"); + + b.ToTable("TasksMedias", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.TaskMessageAgg.TaskMessage", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AssignId") + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Message") + .HasColumnType("ntext"); + + b.Property("RequestedDateFa") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("TypeOfMessage") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.HasKey("id"); + + b.HasIndex("AssignId"); + + b.ToTable("TaskMessages", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.TaskMessageItemsAgg.TaskMessageItems", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("ReceiverAccountId") + .HasColumnType("bigint"); + + b.Property("SenderAccountId") + .HasColumnType("bigint"); + + b.Property("TaskMessageId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("TaskMessageId"); + + b.ToTable("TaskMessageItems", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.TaskScheduleAgg.TaskSchedule", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Count") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("LastEndTaskDate") + .HasColumnType("datetime2"); + + b.Property("Type") + .HasMaxLength(12) + .HasColumnType("nvarchar(12)"); + + b.Property("UnitNumber") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("UnitType") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.HasKey("id"); + + b.ToTable("TaskSchedules", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.TaskSubjectAgg.TaskSubject", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Subject") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("id"); + + b.ToTable("TaskSubjects", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.TicketAccessAccountAgg.TicketAccessAccount", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.HasKey("id"); + + b.ToTable("TicketAccessAccounts", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.TicketAgg.Ticket", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ContractingPartyName") + .HasMaxLength(155) + .HasColumnType("nvarchar(155)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("ntext"); + + b.Property("SenderId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("SubAccountSenderId") + .HasColumnType("bigint"); + + b.Property("TicketNumber") + .HasMaxLength(12) + .HasColumnType("nvarchar(12)"); + + b.Property("TicketType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Title") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.ToTable("Tickets", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.TicketMediasAgg.TicketMedia", b => + { + b.Property("TicketId") + .HasColumnType("bigint"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.HasKey("TicketId", "MediaId"); + + b.HasIndex("MediaId"); + + b.ToTable("TicketMedias", (string)null); + }); + + modelBuilder.Entity("TaskManager.Domain.PositionAgg.Position", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("PositionName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PositionValue") + .HasMaxLength(2) + .HasColumnType("int"); + + b.HasKey("id"); + + b.ToTable("Positions", (string)null); + }); + + modelBuilder.Entity("AccountManagement.Domain.AccountAgg.Account", b => + { + b.HasOne("TaskManager.Domain.PositionAgg.Position", "Position") + .WithMany("Accounts") + .HasForeignKey("PositionId"); + + b.HasOne("AccountManagement.Domain.RoleAgg.Role", "Role") + .WithMany("Accounts") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Position"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("AccountManagement.Domain.AccountLeftWorkAgg.AccountLeftWork", b => + { + b.HasOne("AccountManagement.Domain.AccountAgg.Account", "Account") + .WithMany("AccountLeftWorkList") + .HasForeignKey("AccountId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("AccountManagement.Domain.AdminResponseAgg.AdminResponse", b => + { + b.HasOne("AccountManagement.Domain.TicketAgg.Ticket", "Ticket") + .WithMany("AdminResponses") + .HasForeignKey("TicketId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Ticket"); + }); + + modelBuilder.Entity("AccountManagement.Domain.AdminResponseMediaAgg.AdminResponseMedia", b => + { + b.HasOne("AccountManagement.Domain.AdminResponseAgg.AdminResponse", "AdminResponse") + .WithMany("AdminResponseMedias") + .HasForeignKey("AdminResponseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media") + .WithMany("AdminResponseMedias") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AdminResponse"); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("AccountManagement.Domain.AssignAgg.Assign", b => + { + b.HasOne("AccountManagement.Domain.TaskAgg.Tasks", "Task") + .WithMany("Assigns") + .HasForeignKey("TaskId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Task"); + }); + + modelBuilder.Entity("AccountManagement.Domain.CameraAccountAgg.CameraAccount", b => + { + b.HasOne("AccountManagement.Domain.AccountAgg.Account", "Account") + .WithMany("CameraAccounts") + .HasForeignKey("AccountId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("AccountManagement.Domain.ClientResponseAgg.ClientResponse", b => + { + b.HasOne("AccountManagement.Domain.TicketAgg.Ticket", "Ticket") + .WithMany("ClientResponses") + .HasForeignKey("TicketId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Ticket"); + }); + + modelBuilder.Entity("AccountManagement.Domain.ClientResponseMediaAgg.ClientResponseMedia", b => + { + b.HasOne("AccountManagement.Domain.ClientResponseAgg.ClientResponse", "ClientResponse") + .WithMany("ClientResponseMedias") + .HasForeignKey("ClientResponseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media") + .WithMany("ClientResponseMedias") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ClientResponse"); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("AccountManagement.Domain.RoleAgg.Role", b => + { + b.OwnsMany("AccountManagement.Domain.RoleAgg.Permission", "Permissions", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("Code") + .HasColumnType("int"); + + b1.Property("RoleId") + .HasColumnType("bigint"); + + b1.HasKey("Id"); + + b1.HasIndex("RoleId"); + + b1.ToTable("RolePermissions", (string)null); + + b1.WithOwner("Role") + .HasForeignKey("RoleId"); + + b1.Navigation("Role"); + }); + + b.Navigation("Permissions"); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountAgg.SubAccount", b => + { + b.HasOne("AccountManagement.Domain.SubAccountRoleAgg.SubAccountRole", "SubAccountRole") + .WithMany("SubAccounts") + .HasForeignKey("SubAccountRoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SubAccountRole"); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountPermissionSubtitle2Agg.SubAccountPermissionSubtitle2", b => + { + b.HasOne("AccountManagement.Domain.SubAccountPermissionSubtitle1Agg.SubAccountPermissionSubtitle1", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountPermissionSubtitle3Agg.SubAccountPermissionSubtitle3", b => + { + b.HasOne("AccountManagement.Domain.SubAccountPermissionSubtitle2Agg.SubAccountPermissionSubtitle2", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountPermissionSubtitle4Agg.SubAccountPermissionSubtitle4", b => + { + b.HasOne("AccountManagement.Domain.SubAccountPermissionSubtitle3Agg.SubAccountPermissionSubtitle3", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountRoleAgg.SubAccountRole", b => + { + b.OwnsMany("AccountManagement.Domain.SubAccountRoleAgg.SubAccountRolePermission", "RolePermissions", b1 => + { + b1.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("id")); + + b1.Property("PermissionCode") + .HasColumnType("int"); + + b1.Property("SubAccountRoleId") + .HasColumnType("bigint"); + + b1.HasKey("id"); + + b1.HasIndex("SubAccountRoleId"); + + b1.ToTable("SubAccountRolePermissions", (string)null); + + b1.WithOwner("SubAccountRole") + .HasForeignKey("SubAccountRoleId"); + + b1.Navigation("SubAccountRole"); + }); + + b.Navigation("RolePermissions"); + }); + + modelBuilder.Entity("AccountManagement.Domain.TaskAgg.Tasks", b => + { + b.HasOne("AccountManagement.Domain.TaskScheduleAgg.TaskSchedule", "TaskSchedule") + .WithMany("TasksList") + .HasForeignKey("TaskScheduleId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("TaskSchedule"); + }); + + modelBuilder.Entity("AccountManagement.Domain.TaskMediaAgg.TaskMedia", b => + { + b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media") + .WithMany("TaskMedias") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("AccountManagement.Domain.TaskAgg.Tasks", "Tasks") + .WithMany("TaskMedias") + .HasForeignKey("TaskId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Media"); + + b.Navigation("Tasks"); + }); + + modelBuilder.Entity("AccountManagement.Domain.TaskMessageAgg.TaskMessage", b => + { + b.HasOne("AccountManagement.Domain.AssignAgg.Assign", "Assign") + .WithMany("TaskMessageList") + .HasForeignKey("AssignId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Assign"); + }); + + modelBuilder.Entity("AccountManagement.Domain.TaskMessageItemsAgg.TaskMessageItems", b => + { + b.HasOne("AccountManagement.Domain.TaskMessageAgg.TaskMessage", "TaskMessage") + .WithMany("TaskMessageItemsList") + .HasForeignKey("TaskMessageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TaskMessage"); + }); + + modelBuilder.Entity("AccountManagement.Domain.TicketMediasAgg.TicketMedia", b => + { + b.HasOne("AccountManagement.Domain.MediaAgg.Media", "Media") + .WithMany("TicketMedias") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("AccountManagement.Domain.TicketAgg.Ticket", "Ticket") + .WithMany("TicketMedias") + .HasForeignKey("TicketId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Media"); + + b.Navigation("Ticket"); + }); + + modelBuilder.Entity("AccountManagement.Domain.AccountAgg.Account", b => + { + b.Navigation("AccountLeftWorkList"); + + b.Navigation("CameraAccounts"); + }); + + modelBuilder.Entity("AccountManagement.Domain.AdminResponseAgg.AdminResponse", b => + { + b.Navigation("AdminResponseMedias"); + }); + + modelBuilder.Entity("AccountManagement.Domain.AssignAgg.Assign", b => + { + b.Navigation("TaskMessageList"); + }); + + modelBuilder.Entity("AccountManagement.Domain.ClientResponseAgg.ClientResponse", b => + { + b.Navigation("ClientResponseMedias"); + }); + + modelBuilder.Entity("AccountManagement.Domain.MediaAgg.Media", b => + { + b.Navigation("AdminResponseMedias"); + + b.Navigation("ClientResponseMedias"); + + b.Navigation("TaskMedias"); + + b.Navigation("TicketMedias"); + }); + + modelBuilder.Entity("AccountManagement.Domain.RoleAgg.Role", b => + { + b.Navigation("Accounts"); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountPermissionSubtitle1Agg.SubAccountPermissionSubtitle1", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountPermissionSubtitle2Agg.SubAccountPermissionSubtitle2", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountPermissionSubtitle3Agg.SubAccountPermissionSubtitle3", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("AccountManagement.Domain.SubAccountRoleAgg.SubAccountRole", b => + { + b.Navigation("SubAccounts"); + }); + + modelBuilder.Entity("AccountManagement.Domain.TaskAgg.Tasks", b => + { + b.Navigation("Assigns"); + + b.Navigation("TaskMedias"); + }); + + modelBuilder.Entity("AccountManagement.Domain.TaskMessageAgg.TaskMessage", b => + { + b.Navigation("TaskMessageItemsList"); + }); + + modelBuilder.Entity("AccountManagement.Domain.TaskScheduleAgg.TaskSchedule", b => + { + b.Navigation("TasksList"); + }); + + modelBuilder.Entity("AccountManagement.Domain.TicketAgg.Ticket", b => + { + b.Navigation("AdminResponses"); + + b.Navigation("ClientResponses"); + + b.Navigation("TicketMedias"); + }); + + modelBuilder.Entity("TaskManager.Domain.PositionAgg.Position", b => + { + b.Navigation("Accounts"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/AccountMangement.Infrastructure.EFCore/Migrations/20250104133725_SeedPermission.cs b/AccountMangement.Infrastructure.EFCore/Migrations/20250104133725_SeedPermission.cs new file mode 100644 index 00000000..8832134f --- /dev/null +++ b/AccountMangement.Infrastructure.EFCore/Migrations/20250104133725_SeedPermission.cs @@ -0,0 +1,408 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional + +namespace AccountMangement.Infrastructure.EFCore.Migrations +{ + /// + public partial class SeedPermission : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.InsertData( + table: "SubAccountPermissionSubtitle1", + columns: new[] { "id", "Code", "CreationDate", "Title" }, + values: new object[,] + { + { 102L, 102, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2250), "عملیات کارگاه" }, + { 103L, 103, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2262), "عملیات پرسنل" }, + { 104L, 104, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2263), "فیش حقوقی غیر رسمی" }, + { 106L, 106, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2265), "حضور و غیاب" }, + { 110L, 110, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2267), "کارپوشه" }, + { 111L, 111, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2268), "صورت حساب های مالی" }, + { 112L, 112, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2268), "مدیریت کاربران" }, + { 113L, 113, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2264), "گزارشات" } + }); + + migrationBuilder.InsertData( + table: "SubAccountPermissionSubtitle2", + columns: new[] { "id", "Code", "CreationDate", "ParentId", "Title" }, + values: new object[,] + { + { 10201L, 10201, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2358), 102L, "لیست قرارداد" }, + { 10202L, 10202, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2361), 102L, "لیست فیش حقوقی" }, + { 10203L, 10203, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2363), 102L, "لیست بیمه" }, + { 10204L, 10204, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2365), 102L, "گزارش وضعیت پرسنل به صورت گروهی" }, + { 10205L, 10205, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2366), 102L, "گزارش وضعیت پرسنل به صورت انفرادی" }, + { 10206L, 10206, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2368), 102L, "لیست کل پرسنل" }, + { 10301L, 10301, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2370), 103L, "ثبت مرخصی" }, + { 10302L, 10302, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2372), 103L, "لیست کل مرخصی" }, + { 10303L, 10303, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2374), 103L, "عملیات مدارک پرسنل" }, + { 10304L, 10304, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2377), 103L, "عملیات پرداخت حقوق پرسنل" }, + { 10305L, 10305, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2378), 103L, "عملیات وام" }, + { 10306L, 10306, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2380), 103L, "عملیات پاداش" }, + { 10307L, 10307, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2382), 103L, "عملیات مساعده" }, + { 10308L, 10308, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2383), 103L, "عملیات جرایم" }, + { 10402L, 10402, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2385), 104L, "تنظیم گروه بندی و حقوق پرسنل" }, + { 10403L, 10403, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2387), 104L, "لیست فیش حقوقی موقت" }, + { 10404L, 10404, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2388), 104L, "لیست فیش حقوقی نهایی" }, + { 10601L, 10601, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2394), 106L, "ارتقا یا تغییر سرویس حضور غیاب" }, + { 10602L, 10602, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2395), 106L, "آپلود عکس پرسنل" }, + { 10603L, 10603, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2400), 106L, "حضور و غیاب جاری" }, + { 10604L, 10604, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2398), 106L, "سوابق حضور و غیاب" }, + { 10605L, 10605, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2401), 106L, "عملیات گروهبندی" }, + { 10606L, 10606, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2404), 106L, "تنظیم ساعت فعالیت مجموعه" }, + { 10607L, 10607, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2406), 106L, "تنظیمات حساب کاربری دوربین" }, + { 11001L, 11001, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2408), 110L, "حضور و غیاب کارپوشه" }, + { 11002L, 11002, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2411), 110L, "قرارداد و فیش حقوقی کارپوشه" }, + { 11003L, 11003, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2413), 110L, "بیمه کارپوشه" }, + { 11301L, 11301, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2391), 113L, "گزارشات تجمیع حقوق پرسنل" } + }); + + migrationBuilder.InsertData( + table: "SubAccountPermissionSubtitle3", + columns: new[] { "id", "Code", "CreationDate", "ParentId", "Title" }, + values: new object[,] + { + { 1030501L, 1030501, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2701), 10305L, "ایجاد وام" }, + { 1030502L, 1030502, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2706), 10305L, "ویرایش وام" }, + { 1030503L, 1030503, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2710), 10305L, "حذف وام" }, + { 1030601L, 1030601, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2713), 10306L, "ایجاد پاداش" }, + { 1030602L, 1030602, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2716), 10306L, "ویرایش پاداش" }, + { 1030603L, 1030603, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2748), 10306L, "حذف پاداش" }, + { 1030701L, 1030701, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2751), 10307L, "ایجاد مساعده" }, + { 1030702L, 1030702, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2755), 10307L, "ویرایش مساعده" }, + { 1030703L, 1030703, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2759), 10307L, "حذف مساعده" }, + { 1030801L, 1030801, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2763), 10308L, "ایجاد جریمه" }, + { 1030802L, 1030802, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2766), 10308L, "ایجاد عنوان جریمه" }, + { 1030803L, 1030803, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2770), 10308L, "ویرایش جریمه" }, + { 1030804L, 1030804, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2773), 10308L, "حذف جریمه" }, + { 1040201L, 1040201, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2799), 10402L, "تنظیمات محاسبه فیش حقوقی" }, + { 1040301L, 1040301, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2776), 10403L, "ایجاد فیش حقوقی غیر رسمی موقت" }, + { 1040302L, 1040302, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2780), 10403L, "پرینت فیش حقوقی غیر رسمی موقت" }, + { 1040303L, 1040303, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2784), 10403L, "حذف فیش حقوقی غیر رسمی موقت" }, + { 1040401L, 1040401, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2788), 10404L, "ایجاد فیش حقوقی غیر رسمی نهایی" }, + { 1040402L, 1040402, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2792), 10404L, "پرینت فیش حقوقی غیر رسمی نهایی" }, + { 1040403L, 1040403, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2796), 10404L, "حذف فیش حقوقی غیر رسمی نهایی" }, + { 1060201L, 1060201, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2804), 10602L, "ویرایش عکس پرسنل" }, + { 1060202L, 1060202, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2808), 10602L, "فعال و غیر فعال کردن پرسنل" }, + { 1060203L, 1060203, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2812), 10602L, "ویرایش نام مستعار" }, + { 1060401L, 1060401, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2816), 10604L, "ویرایش و افزودن سوابق حضور و غیاب" }, + { 1060402L, 1060402, new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2821), 10604L, "حذف سوابق حضور و غیاب" } + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle1", + keyColumn: "id", + keyValue: 111L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle1", + keyColumn: "id", + keyValue: 112L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10201L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10202L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10203L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10204L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10205L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10206L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10301L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10302L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10303L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10304L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10601L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10603L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10605L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10606L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10607L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 11001L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 11002L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 11003L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 11301L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1030501L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1030502L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1030503L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1030601L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1030602L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1030603L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1030701L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1030702L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1030703L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1030801L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1030802L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1030803L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1030804L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1040201L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1040301L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1040302L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1040303L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1040401L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1040402L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1040403L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1060201L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1060202L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1060203L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1060401L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle3", + keyColumn: "id", + keyValue: 1060402L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle1", + keyColumn: "id", + keyValue: 102L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle1", + keyColumn: "id", + keyValue: 110L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle1", + keyColumn: "id", + keyValue: 113L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10305L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10306L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10307L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10308L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10402L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10403L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10404L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10602L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle2", + keyColumn: "id", + keyValue: 10604L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle1", + keyColumn: "id", + keyValue: 103L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle1", + keyColumn: "id", + keyValue: 104L); + + migrationBuilder.DeleteData( + table: "SubAccountPermissionSubtitle1", + keyColumn: "id", + keyValue: 106L); + } + } +} diff --git a/AccountMangement.Infrastructure.EFCore/Migrations/AccountContextModelSnapshot.cs b/AccountMangement.Infrastructure.EFCore/Migrations/AccountContextModelSnapshot.cs index fef8fd2c..630337d3 100644 --- a/AccountMangement.Infrastructure.EFCore/Migrations/AccountContextModelSnapshot.cs +++ b/AccountMangement.Infrastructure.EFCore/Migrations/AccountContextModelSnapshot.cs @@ -472,6 +472,64 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations b.HasKey("id"); b.ToTable("SubAccountPermissionSubtitle1", (string)null); + + b.HasData( + new + { + id = 102L, + Code = 102, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2250), + Title = "عملیات کارگاه" + }, + new + { + id = 103L, + Code = 103, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2262), + Title = "عملیات پرسنل" + }, + new + { + id = 104L, + Code = 104, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2263), + Title = "فیش حقوقی غیر رسمی" + }, + new + { + id = 113L, + Code = 113, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2264), + Title = "گزارشات" + }, + new + { + id = 106L, + Code = 106, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2265), + Title = "حضور و غیاب" + }, + new + { + id = 110L, + Code = 110, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2267), + Title = "کارپوشه" + }, + new + { + id = 111L, + Code = 111, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2268), + Title = "صورت حساب های مالی" + }, + new + { + id = 112L, + Code = 112, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2268), + Title = "مدیریت کاربران" + }); }); modelBuilder.Entity("AccountManagement.Domain.SubAccountPermissionSubtitle2Agg.SubAccountPermissionSubtitle2", b => @@ -502,6 +560,232 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations b.HasIndex("ParentId"); b.ToTable("SubAccountPermissionSubtitle2", (string)null); + + b.HasData( + new + { + id = 10201L, + Code = 10201, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2358), + ParentId = 102L, + Title = "لیست قرارداد" + }, + new + { + id = 10202L, + Code = 10202, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2361), + ParentId = 102L, + Title = "لیست فیش حقوقی" + }, + new + { + id = 10203L, + Code = 10203, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2363), + ParentId = 102L, + Title = "لیست بیمه" + }, + new + { + id = 10204L, + Code = 10204, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2365), + ParentId = 102L, + Title = "گزارش وضعیت پرسنل به صورت گروهی" + }, + new + { + id = 10205L, + Code = 10205, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2366), + ParentId = 102L, + Title = "گزارش وضعیت پرسنل به صورت انفرادی" + }, + new + { + id = 10206L, + Code = 10206, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2368), + ParentId = 102L, + Title = "لیست کل پرسنل" + }, + new + { + id = 10301L, + Code = 10301, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2370), + ParentId = 103L, + Title = "ثبت مرخصی" + }, + new + { + id = 10302L, + Code = 10302, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2372), + ParentId = 103L, + Title = "لیست کل مرخصی" + }, + new + { + id = 10303L, + Code = 10303, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2374), + ParentId = 103L, + Title = "عملیات مدارک پرسنل" + }, + new + { + id = 10304L, + Code = 10304, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2377), + ParentId = 103L, + Title = "عملیات پرداخت حقوق پرسنل" + }, + new + { + id = 10305L, + Code = 10305, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2378), + ParentId = 103L, + Title = "عملیات وام" + }, + new + { + id = 10306L, + Code = 10306, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2380), + ParentId = 103L, + Title = "عملیات پاداش" + }, + new + { + id = 10307L, + Code = 10307, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2382), + ParentId = 103L, + Title = "عملیات مساعده" + }, + new + { + id = 10308L, + Code = 10308, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2383), + ParentId = 103L, + Title = "عملیات جرایم" + }, + new + { + id = 10402L, + Code = 10402, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2385), + ParentId = 104L, + Title = "تنظیم گروه بندی و حقوق پرسنل" + }, + new + { + id = 10403L, + Code = 10403, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2387), + ParentId = 104L, + Title = "لیست فیش حقوقی موقت" + }, + new + { + id = 10404L, + Code = 10404, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2388), + ParentId = 104L, + Title = "لیست فیش حقوقی نهایی" + }, + new + { + id = 11301L, + Code = 11301, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2391), + ParentId = 113L, + Title = "گزارشات تجمیع حقوق پرسنل" + }, + new + { + id = 10601L, + Code = 10601, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2394), + ParentId = 106L, + Title = "ارتقا یا تغییر سرویس حضور غیاب" + }, + new + { + id = 10602L, + Code = 10602, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2395), + ParentId = 106L, + Title = "آپلود عکس پرسنل" + }, + new + { + id = 10604L, + Code = 10604, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2398), + ParentId = 106L, + Title = "سوابق حضور و غیاب" + }, + new + { + id = 10603L, + Code = 10603, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2400), + ParentId = 106L, + Title = "حضور و غیاب جاری" + }, + new + { + id = 10605L, + Code = 10605, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2401), + ParentId = 106L, + Title = "عملیات گروهبندی" + }, + new + { + id = 10606L, + Code = 10606, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2404), + ParentId = 106L, + Title = "تنظیم ساعت فعالیت مجموعه" + }, + new + { + id = 10607L, + Code = 10607, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2406), + ParentId = 106L, + Title = "تنظیمات حساب کاربری دوربین" + }, + new + { + id = 11001L, + Code = 11001, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2408), + ParentId = 110L, + Title = "حضور و غیاب کارپوشه" + }, + new + { + id = 11002L, + Code = 11002, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2411), + ParentId = 110L, + Title = "قرارداد و فیش حقوقی کارپوشه" + }, + new + { + id = 11003L, + Code = 11003, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2413), + ParentId = 110L, + Title = "بیمه کارپوشه" + }); }); modelBuilder.Entity("AccountManagement.Domain.SubAccountPermissionSubtitle3Agg.SubAccountPermissionSubtitle3", b => @@ -532,6 +816,208 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations b.HasIndex("ParentId"); b.ToTable("SubAccountPermissionSubtitle3", (string)null); + + b.HasData( + new + { + id = 1030501L, + Code = 1030501, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2701), + ParentId = 10305L, + Title = "ایجاد وام" + }, + new + { + id = 1030502L, + Code = 1030502, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2706), + ParentId = 10305L, + Title = "ویرایش وام" + }, + new + { + id = 1030503L, + Code = 1030503, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2710), + ParentId = 10305L, + Title = "حذف وام" + }, + new + { + id = 1030601L, + Code = 1030601, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2713), + ParentId = 10306L, + Title = "ایجاد پاداش" + }, + new + { + id = 1030602L, + Code = 1030602, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2716), + ParentId = 10306L, + Title = "ویرایش پاداش" + }, + new + { + id = 1030603L, + Code = 1030603, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2748), + ParentId = 10306L, + Title = "حذف پاداش" + }, + new + { + id = 1030701L, + Code = 1030701, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2751), + ParentId = 10307L, + Title = "ایجاد مساعده" + }, + new + { + id = 1030702L, + Code = 1030702, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2755), + ParentId = 10307L, + Title = "ویرایش مساعده" + }, + new + { + id = 1030703L, + Code = 1030703, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2759), + ParentId = 10307L, + Title = "حذف مساعده" + }, + new + { + id = 1030801L, + Code = 1030801, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2763), + ParentId = 10308L, + Title = "ایجاد جریمه" + }, + new + { + id = 1030802L, + Code = 1030802, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2766), + ParentId = 10308L, + Title = "ایجاد عنوان جریمه" + }, + new + { + id = 1030803L, + Code = 1030803, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2770), + ParentId = 10308L, + Title = "ویرایش جریمه" + }, + new + { + id = 1030804L, + Code = 1030804, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2773), + ParentId = 10308L, + Title = "حذف جریمه" + }, + new + { + id = 1040301L, + Code = 1040301, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2776), + ParentId = 10403L, + Title = "ایجاد فیش حقوقی غیر رسمی موقت" + }, + new + { + id = 1040302L, + Code = 1040302, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2780), + ParentId = 10403L, + Title = "پرینت فیش حقوقی غیر رسمی موقت" + }, + new + { + id = 1040303L, + Code = 1040303, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2784), + ParentId = 10403L, + Title = "حذف فیش حقوقی غیر رسمی موقت" + }, + new + { + id = 1040401L, + Code = 1040401, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2788), + ParentId = 10404L, + Title = "ایجاد فیش حقوقی غیر رسمی نهایی" + }, + new + { + id = 1040402L, + Code = 1040402, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2792), + ParentId = 10404L, + Title = "پرینت فیش حقوقی غیر رسمی نهایی" + }, + new + { + id = 1040403L, + Code = 1040403, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2796), + ParentId = 10404L, + Title = "حذف فیش حقوقی غیر رسمی نهایی" + }, + new + { + id = 1040201L, + Code = 1040201, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2799), + ParentId = 10402L, + Title = "تنظیمات محاسبه فیش حقوقی" + }, + new + { + id = 1060201L, + Code = 1060201, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2804), + ParentId = 10602L, + Title = "ویرایش عکس پرسنل" + }, + new + { + id = 1060202L, + Code = 1060202, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2808), + ParentId = 10602L, + Title = "فعال و غیر فعال کردن پرسنل" + }, + new + { + id = 1060203L, + Code = 1060203, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2812), + ParentId = 10602L, + Title = "ویرایش نام مستعار" + }, + new + { + id = 1060401L, + Code = 1060401, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2816), + ParentId = 10604L, + Title = "ویرایش و افزودن سوابق حضور و غیاب" + }, + new + { + id = 1060402L, + Code = 1060402, + CreationDate = new DateTime(2025, 1, 4, 17, 7, 24, 472, DateTimeKind.Local).AddTicks(2821), + ParentId = 10604L, + Title = "حذف سوابق حضور و غیاب" + }); }); modelBuilder.Entity("AccountManagement.Domain.SubAccountPermissionSubtitle4Agg.SubAccountPermissionSubtitle4", b => diff --git a/AccountMangement.Infrastructure.EFCore/Repository/SubAccountPermissionSubtitle1Repository.cs b/AccountMangement.Infrastructure.EFCore/Repository/SubAccountPermissionSubtitle1Repository.cs index 8ea2044d..84ed1e59 100644 --- a/AccountMangement.Infrastructure.EFCore/Repository/SubAccountPermissionSubtitle1Repository.cs +++ b/AccountMangement.Infrastructure.EFCore/Repository/SubAccountPermissionSubtitle1Repository.cs @@ -1,26 +1,26 @@  using _0_Framework.InfraStructure; using AccountManagement.Application.Contracts.SubAccountPermissionSubtitle; +using AccountManagement.Domain.SubAccountAgg; using AccountManagement.Domain.SubAccountPermissionSubtitle1Agg; using Microsoft.EntityFrameworkCore; using System.Collections.Generic; using System.Linq; -using AccountManagement.Domain.SubAccountAgg; namespace AccountMangement.Infrastructure.EFCore.Repository { - public class SubAccountPermissionSubtitle1Repository : RepositoryBase, - ISubAccountPermissionSubtitle1Repository - { - private readonly AccountContext _context; + public class SubAccountPermissionSubtitle1Repository : RepositoryBase, + ISubAccountPermissionSubtitle1Repository + { + private readonly AccountContext _context; - public SubAccountPermissionSubtitle1Repository(AccountContext context) : base(context) - { - _context = context; - } + public SubAccountPermissionSubtitle1Repository(AccountContext context) : base(context) + { + _context = context; + } - public List GetAllWithChildren() - { + public List GetAllWithChildren() + { return _context.SubAccountPermissionSubtitle1Collection.Include(x => x.Children) .ThenInclude(x => x.Children) .ThenInclude(x => x.Children).AsSplitQuery().Select(x => new SubAccountPermissionSubtitleViewModel @@ -52,26 +52,26 @@ namespace AccountMangement.Infrastructure.EFCore.Repository } - public List GetAllPermissionCodes() - { - var data = GetAllWithChildren(); - return Flatten(data); + public List GetAllPermissionCodes() + { + var data = GetAllWithChildren(); + return Flatten(data); - } + } - public List Flatten(List hierarchy) - { - var flatList = new List(); - foreach (var item in hierarchy) - { - flatList.Add(item.Code); - if (item.Children != null && item.Children.Any()) - { - flatList.AddRange(Flatten(item.Children.ToList())); - } - } + public List Flatten(List hierarchy) + { + var flatList = new List(); + foreach (var item in hierarchy) + { + flatList.Add(item.Code); + if (item.Children != null && item.Children.Any()) + { + flatList.AddRange(Flatten(item.Children.ToList())); + } + } - return flatList; - } - } + return flatList; + } + } } diff --git a/AccountMangement.Infrastructure.EFCore/Seed/SubAccountPermissionSeeder.cs b/AccountMangement.Infrastructure.EFCore/Seed/SubAccountPermissionSeeder.cs new file mode 100644 index 00000000..533ec254 --- /dev/null +++ b/AccountMangement.Infrastructure.EFCore/Seed/SubAccountPermissionSeeder.cs @@ -0,0 +1,45 @@ +using _0_Framework.Application; +using AccountManagement.Domain.SubAccountPermissionSubtitle1Agg; +using AccountManagement.Domain.SubAccountPermissionSubtitle2Agg; +using AccountManagement.Domain.SubAccountPermissionSubtitle3Agg; +using AccountManagement.Domain.SubAccountPermissionSubtitle4Agg; +using Microsoft.EntityFrameworkCore; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; + +namespace AccountMangement.Infrastructure.EFCore.Seed +{ + public static class SubAccountPermissionSeeder + { + public static void Seed(ModelBuilder builder) + { + + + PropertyInfo[] properties = typeof(SubAccountPermissionHelper).GetProperties(BindingFlags.Static | BindingFlags.Public); + var permissionsList = properties + .Where(x => x.PropertyType == typeof(SubAccountPermissionDto)).Select(x => (SubAccountPermissionDto)x.GetValue(null)).ToList(); + + List result1 = permissionsList.Where(x => x.ParentId == 0) + .Select(x => new SubAccountPermissionSubtitle1(x.Name, x.Code) { id = x.Id }).ToList(); + + + List result2 = permissionsList.Where(x => result1.Any(y => y.id == x.ParentId)) + .Select(x => new SubAccountPermissionSubtitle2(x.Name, x.Code, x.ParentId) { id = x.Id }).ToList(); + + + List result3 = permissionsList.Where(x => result2.Any(y => y.id == x.ParentId)) + .Select(x => new SubAccountPermissionSubtitle3(x.Name, x.Code, x.ParentId) { id = x.Id }).ToList(); + + + List result4 = permissionsList.Where(x => result3.Any(y => y.id == x.ParentId)) + .Select(x => new SubAccountPermissionSubtitle4(x.Name, x.Code, x.ParentId) { id = x.Id }).ToList(); + + builder.Entity().HasData(result1); + builder.Entity().HasData(result2); + builder.Entity().HasData(result3); + builder.Entity().HasData(result4); + + } + } +} diff --git a/ServiceHost/Areas/Client/Pages/Company/SubAccounts/Index.cshtml b/ServiceHost/Areas/Client/Pages/Company/SubAccounts/Index.cshtml index d960b792..05e15720 100644 --- a/ServiceHost/Areas/Client/Pages/Company/SubAccounts/Index.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/SubAccounts/Index.cshtml @@ -371,5 +371,5 @@ var changeSubAccountChangeStatusAjax = `@Url.Page("./Index", "SubAccountChangeStatus")`; - + } diff --git a/ServiceHost/Areas/Client/Pages/Company/SubAccounts/ModalCreateRole.cshtml b/ServiceHost/Areas/Client/Pages/Company/SubAccounts/ModalCreateRole.cshtml index 17ad6a29..210bd6e8 100644 --- a/ServiceHost/Areas/Client/Pages/Company/SubAccounts/ModalCreateRole.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/SubAccounts/ModalCreateRole.cshtml @@ -3,95 +3,7 @@ @{ string clientVersion = _0_Framework.Application.Version.StyleVersion; - - - + }
@@ -122,7 +34,6 @@
- @@ -161,4 +72,4 @@ var saveNewRoleSubAccountAjax = `@Url.Page("./Index", "CreateRole")`; var permissionListAjax = `@Url.Page("./Index", "Permissions")`; - \ No newline at end of file + \ No newline at end of file diff --git a/ServiceHost/Areas/Client/Pages/Company/SubAccounts/ModalEditRole.cshtml b/ServiceHost/Areas/Client/Pages/Company/SubAccounts/ModalEditRole.cshtml index c2a272f4..0a28eb8d 100644 --- a/ServiceHost/Areas/Client/Pages/Company/SubAccounts/ModalEditRole.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/SubAccounts/ModalEditRole.cshtml @@ -3,97 +3,8 @@ @{ string clientVersion = _0_Framework.Application.Version.StyleVersion; - + - } @@ -166,4 +77,4 @@ var permissionListAjax = `@Url.Page("./Index", "Permissions")`; var itemsPermission = @Html.Raw(Json.Serialize(Model.Permissions)); - \ No newline at end of file + \ No newline at end of file diff --git a/ServiceHost/Areas/Client/Pages/Shared/_Menu.cshtml b/ServiceHost/Areas/Client/Pages/Shared/_Menu.cshtml index 7e7c5ad3..0aa84e6f 100644 --- a/ServiceHost/Areas/Client/Pages/Shared/_Menu.cshtml +++ b/ServiceHost/Areas/Client/Pages/Shared/_Menu.cshtml @@ -1,7 +1,10 @@ @using System.Reflection.Metadata +@using System.Security.Claims +@using _0_Framework.Application @using AccountManagement.Application.Contracts.Account @using CompanyManagment.App.Contracts.FinancialStatment @using CompanyManagment.App.Contracts.PersonalContractingParty +@using Microsoft.AspNetCore.Mvc.TagHelpers @using WorkFlow.Application.Contracts.WorkFlow @inject _0_Framework.Application.IAuthHelper AuthHelper; @@ -11,7 +14,7 @@ @{ var currentAccount = AuthHelper.CurrentAccountInfo(); - var statmentInfo = ContractingPartyApp.GetContractingpartyIdByAccountId(currentAccount.Id); + var statementInfo = ContractingPartyApp.GetContractingpartyIdByAccountId(currentAccount.Id); long workshopId = currentAccount.WorkshopList.First(x => x.Slug == currentAccount.WorkshopSlug).Id; } @@ -30,7 +33,7 @@