diff --git a/0_Framework/Application/SubAccountPermissionHelper.cs b/0_Framework/Application/SubAccountPermissionHelper.cs
index 31682848..43a5bdff 100644
--- a/0_Framework/Application/SubAccountPermissionHelper.cs
+++ b/0_Framework/Application/SubAccountPermissionHelper.cs
@@ -72,16 +72,40 @@
///
public const int PaymentToEmployeePermissionCode = 10304;
- #region عملیات وام
///
- /// عملیات وام
+ /// عملیات حساب بانکی پرسنل
///
- public const int LoanOperationsPermissionCode = 10305;
+ public const int EmployeeBankInformationPermissionCode = 10309;
///
/// ایجاد وام
///
- public const int CreateLoanPermissionCode = 1030501;
+ public const int CreateLoanPermissionCode = 114;
+
+ ///
+ /// ایجاد پاداش
+ ///
+ public const int CreateRewardPermissionCode = 115;
+
+ ///
+ /// ایجاد مساعده
+ ///
+ public const int CreateSalaryAidPermissionCode = 116;
+
+ ///
+ /// ایجاد جریمه
+ ///
+ public const int CreateFinePermissionCode = 117;
+ #region عملیات وام
+ ///
+ /// عملیات وام
+ ///
+ public const int LoanOperationsPermissionCode = 10305;
+
+ /////
+ ///// ایجاد وام
+ /////
+ //public const int CreateLoanPermissionCode = 1030501;
///
/// ویرایش وام
@@ -100,10 +124,10 @@
///
public const int RewardOperationsPermissionCode = 10306;
- ///
- /// ایجاد پاداش
- ///
- public const int CreateRewardPermissionCode = 1030601;
+ /////
+ ///// ایجاد پاداش
+ /////
+ //public const int CreateRewardPermissionCode = 1030601;
///
/// ویرایش پاداش
@@ -123,10 +147,10 @@
///
public const int SalaryAidOperationsPermissionCode = 10307;
- ///
- /// ایجاد مساعده
- ///
- public const int CreateSalaryAidPermissionCode = 1030701;
+ /////
+ ///// ایجاد مساعده
+ /////
+ //public const int CreateSalaryAidPermissionCode = 1030701;
///
/// ویرایش مساعده
@@ -145,10 +169,10 @@
///
public const int FineOperationsPermissionCode = 10308;
- ///
- /// ایجاد جریمه
- ///
- public const int CreateFinePermissionCode = 1030801;
+ /////
+ ///// ایجاد جریمه
+ /////
+ //public const int CreateFinePermissionCode = 1030801;
///
/// ایجاد عنوان جریمه
@@ -409,7 +433,39 @@
Code = PersonnelOperationsPermissionCode,
ParentId = 0
};
- public static SubAccountPermissionDto CustomizeCheckoutOperationsPermission { get; } = new()
+
+ public static SubAccountPermissionDto LoanOperationsPermission { get; } = new()
+ {
+ Id = LoanOperationsPermissionCode,
+ Name = "عملیات وام",
+ Code = LoanOperationsPermissionCode,
+ ParentId = 0
+ };
+
+ public static SubAccountPermissionDto RewardOperationsPermission { get; } = new()
+ {
+ Id = RewardOperationsPermissionCode,
+ Name = "عملیات پاداش",
+ Code = RewardOperationsPermissionCode,
+ ParentId = 0
+ };
+
+ public static SubAccountPermissionDto SalaryAidOperationsPermission { get; } = new()
+ {
+ Id = SalaryAidOperationsPermissionCode,
+ Name = "عملیات مساعده",
+ Code = SalaryAidOperationsPermissionCode,
+ ParentId = 0
+ };
+
+ public static SubAccountPermissionDto FineOperationsPermission { get; } = new()
+ {
+ Id = FineOperationsPermissionCode,
+ Name = "عملیات جرایم",
+ Code = FineOperationsPermissionCode,
+ ParentId = PersonnelOperationsPermissionCode
+ };
+ public static SubAccountPermissionDto CustomizeCheckoutOperationsPermission { get; } = new()
{
Id = CustomizeCheckoutOperationsPermissionCode,
Name = "فیش حقوقی غیر رسمی",
@@ -540,6 +596,7 @@
ParentId = PersonnelOperationsPermissionCode
};
+
public static SubAccountPermissionDto PaymentToEmployeePermission { get; } = new()
{
Id = PaymentToEmployeePermissionCode,
@@ -548,44 +605,20 @@
ParentId = PersonnelOperationsPermissionCode
};
- public static SubAccountPermissionDto LoanOperationsPermission { get; } = new()
+ public static SubAccountPermissionDto EmployeeBankInformationPermission { get; } = new()
{
- Id = LoanOperationsPermissionCode,
- Name = "عملیات وام",
- Code = LoanOperationsPermissionCode,
- ParentId = PersonnelOperationsPermissionCode
+ Id = EmployeeBankInformationPermissionCode,
+ Name = "عملیات حساب بانکی پرسنل",
+ Code = EmployeeBankInformationPermissionCode,
+ ParentId = PersonnelOperationsPermissionCode
};
- public static SubAccountPermissionDto RewardOperationsPermission { get; } = new()
- {
- Id = RewardOperationsPermissionCode,
- Name = "عملیات پاداش",
- Code = RewardOperationsPermissionCode,
- ParentId = PersonnelOperationsPermissionCode
- };
+ #endregion
- 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
+ #region فیش حقوقی غیر رسمی,ParentId = CustomizeCheckoutOperationsPermissionCode
- public static SubAccountPermissionDto CustomizeCheckoutSetGroupAndSalaryPermission { get; } = new()
+ public static SubAccountPermissionDto CustomizeCheckoutSetGroupAndSalaryPermission { get; } = new()
{
Id = CustomizeCheckoutSetGroupAndSalaryPermissionCode,
Name = "تنظیم گروه بندی و حقوق پرسنل",
diff --git a/0_Framework/Excel/Checkout/CustomizeCheckoutExcelGenerator.cs b/0_Framework/Excel/Checkout/CustomizeCheckoutExcelGenerator.cs
index 6909ca57..1c591f5a 100644
--- a/0_Framework/Excel/Checkout/CustomizeCheckoutExcelGenerator.cs
+++ b/0_Framework/Excel/Checkout/CustomizeCheckoutExcelGenerator.cs
@@ -1,180 +1,201 @@
using System.Collections.Generic;
using System.Drawing;
using System.IO;
+using System.Linq;
using _0_Framework.Application;
using OfficeOpenXml;
namespace _0_Framework.Excel.Checkout;
+using OfficeOpenXml;
+using OfficeOpenXml.Style;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+
public class CustomizeCheckoutExcelGenerator
{
- public static byte[] GenerateCheckoutTempExcelInfo(List data)
- {
- OfficeOpenXml.ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
- using var package = new OfficeOpenXml.ExcelPackage();
- var worksheet = package.Workbook.Worksheets.Add("Sheet1");
-
- //worksheet.Cells["A1:AC1"].Merge = true;
-
- //var headerImagePath = Path.Combine("wwwroot", "Excel", "header", "2.png");
- //using (var stream = new FileStream(headerImagePath, FileMode.Open, FileAccess.Read))
- //{
- // var picture = worksheet.Drawings.AddPicture("HeaderImage", stream);
- // picture.SetPosition(0, 0, 0, 0); // Set position to the merged cell
- // //picture.SetSize(600, 75); // Adjust the size as needed
- //}
+ public static byte[] GenerateCheckoutTempExcelInfo(List data, List selectedParameters)
+ {
+ OfficeOpenXml.ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+ using var package = new ExcelPackage();
+ var worksheet = package.Workbook.Worksheets.Add("Sheet1");
- string[] headers =
- [
- //جزییات
- "ردیف", "سال", "ماه", "نام و نام خانوادگی", "شماره پرسنلی", "کدملی", "روز کارکرد",
-
- //مطالبات
- "حقوق ماهانه", "پاداش", "جمعه کاری", "اضافه کاری", "نوبت کاری", "شب کاری",
- "حق تاهل", "حق فرزند", "عیدی", "سنوات", "مزد مرخصی",
-
- //کسورات
- "غیبت", "تاخیر در ورود", "تعجیل در خروج", "مساعده", "قسط وام", "جریمه", "حق بیمه", "مالیات",
-
- //مجموع
- "جمع مطالبات", "جمع کسورات", "مبلغ قابل پرداخت"
- ];
+ // Define headers
+ Dictionary headers = new Dictionary
+ {
+ { "Month", "ماه" },
+ { "Year", "سال" },
+ { "EmployeeFullName", "نام و نام خانوادگی" },
+ { "PersonnelCodeString", "شماره پرسنلی" },
+ { "NationalCode", "کدملی" },
+ { "SumOfWorkingDays", "روز کارکرد" },
+ { "MonthlySalary", "حقوق ماهانه" },
+ { "BaseYearsPay", "سنوات" },
+ { "MarriedAllowance", "حق تاهل" },
+ { "OvertimePay", "اضافه کاری" },
+ { "NightworkPay", "شب کاری" },
+ { "FridayPay", "جمعه کاری" },
+ { "MissionPay", "مأموریت" },
+ { "ShiftPay", "نوبت کاری" },
+ { "FamilyAllowance", "حق فرزند" },
+ { "BonusesPay", "پاداش" },
+ { "LeavePay", "مزد مرخصی" },
+ { "RewardPay", "پاداش" },
+ { "FineDeduction", "جریمه" },
+ { "InsuranceDeduction", "حق بیمه" },
+ { "TaxDeducation", "مالیات" },
+ { "InstallmentDeduction", "قسط وام" },
+ { "SalaryAidDeduction", "مساعده" },
+ { "AbsenceDeduction", "غیبت" },
+ { "EarlyExitDeduction", "تعجیل در خروج" },
+ { "LateToWorkDeduction", "تاخیر در ورود" },
+ { "TotalClaims", "جمع مطالبات" },
+ { "TotalDeductions", "جمع کسورات" },
+ { "TotalPayment", "مبلغ قابل پرداخت" },
+ { "CardNumber", "شماره کارت" },
+ { "ShebaNumber", "شماره شبا" },
+ { "BankAccountNumber", "شماره حساب" },
+ };
+ Dictionary filteredHeaders;
+ if (!selectedParameters.Any())
+ {
+ filteredHeaders = headers;
+ }
+ else
+ {
+ // Filter headers based on selected parameters
+ filteredHeaders = headers.Where(h => selectedParameters.Contains(h.Key)).ToDictionary();
+ }
+ var indexCell = worksheet.Cells[1, 1];
+ indexCell.Value = "ردیف";
+ ApplyHeaderStyle(indexCell);
+ // Add headers to worksheet
+ for (int i = 0; i < filteredHeaders.Count; i++)
+ {
+ worksheet.Cells[1, i + 2].Value = filteredHeaders.ElementAt(i).Value;
+ ApplyHeaderStyle(worksheet.Cells[1, i + 2]);
+ }
+ var dataRow = 2;
+ foreach (var item in data)
+ {
+ var column = 2;
+ foreach (var header in filteredHeaders)
+ {
+ var property = item.GetType().GetProperty(header.Key);
+ var value = property.GetValue(item, null)?.ToString();
+ // Check if the property requires MoneyToDouble()
+ if (RequiresMoneyToDouble(property.Name))
+ {
+ worksheet.Cells[dataRow, column].Value = MoneyToDouble(value);
+ }
+ else
+ {
+ worksheet.Cells[dataRow, column].Value = value;
+ }
- for (int i = 0; i < headers.Length; i++)
- {
- worksheet.Cells[1, i + 1].Value = headers[i];
- }
+ ApplyGeneralDataStyle(worksheet.Cells[dataRow, column]);
+ ApplySpecificStyle(worksheet.Cells[dataRow, column], column); // Apply specific styles
+ column++;
+ }
+ var rowCounter = worksheet.Cells[dataRow, 1];
+ rowCounter.Value = dataRow - 1;
+ ApplyGeneralDataStyle(rowCounter);
+ ApplySpecificStyle(rowCounter, 1);
+ dataRow++;
+ }
+ worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns();
+ worksheet.PrinterSettings.PaperSize = ePaperSize.A4;
+ worksheet.PrinterSettings.Orientation = eOrientation.Landscape;
+ worksheet.PrinterSettings.FitToPage = true;
+ worksheet.PrinterSettings.FitToWidth = 1;
+ worksheet.PrinterSettings.FitToHeight = 0;
+ worksheet.PrinterSettings.Scale = 85;
+ worksheet.View.RightToLeft = true;
- // Lock cells A1 to H6
- //worksheet.Cells.Style.Locked = false;
- //worksheet.Cells["A1:AC1"].Style.Locked = true;
- //// Set worksheet protection with password
+ return package.GetAsByteArray();
+ }
- //worksheet.Protection.IsProtected = true;
- //worksheet.Protection.SetPassword("Gozareshgir2049"); // Set your desired password here
+ // Method to check if a property requires MoneyToDouble()
+ private static bool RequiresMoneyToDouble(string propertyName)
+ {
+ var propertiesRequiringConversion = new HashSet
+ {
+ "MonthlySalary", "RewardPay", "FridayPay", "OvertimePay", "ShiftPay", "NightWorkPay",
+ "MarriedAllowance", "FamilyAllowance", "BonusesPay", "BaseYearsPay", "LeavePay",
+ "AbsenceDeduction", "LateToWorkDeduction", "EarlyExitDeduction", "SalaryAidDeduction",
+ "InstallmentDeduction", "FineDeduction", "InsuranceDeduction", "TaxDeduction",
+ "TotalClaims", "TotalDeductions", "TotalPayment"
+ };
+ return propertiesRequiringConversion.Contains(propertyName);
+ }
- //worksheet.Protection.AllowSelectLockedCells = true; // Unlock all other cells
+ // Placeholder for the MoneyToDouble() method
+ private static double MoneyToDouble(string value)
+ {
+ Console.WriteLine(value);
+ var min = value.Length>1? value.Substring(0, 2): "";
+ var test = min == "\u200e\u2212" ? value.MoneyToDouble() * -1 : value.MoneyToDouble();
- using (var range = worksheet.Cells[1, 1, 1, 29])
- {
- range.Style.Font.Bold = true;
- range.Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
- range.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightGray);
- range.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
- range.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
- range.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
- range.Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
- range.Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
- }
+ Console.WriteLine(test);
+ return test;
+ }
- var dataRow = 2;
- var numberFormat = "#,##0";
- for (int i = 0; i < data.Count; i++)
- {
- var checkout = data[i];
- worksheet.Cells[i + dataRow, 1].Value = i + 1;
- worksheet.Cells[i + dataRow, 2].Value = checkout.Year;
- worksheet.Cells[i + dataRow, 3].Value = checkout.Month;
- worksheet.Cells[i + dataRow, 4].Value = checkout.EmployeeFullName;
- worksheet.Cells[i + dataRow, 5].Value = checkout.PersonnelCodeString;
- worksheet.Cells[i + dataRow, 6].Value = checkout.NationalCode;
- worksheet.Cells[i + dataRow, 7].Value = checkout.SumOfWorkingDays;
- worksheet.Cells[i + dataRow, 8].Value = checkout.MonthlySalary.MoneyToDouble();
- worksheet.Cells[i + dataRow, 9].Value = checkout.RewardPay.MoneyToDouble();
- worksheet.Cells[i + dataRow, 10].Value = checkout.FridayPay.MoneyToDouble();
- worksheet.Cells[i + dataRow, 11].Value = checkout.OvertimePay.MoneyToDouble();
- worksheet.Cells[i + dataRow, 12].Value = checkout.ShiftPay.MoneyToDouble();
- worksheet.Cells[i + dataRow, 13].Value = checkout.NightworkPay.MoneyToDouble();
- worksheet.Cells[i + dataRow, 14].Value = checkout.MarriedAllowance.MoneyToDouble();
- worksheet.Cells[i + dataRow, 15].Value = checkout.FamilyAllowance.MoneyToDouble();
- worksheet.Cells[i + dataRow, 16].Value = checkout.BonusesPay.MoneyToDouble();
- worksheet.Cells[i + dataRow, 17].Value = checkout.BaseYearsPay.MoneyToDouble();
- worksheet.Cells[i + dataRow, 18].Value = checkout.LeavePay.MoneyToDouble();
- worksheet.Cells[i + dataRow, 19].Value = checkout.AbsenceDeduction.MoneyToDouble();
- worksheet.Cells[i + dataRow, 20].Value = checkout.LateToWorkDeduction.MoneyToDouble();
- worksheet.Cells[i + dataRow, 21].Value = checkout.EarlyExitDeduction.MoneyToDouble();
- worksheet.Cells[i + dataRow, 22].Value = checkout.SalaryAidDeduction.MoneyToDouble();
- worksheet.Cells[i + dataRow, 23].Value = checkout.InstallmentDeduction.MoneyToDouble();
- worksheet.Cells[i + dataRow, 24].Value = checkout.FineDeduction.MoneyToDouble();
- worksheet.Cells[i + dataRow, 25].Value = checkout.InsuranceDeduction.MoneyToDouble();
- worksheet.Cells[i + dataRow, 26].Value = checkout.TaxDeducation.MoneyToDouble();
- worksheet.Cells[i + dataRow, 27].Value = checkout.TotalClaims.MoneyToDouble();
- worksheet.Cells[i + dataRow, 28].Value = checkout.TotalDeductions.MoneyToDouble();
- worksheet.Cells[i + dataRow, 29].Value = checkout.TotalPayment.MoneyToDouble();
+ private static void ApplyHeaderStyle(ExcelRange cell)
+ {
+ cell.Style.Font.Bold = true;
+ cell.Style.Fill.PatternType = ExcelFillStyle.Solid;
+ cell.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightGray);
+ cell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
+ cell.Style.Border.BorderAround(ExcelBorderStyle.Thin);
+ }
+ private static void ApplyGeneralDataStyle(ExcelRange cell)
+ {
+ cell.Style.Border.BorderAround(ExcelBorderStyle.Thin);
+ cell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
+ cell.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
+ cell.Style.Fill.PatternType = ExcelFillStyle.Solid;
+ }
- // Style data cells
- for (int j = 1; j <= 29; j++)
- {
- var cell = worksheet.Cells[i + 2, j];
- cell.Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin);
- cell.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
- cell.Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center;
- cell.Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
+ private static void ApplySpecificStyle(ExcelRange cell, int columnIndex)
+ {
+ switch (columnIndex)
+ {
+ case int n when (n >= 1 && n <= 8):
+ cell.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightYellow);
+ break;
+ case int n when (n >= 9 && n <= 19):
+ cell.Style.Fill.BackgroundColor.SetColor(1, 208, 248, 208);
+ cell.Style.Numberformat.Format = "#,##0";
+ break;
+ case int n when (n >= 20 && n <= 27):
+ cell.Style.Fill.BackgroundColor.SetColor(1, 246, 176, 176);
+ cell.Style.Numberformat.Format = "#,##0";
+ break;
+ case 28:
+ cell.Style.Fill.BackgroundColor.SetColor(1, 169, 208, 142);
+ cell.Style.Numberformat.Format = "#,##0";
+ break;
+ case 29:
+ cell.Style.Fill.BackgroundColor.SetColor(1, 241, 143, 143);
+ cell.Style.Numberformat.Format = "#,##0";
+ break;
+ case 30:
+ cell.Style.Fill.BackgroundColor.SetColor(1, 168, 186, 254);
+ cell.Style.Numberformat.Format = "#,##0";
+ break;
+ case >= 31 and <= 33:
+ cell.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightYellow);
+ break;
+ }
+ }
+}
- if (j >= 1 && j <= 7)
- {
- cell.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightYellow);
-
- }
- else if (j >= 8 && j <= 18)
- {
- cell.Style.Fill.BackgroundColor.SetColor(1,208,248,208);
- cell.Style.Numberformat.Format = numberFormat;
-
-
- }
- else if (j >= 19 && j <= 26)
- {
- cell.Style.Fill.BackgroundColor.SetColor(1,246,176,176);
- cell.Style.Numberformat.Format = numberFormat;
-
- }
-
- switch (j)
- {
- //جمع مطالبات
- case 27:
- cell.Style.Fill.BackgroundColor.SetColor(1, 169, 208, 142);
- cell.Style.Numberformat.Format = numberFormat;
-
- break;
-
- //جمع کسورات
- case 28:
- cell.Style.Fill.BackgroundColor.SetColor(1, 241, 143, 143);
- cell.Style.Numberformat.Format = numberFormat;
-
- break;
-
- //مبلغ قابل پرداخت
- case 29:
- cell.Style.Fill.BackgroundColor.SetColor(1, 168, 186, 254);
- cell.Style.Numberformat.Format = numberFormat;
-
- break;
- }
- }
- }
-
- worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns();
-
- worksheet.PrinterSettings.PaperSize = ePaperSize.A4;
- worksheet.PrinterSettings.Orientation = eOrientation.Landscape;
- worksheet.PrinterSettings.FitToPage = true;
- worksheet.PrinterSettings.FitToWidth = 1;
- worksheet.PrinterSettings.FitToHeight = 0;
- worksheet.PrinterSettings.Scale = 85; // Scale to fit content within A4 width
- worksheet.View.RightToLeft = true;
-
-
- worksheet.PrinterSettings.RepeatRows = new OfficeOpenXml.ExcelAddress("1:1"); // Repeat rows 1 to 6 on every page
- return package.GetAsByteArray();
- }
-}
\ No newline at end of file
diff --git a/0_Framework/Excel/Checkout/CustomizeCheckoutTempExcelViewModel.cs b/0_Framework/Excel/Checkout/CustomizeCheckoutTempExcelViewModel.cs
index 505a9d0b..74f18f64 100644
--- a/0_Framework/Excel/Checkout/CustomizeCheckoutTempExcelViewModel.cs
+++ b/0_Framework/Excel/Checkout/CustomizeCheckoutTempExcelViewModel.cs
@@ -48,5 +48,9 @@ public class CustomizeCheckoutTempExcelViewModel
public string TotalDeductions { get; set; }
public string TotalPayment { get; set; }
+ public string BankAccountNumber { get; set; }
+ public string CardNumber { get; set; }
+ public string ShebaNumber { get; set; }
+
}
\ No newline at end of file
diff --git a/0_Framework/Excel/ExcelGenerator.cs b/0_Framework/Excel/ExcelGenerator.cs
index 2728d095..23d6382b 100644
--- a/0_Framework/Excel/ExcelGenerator.cs
+++ b/0_Framework/Excel/ExcelGenerator.cs
@@ -5,6 +5,7 @@ using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
+
using OfficeOpenXml;
using OfficeOpenXml.Style;
using LicenseContext = OfficeOpenXml.LicenseContext;
@@ -198,5 +199,5 @@ public class ExcelGenerator
return resultList;
}
-
+
}
\ No newline at end of file
diff --git a/AccountManagement.Application.Contracts/Media/IMediaApplication.cs b/AccountManagement.Application.Contracts/Media/IMediaApplication.cs
new file mode 100644
index 00000000..a4148a11
--- /dev/null
+++ b/AccountManagement.Application.Contracts/Media/IMediaApplication.cs
@@ -0,0 +1,15 @@
+using _0_Framework.Application;
+using Microsoft.AspNetCore.Http;
+using System.Collections.Generic;
+
+namespace AccountManagement.Application.Contracts.Media
+{
+ public interface IMediaApplication
+ {
+ MediaViewModel Get(long id);
+ OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath, int maximumFileLength, List allowedExtensions);
+ OperationResult MoveFile(long mediaId, string newRelativePath);
+ OperationResult DeleteFile(long mediaId);
+ List GetRange(IEnumerable select);
+ }
+}
diff --git a/AccountManagement.Application/MediaApplication.cs b/AccountManagement.Application/MediaApplication.cs
new file mode 100644
index 00000000..4f834f79
--- /dev/null
+++ b/AccountManagement.Application/MediaApplication.cs
@@ -0,0 +1,153 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using _0_Framework.Application;
+using AccountManagement.Application.Contracts.Media;
+using AccountManagement.Domain.MediaAgg;
+using Microsoft.AspNetCore.Http;
+
+namespace AccountManagement.Application
+{
+ public class MediaApplication:IMediaApplication
+ {
+
+
+ private const string _basePath = "Medias";
+ private readonly IMediaRepository _mediaRepository;
+
+ public MediaApplication(IMediaRepository mediaRepository)
+ {
+ _mediaRepository = mediaRepository;
+ }
+
+
+ ///
+ /// دریافت فایل و نوشتن آن در مسیر داده شده، و ثبت مدیا
+ ///
+ /// فایل
+ /// برچسب فایل که در نام فایل ظاهر می شود
+ /// مسیر فایل
+ /// [.png,.jpg,.jpeg] پسوند های مجاز مثلا
+ /// حداکثر حجم فایل به مگابایت
+ ///
+ public OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath,int maximumFileLength,List allowedExtensions)
+ {
+ OperationResult op = new();
+ var path = Path.Combine(_basePath, relativePath);
+ var fileExtension = Path.GetExtension(file.FileName);
+
+ if (file == null || file.Length == 0)
+ return op.Failed("خطای سیستمی");
+
+ if (file.Length > (maximumFileLength * 1024 * 1024))
+ return op.Failed($"حجم فایل نمی تواند بیشتر از " +
+ $"{maximumFileLength}" +
+ $"مگابایت باشد");
+
+ if (!allowedExtensions.Contains(fileExtension.ToLower()))
+ {
+ var operationMessage = ":فرمت فایل باید یکی از موارد زیر باشد";
+ operationMessage += "\n";
+ operationMessage += string.Join(" ", allowedExtensions);
+ return op.Failed(operationMessage);
+ }
+
+
+ Directory.CreateDirectory(path);
+
+ var extension = Path.GetExtension(file.FileName);
+
+ var uniqueFileName = $"{fileLabel}-{DateTime.Now.Ticks}{extension}";
+ var filePath = Path.Combine(path, uniqueFileName);
+ using (var fileStream = new FileStream(filePath, FileMode.CreateNew))
+ {
+ file.CopyTo(fileStream);
+ }
+ var mediaEntity = new Media(filePath, extension, "فایل", "EmployeeDocuments");
+ _mediaRepository.Create(mediaEntity);
+ _mediaRepository.SaveChanges();
+
+ return op.Succcedded(mediaEntity.id);
+
+ }
+
+
+ ///
+ /// حذف فایل
+ ///
+ public OperationResult DeleteFile(long mediaId)
+ {
+ OperationResult op = new();
+ var media = _mediaRepository.Get(mediaId);
+ if (media == null)
+ return op.Failed("رکورد مورد نظر یافت نشد");
+ try
+ {
+ if (File.Exists(media.Path))
+ File.Delete(media.Path);
+ else
+ return op.Failed("فایل یافت نشد");
+ }
+ catch
+ {
+ return op.Failed("خطایی در حذف فایل رخ داده است");
+ }
+
+ _mediaRepository.Remove(media.id);
+ _mediaRepository.SaveChanges();
+ return op.Succcedded();
+ }
+
+ ///
+ /// جابجا کردن فایل
+ ///
+ public OperationResult MoveFile(long mediaId, string newRelativePath)
+ {
+ OperationResult op = new();
+ var media = _mediaRepository.Get(mediaId);
+ var oldPath = media.Path;
+ var path = Path.Combine(_basePath, newRelativePath);
+ Directory.CreateDirectory(path);
+
+ string filepath = Path.Combine(path, Path.GetFileName(oldPath));
+ try
+ {
+ File.Move(oldPath, filepath);
+ }
+ catch
+ {
+ return op.Failed("در جابجایی فایل خطایی رخ داده است");
+ }
+
+ media.Edit(filepath, media.Type, media.Category);
+ _mediaRepository.SaveChanges();
+ return op.Succcedded();
+ }
+
+ public MediaViewModel Get(long id)
+ {
+ var media = _mediaRepository.Get(id);
+ return new MediaViewModel()
+ {
+ Category = media.Category,
+ Path = media.Path,
+ Id = media.id,
+ Type = media.Type
+ };
+ }
+
+ public List GetRange(IEnumerable ids)
+ {
+ var medias = _mediaRepository.GetRange(ids);
+ return medias.Select(x=>new MediaViewModel()
+ {
+ Category = x.Category,
+ Path = x.Path,
+ Id = x.id,
+ Type = x.Type,
+ }).ToList();
+ }
+
+ }
+}
diff --git a/AccountManagement.Application/TaskApplication.cs b/AccountManagement.Application/TaskApplication.cs
index d9a0ab4e..3a274884 100644
--- a/AccountManagement.Application/TaskApplication.cs
+++ b/AccountManagement.Application/TaskApplication.cs
@@ -943,7 +943,7 @@ public class TaskApplication : ITaskApplication
}
var type = Path.GetExtension(filepath);
- var media = new Media(filepath, type, "فایل");
+ var media = new Media(filepath, type, "فایل", "Task");
_mediaRepository.Create(media);
_mediaRepository.SaveChanges();
return operation.Succcedded(media.id);
diff --git a/AccountManagement.Application/TicketApplication.cs b/AccountManagement.Application/TicketApplication.cs
index 5ab99091..71333f0a 100644
--- a/AccountManagement.Application/TicketApplication.cs
+++ b/AccountManagement.Application/TicketApplication.cs
@@ -461,7 +461,7 @@ public class TicketApplication : ITicketApplication
}
var type = Path.GetExtension(filepath);
- var media = new Media(filepath, type, "فایل");
+ var media = new Media(filepath, type, "فایل", "Ticket");
_mediaRepository.Create(media);
_mediaRepository.SaveChanges();
return operation.Succcedded(media.id);
diff --git a/AccountManagement.Configuration/AccountManagementBootstrapper.cs b/AccountManagement.Configuration/AccountManagementBootstrapper.cs
index 936c5bba..1a97d103 100644
--- a/AccountManagement.Configuration/AccountManagementBootstrapper.cs
+++ b/AccountManagement.Configuration/AccountManagementBootstrapper.cs
@@ -1,6 +1,7 @@
using AccountManagement.Application;
using AccountManagement.Application.Contracts.Account;
using AccountManagement.Application.Contracts.CameraAccount;
+using AccountManagement.Application.Contracts.Media;
using AccountManagement.Application.Contracts.Position;
using AccountManagement.Application.Contracts.Role;
using AccountManagement.Application.Contracts.SubAccount;
@@ -68,8 +69,9 @@ namespace AccountManagement.Configuration
services.AddTransient();
services.AddTransient();
+ services.AddTransient();
- services.AddTransient();
+ services.AddTransient();
services.AddTransient();
services.AddTransient();
diff --git a/AccountManagement.Domain/MediaAgg/IMediaRepository.cs b/AccountManagement.Domain/MediaAgg/IMediaRepository.cs
index d85b140e..b8ccb898 100644
--- a/AccountManagement.Domain/MediaAgg/IMediaRepository.cs
+++ b/AccountManagement.Domain/MediaAgg/IMediaRepository.cs
@@ -10,8 +10,17 @@ public interface IMediaRepository:IRepository
void CreateMediaWithTaskMedia(long taskId, long mediaId);
List GetMediaByTaskId(long taskId);
void Remove(long id);
-
+ void RemoveRange(IEnumerable medias);
void CreateTicketMedia(long ticketId, long mediaId);
void CreateAdminResponseMedia(long adminResponseId, long mediaId);
void CreateClientResponseMedia(long clientResponseId, long mediaId);
+
+ #region Pooya
+
+
+ List GetMedias(List ids);
+ List GetRange(IEnumerable mediaIds);
+
+ #endregion
+
}
\ No newline at end of file
diff --git a/AccountManagement.Domain/MediaAgg/Media.cs b/AccountManagement.Domain/MediaAgg/Media.cs
index d1ce763f..7c001a5d 100644
--- a/AccountManagement.Domain/MediaAgg/Media.cs
+++ b/AccountManagement.Domain/MediaAgg/Media.cs
@@ -1,20 +1,22 @@
-using System.Collections.Generic;
-using _0_Framework.Domain;
+using _0_Framework.Domain;
using AccountManagement.Domain.AdminResponseMediaAgg;
using AccountManagement.Domain.ClientResponseMediaAgg;
using AccountManagement.Domain.TaskMediaAgg;
using AccountManagement.Domain.TicketMediasAgg;
+using System.Collections.Generic;
namespace AccountManagement.Domain.MediaAgg;
public class Media : EntityBase
{
- public Media(string path, string type, string category)
+ public Media(string path, string type, string category, string serviceName)
{
Path = path;
Type = type;
Category = category;
+ ServiceName = serviceName;
+
}
@@ -26,6 +28,10 @@ public class Media : EntityBase
//دسته بندی ذخیره فایل
public string Category { get; private set; }
+
+ //نام ماژولی که رکورد را ایجاد کرده
+ public string ServiceName { get; private set; }
+
public List TaskMedias { get; set; }
public List AdminResponseMedias { get; set; }
public List ClientResponseMedias { get; set; }
@@ -33,8 +39,8 @@ public class Media : EntityBase
public void Edit(string path, string type, string category)
{
- Path = path;
- Type = type;
+ Path = path;
+ Type = type;
Category = category;
}
diff --git a/AccountMangement.Infrastructure.EFCore/AccountContext.cs b/AccountMangement.Infrastructure.EFCore/AccountContext.cs
index ef1d73cb..235d0449 100644
--- a/AccountMangement.Infrastructure.EFCore/AccountContext.cs
+++ b/AccountMangement.Infrastructure.EFCore/AccountContext.cs
@@ -77,7 +77,7 @@ namespace AccountMangement.Infrastructure.EFCore
{
var assembly = typeof(AccountMapping).Assembly;
modelBuilder.ApplyConfigurationsFromAssembly(assembly);
- // SubAccountPermissionSeeder.Seed(modelBuilder);
+ //SubAccountPermissionSeeder.Seed(modelBuilder);
base.OnModelCreating(modelBuilder);
}
}
diff --git a/AccountMangement.Infrastructure.EFCore/Mappings/MediaMapping.cs b/AccountMangement.Infrastructure.EFCore/Mappings/MediaMapping.cs
index 8052a1c6..8102235b 100644
--- a/AccountMangement.Infrastructure.EFCore/Mappings/MediaMapping.cs
+++ b/AccountMangement.Infrastructure.EFCore/Mappings/MediaMapping.cs
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace AccountMangement.Infrastructure.EFCore.Mappings;
-public class MediaMapping:IEntityTypeConfiguration
+public class MediaMapping : IEntityTypeConfiguration
{
public void Configure(EntityTypeBuilder builder)
{
@@ -14,6 +14,7 @@ public class MediaMapping:IEntityTypeConfiguration
builder.Property(x => x.Path).HasColumnType("ntext");
builder.Property(x => x.Type).HasMaxLength(10);
builder.Property(x => x.Category).HasMaxLength(10);
+ builder.Property(x => x.ServiceName).HasMaxLength(50);
diff --git a/AccountMangement.Infrastructure.EFCore/Migrations/20250119145902_AddServiceNameToMedia.Designer.cs b/AccountMangement.Infrastructure.EFCore/Migrations/20250119145902_AddServiceNameToMedia.Designer.cs
new file mode 100644
index 00000000..0ad3a982
--- /dev/null
+++ b/AccountMangement.Infrastructure.EFCore/Migrations/20250119145902_AddServiceNameToMedia.Designer.cs
@@ -0,0 +1,1258 @@
+//
+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("20250119145902_AddServiceNameToMedia")]
+ partial class AddServiceNameToMedia
+ {
+ ///
+ 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("ServiceName")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Type")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.HasKey("id");
+
+ b.ToTable("Medias", (string)null);
+ });
+
+ modelBuilder.Entity("AccountManagement.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.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(5)
+ .HasColumnType("nvarchar(5)");
+
+ 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);
+ });
+
+ 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);
+ });
+
+ 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);
+ });
+
+ 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("IsDeleted")
+ .HasColumnType("bit");
+
+ 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("AccountManagement.Domain.AccountAgg.Account", b =>
+ {
+ b.HasOne("AccountManagement.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.PositionAgg.Position", b =>
+ {
+ b.Navigation("Accounts");
+ });
+
+ 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");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/AccountMangement.Infrastructure.EFCore/Migrations/20250119145902_AddServiceNameToMedia.cs b/AccountMangement.Infrastructure.EFCore/Migrations/20250119145902_AddServiceNameToMedia.cs
new file mode 100644
index 00000000..24462d30
--- /dev/null
+++ b/AccountMangement.Infrastructure.EFCore/Migrations/20250119145902_AddServiceNameToMedia.cs
@@ -0,0 +1,29 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace AccountMangement.Infrastructure.EFCore.Migrations
+{
+ ///
+ public partial class AddServiceNameToMedia : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn(
+ name: "ServiceName",
+ table: "Medias",
+ type: "nvarchar(50)",
+ maxLength: 50,
+ nullable: true);
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "ServiceName",
+ table: "Medias");
+ }
+ }
+}
diff --git a/AccountMangement.Infrastructure.EFCore/Migrations/AccountContextModelSnapshot.cs b/AccountMangement.Infrastructure.EFCore/Migrations/AccountContextModelSnapshot.cs
index 06ae2209..d191b577 100644
--- a/AccountMangement.Infrastructure.EFCore/Migrations/AccountContextModelSnapshot.cs
+++ b/AccountMangement.Infrastructure.EFCore/Migrations/AccountContextModelSnapshot.cs
@@ -355,6 +355,10 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.Property("Path")
.HasColumnType("ntext");
+ b.Property("ServiceName")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
b.Property("Type")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
diff --git a/AccountMangement.Infrastructure.EFCore/Repository/MediaRepository.cs b/AccountMangement.Infrastructure.EFCore/Repository/MediaRepository.cs
index 0a76d520..541ce3f1 100644
--- a/AccountMangement.Infrastructure.EFCore/Repository/MediaRepository.cs
+++ b/AccountMangement.Infrastructure.EFCore/Repository/MediaRepository.cs
@@ -13,17 +13,17 @@ namespace AccountMangement.Infrastructure.EFCore.Repository;
public class MediaRepository:RepositoryBase,IMediaRepository
{
- private readonly AccountContext _taskManagerContext;
+ private readonly AccountContext _accountContext;
public MediaRepository( AccountContext taskManagerContext) : base(taskManagerContext)
{
- _taskManagerContext = taskManagerContext;
+ _accountContext = taskManagerContext;
}
//ساخت جدول واسط بین مدیا و نسک
//نکته: این متد ذخیره انجام نمیدهد
public void CreateMediaWithTaskMedia(long taskId, long mediaId)
{
var Taskmedias = new TaskMedia(taskId,mediaId);
- _taskManagerContext.Add(Taskmedias);
+ _accountContext.Add(Taskmedias);
}
public void Remove(long id)
{
@@ -34,24 +34,24 @@ public class MediaRepository:RepositoryBase,IMediaRepository
public void CreateTicketMedia(long ticketId, long mediaId)
{
var ticketMedias = new TicketMedia(ticketId, mediaId);
- _taskManagerContext.Add(ticketMedias);
+ _accountContext.Add(ticketMedias);
}
public void CreateAdminResponseMedia(long adminResponseId, long mediaId)
{
var adminResMedia = new AdminResponseMedia(adminResponseId, mediaId);
- _taskManagerContext.Add(adminResMedia);
+ _accountContext.Add(adminResMedia);
}
public void CreateClientResponseMedia(long clientResponseId, long mediaId)
{
var clientResMedia = new ClientResponseMedia(clientResponseId, mediaId);
- _taskManagerContext.Add(clientResMedia);
+ _accountContext.Add(clientResMedia);
}
public List GetMediaByTaskId(long taskId)
{
- return _taskManagerContext.TaskMedias.Include(x => x.Media).Where(x => x.TaskId == taskId).Select(x =>
+ return _accountContext.TaskMedias.Include(x => x.Media).Where(x => x.TaskId == taskId).Select(x =>
new MediaViewModel()
{
Id = x.Media.id,
@@ -59,4 +59,24 @@ public class MediaRepository:RepositoryBase,IMediaRepository
Type = x.Media.Type,
}).ToList();
}
-}
\ No newline at end of file
+
+ #region Pooya
+
+ public List GetMedias(List ids)
+ {
+ return _accountContext.Medias.Where(x => ids.Contains(x.id)).Select(x => new MediaViewModel()
+ {
+ Id = x.id,
+ Path = x.Path,
+ Category = x.Category,
+ Type = x.Type
+ }).ToList();
+ }
+
+ public List GetRange(IEnumerable mediaIds)
+ {
+ return _accountContext.Medias.Where(x => mediaIds.Contains(x.id)).ToList();
+ }
+}
+
+#endregion
diff --git a/Company.Domain/BankAgg/Bank.cs b/Company.Domain/BankAgg/Bank.cs
new file mode 100644
index 00000000..d398633d
--- /dev/null
+++ b/Company.Domain/BankAgg/Bank.cs
@@ -0,0 +1,24 @@
+
+using _0_Framework.Domain;
+
+namespace Company.Domain.BankAgg
+{
+ public class Bank : EntityBaseWithoutCreationDate
+ {
+ public string BankName { get; private set; }
+ public long BankLogoMediaId { get; private set; }
+
+ public Bank(string bankName, long bankLogoMediaId)
+ {
+ BankName = bankName;
+ BankLogoMediaId = bankLogoMediaId;
+ }
+
+ public void Edit(string bankName, long bankLogoMediaId)
+ {
+ BankName = bankName;
+ BankLogoMediaId = bankLogoMediaId;
+ }
+
+ }
+}
diff --git a/Company.Domain/BankAgg/IBankRepository.cs b/Company.Domain/BankAgg/IBankRepository.cs
new file mode 100644
index 00000000..96cf189d
--- /dev/null
+++ b/Company.Domain/BankAgg/IBankRepository.cs
@@ -0,0 +1,12 @@
+using System.Collections.Generic;
+using _0_Framework.Domain;
+using CompanyManagment.App.Contracts.Bank;
+
+namespace Company.Domain.BankAgg
+{
+ public interface IBankRepository:IRepository
+ {
+ public void Remove(Bank entity);
+ List Search(string name);
+ }
+}
diff --git a/Company.Domain/CustomizeCheckoutAgg/ValueObjects/CustomizeCheckoutLoanInstallments.cs b/Company.Domain/CustomizeCheckoutAgg/ValueObjects/CustomizeCheckoutLoanInstallments.cs
index 5b9df955..a2a1314e 100644
--- a/Company.Domain/CustomizeCheckoutAgg/ValueObjects/CustomizeCheckoutLoanInstallments.cs
+++ b/Company.Domain/CustomizeCheckoutAgg/ValueObjects/CustomizeCheckoutLoanInstallments.cs
@@ -5,18 +5,20 @@ namespace Company.Domain.CustomizeCheckoutAgg.ValueObjects;
public class CustomizeCheckoutLoanInstallments
{
- public CustomizeCheckoutLoanInstallments(string amountForMonth, string month, string year, IsActive isActive, string loanRemaining)
+ public CustomizeCheckoutLoanInstallments(string amountForMonth, string month, string year, IsActive isActive, string loanRemaining, string loanAmount)
{
AmountForMonth = amountForMonth;
Month = month;
Year = year;
IsActive = isActive;
LoanRemaining = loanRemaining;
+ LoanAmount = loanAmount;
}
public string AmountForMonth { get; private set; }
public string Month { get; private set; }
public string Year { get; private set; }
public string LoanRemaining { get; set; }
+ public string LoanAmount { get; set; }
public IsActive IsActive { get; private set; }
}
\ No newline at end of file
diff --git a/Company.Domain/CustomizeCheckoutTempAgg/ValueObjects/CustomizeCheckoutTempLoanInstallments.cs b/Company.Domain/CustomizeCheckoutTempAgg/ValueObjects/CustomizeCheckoutTempLoanInstallments.cs
index 8e927d2c..00d1113d 100644
--- a/Company.Domain/CustomizeCheckoutTempAgg/ValueObjects/CustomizeCheckoutTempLoanInstallments.cs
+++ b/Company.Domain/CustomizeCheckoutTempAgg/ValueObjects/CustomizeCheckoutTempLoanInstallments.cs
@@ -4,13 +4,14 @@ namespace Company.Domain.CustomizeCheckoutTempAgg.ValueObjects;
public class CustomizeCheckoutTempLoanInstallments
{
- public CustomizeCheckoutTempLoanInstallments(string amountForMonth, string month, string year, IsActive isActive, string loanRemaining)
+ public CustomizeCheckoutTempLoanInstallments(string amountForMonth, string month, string year, IsActive isActive, string loanRemaining, string loanAmount)
{
AmountForMonth = amountForMonth;
Month = month;
Year = year;
IsActive = isActive;
LoanRemaining = loanRemaining;
+ LoanAmount = loanAmount;
}
public string AmountForMonth { get; private set; }
@@ -18,4 +19,6 @@ public class CustomizeCheckoutTempLoanInstallments
public string Year { get; private set; }
public IsActive IsActive { get; private set; }
public string LoanRemaining { get; set; }
+ public string LoanAmount { get; set; }
+
}
\ No newline at end of file
diff --git a/Company.Domain/EmployeeAgg/Employee.cs b/Company.Domain/EmployeeAgg/Employee.cs
index d42f709a..4caaffc5 100644
--- a/Company.Domain/EmployeeAgg/Employee.cs
+++ b/Company.Domain/EmployeeAgg/Employee.cs
@@ -4,6 +4,7 @@ using _0_Framework.Domain;
using Company.Domain.ClientEmployeeWorkshopAgg;
using Company.Domain.ContractAgg;
using Company.Domain.CustomizeCheckoutAgg;
+using Company.Domain.EmployeeBankInformationAgg;
using Company.Domain.EmployeeChildrenAgg;
using Company.Domain.EmployeeInsuranceRecordAgg;
using Company.Domain.InsuranceEmployeeInfoAgg;
@@ -129,6 +130,10 @@ public class Employee : EntityBase
public string FullName => $"{FName} {LName}";
+ #region Pooya
+ public List EmployeeBankInformationList { get; set; }
+ #endregion
+
//public List Checkouts { get; set; }
public Employee()
{
diff --git a/Company.Domain/EmployeeBankInformationAgg/EmployeeBankInformation.cs b/Company.Domain/EmployeeBankInformationAgg/EmployeeBankInformation.cs
new file mode 100644
index 00000000..497f9a65
--- /dev/null
+++ b/Company.Domain/EmployeeBankInformationAgg/EmployeeBankInformation.cs
@@ -0,0 +1,62 @@
+using _0_Framework.Domain;
+using Company.Domain.BankAgg;
+using Company.Domain.EmployeeAgg;
+
+namespace Company.Domain.EmployeeBankInformationAgg
+{
+ public class EmployeeBankInformation : EntityBase
+ {
+ public long EmployeeId { get;private set; }
+ public long WorkshopId { get; private set; }
+
+ public Bank Bank { get; set; }
+ public long BankId { get; private set; }
+
+ ///
+ /// شماره حساب
+ ///
+ public string BankAccountNumber { get;private set; }
+
+ ///
+ /// شماره کارت
+ ///
+ public string CardNumber { get; private set; }
+
+ ///
+ /// شماره شبا
+ ///
+ public string ShebaNumber { get; private set; }
+
+ public bool IsDefault { get; private set; } = false;
+
+
+ //ONE TO MANY WITH EMPLOYEE
+ public Employee Employee { get; set; }
+
+ private EmployeeBankInformation()
+ {
+
+ }
+ public EmployeeBankInformation(long employeeId, long workshopId, long bankId, string bankAccountNumber, string cardNumber, string shebaNumber)
+ {
+ EmployeeId = employeeId;
+ WorkshopId = workshopId;
+ BankId = bankId;
+ BankAccountNumber = bankAccountNumber;
+ CardNumber = cardNumber;
+ ShebaNumber = shebaNumber;
+ }
+ public void Edit(long bankId, string bankAccountNumber, string cardNumber, string shebaNumber)
+ {
+ BankId = bankId;
+ BankAccountNumber = bankAccountNumber;
+ CardNumber = cardNumber;
+ ShebaNumber = shebaNumber;
+ }
+
+ public void SetDefault(bool setAsDefault = true)
+ {
+ IsDefault = setAsDefault;
+ }
+ }
+}
diff --git a/Company.Domain/EmployeeBankInformationAgg/IEmployeeBankInformationRepository.cs b/Company.Domain/EmployeeBankInformationAgg/IEmployeeBankInformationRepository.cs
new file mode 100644
index 00000000..8059dd11
--- /dev/null
+++ b/Company.Domain/EmployeeBankInformationAgg/IEmployeeBankInformationRepository.cs
@@ -0,0 +1,20 @@
+
+using _0_Framework.Domain;
+using CompanyManagment.App.Contracts.EmployeeBankInformation;
+using System.Collections.Generic;
+
+namespace Company.Domain.EmployeeBankInformationAgg
+{
+ public interface IEmployeeBankInformationRepository : IRepository
+ {
+ List Search(long workshopId, EmployeeBankInformationSearchModel searchParams);
+
+ void Remove(EmployeeBankInformation bankInformation);
+
+ GroupedEmployeeBankInformationViewModel GetByEmployeeId(long workshopId, long employeeId);
+ List GetRangeByEmployeeId(long workshopId, long employeeId);
+ void RemoveRange(List entities);
+ EmployeeBankInformationViewModel GetDetails(long id);
+ List GetAllByWorkshopId(long workshopId);
+ }
+}
diff --git a/CompanyManagment.App.Contracts/Bank/BankViewModel.cs b/CompanyManagment.App.Contracts/Bank/BankViewModel.cs
new file mode 100644
index 00000000..d70ce3a0
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Bank/BankViewModel.cs
@@ -0,0 +1,9 @@
+namespace CompanyManagment.App.Contracts.Bank;
+
+public class BankViewModel
+{
+ public long Id { get; set; }
+ public string BankName { get; set; }
+ public string BankLogoPicturePath { get; set; }
+ public long BankLogoPictureMediaId { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Bank/CreateBank.cs b/CompanyManagment.App.Contracts/Bank/CreateBank.cs
new file mode 100644
index 00000000..5352bec3
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Bank/CreateBank.cs
@@ -0,0 +1,11 @@
+
+using Microsoft.AspNetCore.Http;
+
+namespace CompanyManagment.App.Contracts.Bank
+{
+ public class CreateBank
+ {
+ public string BankName { get; set; }
+ public IFormFile BankLogoPictureFile { get; set; }
+ }
+}
diff --git a/CompanyManagment.App.Contracts/Bank/EditBank.cs b/CompanyManagment.App.Contracts/Bank/EditBank.cs
new file mode 100644
index 00000000..2ba3a4b1
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Bank/EditBank.cs
@@ -0,0 +1,6 @@
+namespace CompanyManagment.App.Contracts.Bank;
+
+public class EditBank : CreateBank
+{
+ public long Id { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Bank/IBankApplication.cs b/CompanyManagment.App.Contracts/Bank/IBankApplication.cs
new file mode 100644
index 00000000..be5d7843
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Bank/IBankApplication.cs
@@ -0,0 +1,14 @@
+using System.Collections.Generic;
+using _0_Framework.Application;
+
+namespace CompanyManagment.App.Contracts.Bank
+{
+ public interface IBankApplication
+ {
+ BankViewModel GetBy(long id);
+ OperationResult Remove(long id);
+ OperationResult Create(CreateBank command);
+ OperationResult Edit(EditBank command);
+ List Search(string name);
+ }
+}
diff --git a/CompanyManagment.App.Contracts/EmployeeBankInformation/CreateEmployeeInformation.cs b/CompanyManagment.App.Contracts/EmployeeBankInformation/CreateEmployeeInformation.cs
new file mode 100644
index 00000000..8c4e3fd5
--- /dev/null
+++ b/CompanyManagment.App.Contracts/EmployeeBankInformation/CreateEmployeeInformation.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CompanyManagment.App.Contracts.EmployeeBankInformation
+{
+ public class CreateEmployeeInformation
+ {
+ public long EmployeeId { get; set; }
+ public string EmployeeName { get; set; }
+ public long WorkshopId { get; set; }
+ public long BankId { get; set; }
+
+ //شماره حساب
+ public string BankAccountNumber { get; set; }
+
+ //شماره کارت
+ public string CardNumber { get; set; }
+
+ //شماره شبا
+ public string ShebaNumber { get; set; }
+ }
+}
diff --git a/CompanyManagment.App.Contracts/EmployeeBankInformation/EditEmployeeInformation.cs b/CompanyManagment.App.Contracts/EmployeeBankInformation/EditEmployeeInformation.cs
new file mode 100644
index 00000000..ee0b71df
--- /dev/null
+++ b/CompanyManagment.App.Contracts/EmployeeBankInformation/EditEmployeeInformation.cs
@@ -0,0 +1,6 @@
+namespace CompanyManagment.App.Contracts.EmployeeBankInformation;
+
+public class EditEmployeeInformation:CreateEmployeeInformation
+{
+ public long Id { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/EmployeeBankInformation/EmployeeBankInformationSearchModel.cs b/CompanyManagment.App.Contracts/EmployeeBankInformation/EmployeeBankInformationSearchModel.cs
new file mode 100644
index 00000000..cac6b907
--- /dev/null
+++ b/CompanyManagment.App.Contracts/EmployeeBankInformation/EmployeeBankInformationSearchModel.cs
@@ -0,0 +1,7 @@
+namespace CompanyManagment.App.Contracts.EmployeeBankInformation;
+
+public class EmployeeBankInformationSearchModel
+{
+ public long EmployeeId { get; set; }
+ public long BankId { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/EmployeeBankInformation/EmployeeBankInformationViewModel.cs b/CompanyManagment.App.Contracts/EmployeeBankInformation/EmployeeBankInformationViewModel.cs
new file mode 100644
index 00000000..60217e49
--- /dev/null
+++ b/CompanyManagment.App.Contracts/EmployeeBankInformation/EmployeeBankInformationViewModel.cs
@@ -0,0 +1,17 @@
+using System.Security.AccessControl;
+
+namespace CompanyManagment.App.Contracts.EmployeeBankInformation;
+
+public class EmployeeBankInformationViewModel
+{
+ public long Id { get; set; }
+ public long EmployeeId { get; set; }
+ public string EmployeeName { get; set; }
+ public string BankName { get; set; }
+ public string BankLogoPath { get; set; }
+ public string CardNumber { get; set; }
+ public string ShebaNumber { get; set; }
+ public string BankAccountNumber { get; set; }
+ public bool IsDefault { get; set; }
+ public long BankId { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/EmployeeBankInformation/EmployeeInformationViewModel.cs b/CompanyManagment.App.Contracts/EmployeeBankInformation/EmployeeInformationViewModel.cs
new file mode 100644
index 00000000..e9a24c50
--- /dev/null
+++ b/CompanyManagment.App.Contracts/EmployeeBankInformation/EmployeeInformationViewModel.cs
@@ -0,0 +1,21 @@
+namespace CompanyManagment.App.Contracts.EmployeeBankInformation;
+
+public class EmployeeInformationViewModel
+{
+ public long EmployeeId { get; set; }
+ public string EmployeeName { get; set; }
+ public long WorkshopId { get; set; }
+
+ //نام بانک
+ public string BankName { get; set; }
+
+ //شماره حساب
+ public string BankAccountNumber { get; set; }
+
+ //شماره کارت
+ public string CardNumber { get; set; }
+
+ //شماره شبا
+ public string ShebaNumber { get; set; }
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/EmployeeBankInformation/GroupedEmployeeBankInformationViewModel.cs b/CompanyManagment.App.Contracts/EmployeeBankInformation/GroupedEmployeeBankInformationViewModel.cs
new file mode 100644
index 00000000..16562a85
--- /dev/null
+++ b/CompanyManagment.App.Contracts/EmployeeBankInformation/GroupedEmployeeBankInformationViewModel.cs
@@ -0,0 +1,14 @@
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.EmployeeBankInformation;
+
+public class GroupedEmployeeBankInformationViewModel
+{
+ public long EmployeeId { get; set; }
+ public long WorkshopId { get; set; }
+ public string EmployeeName { get; set; }
+ public string PersonnelCode { get; set; }
+ public int TotalBankAccountsCount { get; set; }
+ public List BankInformation { get; set; }
+ public List BankPicturesList { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/EmployeeBankInformation/IEmployeeBankInformationApplication.cs b/CompanyManagment.App.Contracts/EmployeeBankInformation/IEmployeeBankInformationApplication.cs
new file mode 100644
index 00000000..12a4853b
--- /dev/null
+++ b/CompanyManagment.App.Contracts/EmployeeBankInformation/IEmployeeBankInformationApplication.cs
@@ -0,0 +1,18 @@
+using _0_Framework.Application;
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.EmployeeBankInformation
+{
+ public interface IEmployeeBankInformationApplication
+ {
+ OperationResult Create(CreateEmployeeInformation command);
+ OperationResult Edit(EditEmployeeInformation command);
+ List Search(long workshopId, EmployeeBankInformationSearchModel searchParams);
+ GroupedEmployeeBankInformationViewModel GetByEmployeeId(long workshopId, long employeeId);
+ EmployeeBankInformationViewModel GetDetails(long id);
+ OperationResult Remove(long id);
+ OperationResult RemoveByEmployeeId(long workshopId, long employeeId);
+ List