diff --git a/.github/workflows/dotnet-developPublish.yml b/.github/workflows/dotnet-developPublish.yml
new file mode 100644
index 00000000..aace164d
--- /dev/null
+++ b/.github/workflows/dotnet-developPublish.yml
@@ -0,0 +1,48 @@
+name: Deploy Development ASP.NET Core App to IIS
+
+on:
+ push:
+ branches:
+ - Main
+
+env:
+ DOTNET_ENVIRONMENT: Development
+
+jobs:
+ build-and-deploy:
+ runs-on: windows-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Setup .NET SDK
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: '8.0.x' # یا نسخه پروژهت
+
+ - name: Restore dependencies
+ run: dotnet restore
+
+ - name: Build
+ run: dotnet build --configuration Release
+
+ - name: Publish
+ run: dotnet publish --configuration Release --output ./publish /p:EnvironmentName=Development --no-build
+
+ - name: Deploy to IIS via Web Deploy
+ shell: powershell
+ run: |
+ $publishFolder = Resolve-Path ./publish
+ & "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" `
+ -verb:sync `
+ -source:contentPath="$publishFolder" `
+ -dest:contentPath="dadmehrg",computerName="https://171.22.24.15:8172/msdeploy.axd?site=dadmehrg",userName="Administrator",password="R2rNpdnetP3j>q5b18",authType="Basic" `
+ -allowUntrusted `
+ -enableRule:AppOffline
+
+
+ env:
+ SERVER_HOST: your-server-ip-or-domain
+ DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
+ DEPLOY_PASSWORD: ${{ secrets.DEPLOY_PASSWORD }}
diff --git a/.gitignore b/.gitignore
index 4e3f1d6d..674512f1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -361,4 +361,4 @@ MigrationBackup/
# # Fody - auto-generated XML schema
# FodyWeavers.xsd
-
+.idea
diff --git a/0_Framework/0_Framework.csproj b/0_Framework/0_Framework.csproj
index 04624e92..54b62986 100644
--- a/0_Framework/0_Framework.csproj
+++ b/0_Framework/0_Framework.csproj
@@ -15,8 +15,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/0_Framework/Application/AppSettingConfiguration.cs b/0_Framework/Application/AppSettingConfiguration.cs
new file mode 100644
index 00000000..127f11d5
--- /dev/null
+++ b/0_Framework/Application/AppSettingConfiguration.cs
@@ -0,0 +1,8 @@
+namespace _0_Framework.Application;
+
+public class AppSettingConfiguration
+{
+ public string Domain { get; set; }
+ public string ClientDomain =>"client"+Domain;
+ public string AdminDomain =>"admin"+Domain;
+}
\ No newline at end of file
diff --git a/0_Framework/Application/AuthHelper.cs b/0_Framework/Application/AuthHelper.cs
index bb94f1b2..ef510830 100644
--- a/0_Framework/Application/AuthHelper.cs
+++ b/0_Framework/Application/AuthHelper.cs
@@ -40,7 +40,10 @@ public class AuthHelper : IAuthHelper
result.Mobile = claims.FirstOrDefault(x => x is { Type: "Mobile" }).Value;
result.SubAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId").Value);
result.WorkshopName = claims.FirstOrDefault(x => x is { Type: "WorkshopName" })?.Value;
- return result;
+ result.Permissions = Tools.DeserializeFromBsonList(claims.FirstOrDefault(x => x is { Type: "permissions" })?.Value);
+ result.RoleName = claims.FirstOrDefault(x => x is { Type: "RoleName" })?.Value;
+ result.WorkshopId = long.Parse(claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value??"0");
+ return result;
}
public List GetPermissions()
@@ -74,7 +77,7 @@ public class AuthHelper : IAuthHelper
#region Vafa
- public void UpdateWorkshopSlugClaim(string newWorkshopSlug, string newWorkshopName)
+ public void UpdateWorkshopSlugClaim(string newWorkshopSlug, string newWorkshopName,long newWorkshopId)
{
var user = _contextAccessor.HttpContext.User;
@@ -83,6 +86,7 @@ public class AuthHelper : IAuthHelper
var claimsIdentity = (ClaimsIdentity)user.Identity;
var existingClaimSlug = claimsIdentity.FindFirst("WorkshopSlug");
var existingClaimName = claimsIdentity.FindFirst("WorkshopName");
+ var existingWorkshopId = claimsIdentity.FindFirst("WorkshopId");
if (existingClaimSlug != null)
{
@@ -94,9 +98,14 @@ public class AuthHelper : IAuthHelper
claimsIdentity.RemoveClaim(existingClaimName);
}
+ if (existingWorkshopId != null)
+ {
+ claimsIdentity.RemoveClaim(existingWorkshopId);
+ }
claimsIdentity.AddClaim(new Claim("WorkshopSlug", newWorkshopSlug));
claimsIdentity.AddClaim(new Claim("WorkshopName", newWorkshopName));
+ claimsIdentity.AddClaim(new Claim("WorkshopId",newWorkshopId.ToString()));
var authProperties = new AuthenticationProperties
@@ -126,8 +135,16 @@ public class AuthHelper : IAuthHelper
return "";
}
+
+
#endregion
+ public long GetWorkshopId()
+ {
+ return long.Parse(_contextAccessor.HttpContext?.User.Claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value ?? "0");
+
+
+ }
public string CurrentAccountRole()
{
@@ -180,6 +197,7 @@ public class AuthHelper : IAuthHelper
//mahanChanges
new("workshopList",workshopBson),
new("WorkshopSlug",slug),
+ new("WorkshopId", account.WorkshopId.ToString()),
new("WorkshopName",account.WorkshopName??"")
};
diff --git a/0_Framework/Application/AuthViewModel.cs b/0_Framework/Application/AuthViewModel.cs
index dba5d198..d419bd67 100644
--- a/0_Framework/Application/AuthViewModel.cs
+++ b/0_Framework/Application/AuthViewModel.cs
@@ -20,6 +20,7 @@ public class AuthViewModel
public int? PositionValue { get; set; }
public string WorkshopSlug { get; set; }
+ public long WorkshopId { get; set; }
public string WorkshopName { get; set; }
public List WorkshopList { get; set; }
diff --git a/0_Framework/Application/Enums/ActivationStatus.cs b/0_Framework/Application/Enums/ActivationStatus.cs
new file mode 100644
index 00000000..c125f5bd
--- /dev/null
+++ b/0_Framework/Application/Enums/ActivationStatus.cs
@@ -0,0 +1,8 @@
+namespace _0_Framework.Application.Enums;
+
+public enum ActivationStatus
+{
+ None = 0,
+ Active = 1,
+ DeActive = 2
+}
\ No newline at end of file
diff --git a/0_Framework/Application/Enums/LegalType.cs b/0_Framework/Application/Enums/LegalType.cs
new file mode 100644
index 00000000..779cdccc
--- /dev/null
+++ b/0_Framework/Application/Enums/LegalType.cs
@@ -0,0 +1,8 @@
+namespace _0_Framework.Application.Enums;
+
+public enum LegalType
+{
+ None = 0,
+ Real = 1,
+ Legal = 2
+}
\ No newline at end of file
diff --git a/0_Framework/Application/Enums/TypeOfCheckoutWarning.cs b/0_Framework/Application/Enums/TypeOfCheckoutWarning.cs
new file mode 100644
index 00000000..45c82a53
--- /dev/null
+++ b/0_Framework/Application/Enums/TypeOfCheckoutWarning.cs
@@ -0,0 +1,15 @@
+namespace _0_Framework.Application.Enums;
+
+public enum TypeOfCheckoutWarning
+{
+ ///
+ /// هشدار های متفرقه
+ ///
+ OthersWarning,
+ ///
+ /// هشدار سهم بیمه کارگر
+ ///
+ InsuranceEmployeeShare,
+
+
+}
\ No newline at end of file
diff --git a/0_Framework/Application/IAuthHelper.cs b/0_Framework/Application/IAuthHelper.cs
index 281755aa..ab9cf572 100644
--- a/0_Framework/Application/IAuthHelper.cs
+++ b/0_Framework/Application/IAuthHelper.cs
@@ -17,11 +17,12 @@ public interface IAuthHelper
#region Vafa
- void UpdateWorkshopSlugClaim(string workshopSlug, string workshopName);
+ void UpdateWorkshopSlugClaim(string workshopSlug, string workshopName, long workshopId);
#endregion
long CurrentSubAccountId();
string GetWorkshopSlug();
string GetWorkshopName();
+ long GetWorkshopId();
(long Id, UserType userType, long roleId) GetUserTypeWithId();
}
\ No newline at end of file
diff --git a/0_Framework/Application/PagedResult.cs b/0_Framework/Application/PagedResult.cs
new file mode 100644
index 00000000..ecfa9ea1
--- /dev/null
+++ b/0_Framework/Application/PagedResult.cs
@@ -0,0 +1,15 @@
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+
+namespace _0_Framework.Application;
+
+
+public class PagedResult where T : class
+{
+ public int TotalCount { get; set; }
+ public List List { get; set; }
+}
+public class PagedResult:PagedResult where T : class
+{
+ public TMeta? Meta { get; set; }
+}
diff --git a/0_Framework/Application/PaginationRequest.cs b/0_Framework/Application/PaginationRequest.cs
new file mode 100644
index 00000000..0ad0fe3d
--- /dev/null
+++ b/0_Framework/Application/PaginationRequest.cs
@@ -0,0 +1,7 @@
+namespace _0_Framework.Application;
+
+public class PaginationRequest
+{
+ public int PageIndex { get; set; } = 1;
+ public int PageSize { get; set; } = 30;
+}
\ No newline at end of file
diff --git a/0_Framework/Application/PaymentGateway/AqayePardakhtPaymentGateway.cs b/0_Framework/Application/PaymentGateway/AqayePardakhtPaymentGateway.cs
new file mode 100644
index 00000000..b71f8681
--- /dev/null
+++ b/0_Framework/Application/PaymentGateway/AqayePardakhtPaymentGateway.cs
@@ -0,0 +1,100 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Http;
+using System.Net.Http.Json;
+using System.Security.Policy;
+using System.Security.Principal;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.Extensions.Options;
+
+namespace _0_Framework.Application.PaymentGateway;
+
+public class AqayePardakhtPaymentGateway:IPaymentGateway
+{
+ private static string _pin = "86EAF2C4D052F7D8759F";
+ private const string AccountNumber = "AP.1042276242";
+ private const string EncryptedKey = "130D2@D2923";
+
+ private readonly HttpClient _httpClient;
+
+ public AqayePardakhtPaymentGateway(IHttpClientFactory httpClientFactory,IOptions appSetting)
+ {
+ _httpClient = httpClientFactory.CreateClient();
+
+ if (appSetting.Value.Domain == ".dadmehrg.ir")
+ {
+ _pin = "7349F84E81AB584862D9";
+ }
+
+ }
+
+ public async Task Create(CreatePaymentGatewayRequest command,CancellationToken cancellationToken =default)
+ {
+ var response = await _httpClient.PostAsJsonAsync("https://panel.aqayepardakht.ir/api/v2/create", new
+ {
+ pin = _pin,
+ amount = command.Amount,
+ callback = command.CallBackUrl,
+ card_number = command.CardNumber,
+ invoice_id = command.InvoiceId,
+ mobile = command.Mobile,
+ email = command.Email??"",
+ description = command.Description,
+ }, cancellationToken: cancellationToken);
+ var resStr = await response.Content.ReadAsStringAsync(cancellationToken);
+ var result = await response.Content.ReadFromJsonAsync(cancellationToken: cancellationToken);
+ return result;
+ }
+
+ public string GetStartPayUrl(string transactionId) =>
+ $"https://panel.aqayepardakht.ir/startpay/{transactionId}";
+
+ public async Task Verify(VerifyPaymentGateWayRequest command, CancellationToken cancellationToken = default)
+ {
+ var response = await _httpClient.PostAsJsonAsync("https://panel.aqayepardakht.ir/api/v2/verify", new
+ {
+ pin = _pin,
+ amount = command.Amount,
+ transid = command.TransactionId,
+ }, cancellationToken: cancellationToken);
+
+ var result = await response.Content.ReadFromJsonAsync(cancellationToken: cancellationToken);
+ return result;
+ }
+
+ public async Task CreateSandBox(CreatePaymentGatewayRequest command, CancellationToken cancellationToken = default)
+ {
+ var response = await _httpClient.PostAsJsonAsync("https://panel.aqayepardakht.ir/api/v2/create", new
+ {
+ pin = "sandbox",
+ amount = command.Amount,
+ callback = command.CallBackUrl,
+ card_number = command.Amount,
+ invoice_id = command.InvoiceId,
+ mobile = command.Mobile,
+ email = command.Email,
+ description = command.Email,
+ }, cancellationToken: cancellationToken);
+
+ var result = await response.Content.ReadFromJsonAsync(cancellationToken: cancellationToken);
+ return result;
+ }
+
+ public string GetStartPaySandBoxUrl(string transactionId) =>
+ $"https://panel.aqayepardakht.ir/startpay/sandbox/{transactionId}";
+
+ public async Task GetWalletAmount(CancellationToken cancellationToken)
+ {
+ var response =await _httpClient.PostAsJsonAsync("https://panel.aqayepardakht.ir/api/v2/getmoney", new
+ {
+ account=AccountNumber,
+ code = EncryptedKey
+ }, cancellationToken: cancellationToken);
+ var jsonString = await response.Content.ReadAsStringAsync(cancellationToken);
+ var result = await response.Content.ReadFromJsonAsync(cancellationToken);
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/0_Framework/Application/PaymentGateway/IPaymentGateway.cs b/0_Framework/Application/PaymentGateway/IPaymentGateway.cs
new file mode 100644
index 00000000..306a75a2
--- /dev/null
+++ b/0_Framework/Application/PaymentGateway/IPaymentGateway.cs
@@ -0,0 +1,62 @@
+using Microsoft.AspNetCore.Server.HttpSys;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.Json.Serialization;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace _0_Framework.Application.PaymentGateway;
+
+public interface IPaymentGateway
+{
+ Task Create(CreatePaymentGatewayRequest command, CancellationToken cancellationToken =default);
+
+ string GetStartPayUrl(string transactionId);
+ Task Verify(VerifyPaymentGateWayRequest command, CancellationToken cancellationToken=default);
+ Task CreateSandBox(CreatePaymentGatewayRequest command, CancellationToken cancellationToken=default);
+ string GetStartPaySandBoxUrl(string transactionId);
+ Task GetWalletAmount(CancellationToken cancellationToken);
+
+}
+public class PaymentGatewayResponse
+{
+ [JsonPropertyName("status")]
+ public string Status { get; set; }
+
+ [JsonPropertyName("code")]
+ public int? ErrorCode { get; set; }
+
+ [JsonPropertyName("transid")]
+ public string TransactionId { get; set; }
+
+ public bool IsSuccess => Status == "success";
+}
+
+public class WalletAmountResponse
+{
+ [JsonPropertyName("status")]
+ public string Status { get; set; }
+ [JsonPropertyName("money")]
+ public double Amount { get; set; }
+ [JsonPropertyName("code")]
+ public int Code { get; set; }
+}
+
+public class CreatePaymentGatewayRequest
+{
+ public double Amount { get; set; }
+ public string CallBackUrl { get; set; }
+ public string InvoiceId { get; set; }
+ public string CardNumber { get; set; }
+ public string Mobile { get; set; }
+ public string Email { get; set; }
+ public string Description { get; set; }
+}
+
+public class VerifyPaymentGateWayRequest
+{
+ public string TransactionId { get; set; }
+ public double Amount { get; set; }
+}
\ No newline at end of file
diff --git a/0_Framework/Application/SelectListViewModel.cs b/0_Framework/Application/SelectListViewModel.cs
new file mode 100644
index 00000000..2262df1a
--- /dev/null
+++ b/0_Framework/Application/SelectListViewModel.cs
@@ -0,0 +1,7 @@
+namespace _0_Framework.Application;
+
+public class SelectListViewModel
+{
+ public long Id { get; set; }
+ public string Text { get; set; }
+}
\ No newline at end of file
diff --git a/0_Framework/Application/Sms/ISmsService.cs b/0_Framework/Application/Sms/ISmsService.cs
index 36a38030..bf55eb00 100644
--- a/0_Framework/Application/Sms/ISmsService.cs
+++ b/0_Framework/Application/Sms/ISmsService.cs
@@ -26,6 +26,11 @@ public interface ISmsService
#region Mahan
Task GetCreditAmount();
+
+ public Task SendInstitutionCreationVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId);
+
+ public Task SendInstitutionVerificationCode(string number, string code, string contractingPartyFullName,
+ long contractingPartyId, long institutionContractId);
#endregion
diff --git a/0_Framework/Application/Sms/OtpResultViewModel.cs b/0_Framework/Application/Sms/OtpResultViewModel.cs
new file mode 100644
index 00000000..ea85d622
--- /dev/null
+++ b/0_Framework/Application/Sms/OtpResultViewModel.cs
@@ -0,0 +1,7 @@
+namespace _0_Framework.Application.Sms;
+
+public class OtpResultViewModel
+{
+ public int ExpireTimeSec { get; set; }
+ public int ReSendTimeSec { get; set; }
+}
\ No newline at end of file
diff --git a/0_Framework/Application/StaticWorkshopAccounts.cs b/0_Framework/Application/StaticWorkshopAccounts.cs
index eac5ad08..f0746e01 100644
--- a/0_Framework/Application/StaticWorkshopAccounts.cs
+++ b/0_Framework/Application/StaticWorkshopAccounts.cs
@@ -30,8 +30,9 @@ public static class StaticWorkshopAccounts
/// 380 - افروز نظری
/// 381 - مهدی قربانی
/// 392 - عمار حسن دوست
+ /// 20 - سمیرا الهی نیا
///
- public static List StaticAccountIds = [2, 3, 380, 381, 392];
+ public static List StaticAccountIds = [2, 3, 380, 381, 392, 20];
///
/// این تاریخ در جدول اکانت لفت ورک به این معنیست
diff --git a/0_Framework/Application/Tools.cs b/0_Framework/Application/Tools.cs
index 76c9bdda..23afe3cb 100644
--- a/0_Framework/Application/Tools.cs
+++ b/0_Framework/Application/Tools.cs
@@ -41,6 +41,23 @@ public static class Tools
return Regex.IsMatch(mobileNo, "^((09))(\\d{9})$");
}
+ ///
+ /// تاریخ شروع و تعداد ماه را میگیرد و تاریخ پایان قراردا را بر میگرداند
+ ///
+ ///
+ ///
+ ///
+ public static (DateTime endDateGr, string endDateFa) FindEndOfContract(string startDate, string monthPlus)
+ {
+
+ int startYear = Convert.ToInt32(startDate.Substring(0, 4));
+ int startMonth = Convert.ToInt32(startDate.Substring(5, 2));
+ int startDay = Convert.ToInt32(startDate.Substring(8, 2));
+ var start = new PersianDateTime(startYear, startMonth, startDay);
+ var end = (start.AddMonths(Convert.ToInt32(monthPlus))).AddDays(-1);
+ return ($"{end}".ToGeorgianDateTime(), $"{end}");
+
+ }
///
/// دریافت روزهای کارکرد پرسنل در لیست بیمه ماه مشخص شده
@@ -460,26 +477,42 @@ public static class Tools
string bb = string.Empty;
bool isNegative = false;
- for (int x = 0; x < myMoney.Length; x++)
+ try
{
- if (char.IsDigit(myMoney[x]))
+ if (!string.IsNullOrWhiteSpace(myMoney))
{
- bb += myMoney[x];
- }
- else if (myMoney[x] == '-' && bb.Length == 0)
- {
- // اگر علامت منفی قبل از اولین عدد آمد، در نظر بگیر
- isNegative = true;
- }
- }
+ for (int x = 0; x < myMoney.Length; x++)
+ {
+ if (char.IsDigit(myMoney[x]))
+ {
+ bb += myMoney[x];
+ }
+ else if (myMoney[x] == '-' && bb.Length == 0)
+ {
+ // اگر علامت منفی قبل از اولین عدد آمد، در نظر بگیر
+ isNegative = true;
+ }
+ }
- if (bb.Length > 0)
- {
- double res = double.Parse(bb);
- return isNegative ? -res : res;
+ if (bb.Length > 0)
+ {
+ double res = double.Parse(bb);
+ return isNegative ? -res : res;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ else
+ {
+ return 0;
+ }
+
}
- else
+ catch (Exception)
{
+
return 0;
}
}
@@ -1479,6 +1512,14 @@ public static class Tools
#region Mahan
+ public static bool IsvalidIban(this string iban)
+ {
+ return Regex.IsMatch(iban, @"^IR[0-9]{24}$");
+ }
+ public static bool IsValidCardNumber(this string cardNumber)
+ {
+ return Regex.IsMatch(cardNumber, @"^[0-9]{16}$");
+ }
///
/// این متد حروف عربی را به فارسی در میاورد. مثال: علي را به علی تبدیل میکند
///
diff --git a/0_Framework/Application/UID/IUidService.cs b/0_Framework/Application/UID/IUidService.cs
index 19dd0034..a3350dfa 100644
--- a/0_Framework/Application/UID/IUidService.cs
+++ b/0_Framework/Application/UID/IUidService.cs
@@ -38,7 +38,7 @@ public class UidBasicInformation
{
"GENDER_MALE" => Application.Gender.Male,
"GENDER_FEMALE" => Application.Gender.Female,
- _ => throw new ArgumentOutOfRangeException()
+ _ => Application.Gender.None
};
}
public record IdentificationInformation(string NationalId, string BirthDate, string ShenasnameSeri, string ShenasnameSerial, string ShenasnamehNumber);
@@ -110,6 +110,53 @@ public interface IUidService
{
Task GetPersonalInfo(string nationalCode , string birthDate);
Task IsMachPhoneWithNationalCode(string nationalCode , string phoneNumber);
+ Task IbanInquiry (string iban);
+ Task AccountToIban(string accountNumber, UidBanks bank);
+ Task CardToIban(string cardNumber);
+}
+
+public class CardToNumberResponse:UidBaseResponse
+{
+ public string Iban { get; set; }
+ public string CardNumber { get; set; }
+}
+
+public class AccountToIbanResponse:UidBaseResponse
+{
+ public string Iban { get; set; }
+}
+
+public class IbanInquiryResponse:UidBaseResponse
+{
+ public IbanInquiryAccountBasicInformation AccountBasicInformation { get; set; }
+ [JsonProperty("owners")]
+ public List Owners { get; set; }
+}
+
+public class IbanInquiryAccountBasicInformation
+{
+ public string Iban { get; set; }
+ public string AccountNumber { get; set; }
+ public IbanInquiryBankInformation BankInformation { get; set; }
+ public string AccountStatus { get; set; }
+
+}
+
+public class IbanInquiryBankInformation
+{
+ public string BankName { get; set; }
+}
+
+public class IbanInquiryOwner
+{
+ [JsonProperty("firstName")]
+ public string FirstName { get; set; }
+ [JsonProperty("lastName")]
+ public string LastName { get; set; }
+ [JsonProperty("nationalIdentifier")]
+ public string NationalIdentifier { get; set; }
+ [JsonProperty("customerType")]
+ public string CustomerType { get; set; }
}
public class MatchMobileWithNationalCodeResponse
@@ -118,4 +165,7 @@ public class MatchMobileWithNationalCodeResponse
public ResponseContext ResponseContext { get; set; }
}
-
+public class UidBaseResponse
+{
+ public ResponseContext ResponseContext { get; set; }
+}
diff --git a/0_Framework/Application/UID/UidBanks.cs b/0_Framework/Application/UID/UidBanks.cs
new file mode 100644
index 00000000..16e0c3d4
--- /dev/null
+++ b/0_Framework/Application/UID/UidBanks.cs
@@ -0,0 +1,117 @@
+using System.ComponentModel;
+
+namespace _0_Framework.Application.UID;
+
+public enum UidBanks
+{
+ [Description("بانک دی")]
+ BANK_DEY = 66,
+
+ [Description("بانک سپه")]
+ BANK_SEPAH = 15,
+
+ [Description("بانک شهر")]
+ BANK_SHAHR = 61,
+
+ [Description("بانک ملت")]
+ BANK_MELAT = 12,
+
+ [Description("بانک ملی")]
+ BANK_MELLI = 17,
+
+ [Description("بانک رفاه کارگران")]
+ BANK_REFAH = 13,
+
+ [Description("بانک سینا")]
+ BANK_SINA = 59,
+
+ [Description("بانک مسکن")]
+ BANK_MASKAN = 14,
+
+ [Description("بانک آینده")]
+ BANK_AYANDEH = 62,
+
+ [Description("بانک انصار")]
+ BANK_ANSAR = 63,
+
+ [Description("بانک تجارت")]
+ BANK_TEJARAT = 18,
+
+ [Description("بانک رسالت")]
+ BANK_RESALAT = 70,
+
+ [Description("بانک سامان")]
+ BANK_SAMAN = 56,
+
+ [Description("بانک مرکزی")]
+ BANK_MARKAZI = 10,
+
+ [Description("بانک سرمایه")]
+ BANK_SARMAYEH = 58,
+
+ [Description("بانک صادرات")]
+ BANK_SADERAT = 19,
+
+ [Description("بانک قوامین")]
+ BANK_GHAVAMIN = 52,
+
+ [Description("بانک پارسیان")]
+ BANK_PARSIAN = 54,
+
+ [Description("بانک کشاورزی")]
+ BANK_KESHAVARZI = 16,
+
+ [Description("بانک گردشگری")]
+ BANK_GARDESHGARI = 64,
+
+ [Description("پست بانک")]
+ BANK_POST_BANK = 21,
+
+ [Description("بانک پاسارگاد")]
+ BANK_PASARGAD = 57,
+
+ [Description("بانک کارآفرین")]
+ BANK_KARAFARIN = 53,
+
+ [Description("بانک خاورمیانه")]
+ BANK_KHAVARMIANEH = 78,
+
+ [Description("بانک ایران زمین")]
+ BANK_IRAN_ZAMIN = 69,
+
+ [Description("بانک مهر اقتصاد")]
+ BANK_MEHR_EQTESAD = 79,
+
+ [Description("بانک صنعت و معدن")]
+ BANK_SANAT_MADAN = 11,
+
+ [Description("بانک اقتصاد نوین")]
+ BANK_EGHTESAD_NOVIN = 55,
+
+ [Description("بانک توسعه تعاون")]
+ BANK_TOSSE_TAAVON = 22,
+
+ [Description("بانک توسعه صادرات")]
+ BANK_TOSSE_SADERAT = 20,
+
+ [Description("بانک ایران و ونزوئلا")]
+ BANK_IRAN_VENEZUELA = 95,
+
+ [Description("بانک حکمت ایرانیان")]
+ BANK_HEKMAT_IRANIAN = 65,
+
+ [Description("بانک قرض الحسنه مهر")]
+ BANK_GHARZOLHASANEH_MEHR = 60,
+
+ [Description("موسسه مالی و اعتباری ملل")]
+ BANK_MOASSASE_MELLAL = 75,
+
+ [Description("موسسه مالی و اعتباری نور")]
+ BANK_MOASSASE_NOOR = 80,
+
+ [Description("موسسه مالی و اعتباری کوثر")]
+ BANK_MOASSASE_KOSAR = 73,
+
+ [Description("موسسه مالی و اعتباری توسعه")]
+ BANK_MOASSASE_TOSSE = 51
+}
\ No newline at end of file
diff --git a/0_Framework/Application/UID/UidBanksExtension.cs b/0_Framework/Application/UID/UidBanksExtension.cs
new file mode 100644
index 00000000..98a46f16
--- /dev/null
+++ b/0_Framework/Application/UID/UidBanksExtension.cs
@@ -0,0 +1,27 @@
+using System;
+using System.ComponentModel;
+using System.Reflection;
+
+namespace _0_Framework.Application.UID
+{
+ public static class UidBanksExtension
+ {
+ ///
+ /// دریافت نام فارسی بانک
+ ///
+ /// بانک
+ /// نام فارسی بانک
+ public static string GetPersianName(this UidBanks bank)
+ {
+ var fieldInfo = bank.GetType().GetField(bank.ToString());
+
+ if (fieldInfo == null)
+ return string.Empty;
+
+ var attribute = (DescriptionAttribute)Attribute.GetCustomAttribute(
+ fieldInfo, typeof(DescriptionAttribute));
+
+ return attribute?.Description ?? bank.ToString();
+ }
+ }
+}
diff --git a/0_Framework/Application/UID/UidService.cs b/0_Framework/Application/UID/UidService.cs
deleted file mode 100644
index ccf3c0ef..00000000
--- a/0_Framework/Application/UID/UidService.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using System;
-using System.Net.Http;
-using System.Net.Http.Json;
-using System.Text;
-using System.Text.Json;
-using System.Threading.Tasks;
-using Newtonsoft.Json;
-
-namespace _0_Framework.Application.UID;
-
-public class UidService : IUidService
-{
- private readonly HttpClient _httpClient;
- private const string BaseUrl = "https://json-api.uid.ir/api/inquiry/";
-
- public UidService()
- {
- _httpClient = new HttpClient()
- {
- BaseAddress = new Uri(BaseUrl)
- };
- }
-
- public async Task GetPersonalInfo(string nationalCode, string birthDate)
- {
- var request = new PersonalInfoRequest
- {
- BirthDate = birthDate,
- NationalId = nationalCode,
- RequestContext = new UidRequestContext()
- };
- var json = JsonConvert.SerializeObject(request);
- var contentType = new StringContent(json, Encoding.UTF8, "application/json");
-
- try
- {
- var requestResult = await _httpClient.PostAsync("person/v2", contentType);
- if (!requestResult.IsSuccessStatusCode)
- return null;
- var responseResult = await requestResult.Content.ReadFromJsonAsync();
- if (responseResult.BasicInformation != null)
- {
- responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName?.ToPersian();
- responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName?.ToPersian();
- responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName?.ToPersian();
- }
-
- return responseResult;
- }
- catch
- {
-
- return new PersonalInfoResponse(new UidBasicInformation(),
- new IdentificationInformation(default, default, default, default, default), new RegistrationStatus(),
- new ResponseContext(new UidStatus(14, "")));
- }
-
- }
-
-
- public async Task IsMachPhoneWithNationalCode(string nationalCode, string phoneNumber)
- {
- var request = new PersonalInfoRequest
- {
- MobileNumber = phoneNumber,
- NationalId = nationalCode,
- RequestContext = new UidRequestContext()
- };
- var json = JsonConvert.SerializeObject(request);
- var contentType = new StringContent(json, Encoding.UTF8, "application/json");
-
- var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
- if (!requestResult.IsSuccessStatusCode)
- return null;
-
- var responseResult = await requestResult.Content.ReadFromJsonAsync();
- return responseResult;
- }
-}
\ No newline at end of file
diff --git a/0_Framework/Domain/CustomizeCheckoutShared/Base/BaseCustomizeEntity.cs b/0_Framework/Domain/CustomizeCheckoutShared/Base/BaseCustomizeEntity.cs
index a8522d14..13eae1f7 100644
--- a/0_Framework/Domain/CustomizeCheckoutShared/Base/BaseCustomizeEntity.cs
+++ b/0_Framework/Domain/CustomizeCheckoutShared/Base/BaseCustomizeEntity.cs
@@ -119,7 +119,7 @@ public class BaseCustomizeEntity : EntityBase
public BreakTime BreakTime { get; protected set; }
- public List WeeklyOffDays { get; set; }
+ public List WeeklyOffDays { get; set; } = [];
public void FridayWorkToWeeklyDayOfWeek()
{
diff --git a/0_Framework/Domain/IRepository.cs b/0_Framework/Domain/IRepository.cs
index 8c4b008a..209a5f29 100644
--- a/0_Framework/Domain/IRepository.cs
+++ b/0_Framework/Domain/IRepository.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.EntityFrameworkCore.Storage;
namespace _0_Framework.Domain;
@@ -17,4 +18,6 @@ public interface IRepository where T:class
bool Exists(Expression> expression);
void SaveChanges();
Task SaveChangesAsync();
+ Task BeginTransactionAsync();
+
}
\ No newline at end of file
diff --git a/0_Framework/Exceptions/BadRequestException.cs b/0_Framework/Exceptions/BadRequestException.cs
index ac8324b7..7a85e96f 100644
--- a/0_Framework/Exceptions/BadRequestException.cs
+++ b/0_Framework/Exceptions/BadRequestException.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
namespace _0_Framework.Exceptions;
@@ -14,5 +15,13 @@ public class BadRequestException:Exception
Details = details;
}
+ public BadRequestException(string message, Dictionary extra) :
+ base(message)
+ {
+ Extra = extra;
+ }
+
public string Details { get; }
+ public Dictionary Extra { get; set; }
+
}
\ No newline at end of file
diff --git a/0_Framework/Exceptions/Handler/CustomExceptionHandler.cs b/0_Framework/Exceptions/Handler/CustomExceptionHandler.cs
new file mode 100644
index 00000000..e6fd9da1
--- /dev/null
+++ b/0_Framework/Exceptions/Handler/CustomExceptionHandler.cs
@@ -0,0 +1,84 @@
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Diagnostics;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Logging;
+
+
+namespace _0_Framework.Exceptions.Handler;
+
+public class CustomExceptionHandler : IExceptionHandler
+{
+ private readonly ILogger _logger;
+
+ public CustomExceptionHandler(ILogger logger)
+ {
+ _logger = logger;
+ }
+
+ public async ValueTask TryHandleAsync(HttpContext context, Exception exception, CancellationToken cancellationToken)
+ {
+ _logger.LogError(
+ "Error Message: {exceptionMessage}, Time of occurrence {time}",
+ exception.Message, DateTime.UtcNow);
+
+ (string Detail, string Title, int StatusCode, Dictionary? Extra) details = exception switch
+ {
+ InternalServerException =>
+ (
+ exception.Message,
+ exception.GetType().Name,
+ context.Response.StatusCode = StatusCodes.Status500InternalServerError,
+ null
+ ),
+ BadRequestException bre =>
+ (
+ exception.Message,
+ exception.GetType().Name,
+ context.Response.StatusCode = StatusCodes.Status400BadRequest,
+ bre.Extra
+ ),
+ NotFoundException =>
+ (
+ exception.Message,
+ exception.GetType().Name,
+ context.Response.StatusCode = StatusCodes.Status404NotFound,
+ null
+ ),
+ UnAuthorizeException =>
+ (
+ exception.Message,
+ exception.GetType().Name,
+ context.Response.StatusCode = StatusCodes.Status401Unauthorized,
+ null
+ ),
+ _ =>
+ (
+ exception.Message,
+ exception.GetType().Name,
+ context.Response.StatusCode = StatusCodes.Status500InternalServerError,
+ null
+ )
+ };
+
+ var problemDetails = new ProblemDetails
+ {
+ Title = details.Title,
+ Detail = details.Detail,
+ Status = details.StatusCode,
+ Instance = context.Request.Path,
+ Extensions = details.Extra ?? new Dictionary()
+ };
+
+
+
+ problemDetails.Extensions.Add("traceId", context.TraceIdentifier);
+
+ await context.Response.WriteAsJsonAsync(problemDetails, cancellationToken: cancellationToken);
+
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/0_Framework/Exceptions/UnAuthorizeException.cs b/0_Framework/Exceptions/UnAuthorizeException.cs
new file mode 100644
index 00000000..83edb8f9
--- /dev/null
+++ b/0_Framework/Exceptions/UnAuthorizeException.cs
@@ -0,0 +1,10 @@
+using System;
+
+namespace _0_Framework.Exceptions;
+
+public class UnAuthorizeException:Exception
+{
+ public UnAuthorizeException(string message) : base(message)
+ {
+ }
+}
\ No newline at end of file
diff --git a/0_Framework/InfraStructure/Mongo/MongoDbConfig.cs b/0_Framework/InfraStructure/Mongo/MongoDbConfig.cs
new file mode 100644
index 00000000..bcb351bd
--- /dev/null
+++ b/0_Framework/InfraStructure/Mongo/MongoDbConfig.cs
@@ -0,0 +1,8 @@
+namespace _0_Framework.InfraStructure.Mongo;
+
+public class MongoDbConfig
+{
+ public string ConnectionString { get; set; } = null!;
+
+ public string DatabaseName { get; set; } = null!;
+}
\ No newline at end of file
diff --git a/0_Framework/InfraStructure/QueryableExtensions.cs b/0_Framework/InfraStructure/QueryableExtensions.cs
new file mode 100644
index 00000000..bcfb7bc6
--- /dev/null
+++ b/0_Framework/InfraStructure/QueryableExtensions.cs
@@ -0,0 +1,22 @@
+using System.Collections.Generic;
+using System.Linq;
+
+namespace _0_Framework.InfraStructure;
+
+public static class QueryableExtensions
+{
+ public static IQueryable ApplyPagination(this IQueryable query, int page, int pageSize = 30)
+ {
+ if (page <= 0) page = 1;
+ if (pageSize <= 0) pageSize = 10;
+
+ return query.Skip((page - 1) * pageSize).Take(pageSize);
+ }
+ public static IEnumerable ApplyPagination(this IEnumerable source, int page, int pageSize = 30)
+ {
+ if (page <= 0) page = 1;
+ if (pageSize <= 0) pageSize = 10;
+
+ return source.Skip((page - 1) * pageSize).Take(pageSize);
+ }
+}
\ No newline at end of file
diff --git a/0_Framework/InfraStructure/RepositoryBase.cs b/0_Framework/InfraStructure/RepositoryBase.cs
index 3c573b18..8f8a9fac 100644
--- a/0_Framework/InfraStructure/RepositoryBase.cs
+++ b/0_Framework/InfraStructure/RepositoryBase.cs
@@ -6,6 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using _0_Framework.Domain;
using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Storage;
namespace _0_Framework.InfraStructure
{
@@ -70,5 +71,10 @@ namespace _0_Framework.InfraStructure
{
await _context.SaveChangesAsync();
}
+
+ public async Task BeginTransactionAsync()
+ {
+ return await _context.Database.BeginTransactionAsync();
+ }
}
}
diff --git a/AccountManagement.Application.Contracts/Account/IAccountApplication.cs b/AccountManagement.Application.Contracts/Account/IAccountApplication.cs
index 89f9693a..ac21411b 100644
--- a/AccountManagement.Application.Contracts/Account/IAccountApplication.cs
+++ b/AccountManagement.Application.Contracts/Account/IAccountApplication.cs
@@ -64,4 +64,13 @@ public interface IAccountApplication
///
///
public bool CheckExistClientAccount(string userName);
+ List GetAdminAccountsNew();
+
+ void CameraLogin(CameraLoginRequest request);
+}
+
+public class CameraLoginRequest
+{
+ public string UserName { get; set; }
+ public string Password { get; set; }
}
\ No newline at end of file
diff --git a/AccountManagement.Application/AccountApplication.cs b/AccountManagement.Application/AccountApplication.cs
index 7c32b7db..74880b13 100644
--- a/AccountManagement.Application/AccountApplication.cs
+++ b/AccountManagement.Application/AccountApplication.cs
@@ -18,6 +18,7 @@ using Microsoft.AspNetCore.Mvc.Rendering;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
using Company.Domain.WorkshopAgg;
using System.Security.Claims;
+using _0_Framework.Exceptions;
using AccountManagement.Domain.PositionAgg;
using AccountManagement.Domain.SubAccountAgg;
using AccountManagement.Domain.SubAccountPermissionSubtitle1Agg;
@@ -259,7 +260,8 @@ public class AccountApplication : IAccountApplication
var workshop = workshopList.First();
authViewModel.WorkshopName = workshop.Name;
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
- }
+ authViewModel.WorkshopId = workshop.Id;
+ }
}
_authHelper.Signin(authViewModel);
@@ -317,6 +319,7 @@ public class AccountApplication : IAccountApplication
var workshop = workshopList.First();
authViewModel.WorkshopName = workshop.WorkshopName;
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.WorkshopId);
+ authViewModel.WorkshopId = workshop.WorkshopId;
}
_authHelper.Signin(authViewModel);
idAutoriz = 2;
@@ -368,6 +371,7 @@ public class AccountApplication : IAccountApplication
var workshop = workshopList.First();
authViewModel.WorkshopName = workshop.Name;
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
+ authViewModel.WorkshopId = workshop.Id;
}
}
@@ -515,6 +519,7 @@ public class AccountApplication : IAccountApplication
var workshop = authViewModel.WorkshopList.First();
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
authViewModel.WorkshopName = workshop.Name;
+ authViewModel.WorkshopId = workshop.Id;
}
_authHelper.Signin(authViewModel);
return operation.Succcedded(2);
@@ -795,4 +800,33 @@ public class AccountApplication : IAccountApplication
return _accountRepository.CheckExistClientAccount(userName);
}
+ public List GetAdminAccountsNew()
+ {
+ return _accountRepository.GetAdminAccountsNew();
+ }
+
+ public void CameraLogin(CameraLoginRequest request)
+ {
+ var cameraAccount = _cameraAccountRepository.GetBy(request.UserName);
+
+ if (cameraAccount == null)
+ {
+ throw new BadRequestException(ApplicationMessages.WrongUserPass);
+ }
+
+ (bool Verified, bool NeedUpgrade) result = _passwordHasher.Check(cameraAccount.Password, request.Password);
+
+ if (!result.Verified)
+ throw new BadRequestException(ApplicationMessages.WrongUserPass);
+
+ var mobile = string.IsNullOrWhiteSpace(cameraAccount.Mobile) ? " " : cameraAccount.Mobile;
+
+ var authViewModel = new CameraAuthViewModel(cameraAccount.id, cameraAccount.WorkshopId,
+ cameraAccount.Username, mobile, cameraAccount.WorkshopName, cameraAccount.AccountId,
+ cameraAccount.IsActiveSting);
+ if (cameraAccount.IsActiveSting != "true")
+ throw new BadRequestException(ApplicationMessages.WrongUserPass);
+
+ _authHelper.CameraSignIn(authViewModel);
+ }
}
\ No newline at end of file
diff --git a/Company.Domain/AuthorizedBankDetailsAgg/AuthorizedBankDetails.cs b/Company.Domain/AuthorizedBankDetailsAgg/AuthorizedBankDetails.cs
new file mode 100644
index 00000000..198c1a44
--- /dev/null
+++ b/Company.Domain/AuthorizedBankDetailsAgg/AuthorizedBankDetails.cs
@@ -0,0 +1,46 @@
+using System.Collections.Generic;
+using _0_Framework_b.Domain;
+
+namespace Company.Domain.AuthorizedBankDetailsAgg
+{
+ public class AuthorizedBankDetails : EntityBase
+ {
+ private AuthorizedBankDetails()
+ {
+ OwnersList = new List();
+ }
+
+ public AuthorizedBankDetails(string cardNumber, string accountNumber, string ban, string bankName, List ownersList)
+ {
+ CardNumber = cardNumber;
+ AccountNumber = accountNumber;
+ IBan = ban;
+ BankName = bankName;
+ OwnersList = ownersList ?? new List();
+ }
+
+ public string CardNumber { get; private set; }
+ public string AccountNumber { get; private set; }
+ public string IBan { get; private set; }
+ public string BankName { get; private set; }
+ public List OwnersList { get; private set; }
+ }
+
+ public class AuthorizedBankDetailsOwner // Value Object - not inheriting from EntityBase
+ {
+ private AuthorizedBankDetailsOwner() { }
+
+ public AuthorizedBankDetailsOwner(string fName, string lName, string nationalIdentifier, string customerType)
+ {
+ FName = fName;
+ LName = lName;
+ NationalIdentifier = nationalIdentifier;
+ CustomerType = customerType;
+ }
+
+ public string FName { get; private set; }
+ public string LName { get; private set; }
+ public string NationalIdentifier { get; private set; }
+ public string CustomerType { get; private set; }
+ }
+}
\ No newline at end of file
diff --git a/Company.Domain/AuthorizedBankDetailsAgg/IAuthorizedBankDetailsRepository.cs b/Company.Domain/AuthorizedBankDetailsAgg/IAuthorizedBankDetailsRepository.cs
new file mode 100644
index 00000000..7b514ff5
--- /dev/null
+++ b/Company.Domain/AuthorizedBankDetailsAgg/IAuthorizedBankDetailsRepository.cs
@@ -0,0 +1,13 @@
+using _0_Framework_b.Domain;
+using System.Collections.Generic;
+using Company.Application.Contracts.AuthorizedBankDetails;
+
+namespace Company.Domain.AuthorizedBankDetailsAgg
+{
+ public interface IAuthorizedBankDetailsRepository : IRepository
+ {
+ EditAuthorizedBankDetails GetDetails(long id);
+ List Search(AuthorizedBankDetailsSearchModel searchModel);
+ AuthorizedBankDetailsViewModel GetByIban(string iban);
+ }
+}
diff --git a/Company.Domain/AuthorizedPersonAgg/AuthorizedPerson.cs b/Company.Domain/AuthorizedPersonAgg/AuthorizedPerson.cs
new file mode 100644
index 00000000..93819400
--- /dev/null
+++ b/Company.Domain/AuthorizedPersonAgg/AuthorizedPerson.cs
@@ -0,0 +1,51 @@
+using System;
+using _0_Framework.Domain;
+
+namespace Company.Domain.AuthorizedPersonAgg;
+
+public class AuthorizedPerson : EntityBase
+{
+ public string NationalCode { get; private set; }
+ public string FirstName { get; private set; }
+ public string LastName { get; private set; }
+ public string FatherName { get; private set; }
+ public string BirthDate { get; private set; }
+ public string Gender { get; private set; }
+ public string DeathStatus { get; private set; }
+ public string ShenasnameSeri { get; private set; }
+ public string ShenasnameSerial { get; private set; }
+ public string ShenasnamehNumber { get; private set; }
+ public bool IsVerified { get; private set; }
+ public DateTime? VerificationDate { get; private set; }
+
+ public AuthorizedPerson(string nationalCode, string firstName, string lastName, string fatherName,
+ string birthDate, string gender, string deathStatus, string shenasnameSeri,
+ string shenasnameSerial, string shenasnamehNumber)
+ {
+ NationalCode = nationalCode;
+ FirstName = firstName;
+ LastName = lastName;
+ FatherName = fatherName;
+ BirthDate = birthDate;
+ Gender = gender;
+ DeathStatus = deathStatus;
+ ShenasnameSeri = shenasnameSeri;
+ ShenasnameSerial = shenasnameSerial;
+ ShenasnamehNumber = shenasnamehNumber;
+ IsVerified = true;
+ VerificationDate = DateTime.Now;
+ }
+
+ public void UpdatePersonalInfo(string firstName, string lastName, string fatherName,
+ string gender, string deathStatus)
+ {
+ FirstName = firstName;
+ LastName = lastName;
+ FatherName = fatherName;
+ Gender = gender;
+ DeathStatus = deathStatus;
+ VerificationDate = DateTime.Now;
+ }
+
+ protected AuthorizedPerson() { }
+}
diff --git a/Company.Domain/AuthorizedPersonAgg/IAuthorizedPersonRepository.cs b/Company.Domain/AuthorizedPersonAgg/IAuthorizedPersonRepository.cs
new file mode 100644
index 00000000..2157150a
--- /dev/null
+++ b/Company.Domain/AuthorizedPersonAgg/IAuthorizedPersonRepository.cs
@@ -0,0 +1,9 @@
+using _0_Framework.Domain;
+
+namespace Company.Domain.AuthorizedPersonAgg;
+
+public interface IAuthorizedPersonRepository : IRepository
+{
+ AuthorizedPerson GetByNationalCode(string nationalCode);
+ bool ExistsByNationalCode(string nationalCode);
+}
diff --git a/Company.Domain/CheckoutAgg/Checkout.cs b/Company.Domain/CheckoutAgg/Checkout.cs
index a0a24239..eece536d 100644
--- a/Company.Domain/CheckoutAgg/Checkout.cs
+++ b/Company.Domain/CheckoutAgg/Checkout.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Security.AccessControl;
using _0_Framework.Application;
using _0_Framework.Domain;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
@@ -12,25 +13,25 @@ namespace Company.Domain.CheckoutAgg;
public class Checkout : EntityBase
{
- private Checkout()
- {
-
- }
+ public Checkout()
+ {
+ }
+
public Checkout(string employeeFullName, string fathersName, string nationalCode, string dateOfBirth,
long employeeId, string workshopName, long workshopId, string contractNo, DateTime contractStart,
- DateTime contractEnd, string month, string year, long contractId, long workingHoursId,
+ DateTime contractEnd, string month, string year, long contractId, long workingHoursId,
double monthlySalary, double baseYearsPay, double consumableItems, double housingAllowance,
double overtimePay, double nightworkPay, double fridayPay, double missionPay, double shiftPay,
double familyAllowance, double bonusesPay, double yearsPay, double leavePay,
double insuranceDeduction, double taxDeducation, double installmentDeduction,
double salaryAidDeduction, double absenceDeduction, string sumOfWorkingDays
- , string archiveCode, string personnelCode,
+ , string archiveCode, string personnelCode,
string totalClaims, string totalDeductions, double totalPayment, string signature, double marriedAllowance, bool leaveCheckout,
double creditLeaves, double absencePeriod, double averageHoursPerDay, bool hasRollCall, string overTimeWorkvalue,
string overNightWorkValue, string fridayWorkValue, string rotatingShifValue, string absenceValue,
string totalDayOfLeaveCompute, string totalDayOfYearsCompute, string totalDayOfBunosesCompute,
ICollection loanInstallments,
- ICollection salaryAids,CheckoutRollCall checkoutRollCall)
+ ICollection salaryAids, CheckoutRollCall checkoutRollCall, TimeSpan employeeMandatoryHours, bool hasInsuranceShareTheSameAsList)
{
EmployeeFullName = employeeFullName;
FathersName = fathersName;
@@ -90,14 +91,17 @@ public class Checkout : EntityBase
LoanInstallments = loanInstallments;
SalaryAids = salaryAids;
CheckoutRollCall = checkoutRollCall;
+ EmployeeMandatoryHours = employeeMandatoryHours;
+ HasInsuranceShareTheSameAsList = hasInsuranceShareTheSameAsList;
}
+
public string EmployeeFullName { get; private set; }
public string IsActiveString { get; private set; }
public string Signature { get; private set; }
public string FathersName { get; private set; }
public string NationalCode { get; private set; }
- public string DateOfBirth { get; private set; }
+ public string DateOfBirth { get; private set; }
public long EmployeeId { get; private set; }
public string WorkshopName { get; private set; }
@@ -133,7 +137,7 @@ public class Checkout : EntityBase
public double SalaryAidDeduction { get; private set; }
public double AbsenceDeduction { get; private set; }
-
+
public string SumOfWorkingDays { get; private set; }
public string ArchiveCode { get; private set; }
public string PersonnelCode { get; private set; }
@@ -155,49 +159,70 @@ public class Checkout : EntityBase
//میانگین ساعت کار در یک روز
public double AverageHoursPerDay { get; private set; }
public bool HasRollCall { get; private set; }
- ///
- /// مقدار اضافه کار
- ///
+ ///
+ /// مقدار اضافه کار
+ ///
public string OverTimeWorkValue { get; private set; }
-
- ///
- /// مقدار شبکاری
- ///
+
+ ///
+ /// مقدار شبکاری
+ ///
public string OverNightWorkValue { get; private set; }
-
- ///
- /// مقدار جمعه کاری
- ///
- public string FridayWorkValue { get; private set; }
-
- ///
- /// درصد نوبت کاری
- ///
- public string RotatingShiftValue { get; private set; }
-
- ///
+
+ ///
+ /// مقدار جمعه کاری
+ ///
+ public string FridayWorkValue { get; private set; }
+
+ ///
+ /// درصد نوبت کاری
+ ///
+ public string RotatingShiftValue { get; private set; }
+
+ ///
/// مقدار غیبت
///
- public string AbsenceValue { get; private set; }
+ public string AbsenceValue { get; private set; }
- ///
- /// تعداد روزهای محاسبه شده برای مزد مرخصی
- ///
- public string TotalDayOfLeaveCompute { get; private set; }
- ///
- /// تعداد روزهای محاسبه شده برای سنوات
- ///
- public string TotalDayOfYearsCompute { get; private set; }
- ///
- /// تعداد روزهای محاسبه شده برای عیدی و پاداش
- ///
- public string TotalDayOfBunosesCompute { get; private set; }
+ ///
+ /// تعداد روزهای محاسبه شده برای مزد مرخصی
+ ///
+ public string TotalDayOfLeaveCompute { get; private set; }
+ ///
+ /// تعداد روزهای محاسبه شده برای سنوات
+ ///
+ public string TotalDayOfYearsCompute { get; private set; }
+ ///
+ /// تعداد روزهای محاسبه شده برای عیدی و پاداش
+ ///
+ public string TotalDayOfBunosesCompute { get; private set; }
+ ///
+ /// دارای تداخل مبلغ است. این در زمانی اتفاق می افتد که فیش مبلغ آن تغییر کرده ولی به دلیل مسائل قانونی امکان صدور دوباره آن وجود ندارد
+ ///
+ public bool HasAmountConflict { get; private set; }
- #region valueObjects
+ ///
+ /// ساعت موظفی پرسنل در ماه
+ ///
+ public TimeSpan EmployeeMandatoryHours { get; set; }
- public ICollection LoanInstallments { get; set; } = [];
- public ICollection SalaryAids { get; set; } = [];
+ ///
+ /// آیا حق بیمه مشابه لیست بیمه حساب شده؟
+ ///
+ public bool HasInsuranceShareTheSameAsList { get; private set; }
+
+ ///
+ /// آیا فیش نیاز به بروزرسانی دارد
+ ///
+ public bool IsUpdateNeeded { get; private set; }
+
+ public List CheckoutWarningMessageList { get; set; }
+
+ #region valueObjects
+
+ public ICollection LoanInstallments { get; set; } = [];
+ public ICollection SalaryAids { get; set; } = [];
public CheckoutRollCall CheckoutRollCall { get; private set; }
#endregion
@@ -266,7 +291,7 @@ public class Checkout : EntityBase
var year = contarctStart.ToFarsiYear();
var sumYear = year.Substring(Math.Max(0, year.Length - 2));
-
+
ContractNo = archiveCode + "/" + personnelCode + "/" + sumYear + "/" + month;
}
public void Active()
@@ -301,7 +326,7 @@ public class Checkout : EntityBase
}
- public void SetSalaryAid(ICollection salaryAids,double salaryAidAmount)
+ public void SetSalaryAid(ICollection salaryAids, double salaryAidAmount)
{
SalaryAids = salaryAids;
SalaryAidDeduction = salaryAidAmount;
@@ -316,23 +341,48 @@ public class Checkout : EntityBase
{
CheckoutRollCall = checkoutRollCall;
}
+
+ public void SetAmountConflict(bool hasAmountConflict)
+ {
+ HasAmountConflict = hasAmountConflict;
+ }
+
+ public void SetEmployeeMandatoryHours(TimeSpan employeeMandatoryHours)
+ {
+ EmployeeMandatoryHours = employeeMandatoryHours;
+ }
+
+ public void SetInsuranceShare()
+ {
+ HasInsuranceShareTheSameAsList = true;
+ }
+
+ ///
+ /// نیاز به آپدیت
+ ///
+ public void SetUpdateNeeded()
+ {
+ IsUpdateNeeded = true;
+ }
+
+
}
public class CheckoutRollCall
{
- private CheckoutRollCall(){}
- public CheckoutRollCall(TimeSpan totalMandatoryTimeSpan, TimeSpan totalPresentTimeSpan, TimeSpan totalBreakTimeSpan,
- TimeSpan totalWorkingTimeSpan, TimeSpan totalPaidLeaveTmeSpan, TimeSpan totalSickLeaveTimeSpan,
- ICollection rollCallDaysCollection)
- {
- TotalMandatoryTimeSpan = totalMandatoryTimeSpan;
- TotalPresentTimeSpan = totalPresentTimeSpan;
- TotalBreakTimeSpan = totalBreakTimeSpan;
- TotalWorkingTimeSpan = totalWorkingTimeSpan;
- TotalPaidLeaveTmeSpan = totalPaidLeaveTmeSpan;
- TotalSickLeaveTimeSpan = totalSickLeaveTimeSpan;
- RollCallDaysCollection = rollCallDaysCollection;
- }
+ private CheckoutRollCall() { }
+ public CheckoutRollCall(TimeSpan totalMandatoryTimeSpan, TimeSpan totalPresentTimeSpan, TimeSpan totalBreakTimeSpan,
+ TimeSpan totalWorkingTimeSpan, TimeSpan totalPaidLeaveTmeSpan, TimeSpan totalSickLeaveTimeSpan,
+ ICollection rollCallDaysCollection)
+ {
+ TotalMandatoryTimeSpan = totalMandatoryTimeSpan;
+ TotalPresentTimeSpan = totalPresentTimeSpan;
+ TotalBreakTimeSpan = totalBreakTimeSpan;
+ TotalWorkingTimeSpan = totalWorkingTimeSpan;
+ TotalPaidLeaveTmeSpan = totalPaidLeaveTmeSpan;
+ TotalSickLeaveTimeSpan = totalSickLeaveTimeSpan;
+ RollCallDaysCollection = rollCallDaysCollection;
+ }
///
@@ -373,27 +423,27 @@ public class CheckoutRollCall
public class CheckoutRollCallDay
{
- private CheckoutRollCallDay(){}
- public CheckoutRollCallDay(DateTime date, string firstStartDate, string firstEndDate,
- string secondStartDate, string secondEndDate, TimeSpan breakTimeSpan,
- bool isSliced, TimeSpan workingTimeSpan, bool isAbsent, bool isFriday,
- bool isHoliday, string leaveType)
- {
- Date = date;
- FirstStartDate = firstStartDate;
- FirstEndDate = firstEndDate;
- SecondStartDate = secondStartDate;
- SecondEndDate = secondEndDate;
- BreakTimeSpan = breakTimeSpan;
- IsSliced = isSliced;
- WorkingTimeSpan = workingTimeSpan;
- IsAbsent = isAbsent;
- IsFriday = isFriday;
- IsHoliday = isHoliday;
- LeaveType = leaveType;
- }
+ private CheckoutRollCallDay() { }
+ public CheckoutRollCallDay(DateTime date, string firstStartDate, string firstEndDate,
+ string secondStartDate, string secondEndDate, TimeSpan breakTimeSpan,
+ bool isSliced, TimeSpan workingTimeSpan, bool isAbsent, bool isFriday,
+ bool isHoliday, string leaveType)
+ {
+ Date = date;
+ FirstStartDate = firstStartDate;
+ FirstEndDate = firstEndDate;
+ SecondStartDate = secondStartDate;
+ SecondEndDate = secondEndDate;
+ BreakTimeSpan = breakTimeSpan;
+ IsSliced = isSliced;
+ WorkingTimeSpan = workingTimeSpan;
+ IsAbsent = isAbsent;
+ IsFriday = isFriday;
+ IsHoliday = isHoliday;
+ LeaveType = leaveType;
+ }
- public long Id { get; set; }
+ public long Id { get; set; }
///
/// تاریخ
@@ -437,12 +487,12 @@ public class CheckoutRollCallDay
///
/// آیا غیبت است
///
- public bool IsAbsent { get; private set; }
+ public bool IsAbsent { get; private set; }
///
/// آیا جمعه است
///
- public bool IsFriday { get; private set; }
+ public bool IsFriday { get; private set; }
///
/// آیا تعطیل رسمی است
@@ -454,6 +504,6 @@ public class CheckoutRollCallDay
///
public string LeaveType { get; private set; }
- public long CheckoutId { get; set; }
+ public long CheckoutId { get; set; }
}
\ No newline at end of file
diff --git a/Company.Domain/CheckoutAgg/CheckoutWarningMessage.cs b/Company.Domain/CheckoutAgg/CheckoutWarningMessage.cs
new file mode 100644
index 00000000..167a9664
--- /dev/null
+++ b/Company.Domain/CheckoutAgg/CheckoutWarningMessage.cs
@@ -0,0 +1,32 @@
+using _0_Framework.Application.Enums;
+using _0_Framework.Domain;
+
+namespace Company.Domain.CheckoutAgg;
+
+public class CheckoutWarningMessage : EntityBaseWithoutCreationDate
+{
+ public CheckoutWarningMessage(string warningMessage, long checkoutId, TypeOfCheckoutWarning typeOfCheckoutWarning)
+ {
+ WarningMessage = warningMessage;
+ CheckoutId = checkoutId;
+ TypeOfCheckoutWarning = typeOfCheckoutWarning;
+ }
+
+ ///
+ /// پیام هشدار
+ ///
+ public string WarningMessage { get; private set; }
+
+
+ ///
+ /// آی دی فیش حقوقی
+ ///
+ public long CheckoutId { get; private set; }
+
+ ///
+ /// نوع هشدار فیش حقوقی
+ ///
+ public TypeOfCheckoutWarning TypeOfCheckoutWarning { get; private set; }
+
+ public Checkout Checkout { get; set; }
+}
\ No newline at end of file
diff --git a/Company.Domain/CheckoutAgg/ICheckoutRepository.cs b/Company.Domain/CheckoutAgg/ICheckoutRepository.cs
index 90d2f576..5294bbaa 100644
--- a/Company.Domain/CheckoutAgg/ICheckoutRepository.cs
+++ b/Company.Domain/CheckoutAgg/ICheckoutRepository.cs
@@ -18,7 +18,7 @@ public interface ICheckoutRepository : IRepository
///
///
///
- (bool hasChekout, double FamilyAlloance, double OverTimePay) HasCheckout(long workshopId, long employeId,
+ (bool hasChekout, double FamilyAlloance, double OverTimePay, double RotatingShift, double Nightwork, double Fridaywork, double YraesPay) HasCheckout(long workshopId, long employeId,
string year, string month);
EditCheckout GetDetails(long id);
@@ -78,4 +78,6 @@ public interface ICheckoutRepository : IRepository
long workshopId, DateTime start, DateTime end);
#endregion
+
+ Task GetByWorkshopIdEmployeeIdInDate(long workshopId, long employeeId, DateTime inDate);
}
\ No newline at end of file
diff --git a/Company.Domain/ClassifiedSalaryAgg/ClassifiedSalary.cs b/Company.Domain/ClassifiedSalaryAgg/ClassifiedSalary.cs
index b9c58e62..1e67bc01 100644
--- a/Company.Domain/ClassifiedSalaryAgg/ClassifiedSalary.cs
+++ b/Company.Domain/ClassifiedSalaryAgg/ClassifiedSalary.cs
@@ -10,6 +10,7 @@ namespace Company.Domain.ClassifiedSalaryAgg
{
public class ClassifiedSalary : EntityBase
{
+ //test//test
public ClassifiedSalary(double group1, double group2, double group3, double group4, double group5, double group6, double group7, double group8, double group9, double group10, double group11, double group12, double group13, double group14, double group15, double group16, double group17, double group18, double group19, double group20, DateTime startDate, DateTime endDate, int year)
{
Group1 = group1;
diff --git a/Company.Domain/Company.Domain.csproj b/Company.Domain/Company.Domain.csproj
index 76106517..09e112b7 100644
--- a/Company.Domain/Company.Domain.csproj
+++ b/Company.Domain/Company.Domain.csproj
@@ -18,4 +18,8 @@
+
+
+
+
diff --git a/Company.Domain/ContactUsAgg/ContactUs.cs b/Company.Domain/ContactUsAgg/ContactUs.cs
new file mode 100644
index 00000000..43f9825f
--- /dev/null
+++ b/Company.Domain/ContactUsAgg/ContactUs.cs
@@ -0,0 +1,26 @@
+using _0_Framework.Domain;
+
+namespace Company.Domain.ContactUsAgg;
+
+public class ContactUs:EntityBase
+{
+ public ContactUs(string firstName, string lastName, string email, string phoneNumber, string title, string message)
+ {
+ FirstName = firstName.Trim();
+ LastName = lastName.Trim();
+ Email = email;
+ PhoneNumber = phoneNumber;
+ Title = title;
+ Message = message;
+ FullName = FirstName + " " + LastName;
+ }
+
+ public string FirstName { get; private set; }
+ public string LastName { get; private set; }
+ public string Email { get; private set; }
+ public string PhoneNumber { get; private set; }
+ public string Title { get; private set; }
+ public string Message { get; private set; }
+ public string FullName { get; private set; }
+
+}
\ No newline at end of file
diff --git a/Company.Domain/ContactUsAgg/IContactUsRepository.cs b/Company.Domain/ContactUsAgg/IContactUsRepository.cs
new file mode 100644
index 00000000..8dbe78bd
--- /dev/null
+++ b/Company.Domain/ContactUsAgg/IContactUsRepository.cs
@@ -0,0 +1,8 @@
+using _0_Framework.Domain;
+
+namespace Company.Domain.ContactUsAgg;
+
+public interface IContactUsRepository : IRepository
+{
+
+}
\ No newline at end of file
diff --git a/Company.Domain/ContarctingPartyAgg/IPersonalContractingPartyRepository.cs b/Company.Domain/ContarctingPartyAgg/IPersonalContractingPartyRepository.cs
index 0ba87c2d..26e6e6df 100644
--- a/Company.Domain/ContarctingPartyAgg/IPersonalContractingPartyRepository.cs
+++ b/Company.Domain/ContarctingPartyAgg/IPersonalContractingPartyRepository.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using _0_Framework.Application;
using _0_Framework.Domain;
using AccountManagement.Application.Contracts.Account;
+using System.Threading.Tasks;
namespace Company.Domain.ContarctingPartyAgg;
@@ -14,7 +15,7 @@ public interface IPersonalContractingPartyRepository :IRepository Search(PersonalContractingPartySearchModel searchModel2);
- int GetLastArchiveCode();
+ int GetLastNewArchiveCode();
#region Mahan
List SearchByName(string name);
@@ -42,6 +43,37 @@ public interface IPersonalContractingPartyRepository :IRepository
+ /// لیست طرف حساب ها
+ ///
+ ///
+ ///
+ Task> GetList(ContractingPartyGetListSearchModel searchModel);
+ ///
+ /// لیست طرف حساب برای سلکت لیست سرچ
+ ///
+ ///
+ ///
+ Task> GetSelectList(string search,long id);
+ ///
+ /// لیستی از شماره ملی یا شناسه ملی بر اساس حقیقی یا حقوقی بودن
+ ///
+ ///
+ Task> GetNationalCodeOrNationalId();
+
+ ///
+ /// غیرفعال کردن طرف حساب و زیرمجموعه های آن
+ ///
+ ///
+ ///
+ Task> DeactivateWithSubordinates(long id);
+
+ void Remove(PersonalContractingParty entity);
+ Task GetRealDetails(long id);
+ Task GetLegalDetails(long id);
+
+ Task GetByNationalCode(string nationalCode);
+ Task GetByRegisterId(string registerId);
}
\ No newline at end of file
diff --git a/Company.Domain/ContarctingPartyAgg/PersonalContractingParty.cs b/Company.Domain/ContarctingPartyAgg/PersonalContractingParty.cs
index 7097b061..abe676c0 100644
--- a/Company.Domain/ContarctingPartyAgg/PersonalContractingParty.cs
+++ b/Company.Domain/ContarctingPartyAgg/PersonalContractingParty.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using _0_Framework.Application;
using _0_Framework.Domain;
+using Company.Domain.ContractingPartyBankAccountsAgg;
using Company.Domain.empolyerAgg;
using Company.Domain.RepresentativeAgg;
@@ -72,17 +73,33 @@ public class PersonalContractingParty : EntityBase
/// آیا از طریق ای پی ای احراز هویت شده است
///
public bool IsAuthenticated { get; private set; }
-
-
+
///
/// جنسیت
///
public Gender Gender { get; private set; }
+
+ ///
+ /// سمت و صاحب امضاء اوراق (فقط برای طرف حقوقی)
+ ///
+ public string LegalPosition { get; private set; }
+
+ ///
+ /// نام مدیر عامل (فقط برای طرف حقوقی)
+ ///
+ public string CeoFName { get; private set; }
+
+ ///
+ /// نام خانوادگی مدیر عامل (فقط برای طرف حقوقی)
+ ///
+ public string CeoLName { get; private set; }
+
#endregion
public List Employers { get; private set; }
public Representative Representative { get; set; }
+ public List ContractingPartyBankAccounts { get; set; }
public PersonalContractingParty()
{
@@ -92,7 +109,8 @@ public class PersonalContractingParty : EntityBase
public PersonalContractingParty(string fName, string lName, string nationalcode, string idNumber,
/*string legalName,*/ string registerId, string nationalId, string isLegal,
string phone, string agentPhone, string address,long representativeId,
- string representativeFullName, int archiveCode, string state,string city, string zone, string sureName)
+ string representativeFullName, int archiveCode, string state,string city,
+ string zone, string sureName,string ceoFName,string ceoLName,string legalPosition=null)
{
FName = fName;
@@ -118,8 +136,9 @@ public class PersonalContractingParty : EntityBase
IsActiveString = "true";
IsBlock = "false";
BlockTimes = 0;
-
-
+ LegalPosition = legalPosition;
+ CeoFName = ceoFName;
+ CeoLName = ceoLName;
}
@@ -149,7 +168,7 @@ public class PersonalContractingParty : EntityBase
}
public void EditLegal(string lName, string registerId, string nationalId, string phone, string agentPhone, string address, long representativeId, string representativeFullName, int archiveCode,
- string state, string city, string zone, string sureName)
+ string state, string city, string zone, string sureName,string legalPosition = null)
{
LName = lName;
@@ -166,6 +185,8 @@ public class PersonalContractingParty : EntityBase
State = state;
City = city;
Zone = zone;
+ if (legalPosition != null)
+ LegalPosition = legalPosition;
}
@@ -201,7 +222,8 @@ public class PersonalContractingParty : EntityBase
IsAuthenticated = true;
}
- public void Authentication(string fName, string lName, string fatherName,string idNumber, string idNumberSeri, string idNumberSerial, string dateOfBirth, Gender gender)
+ public void Authentication(string fName, string lName, string fatherName,string idNumber,
+ string idNumberSeri, string idNumberSerial, string dateOfBirth, Gender gender,string phone)
{
this.FName = fName;
this.LName = lName;
@@ -212,5 +234,31 @@ public class PersonalContractingParty : EntityBase
this.IdNumber = idNumber;
this.Gender = gender;
this.IsAuthenticated = true;
+ Phone = phone;
+ }
+
+ public void LegalAuthentication(string fName, string lName, string fatherName,string idNumber, string idNumberSeri,
+ string idNumberSerial, string dateOfBirth, Gender gender,string phone)
+ {
+ CeoFName = fName;
+ CeoLName = lName;
+ this.FatherName = fatherName;
+ this.IdNumberSeri = idNumberSeri;
+ this.IdNumberSerial = idNumberSerial;
+ this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : null;
+ this.IdNumber = idNumber;
+ this.Gender = gender;
+ this.IsAuthenticated = true;
+ Phone = phone;
+ }
+
+ public void RegisterComplete(string fatherName, string idNumberSeri, string idNumberSerial, DateTime dateOfBirth, Gender gender)
+ {
+ this.FatherName = fatherName;
+ this.IdNumberSeri = idNumberSeri;
+ this.IdNumberSerial = idNumberSerial;
+ this.DateOfBirth = dateOfBirth;
+ this.Gender = gender;
+ this.IsAuthenticated = true;
}
}
\ No newline at end of file
diff --git a/Company.Domain/ContractAgg/Contract.cs b/Company.Domain/ContractAgg/Contract.cs
index 24e2e371..5ad80d1f 100644
--- a/Company.Domain/ContractAgg/Contract.cs
+++ b/Company.Domain/ContractAgg/Contract.cs
@@ -17,7 +17,7 @@ public class Contract : EntityBase
public Contract(long personnelCode, long employeeId, long employerId,
long workshopIds, long yearlySalaryId, DateTime contarctStart, DateTime contractEnd, string dayliWage,
string archiveCode, DateTime getWorkDate, DateTime setContractDate, string jobType,
- string contractType, string workshopAddress1, string workshopAddress2, string consumableItems, long jobTypeId, string housingAllowance, string agreementSalary, string workingHoursWeekly, string familyAllowance, string contractPeriod)
+ string contractType, string workshopAddress1, string workshopAddress2, string consumableItems, long jobTypeId, string housingAllowance, string agreementSalary, string workingHoursWeekly, string familyAllowance, string contractPeriod, double dailySalaryAffected, double baseYearAffected, double dailySalaryUnAffected, double baseYearUnAffected, bool hasManualDailyWage, string dailyWageType)
{
PersonnelCode = personnelCode;
EmployeeId = employeeId;
@@ -45,6 +45,19 @@ public class Contract : EntityBase
WorkingHoursWeekly = workingHoursWeekly;
FamilyAllowance = familyAllowance;
ContractPeriod = contractPeriod;
+
+ //پراپرتی های جدید برای دستمزد دلخواه
+ #region NewManualDailyWage
+ DailySalaryAffected = dailySalaryAffected;
+ BaseYearAffected = baseYearAffected;
+ DailySalaryUnAffected = dailySalaryUnAffected;
+ BaseYearUnAffected = baseYearUnAffected;
+ HasManualDailyWage = hasManualDailyWage;
+ DailyWageType = dailyWageType;
+
+ #endregion
+
+
Signature = "0";
@@ -65,7 +78,42 @@ public class Contract : EntityBase
public DateTime SetContractDate { get; private set; }
public string JobType { get; private set; }
public string ContractType { get; private set; }
+ ///
+ /// مزد تجمیعی یعد از تاثیر ساعت کار
+ ///
public string DayliWage { get; private set; }
+
+ ///
+ /// دستمزد روزانه خام بعد از تاثیر ساعت کار
+ ///
+ public double DailySalaryAffected { get; set; }
+
+ ///
+ /// پایه سنوات بعد از تاثیر ساعت کار
+ ///
+ public double BaseYearAffected { get; set; }
+
+
+ ///
+ /// دستمزد روزانه قبل از تاثیر ساعت کار
+ ///
+ public double DailySalaryUnAffected { get; set; }
+
+ ///
+ /// پایه سنوات قبل از تاثیر ساعت کار
+ ///
+ public double BaseYearUnAffected { get; set; }
+
+ ///
+ /// آیا دستمزد روزانه دستی وارد شده است؟
+ ///
+ public bool HasManualDailyWage { get; set; }
+
+ ///
+ /// نوع دستمزد انتخاب شده
+ ///
+ public string DailyWageType { get; set; }
+
public string IsActiveString { get; private set; }
public string ArchiveCode { get; private set; }
public string WorkshopAddress1 { get; private set; }
@@ -89,6 +137,7 @@ public class Contract : EntityBase
public Contract()
{
+
WorkingHoursList = new List();
}
public void Edit(long pesrsonnelCode, long employeeId, long employerId, long workshopId, long yearlySalaryId,
diff --git a/Company.Domain/ContractAgg/IContractRepository.cs b/Company.Domain/ContractAgg/IContractRepository.cs
index 808c7e3b..3d6ea269 100644
--- a/Company.Domain/ContractAgg/IContractRepository.cs
+++ b/Company.Domain/ContractAgg/IContractRepository.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.Contract;
@@ -9,6 +10,24 @@ namespace Company.Domain.ContractAgg;
public interface IContractRepository : IRepository
{
+ ///
+ /// دریافت مزد ارتقاء یافته
+ ///
+ ///
+ ///
+ ///
+ ///
+ Task GetManualDailWage(long workshopId, long employeeId, long yearlySalaryId, DateTime contractStart);
+
+ ///
+ /// دریافت لیست مزد ارتقاء یافته
+ ///
+ ///
+ ///
+ ///
+ ///
+ Task GetManualDailWageList(long workshopId, long employeeId,
+ DateTime contractStart);
EditContract GetDetails(long id);
EditContract GetContractByStartEnd(DateTime start, DateTime end, long workshopId, long employeeId);
diff --git a/Company.Domain/ContractingPartyBankAccountsAgg/ContractingPartyBankAccount.cs b/Company.Domain/ContractingPartyBankAccountsAgg/ContractingPartyBankAccount.cs
new file mode 100644
index 00000000..84166f26
--- /dev/null
+++ b/Company.Domain/ContractingPartyBankAccountsAgg/ContractingPartyBankAccount.cs
@@ -0,0 +1,27 @@
+using _0_Framework.Domain;
+using Company.Domain.ContarctingPartyAgg;
+
+namespace Company.Domain.ContractingPartyBankAccountsAgg;
+
+public class ContractingPartyBankAccount : EntityBase
+{
+ public long ContractingPartyId { get; private set; }
+
+ public PersonalContractingParty ContractingParty { get; private set; }
+ public string CardNumber { get; private set; }
+ public string AccountHolderName { get; private set; }
+ public string AccountNumber { get; private set; }
+ public string IBan { get; private set; }
+ public bool IsAuth { get; private set; }
+
+ public ContractingPartyBankAccount(long contractingPartyId, string cardNumber, string accountHolderName,
+ string accountNumber, string iBan , bool isAuth)
+ {
+ ContractingPartyId = contractingPartyId;
+ CardNumber = cardNumber;
+ AccountHolderName = accountHolderName;
+ AccountNumber = accountNumber;
+ IBan = iBan;
+ IsAuth = isAuth;
+ }
+}
\ No newline at end of file
diff --git a/Company.Domain/ContractingPartyBankAccountsAgg/IContractingPartyBankAccountsRepository.cs b/Company.Domain/ContractingPartyBankAccountsAgg/IContractingPartyBankAccountsRepository.cs
new file mode 100644
index 00000000..e555fd6c
--- /dev/null
+++ b/Company.Domain/ContractingPartyBankAccountsAgg/IContractingPartyBankAccountsRepository.cs
@@ -0,0 +1,19 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using _0_Framework.Application;
+using _0_Framework.Domain;
+using CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
+
+namespace Company.Domain.ContractingPartyBankAccountsAgg;
+
+public interface IContractingPartyBankAccountsRepository:IRepository
+{
+ Task GetList(ContractingPartyBankAccountSearchModel searchModel);
+ Task> ContractingPartyOrAccountHolderNameSelectList(string search, string selected);
+ Task> IBanSelectList(string search, string selected);
+
+ Task> CardNumberSelectList(string search, string selected);
+ Task> AccountNumberSelectList(string search, string selected);
+ Task> GetAccountHolderNameSelectList(string search, string selected);
+ Task> ContractingPartyNamesSelectList(string search, string selected);
+}
\ No newline at end of file
diff --git a/Company.Domain/CustomizeCheckoutAgg/CustomizeCheckout.cs b/Company.Domain/CustomizeCheckoutAgg/CustomizeCheckout.cs
index a5a5b953..637290cc 100644
--- a/Company.Domain/CustomizeCheckoutAgg/CustomizeCheckout.cs
+++ b/Company.Domain/CustomizeCheckoutAgg/CustomizeCheckout.cs
@@ -374,6 +374,13 @@ public class CustomizeCheckout : EntityBase
TotalPayment = TotalPayment - previousAmount + newAmount;
}
+ ///
+ /// آیا مغایرت مبلغ دارد
+ ///
+ public bool HasAmountConflict { get; private set; }
-
+ public void SetHasAmountConflict(bool hasConflict)
+ {
+ HasAmountConflict = hasConflict;
+ }
}
\ No newline at end of file
diff --git a/Company.Domain/CustomizeCheckoutTempAgg/CustomizeCheckoutTemp.cs b/Company.Domain/CustomizeCheckoutTempAgg/CustomizeCheckoutTemp.cs
index 8a3cb9f2..d6330491 100644
--- a/Company.Domain/CustomizeCheckoutTempAgg/CustomizeCheckoutTemp.cs
+++ b/Company.Domain/CustomizeCheckoutTempAgg/CustomizeCheckoutTemp.cs
@@ -377,4 +377,16 @@ public class CustomizeCheckoutTemp : EntityBase
{
TotalPayment = TotalPayment - previousAmount + newAmount;
}
+
+ ///
+ /// آیا مغایرت مبلغ دارد
+ ///
+ public bool HasAmountConflict { get; private set; }
+
+
+
+ public void SetHasAmountConflict(bool hasConflict)
+ {
+ HasAmountConflict = hasConflict;
+ }
}
\ No newline at end of file
diff --git a/Company.Domain/EmployeeAgg/IEmployeeRepository.cs b/Company.Domain/EmployeeAgg/IEmployeeRepository.cs
index ae689fb6..43a2564a 100644
--- a/Company.Domain/EmployeeAgg/IEmployeeRepository.cs
+++ b/Company.Domain/EmployeeAgg/IEmployeeRepository.cs
@@ -71,7 +71,12 @@ public interface IEmployeeRepository : IRepository
Task GetEmployeeEditInEmployeeDocumentWorkFlow(long employeeId,
long workshopId);
- #endregion
+ #endregion
+
+ #region Api
+ Task> GetSelectList(string searchText,long id);
+ Task> GetList(GetEmployeeListSearchModel searchModel);
+ #endregion
}
\ No newline at end of file
diff --git a/Company.Domain/EmployeeFaceEmbeddingAgg/EmployeeFaceEmbedding.cs b/Company.Domain/EmployeeFaceEmbeddingAgg/EmployeeFaceEmbedding.cs
new file mode 100644
index 00000000..d38fc151
--- /dev/null
+++ b/Company.Domain/EmployeeFaceEmbeddingAgg/EmployeeFaceEmbedding.cs
@@ -0,0 +1,189 @@
+using System;
+using System.Collections.Generic;
+using MongoDB.Bson;
+using MongoDB.Bson.Serialization.Attributes;
+
+namespace Company.Domain.EmployeeFaceEmbeddingAgg;
+
+public class EmployeeFaceEmbedding
+ {
+ public EmployeeFaceEmbedding()
+ {
+ EmbeddingHistory = new List();
+ MetadataHistory = new List();
+ }
+
+ public EmployeeFaceEmbedding(string employeeFullName, long employeeId, long workshopId,
+ List embeddings, EmployeeFaceEmbeddingMetadata metadata)
+ {
+ Id = Guid.NewGuid().ToString();
+ EmployeeFullName = employeeFullName;
+ EmployeeId = employeeId;
+ WorkshopId = workshopId;
+ Embeddings = embeddings;
+ Metadata = metadata;
+ EmbeddingHistory = new List();
+ MetadataHistory = new List();
+ CreatedAt = DateTime.UtcNow;
+ UpdatedAt = DateTime.UtcNow;
+ }
+
+ [BsonId]
+ [BsonRepresentation(BsonType.String)]
+ public string Id { get; set; }
+
+ [BsonElement("employeeFullName")]
+ public string EmployeeFullName { get; set; }
+
+ [BsonElement("employeeId")]
+ public long EmployeeId { get; set; }
+
+ [BsonElement("workshopId")]
+ public long WorkshopId { get; set; }
+
+ [BsonElement("embeddings")]
+ public List Embeddings { get; set; }
+
+ [BsonElement("metadata")]
+ public EmployeeFaceEmbeddingMetadata Metadata { get; set; }
+
+ [BsonElement("embeddingHistory")]
+ public List EmbeddingHistory { get; set; }
+
+ [BsonElement("metadataHistory")]
+ public List MetadataHistory { get; set; }
+
+ [BsonElement("createdAt")]
+ public DateTime CreatedAt { get; set; }
+
+ [BsonElement("updatedAt")]
+ public DateTime UpdatedAt { get; set; }
+
+ public void UpdateEmbedding(List newEmbedding, double confidence, double refinementPercentage)
+ {
+ if (Embeddings != null)
+ {
+ EmbeddingHistory.Add(new EmbeddingHistoryItem
+ {
+ Embedding = new List(Embeddings),
+ Timestamp = DateTime.UtcNow,
+ Confidence = confidence,
+ RefinementPercentage = refinementPercentage
+ });
+ }
+
+ Embeddings = newEmbedding;
+ UpdatedAt = DateTime.UtcNow;
+ }
+
+ public void UpdateMetadata(EmployeeFaceEmbeddingMetadata newMetadata, double confidence, double refinementPercentage)
+ {
+ if (Metadata != null)
+ {
+ MetadataHistory.Add(new MetadataHistoryItem
+ {
+ Metadata = Metadata,
+ Timestamp = DateTime.UtcNow,
+ Confidence = confidence,
+ RefinementPercentage = refinementPercentage
+ });
+ }
+
+ Metadata = newMetadata;
+ UpdatedAt = DateTime.UtcNow;
+ }
+
+ public void UpdateEmployeeInfo(string employeeFullName, long workshopId)
+ {
+ EmployeeFullName = employeeFullName;
+ WorkshopId = workshopId;
+ UpdatedAt = DateTime.UtcNow;
+ }
+ }
+
+ public class EmployeeFaceEmbeddingMetadata
+ {
+ [BsonElement("avg_eye_distance_normalized")]
+ public double AvgEyeDistanceNormalized { get; set; }
+
+ [BsonElement("avg_eye_to_face_ratio")]
+ public double AvgEyeToFaceRatio { get; set; }
+
+ [BsonElement("avg_face_aspect_ratio")]
+ public double AvgFaceAspectRatio { get; set; }
+
+ [BsonElement("avg_detection_confidence")]
+ public double AvgDetectionConfidence { get; set; }
+
+ [BsonElement("avg_keypoints_normalized")]
+ public EmployeeFaceEmbeddingKeypoints AvgKeypointsNormalized { get; set; }
+
+ [BsonElement("per_image_metadata")]
+ public List PerImageMetadata { get; set; }
+ }
+
+ public class EmployeeFaceEmbeddingKeypoints
+ {
+ [BsonElement("left_eye")]
+ public double[] LeftEye { get; set; }
+
+ [BsonElement("right_eye")]
+ public double[] RightEye { get; set; }
+
+ [BsonElement("nose")]
+ public double[] Nose { get; set; }
+
+ [BsonElement("mouth_left")]
+ public double[] MouthLeft { get; set; }
+
+ [BsonElement("mouth_right")]
+ public double[] MouthRight { get; set; }
+ }
+
+ public class ImageMetadata
+ {
+ [BsonElement("face_aspect_ratio")]
+ public double FaceAspectRatio { get; set; }
+
+ [BsonElement("eye_distance_normalized")]
+ public double EyeDistanceNormalized { get; set; }
+
+ [BsonElement("eye_to_face_ratio")]
+ public double EyeToFaceRatio { get; set; }
+
+ [BsonElement("detection_confidence")]
+ public double DetectionConfidence { get; set; }
+
+ [BsonElement("keypoints_normalized")]
+ public EmployeeFaceEmbeddingKeypoints KeypointsNormalized { get; set; }
+ }
+
+ public class EmbeddingHistoryItem
+ {
+ [BsonElement("embedding")]
+ public List Embedding { get; set; }
+
+ [BsonElement("timestamp")]
+ public DateTime Timestamp { get; set; }
+
+ [BsonElement("confidence")]
+ public double Confidence { get; set; }
+
+ [BsonElement("refinementPercentage")]
+ public double RefinementPercentage { get; set; }
+ }
+
+ public class MetadataHistoryItem
+ {
+ [BsonElement("metadata")]
+ public EmployeeFaceEmbeddingMetadata Metadata { get; set; }
+
+ [BsonElement("timestamp")]
+ public DateTime Timestamp { get; set; }
+
+ [BsonElement("confidence")]
+ public double Confidence { get; set; }
+
+ [BsonElement("refinementPercentage")]
+ public double RefinementPercentage { get; set; }
+ }
\ No newline at end of file
diff --git a/Company.Domain/EmployeeFaceEmbeddingAgg/IEmployeeFaceEmbeddingRepository.cs b/Company.Domain/EmployeeFaceEmbeddingAgg/IEmployeeFaceEmbeddingRepository.cs
new file mode 100644
index 00000000..f2b6e470
--- /dev/null
+++ b/Company.Domain/EmployeeFaceEmbeddingAgg/IEmployeeFaceEmbeddingRepository.cs
@@ -0,0 +1,15 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace Company.Domain.EmployeeFaceEmbeddingAgg;
+
+public interface IEmployeeFaceEmbeddingRepository
+{
+ Task CreateAsync(EmployeeFaceEmbedding employeeFaceEmbedding);
+ Task UpdateAsync(EmployeeFaceEmbedding employeeFaceEmbedding);
+ Task GetByIdAsync(string id);
+ Task GetByEmployeeIdAsync(long employeeId);
+ Task> GetByWorkshopIdAsync(long workshopId);
+ Task> GetByWorkshopIdsAsync(List workshopIds);
+ Task DeleteAsync(string id);
+}
\ No newline at end of file
diff --git a/Company.Domain/FinancialStatmentAgg/FinancialStatment.cs b/Company.Domain/FinancialStatmentAgg/FinancialStatment.cs
index a1fb2830..4a98f120 100644
--- a/Company.Domain/FinancialStatmentAgg/FinancialStatment.cs
+++ b/Company.Domain/FinancialStatmentAgg/FinancialStatment.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -16,7 +17,8 @@ public class FinancialStatment : EntityBase
{
ContractingPartyId = contractingPartyId;
ContractingPartyName = contractingPartyName;
-
+ PublicId = Guid.NewGuid();
+ FinancialTransactionList = [];
}
public FinancialStatment()
@@ -25,10 +27,25 @@ public class FinancialStatment : EntityBase
}
public long ContractingPartyId { get; private set; }
public string ContractingPartyName { get; private set; }
+ public Guid PublicId { get; private set; }
+ [NotMapped]
+ public string PublicIdStr => PublicId.ToString("N");
public List FinancialTransactionList { get; set; }
public List FinancialInvoices { get; set; }
-
+
+ public void SetPublicId()
+ {
+ PublicId = Guid.NewGuid();
+ }
+
+ public void AddFinancialTransaction(FinancialTransaction financialTransaction)
+ {
+ if (financialTransaction == null)
+ throw new ArgumentNullException(nameof(financialTransaction));
+ FinancialTransactionList.Add(financialTransaction);
+ }
+
}
\ No newline at end of file
diff --git a/Company.Domain/FinancialStatmentAgg/IFinancialStatmentRepository.cs b/Company.Domain/FinancialStatmentAgg/IFinancialStatmentRepository.cs
index 8bed15be..60a1d8f6 100644
--- a/Company.Domain/FinancialStatmentAgg/IFinancialStatmentRepository.cs
+++ b/Company.Domain/FinancialStatmentAgg/IFinancialStatmentRepository.cs
@@ -3,14 +3,25 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using _0_Framework.Application;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.FinancialStatment;
+using Microsoft.AspNetCore.Mvc;
namespace Company.Domain.FinancialStatmentAgg;
public interface IFinancialStatmentRepository : IRepository
{
+ [Obsolete("این متد منسوخ شده است. لطفاً از متد GetDetailsByContractingParty استفاده کنید.")]
FinancialStatmentViewModel GetDetailsByContractingPartyId(long contractingPartyId);
List Search(FinancialStatmentSearchModel searchModel);
+ Task GetClientFinancialStatement(long accountId,
+ FinancialStatementSearchModel searchModel);
+
+ Task> GetDetailsByPublicId(string publicId);
+ Task GetBalanceAmount(long id);
+ Task GetClientDebtAmount(long accountId);
+ Task GetDetailsByContractingParty(long contractingPartyId,FinancialStatementSearchModel searchModel);
+ Task GetByContractingPartyId(long contractingPartyId);
}
\ No newline at end of file
diff --git a/Company.Domain/FinancialTransactionAgg/IFinancialTransactionRepository.cs b/Company.Domain/FinancialTransactionAgg/IFinancialTransactionRepository.cs
index 30813b5c..795a531a 100644
--- a/Company.Domain/FinancialTransactionAgg/IFinancialTransactionRepository.cs
+++ b/Company.Domain/FinancialTransactionAgg/IFinancialTransactionRepository.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using _0_Framework.Application;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.FinancilTransaction;
@@ -13,4 +14,15 @@ public interface IFinancialTransactionRepository : IRepository
+ /// ایجاد بدهی استند حضور غیاب برای اکسل
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ OperationResult CreateDebtFromExcel(long contractingPartyId, string transactionDate, double debt,
+ string description);
}
\ No newline at end of file
diff --git a/Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs b/Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs
index 5d84c2bc..3a91fcdf 100644
--- a/Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs
+++ b/Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs
@@ -2,9 +2,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
+using _0_Framework.Application;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.InstitutionContract;
using CompanyManagment.App.Contracts.Workshop;
+using Microsoft.AspNetCore.Mvc;
namespace Company.Domain.InstitutionContractAgg;
@@ -13,7 +15,8 @@ public interface IInstitutionContractRepository : IRepository InstitutionContractsWithoutAccount();
+ List ContractWithoutValidContactInfo();
List Search(InstitutionContractSearchModel searchModel);
List NewSearch(InstitutionContractSearchModel searchModel);
List PrintAll(List id);
@@ -32,4 +35,46 @@ public interface IInstitutionContractRepository : IRepository workshopViewModels);
InstitutionContract InstitutionContractByEmployerId(long employerId);
+
+
+ ///
+ /// ایجاد سند مالی حضور غیاب
+ ///
+ ///
+ ///
+ ///
+ ///
+ void RollcallServiceCreateTransaction();
+
+ Task> GetList(InstitutionContractListSearchModel searchModel);
+ Task GetListStats(InstitutionContractListSearchModel searchModel);
+ Task> RegistrationWorkflowMainList();
+ Task> RegistrationWorkflowItems(long institutionContractId);
+ Task GetInstitutionWorkshopInitialDetails(long institutionWorkshopInitialId);
+ Task GetIncludeWorkshopDetailsAsync(long institutionContractId);
+ void UpdateStatusIfNeeded(long institutionContractId);
+ Task GetVerificationDetails(Guid id);
+ Task GetByPublicIdAsync(Guid id);
+
+ #region Extension
+
+ Task GetExtensionInquiry(long previousContractId);
+ Task GetExtensionWorkshops(InstitutionContractExtensionWorkshopsRequest request);
+ Task GetExtensionInstitutionPlan(InstitutionContractExtensionPlanRequest request);
+ Task GetExtensionPaymentMethod(InstitutionContractExtensionPaymentRequest request);
+ Task ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
+
+ #endregion
+
+ #region Upgrade(Amendment)
+
+ Task GetAmendmentWorkshops(long institutionContractId);
+ Task GetAmendmentPaymentDetails(InsitutionContractAmendmentPaymentRequest request);
+
+ Task InsertAmendmentTempWorkshops(InstitutionContractAmendmentTempWorkshopViewModel request);
+ Task RemoveAmendmentWorkshops(Guid workshopTempId);
+ #endregion
+
+ Task> GetInstitutionContractSelectList(string search, string selected);
+ Task> PrintAllAsync(List ids);
}
\ No newline at end of file
diff --git a/Company.Domain/InstitutionContractAgg/InstitutionContract.cs b/Company.Domain/InstitutionContractAgg/InstitutionContract.cs
index 95a30277..2df07cf1 100644
--- a/Company.Domain/InstitutionContractAgg/InstitutionContract.cs
+++ b/Company.Domain/InstitutionContractAgg/InstitutionContract.cs
@@ -1,17 +1,24 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Linq;
+using System.Security.Cryptography;
using _0_Framework.Domain;
using Company.Domain.InstitutionContractContactInfoAgg;
+using CompanyManagment.App.Contracts.InstitutionContract;
namespace Company.Domain.InstitutionContractAgg;
public class InstitutionContract : EntityBase
{
- public InstitutionContract(string contractNo, long representativeId, string representativeName, long contractingPartyId,
+ public InstitutionContract(string contractNo, long representativeId, string representativeName,
+ long contractingPartyId,
string contractingPartyName, DateTime contractDateGr, string contractDateFa, string state, string city,
string address, DateTime contractStartGr, string contractStartFa, DateTime contractEndGr,
string contractEndFa, double contractAmount, double dailyCompenseation, double obligation,
- double totalAmount, int extensionNo, string workshopManualCount, string employeeManualCount, string description, string officialCompany,string typeOfcontract, string hasValueAddedTax, double valueAddedTax)
+ double totalAmount, int extensionNo, string workshopManualCount, string employeeManualCount, string description,
+ string officialCompany, string typeOfcontract, string hasValueAddedTax, double valueAddedTax,
+ List workshopDetails, long lawId)
{
ContractNo = contractNo;
RepresentativeId = representativeId;
@@ -43,67 +50,123 @@ public class InstitutionContract : EntityBase
TypeOfContract = typeOfcontract;
HasValueAddedTax = hasValueAddedTax;
ValueAddedTax = valueAddedTax;
+ VerificationStatus = InstitutionContractVerificationStatus.PendingForVerify;
+ ContactInfoList = [];
+ Installments = [];
+ WorkshopGroup = new InstitutionContractWorkshopGroup(id, workshopDetails);
+ PublicId = Guid.NewGuid();
+ LawId = lawId;
}
+ public long LawId { get; private set; }
+
public string ContractNo { get; private set; }
public long RepresentativeId { get; private set; }
+
public string RepresentativeName { get; private set; }
+
public long ContractingPartyId { get; private set; }
+
public string ContractingPartyName { get; private set; }
+
public DateTime ContractDateGr { get; private set; }
+
public string ContractDateFa { get; private set; }
+
public string State { get; private set; }
+
public string City { get; private set; }
+
public string Address { get; private set; }
+
//public long ContactInfoId { get; private set; }
public DateTime ContractStartGr { get; private set; }
+
public string ContractStartFa { get; private set; }
+
public DateTime ContractEndGr { get; private set; }
+
public string ContractEndFa { get; private set; }
-
+
// مبلغ قرارداد
public double ContractAmount { get; private set; }
-
+
//خسارت روزانه
public double DailyCompenseation { get; private set; }
//وجه التزام
public double Obligation { get; private set; }
+
// مبلغ کل قرارداد
public double TotalAmount { get; private set; }
+
public string WorkshopManualCount { get; private set; }
+
public string EmployeeManualCount { get; private set; }
+
public string IsActiveString { get; private set; }
+
public int ExtensionNo { get; private set; }
+
public string Description { get; private set; }
+
public string Signature { get; private set; }
+
public string OfficialCompany { get; private set; }
+
public string TypeOfContract { get; private set; }
- public string HasValueAddedTax { get; set; }
- public double ValueAddedTax { get; set; }
+
+ public string HasValueAddedTax { get; private set; }
+
+ public double ValueAddedTax { get; private set; }
+
+ public Guid PublicId { get; private set; }
+
+ public string VerifyCode { get; private set; }
+ public DateTime VerifyCodeCreation { get; private set; }
+ public string VerifierFullName { get; private set; }
+ public string VerifierPhoneNumber { get; private set; }
+
+ [NotMapped] public bool VerifyCodeExpired => VerifyCodeCreation.Add(ExpireTime) <= DateTime.Now;
+
+ [NotMapped] public bool CanResendVerifyCode => VerifyCodeCreation.Add(ReSendTime) <= DateTime.Now;
+
+ [NotMapped] public TimeSpan ExpireTime => TimeSpan.FromMinutes(5);
+
+
+ [NotMapped] public TimeSpan ReSendTime => TimeSpan.FromMinutes(2);
+
+ public bool IsInstallment { get; set; }
+
+ public InstitutionContractVerificationStatus VerificationStatus { get; private set; }
+
+ public InstitutionContractWorkshopGroup WorkshopGroup { get; private set; }
public List ContactInfoList { get; set; }
+ public List Installments { get; set; }
+
+ public List Amendments { get; private set; }
+
public InstitutionContract()
{
-
- ContactInfoList = new List();
+ ContactInfoList = [];
+ Installments = [];
}
public void Edit(DateTime contractDateGr, string contractDateFa, string state, string city, string address,
DateTime contractStartGr, string contractStartFa, DateTime contractEndGr, string contractEndFa,
double contractAmount, double dailyCompenseation, double obligation, double totalAmount,
- string workshopManualCount, string employeeManualCount, string description, string officialCompany,
+ string workshopManualCount, string employeeManualCount, string description, string officialCompany,
string typeOfcontract, double valueAddedTax, string hasValueAddedTax)
{
-
ContractDateGr = contractDateGr;
ContractDateFa = contractDateFa;
State = state;
City = city;
Address = address;
-
+
ContractStartGr = contractStartGr;
ContractStartFa = contractStartFa;
ContractEndGr = contractEndGr;
@@ -124,13 +187,11 @@ public class InstitutionContract : EntityBase
public void Active()
{
-
this.IsActiveString = "true";
}
public void DeActive()
{
-
this.IsActiveString = "false";
}
@@ -148,4 +209,182 @@ public class InstitutionContract : EntityBase
{
this.Signature = "0";
}
+
+ public void Verified()
+ {
+ VerificationStatus = InstitutionContractVerificationStatus.Verified;
+ }
+
+ public void SetPendingWorkflow()
+ {
+ VerificationStatus = InstitutionContractVerificationStatus.PendingWorkflow;
+ }
+
+ public void SetInstallments(List installments)
+ {
+ Installments = installments;
+ IsInstallment = true;
+ }
+
+
+ public void SetVerifyCode(string code,string verifierFullName, string verifierPhoneNumber)
+ {
+ VerifyCode = code;
+ VerifyCodeCreation = DateTime.Now;
+ VerifierFullName = verifierFullName;
+ VerifierPhoneNumber = verifierPhoneNumber;
+ }
+
+ public void SetWorkshopGroup(InstitutionContractWorkshopGroup workshopGroup)
+ {
+ WorkshopGroup = workshopGroup;
+ }
+
+ public void SetAmount(double totalAmount, double tax, double oneMonthPayment)
+ {
+ ContractAmount = oneMonthPayment;
+ TotalAmount = totalAmount;
+ ValueAddedTax = tax;
+ HasValueAddedTax = tax > 0 ? "true" : "false";
+ }
+
+ public void ClearGroup()
+ {
+ WorkshopGroup = null;
+ }
+}
+
+public class InstitutionContractAmendment : EntityBase
+{
+ private InstitutionContractAmendment(){}
+ public InstitutionContractAmendment(long institutionContractId,
+ List installments, double amount, bool hasInstallment,
+ InstitutionContractAmendmentChange amendmentChange, long lawId)
+ {
+ InstitutionContractId = institutionContractId;
+ Installments = installments is { Count: > 0} ? installments : [];
+ Amount = amount;
+ HasInstallment = hasInstallment;
+ AmendmentChanges = [amendmentChange];
+ LawId = lawId;
+ }
+
+ public long InstitutionContractId { get; set; }
+ public InstitutionContract InstitutionContract { get; set; }
+ public List Installments { get; set; }
+ public double Amount { get; set; }
+ public bool HasInstallment { get; set; }
+ public string VerifyCode { get; set; }
+ public DateTime VerificationCreation { get; set; }
+ public List AmendmentChanges { get; set; }
+
+ public long LawId { get; set; }
+
+ public void SetVerifyCode(string code,string verifierFullName, string verifierPhoneNumber)
+ {
+ VerifyCode = code;
+ VerifyCodeCreation = DateTime.Now;
+ VerifierFullName = verifierFullName;
+ VerifierPhoneNumber = verifierPhoneNumber;
+ }
+
+ public string VerifierPhoneNumber { get; private set; }
+
+ public string VerifierFullName { get; private set; }
+
+ public DateTime VerifyCodeCreation { get; set; }
+}
+
+public class InstitutionContractAmendmentChange : EntityBase
+{
+ private InstitutionContractAmendmentChange() { }
+ private InstitutionContractAmendmentChange(long institutionContractAmendmentId,
+ InstitutionContractAmendment institutionContractAmendment, InstitutionContractAmendmentChangeType changeType,
+ DateTime changeDateGr, bool? hasRollCallPlan, bool? hasCustomizeCheckoutPlan, bool? hasContractPlan,
+ bool? hasContractPlanInPerson, bool? hasInsurancePlan, bool? hasInsurancePlanInPerson, int? personnelCount,
+ long? workshopDetailsId)
+ {
+ InstitutionContractAmendmentId = institutionContractAmendmentId;
+ InstitutionContractAmendment = institutionContractAmendment;
+ ChangeType = changeType;
+ ChangeDateGr = changeDateGr;
+ HasRollCallPlan = hasRollCallPlan;
+ HasCustomizeCheckoutPlan = hasCustomizeCheckoutPlan;
+ HasContractPlan = hasContractPlan;
+ HasContractPlanInPerson = hasContractPlanInPerson;
+ HasInsurancePlan = hasInsurancePlan;
+ HasInsurancePlanInPerson = hasInsurancePlanInPerson;
+ PersonnelCount = personnelCount;
+ WorkshopDetailsId = workshopDetailsId;
+ }
+
+ public long InstitutionContractAmendmentId { get; private set; }
+ public InstitutionContractAmendment InstitutionContractAmendment { get; private set; }
+ public InstitutionContractAmendmentChangeType ChangeType { get; private set; }
+ public DateTime ChangeDateGr { get; private set; }
+
+ ///
+ /// پلن حضور و غیاب
+ ///
+ public bool? HasRollCallPlan { get; private set; }
+
+ ///
+ /// پلن فیش غیر رسمی
+ ///
+ public bool? HasCustomizeCheckoutPlan { get; private set; }
+
+ ///
+ /// پلن قرارداد و تصفیه
+ ///
+ public bool? HasContractPlan { get; private set; }
+
+ ///
+ /// پلن قرارداد و تصفیه حضوری
+ ///
+ public bool? HasContractPlanInPerson { get; private set; }
+
+ ///
+ /// پلن بیمه
+ ///
+ public bool? HasInsurancePlan { get; private set; }
+
+ ///
+ /// پلن بیمه حضوری
+ ///
+ public bool? HasInsurancePlanInPerson { get; private set; }
+
+ ///
+ /// تعداد پرسنل
+ ///
+ public int? PersonnelCount { get; private set; }
+
+ ///
+ /// تعداد کارگاه
+ ///
+ public long? WorkshopDetailsId { get; private set; }
+}
+
+public enum InstitutionContractAmendmentChangeType
+{
+ PersonCount,
+ Services,
+ WorkshopCreated
+}
+
+public enum InstitutionContractVerificationStatus
+{
+ ///
+ /// در انتظار تایید
+ ///
+ PendingForVerify = 0,
+
+ ///
+ /// در انتظار کارپوشه
+ ///
+ PendingWorkflow = 1,
+
+ ///
+ /// تایید شده
+ ///
+ Verified = 2
}
\ No newline at end of file
diff --git a/Company.Domain/InstitutionContractAgg/InstitutionContractInstallment.cs b/Company.Domain/InstitutionContractAgg/InstitutionContractInstallment.cs
new file mode 100644
index 00000000..bdbfa535
--- /dev/null
+++ b/Company.Domain/InstitutionContractAgg/InstitutionContractInstallment.cs
@@ -0,0 +1,28 @@
+using System;
+using _0_Framework.Application;
+
+namespace Company.Domain.InstitutionContractAgg;
+
+public class InstitutionContractInstallment
+{
+ public InstitutionContractInstallment(DateTime installmentDateGr, double amount,
+ string description)
+ {
+ InstallmentDateGr = installmentDateGr;
+ InstallmentDateFa = installmentDateGr.ToFarsi();
+ Amount = amount;
+ Description = description;
+ }
+
+ public long Id { get; private set; }
+ public DateTime InstallmentDateGr { get; private set; }
+ public string InstallmentDateFa { get; private set; }
+ public double Amount { get; private set; }
+ public string Description { get; private set; }
+
+ public long InstitutionContractId { get; private set; }
+ public long? InstitutionContractAmendmentId { get; private set; }
+
+ public InstitutionContract InstitutionContract { get; private set; }
+ public InstitutionContractAmendment InstitutionContractAmendment { get; set; }
+}
diff --git a/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopBase.cs b/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopBase.cs
new file mode 100644
index 00000000..046cfe21
--- /dev/null
+++ b/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopBase.cs
@@ -0,0 +1,84 @@
+using System;
+using System.Collections.Generic;
+using _0_Framework.Domain;
+
+namespace Company.Domain.InstitutionContractAgg;
+
+public class InstitutionContractWorkshopBase:EntityBase
+{
+ protected InstitutionContractWorkshopBase(){}
+ public InstitutionContractWorkshopBase(string workshopName, bool hasRollCallPlan,bool hasRollCallPlanInPerson,
+ bool hasCustomizeCheckoutPlan, bool hasContractPlan,bool hasContractPlanInPerson,bool hasInsurancePlan,bool hasInsurancePlanInPerson,
+ int personnelCount, double price )
+ {
+ WorkshopName = workshopName;
+ Services = new WorkshopServices(hasInsurancePlan, hasInsurancePlanInPerson,
+ hasContractPlan, hasContractPlanInPerson, hasRollCallPlan, hasRollCallPlanInPerson,hasCustomizeCheckoutPlan);
+ PersonnelCount = personnelCount;
+ Price = price;
+ Employers = [];
+ }
+ ///
+ /// شناسه کارگاه
+ ///
+ public long? WorkshopId { get; protected set; }
+
+ ///
+ /// نام کارگاه
+ ///
+ public string WorkshopName { get; private set; }
+
+ public WorkshopServices Services { get; set; } = new (false, false,
+ false, false, false,
+ false, false);
+ public int PersonnelCount { get; private set; }
+
+
+
+ ///
+ /// شناسه قرارداد نهاد مرتبط
+ ///
+ public long InstitutionContractId { get; private set; }
+
+
+ public double Price { get; private set; }
+
+
+ public List Employers { get; private set; } = new();
+
+ public void SetEmployers(List employerIds)
+ {
+ Employers.Clear();
+ foreach (var employerId in employerIds)
+ {
+ Employers.Add(new InstitutionContractWorkshopDetailEmployer(employerId));
+ }
+ }
+ public void AddEmployer(long employerId)
+ {
+ if (Employers.Exists(x => x.EmployerId == employerId))
+ return;
+
+ Employers.Add(new InstitutionContractWorkshopDetailEmployer(employerId));
+ }
+
+ // ⚡️ Equality Implementation
+ public override bool Equals(object? obj)
+ {
+ if (obj is not InstitutionContractWorkshopBase other)
+ return false;
+
+ return WorkshopName == other.WorkshopName &&
+ PersonnelCount == other.PersonnelCount &&
+ Price == other.Price &&
+ Services == other.Services;
+ }
+
+ public override int GetHashCode()
+ {
+ return HashCode.Combine(WorkshopName, PersonnelCount, Price, Services);
+ }
+
+
+
+}
\ No newline at end of file
diff --git a/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopCurrent.cs b/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopCurrent.cs
new file mode 100644
index 00000000..f133fa70
--- /dev/null
+++ b/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopCurrent.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using _0_Framework_b.Domain;
+
+namespace Company.Domain.InstitutionContractAgg;
+
+public class InstitutionContractWorkshopCurrent:InstitutionContractWorkshopBase
+{
+ private InstitutionContractWorkshopCurrent(){}
+ public InstitutionContractWorkshopCurrent(string workshopName, bool hasRollCallPlan,
+ bool hasRollCallPlanInPerson, bool hasCustomizeCheckoutPlan, bool hasContractPlan,
+ bool hasContractPlanInPerson, bool hasInsurancePlan, bool hasInsurancePlanInPerson,
+ int personnelCount, double price,long institutionContractWorkshopGroupId,InstitutionContractWorkshopGroup workshopGroup,long workshopId) : base(workshopName, hasRollCallPlan,
+ hasRollCallPlanInPerson, hasCustomizeCheckoutPlan, hasContractPlan,
+ hasContractPlanInPerson, hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, price)
+ {
+ InstitutionContractWorkshopGroupId = institutionContractWorkshopGroupId;
+ WorkshopGroup = workshopGroup;
+ WorkshopId = workshopId;
+ }
+ public long InstitutionContractWorkshopGroupId { get; private set; }
+ public InstitutionContractWorkshopGroup WorkshopGroup { get; private set; }
+ public long InitialWorkshopId { get; private set; }
+ public InstitutionContractWorkshopInitial WorkshopInitial { get; private set; }
+
+
+}
\ No newline at end of file
diff --git a/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopGroup.cs b/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopGroup.cs
new file mode 100644
index 00000000..20797f04
--- /dev/null
+++ b/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopGroup.cs
@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Linq;
+using _0_Framework_b.Domain;
+
+namespace Company.Domain.InstitutionContractAgg;
+
+public class InstitutionContractWorkshopGroup : EntityBase
+{
+ private InstitutionContractWorkshopGroup()
+ {
+ }
+
+ public long InstitutionContractId { get; private set; }
+ public InstitutionContract InstitutionContract { get; set; }
+ public List InitialWorkshops { get; private set; }
+ public List CurrentWorkshops { get; private set; }
+ public DateTime LastModifiedDate { get; private set; }
+
+ [NotMapped]
+ public bool HasChanges =>
+ !InitialWorkshops.Cast()
+ .SequenceEqual(CurrentWorkshops.Cast());
+
+ public InstitutionContractWorkshopGroup(long institutionContractId,
+ List initialDetails)
+ {
+ InstitutionContractId = institutionContractId;
+ var initialWorkshops = initialDetails.ToList();
+ InitialWorkshops = initialWorkshops.ToList();
+ LastModifiedDate = DateTime.Now;
+ }
+
+ public void UpdateCurrentWorkshops(List updatedDetails)
+ {
+ CurrentWorkshops = updatedDetails.ToList();
+ LastModifiedDate = DateTime.Now;
+ }
+}
\ No newline at end of file
diff --git a/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopInitial.cs b/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopInitial.cs
new file mode 100644
index 00000000..cceaeefb
--- /dev/null
+++ b/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopInitial.cs
@@ -0,0 +1,70 @@
+using System.Collections.Generic;
+using System.Linq;
+using _0_Framework.Domain;
+using CompanyManagment.App.Contracts.InstitutionContract;
+
+namespace Company.Domain.InstitutionContractAgg;
+
+public class InstitutionContractWorkshopInitial:InstitutionContractWorkshopBase
+{
+ private InstitutionContractWorkshopInitial(){}
+ public InstitutionContractWorkshopInitial(string workshopName, bool hasRollCallPlan,
+ bool hasRollCallPlanInPerson, bool hasCustomizeCheckoutPlan, bool hasContractPlan,
+ bool hasContractPlanInPerson, bool hasInsurancePlan, bool hasInsurancePlanInPerson,
+ int personnelCount, double price) : base(workshopName, hasRollCallPlan,
+ hasRollCallPlanInPerson, hasCustomizeCheckoutPlan, hasContractPlan, hasContractPlanInPerson,
+ hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, price)
+ {
+ WorkshopCreated = false;
+ }
+
+ public long InstitutionContractWorkshopGroupId { get; private set; }
+ public InstitutionContractWorkshopGroup WorkshopGroup { get; private set; }
+ public bool WorkshopCreated { get; private set; }
+
+ public InstitutionContractWorkshopCurrent? WorkshopCurrent { get; private set; }
+ public long? InstitutionContractWorkshopCurrentId { get; private set; }
+
+ public void SetWorkshopId(long workshopId)
+ {
+ WorkshopId = workshopId;
+ WorkshopCreated = true;
+ WorkshopCurrent = new InstitutionContractWorkshopCurrent(WorkshopName,Services.RollCall,Services.RollCallInPerson,
+ Services.CustomizeCheckout,Services.Contract,Services.ContractInPerson,Services.Insurance,
+ Services.InsuranceInPerson,PersonnelCount,Price,InstitutionContractWorkshopGroupId,WorkshopGroup,workshopId);
+ WorkshopCurrent.SetEmployers(Employers.Select(x=>x.EmployerId).ToList());
+ }
+
+ public static InstitutionContractWorkshopInitial CreateManual(string workshopName, bool hasRollCallPlan,
+ bool hasRollCallPlanInPerson, bool hasCustomizeCheckoutPlan, bool hasContractPlan,
+ bool hasContractPlanInPerson, bool hasInsurancePlan, bool hasInsurancePlanInPerson,
+ int personnelCount, double price, long workshopId,List employerIds)
+ {
+
+ var entity = new InstitutionContractWorkshopInitial(workshopName, hasRollCallPlan,
+ hasRollCallPlanInPerson, hasCustomizeCheckoutPlan, hasContractPlan, hasContractPlanInPerson,
+ hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, price);
+ entity.WorkshopCreated = true;
+ entity.WorkshopId = workshopId;
+ entity.SetEmployers(employerIds);
+ return entity;
+ }
+
+ public void SetWorkshopGroup(InstitutionContractWorkshopGroup entityWorkshopGroup)
+ {
+ InstitutionContractWorkshopGroupId = entityWorkshopGroup.id;
+ WorkshopGroup = entityWorkshopGroup;
+ }
+}
+
+public class InstitutionContractWorkshopDetailEmployer : EntityBase
+{
+ public long EmployerId { get; private set; }
+
+ public InstitutionContractWorkshopDetailEmployer(long employerId)
+ {
+ EmployerId = employerId;
+ }
+
+ private InstitutionContractWorkshopDetailEmployer() { }
+}
\ No newline at end of file
diff --git a/Company.Domain/InstitutionContractAgg/WorkshopServices.cs b/Company.Domain/InstitutionContractAgg/WorkshopServices.cs
new file mode 100644
index 00000000..95d71066
--- /dev/null
+++ b/Company.Domain/InstitutionContractAgg/WorkshopServices.cs
@@ -0,0 +1,23 @@
+namespace Company.Domain.InstitutionContractAgg;
+public record WorkshopServices
+{
+ public WorkshopServices(bool insurance, bool insuranceInPerson, bool contract, bool contractInPerson, bool rollCall, bool rollCallInPerson, bool customizeCheckout)
+ {
+ Insurance = insurance;
+ InsuranceInPerson = insuranceInPerson;
+ Contract = contract;
+ ContractInPerson = contractInPerson;
+ RollCall = rollCall;
+ CustomizeCheckout = customizeCheckout;
+ RollCallInPerson = rollCallInPerson;
+ }
+
+ public bool Insurance { get; private set; }
+ public bool InsuranceInPerson { get; private set; }
+ public bool Contract { get; private set; }
+ public bool ContractInPerson { get; private set; }
+ public bool RollCall { get; private set; }
+
+ public bool RollCallInPerson { get; private set; }
+ public bool CustomizeCheckout { get; private set; }
+}
\ No newline at end of file
diff --git a/Company.Domain/InstitutionContractAmendmentTempAgg/InstitutionContractAmendmentTemp.cs b/Company.Domain/InstitutionContractAmendmentTempAgg/InstitutionContractAmendmentTemp.cs
new file mode 100644
index 00000000..bac4cd56
--- /dev/null
+++ b/Company.Domain/InstitutionContractAmendmentTempAgg/InstitutionContractAmendmentTemp.cs
@@ -0,0 +1,151 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MongoDB.Bson;
+using MongoDB.Bson.Serialization.Attributes;
+
+namespace Company.Domain.InstitutionContractAmendmentTempAgg;
+
+public class InstitutionContractAmendmentTemp
+{
+ public InstitutionContractAmendmentTemp(List prevWorkshops,
+ long institutionContractId)
+ {
+ Id = Guid.NewGuid();
+ PrevWorkshops = prevWorkshops;
+ NewWorkshops = prevWorkshops.Select(x=> new InstitutionContractAmendmentTempNewWorkshop(
+ x.WorkshopName, x.CountPerson, x.ContractAndCheckout, x.ContractAndCheckoutInPerson, x.Insurance,
+ x.InsuranceInPerson, x.RollCall, x.RollCallInPerson, x.CustomizeCheckout, x.Price, x.WorkshopId,
+ x.CurrentWorkshopId, 0)).ToList();
+ InstitutionContractId = institutionContractId;
+ }
+
+ [BsonId]
+ [BsonRepresentation(BsonType.String)]
+ public Guid Id { get; private set; }
+ public List PrevWorkshops { get; private set; }
+ public List NewWorkshops { get; private set; }
+ public long InstitutionContractId { get; private set; }
+}
+
+public class InstitutionContractAmendmentTempNewWorkshop : InstitutionContractAmendmentTempPrevWorkshop
+{
+ public InstitutionContractAmendmentTempNewWorkshop(string workshopName, int countPerson, bool contractAndCheckout,
+ bool contractAndCheckoutInPerson, bool insurance, bool insuranceInPerson, bool rollCall, bool rollCallInPerson,
+ bool customizeCheckout, double price, long workshopId, long currentWorkshopId,double priceDifference) : base(
+ workshopName, countPerson, contractAndCheckout, contractAndCheckoutInPerson, insurance, insuranceInPerson,
+ rollCall, rollCallInPerson, customizeCheckout, price, workshopId, currentWorkshopId)
+ {
+ PriceDifference = priceDifference;
+ }
+
+ ///
+ /// مبلغ اختلاف کارگاه جدید با کارگاه قبلی(مبلغ اصلی ارتقاء)
+ ///
+ public double PriceDifference { get; private set; }
+
+
+ public void Edit(string workshopName, int countPerson, bool contractAndCheckout,
+ bool contractAndCheckoutInPerson,
+ bool insurance, bool insuranceInPerson, bool rollCall, bool customizeCheckout,
+ double price,double priceDifference)
+ {
+ base.Edit(workshopName, countPerson, contractAndCheckout, contractAndCheckoutInPerson, insurance,
+ insuranceInPerson, rollCall, customizeCheckout, price);
+ PriceDifference = priceDifference;
+ }
+}
+
+public class InstitutionContractAmendmentTempPrevWorkshop
+{
+ public InstitutionContractAmendmentTempPrevWorkshop(string workshopName, int countPerson, bool contractAndCheckout,
+ bool contractAndCheckoutInPerson,
+ bool insurance, bool insuranceInPerson,
+ bool rollCall, bool rollCallInPerson, bool customizeCheckout, double price, long workshopId,
+ long currentWorkshopId)
+ {
+ Id = Guid.NewGuid();
+ WorkshopName = workshopName;
+ CountPerson = countPerson;
+ ContractAndCheckout = contractAndCheckout;
+ Insurance = insurance;
+ RollCall = rollCall;
+ CustomizeCheckout = customizeCheckout;
+ ContractAndCheckoutInPerson = contractAndCheckoutInPerson;
+ InsuranceInPerson = insuranceInPerson;
+ RollCallInPerson = rollCallInPerson;
+ Price = price;
+ WorkshopId = workshopId;
+ CurrentWorkshopId = currentWorkshopId;
+ }
+
+ [BsonRepresentation(BsonType.String)]
+ public Guid Id { get; set; }
+
+ public long CurrentWorkshopId { get; private set; }
+ public long WorkshopId { get; set; }
+
+ ///
+ /// نام کارگاه
+ ///
+ public string WorkshopName { get; private set; }
+
+ ///
+ /// تعداد پرسنل
+ ///
+ public int CountPerson { get; private set; }
+
+
+ #region ServiceSelection
+
+ ///
+ /// قرارداد و تصفیه
+ ///
+ public bool ContractAndCheckout { get; private set; }
+
+ ///
+ /// بیمه
+ ///
+ public bool Insurance { get; private set; }
+
+ ///
+ /// حضورغباب
+ ///
+ public bool RollCall { get; private set; }
+
+ public bool RollCallInPerson { get; set; }
+
+ ///
+ /// فیش غیر رسمی
+ ///
+ public bool CustomizeCheckout { get; private set; }
+
+ ///
+ /// خدمات حضوری قرداد و تصفیه
+ ///
+ public bool ContractAndCheckoutInPerson { get; private set; }
+
+ ///
+ /// خدمات حضوری بیمه
+ ///
+ public bool InsuranceInPerson { get; private set; }
+
+ public double Price { get; private set; }
+
+ #endregion
+
+ public void Edit(string workshopName, int countPerson, bool contractAndCheckout, bool contractAndCheckoutInPerson,
+ bool insurance, bool insuranceInPerson, bool rollCall, bool customizeCheckout,
+ double price)
+ {
+ WorkshopName = workshopName;
+ CountPerson = countPerson;
+ ContractAndCheckout = contractAndCheckout;
+ Insurance = insurance;
+ RollCall = rollCall;
+ CustomizeCheckout = customizeCheckout;
+ ContractAndCheckoutInPerson = contractAndCheckoutInPerson;
+ InsuranceInPerson = insuranceInPerson;
+ Price = price;
+ }
+}
\ No newline at end of file
diff --git a/Company.Domain/InstitutionContractExtensionTempAgg/IInstitutionContractExtenstionTempRepository.cs b/Company.Domain/InstitutionContractExtensionTempAgg/IInstitutionContractExtenstionTempRepository.cs
new file mode 100644
index 00000000..020200f5
--- /dev/null
+++ b/Company.Domain/InstitutionContractExtensionTempAgg/IInstitutionContractExtenstionTempRepository.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Threading.Tasks;
+
+namespace Company.Domain.InstitutionContractExtensionTempAgg;
+
+public interface IInstitutionContractExtenstionTempRepository
+{
+ Task Create(InstitutionContractExtensionTemp institutionContract);
+
+ Task GetPreviousExtenstionData(long contractingPartyId);
+ Task Remove(Guid id);
+}
\ No newline at end of file
diff --git a/Company.Domain/InstitutionContractExtensionTempAgg/InstitutionContractExtensionTemp.cs b/Company.Domain/InstitutionContractExtensionTempAgg/InstitutionContractExtensionTemp.cs
new file mode 100644
index 00000000..568ae4a5
--- /dev/null
+++ b/Company.Domain/InstitutionContractExtensionTempAgg/InstitutionContractExtensionTemp.cs
@@ -0,0 +1,168 @@
+using System;
+using System.Collections.Generic;
+using CompanyManagment.App.Contracts.InstitutionContract;
+using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
+using MongoDB.Bson;
+using MongoDB.Bson.Serialization.Attributes;
+
+namespace Company.Domain.InstitutionContractExtensionTempAgg;
+
+public class InstitutionContractExtensionTemp
+{
+ public InstitutionContractExtensionTemp(long previousContractingPartyId)
+ {
+ Id = Guid.NewGuid();
+ PreviousId = previousContractingPartyId;
+ }
+
+ [BsonId] // Specifies this field as the _id in MongoDB
+ [BsonRepresentation(BsonType.String)] // Ensures the GUID is stored as a string
+ public Guid Id { get; set; }
+ public long PreviousId { get; set; }
+ public string Address { get; set; }
+ public string City { get; set; }
+ public string Province { get; set; }
+ public List ContactInfos { get; set; }
+
+ public List Workshops { get; set; }
+
+ public InstitutionContractExtensionPlanDetail OneMonth { get; set; }
+ public InstitutionContractExtensionPlanDetail ThreeMonths { get; set; }
+ public InstitutionContractExtensionPlanDetail SixMonths { get; set; }
+ public InstitutionContractExtensionPlanDetail TwelveMonths { get; set; }
+ public InstitutionContractPaymentMonthlyViewModel MonthlyPayment { get; set; }
+ public InstitutionContractPaymentOneTimeViewModel OneTimePayment { get; set; }
+
+ public bool HasContractInPerson { get; set; }
+
+ public InstitutionContractDuration? Duration { get; set; }
+
+ public void SetContractingPartyInfos(string address, string city, string province, List contactInfos)
+ {
+ Address = address;
+ City = city;
+ Province = province;
+ ContactInfos = contactInfos;
+ }
+
+ public void SetWorkshopsAndPlanAmounts(List workshops,
+ InstitutionContractExtensionPlanDetail oneMonth,
+ InstitutionContractExtensionPlanDetail threeMonth, InstitutionContractExtensionPlanDetail sixMonth,
+ InstitutionContractExtensionPlanDetail twelveMonth, bool hasContractInPerson)
+ {
+ Workshops = workshops;
+ OneMonth = oneMonth;
+ ThreeMonths = threeMonth;
+ SixMonths = sixMonth;
+ TwelveMonths = twelveMonth;
+ HasContractInPerson = hasContractInPerson;
+ }
+
+ public void SetAmountAndDuration(InstitutionContractDuration duration,InstitutionContractPaymentMonthlyViewModel monthly,
+ InstitutionContractPaymentOneTimeViewModel oneTime)
+ {
+ Duration = duration;
+ MonthlyPayment = monthly;
+ OneTimePayment = oneTime;
+ }
+
+}
+
+public class InstitutionContractExtenstionTempPlan
+{
+ public InstitutionContractExtenstionTempPlan(string contractStart, string contractEnd,
+ string oneMonthPaymentDiscounted, string oneMonthDiscount, string oneMonthOriginalPayment,
+ string totalPayment, string dailyCompensation, string obligation)
+ {
+ ContractStart = contractStart;
+ ContractEnd = contractEnd;
+ OneMonthPaymentDiscounted = oneMonthPaymentDiscounted;
+ OneMonthDiscount = oneMonthDiscount;
+ OneMonthOriginalPayment = oneMonthOriginalPayment;
+ TotalPayment = totalPayment;
+ DailyCompensation = dailyCompensation;
+ Obligation = obligation;
+ }
+
+ public string ContractStart { get; set; }
+ public string ContractEnd { get; set; }
+ public string OneMonthPaymentDiscounted { get; set; }
+ public string OneMonthDiscount { get; set; }
+ public string OneMonthOriginalPayment { get; set; }
+ public string TotalPayment { get; set; }
+ public string DailyCompensation { get; set; }
+ public string Obligation { get; set; }
+}
+
+public class InstitutionContractExtensionTempWorkshop
+{
+ public InstitutionContractExtensionTempWorkshop(string workshopName, int countPerson, bool contractAndCheckout, bool contractAndCheckoutInPerson,
+ bool insurance, bool insuranceInPerson,
+ bool rollCall,bool rollCallInPerson, bool customizeCheckout,double price,long workshopId)
+ {
+ WorkshopName = workshopName;
+ CountPerson = countPerson;
+ ContractAndCheckout = contractAndCheckout;
+ Insurance = insurance;
+ RollCall = rollCall;
+ CustomizeCheckout = customizeCheckout;
+ ContractAndCheckoutInPerson = contractAndCheckoutInPerson;
+ InsuranceInPerson = insuranceInPerson;
+ RollCallInPerson = rollCallInPerson;
+ Price = price;
+ WorkshopId = workshopId;
+ }
+
+ public long WorkshopId { get; set; }
+
+ ///
+ /// نام کارگاه
+ ///
+ public string WorkshopName { get; private set; }
+
+ ///
+ /// تعداد پرسنل
+ ///
+ public int CountPerson { get; private set; }
+
+
+ #region ServiceSelection
+
+ ///
+ /// قرارداد و تصفیه
+ ///
+ public bool ContractAndCheckout { get; private set; }
+
+ ///
+ /// بیمه
+ ///
+ public bool Insurance { get; private set; }
+
+ ///
+ /// حضورغباب
+ ///
+ public bool RollCall { get; private set; }
+
+ public bool RollCallInPerson { get; set; }
+
+ ///
+ /// فیش غیر رسمی
+ ///
+ public bool CustomizeCheckout { get;private set; }
+
+ ///
+ /// خدمات حضوری قرداد و تصفیه
+ ///
+ public bool ContractAndCheckoutInPerson { get; private set; }
+
+ ///
+ /// خدمات حضوری بیمه
+ ///
+ public bool InsuranceInPerson { get; private set; }
+
+ public double Price{ get; set; }
+
+ #endregion
+}
+
+
diff --git a/Company.Domain/InsurancJobAgg/IInsuranceJobRepositpry.cs b/Company.Domain/InsurancJobAgg/IInsuranceJobRepositpry.cs
index 27a906a7..fc889ab0 100644
--- a/Company.Domain/InsurancJobAgg/IInsuranceJobRepositpry.cs
+++ b/Company.Domain/InsurancJobAgg/IInsuranceJobRepositpry.cs
@@ -25,5 +25,6 @@ public interface IInsuranceJobRepositpry:IRepository
OperationResult EditInsuranceJob(EditInsuranceJob command);
+ Task> GetSelectList();
}
diff --git a/Company.Domain/InsuranceListAgg/IInsuranceListRepository.cs b/Company.Domain/InsuranceListAgg/IInsuranceListRepository.cs
index 1ff57039..214df689 100644
--- a/Company.Domain/InsuranceListAgg/IInsuranceListRepository.cs
+++ b/Company.Domain/InsuranceListAgg/IInsuranceListRepository.cs
@@ -51,6 +51,14 @@ public interface IInsuranceListRepository:IRepository
List GetEmployeeInsuranceDataAmonthAgo(DateTime currentMonthStartDate, long workshopId);
#endregion
+ ///
+ /// دریافت اطلاعات بیمه کارکنان برای استفاده در فیش حقوقی
+ ///
+ ///
+ ///
+ ///
+ List EmployeeInsuranceDataBy(DateTime startDate, long workshopId);
+
///
/// بدست آوردن اطلاعات محاسباتی ماه پرسنل برای ویرایش
///
@@ -67,6 +75,8 @@ public interface IInsuranceListRepository:IRepository
Task GetTabCounts(InsuranceListSearchModel searchModel);
#endregion
+
+ Task> GetNotCreatedWorkshop(InsuranceListSearchModel searchModel);
}
diff --git a/Company.Domain/LawAgg/ILawRepository.cs b/Company.Domain/LawAgg/ILawRepository.cs
new file mode 100644
index 00000000..08708532
--- /dev/null
+++ b/Company.Domain/LawAgg/ILawRepository.cs
@@ -0,0 +1,15 @@
+using _0_Framework.Domain;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using CompanyManagment.App.Contracts.Law;
+
+namespace Company.Domain.LawAgg
+{
+ public interface ILawRepository : IRepository
+ {
+ Task GetWithItems(long id);
+ Task> GetActive();
+ Task GetByType(LawType type);
+ Task> GetList(LawSearchModel searchModel);
+ }
+}
diff --git a/Company.Domain/LawAgg/Law.cs b/Company.Domain/LawAgg/Law.cs
new file mode 100644
index 00000000..284f251f
--- /dev/null
+++ b/Company.Domain/LawAgg/Law.cs
@@ -0,0 +1,116 @@
+using System;
+using System.Collections.Generic;
+using _0_Framework.Domain;
+using CompanyManagment.App.Contracts.Law;
+using System.Text.Json;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Company.Domain.LawAgg
+{
+ public class Law : EntityBase
+ {
+ private Law(){}
+ public string Title { get; private set; }
+ public bool IsActive { get; private set; }
+ public List Items { get; private set; }
+ public LawType Type { get; private set; }
+ public string HeadTitle { get; private set; }
+ public string NotificationsJson { get; private set; }
+ public int Version { get; private set; }
+
+ [NotMapped]
+ public List Notifications
+ {
+ get => string.IsNullOrEmpty(NotificationsJson)
+ ? new List()
+ : JsonSerializer.Deserialize>(NotificationsJson);
+ set => NotificationsJson = JsonSerializer.Serialize(value);
+ }
+
+ public Law(string title, LawType lawType, List notifications, string headTitle, int version = 1)
+ {
+ Title = title;
+ IsActive = true; // آخرین نسخه فعال است
+ Items = new List();
+ Type = lawType;
+ Notifications = notifications ?? new List();
+ HeadTitle = headTitle;
+ Version = version;
+ }
+
+ public void Edit(string title)
+ {
+ Title = title;
+ }
+
+ public void AddItem(string header, string details, int orderNumber)
+ {
+ Items.Add(new LawItem(header, details, orderNumber));
+ }
+
+ public void SetItem(List items)
+ {
+ Items = items ?? new List();
+ }
+ public void RemoveItem(int orderNumber)
+ {
+ var item = Items.Find(x => x.OrderNumber == orderNumber);
+ if (item != null)
+ Items.Remove(item);
+ }
+
+ public void Activate()
+ {
+ IsActive = true;
+ }
+
+ public void Deactivate()
+ {
+ IsActive = false;
+ }
+
+ public void SetAsLatestVersion()
+ {
+ IsActive = true;
+ }
+
+ public void SetAsOldVersion()
+ {
+ IsActive = false;
+ }
+
+ public Law CreateNewVersion(string title, List notifications, string headTitle, List items)
+ {
+ var newVersion = new Law(
+ title,
+ this.Type,
+ notifications,
+ headTitle,
+ this.Version + 1
+ );
+
+ newVersion.SetItem(items);
+ newVersion.SetAsLatestVersion();
+
+ return newVersion;
+ }
+ }
+
+ public class LawItem
+ {
+ public long Id { get; set; }
+ public string Header { get; private set; }
+ public string Details { get; private set; }
+ public int OrderNumber { get; private set; }
+ public long LawId { get; set; }
+
+ protected LawItem() { }
+
+ public LawItem(string header, string details, int orderNumber)
+ {
+ Header = header;
+ Details = details;
+ OrderNumber = orderNumber;
+ }
+ }
+}
diff --git a/Company.Domain/LeaveAgg/ILeaveRepository.cs b/Company.Domain/LeaveAgg/ILeaveRepository.cs
index 7b4ee239..d5c96aa4 100644
--- a/Company.Domain/LeaveAgg/ILeaveRepository.cs
+++ b/Company.Domain/LeaveAgg/ILeaveRepository.cs
@@ -22,7 +22,7 @@ public interface ILeaveRepository : IRepository
bool CheckContractExist(DateTime myDate,long employeeId, long workshopId);
- LeavErrorViewModel CheckErrors(DateTime startLeav, DateTime endLeav, long employeeId, long workshopId);
+ LeavErrorViewModel CheckErrors(DateTime startLeav, DateTime endLeav, long employeeId, long workshopId,bool isInvalid);
LeaveViewModel LeavOnChekout(DateTime starContract, DateTime endContract, long employeeId, long workshopId);
List searchClient(LeaveSearchModel searchModel);
LeavePrintViewModel PrintOne(long id);
diff --git a/Company.Domain/LeaveAgg/Leave.cs b/Company.Domain/LeaveAgg/Leave.cs
index d164b49d..86cc530c 100644
--- a/Company.Domain/LeaveAgg/Leave.cs
+++ b/Company.Domain/LeaveAgg/Leave.cs
@@ -8,7 +8,9 @@ public class Leave: EntityBase
{
public Leave(DateTime startLeave, DateTime endLeave,
string leaveHourses, long workshopId, long employeeId,
- string paidLeaveType, string leaveType, string employeeFullName, string workshopName, bool isAccepted, string decription, int year, int month, TimeSpan shiftDuration, bool hasShiftDuration)
+ string paidLeaveType, string leaveType, string employeeFullName, string workshopName,
+ bool isAccepted, string decription, int year, int month, TimeSpan shiftDuration,
+ bool hasShiftDuration,bool isInvalid)
{
StartLeave = startLeave;
EndLeave = endLeave;
@@ -25,6 +27,7 @@ public class Leave: EntityBase
Month = month;
ShiftDuration = shiftDuration;
HasShiftDuration = hasShiftDuration;
+ IsInvalid = isInvalid;
}
public DateTime StartLeave { get; private set; }
@@ -43,6 +46,10 @@ public class Leave: EntityBase
public TimeSpan ShiftDuration { get; private set; }
public bool HasShiftDuration { get; private set; }
+ ///
+ ///آیا فاقد اعتبار است. فاقد اعتبار ها فقط برای فیش های غیررسمی مورد استفاده قرار میگیرند
+ ///
+ public bool IsInvalid { get; private set; }
public void Edit(DateTime startLeave, DateTime endLeave,
string leaveHourses, long workshopId, long employeeId,
diff --git a/Company.Domain/PaymentInstrumentAgg/IPaymentInstrumentGroupRepository.cs b/Company.Domain/PaymentInstrumentAgg/IPaymentInstrumentGroupRepository.cs
new file mode 100644
index 00000000..f8025530
--- /dev/null
+++ b/Company.Domain/PaymentInstrumentAgg/IPaymentInstrumentGroupRepository.cs
@@ -0,0 +1,12 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using _0_Framework.Domain;
+using CompanyManagment.App.Contracts.PaymentInstrument;
+
+namespace Company.Domain.PaymentInstrumentAgg;
+
+public interface IPaymentInstrumentGroupRepository:IRepository
+{
+ void Remove(PaymentInstrumentGroup paymentInstrumentGroup);
+ Task> GetList();
+}
\ No newline at end of file
diff --git a/Company.Domain/PaymentInstrumentAgg/IPaymentInstrumentRepository.cs b/Company.Domain/PaymentInstrumentAgg/IPaymentInstrumentRepository.cs
new file mode 100644
index 00000000..a8d4a943
--- /dev/null
+++ b/Company.Domain/PaymentInstrumentAgg/IPaymentInstrumentRepository.cs
@@ -0,0 +1,19 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using _0_Framework.Application;
+using _0_Framework.Domain;
+using CompanyManagment.App.Contracts.PaymentInstrument;
+
+namespace Company.Domain.PaymentInstrumentAgg;
+
+public interface IPaymentInstrumentRepository:IRepository
+{
+ Task GetList(PaymentInstrumentSearchModel searchModel);
+ Task> GetPosTerminalSelectList(string search);
+ Task> PosTerminalIdSelectList(string search, string selected);
+ Task> IbanSelectList(string search, string selected);
+ Task> AccountNumberSelectList(string search, string selected);
+ Task> CardNumberSelectList(string search, string selected);
+ Task> AccountHolderNameSelectList(string search, string selected);
+
+}
\ No newline at end of file
diff --git a/Company.Domain/PaymentInstrumentAgg/PaymentInstrument.cs b/Company.Domain/PaymentInstrumentAgg/PaymentInstrument.cs
new file mode 100644
index 00000000..11ee80c7
--- /dev/null
+++ b/Company.Domain/PaymentInstrumentAgg/PaymentInstrument.cs
@@ -0,0 +1,52 @@
+using _0_Framework.Domain;
+using CompanyManagment.App.Contracts.PaymentInstrument;
+
+namespace Company.Domain.PaymentInstrumentAgg;
+
+public class PaymentInstrument:EntityBase
+{
+ private PaymentInstrument(string cardNumber, string accountHolderName, string accountNumber,string iBan,bool isAuth,long paymentInstrumentGroupId)
+ {
+ CardNumber = cardNumber;
+ AccountHolderName = accountHolderName;
+ AccountNumber = accountNumber;
+ IBan = iBan;
+ IsAuth = isAuth;
+ PaymentInstrumentGroupId = paymentInstrumentGroupId;
+ Type = PaymentInstrumentType.BankAccount;
+ }
+
+ private PaymentInstrument(string posTerminalId , string description,long paymentInstrumentGroupId)
+ {
+ PosTerminalId = posTerminalId;
+ Description = description;
+ PaymentInstrumentGroupId = paymentInstrumentGroupId;
+ Type = PaymentInstrumentType.Pos;
+ }
+
+ public static PaymentInstrument CreatePosType(string posTerminalId, string description, long paymentInstrumentGroupId)
+ {
+ return new PaymentInstrument(posTerminalId, description, paymentInstrumentGroupId);
+ }
+
+ public static PaymentInstrument CreateBankAccount(string cardNumber, string accountHolderName, string accountNumber,
+ string iBan, bool isAuth, long paymentInstrumentGroupId)
+ {
+ return new PaymentInstrument(cardNumber, accountHolderName, accountNumber, iBan, isAuth, paymentInstrumentGroupId);
+ }
+
+ public string CardNumber { get; private set; }
+ public string AccountHolderName { get; private set; }
+ public string AccountNumber { get; private set; }
+ public string IBan { get; private set; }
+
+ public string PosTerminalId { get; private set; }
+ public string Description { get; set; }
+
+ public PaymentInstrumentType Type { get; private set; }
+
+ public bool IsAuth { get; private set; }
+
+ public long PaymentInstrumentGroupId { get; private set; }
+ public PaymentInstrumentGroup PaymentInstrumentGroup { get; private set; }
+}
diff --git a/Company.Domain/PaymentInstrumentAgg/PaymentInstrumentGroup.cs b/Company.Domain/PaymentInstrumentAgg/PaymentInstrumentGroup.cs
new file mode 100644
index 00000000..c6a243f4
--- /dev/null
+++ b/Company.Domain/PaymentInstrumentAgg/PaymentInstrumentGroup.cs
@@ -0,0 +1,28 @@
+using System.Collections.Generic;
+using _0_Framework.Application;
+using _0_Framework.Domain;
+
+namespace Company.Domain.PaymentInstrumentAgg;
+
+public class PaymentInstrumentGroup:EntityBase
+{
+ public PaymentInstrumentGroup(string name)
+ {
+ Name = name;
+ IsActive = IsActive.True;
+ }
+
+ public string Name { get; private set; }
+ public IsActive IsActive { get; private set; }
+ public List PaymentInstruments { get; set; }
+
+ public void Edit(string name)
+ {
+ Name = name;
+ }
+
+ public void DeActive()
+ {
+ IsActive = IsActive.False;
+ }
+}
\ No newline at end of file
diff --git a/Company.Domain/PaymentTransactionAgg/IPaymentTransactionRepository.cs b/Company.Domain/PaymentTransactionAgg/IPaymentTransactionRepository.cs
new file mode 100644
index 00000000..e37eaa30
--- /dev/null
+++ b/Company.Domain/PaymentTransactionAgg/IPaymentTransactionRepository.cs
@@ -0,0 +1,14 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using _0_Framework.Domain;
+using CompanyManagment.App.Contracts.PaymentTransaction;
+
+namespace Company.Domain.PaymentTransactionAgg;
+
+public interface IPaymentTransactionRepository:IRepository
+{
+ Task> GetPaymentTransactionList(
+ GetPaymentTransactionListSearchModel searchModel);
+
+ Task GetDetails(long id);
+}
\ No newline at end of file
diff --git a/Company.Domain/PaymentTransactionAgg/PaymentTransaction.cs b/Company.Domain/PaymentTransactionAgg/PaymentTransaction.cs
new file mode 100644
index 00000000..9c238bc2
--- /dev/null
+++ b/Company.Domain/PaymentTransactionAgg/PaymentTransaction.cs
@@ -0,0 +1,88 @@
+using System;
+using _0_Framework.Domain;
+using CompanyManagment.App.Contracts.PaymentTransaction;
+
+namespace Company.Domain.PaymentTransactionAgg;
+
+///
+/// نمایانگر یک تراکنش پرداخت شامل جزئیات طرف قرارداد، اطلاعات بانکی، وضعیت تراکنش و مبلغ.
+///
+public class PaymentTransaction:EntityBase
+{
+ ///
+ /// سازنده کلاس PaymentTransaction با دریافت اطلاعات تراکنش.
+ ///
+ /// شناسه طرف قرارداد
+ /// مبلغ تراکنش
+ ///
+ ///
+ public PaymentTransaction(long contractingPartyId,
+ double amount,
+ string contractingPartyName,string callBackUrl)
+ {
+ ContractingPartyId = contractingPartyId;
+ Status = PaymentTransactionStatus.Pending;
+ Amount = amount;
+ ContractingPartyName = contractingPartyName;
+ CallBackUrl = callBackUrl;
+ }
+
+ ///
+ /// تاریخ و زمان انجام پرداخت
+ ///
+ public DateTime TransactionDate { get; private set; }
+
+ ///
+ /// شناسه طرف حساب
+ ///
+ public long ContractingPartyId { get; private set; }
+
+ ///
+ /// نام طرف حساب
+ ///
+ public string ContractingPartyName { get; private set; }
+
+ ///
+ /// نام بانک
+ ///
+ public string BankName { get; private set; }
+
+ ///
+ /// شماره کارت
+ ///
+ public string CardNumber { get; private set; }
+
+ ///
+ /// وضعیت تراکنش پرداخت
+ ///
+ public PaymentTransactionStatus Status { get; private set; }
+
+ ///
+ /// مبلغ تراکنش
+ ///
+ public double Amount { get; private set; }
+
+ ///
+ /// شناسه یکتای تراکنش
+ ///
+ public string TransactionId { get; private set; }
+
+ public string CallBackUrl { get; private set; }
+
+ public void SetPaid(string cardNumber,string bankName)
+ {
+ Status = PaymentTransactionStatus.Success;
+ TransactionDate = DateTime.Now;
+ CardNumber = cardNumber;
+ BankName = bankName;
+ }
+ public void SetFailed()
+ {
+ Status = PaymentTransactionStatus.Failed;
+ TransactionDate = DateTime.Now;
+ }
+ public void SetTransactionId(string transactionId)
+ {
+ TransactionId = transactionId;
+ }
+}
\ No newline at end of file
diff --git a/Company.Domain/ReportAgg/IReportRepository.cs b/Company.Domain/ReportAgg/IReportRepository.cs
index 7615bbf7..892391d1 100644
--- a/Company.Domain/ReportAgg/IReportRepository.cs
+++ b/Company.Domain/ReportAgg/IReportRepository.cs
@@ -11,21 +11,23 @@ namespace Company.Domain.ReportAgg
{
Task GetAllActiveWorkshopsNew(string year, string month);
AllReport GetAllActiveWorkshops(string year, string month);
- WorkshopResult GetWorkshopContractDone(string year, string month, long accountId, List workshopList);
- WorkshopResult GetWorkshopContractSignDone(string year, string month, long accountId, List workshopList);
- WorkshopResult GetWorkshopCheckoutDone(string year, string month, long accountId, List workshopList);
- WorkshopResult GetWorkshopCheckoutSignDone(string year, string month, long accountId, List workshopList);
- List GetEmployeeContract(string year, string month, long workshopId);
- List GetEmployeeContractSign(string year, string month, long workshopId);
- List GetEmployeeCheckout(string year, string month, long workshopId);
- List GetEmployeeCheckoutSign(string year, string month, long workshopId);
- PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId,
+ Task GetWorkshopContractDone(string year, string month, long accountId, List workshopList);
+ Task GetWorkshopContractSignDone(string year, string month, long accountId,
List workshopList);
- PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId,
+ Task GetWorkshopCheckoutDone(string year, string month, long accountId, List workshopList);
+ Task GetWorkshopCheckoutSignDone(string year, string month, long accountId,
List workshopList);
- PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId,
+ Task> GetEmployeeContract(string year, string month, long workshopId);
+ Task> GetEmployeeContractSign(string year, string month, long workshopId);
+ Task> GetEmployeeCheckout(string year, string month, long workshopId);
+ Task> GetEmployeeCheckoutSign(string year, string month, long workshopId);
+ Task GetPrintAllContractDone(string year, string month, long accountId,
List workshopList);
- PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId,
+ Task GetPrintAllContractSignDone(string year, string month, long accountId,
+ List workshopList);
+ Task GetPrintAllCheckoutDone(string year, string month, long accountId,
+ List workshopList);
+ Task GetPrintAllCheckoutSignDone(string year, string month, long accountId,
List workshopList);
diff --git a/Company.Domain/RepresentativeAgg/IRepresentativeRepository.cs b/Company.Domain/RepresentativeAgg/IRepresentativeRepository.cs
index 784600be..e25364ad 100644
--- a/Company.Domain/RepresentativeAgg/IRepresentativeRepository.cs
+++ b/Company.Domain/RepresentativeAgg/IRepresentativeRepository.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.PersonalContractingParty;
@@ -20,4 +21,10 @@ public interface IRepresentativeRepository : IRepository
#endregion
+ #region Api
+ Task> GetList(RepresentativeGetListSearchModel searchModel);
+ bool HasAnyContractingParty(long id);
+ Task> GetSelectList();
+ #endregion
+
}
\ No newline at end of file
diff --git a/Company.Domain/RollCallAgg/IRollCallMandatoryRepository.cs b/Company.Domain/RollCallAgg/IRollCallMandatoryRepository.cs
index c1a8e006..9d501157 100644
--- a/Company.Domain/RollCallAgg/IRollCallMandatoryRepository.cs
+++ b/Company.Domain/RollCallAgg/IRollCallMandatoryRepository.cs
@@ -15,7 +15,7 @@ namespace Company.Domain.RollCallAgg;
public interface IRollCallMandatoryRepository : IRepository
{
- ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute);
+ ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute, double dailyWageUnAffected, bool totalLeaveCompute);
///
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
diff --git a/Company.Domain/RollCallEmployeeStatusAgg/IRollCallEmployeeStatusRepository.cs b/Company.Domain/RollCallEmployeeStatusAgg/IRollCallEmployeeStatusRepository.cs
index ed2db0ec..2009aeec 100644
--- a/Company.Domain/RollCallEmployeeStatusAgg/IRollCallEmployeeStatusRepository.cs
+++ b/Company.Domain/RollCallEmployeeStatusAgg/IRollCallEmployeeStatusRepository.cs
@@ -26,5 +26,6 @@ namespace Company.Domain.RollCallEmployeeStatusAgg
List GetActiveByWorkshopIdInDate(long workshopId, DateTime startDateGr, DateTime endDateGr);
List GetByWorkshopIdInDates(long workshopId, DateTime start, DateTime end);
bool IsActiveInPeriod(long employeeId, long workshopId, DateTime startDate, DateTime endDate);
- }
+ void RemoveRange(IEnumerable rollCallEmployeeStatusList);
+ }
}
diff --git a/Company.Domain/SalaryAidAgg/ISalaryAidRepository.cs b/Company.Domain/SalaryAidAgg/ISalaryAidRepository.cs
index edc2d7c5..4acc1cec 100644
--- a/Company.Domain/SalaryAidAgg/ISalaryAidRepository.cs
+++ b/Company.Domain/SalaryAidAgg/ISalaryAidRepository.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.Reward;
using CompanyManagment.App.Contracts.SalaryAid;
@@ -21,4 +22,5 @@ public interface ISalaryAidRepository:IRepository
SalaryAidsGroupedViewModel GetSearchListAsGrouped(SalaryAidSearchViewModel searchModel);
#endregion
+
}
\ No newline at end of file
diff --git a/Company.Domain/SmsResultAgg/SmsResult.cs b/Company.Domain/SmsResultAgg/SmsResult.cs
index 7a460662..5270f4de 100644
--- a/Company.Domain/SmsResultAgg/SmsResult.cs
+++ b/Company.Domain/SmsResultAgg/SmsResult.cs
@@ -5,7 +5,8 @@ namespace Company.Domain.SmsResultAgg;
public class SmsResult: EntityBase
{
- public SmsResult(int messageId, string status,string typeOfSms, string contractingPartyName,string mobile, long contractingPatyId, long institutionContractId)
+ public SmsResult(int messageId, string status,string typeOfSms,
+ string contractingPartyName,string mobile, long contractingPatyId, long institutionContractId)
{
MessageId = messageId;
Status = status;
diff --git a/Company.Domain/TemporaryClientRegistrationAgg/ContractingPartyTemp.cs b/Company.Domain/TemporaryClientRegistrationAgg/ContractingPartyTemp.cs
index e6ee8870..5e24becb 100644
--- a/Company.Domain/TemporaryClientRegistrationAgg/ContractingPartyTemp.cs
+++ b/Company.Domain/TemporaryClientRegistrationAgg/ContractingPartyTemp.cs
@@ -21,6 +21,8 @@ public class ContractingPartyTemp : EntityBase
IdNumberSerial = idNumberSerial;
Gender = gender;
DateOfBirth = dateOfBirth;
+ PublicId = Guid.NewGuid();
+ Status = ContractingPartyTempStatus.InComplete;
}
///
@@ -91,10 +93,34 @@ public class ContractingPartyTemp : EntityBase
///
public string Address { get; private set; }
+ public ContractingPartyTempStatus Status { get; set; }
+
+ public string VerifyCode { get; set; }
+ public DateTime VerifyCodeSentDateTime { get; set; }
+
+ public Guid PublicId { get; set; }
+
public void UpdateAddress(string state, string city, string address)
{
this.State = state;
this.City = city;
this.Address = address;
}
+
+ public void SetCompleted()
+ {
+ Status = ContractingPartyTempStatus.Completed;
+ }
+
+ public void SetVerifyCode(string verifyCode)
+ {
+ VerifyCode = verifyCode;
+ VerifyCodeSentDateTime = DateTime.Now;
+ }
+}
+
+public enum ContractingPartyTempStatus
+{
+ InComplete,
+ Completed
}
\ No newline at end of file
diff --git a/Company.Domain/TemporaryClientRegistrationAgg/IInstitutionContractContactInfoTempRepository.cs b/Company.Domain/TemporaryClientRegistrationAgg/IInstitutionContractContactInfoTempRepository.cs
new file mode 100644
index 00000000..584029f9
--- /dev/null
+++ b/Company.Domain/TemporaryClientRegistrationAgg/IInstitutionContractContactInfoTempRepository.cs
@@ -0,0 +1,7 @@
+using _0_Framework.Domain;
+
+namespace Company.Domain.TemporaryClientRegistrationAgg;
+
+public interface IInstitutionContractContactInfoTempRepository : IRepository
+{
+}
\ No newline at end of file
diff --git a/Company.Domain/TemporaryClientRegistrationAgg/IInstitutionContractTempRepository.cs b/Company.Domain/TemporaryClientRegistrationAgg/IInstitutionContractTempRepository.cs
index 7d9fe9a7..45443466 100644
--- a/Company.Domain/TemporaryClientRegistrationAgg/IInstitutionContractTempRepository.cs
+++ b/Company.Domain/TemporaryClientRegistrationAgg/IInstitutionContractTempRepository.cs
@@ -1,5 +1,7 @@
-using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading.Tasks;
using _0_Framework_b.Domain;
+using CompanyManagment.App.Contracts.InstitutionContract;
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
namespace Company.Domain.TemporaryClientRegistrationAgg;
@@ -15,4 +17,6 @@ public interface IInstitutionContractTempRepository : IRepository
///
Task GetInstitutionContractTemp(long id,long contractingPartyTempId);
+
+
}
\ No newline at end of file
diff --git a/Company.Domain/TemporaryClientRegistrationAgg/IWorkshopTempRepository.cs b/Company.Domain/TemporaryClientRegistrationAgg/IWorkshopTempRepository.cs
index 5ba19824..f9b99c56 100644
--- a/Company.Domain/TemporaryClientRegistrationAgg/IWorkshopTempRepository.cs
+++ b/Company.Domain/TemporaryClientRegistrationAgg/IWorkshopTempRepository.cs
@@ -14,5 +14,7 @@ public interface IWorkshopTempRepository : IRepository
///
Task> GetWorkshopTemp(long contractingPartyTemp);
+ System.Threading.Tasks.Task RemoveWorkshopTemps(List workshopTempIds);
+
}
\ No newline at end of file
diff --git a/Company.Domain/TemporaryClientRegistrationAgg/InstitutionContractContactInfoTemp.cs b/Company.Domain/TemporaryClientRegistrationAgg/InstitutionContractContactInfoTemp.cs
new file mode 100644
index 00000000..4d616f77
--- /dev/null
+++ b/Company.Domain/TemporaryClientRegistrationAgg/InstitutionContractContactInfoTemp.cs
@@ -0,0 +1,25 @@
+using _0_Framework.Domain;
+
+namespace Company.Domain.TemporaryClientRegistrationAgg;
+
+public class InstitutionContractContactInfoTemp : EntityBase
+{
+ public InstitutionContractContactInfoTemp(string phoneType, string position, string phoneNumber,
+ string fullName, long institutionContractTempId, bool sendSms)
+ {
+ PhoneType = phoneType;
+ Position = position;
+ PhoneNumber = phoneNumber;
+ FullName = fullName;
+ InstitutionContractTempId = institutionContractTempId;
+ SendSms = sendSms;
+ }
+
+ public string PhoneType { get; private set; }
+ public long InstitutionContractTempId { get; private set; }
+ public string Position { get; private set; }
+ public string PhoneNumber { get; private set; }
+ public string FullName { get; private set; }
+ public bool SendSms { get; private set; }
+ public InstitutionContractTemp InstitutionContractTemp { get; set; }
+}
\ No newline at end of file
diff --git a/Company.Domain/TemporaryClientRegistrationAgg/InstitutionContractTemp.cs b/Company.Domain/TemporaryClientRegistrationAgg/InstitutionContractTemp.cs
index 62974a44..b21d9b9c 100644
--- a/Company.Domain/TemporaryClientRegistrationAgg/InstitutionContractTemp.cs
+++ b/Company.Domain/TemporaryClientRegistrationAgg/InstitutionContractTemp.cs
@@ -1,13 +1,15 @@
using System;
+using System.Collections.Generic;
using System.Threading.Tasks;
using _0_Framework.Application.UID;
using _0_Framework.Domain;
+using CompanyManagment.App.Contracts.TemporaryClientRegistration;
namespace Company.Domain.TemporaryClientRegistrationAgg;
public class InstitutionContractTemp : EntityBase
{
- public InstitutionContractTemp(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, string registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
+ public InstitutionContractTemp(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, InstitutionContractTempStatus registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
{
ContractingPartyTempId = contractingPartyTempId;
PaymentModel = paymentModel;
@@ -22,6 +24,7 @@ public class InstitutionContractTemp : EntityBase
MessageId = messageId;
SendVerifyCodeTime = sendVerifyCodeTime;
VerifyCodeEndTime = verifyCodeEndTime;
+ PublicId = Guid.NewGuid();
}
///
@@ -34,12 +37,14 @@ public class InstitutionContractTemp : EntityBase
/// بصورت یکجا
/// -
/// بصئورت ماهیانه
+ /// OneTime
///
public string PaymentModel { get; private set; }
///
/// مدت قرارداد
/// چند ماهه؟
+ /// "12"
///
public string PeriodModel { get; private set; }
@@ -85,7 +90,7 @@ public class InstitutionContractTemp : EntityBase
/// -
/// Completed ثبت نام تکمیل شده
///
- public string RegistrationStatus { get; private set; }
+ public InstitutionContractTempStatus RegistrationStatus { get; private set; }
///
/// آی دی پیامک ارسال شده
@@ -102,8 +107,16 @@ public class InstitutionContractTemp : EntityBase
///
public DateTime? VerifyCodeEndTime{ get; private set; }
+ ///
+ /// آیدی عمومی
+ /// برای نمایش در آدرس
+ ///
+ public Guid PublicId { get; set; }
- public void Edit(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, string registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
+ public List ContactInfoList { get; set; }
+
+
+ public void Edit(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, InstitutionContractTempStatus registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
{
ContractingPartyTempId = contractingPartyTempId;
PaymentModel = paymentModel;
@@ -120,7 +133,7 @@ public class InstitutionContractTemp : EntityBase
VerifyCodeEndTime = verifyCodeEndTime;
}
- public void Update(string verifyCode, string registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
+ public void Update(string verifyCode, InstitutionContractTempStatus registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
{
VerifyCode = verifyCode;
RegistrationStatus = registrationStatus;
@@ -129,6 +142,10 @@ public class InstitutionContractTemp : EntityBase
VerifyCodeEndTime = verifyCodeEndTime;
}
-
+ public void ChangeRegistrationStatus(InstitutionContractTempStatus registrationStatus)
+ {
+ RegistrationStatus = registrationStatus;
+ }
+
+}
-}
\ No newline at end of file
diff --git a/Company.Domain/WorkshopAgg/IWorkshopRepository.cs b/Company.Domain/WorkshopAgg/IWorkshopRepository.cs
index ac14d666..6d5f56ea 100644
--- a/Company.Domain/WorkshopAgg/IWorkshopRepository.cs
+++ b/Company.Domain/WorkshopAgg/IWorkshopRepository.cs
@@ -69,7 +69,8 @@ public interface IWorkshopRepository : IRepository
Task GetWorkshopsForEmployeeStartWorkCount(long accountId);
Task> GetWorkshopsForLeftWorkTemp(long accountId);
Task GetWorkshopsForLeftWorkTempCount(long accountId);
- Task> GetSelectList(string search);
+ Task> GetSelectList(string search, long id);
+ int GetLastArchiveCode();
#endregion
diff --git a/Company.Domain/WorkshopAgg/Workshop.cs b/Company.Domain/WorkshopAgg/Workshop.cs
index 96e61911..99226c05 100644
--- a/Company.Domain/WorkshopAgg/Workshop.cs
+++ b/Company.Domain/WorkshopAgg/Workshop.cs
@@ -76,14 +76,13 @@ public class Workshop : EntityBase
ClientEmployeeWorkshopList = new List();
}
-
-
-
+
public Workshop(string workshopName,string workshopSureName, string insuranceCode, string typeOfOwnership, string archiveCode, string agentName, string agentPhone,
string state, string city, string address, string typeOfInsuranceSend, string typeOfContract, string contractTerm,
string agreementNumber, bool fixedSalary, string population,long? insuranceJobId, string zoneName, bool addBonusesPay, bool addYearsPay, bool addLeavePay, bool totalPaymentHide,
bool isClassified, string computeOptions, string bonusesOptions, string yearsOptions, string hasRollCallFreeVip, bool workshopHolidayWorking,
- bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance, bool createContract, bool signContract, bool createCheckout, bool signCheckout, IsActive cutContractEndOfYear, bool rotatingShiftCompute, bool isStaticCheckout)
+ bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance, bool createContract, bool signContract, bool createCheckout, bool signCheckout,
+ IsActive cutContractEndOfYear, bool rotatingShiftCompute, bool isStaticCheckout,long contractingPartyId)
{
WorkshopName = workshopName;
WorkshopSureName = workshopSureName;
@@ -134,6 +133,7 @@ public class Workshop : EntityBase
CutContractEndOfYear = cutContractEndOfYear;
RotatingShiftCompute = rotatingShiftCompute;
IsStaticCheckout = isStaticCheckout;
+ ContractingPartyId = contractingPartyId;
}
@@ -233,6 +233,8 @@ public class Workshop : EntityBase
///
public bool IsStaticCheckout { get; private set; }
+ public long ContractingPartyId { get; private set; }
+
public Workshop()
{
RollCallServicesList = new List();
@@ -344,4 +346,10 @@ public class Workshop : EntityBase
this.IsActiveString = "false";
ArchiveCode = "b-" + archiveCode;
}
+}
+
+public enum WorkshopRegistrationStatus
+{
+ NotRegistered = 0,
+ Registered = 1
}
\ No newline at end of file
diff --git a/Company.Domain/YearlySalaryAgg/IYearlySalaryRepository.cs b/Company.Domain/YearlySalaryAgg/IYearlySalaryRepository.cs
index 7a0a3acc..cae19664 100644
--- a/Company.Domain/YearlySalaryAgg/IYearlySalaryRepository.cs
+++ b/Company.Domain/YearlySalaryAgg/IYearlySalaryRepository.cs
@@ -6,6 +6,7 @@ using CompanyManagment.App.Contracts.YearlySalary;
using System.Threading.Tasks;
using CompanyManagment.App.Contracts.Checkout;
using CompanyManagment.App.Contracts.Holiday;
+using CompanyManagment.App.Contracts.Contract;
namespace Company.Domain.YearlySalaryAgg;
@@ -17,10 +18,50 @@ public interface IYearlySalaryRepository : IRepository
void TestDayliFeeCompute();
List GetYears();
List GetYearlySalary();
+
+ ///
+ /// دریافت مزد روزانه فیش حقوقی
+ ///
+ ///
+ ///
+ ///
+ ///
+ Task GetCheckoutDailyWage(EditContract contract, DateTime checkoutStart, DateTime checkoutEnd);
+
+ ///
+ /// دریافت مزد روزانه بر اساس تاریخ شروع و پایان
+ ///
+ ///
+ ///
+ ///
+ Task<(double dailyWage, long yearlySalaryId)> GetDailyWageByStartEnd(DateTime start, DateTime end);
+
MontlywageBunosYearsViewModel GetMontlyBunosYears(TimeSpan weeklyTime, DateTime contractStart,DateTime contractEnd, double daylyWage, string weeklyWorkingTime, int officialholiday, int friday, string totalHoursH, string totalHorsM, string basic, int fridayStartToEnd, double dayliFeeComplete, bool hasRollCall, bool holidaysWorking,string shiftWork);
double GetLeavePay(DateTime contractStart, DateTime contractEnd, double daylyWage, double consumableItem, double housingAllowance, double familyAllowance , string weeklyWorkingTime, int officialholiday, int friday, string totalHoursH, string totalHorsM);
double GetOverTimeWorking(double dayliWage, string overTimeWorkH, string overTimeWorkM);
double GetOverNightWorking(double dayliWage, string overNightWorkH, string overNightWorkM, string weeklyWorkingTime, int officialholiday, int friday, DateTime contractStart, DateTime contractEnd, string totalHoursH, string totalHorsM);
+
+ ///
+ /// متد ارتقاء مزد دلخواه
+ ///
+ ///
+ ///
+ ///
+ ///
+ Task UpgradeManualDailyWage(DateTime newContractStart, DateTime lastContractStart,
+ double lastContractManualDailyWage);
+
+ ///
+ /// متد محاسبه پایه سنوات و لیست پایه سنوات های پرسنل
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ Task BaseYearCompute(DateTime contractStart, DateTime contractEnd, long employeeId,
+ long workshopId, List leftWorkList);
DayliFeeViewModel DayliFeeComputing(DateTime startDateW,DateTime contractStart, DateTime endDateW, long employeeId, long workshopId,List leftWorkList);
Task DayliFeeComputingAsync(DateTime startDateW, DateTime contractStart, DateTime endDateW, long employeeId, long workshopId, List leftWorkList);
string ConsumableItems(DateTime endDateW);
diff --git a/Company.Domain/empolyerAgg/Employer.cs b/Company.Domain/empolyerAgg/Employer.cs
index 09837e79..0722e73f 100644
--- a/Company.Domain/empolyerAgg/Employer.cs
+++ b/Company.Domain/empolyerAgg/Employer.cs
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
+using System.Security.AccessControl;
+using _0_Framework.Application;
using _0_Framework.Domain;
using Company.Domain.ContarctingPartyAgg;
using Company.Domain.ContractAgg;
@@ -66,6 +68,11 @@ public class Employer : EntityBase
public string SanaPassword { get; private set; }
public string EmployerNo { get; set; }
+ public bool IsAuth { get; set; }
+ public string IdNumberSerial { get; set; }
+
+ public string IdNumberSeri { get; set; }
+
public PersonalContractingParty ContractingParty { get; set; }
//public List Workshops { get; private set; }
@@ -227,4 +234,35 @@ public class Employer : EntityBase
this.IsActive = false;
this.Address = "false";
}
+
+ public void Authentication(string fName, string lName, string fatherName,string idNumber,
+ string idNumberSeri, string idNumberSerial, string dateOfBirth, Gender gender,string phone)
+ {
+ this.FName = fName;
+ this.LName = lName;
+ this.FatherName = fatherName;
+ this.IdNumberSeri = idNumberSeri;
+ this.IdNumberSerial = idNumberSerial;
+ this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : new();
+ this.IdNumber = idNumber;
+ this.Gender = gender == _0_Framework.Application.Gender.Male? "مرد" : "زن";
+ this.IsAuth = true;
+ Phone = phone;
+ }
+
+
+ public void LegalAuthentication(string fName, string lName, string fatherName,string idNumber, string idNumberSeri,
+ string idNumberSerial, string dateOfBirth, Gender gender,string phone)
+ {
+ FName = fName;
+ EmployerLName = lName;
+ this.FatherName = fatherName;
+ this.IdNumberSeri = idNumberSeri;
+ this.IdNumberSerial = idNumberSerial;
+ this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : new();
+ this.IdNumber = idNumber;
+ this.Gender =gender == _0_Framework.Application.Gender.Male? "مرد" : "زن";
+ this.IsAuth = true;
+ Phone = phone;
+ }
}
\ No newline at end of file
diff --git a/Company.Domain/empolyerAgg/IEmployerRepository.cs b/Company.Domain/empolyerAgg/IEmployerRepository.cs
index 1c8dc4e7..94489f36 100644
--- a/Company.Domain/empolyerAgg/IEmployerRepository.cs
+++ b/Company.Domain/empolyerAgg/IEmployerRepository.cs
@@ -1,9 +1,11 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using _0_Framework.Application;
+using _0_Framework.Application.Enums;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.Checkout;
using CompanyManagment.App.Contracts.Employer;
+using Microsoft.AspNetCore.Mvc;
namespace Company.Domain.empolyerAgg;
@@ -34,7 +36,7 @@ public interface IEmployerRepository : IRepository
List GetEmployersHasWorkshop();
- Task> GetSelectList(string search);
+ Task> GetSelectList(string search, long id, LegalType? legalType);
#endregion
@@ -56,6 +58,17 @@ public interface IEmployerRepository : IRepository
#endregion
+ #region Api
+ Task> GetEmployerList(GetEmployerSearchModel searchModel);
+
+ Task GetLegalEmployerDetail(long id);
+ Task GetRealEmployerDetail(long id);
+ //Task> GetSelectList(string search);
+ Task> DeactivateWithSubordinates(long id);
+ #endregion
+
+
+ Task> GetWorkflowRegistrationForEdit(long employerId, long institutionWorkshopDetailsId);
}
\ No newline at end of file
diff --git a/CompanyManagement.Infrastructure.Excel/RollCall/CaseHistoryRollCallExcelViewModel.cs b/CompanyManagement.Infrastructure.Excel/RollCall/CaseHistoryRollCallExcelViewModel.cs
index 68144324..ca7dcfac 100644
--- a/CompanyManagement.Infrastructure.Excel/RollCall/CaseHistoryRollCallExcelViewModel.cs
+++ b/CompanyManagement.Infrastructure.Excel/RollCall/CaseHistoryRollCallExcelViewModel.cs
@@ -12,9 +12,7 @@ public class CaseHistoryRollCallExcelForEmployeeViewModel
public string EmployeeFullName { get; set; }
public string TotalWorkingHoursFa { get; set; }
public string TotalWorkingTimeSpan { get; set; }
-
-
-
+
public List RollCalls { get; set; }
}
@@ -40,7 +38,8 @@ public class RollCallItemForEmployeeExcelViewModel
public bool HasLeave { get; set; }
public string TotalWorkingHours { get; set; }
-
+ public string EnterTimeDifferences { get; set; }
+ public string ExitTimeDifferences { get; set; }
}
public class RollCallTimeExcelViewModel
diff --git a/CompanyManagement.Infrastructure.Excel/RollCall/RollCallExcelGenerator.cs b/CompanyManagement.Infrastructure.Excel/RollCall/RollCallExcelGenerator.cs
index 4d10e241..b7455351 100644
--- a/CompanyManagement.Infrastructure.Excel/RollCall/RollCallExcelGenerator.cs
+++ b/CompanyManagement.Infrastructure.Excel/RollCall/RollCallExcelGenerator.cs
@@ -113,11 +113,12 @@ public class RollCallExcelGenerator : ExcelGenerator
worksheet.Cells[i + row + 1, 1].Value = i + 1;
worksheet.Cells[i + row + 1, 2].Value = rollCall.DayOfWeekFa;
worksheet.Cells[i + row + 1, 3].Value = rollCall.DateFa;
- worksheet.Cells[i + row + 1, 4].Value = "-";
+ worksheet.Cells[i + row + 1, 4].Value = rollCall.EnterTimeDifferences;
worksheet.Cells[i + row + 1, 5].Value = rollCall.StartsItems;
worksheet.Cells[i + row + 1, 6].Value = rollCall.EndsItems;
- worksheet.Cells[i + row + 1, 7].Value = "-";
- worksheet.Cells[i + row + 1, 8].Value = rollCall.TotalWorkingHours == string.Empty ? "ندارد" : rollCall.TotalWorkingHours;
+ worksheet.Cells[i + row + 1, 7].Value = rollCall.ExitTimeDifferences;
+ worksheet.Cells[i + row + 1, 8].Value = rollCall.TotalWorkingHours == string.Empty
+ ? "ندارد" : rollCall.TotalWorkingHours;
// Style data cells
for (int j = 1; j <= 8; j++)
@@ -307,6 +308,49 @@ public class RollCallExcelGenerator : ExcelGenerator
return package.GetAsByteArray();
}
+ private string CalculateExitMinuteDifference(TimeSpan early, TimeSpan late)
+ {
+ if (early == TimeSpan.Zero && late == TimeSpan.Zero)
+ {
+ return "-";
+ }
+ else if (late != TimeSpan.Zero)
+ {
+ var minutes = late.TotalMinutes > 999 ? "999" : late.TotalMinutes.ToString();
+ return $"{minutes}+";
+ }
+ else if (early != TimeSpan.Zero)
+ {
+ var minutes = early.TotalMinutes > 999 ? "999" : early.TotalMinutes.ToString();
+ return $"{minutes}-";
+ }
+ else
+ {
+ return $"";
+ }
+ }
+
+ private string CalculateEntryMinuteDifference(TimeSpan early, TimeSpan late)
+ {
+ if (early == TimeSpan.Zero && late == TimeSpan.Zero)
+ {
+ return "-";
+ }
+ else if (late != TimeSpan.Zero)
+ {
+ var minutes = late.TotalMinutes > 999 ? "999" : late.TotalMinutes.ToString();
+ return $"{minutes}-";
+ }
+ else if (early != TimeSpan.Zero)
+ {
+ var minutes = early.TotalMinutes > 999 ? "999" : early.TotalMinutes.ToString();
+ return $"{minutes}+";
+ }
+ else
+ {
+ return $"";
+ }
+ }
}
diff --git a/CompanyManagement.Infrastructure.Mongo/CompanyManagement.Infrastructure.Mongo.csproj b/CompanyManagement.Infrastructure.Mongo/CompanyManagement.Infrastructure.Mongo.csproj
new file mode 100644
index 00000000..4c09d4ae
--- /dev/null
+++ b/CompanyManagement.Infrastructure.Mongo/CompanyManagement.Infrastructure.Mongo.csproj
@@ -0,0 +1,17 @@
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CompanyManagement.Infrastructure.Mongo/EmployeeFaceEmbeddingRepo/EmployeeFaceEmbeddingRepository.cs b/CompanyManagement.Infrastructure.Mongo/EmployeeFaceEmbeddingRepo/EmployeeFaceEmbeddingRepository.cs
new file mode 100644
index 00000000..e2abc255
--- /dev/null
+++ b/CompanyManagement.Infrastructure.Mongo/EmployeeFaceEmbeddingRepo/EmployeeFaceEmbeddingRepository.cs
@@ -0,0 +1,60 @@
+using Company.Domain.EmployeeFaceEmbeddingAgg;
+using MongoDB.Driver;
+
+namespace CompanyManagement.Infrastructure.Mongo.EmployeeFaceEmbeddingRepo;
+
+public class EmployeeFaceEmbeddingRepository : IEmployeeFaceEmbeddingRepository
+{
+ private readonly IMongoCollection _employeeFaceEmbeddings;
+
+ public EmployeeFaceEmbeddingRepository(IMongoDatabase database)
+ {
+ _employeeFaceEmbeddings = database.GetCollection("EmployeeFaces");
+ }
+
+ public async Task CreateAsync(EmployeeFaceEmbedding employeeFaceEmbedding)
+ {
+ await _employeeFaceEmbeddings.InsertOneAsync(employeeFaceEmbedding);
+ }
+
+ public async Task UpdateAsync(EmployeeFaceEmbedding employeeFaceEmbedding)
+ {
+ await _employeeFaceEmbeddings.ReplaceOneAsync(
+ x => x.Id == employeeFaceEmbedding.Id,
+ employeeFaceEmbedding);
+ }
+
+ public async Task GetByIdAsync(string id)
+ {
+ return await _employeeFaceEmbeddings
+ .Find(x => x.Id == id)
+ .FirstOrDefaultAsync();
+ }
+
+ public async Task GetByEmployeeIdAsync(long employeeId)
+ {
+ return await _employeeFaceEmbeddings
+ .Find(x => x.EmployeeId == employeeId)
+ .FirstOrDefaultAsync();
+ }
+
+ public async Task> GetByWorkshopIdAsync(long workshopId)
+ {
+ return await _employeeFaceEmbeddings
+ .Find(x => x.WorkshopId == workshopId)
+ .ToListAsync();
+ }
+
+ public async Task> GetByWorkshopIdsAsync(List workshopIds)
+ {
+ return await _employeeFaceEmbeddings
+ .Find(x => workshopIds.First()==x.WorkshopId)
+ .ToListAsync();
+ }
+
+ public async Task DeleteAsync(string id)
+ {
+ await _employeeFaceEmbeddings.DeleteOneAsync(x => x.Id == id);
+ }
+}
+
diff --git a/CompanyManagement.Infrastructure.Mongo/InstitutionContractInsertTempRepo/InstitutionContractExtenstionTempRepository.cs b/CompanyManagement.Infrastructure.Mongo/InstitutionContractInsertTempRepo/InstitutionContractExtenstionTempRepository.cs
new file mode 100644
index 00000000..2b959872
--- /dev/null
+++ b/CompanyManagement.Infrastructure.Mongo/InstitutionContractInsertTempRepo/InstitutionContractExtenstionTempRepository.cs
@@ -0,0 +1,32 @@
+using Company.Domain.InstitutionContractExtensionTempAgg;
+using MongoDB.Driver;
+
+namespace CompanyManagement.Infrastructure.Mongo.InstitutionContractInsertTempRepo;
+
+public class InstitutionContractExtenstionTempRepository:IInstitutionContractExtenstionTempRepository
+{
+ private readonly IMongoCollection _institutionExtenstionTemp;
+
+ public InstitutionContractExtenstionTempRepository(IMongoDatabase database)
+ {
+ _institutionExtenstionTemp = database.GetCollection("InstitutionContractExtenstionTemp");
+ }
+
+ public async Task Create(InstitutionContractExtensionTemp institutionContract)
+ {
+ await _institutionExtenstionTemp.InsertOneAsync(institutionContract);
+ }
+
+ public async Task GetPreviousExtenstionData(long contractingPartyId)
+ {
+ var entity = await _institutionExtenstionTemp
+ .Find(x => x.PreviousId == contractingPartyId)
+ .FirstOrDefaultAsync();
+ return entity;
+ }
+
+ public async Task Remove(Guid id)
+ {
+ await _institutionExtenstionTemp.DeleteOneAsync(x=>x.Id == id);
+ }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/AuthorizedBankDetails/AuthorizedBankDetailsSearchModel.cs b/CompanyManagment.App.Contracts/AuthorizedBankDetails/AuthorizedBankDetailsSearchModel.cs
new file mode 100644
index 00000000..3f47b0be
--- /dev/null
+++ b/CompanyManagment.App.Contracts/AuthorizedBankDetails/AuthorizedBankDetailsSearchModel.cs
@@ -0,0 +1,12 @@
+namespace Company.Application.Contracts.AuthorizedBankDetails
+{
+ public class AuthorizedBankDetailsSearchModel
+ {
+ public string CardNumber { get; set; }
+ public string AccountNumber { get; set; }
+ public string IBan { get; set; }
+ public string BankName { get; set; }
+ public string NationalIdentifier { get; set; }
+ }
+}
+
diff --git a/CompanyManagment.App.Contracts/AuthorizedBankDetails/AuthorizedBankDetailsViewModel.cs b/CompanyManagment.App.Contracts/AuthorizedBankDetails/AuthorizedBankDetailsViewModel.cs
new file mode 100644
index 00000000..3987e925
--- /dev/null
+++ b/CompanyManagment.App.Contracts/AuthorizedBankDetails/AuthorizedBankDetailsViewModel.cs
@@ -0,0 +1,18 @@
+using System;
+using System;
+
+using System.Collections.Generic;
+namespace Company.Application.Contracts.AuthorizedBankDetails;
+
+public class AuthorizedBankDetailsViewModel
+{
+ public string NationalIdentifier { get; set; }
+
+ public long Id { get; set; }
+ public string CustomerType { get; set; }
+ public string CardNumber { get; set; }
+ public string AccountNumber { get; set; }
+ public string IBan { get; set; }
+ public string BankName { get; set; }
+ public List Owners { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/AuthorizedBankDetails/CreateAuthorizedBankDetails.cs b/CompanyManagment.App.Contracts/AuthorizedBankDetails/CreateAuthorizedBankDetails.cs
new file mode 100644
index 00000000..5e299e34
--- /dev/null
+++ b/CompanyManagment.App.Contracts/AuthorizedBankDetails/CreateAuthorizedBankDetails.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+
+namespace Company.Application.Contracts.AuthorizedBankDetails
+{
+ public class CreateAuthorizedBankDetails
+ {
+ public string CardNumber { get; set; }
+
+ public string AccountNumber { get; set; }
+
+ public string IBan { get; set; }
+
+ public string BankName { get; set; }
+
+ public List OwnersList { get; set; }
+ }
+
+ public class CreateAuthorizedBankDetailsOwner
+ {
+ public string FName { get; set; }
+
+ public string LName { get; set; }
+
+ public string NationalIdentifier { get; set; }
+
+ public string CustomerType { get; set; }
+ }
+}
diff --git a/CompanyManagment.App.Contracts/AuthorizedBankDetails/EditAuthorizedBankDetails.cs b/CompanyManagment.App.Contracts/AuthorizedBankDetails/EditAuthorizedBankDetails.cs
new file mode 100644
index 00000000..ea28e332
--- /dev/null
+++ b/CompanyManagment.App.Contracts/AuthorizedBankDetails/EditAuthorizedBankDetails.cs
@@ -0,0 +1,28 @@
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+
+namespace Company.Application.Contracts.AuthorizedBankDetails
+{
+ public class EditAuthorizedBankDetails
+ {
+ public long Id { get; set; }
+
+ public string CardNumber { get; set; }
+
+ public string AccountNumber { get; set; }
+
+ public string IBan { get; set; }
+
+ public string BankName { get; set; }
+
+ public List OwnersList { get; set; }
+ }
+
+ public class AuthorizedBankDetailsOwnerViewModel
+ {
+ public string FName { get; set; }
+ public string LName { get; set; }
+ public string NationalIdentifier { get; set; }
+ public string CustomerType { get; set; }
+ }
+}
diff --git a/CompanyManagment.App.Contracts/AuthorizedBankDetails/IAuthorizedBankDetailsApplication.cs b/CompanyManagment.App.Contracts/AuthorizedBankDetails/IAuthorizedBankDetailsApplication.cs
new file mode 100644
index 00000000..90368d4a
--- /dev/null
+++ b/CompanyManagment.App.Contracts/AuthorizedBankDetails/IAuthorizedBankDetailsApplication.cs
@@ -0,0 +1,14 @@
+using System.Collections.Generic;
+using _0_Framework.Application;
+using Company.Application.Contracts.AuthorizedBankDetails;
+
+namespace Company.Application.Contracts.AuthorizedBankDetails
+{
+ public interface IAuthorizedBankDetailsApplication
+ {
+ OperationResult Create(CreateAuthorizedBankDetails command);
+ EditAuthorizedBankDetails GetDetails(long id);
+ List Search(AuthorizedBankDetailsSearchModel searchModel);
+ AuthorizedBankDetailsViewModel GetByIban(string iban);
+ }
+}
diff --git a/CompanyManagment.App.Contracts/AuthorizedPerson/AuthorizedPersonViewModel.cs b/CompanyManagment.App.Contracts/AuthorizedPerson/AuthorizedPersonViewModel.cs
new file mode 100644
index 00000000..762a3c4a
--- /dev/null
+++ b/CompanyManagment.App.Contracts/AuthorizedPerson/AuthorizedPersonViewModel.cs
@@ -0,0 +1,19 @@
+namespace CompanyManagment.App.Contracts.AuthorizedPerson;
+
+public class AuthorizedPersonViewModel
+{
+ public long Id { get; set; }
+ public string NationalCode { get; set; }
+ public string FirstName { get; set; }
+ public string LastName { get; set; }
+ public string FatherName { get; set; }
+ public string BirthDate { get; set; }
+ public string Gender { get; set; }
+ public string DeathStatus { get; set; }
+ public string ShenasnameSeri { get; set; }
+ public string ShenasnameSerial { get; set; }
+ public string ShenasnamehNumber { get; set; }
+ public bool IsVerified { get; set; }
+ public string VerificationDate { get; set; }
+ public string CreationDate { get; set; }
+}
diff --git a/CompanyManagment.App.Contracts/AuthorizedPerson/CreateAuthorizedPerson.cs b/CompanyManagment.App.Contracts/AuthorizedPerson/CreateAuthorizedPerson.cs
new file mode 100644
index 00000000..f00a3220
--- /dev/null
+++ b/CompanyManagment.App.Contracts/AuthorizedPerson/CreateAuthorizedPerson.cs
@@ -0,0 +1,15 @@
+namespace CompanyManagment.App.Contracts.AuthorizedPerson;
+
+public class CreateAuthorizedPerson
+{
+ public string NationalCode { get; set; }
+ public string FirstName { get; set; }
+ public string LastName { get; set; }
+ public string FatherName { get; set; }
+ public string BirthDate { get; set; }
+ public string Gender { get; set; }
+ public string DeathStatus { get; set; }
+ public string ShenasnameSeri { get; set; }
+ public string ShenasnameSerial { get; set; }
+ public string ShenasnamehNumber { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/AuthorizedPerson/IAuthorizedPersonApplication.cs b/CompanyManagment.App.Contracts/AuthorizedPerson/IAuthorizedPersonApplication.cs
new file mode 100644
index 00000000..809dca56
--- /dev/null
+++ b/CompanyManagment.App.Contracts/AuthorizedPerson/IAuthorizedPersonApplication.cs
@@ -0,0 +1,13 @@
+using System.Collections.Generic;
+using _0_Framework.Application;
+
+namespace CompanyManagment.App.Contracts.AuthorizedPerson;
+
+public interface IAuthorizedPersonApplication
+{
+ OperationResult Create(CreateAuthorizedPerson command);
+ OperationResult CreateFromUidResponse(CreateAuthorizedPerson command);
+ AuthorizedPersonViewModel GetByNationalCode(string nationalCode);
+ List Search(string nationalCode = null, string firstName = null, string lastName = null);
+ bool ExistsByNationalCode(string nationalCode);
+}
diff --git a/CompanyManagment.App.Contracts/Checkout/CheckoutViewModel.cs b/CompanyManagment.App.Contracts/Checkout/CheckoutViewModel.cs
index 2dea371f..de3f9ebb 100644
--- a/CompanyManagment.App.Contracts/Checkout/CheckoutViewModel.cs
+++ b/CompanyManagment.App.Contracts/Checkout/CheckoutViewModel.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using _0_Framework.Application.Enums;
using CompanyManagment.App.Contracts.Employer;
using CompanyManagment.App.Contracts.Loan;
using CompanyManagment.App.Contracts.RollCall;
@@ -133,6 +134,15 @@ public class CheckoutViewModel
///
public string TotalPaidLeave { get; set; }
+ ///
+ /// آیا فیش نیاز به بروزرسانی دارد
+ ///
+ public bool IsUpdateNeeded { get; set; }
+
+ ///
+ /// لیست پیام های هشدار فیش حقوقی
+ ///
+ public List CheckoutWarningMessageList { get; set; }
public bool HasSignCheckout { get; set; }
@@ -141,7 +151,9 @@ public class CheckoutViewModel
public List InstallmentViewModels { get; set; }
public List SalaryAidViewModels { get; set; }
public CheckoutRollCallViewModel CheckoutRollCall { get; set; }
-
+ public bool HasAmountConflict { get; set; }
+ public string EmployeeMandatoryHoursStr { get; set; }
+ public TimeSpan EmployeeMandatoryHoursTimeSpan { get; set; }
}
public class CheckoutRollCallViewModel
diff --git a/CompanyManagment.App.Contracts/Checkout/CheckoutWarningMessageModel.cs b/CompanyManagment.App.Contracts/Checkout/CheckoutWarningMessageModel.cs
new file mode 100644
index 00000000..7640060b
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Checkout/CheckoutWarningMessageModel.cs
@@ -0,0 +1,25 @@
+using _0_Framework.Application.Enums;
+
+namespace CompanyManagment.App.Contracts.Checkout;
+
+///
+/// مدل هشدار فیش حقوقی
+///
+public class CheckoutWarningMessageModel
+{
+ ///
+ /// پیام هشدار
+ ///
+ public string WarningMessage { get; set; }
+
+
+ ///
+ /// آی دی فیش حقوقی
+ ///
+ public long CheckoutId { get; set; }
+
+ ///
+ /// نوع هشدار فیش حقوقی
+ ///
+ public TypeOfCheckoutWarning TypeOfCheckoutWarning { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Checkout/CreateCheckout.cs b/CompanyManagment.App.Contracts/Checkout/CreateCheckout.cs
index 423d087c..57f9691c 100644
--- a/CompanyManagment.App.Contracts/Checkout/CreateCheckout.cs
+++ b/CompanyManagment.App.Contracts/Checkout/CreateCheckout.cs
@@ -135,6 +135,11 @@ public class CreateCheckout
///
public string TotalDayOfBunosesCompute { get; set; }
+ ///
+ /// ساعت موظفی پرسنل برای این ماه
+ ///
+ public TimeSpan EmployeeMandatoryHours { get; set; }
+
public bool HolidayWorking { get; set; }
public string ShiftWork { get; set; }
@@ -155,4 +160,37 @@ public class CreateCheckout
public TimeSpan TotalPaidLeave { get; set; }
public TimeSpan TotalSickLeave { get; set; }
+ public bool HasLeft { get; set; }
+
+
+ ///
+ /// دستمزد روزانه خام بعد از تاثیر ساعت کار
+ ///
+ public double DailySalaryAffected { get; set; }
+
+ ///
+ /// پایه سنوات بعد از تاثیر ساعت کار
+ ///
+ public double BaseYearAffected { get; set; }
+
+
+ ///
+ /// دستمزد روزانه قبل از تاثیر ساعت کار
+ ///
+ public double DailySalaryUnAffected { get; set; }
+
+ ///
+ /// دستمزد روزانه دریافت شده از سمت فرانت
+ ///
+ public string DailySalaryUnAffectedStr { get; set; }
+
+ ///
+ /// مزد سالانه نرمال دریافت از سمت فرانت
+ ///
+ public string NormalDailyWage { get; set; }
+
+ ///
+ /// پایه سنوات قبل از تاثیر ساعت کار
+ ///
+ public double BaseYearUnAffected { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/CompanyManagment.App.Contracts.csproj b/CompanyManagment.App.Contracts/CompanyManagment.App.Contracts.csproj
index 7a94df9f..b2977176 100644
--- a/CompanyManagment.App.Contracts/CompanyManagment.App.Contracts.csproj
+++ b/CompanyManagment.App.Contracts/CompanyManagment.App.Contracts.csproj
@@ -1,17 +1,22 @@
-
- net8.0
-
+
+ net8.0
+ true
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/CompanyManagment.App.Contracts/ContactUs/IContactUsApplication.cs b/CompanyManagment.App.Contracts/ContactUs/IContactUsApplication.cs
new file mode 100644
index 00000000..a286955d
--- /dev/null
+++ b/CompanyManagment.App.Contracts/ContactUs/IContactUsApplication.cs
@@ -0,0 +1,18 @@
+using _0_Framework.Application;
+
+namespace CompanyManagment.App.Contracts.ContactUs;
+
+public interface IContactUsApplication
+{
+ OperationResult Create(CreateContactUs command);
+}
+
+public class CreateContactUs
+{
+ public string FirstName { get; set; }
+ public string LastName { get; set; }
+ public string Email { get; set; }
+ public string PhoneNumber { get; set; }
+ public string Title { get; set; }
+ public string Message { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Contract/ComputingViewModel.cs b/CompanyManagment.App.Contracts/Contract/ComputingViewModel.cs
index 0e8ce49c..ad0068e1 100644
--- a/CompanyManagment.App.Contracts/Contract/ComputingViewModel.cs
+++ b/CompanyManagment.App.Contracts/Contract/ComputingViewModel.cs
@@ -56,5 +56,28 @@ public class ComputingViewModel
public TimeSpan TotalPaidLeave { get; set; }
public TimeSpan TotalSickLeave { get; set; }
+ ///
+ /// ساعت موظفی پرسنل برای این ماه
+ ///
+ public TimeSpan EmployeeMandatoryHours { get; set; }
+
+
+ ///
+ /// پایه سنوات قبل از تاثیر ساعت کار
+ ///
+ public double BaseYearUnAffected { get; set; }
+
+
+ ///
+ /// پایه سنوات بعد از تاثیر ساعت کار
+ ///
+ public double BaseYearAffected { get; set; }
+
+
+ ///
+ /// دستمزد روزانه خام بعد از تاثیر ساعت کار
+ ///
+ public double DailySalaryAffected { get; set; }
+
//public List holidays;
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Contract/ContractDailyWageAndBaseYearReport.cs b/CompanyManagment.App.Contracts/Contract/ContractDailyWageAndBaseYearReport.cs
new file mode 100644
index 00000000..69cd1dfc
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Contract/ContractDailyWageAndBaseYearReport.cs
@@ -0,0 +1,70 @@
+using CompanyManagment.App.Contracts.YearlySalary;
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.Contract;
+///
+/// نمایش نحوه محاسبه پایه سنوات و دستمزد روزانه
+///
+public class ContractDailyWageAndBaseYearReport
+{
+ ///
+ /// لیست داده های محاسبه پایه سنوات
+ ///
+ public BaseYearDataViewModel BaseYearDataViewModel { get; set; }
+
+ ///
+ /// پایه سنوات متاثر از ساعت کار
+ ///
+ public string BaseYearAffected { get; set; }
+
+ ///
+ /// دستمزد روزانه متاثر از ساعت کار
+ ///
+ public string DailySalaryAffected { get; set; }
+
+ ///
+ /// دستمزد روزانه بدون تاثیر ساعت کار
+ ///
+ public string DailySalaryUnAffected { get; set; }
+
+ ///
+ /// دستمزد روزانه تجمیعی
+ ///
+ public string DailyWage { get; set; }
+
+ ///
+ /// تاریخ قراداد
+ ///
+ public string ContractDate { get; set; }
+
+
+ ///
+ /// نوع دستمزد انتخاب شده
+ ///
+ public string DailyWageType { get; set; }
+
+ ///
+ /// لیست ارتقاء
+ ///
+ public List UpgradeManualDailyWageLists { get; set; }
+
+ ///
+ /// نام پرسنل
+ ///
+ public string EmployeeName { get; set; }
+
+ ///
+ /// نام کارگاه
+ ///
+ public string WorkshopName { get; set; }
+
+ ///
+ /// آیا با متد جدید محاسبه شده
+ ///
+ public bool OldComputeMethod { get; set; }
+
+ ///
+ /// آیا محاسبات با مقادیر ذخیره شده مغایرت دارد
+ ///
+ public bool Contradiction { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Contract/CreateContract.cs b/CompanyManagment.App.Contracts/Contract/CreateContract.cs
index 3a2f5bff..728ddd55 100644
--- a/CompanyManagment.App.Contracts/Contract/CreateContract.cs
+++ b/CompanyManagment.App.Contracts/Contract/CreateContract.cs
@@ -140,7 +140,36 @@ public class CreateContract
public string ConvertMonth { get; set; }
public string FormStep { get; set; }
-
+ ///
+ /// دستمزد روزانه خام بعد از تاثیر ساعت کار
+ ///
+ public double DailySalaryAffected { get; set; }
+
+ ///
+ /// پایه سنوات بعد از تاثیر ساعت کار
+ ///
+ public double BaseYearAffected { get; set; }
+
+
+ ///
+ /// دستمزد روزانه قبل از تاثیر ساعت کار
+ ///
+ public double DailySalaryUnAffected { get; set; }
+
+ ///
+ /// پایه سنوات قبل از تاثیر ساعت کار
+ ///
+ public double BaseYearUnAffected { get; set; }
+
+ ///
+ /// آیا دستمزد روزانه دستی وارد شده است؟
+ ///
+ public bool HasManualDailyWage { get; set; }
+
+ ///
+ /// نوع دستمزد انتخاب شده
+ ///
+ public string DailyWageType { get; set; }
public List Contracts { get; set; }
public List Workshops { get; set; }
public List Employers { get; set; }
diff --git a/CompanyManagment.App.Contracts/Contract/IContractApplication.cs b/CompanyManagment.App.Contracts/Contract/IContractApplication.cs
index d7dfbc79..5048b564 100644
--- a/CompanyManagment.App.Contracts/Contract/IContractApplication.cs
+++ b/CompanyManagment.App.Contracts/Contract/IContractApplication.cs
@@ -7,6 +7,14 @@ namespace CompanyManagment.App.Contracts.Contract;
public interface IContractApplication
{
+ ///
+ /// دریافت مزد ارتقاء یافته
+ ///
+ ///
+ ///
+ ///
+ ///
+ Task GetManualDailWage(long workshopId, long employeeId, long yearlySalaryId, DateTime contractStart);
OperationResult Create(CreateContract command);
OperationResult CreateNew(createContractModel command);
OperationResult Edit(EditContract command);
diff --git a/CompanyManagment.App.Contracts/Contract/UpgradeManualDailyWageModel.cs b/CompanyManagment.App.Contracts/Contract/UpgradeManualDailyWageModel.cs
new file mode 100644
index 00000000..3a3958da
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Contract/UpgradeManualDailyWageModel.cs
@@ -0,0 +1,36 @@
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.Contract;
+
+///
+/// ویو مدل رتقاء دستمزد روزانه و لیست ارتقاء
+///
+public class UpgradeManualDailyWageModel
+{
+ ///
+ /// دستمزد روزانه
+ ///
+ public double DailyWage{ get; set; }
+
+
+ ///
+ /// لیست ارتقاء
+ ///
+ public List UpgradeManualDailyWageLists { get; set; }
+}
+
+///
+/// لیست ارتقاء
+///
+public class UpgradeManualDailyWageList
+{
+ ///
+ /// تاریخ شروع و پایان بازه ارتقاء
+ ///
+ public string StartEndDate { get; set; }
+
+ ///
+ /// دستمزد روزانه
+ ///
+ public string DailyWage { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/ContractingPartyBankAccounts/ContractingPartyBankAccountSearchModel.cs b/CompanyManagment.App.Contracts/ContractingPartyBankAccounts/ContractingPartyBankAccountSearchModel.cs
new file mode 100644
index 00000000..b56eb988
--- /dev/null
+++ b/CompanyManagment.App.Contracts/ContractingPartyBankAccounts/ContractingPartyBankAccountSearchModel.cs
@@ -0,0 +1,37 @@
+namespace CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
+
+///
+/// جستجوی لیست اطلاعات بانکی طرف حساب
+///
+public class ContractingPartyBankAccountSearchModel
+{
+ ///
+ /// نام طرف حساب / نام صاحب حساب
+ ///
+ public string ContractingPartyOrAccountHolderName { get; set; }
+
+ ///
+ /// شناسه دستگاه
+ ///
+ public string PosTerminalId { get; set; }
+
+ ///
+ /// شماره کارت
+ ///
+ public string CardNumber { get; set; }
+
+ ///
+ /// شماره حساب
+ ///
+ public string AccountNumber { get; set; }
+
+ ///
+ /// شماره شبا
+ ///
+ public string IBan { get; set; }
+
+ ///
+ /// شمارش page
+ ///
+ public int PageIndex { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/ContractingPartyBankAccounts/CreateContractingPartyBankAccounts.cs b/CompanyManagment.App.Contracts/ContractingPartyBankAccounts/CreateContractingPartyBankAccounts.cs
new file mode 100644
index 00000000..44cbd5ad
--- /dev/null
+++ b/CompanyManagment.App.Contracts/ContractingPartyBankAccounts/CreateContractingPartyBankAccounts.cs
@@ -0,0 +1,37 @@
+namespace CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
+
+///
+/// ایجاد اطلاعات بانکی طرف حساب
+///
+public class CreateContractingPartyBankAccounts
+{
+ ///
+ /// آیدی طرف حساب
+ ///
+ public long ContractingPartyId { get; set; }
+
+ ///
+ /// شماره کارت
+ ///
+ public string CardNumber { get; set; }
+
+ ///
+ /// نام صاحب حساب
+ ///
+ public string AccountHolderName { get; set; }
+
+ ///
+ /// شماره حساب
+ ///
+ public string AccountNumber { get; set; }
+
+ ///
+ /// شماره شبا
+ ///
+ public string IBan { get; set; }
+
+ ///
+ /// آیا احزار هویت شده است یا خیر
+ ///
+ public bool IsAuth { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/ContractingPartyBankAccounts/GetContractingPartyBankAccountViewModel.cs b/CompanyManagment.App.Contracts/ContractingPartyBankAccounts/GetContractingPartyBankAccountViewModel.cs
new file mode 100644
index 00000000..96f4cc03
--- /dev/null
+++ b/CompanyManagment.App.Contracts/ContractingPartyBankAccounts/GetContractingPartyBankAccountViewModel.cs
@@ -0,0 +1,65 @@
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
+
+///
+/// لیست اطلاعات بانکی طرف حساب
+///
+public class GetContractingPartyBankAccountViewModel
+{
+ ///
+ /// تعداد
+ ///
+ public int Count { get; set; }
+ public List List { get; set; }
+
+}
+
+public class ContractingPartyBankAccountsGroupedViewModel
+{
+ ///
+ /// لیست حساب های بانکی
+ ///
+ public List BankAccountsItems { get; set; }
+
+ ///
+ /// آیدی طرف حساب
+ ///
+ public long ContractingPartyId { get; set; }
+
+ ///
+ /// نام طرف حساب
+ ///
+ public string ContractingPartyName { get; set; }
+
+ ///
+ /// نام کارگاه
+ ///
+ public string WorkshopName { get; set; }
+}
+
+///
+/// حساب بانکی طرف حساب
+///
+public class ContractingPartyBankAccountsItemViewModel
+{
+ ///
+ /// نام صاحب حساب
+ ///
+ public string AccountHolderName { get; set; }
+
+ ///
+ /// شماره کارت
+ ///
+ public string CardNumber { get; set; }
+
+ ///
+ /// شماره حساب
+ ///
+ public string AccountNumber { get; set; }
+
+ ///
+ /// شماره شبا
+ ///
+ public string IBan { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/ContractingPartyBankAccounts/IContractingPartyBankAccountsApplication.cs b/CompanyManagment.App.Contracts/ContractingPartyBankAccounts/IContractingPartyBankAccountsApplication.cs
new file mode 100644
index 00000000..992e9808
--- /dev/null
+++ b/CompanyManagment.App.Contracts/ContractingPartyBankAccounts/IContractingPartyBankAccountsApplication.cs
@@ -0,0 +1,102 @@
+using System.Collections.Generic;
+using System.Security.AccessControl;
+using System.Security.Cryptography;
+using System.Threading.Tasks;
+using System.Transactions;
+using _0_Framework.Application;
+using _0_Framework.Application.UID;
+using CompanyManagment.App.Contracts.OriginalTitle;
+
+namespace CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
+
+///
+/// اپلیکیشن اطلاعات بانکی طرف حساب
+///
+public interface IContractingPartyBankAccountsApplication
+{
+ ///
+ /// ایجاد اطلاعات بانکی طرف حساب
+ ///
+ ///
+ ///
+ Task Create(CreateContractingPartyBankAccounts command);
+ Task Create(List commands);
+
+ ///
+ /// لیست اطلاعات طرف حساب بانکی
+ ///
+ ///
+ ///
+ Task GetList(ContractingPartyBankAccountSearchModel searchModel);
+
+ ///
+ /// سلکت لیست جستجو برای نام طرف حساب / صاحب حساب
+ ///
+ /// نام جستجو
+ /// نام سلکت شده
+ ///
+ Task> ContractingPartyOrAccountHolderNameSelectList(string search, string selected);
+
+ ///
+ /// سلکت لیست شماره کارت
+ ///
+ /// نام جستجو
+ /// نام سلکت شده
+ ///
+ Task> CardNumberSelectList(string search, string selected);
+
+ ///
+ /// سلکت لیست شماره شبا
+ ///
+ /// نام جستجو
+ /// نام سلکت شده
+ ///
+ Task> IBanSelectList(string search, string selected);
+
+ ///
+ /// سلکت لیست شماره حساب
+ ///
+ /// نام جستجو
+ /// نام سلکت شده
+ ///
+ Task> AccountNumberSelectList(string search, string selected);
+
+ ///
+ /// سلکت لیست نام صاحبان حساب
+ ///
+ /// نام جستجو
+ /// نام سلکت شده
+ ///
+ Task> GetAccountHolderNameSelectList(string search, string selected);
+
+ ///
+ /// سلکت لیست نام طرف حسابها
+ ///
+ /// نام جستجو
+ /// نام سلکت شده
+ ///
+ Task> ContractingPartyNamesSelectList(string search, string selected);
+
+ ///
+ /// احراز هویت اطلاعات بانکی طرف حساب
+ ///
+ ///
+ ///
+ Task InquiryContractingPartyBankDetails(InquiryContractingPartyBankDetailsRequest command);
+
+}
+public class InquiryContractingPartyBankDetailsRequest
+{
+ public string CardNumber { get; set; }
+ public string AccountNumber { get; set; }
+ public string IBan { get; set; }
+ public UidBanks? UidBank { get; set; }
+}
+public class ContractingPartyBankInquiryResponse
+{
+ public string FullName { get; set; }
+ public string Iban { get; set; }
+ public string AccountNumber { get; set; }
+ public string CardNumber { get; set; }
+}
+
diff --git a/CompanyManagment.App.Contracts/CustomizeCheckout/CustomizeCheckoutViewModel.cs b/CompanyManagment.App.Contracts/CustomizeCheckout/CustomizeCheckoutViewModel.cs
index 1dcb87dc..da3e98de 100644
--- a/CompanyManagment.App.Contracts/CustomizeCheckout/CustomizeCheckoutViewModel.cs
+++ b/CompanyManagment.App.Contracts/CustomizeCheckout/CustomizeCheckoutViewModel.cs
@@ -109,6 +109,8 @@ namespace CompanyManagment.App.Contracts.CustomizeCheckout
public List CustomizeRotatingShifts { get; set; }
public List RegularShift { get; set; }
+ public bool HasAmountConflict { get; set; }
+
//public bool HasLeft { get; set; }
//public string IsBlockCantracingParty { get; set; }
//public string IsActiveString { get; set; }
diff --git a/CompanyManagment.App.Contracts/CustomizeWorkshopSettings/CustomizeWorkshopEmployeeSettingsViewModel.cs b/CompanyManagment.App.Contracts/CustomizeWorkshopSettings/CustomizeWorkshopEmployeeSettingsViewModel.cs
index 6ee51967..072038b8 100644
--- a/CompanyManagment.App.Contracts/CustomizeWorkshopSettings/CustomizeWorkshopEmployeeSettingsViewModel.cs
+++ b/CompanyManagment.App.Contracts/CustomizeWorkshopSettings/CustomizeWorkshopEmployeeSettingsViewModel.cs
@@ -25,4 +25,5 @@ public class CustomizeWorkshopEmployeeSettingsViewModel
public int LeavePermittedDays { get; set; }
public ICollection CustomizeRotatingShiftsViewModels { get; set; }
public List WeeklyOffDays { get; set; }
+ public bool HasLeft { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Employee/GetEmployeeListSearchModel.cs b/CompanyManagment.App.Contracts/Employee/GetEmployeeListSearchModel.cs
new file mode 100644
index 00000000..af2d923e
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Employee/GetEmployeeListSearchModel.cs
@@ -0,0 +1,38 @@
+using _0_Framework.Application.Enums;
+
+namespace CompanyManagment.App.Contracts.Employee;
+
+///
+/// مدل جستجو در لیست پرسنل در ادمین
+///
+public class GetEmployeeListSearchModel
+{
+ ///
+ /// آیدی کارفرما
+ ///
+ public long EmployerId { get; set; }
+ ///
+ /// آیدی کارگاه
+ ///
+ public long WorkshopId { get; set; }
+ ///
+ /// آیدی پرسنل
+ ///
+ public long EmployeeId { get; set; }
+ ///
+ /// کدملی
+ ///
+ public string NationalCode { get; set; }
+ ///
+ /// شماره بیمه
+ ///
+ public string InsuranceCode { get; set; }
+ ///
+ /// وضعیت پرسنل
+ ///
+ public ActivationStatus EmployeeStatus { get; set; }
+ ///
+ /// ایندکس جستجو
+ ///
+ public int PageIndex { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Employee/GetEmployeeListViewModel.cs b/CompanyManagment.App.Contracts/Employee/GetEmployeeListViewModel.cs
new file mode 100644
index 00000000..c5fde22e
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Employee/GetEmployeeListViewModel.cs
@@ -0,0 +1,44 @@
+using _0_Framework.Application;
+using _0_Framework.Application.Enums;
+
+namespace CompanyManagment.App.Contracts.Employee;
+
+///
+/// ویو مدل لیست پرسنل ادمین
+///
+public class GetEmployeeListViewModel
+{
+ ///
+ /// آیدی پرسنل
+ ///
+ public long Id { get; set; }
+ ///
+ /// نام و نام خانوادگی پرسنل
+ ///
+ public string EmployeeFullName { get; set; }
+ ///
+ /// کدملی
+ ///
+ public string NationalCode { get; set; }
+
+ ///
+ /// تعداد فرزندان
+ ///
+ public string ChildrenCount { get; set; }
+ ///
+ /// جنسیت
+ ///
+ public Gender Gender { get; set; }
+ ///
+ /// تاریخ تولد
+ ///
+ public string BirthDate { get; set; }
+ ///
+ /// شماره بیمه
+ ///
+ public string InsuranceCode { get; set; }
+ ///
+ /// وضعیت پرسنل
+ ///
+ public ActivationStatus EmployeeStatus { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Employee/IEmployeeApplication.cs b/CompanyManagment.App.Contracts/Employee/IEmployeeApplication.cs
index ec216d42..2f1b692d 100644
--- a/CompanyManagment.App.Contracts/Employee/IEmployeeApplication.cs
+++ b/CompanyManagment.App.Contracts/Employee/IEmployeeApplication.cs
@@ -77,6 +77,24 @@ public interface IEmployeeApplication
Task> GetEmployeeDataFromApi(string nationalCode, string birthDate);
- #endregion
+ #endregion
+
+ #region Api
+
+ ///
+ /// لیست پرسنل برای جستجو
+ ///
+ ///
+ ///
+ ///
+ Task> GetSelectList(string searchText, long id);
+
+ ///
+ /// لیست کل پرسنل
+ ///
+ ///
+ Task> GetList(GetEmployeeListSearchModel searchModel);
+
+ #endregion
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/EmployeeFaceEmbedding/EmployeeFaceEmbeddingDto.cs b/CompanyManagment.App.Contracts/EmployeeFaceEmbedding/EmployeeFaceEmbeddingDto.cs
new file mode 100644
index 00000000..7261a94c
--- /dev/null
+++ b/CompanyManagment.App.Contracts/EmployeeFaceEmbedding/EmployeeFaceEmbeddingDto.cs
@@ -0,0 +1,14 @@
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.EmployeeFaceEmbedding;
+
+public class EmployeeFaceEmbeddingDto
+{
+ public string Id { get; set; }
+ public string EmployeeFullName { get; set; }
+ public long EmployeeId { get; set; }
+ public long WorkshopId { get; set; }
+ public List Embeddings { get; set; }
+ public EmployeeFaceEmbeddingMetadataDto Metadata { get; set; }
+}
+
diff --git a/CompanyManagment.App.Contracts/EmployeeFaceEmbedding/EmployeeFaceEmbeddingDtos.cs b/CompanyManagment.App.Contracts/EmployeeFaceEmbedding/EmployeeFaceEmbeddingDtos.cs
new file mode 100644
index 00000000..3b641375
--- /dev/null
+++ b/CompanyManagment.App.Contracts/EmployeeFaceEmbedding/EmployeeFaceEmbeddingDtos.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.EmployeeFaceEmbedding;
+
+public class EmployeeFaceEmbeddingMetadataDto
+{
+ public double AvgEyeDistanceNormalized { get; set; }
+ public double AvgEyeToFaceRatio { get; set; }
+ public double AvgFaceAspectRatio { get; set; }
+ public double AvgDetectionConfidence { get; set; }
+ public EmployeeFaceEmbeddingKeypointsDto AvgKeypointsNormalized { get; set; }
+ public List PerImageMetadata { get; set; }
+}
+
+public class EmployeeFaceEmbeddingKeypointsDto
+{
+ public double[] LeftEye { get; set; }
+ public double[] RightEye { get; set; }
+ public double[] Nose { get; set; }
+ public double[] MouthLeft { get; set; }
+ public double[] MouthRight { get; set; }
+}
+
+public class ImageMetadataDto
+{
+ public double FaceAspectRatio { get; set; }
+ public double EyeDistanceNormalized { get; set; }
+ public double EyeToFaceRatio { get; set; }
+ public double DetectionConfidence { get; set; }
+ public EmployeeFaceEmbeddingKeypointsDto KeypointsNormalized { get; set; }
+}
+
+public class EmbeddingHistoryItemDto
+{
+ public List Embedding { get; set; }
+ public DateTime Timestamp { get; set; }
+ public double Confidence { get; set; }
+ public double RefinementPercentage { get; set; }
+}
+
+public class MetadataHistoryItemDto
+{
+ public EmployeeFaceEmbeddingMetadataDto Metadata { get; set; }
+ public DateTime Timestamp { get; set; }
+ public double Confidence { get; set; }
+ public double RefinementPercentage { get; set; }
+}
+
diff --git a/CompanyManagment.App.Contracts/EmployeeFaceEmbedding/IEmployeeFaceEmbeddingApplication.cs b/CompanyManagment.App.Contracts/EmployeeFaceEmbedding/IEmployeeFaceEmbeddingApplication.cs
new file mode 100644
index 00000000..b2d42da6
--- /dev/null
+++ b/CompanyManagment.App.Contracts/EmployeeFaceEmbedding/IEmployeeFaceEmbeddingApplication.cs
@@ -0,0 +1,43 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace CompanyManagment.App.Contracts.EmployeeFaceEmbedding;
+
+///
+/// سرویس مدیریت Embedding چهره کارکنان
+/// این سرویس فقط برای دریافت و ارسال داده است و هیچ command-driven نیست
+///
+public interface IEmployeeFaceEmbeddingApplication
+{
+ ///
+ /// دریافت embedding بر اساس شناسه
+ ///
+ Task GetByIdAsync(string id);
+
+ ///
+ /// دریافت embedding بر اساس شناسه کارمند
+ ///
+ Task GetByEmployeeIdAsync(long employeeId);
+
+ ///
+ /// دریافت لیست embeddings بر اساس شناسه کارگاه
+ ///
+ Task> GetByWorkshopIdAsync(long workshopId);
+
+ ///
+ /// دریافت لیست embeddings بر اساس لیست شناسه کارگاهها
+ ///
+ Task> GetByWorkshopIdsAsync(List workshopIds);
+
+ ///
+ /// ذخیره یا بهروزرسانی embedding
+ /// اگر Id وجود داشته باشد، بهروزرسانی میشود، در غیر این صورت ایجاد میشود
+ ///
+ Task SaveAsync(EmployeeFaceEmbeddingDto dto);
+
+ ///
+ /// حذف embedding
+ ///
+ Task DeleteAsync(string id);
+}
+
diff --git a/CompanyManagment.App.Contracts/Employer/CreateLegalEmployer.cs b/CompanyManagment.App.Contracts/Employer/CreateLegalEmployer.cs
new file mode 100644
index 00000000..a0224f7b
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Employer/CreateLegalEmployer.cs
@@ -0,0 +1,84 @@
+using System.ComponentModel.DataAnnotations;
+using _0_Framework.Application;
+using _0_Framework.Application.Enums;
+
+namespace CompanyManagment.App.Contracts.Employer;
+
+///
+/// ایجاد کارفرمای حقیقی
+///
+public class CreateLegalEmployer
+{
+ ///
+ /// آیدی طرف حساب
+ ///
+ [Required]
+ public long ContractingPartyId { get; set; }
+
+ ///
+ /// نام شرکت
+ ///
+ public string CompanyName { get; set; }
+
+ ///
+ /// شناسه ملی
+ ///
+ public string NationalId { get; set; }
+
+ ///
+ /// شماره ثبت
+ ///
+ public string RegisterId { get; set; }
+
+ ///
+ /// شماره تلفن همراه
+ ///
+ public string PhoneNumber { get; set; }
+
+ ///
+ /// شماره تلفن ثابت
+ ///
+ public string TelephoneNumber { get; set; }
+
+ ///
+ /// نام مدیر عامل
+ ///
+ public string EmployerFName { get; set; }
+ ///
+ /// نام خانوادگی مدیر عامل
+ ///
+ public string EmployerLName { get; set; }
+ ///
+ /// جنسیت مدیر عامل
+ ///
+ public Gender EmployerGender { get; set; }
+ ///
+ /// کد ملی مدیر عامل
+ ///
+ public string EmployerNationalCode { get; set; }
+ ///
+ /// شماره شناسنامه مدیر عامل
+ ///
+ public string EmployerIdNumber { get; set; }
+ ///
+ /// نام پدر مدیر عامل
+ ///
+ public string EmployerFatherName { get; set; }
+ ///
+ /// تاریخ تولد مدیر عامل
+ ///
+ public string EmployerDateOfBirth { get; set; }
+ ///
+ /// تاریخ صدور شناسنامه مدیر عامل
+ ///
+ public string EmployerDateOfIssue { get; set; }
+ ///
+ /// محل صدور شناسنامه مدیر عامل
+ ///
+ public string EmployerPlaceOfIssue { get; set; }
+
+ ///
+ /// اطلاعات سامانه ای
+ ///
+ public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Employer/CreateRealEmployer.cs b/CompanyManagment.App.Contracts/Employer/CreateRealEmployer.cs
new file mode 100644
index 00000000..998e6d75
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Employer/CreateRealEmployer.cs
@@ -0,0 +1,80 @@
+using System.ComponentModel.DataAnnotations;
+using _0_Framework.Application;
+using _0_Framework.Application.Enums;
+
+namespace CompanyManagment.App.Contracts.Employer;
+
+///
+/// ایجاد کارفرما حقیقی
+///
+public class CreateRealEmployer
+{
+ ///
+ /// آیدی طرف حساب
+ ///
+ [Required]
+ public long ContractingPartyId { get; set; }
+
+ ///
+ /// جنسیت
+ ///
+ [Required]
+ public Gender Gender { get; set; }
+
+ ///
+ /// نام
+ ///
+ [Required]
+ public string FName { get; set; }
+
+ ///
+ ///نام خانوادگی
+ ///
+ [Required]
+ public string LName { get; set; }
+
+ ///
+ /// کد ملی
+ ///
+ public string NationalCode { get; set; }
+
+ ///
+ /// شماره شناسنامه
+ ///
+ public string IdNumber { get; set; }
+
+ ///
+ /// شماره تلفن همراه
+ ///
+ public string PhoneNumber { get; set; }
+
+ ///
+ /// شماره تلفن ثابت
+ ///
+ public string Telephone { get; set; }
+
+ ///
+ /// تاریخ صدور شناسنامه
+ ///
+ public string DateOfIssue { get; set; }
+
+ ///
+ /// محل صدور شناسنامه
+ ///
+ public string PlaceOfIssue { get; set; }
+
+ ///
+ /// تاریخ تولد
+ ///
+ public string DateOfBirth { get; set; }
+
+ ///
+ /// نام پدر
+ ///
+ public string FatherName { get; set; }
+
+ ///
+ /// اطلاعات سامانه ای
+ ///
+ public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Employer/EditLegalEmployer.cs b/CompanyManagment.App.Contracts/Employer/EditLegalEmployer.cs
new file mode 100644
index 00000000..06d671d8
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Employer/EditLegalEmployer.cs
@@ -0,0 +1,9 @@
+namespace CompanyManagment.App.Contracts.Employer;
+
+public class EditLegalEmployer: CreateLegalEmployer
+{
+ ///
+ /// آیدی کارفرما
+ ///
+ public long Id { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Employer/EditRealEmployer.cs b/CompanyManagment.App.Contracts/Employer/EditRealEmployer.cs
new file mode 100644
index 00000000..bfe9c3e1
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Employer/EditRealEmployer.cs
@@ -0,0 +1,12 @@
+namespace CompanyManagment.App.Contracts.Employer;
+
+///
+/// ویرایش کارفرما حقیقی
+///
+public class EditRealEmployer:CreateRealEmployer
+{
+ ///
+ /// آیدی کارفرما
+ ///
+ public long Id { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Employer/GetEmployerListViewModel.cs b/CompanyManagment.App.Contracts/Employer/GetEmployerListViewModel.cs
new file mode 100644
index 00000000..f75fc4b9
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Employer/GetEmployerListViewModel.cs
@@ -0,0 +1,50 @@
+using System.Collections.Generic;
+using _0_Framework.Application.Enums;
+
+namespace CompanyManagment.App.Contracts.Employer;
+
+///
+/// مدل برای گرفتن لیست کارفرما
+///
+public class GetEmployerListViewModel
+{
+ ///
+ /// آیدی کارفرما
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// کدملی / شناسه ملی
+ ///
+ public string NationalCodeOrNationalId { get; set; }
+
+ ///
+ /// نام کارفرما
+ ///
+ public string FullName { get; set; }
+
+ ///
+ /// نام های کارگاه
+ ///
+ public ICollection WorkshopNames { get; set; }
+
+ ///
+ /// دارای طرف حساب
+ ///
+ public bool HasContractingParty { get; set; }
+
+ ///
+ /// طرف حساب بلاک شده یا نه
+ ///
+ public bool HasBlockContractingParty { get; set; }
+
+ ///
+ /// نوع کارفرما
+ ///
+ public LegalType LegalType { get; set; }
+
+ ///
+ /// وضعیت کارفرما
+ ///
+ public ActivationStatus EmployerStatus { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Employer/GetEmployerSearchModel.cs b/CompanyManagment.App.Contracts/Employer/GetEmployerSearchModel.cs
new file mode 100644
index 00000000..738f6a25
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Employer/GetEmployerSearchModel.cs
@@ -0,0 +1,44 @@
+using _0_Framework.Application.Enums;
+
+namespace CompanyManagment.App.Contracts.Employer;
+
+///
+/// مدل جستجوی لیست کارفرما
+///
+public class GetEmployerSearchModel
+{
+ ///
+ /// نام شرکت / نام و نام خانوادگی
+ ///
+ public string FullNameOrCompanyName { get; set; }
+
+ ///
+ /// کدملی/ شناسه ملی
+ ///
+ public string NationalCodeOrNationalId { get; set; }
+
+ ///
+ /// شماره شناسنامه یا شماره ثبت
+ ///
+ public string IdNumberOrRegisterId { get; set; }
+
+ ///
+ /// نام طرف حساب
+ ///
+ public string ContractingPartyName { get; set; }
+
+ ///
+ /// وضعیت کارفرما
+ ///
+ public ActivationStatus EmployerStatus { get; set; }
+
+ ///
+ /// نوع کارفرما
+ ///
+ public LegalType EmployerType { get; set; }
+
+ ///
+ /// پیج ایندکس برای دسته بندی سی تایی
+ ///
+ public int PageIndex { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Employer/GetLegalEmployerDetailViewModel.cs b/CompanyManagment.App.Contracts/Employer/GetLegalEmployerDetailViewModel.cs
new file mode 100644
index 00000000..9ffe398e
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Employer/GetLegalEmployerDetailViewModel.cs
@@ -0,0 +1,120 @@
+using _0_Framework.Application;
+using _0_Framework.Application.Enums;
+
+namespace CompanyManagment.App.Contracts.Employer;
+
+///
+/// اطلاعات کارفرمای حقوقی
+///
+public class GetLegalEmployerDetailViewModel
+{
+ ///
+ /// آیدی کارفرما
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// نام شرکت
+ ///
+ public string CompanyName { get; set; }
+
+ ///
+ /// شناسه ملی
+ ///
+ public string NationalId { get; set; }
+
+ ///
+ /// شماره ثبت
+ ///
+ public string RegisterId { get; set; }
+
+ ///
+ /// شماره تلفن همراه
+ ///
+ public string PhoneNumber { get; set; }
+
+ ///
+ /// شماره تلفن ثابت
+ ///
+ public string TelephoneNumber { get; set; }
+
+ ///
+ /// کد کارفرما
+ ///
+ public string EmployerNo { get; set; }
+
+ ///
+ /// نام کارفرما
+ ///
+ public string ContractingPartyName { get; set; }
+
+ ///
+ /// نام کارفرما
+ ///
+ public long ContractingPartyId { get; set; }
+
+ ///
+ /// نام و خانوادگی مدیر عامل
+ ///
+ public string CeoFullName { get; set; }
+
+ ///
+ /// نام و خانوادگی مدیر عامل
+ ///
+ public string CeoFName { get; set; }
+
+ ///
+ /// نام و خانوادگی مدیر عامل
+ ///
+ public string CeoLName { get; set; }
+
+ ///
+ /// جنسیت مدیر عامل
+ ///
+ public Gender Gender { get; set; }
+
+ ///
+ /// جنیست
+ ///
+ public string GenderStr { get; set; }
+
+ ///
+ /// ملیت
+ ///
+ public string Nationality { get; set; }
+
+ ///
+ /// نام پدر
+ ///
+ public string FatherName { get; set; }
+
+ ///
+ /// کد ملی
+ ///
+ public string NationalCode { get; set; }
+
+ ///
+ /// شماره شناسنامه
+ ///
+ public string IdNumber { get; set; }
+
+ ///
+ /// تاریخ تولد
+ ///
+ public string DateOfBirth { get; set; }
+ ///
+ /// تاریخ صدور شناسنامه
+ ///
+ public string DateOfIssue { get; set; }
+
+ ///
+ /// محل صدور شناسنامه
+ ///
+ public string PlaceOfIssue { get; set; }
+
+ ///
+ /// اطلاعات سامانه های دولتی
+ ///
+ public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Employer/GetRealEmployerDetailViewModel.cs b/CompanyManagment.App.Contracts/Employer/GetRealEmployerDetailViewModel.cs
new file mode 100644
index 00000000..9ace3ab6
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Employer/GetRealEmployerDetailViewModel.cs
@@ -0,0 +1,107 @@
+using _0_Framework.Application;
+using _0_Framework.Application.Enums;
+
+namespace CompanyManagment.App.Contracts.Employer;
+
+///
+/// اطلاعات کارفرمای حقوقی
+///
+public class GetRealEmployerDetailViewModel
+{
+ ///
+ /// آیدی کارفرما
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// نام و نام خانوادگی
+ ///
+ public string FullName { get; set; }
+
+ ///
+ /// نام
+ ///
+ public string FName{ get; set; }
+
+ ///
+ /// نام خانوادگی
+ ///
+ public string LName { get; set; }
+
+ ///
+ /// کدملی
+ ///
+ public string NationalCode { get; set; }
+
+ ///
+ /// جنسیت فارسی
+ ///
+ public string GenderStr { get; set; }
+
+ ///
+ /// جنسیت
+ ///
+ public Gender Gender { get; set; }
+
+ ///
+ /// ملیت
+ ///
+ public string Nationality { get; set; }
+
+ ///
+ /// شماره تلفن همراه
+ ///
+ public string PhoneNumber { get; set; }
+
+ ///
+ /// نام پدر
+ ///
+ public string FatherName { get; set; }
+
+ ///
+ /// شماره شناسنامه
+ ///
+ public string IdNumber { get; set; }
+
+ ///
+ /// تاریخ تولد
+ ///
+ public string DateOfBirth { get; set; }
+
+ ///
+ /// نام طرف حساب
+ ///
+ public string ContractingPartyName { get; set; }
+
+
+ ///
+ /// آیدی طرف حساب
+ ///
+ public long ContractingPartyId { get; set; }
+
+ ///
+ /// کد کارفرما
+ ///
+ public string EmployerNo { get; set; }
+
+
+ ///
+ /// شماره تلفن ثابت
+ ///
+ public string TelephoneNumber { get; set; }
+
+ ///
+ /// تاریخ صدور شناسنامه
+ ///
+ public string DateOfIssue { get; set; }
+
+ ///
+ /// محل صدور شناسنامه
+ ///
+ public string PlaceOfIssue { get; set; }
+
+ ///
+ /// اطلاعات سامانه های دولتی
+ ///
+ public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Employer/GovernmentSystemInfo.cs b/CompanyManagment.App.Contracts/Employer/GovernmentSystemInfo.cs
new file mode 100644
index 00000000..611ccb16
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Employer/GovernmentSystemInfo.cs
@@ -0,0 +1,54 @@
+using System;
+
+namespace CompanyManagment.App.Contracts.Employer;
+
+///
+/// اطلاعات سامانه های دولتی
+///
+public class GovernmentSystemInfo
+{
+ #region MCL
+ ///
+ /// نام کاربری اداره کار
+ ///
+ public string MclUsername { get; set; }
+ ///
+ /// رمز عبور اداره کار
+ ///
+ public string MclPassword { get; set; }
+ #endregion
+
+ #region E-Service تامین اجتماعی
+ ///
+ /// نام کاربری سازمان تامین اجتماعی
+ ///
+ public string EServiceUsername { get; set; }
+ ///
+ /// رمز عبور سازمان تامین اجتماعی
+ ///
+ public string EServicePassword { get; set; }
+ #endregion
+
+ #region Tax سامانه مالیاتی
+ ///
+ /// نام کاربری سامانه مالیاتی
+ ///
+ public string TaxUsername { get; set; }
+ ///
+ /// رمز عبور سامانه مالیاتی
+ ///
+ public string TaxPassword { get; set; }
+ #endregion
+
+ #region Sana سامانه ثنا
+ ///
+ /// نام کاربری ثنا
+ ///
+ public string SanaUsername { get; set; }
+ ///
+ /// رمز عبور ثنا
+ ///
+ public string SanaPassword { get; set; }
+ #endregion
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Employer/IEmployerApplication.cs b/CompanyManagment.App.Contracts/Employer/IEmployerApplication.cs
index ec8582f1..0324f953 100644
--- a/CompanyManagment.App.Contracts/Employer/IEmployerApplication.cs
+++ b/CompanyManagment.App.Contracts/Employer/IEmployerApplication.cs
@@ -1,7 +1,12 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Threading.Tasks;
+using System.Transactions;
using _0_Framework.Application;
+using _0_Framework.Application.Enums;
using CompanyManagment.App.Contracts.Checkout;
+using CompanyManagment.App.Contracts.Employee;
+using Microsoft.AspNetCore.Mvc;
namespace CompanyManagment.App.Contracts.Employer;
@@ -19,7 +24,7 @@ public interface IEmployerApplication
OperationResult Active(long id);
OperationResult DeActive(long id);
- OperationResult Remove(long id);
+ OperationResult Remove_Old(long id);
List GetEmployers();
List Search(EmployerSearchModel searchModel);
@@ -36,7 +41,15 @@ public interface IEmployerApplication
#region Mahan
List GetEmployersHasWorkshop();
- Task> GetSelectList(string search);
+
+ ///
+ /// لیست نام کارفرما ها برای جستجو
+ ///
+ ///
+ ///
+ ///
+ ///
+ Task> GetSelectList(string search, long id, LegalType? legalType = null);
#endregion
#region NewByHeydari
@@ -53,6 +66,357 @@ public interface IEmployerApplication
(string employerName, bool isLegal) InsuranceEmployerByWorkshopId(long workshopId);
+
+
+ #endregion
+ #region Api
+ ///
+ /// لیست کارفرما ها
+ ///
+ ///
+ Task> GetEmployerList(GetEmployerSearchModel searchModel);
+
+ ///
+ /// جزئیات کارفرما حقوقی
+ ///
+ ///
+ ///
+ Task GetLegalEmployerDetail(long id);
+
+ ///
+ /// جزئیات کارفرما حقیقی
+ ///
+ ///
+ ///
+ Task GetRealEmployerDetail(long id);
+
+ ///
+ /// ایجاد کارفرمای حقیقی
+ ///
+ ///
+ ///
+ Task CreateReal(CreateRealEmployer command);
+
+ ///
+ /// ایجاد کارفرمای حقوقی
+ ///
+ ///
+ ///
+ Task CreateLegal(CreateLegalEmployer command);
+
+ ///
+ /// ویرایش کارفرمای حقیقی
+ ///
+ ///
+ ///
+ Task EditReal(EditRealEmployer command);
+
+
+ ///
+ /// ویرایش کارفرمای حقوقی
+ ///
+ ///
+ ///
+ Task EditLegal(EditLegalEmployer command);
+
+
+
+ ///
+ /// حذف کارفرما - درصورت داشتن کارگاه کارفرما غیرفعال میشود
+ ///
+ ///
+ ///
+ public Task> Remove(long id);
+
#endregion
-}
\ No newline at end of file
+ Task CreateWorkflowRegistration(CreateEmployerWorkflowRegistration command);
+ ///
+ /// ویرایش کارفرما در گردش کار ثبت نام
+ ///
+ ///
+ ///
+ Task EditWorkflowRegistration(EditEmployerWorkflowRegistration command);
+
+ ///
+ /// حذف کارفرما از گردش کار ثبت نام
+ ///
+ /// شناسه کارفرما
+ /// شناسه جزئیات کارگاه موسسه
+ ///
+ Task DeleteWorkflowRegistration(long employerId, long institutionWorkshopDetailsId);
+
+ Task> AuthenticateEmployer(string nationalCode, string dateOfBirth, string mobile);
+ Task> GetWorkflowRegistrationForEdit(long employerId, long institutionWorkshopDetailsId);
+}
+
+public class AuthenticateUserViewModel
+{
+ ///
+ /// نام
+ ///
+ public string FName { get; set; }
+ ///
+ /// نام خانوادگی
+ ///
+ public string LName { get; set; }
+
+ ///
+ /// نام پدر
+ ///
+ public string FatherName { get; set; }
+
+ ///
+ /// جنسیت
+ ///
+ public Gender Gender { get; set; }
+
+ ///
+ /// کد ملی
+ ///
+ public string NationalCode { get; set; }
+
+
+ public string DateOfBirth { get; set; }
+
+ ///
+ /// سری شناسنامه
+ ///
+ public string IdNumberSeri { get; set; }
+
+ ///
+ /// سریال شناسنامه
+ ///
+ public string IdNumberSerial { get; set; }
+
+
+ ///
+ /// شماره شناسنامه
+ ///
+ public string IdNumber { get; set; }
+
+
+
+ ///
+ /// شماره همراه
+ ///
+ public string Phone { get; set; }
+
+
+}
+
+///
+/// کلاس ثبت کارفرما در گردش کار - شامل اطلاعات کارفرمای حقیقی و حقوقی
+///
+public class CreateEmployerWorkflowRegistration
+{
+ ///
+ /// درزمانی که یوزر کارفرمایی رو انتخاب کرد که از قبل ثبت شده است
+ /// این فیلد باید مقدار داشته باشد
+ ///
+ public long EmployerId { get; set; }
+ ///
+ /// اطلاعات کارفرمای حقیقی
+ ///
+ public CreateRealEmployerWorkflowRegistration RealEmployer { get; set; }
+
+ ///
+ /// اطلاعات کارفرمای حقوقی
+ ///
+ public CreateLegalEmployerWorkflowRegistration LegalEmployer { get; set; }
+
+ ///
+ /// نوع حقوقی
+ ///
+ public LegalType LegalType { get; set; }
+
+ ///
+ /// شناسه جزئیات کارگاه موسسه
+ ///
+ public long InstitutionWorkshopInitialId { get; set; }
+
+ ///
+ /// شناسه قرارداد موسسه
+ ///
+ public long InstitutionContractId { get; set; }
+
+ ///
+ /// شناسه طرف قرارداد
+ ///
+ public long ContractingPartyId { get; set; }
+
+}
+
+///
+/// کلاس ثبت کارفرمای حقوقی در گردش کار - شامل اطلاعات شرکت و مدیرعامل
+///
+public class CreateLegalEmployerWorkflowRegistration
+{
+ ///
+ /// نام شرکت
+ ///
+ public string CompanyName { get; set; }
+
+ ///
+ /// شماره ثبت
+ ///
+ public string RegisterId { get; set; }
+
+ ///
+ /// شناسه ملی شرکت
+ ///
+ public string NationalId { get; set; }
+
+ ///
+ /// جنسیت
+ ///
+ public Gender Gender { get; set; }
+
+ ///
+ /// وضعیت احراز هویت
+ ///
+ public bool IsAuth { get; set; }
+
+ ///
+ /// کد ملی مدیرعامل
+ ///
+ public string CeoNationalCode { get; set; }
+
+ ///
+ /// شماره شناسنامه مدیرعامل
+ ///
+ public string CeoIdNumber { get; set; }
+
+ ///
+ /// نام مدیرعامل
+ ///
+ public string CeoFName { get; set; }
+
+ ///
+ /// نام خانوادگی مدیرعامل
+ ///
+ public string CeoLName { get; set; }
+
+ ///
+ /// نام پدر مدیرعامل
+ ///
+ public string CeoFatherName { get; set; }
+
+ ///
+ /// تاریخ تولد مدیرعامل
+ ///
+ public string CeoDateOfBirth { get; set; }
+
+ ///
+ /// محل صدور شناسنامه مدیرعامل
+ ///
+ public string CeoPlaceOfIssue { get; set; }
+
+ ///
+ /// تاریخ صدور شناسنامه مدیرعامل
+ ///
+ public string CeoDateOfIssue { get; set; }
+
+ ///
+ /// شماره موبایل
+ ///
+ public string PhoneNumber { get; set; }
+
+ ///
+ /// شماره تلفن ثابت
+ ///
+ public string TelephoneNumber { get; set; }
+
+ ///
+ /// اطلاعات سیستم دولتی
+ ///
+ public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
+
+ public string IdNumberSeri { get; set; }
+ public string IdNumberSerial { get; set; }
+}
+
+///
+/// کلاس ثبت کارفرمای حقیقی در گردش کار - شامل اطلاعات شخصی کارفرما
+///
+public class CreateRealEmployerWorkflowRegistration
+{
+ ///
+ /// جنسیت
+ ///
+ public Gender Gender { get; set; }
+
+ ///
+ /// وضعیت احراز هویت
+ ///
+ public bool IsAuth { get; set; }
+
+ ///
+ /// کد ملی
+ ///
+ public string NationalCode { get; set; }
+
+ ///
+ /// شماره شناسنامه
+ ///
+ public string IdNumber { get; set; }
+
+ ///
+ /// نام
+ ///
+ public string FName { get; set; }
+
+ ///
+ /// نام خانوادگی
+ ///
+ public string LName { get; set; }
+
+ ///
+ /// نام پدر
+ ///
+ public string FatherName { get; set; }
+
+ ///
+ /// تاریخ تولد
+ ///
+ public string DateOfBirth { get; set; }
+
+ ///
+ /// شماره موبایل
+ ///
+ public string PhoneNumber { get; set; }
+
+ ///
+ /// محل صدور شناسنامه
+ ///
+ public string PlaceOfIssue { get; set; }
+
+ ///
+ /// تاریخ صدور شناسنامه
+ ///
+ public string DateOfIssue { get; set; }
+
+ ///
+ /// اطلاعات سیستم دولتی
+ ///
+ public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
+
+ ///
+ /// شماره تلفن
+ ///
+ public string Telephone { get; set; }
+
+ public string IdNumberSeri { get; set; }
+ public string IdNumberSerial { get; set; }
+}
+
+///
+/// کلاس ویرایش کارفرما در گردش کار - شامل اطلاعات کارفرمای حقیقی و حقوقی
+///
+public class EditEmployerWorkflowRegistration : CreateEmployerWorkflowRegistration
+{
+ ///
+ /// شناسه کارفرما
+ ///
+ public long EmployerId { get; set; }
+}
diff --git a/CompanyManagment.App.Contracts/FinancialStatment/ClientFinancialStatementViewModel.cs b/CompanyManagment.App.Contracts/FinancialStatment/ClientFinancialStatementViewModel.cs
new file mode 100644
index 00000000..bc1565fe
--- /dev/null
+++ b/CompanyManagment.App.Contracts/FinancialStatment/ClientFinancialStatementViewModel.cs
@@ -0,0 +1,34 @@
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.FinancialStatment;
+
+public class ClientFinancialStatementViewModel
+{
+ ///
+ /// آیدی FinancialStatement
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// نام طرف حساب
+ ///
+ public string ContractingPartyName { get; set; }
+
+ ///
+ /// جمع بدهکاری
+ ///
+ public double TotalDebt { get; set; }
+ ///
+ /// جمع بستانکاری
+ ///
+ public double TotalCredit { get; set; }
+ ///
+ /// مبلغ قابل پرداخت
+ ///
+ public double TotalAmountPayable { get; set; }
+
+ ///
+ /// تراکنش ها
+ ///
+ public List Transactions { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/FinancialStatment/FinancialStatementSearchModel.cs b/CompanyManagment.App.Contracts/FinancialStatment/FinancialStatementSearchModel.cs
new file mode 100644
index 00000000..f8e58adc
--- /dev/null
+++ b/CompanyManagment.App.Contracts/FinancialStatment/FinancialStatementSearchModel.cs
@@ -0,0 +1,27 @@
+namespace CompanyManagment.App.Contracts.FinancialStatment;
+
+public class FinancialStatementSearchModel
+{
+ ///
+ /// از تاریخ
+ ///
+ public string FromDate { get; set; }
+ ///
+ /// تا تاریخ
+ ///
+ public string ToDate { get; set; }
+ ///
+ /// از مبلغ
+ ///
+ public double FromAmount { get; set; }
+ ///
+ /// تا مبلغ
+ ///
+ public double ToAmount { get; set; }
+ ///
+ /// نوع عملیات تراکنش
+ ///
+ public FinancialTransactionType? Type { get; set; }
+
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/FinancialStatment/FinancialTransactionDetailViewModel.cs b/CompanyManagment.App.Contracts/FinancialStatment/FinancialTransactionDetailViewModel.cs
new file mode 100644
index 00000000..4a0f8fb1
--- /dev/null
+++ b/CompanyManagment.App.Contracts/FinancialStatment/FinancialTransactionDetailViewModel.cs
@@ -0,0 +1,45 @@
+using System;
+
+namespace CompanyManagment.App.Contracts.FinancialStatment;
+
+public class FinancialTransactionDetailViewModel
+{
+ public long Id { get; set; }
+ ///
+ /// زمان و تاریخ میلادی
+ ///
+ public DateTime DateTimeGr { get; set; }
+ ///
+ /// تاریخ
+ ///
+ public string DateFa { get; set; }
+ ///
+ /// زمان
+ ///
+ public string TimeFa { get; set; }
+ ///
+ /// شرح
+ ///
+ public string Description { get; set; }
+ ///
+ /// نوع عملیات پرداخت
+ ///
+ public FinancialTransactionType Type { get; set; }
+
+ ///
+ /// نوع عملیات پرداخت به صورت استرینگ
+ ///
+ public string TypeStr { get; set; }
+ ///
+ /// بدهکار
+ ///
+ public double Debtor { get; set; }
+ ///
+ /// بستانکار
+ ///
+ public double Creditor { get; set; }
+ ///
+ /// باقی مانده
+ ///
+ public double Balance { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/FinancialStatment/FinancialTransactionType.cs b/CompanyManagment.App.Contracts/FinancialStatment/FinancialTransactionType.cs
new file mode 100644
index 00000000..a07cc5a7
--- /dev/null
+++ b/CompanyManagment.App.Contracts/FinancialStatment/FinancialTransactionType.cs
@@ -0,0 +1,13 @@
+namespace CompanyManagment.App.Contracts.FinancialStatment;
+
+public enum FinancialTransactionType
+{
+ ///
+ /// ایجاد درآمد
+ ///
+ Debt,
+ ///
+ /// دریافت درآمد
+ ///
+ Credit
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/FinancialStatment/IFinancialStatmentApplication.cs b/CompanyManagment.App.Contracts/FinancialStatment/IFinancialStatmentApplication.cs
index d2ac6498..749a38a8 100644
--- a/CompanyManagment.App.Contracts/FinancialStatment/IFinancialStatmentApplication.cs
+++ b/CompanyManagment.App.Contracts/FinancialStatment/IFinancialStatmentApplication.cs
@@ -1,16 +1,105 @@
using System;
+using _0_Framework.Application;
+using CompanyManagment.App.Contracts.FinancilTransaction;
+using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-using _0_Framework.Application;
namespace CompanyManagment.App.Contracts.FinancialStatment;
public interface IFinancialStatmentApplication
{
+ ///
+ /// ایجاد سند مالی از طریق درگاه بانکی
+ ///
+ ///
+ ///
+ OperationResult CreateFromBankGateway(CreateFinancialStatment command);
OperationResult Create(CreateFinancialStatment command);
List Search(FinancialStatmentSearchModel searchModel);
+ [Obsolete("این متد منسوخ شده است. لطفاً از متد GetDetailsByContractingParty استفاده کنید.")]
FinancialStatmentViewModel GetDetailsByContractingPartyId(long contractingPartyId);
-}
\ No newline at end of file
+
+ ///
+ /// نمایش اطلاعات صورت حساب مالی کلاینت
+ ///
+ ///
+ ///
+ /// مدل صورت حساب مالی کلاینت
+ Task GetClientFinancialStatement(FinancialStatementSearchModel searchModel,
+ long accountId);
+
+
+ ///
+ /// نمایش اطلاعات صورت حساب مالی کلاینت بر اساس کد هش
+ ///
+ ///
+ ///
+ Task> GetDetailsByPublicId(string publicId);
+
+ ///
+ /// مقدار مانده صورت حساب مالی را برمی گرداند
+ ///
+ ///
+ ///
+ Task GetBalanceAmount(long id);
+
+ ///
+ /// مقدار بدهی کلاینت را برمی گرداند
+ ///
+ ///
+ ///
+ Task GetClientDebtAmount(long accountId);
+
+ ///
+ /// جزئیات بر اساس
+ ///
+ ///
+ ///
+ ///
+ Task GetDetailsByContractingParty(long contractingPartyId,
+ FinancialStatementSearchModel searchModel);
+}
+
+public class FinancialStatmentDetailsByContractingPartyViewModel
+{
+ ///
+ /// آیدی FinancialStatement
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// نام طرف حساب
+ ///
+ public string ContractingPartyName { get; set; }
+
+ ///
+ /// جمع بدهکاری
+ ///
+ public double TotalDebt { get; set; }
+ ///
+ /// جمع بستانکاری
+ ///
+ public double TotalCredit { get; set; }
+ ///
+ /// مبلغ قابل پرداخت
+ ///
+ public double TotalAmountPayable { get; set; }
+
+ ///
+ /// تراکنش ها
+ ///
+ public List List { get; set; }
+}
+
+public class GetFinancialStatementBalanceAmount
+{
+ ///
+ /// مبلغ
+ ///
+ public double Amount { get; set; }
+ public long ContractingPartyId { get; set; }
+}
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContract.cs b/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContract.cs
index 8b24f384..7866ecf7 100644
--- a/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContract.cs
+++ b/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContract.cs
@@ -8,6 +8,7 @@ namespace CompanyManagment.App.Contracts.InstitutionContract;
public class CreateInstitutionContract
{
+ public long LawId { get; set; }
public string ContractNo { get; set; }
[Required(ErrorMessage = "انتخاب معرف اجباری است")]
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContractRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContractRequest.cs
new file mode 100644
index 00000000..3cebc401
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContractRequest.cs
@@ -0,0 +1,319 @@
+using System.Collections.Generic;
+using System.Security.AccessControl;
+using _0_Framework.Application;
+using _0_Framework.Application.Enums;
+using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
+using CompanyManagment.App.Contracts.Workshop;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+
+
+///
+/// درخواست ایجاد قرارداد نهاد
+///
+public class CreateInstitutionContractRequest
+{
+ ///
+ /// نوع حقوقی طرف قرارداد (حقیقی یا حقوقی)
+ ///
+ public LegalType ContractingPartyLegalType { get; set; }
+
+ ///
+ /// اطلاعات شخص حقیقی
+ ///
+ public CreateInstitutionContractRealPartyRequest RealParty { get; set; }
+
+ ///
+ /// اطلاعات شخص حقوقی
+ ///
+ public CreateInstitutionContractLegalPartyRequest LegalParty { get; set; }
+
+ ///
+ /// آیدی معرف
+ ///
+ public long RepresentativeId { get; set; }
+
+ ///
+ /// مدت زمان قرارداد
+ ///
+ public InstitutionContractDuration Duration { get; set; }
+
+ ///
+ /// استان
+ ///
+ public string Province { get; set; }
+
+ ///
+ /// شهر
+ ///
+ public string City { get; set; }
+
+ ///
+ /// آدرس
+ ///
+ public string Address { get; set; }
+
+ ///
+ /// اطلاعات تماس
+ ///
+ public List ContactInfos { get; set; }
+
+ ///
+ /// لیست کارگاههای مورد نظر برای قرارداد
+ ///
+ public List Workshops { get; set; }
+
+ ///
+ /// تاریخ شروع قرارداد (فارسی)
+ ///
+ public string ContractStartFa { get; set; }
+
+ ///
+ /// مبلغ خسارت روزانه
+ ///
+ public double DailyCompensation { get; set; }
+
+ ///
+ /// وجه التزام
+ ///
+ public double Obligation { get; set; }
+
+ ///
+ /// توضیحات
+ ///
+ public string Description { get; set; }
+
+ ///
+ /// مبلغ کل قرارداد
+ ///
+ public double TotalAmount { get; set; }
+
+ ///
+ /// آیا قرارداد اقساطی است؟
+ ///
+ public bool IsInstallment { get; set; }
+
+ ///
+ /// مالیات ارزش افزوده
+ ///
+ public double TaxAmount { get; set; }
+
+ public double OneMonthAmount { get; set; }
+
+ public long LawId { get; set; }
+}
+///
+/// مدت زمان قرارداد نهاد
+///
+public enum InstitutionContractDuration
+{
+ ///
+ /// یک ماهه
+ ///
+ OneMonth = 1,
+
+ ///
+ /// سه ماهه
+ ///
+ ThreeMonths = 3,
+
+ ///
+ /// شش ماهه
+ ///
+ SixMonths = 6,
+
+ ///
+ /// دوازده ماهه
+ ///
+ TwelveMonths = 12
+}
+
+///
+/// جزئیات کارگاه در درخواست ایجاد قرارداد نهاد
+///
+public class CreateInstitutionContractWorkshopDetail
+{
+ ///
+ /// شناسه کارگاه (اختیاری - در صورت وجود کارگاه از قبل)
+ ///
+ public long? WorkshopId { get; set; }
+
+ ///
+ /// نام کارگاه
+ ///
+ public string WorkshopName { get; set; }
+
+ ///
+ /// پلن حضور و غیاب
+ ///
+ public bool HasRollCallPlan { get; set; }
+
+ ///
+ /// پلن فیش غیر رسمی
+ ///
+ public bool HasCustomizeCheckoutPlan { get; set; }
+
+ ///
+ /// پلن قرارداد و تصفیه
+ ///
+ public bool HasContractPlan { get; set; }
+
+ ///
+ /// پلن قرارداد و تصفیه حضوری
+ ///
+ public bool HasContractPlanInPerson { get; set; }
+
+ ///
+ /// پلن بیمه
+ ///
+ public bool HasInsurancePlan { get; set; }
+ ///
+ /// پلن بیمه حضوری
+ ///
+ public bool HasInsurancePlanInPerson { get; set; }
+
+ ///
+ /// تعداد پرسنل کارگاه
+ ///
+ public int PersonnelCount { get; set; }
+
+ ///
+ /// مبلغ
+ ///
+ public double Price { get; set; }
+}
+
+///
+/// درخواست ایجاد طرف حقیقی در قرارداد نهاد
+///
+public class CreateInstitutionContractRealPartyRequest
+{
+ ///
+ /// کد ملی
+ ///
+ public string NationalCode { get; set; }
+
+ ///
+ /// تاریخ تولد فارسی
+ ///
+ public string BirthDateFa { get; set; }
+
+ ///
+ /// شماره تلفن
+ ///
+ public string PhoneNumber { get; set; }
+
+ ///
+ /// وضعیت احراز هویت
+ ///
+ public bool IsAuth { get; set; }
+
+ ///
+ /// نام
+ ///
+ public string FName { get; set; }
+
+ ///
+ /// نام خانوادگی
+ ///
+ public string LName { get; set; }
+
+ ///
+ /// نام پدر
+ ///
+ public string FatherName { get; set; }
+
+ ///
+ /// شماره شناسنامه
+ ///
+ public string IdNumber { get; set; }
+
+ ///
+ /// شناسه موقت طرف قرارداد
+ ///
+ public long ContractingPartyTempId { get; set; }
+
+ ///
+ /// جنسیت
+ ///
+ public Gender Gender { get; set; }
+
+
+}
+
+///
+/// درخواست ایجاد طرف حقوقی در قرارداد نهاد
+///
+public class CreateInstitutionContractLegalPartyRequest
+{
+ ///
+ /// نام شرکت
+ ///
+ public string CompanyName { get; set; }
+
+ ///
+ /// شماره ثبت
+ ///
+ public string RegisterId { get; set; }
+
+ ///
+ /// شناسه ملی شرکت
+ ///
+ public string NationalId { get; set; }
+
+ ///
+ /// شماره تلفن شرکت
+ ///
+ public string PhoneNumber { get; set; }
+
+ ///
+ /// شناسه موقت طرف قرارداد
+ ///
+ public long ContractingPartyTempId { get; set; }
+
+ ///
+ /// کد ملی نماینده قانونی
+ ///
+ public string NationalCode { get; set; }
+
+ ///
+ /// تاریخ تولد نماینده قانونی فارسی
+ ///
+ public string BirthDateFa { get; set; }
+
+ ///
+ /// نام نماینده قانونی
+ ///
+ public string FName { get; set; }
+
+ ///
+ /// نام خانوادگی نماینده قانونی
+ ///
+ public string LName { get; set; }
+
+ ///
+ /// نام پدر نماینده قانونی
+ ///
+ public string FatherName { get; set; }
+
+ ///
+ /// شماره شناسنامه نماینده قانونی
+ ///
+ public string IdNumber { get; set; }
+
+ ///
+ /// وضعیت احراز هویت نماینده قانونی
+ ///
+ public bool IsAuth { get; set; }
+
+ ///
+ /// سمت نماینده قانونی در شرکت
+ ///
+ public string Position { get; set; }
+
+ ///
+ /// جنسیت نماینده قانونی
+ ///
+ public Gender Gender { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/EditInstitutionContractRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/EditInstitutionContractRequest.cs
new file mode 100644
index 00000000..4f6d26b8
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/EditInstitutionContractRequest.cs
@@ -0,0 +1,7 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class EditInstitutionContractRequest:CreateInstitutionContractRequest
+{
+ public long Id { get; set; }
+ public long ContractingPartyId { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/ExtenstionInstitutionContractRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/ExtenstionInstitutionContractRequest.cs
new file mode 100644
index 00000000..ddb67145
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/ExtenstionInstitutionContractRequest.cs
@@ -0,0 +1,13 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+///
+/// درخواست تمدید قرارداد مؤسسه
+/// شامل اطلاعات قرارداد قبلی برای فرآیند تمدید
+///
+public class ExtenstionInstitutionContractRequest : EditInstitutionContractRequest
+{
+ ///
+ /// شناسه قرارداد قبلی که قرار است تمدید شود
+ ///
+ public long PreviousContractId { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionContractListItemsViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionContractListItemsViewModel.cs
new file mode 100644
index 00000000..123dc18a
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionContractListItemsViewModel.cs
@@ -0,0 +1,125 @@
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class GetInstitutionContractListItemsViewModel
+{
+ ///
+ /// آیدی
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// دارای امضا
+ ///
+ public bool HasSigniture { get; set; }
+
+ ///
+ /// شماره قرارداد
+ ///
+ public string ContractNo { get; set; }
+
+ ///
+ /// نام معرف
+ ///
+ public string RepresentativeName { get; set; }
+
+ ///
+ /// نام طرف حساب
+ ///
+ public string ContractingPartyName { get; set; }
+
+ ///
+ /// شماره کارفرما
+ ///
+ public string ArchiveNo { get; set; }
+
+ ///
+ /// نام کارفرماها
+ ///
+ public List EmployerNames { get; set; }
+
+ ///
+ /// تعداد کارگاه
+ ///
+ public int WorkshopsCount { get; set; }
+
+ ///
+ /// نام کارگاه ها
+ ///
+ public List WorkshopNames { get; set; }
+
+ ///
+ /// تعداد پرسنل
+ ///
+ public int EmployeesCount { get; set; }
+
+ ///
+ /// شروع قرارداد
+ ///
+ public string ContractStartFa { get; set; }
+
+ ///
+ /// پایان قرارداد
+ ///
+ public string ContractEndFa { get; set; }
+
+ ///
+ /// مبلغ قرارداد
+ ///
+ public double ContractAmount { get; set; }
+
+ ///
+ /// وضعیت مالی
+ ///
+ public double Balance { get; set; }
+
+ ///
+ /// وضعیت قرارداد
+ ///
+ public InstitutionContractListStatus ListStatus { get; set; }
+
+ ///
+ /// آیا منقضی شده است
+ ///
+ public bool IsExpired { get; set; }
+
+ public long ContractingPartyId { get; set; }
+
+ public List Workshops { get; set; }
+
+ public bool IsInPersonContract { get; set; }
+
+ public bool IsOldContract { get; set; }
+}
+
+public class InstitutionContractListWorkshop
+{
+ public string WorkshopName { get; set; }
+ public int EmployeeCount { get; set; }
+ public WorkshopServicesViewModel WorkshopServices { get; set; }
+}
+
+public class WorkshopServicesViewModel
+{
+ public bool Insurance { get; set; }
+ public string InsuranceLabel => "ارسال لیست بیمه";
+
+ public bool InsuranceInPerson { get; set; }
+ public string InsuranceInPersonLabel => "خدمات مستقیم";
+
+ public bool Contract { get; set; }
+ public string ContractLabel => "قرارداد و تصفیه حساب";
+
+ public bool ContractInPerson { get; set; }
+ public string ContractInPersonLabel => "خدمات مستقیم";
+
+ public bool RollCall { get; set; }
+ public string RollCallLabel => "ساعت حضور و غیاب";
+
+ public bool RollCallInPerson { get; set; }
+ public string RollCallInPersonLabel => "خدمات مستقیم";
+
+ public bool CustomizeCheckout { get; set; }
+ public string CustomizeCheckoutLabel => "فیش غیر رسمی";
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionContractListStatsViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionContractListStatsViewModel.cs
new file mode 100644
index 00000000..4c47e047
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionContractListStatsViewModel.cs
@@ -0,0 +1,27 @@
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class GetInstitutionContractListStatsViewModel
+{
+ ///
+ /// مجموع بدهی قراردادهای مؤسسه
+ /// این ویژگی بدهیهای قراردادهای مربوطه را تجمیع میکند و
+ /// یک معیار واحد برای اندازهگیری تعهدات مالی ارائه میدهد
+ ///
+ public double TotalDebt { get; set; }
+
+ ///
+ /// مجموع ارزش پولی مرتبط با قراردادهای مؤسسه
+ /// این ویژگی مبلغ کل قراردادهای مربوطه را برای
+ /// گزارشگیری و تجزیه و تحلیل مالی تجمیع میکند
+ ///
+ public double TotalAmount { get; set; }
+
+ ///
+ /// مجموعهای از تعداد قراردادهای مؤسسه دستهبندی شده بر اساس وضعیت
+ /// این ویژگی تعداد قراردادها را برای هر وضعیت تعریف شده در
+ /// شمارش InstitutionContractStatus ارائه میدهد که امکان تجزیه و تحلیل و نظارت بر توزیع قراردادها را فراهم میکند
+ ///
+ public List Counts { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionContractListViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionContractListViewModel.cs
new file mode 100644
index 00000000..2210e2a7
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionContractListViewModel.cs
@@ -0,0 +1,22 @@
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+///
+/// لیست قرارداد های موسسه
+///
+public class GetInstitutionContractListViewModel
+{
+ ///
+ /// بدهی کل
+ ///
+ public double TotalDebt { get; set; }
+
+ ///
+ /// مبلغ قرارداد ها
+ ///
+ public double TotalAmount { get; set; }
+
+ public List Items { get; set; }
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionVerificationDetailsViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionVerificationDetailsViewModel.cs
new file mode 100644
index 00000000..0e3cc092
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionVerificationDetailsViewModel.cs
@@ -0,0 +1,31 @@
+using _0_Framework.Application.Enums;
+
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class GetInstitutionVerificationDetailsViewModel
+{
+ public InstitutionContratVerificationParty FirstParty { get; set; }
+ public InstitutionContratVerificationParty SecondParty { get; set; }
+ public string ContractNo { get; set; }
+ public string CreationDate { get; set; }
+ public string ContractStart { get; set; }
+ public string ContractEnd { get; set; }
+ public List Workshops { get; set; }
+ public string TotalPrice { get; set; }
+ public string TaxPrice { get; set; }
+ public string PaymentPrice { get; set; }
+ public List Installments { get; set; }
+ public bool IsInstallment { get; set; }
+}
+public class InstitutionContratVerificationParty
+{
+ public string CompanyNameOrFullName { get; set; }
+ public string NationalCodeOrNationalId { get; set; }
+ public string CeoName { get; set; }
+ public string Address { get; set; }
+ public string PostalCode { get; set; }
+ public string PhoneNumber { get; set; }
+ public LegalType LegalType { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionVerificationDetailsWorkshopsViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionVerificationDetailsWorkshopsViewModel.cs
new file mode 100644
index 00000000..cd1ef514
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/GetInstitutionVerificationDetailsWorkshopsViewModel.cs
@@ -0,0 +1,9 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class GetInstitutionVerificationDetailsWorkshopsViewModel
+{
+ public string Name { get; set; }
+ public int PersonnelCount { get; set; }
+ public WorkshopServicesViewModel Services { get; set; }
+ public string Price { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs b/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs
index 342ad846..92463672 100644
--- a/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs
+++ b/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs
@@ -1,33 +1,334 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
using _0_Framework.Application;
+using _0_Framework.Application.Sms;
using CompanyManagment.App.Contracts.Checkout;
+using CompanyManagment.App.Contracts.Law;
+using CompanyManagment.App.Contracts.TemporaryClientRegistration;
+using CompanyManagment.App.Contracts.Workshop;
+using CompanyManagment.App.Contracts.WorkshopPlan;
+using Microsoft.AspNetCore.Mvc;
namespace CompanyManagment.App.Contracts.InstitutionContract;
+///
+/// رابط اپلیکیشن قراردادهای مؤسسه
+/// مدیریت عملیات مربوط به قراردادهای مالی مؤسسات
+///
public interface IInstitutionContractApplication
{
+ ///
+ /// ایجاد قرارداد جدید
+ ///
+ /// اطلاعات قرارداد جدید
+ /// نتیجه عملیات
OperationResult Create(CreateInstitutionContract command);
- OperationResult Extension(CreateInstitutionContract command);
+
+ ///
+ /// تمدید قرارداد موجود
+ ///
+ /// اطلاعات قرارداد برای تمدید
+ /// نتیجه عملیات
+ OperationResult Extension(CreateInstitutionContract command);
+
+ ///
+ /// ویرایش قرارداد موجود
+ ///
+ /// اطلاعات جدید قرارداد
+ /// نتیجه عملیات
OperationResult Edit(EditInstitutionContract command);
+
+ ///
+ /// دریافت جزئیات قرارداد برای ویرایش
+ ///
+ /// شناسه قرارداد
+ /// اطلاعات قرارداد
EditInstitutionContract GetDetails(long id);
+ ///
+ /// جستجو در قراردادها
+ ///
+ /// مدل جستجو
+ /// لیست قراردادها
List Search(InstitutionContractSearchModel searchModel);
+
+ ///
+ /// جستجوی جدید در قراردادها
+ ///
+ /// مدل جستجو
+ /// لیست قراردادها
List NewSearch(InstitutionContractSearchModel searchModel);
+
+ ///
+ /// دریافت اطلاعات قرارداد های مالی فعال
+ ///دارای کارگاه
+ /// جهت ست کردن سرویس ها از طریق اکسل
+ ///
+ ///
+ List GetInstitutionContractToSetServicesExcelImport();
+
+ ///
+ /// چاپ مجموعه قراردادها
+ ///
+ /// لیست شناسه قراردادها
+ /// لیست قراردادها برای چاپ
List PrintAll(List id);
+
+
+ [Obsolete("استفاده نشود، از متد غیرهمزمان استفاده شود")]
+ ///
+ /// چاپ یک قرارداد
+ ///
+ /// شناسه قرارداد
+ /// اطلاعات قرارداد برای چاپ
InstitutionContractViewModel PrintOne(long id);
+
+ ///
+ /// فعال کردن قرارداد
+ ///
+ /// شناسه قرارداد
+ /// نتیجه عملیات
OperationResult Active(long id);
+
+ ///
+ /// غیرفعال کردن قرارداد
+ ///
+ /// شناسه قرارداد
+ /// نتیجه عملیات
OperationResult DeActive(long id);
+
+ ///
+ /// غیرفعال کردن قرارداد (حالت آبی)
+ ///
+ /// شناسه قرارداد
+ /// نتیجه عملیات
OperationResult DeActiveBlue(long id);
+
+ ///
+ /// غیرفعال کردن تمام اتصالات قرارداد
+ ///
+ /// شناسه قرارداد
+ /// نتیجه عملیات
OperationResult DeActiveAllConnections(long id);
+
+ ///
+ /// فعال کردن مجدد تمام اتصالات قرارداد
+ ///
+ /// شناسه قرارداد
+ /// نتیجه عملیات
OperationResult ReActiveAllConnections(long id);
+
+ ///
+ /// فعال کردن مجدد تمام قراردادها بعد از ایجاد قرارداد جدید
+ ///
+ /// شناسه طرف قرارداد
void ReActiveAllAfterCreateNew(long contractingPartyId);
+
+ ///
+ /// حذف قرارداد
+ ///
+ /// شناسه قرارداد
void RemoveContract(long id);
+ ///
+ /// امضای قرارداد
+ ///
+ /// شناسه قرارداد
+ /// نتیجه عملیات
OperationResult Sign(long id);
+
+ ///
+ /// لغو امضای قرارداد
+ ///
+ /// شناسه قرارداد
+ /// نتیجه عملیات
OperationResult UnSign(long id);
+
+ ///
+ /// ایجاد حساب کاربری برای طرف قرارداد
+ ///
+ /// شناسه طرف قرارداد
+ /// شناسه حساب کاربری
void CreateContractingPartyAccount(long contractingPartyid, long accountId);
+ ///
+ /// محاسبه مبلغ قرارداد بر اساس تعداد افراد
+ ///
+ /// تعداد افراد
+ /// مبلغ قرارداد
double GetcontractAmount(int countPerson);
+
+ #region Api
+
+ ///
+ /// لیست قرارداد های مالی
+ ///
+ ///
+ ///
+ Task> GetList
+ (InstitutionContractListSearchModel searchModel);
+
+ ///
+ /// وضعیت لیست کلی
+ ///
+ ///
+ ///
+ Task GetListStats(InstitutionContractListSearchModel searchModel);
+
+ ///
+ /// ایجاد
+ ///
+ ///
+ ///
+ Task CreateAsync(CreateInstitutionContractRequest command);
+
+ ///
+ /// ویرایش
+ ///
+ ///
+ ///
+ Task EditAsync(EditInstitutionContractRequest command);
+
+
+ ///
+ /// دریافت لیست طرف حساب هایی که ثبت نام آنها تکمیل شده
+ /// جهت نمایش در کارپوشه
+ ///
+ ///
+ Task> RegistrationWorkflowMainList();
+ ///
+ /// دریافت آیتم های کارپوشه ثبت نام
+ ///
+ ///
+ ///
+ Task> RegistrationWorkflowItems(long institutionContractId);
+
+
+
+ #endregion
+
+ Task GetVerificationDetails(Guid id);
+ Task> SendVerifyOtp(Guid id);
+ Task VerifyOtp(Guid publicId, string code);
+ Task GetWorkshopInitialDetails(long workshopDetailsId);
+
+ #region Extension
+
+ Task GetExtensionInquiry(long previousContractId);
+
+ Task GetExtensionWorkshops(
+ InstitutionContractExtensionWorkshopsRequest request);
+
+ Task GetExtensionInstitutionPlan(
+ InstitutionContractExtensionPlanRequest request);
+
+ Task GetExtensionPaymentMethod(
+ InstitutionContractExtensionPaymentRequest request);
+
+ Task ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
+ Task> GetInstitutionContractSelectList(string search,string selected);
+
+ #endregion
+
+ #region Upgrade (Amendment)
+
+ Task GetAmendmentWorkshops(long institutionContractId);
+ Task InsertAmendmentTempWorkshops(InstitutionContractAmendmentTempWorkshopViewModel request);
+ Task RemoveAmendmentWorkshops(Guid workshopTempId);
+ Task GetAmendmentPaymentDetails(InsitutionContractAmendmentPaymentRequest request);
+
+ #endregion
+
+ Task ResendVerifyLink(long institutionContractId);
+
+ ///
+ /// دیتای پرینت قرارداد مالی
+ ///
+ ///
+ ///
+ Task PrintOneAsync(long id);
+}
+
+public class InstitutionContractPrintViewModel
+{
+ public InstitutionContratVerificationParty FirstParty { get; set; }
+ public InstitutionContratVerificationParty SecondParty { get; set; }
+ public string ContractNo { get; set; }
+ public string CreationDate { get; set; }
+ public string ContractStart { get; set; }
+ public string ContractEnd { get; set; }
+ public List Workshops { get; set; }
+ public string TotalPrice { get; set; }
+ public string TaxPrice { get; set; }
+ public string PaymentPrice { get; set; }
+ public string VerifyCode { get; set; }
+ public string VerifyDate { get; set; }
+ public string VerifyTime { get; set; }
+ public string VerifierFullName { get; set; }
+ public string VerifierPhoneNumber { get; set; }
+ public LawViewModel LawViewModel { get; set; }
+ public string Obligation { get; set; }
+}
+
+public class InsertAmendmentTempWorkshopResponse
+{
+ public Guid WorkshopTempId { get; set; }
+ public string Amount { get; set; }
+}
+
+public class InstitutionContractAmendmentWorkshopsResponse
+{
+ ///
+ ///
+ ///
+ public List Workshops { get; set; }
+
+ public Guid TempId { get; set; }
+
+}
+
+public class InstitutionContractSelectListViewModel : SelectListViewModel;
+
+public class InstitutionContractExtensionInquiryResponse
+{
+ public long Id { get; set; }
+ public string FName { get; set; }
+ public string LName { get; set; }
+ public string DateOfBirthFa { get; set; }
+ public string FatherName { get; set; }
+ public string IdNumberSerial { get; set; }
+ public string IdNumber { get; set; }
+ public string Address { get; set; }
+ public string Phone { get; set; }
+ public string City { get; set; }
+ public string State { get; set; }
+ public long RepresentativeId { get; set; }
+ public string NationalCode { get; set; }
+}
+
+
+
+public class InstitutionContractExtensionPaymentMonthly:InstitutionContractExtensionPaymentOneTime
+{
+ public List Installments { get; set; }
+}
+
+public class InstitutionContractExtensionPaymentOneTime
+{
+ ///
+ /// مجموع مبالغ
+ ///
+ public string TotalAmount { get; set; }
+ ///
+ /// ارزش افزوده
+ ///
+ public string Tax { get; set; }
+ ///
+ /// مبلغ قابل پرداخت
+ ///
+ public string PaymentAmount { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InsitutionContractAmendmentPaymentRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/InsitutionContractAmendmentPaymentRequest.cs
new file mode 100644
index 00000000..c1444835
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InsitutionContractAmendmentPaymentRequest.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using CompanyManagment.App.Contracts.TemporaryClientRegistration;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InsitutionContractAmendmentPaymentRequest
+{
+ public Guid TempId { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InsitutionContractAmendmentPaymentResponse.cs b/CompanyManagment.App.Contracts/InstitutionContract/InsitutionContractAmendmentPaymentResponse.cs
new file mode 100644
index 00000000..f6a90dc4
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InsitutionContractAmendmentPaymentResponse.cs
@@ -0,0 +1,11 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InsitutionContractAmendmentPaymentResponse
+{
+ public InstitutionContractPaymentOneTimeViewModel OneTime { get; set; }
+ public InstitutionContractPaymentMonthlyViewModel Monthly { get; set; }
+ public string ContractStart { get; set; }
+ public string ContractEnd { get; set; }
+ public string OneMonthAmount { get; set; }
+ public string TotalAmount { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractAmendmentTempWorkshopViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractAmendmentTempWorkshopViewModel.cs
new file mode 100644
index 00000000..242d6287
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractAmendmentTempWorkshopViewModel.cs
@@ -0,0 +1,64 @@
+using System;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractAmendmentTempWorkshopViewModel
+{
+ public Guid TempId { get; set; }
+
+ public Guid WorkshopTempId { get; set; }
+
+ public long CurrentWorkshopId { get; set; }
+
+ public long WorkshopId { get; set; }
+
+ ///
+ /// نام کارگاه
+ ///
+ public string WorkshopName { get; set; }
+
+ ///
+ /// تعداد پرسنل
+ ///
+ public int CountPerson { get; set; }
+
+
+ #region ServiceSelection
+
+ ///
+ /// قرارداد و تصفیه
+ ///
+ public bool ContractAndCheckout { get; set; }
+
+ ///
+ /// بیمه
+ ///
+ public bool Insurance { get; set; }
+
+ ///
+ /// حضورغباب
+ ///
+ public bool RollCall { get; set; }
+
+ public bool RollCallInPerson { get; set; }
+
+ ///
+ /// فیش غیر رسمی
+ ///
+ public bool CustomizeCheckout { get; set; }
+
+ ///
+ /// خدمات حضوری قرداد و تصفیه
+ ///
+ public bool ContractAndCheckoutInPerson { get; set; }
+
+ ///
+ /// خدمات حضوری بیمه
+ ///
+ public bool InsuranceInPerson { get; set; }
+
+ public double Price{ get; set; }
+ public string PriceStr{ get; set; }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionCompleteRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionCompleteRequest.cs
new file mode 100644
index 00000000..f232760c
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionCompleteRequest.cs
@@ -0,0 +1,10 @@
+using System;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractExtensionCompleteRequest
+{
+ public Guid TemporaryId { get; set; }
+ public bool IsInstallment { get; set; }
+ public long LawId { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionInquiryRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionInquiryRequest.cs
new file mode 100644
index 00000000..89578139
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionInquiryRequest.cs
@@ -0,0 +1,9 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractExtensionInquiryRequest
+{
+ public long ContractingPartyId { get; set; }
+ public string NationalCode { get; set; }
+ public string BirthDate { get; set; }
+ public string Mobile { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionInquiryResult.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionInquiryResult.cs
new file mode 100644
index 00000000..b11bcbf8
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionInquiryResult.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using _0_Framework.Application.Enums;
+using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractExtensionInquiryResult
+{
+ ///
+ /// اطلاعات شخص حقیقی
+ ///
+ public CreateInstitutionContractRealPartyRequest RealParty { get; set; }
+
+ ///
+ /// اطلاعات شخص حقوقی
+ ///
+ public CreateInstitutionContractLegalPartyRequest LegalParty { get; set; }
+
+ public LegalType LegalType { get; set; }
+ public Guid TemporaryId { get; set; }
+ public string Address { get; set; }
+ public string City { get; set; }
+ public string Province { get; set; }
+ public List ContactInfoViewModels { get; set; }
+ public long RepresentativeId { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPaymentRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPaymentRequest.cs
new file mode 100644
index 00000000..8406a53a
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPaymentRequest.cs
@@ -0,0 +1,9 @@
+using System;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractExtensionPaymentRequest
+{
+ public InstitutionContractDuration Duration { get; set; }
+ public Guid TempId { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPaymentResponse.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPaymentResponse.cs
new file mode 100644
index 00000000..84906caf
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPaymentResponse.cs
@@ -0,0 +1,8 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractExtensionPaymentResponse
+{
+ public InstitutionContractPaymentOneTimeViewModel OneTime { get; set; }
+ public InstitutionContractPaymentMonthlyViewModel Monthly { get; set; }
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPlanRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPlanRequest.cs
new file mode 100644
index 00000000..40804842
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPlanRequest.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using CompanyManagment.App.Contracts.TemporaryClientRegistration;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractExtensionPlanRequest
+{
+ public List WorkshopTemps { get; set; }
+ public string TotalAmount { get; set; }
+ public Guid TempId { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPlanResponse.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPlanResponse.cs
new file mode 100644
index 00000000..dcdff4ca
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPlanResponse.cs
@@ -0,0 +1,20 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractExtensionPlanResponse
+{
+ public InstitutionContractExtensionPlanDetail OneMonth { get; set; }
+ public InstitutionContractExtensionPlanDetail ThreeMonths { get; set; }
+ public InstitutionContractExtensionPlanDetail SixMonths { get; set; }
+ public InstitutionContractExtensionPlanDetail TwelveMonths { get; set; }
+}
+public class InstitutionContractExtensionPlanDetail
+{
+ public string ContractStart { get; set; }
+ public string ContractEnd { get; set; }
+ public string OneMonthPaymentDiscounted { get; set; }
+ public string OneMonthDiscount { get; set; }
+ public string OneMonthOriginalPayment { get; set; }
+ public string TotalPayment { get; set; }
+ public string DailyCompenseation { get; set; }
+ public string Obligation { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionWorkshopsRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionWorkshopsRequest.cs
new file mode 100644
index 00000000..c741cdf8
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionWorkshopsRequest.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractExtensionWorkshopsRequest
+{
+ public Guid TempId { get; set; }
+ public string City {get; set;}
+ public string Province { get; set; }
+ public string Address { get; set; }
+ public List ContactInfos { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionWorkshopsResponse.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionWorkshopsResponse.cs
new file mode 100644
index 00000000..c8b61061
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionWorkshopsResponse.cs
@@ -0,0 +1,10 @@
+using System.Collections.Generic;
+using CompanyManagment.App.Contracts.TemporaryClientRegistration;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractExtensionWorkshopsResponse
+{
+ public List WorkshopTemps { get; set; }
+ public string TotalAmount { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractInstallmentViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractInstallmentViewModel.cs
new file mode 100644
index 00000000..86655873
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractInstallmentViewModel.cs
@@ -0,0 +1,40 @@
+using System;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+///
+/// مدل نمایش اقساط قرارداد مؤسسه
+/// شامل اطلاعات مربوط به هر قسط از قرارداد
+///
+public class InstitutionContractInstallmentViewModel
+{
+ ///
+ /// شناسه یکتای قسط
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// تاریخ میلادی قسط
+ ///
+ public DateTime InstallmentDateGr { get; set; }
+
+ ///
+ /// تاریخ فارسی قسط
+ ///
+ public string InstallmentDateFa { get; set; }
+
+ ///
+ /// مبلغ قسط
+ ///
+ public string Amount { get; set; }
+
+ ///
+ /// عدد قسط فارسی
+ ///
+ public string InstallmentIndex { get; set; }
+
+ ///
+ /// شناسه قرارداد مؤسسه مربوط به این قسط
+ ///
+ public long InstitutionContractId { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractListSearchModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractListSearchModel.cs
new file mode 100644
index 00000000..c033b124
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractListSearchModel.cs
@@ -0,0 +1,67 @@
+using _0_Framework.Application;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractListSearchModel :PaginationRequest
+{
+ ///
+ /// کارفرما / کارگاه / طرف حساب / معرف
+ ///
+ public string EmployerOrWorkshopOrContractingPartyOrRepresentativeName { get; set; }
+
+ ///
+ /// استان
+ ///
+ public string Province { get; set; }
+
+ ///
+ /// شهر
+ ///
+ public string City { get; set; }
+
+ ///
+ /// مبلغ قرارداد از
+ ///
+ public double AmountFrom { get; set; }
+
+ ///
+ /// مبلغ قرارداد تا
+ ///
+ public double AmountTo { get; set; }
+
+ ///
+ /// تاریخ قرارداد از
+ ///
+ public string ContractDateFrom { get; set; }
+
+ ///
+ /// تاریخ قرارداد تا
+ ///
+ public string ContractDateTo { get; set; }
+
+ ///
+ /// تب
+ ///
+ public InstitutionContractListStatus? Status { get; set; }
+
+ ///
+ /// فعال / غیرفعال
+ ///
+ public bool? IsActive { get; set; }
+
+ ///
+ /// موجود / ناموجود
+ ///
+ public bool? HasSignature { get; set; }
+
+ ///
+ /// نوع = روابط کار / مالیات و حسابداری
+ ///
+ public InstitutionContractType? Type { get; set; }
+
+ ///
+ /// رسمی / غیررسمی
+ ///
+ public bool? IsOfficial { get; set; }
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractListStatus.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractListStatus.cs
new file mode 100644
index 00000000..fa5bd93a
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractListStatus.cs
@@ -0,0 +1,13 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public enum InstitutionContractListStatus
+{
+ Active,
+ Deactive,
+ DeactiveWithDebt,
+ Block,
+ Free,
+ PendingForRenewal,
+ WithoutWorkshop,
+ PendingForVerify
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractPaymentOneTimeViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractPaymentOneTimeViewModel.cs
new file mode 100644
index 00000000..fcc28d47
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractPaymentOneTimeViewModel.cs
@@ -0,0 +1,24 @@
+using System.Collections.Generic;
+using CompanyManagment.App.Contracts.TemporaryClientRegistration;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractPaymentOneTimeViewModel
+{
+ ///
+ /// مجموع مبالغ
+ ///
+ public string TotalAmount { get; set; }
+ ///
+ /// ارزش افزوده
+ ///
+ public string Tax { get; set; }
+ ///
+ /// مبلغ قابل پرداخت
+ ///
+ public string PaymentAmount { get; set; }
+}
+public class InstitutionContractPaymentMonthlyViewModel:InstitutionContractPaymentOneTimeViewModel
+{
+ public List Installments { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractStatusCount.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractStatusCount.cs
new file mode 100644
index 00000000..a6f6bf35
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractStatusCount.cs
@@ -0,0 +1,18 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+///
+/// شمارش وضعیت قراردادهای مؤسسه
+/// نمایش تعداد قراردادها برای هر وضعیت خاص
+///
+public class InstitutionContractStatusCount
+{
+ ///
+ /// وضعیت لیست قرارداد
+ ///
+ public InstitutionContractListStatus ListStatus { get; set; }
+
+ ///
+ /// تعداد قراردادها در این وضعیت
+ ///
+ public int Count { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractType.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractType.cs
new file mode 100644
index 00000000..af958236
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractType.cs
@@ -0,0 +1,13 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public enum InstitutionContractType
+{
+ ///
+ /// روابط کار
+ ///
+ JobRelation,
+ ///
+ /// حسابداری و مالیات
+ ///
+ TaxAndFinancial
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractWorkshopDetailViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractWorkshopDetailViewModel.cs
new file mode 100644
index 00000000..067a8221
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractWorkshopDetailViewModel.cs
@@ -0,0 +1,8 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractWorkshopDetailViewModel
+{
+ public WorkshopServicesViewModel ServicesViewModel { get; set; }
+ public string WorkshopName { get; set; }
+ public int ArchiveCode { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/RegistrationWorkflowMainListViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/RegistrationWorkflowMainListViewModel.cs
new file mode 100644
index 00000000..72c95cdb
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/RegistrationWorkflowMainListViewModel.cs
@@ -0,0 +1,92 @@
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class RegistrationWorkflowMainListViewModel
+{
+ ///
+ /// شناسه قرارداد موسسه
+ ///
+ public long InstitutionContractId { get; set; }
+
+ ///
+ /// نام کامل طرف حساب
+ ///
+ public string ContractingPartyFullName { get; set; }
+
+ ///
+ /// شماره همراه
+ ///
+ public string Phone { get; set; }
+
+ ///
+ /// تعداد کارگاههای انجام شده
+ ///
+ public int DoneWorkshops { get; set; }
+
+ ///
+ /// تعداد کارگاههای انجام نشده
+ ///
+ public int UnDoneWorkshops { get; set; }
+
+ ///
+ /// تعداد کل کارگاهها
+ ///
+ public int TotalWorkshops { get; set; }
+
+ ///
+ /// مبلغ
+ ///
+ public double Amount { get; set; }
+
+ public long ContractingPartyId { get; set; }
+}
+
+///
+/// مدل نمایش آیتمهای گردش کار ثبت نام
+///
+public class RegistrationWorkflowItemsViewModel
+{
+ ///
+ /// لیست کارفرمایان
+ ///
+ public List Employers { get; set; }
+
+ ///
+ /// نام کارگاه
+ ///
+ public string WorkshopName { get; set; }
+
+ ///
+ /// تعداد پرسنل
+ ///
+ public int PersonnelCount { get; set; }
+
+ ///
+ /// قیمت
+ ///
+ public double Price { get; set; }
+
+ ///
+ /// وضعیت انجام شدن
+ ///
+ public bool IsDone { get; set; }
+
+ public long WorkshopDetailsId { get; set; }
+}
+
+///
+/// مدل نمایش کارفرما در آیتمهای گردش کار ثبت نام
+///
+public class RegistrationWorkflowItemsEmployerViewModel
+{
+ ///
+ /// نام و نام خانوادگی
+ ///
+ public string FullName { get; set; }
+
+ ///
+ /// شناسه
+ ///
+ public long Id { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InsuranceJob/IInsuranceJobApplication.cs b/CompanyManagment.App.Contracts/InsuranceJob/IInsuranceJobApplication.cs
index 5f1132d7..e1934372 100644
--- a/CompanyManagment.App.Contracts/InsuranceJob/IInsuranceJobApplication.cs
+++ b/CompanyManagment.App.Contracts/InsuranceJob/IInsuranceJobApplication.cs
@@ -21,4 +21,12 @@ public interface IInsuranceJobApplication
List Search(InsuranceJobSearchModel searchModel);
OperationResult Remove(long id);
+ Task> GetSelectList();
+}
+
+public class InsuranceJobSelectListViewModel
+{
+ public long Id { get; set; }
+ public string InsuranceJobTitle { get; set; }
+ public string EconomicCode { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InsuranceList/IInsuranceListApplication.cs b/CompanyManagment.App.Contracts/InsuranceList/IInsuranceListApplication.cs
index a93637cb..9d48019c 100644
--- a/CompanyManagment.App.Contracts/InsuranceList/IInsuranceListApplication.cs
+++ b/CompanyManagment.App.Contracts/InsuranceList/IInsuranceListApplication.cs
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using _0_Framework.Application;
using CompanyManagment.App.Contracts.InsuranceList;
using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
namespace CompanyManagment.App.Contracts.InsuranceList;
@@ -30,6 +31,50 @@ public interface IInsuranceListApplication
double GetRoundValue(double value);
OperationResult ConfirmInsuranceList(long id);
+ #region New
+ ///
+ /// دستمزد روزانه مشاغل مقطوع بیمه
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ double? GetDailyWageFixedSalary(string year, long workshopId, long employeeId, DateTime? startDateGr,
+ DateTime? endDateGr, long jobId, string population, long? insuranceJobId);
+
+ ///
+ /// محاسبه مزایای ماهانه
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public double GetMonthlyBenefits(int endMonthCurrentDay, double consumableItemsItemValue,
+ double housingAllowanceItemValue, double maritalStatus, int countWorkingDays,
+ string typeOfInsuranceSendWorkshop, long jobId, long employeeId, bool includeStatus);
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public double ComputeDailyWage(double yearlysalaryItemValue, long employeeId, long workshopId, string year);
+
+ #endregion
List SearchForClient(InsuranceListSearchModel searchModel);
//farokhiChanges
@@ -47,4 +92,6 @@ public interface IInsuranceListApplication
Task GetTabCounts(InsuranceListSearchModel searchModel);
#endregion
+
+ Task> GetNotCreatedWorkshop(InsuranceListSearchModel searchModel);
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InsuranceList/InsuranceListViewModel.cs b/CompanyManagment.App.Contracts/InsuranceList/InsuranceListViewModel.cs
index 4a31820e..c85541d3 100644
--- a/CompanyManagment.App.Contracts/InsuranceList/InsuranceListViewModel.cs
+++ b/CompanyManagment.App.Contracts/InsuranceList/InsuranceListViewModel.cs
@@ -40,4 +40,6 @@ public class InsuranceListViewModel
/// نوع تاییدیه کارفرما
///
public InsuranceListEmployerApprovalStatus EmployerApprovalStatus { get; set; }
+
+ public string ArchiveCode { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Law/ILawApplication.cs b/CompanyManagment.App.Contracts/Law/ILawApplication.cs
new file mode 100644
index 00000000..5b628f24
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Law/ILawApplication.cs
@@ -0,0 +1,37 @@
+using _0_Framework.Application;
+using System.Collections.Generic;
+using System.Security.AccessControl;
+using System.Threading.Tasks;
+using CompanyManagment.App.Contracts.Workshop;
+
+namespace CompanyManagment.App.Contracts.Law
+{
+ public interface ILawApplication
+ {
+ OperationResult Create(CreateLaw command);
+ OperationResult Edit(EditLaw command);
+ OperationResult Activate(long id);
+ OperationResult Deactivate(long id);
+ OperationResult ActivateByType(LawType type);
+ OperationResult DeactivateByType(LawType type);
+ EditLaw GetDetails(long id);
+ Task> GetList(LawSearchModel searchModel);
+ Task GetLawWithItems(long id);
+ Task GetLawByType(LawType type);
+ OperationResult UpsertLaw(EditLaw command);
+ }
+
+ public class LawSearchModel
+ {
+ public string Title { get; set; }
+ public string Text { get; set; }
+ }
+
+ public enum LawType
+ {
+ ///
+ /// ثبت نام
+ ///
+ Register
+ }
+}
diff --git a/CompanyManagment.App.Contracts/Law/LawViewModel.cs b/CompanyManagment.App.Contracts/Law/LawViewModel.cs
new file mode 100644
index 00000000..ae481625
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Law/LawViewModel.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+
+namespace CompanyManagment.App.Contracts.Law
+{
+ public class LawViewModel
+ {
+ public long Id { get; set; }
+ public string Title { get; set; }
+ public bool IsActive { get; set; }
+ public DateTime CreatedAt { get; set; }
+ public List Items { get; set; }
+ public LawType Type { get; set; }
+ public string HeadTitle { get; set; }
+ public List Notifications { get; set; }
+ public int Version { get; set; }
+ }
+
+ public class LawItemViewModel
+ {
+ public string Header { get; set; }
+ public string Details { get; set; }
+ // public int OrderNumber { get; set; }
+ }
+
+ public class CreateLaw
+ {
+ public string Title { get; set; }
+ public List Items { get; set; }
+ public LawType Type { get; set; }
+ public string HeadTitle { get; set; }
+ public List Notifications { get; set; }
+ }
+
+
+
+ public class EditLaw
+ {
+ public long Id { get; set; }
+ public string Title { get; set; }
+ public List Items { get; set; }
+ public LawType Type { get; set; }
+ public string HeadTitle { get; set; }
+ public List Notifications { get; set; }
+
+ }
+}
diff --git a/CompanyManagment.App.Contracts/Leave/CreateLeave.cs b/CompanyManagment.App.Contracts/Leave/CreateLeave.cs
index 9edb13c5..3bde2a2d 100644
--- a/CompanyManagment.App.Contracts/Leave/CreateLeave.cs
+++ b/CompanyManagment.App.Contracts/Leave/CreateLeave.cs
@@ -37,4 +37,5 @@ public class CreateLeave
public List RotatingShifts { get; set; }
public bool HasRollCall { get; set; }
public CustomizeRotatingShiftsViewModel SelectedShift { get; set; }
+ public bool IsInvallid { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Leave/LeavErrorViewModel.cs b/CompanyManagment.App.Contracts/Leave/LeavErrorViewModel.cs
index 24953c80..d4fcfe49 100644
--- a/CompanyManagment.App.Contracts/Leave/LeavErrorViewModel.cs
+++ b/CompanyManagment.App.Contracts/Leave/LeavErrorViewModel.cs
@@ -14,5 +14,8 @@ namespace CompanyManagment.App.Contracts.Leave
public string LeftWorlErrMessage { get; set; }
public bool HasNotContract { get; set; }
public string ContractErrMessage { get; set; }
+
+ public bool HasHolidayError { get; set; }
+ public string HolidayErrorMessage { get; set; }
}
}
diff --git a/CompanyManagment.App.Contracts/Leave/LeavePrintViewModel.cs b/CompanyManagment.App.Contracts/Leave/LeavePrintViewModel.cs
index 615f8620..34ea690d 100644
--- a/CompanyManagment.App.Contracts/Leave/LeavePrintViewModel.cs
+++ b/CompanyManagment.App.Contracts/Leave/LeavePrintViewModel.cs
@@ -27,4 +27,5 @@ public class LeavePrintViewModel
public string MonthGr { get; set; }
public int PrintCounter { get; set; }
public List EmployerList { get; set; }
+ public bool IsInvalid { get; set; }
}
diff --git a/CompanyManagment.App.Contracts/Leave/LeaveSearchModel.cs b/CompanyManagment.App.Contracts/Leave/LeaveSearchModel.cs
index 39e9cf4e..fb8949b1 100644
--- a/CompanyManagment.App.Contracts/Leave/LeaveSearchModel.cs
+++ b/CompanyManagment.App.Contracts/Leave/LeaveSearchModel.cs
@@ -20,4 +20,5 @@ public class LeaveSearchModel
public int Year { get; set; }
public int Month { get; set; }
public int PageIndex { get; set; }
+ public bool IsInvalid { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Leave/LeaveViewModel.cs b/CompanyManagment.App.Contracts/Leave/LeaveViewModel.cs
index 2c69168f..a95f1148 100644
--- a/CompanyManagment.App.Contracts/Leave/LeaveViewModel.cs
+++ b/CompanyManagment.App.Contracts/Leave/LeaveViewModel.cs
@@ -27,4 +27,5 @@ public class LeaveViewModel
public TimeSpan ShiftDuration { get; set; }
public bool HasShiftDuration { get; set; }
+ public bool IsInvalid { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PaymentInstrument/AccountNumberSelectListViewModel.cs b/CompanyManagment.App.Contracts/PaymentInstrument/AccountNumberSelectListViewModel.cs
new file mode 100644
index 00000000..e853715c
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentInstrument/AccountNumberSelectListViewModel.cs
@@ -0,0 +1,5 @@
+using _0_Framework.Application;
+
+namespace CompanyManagment.App.Contracts.PaymentInstrument;
+
+public class AccountNumberSelectListViewModel : SelectListViewModel;
diff --git a/CompanyManagment.App.Contracts/PaymentInstrument/CardNumberSelectListViewModel.cs b/CompanyManagment.App.Contracts/PaymentInstrument/CardNumberSelectListViewModel.cs
new file mode 100644
index 00000000..548860f8
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentInstrument/CardNumberSelectListViewModel.cs
@@ -0,0 +1,5 @@
+using _0_Framework.Application;
+
+namespace CompanyManagment.App.Contracts.PaymentInstrument;
+
+public class CardNumberSelectListViewModel:SelectListViewModel;
diff --git a/CompanyManagment.App.Contracts/PaymentInstrument/CreateBankPaymentInstrument.cs b/CompanyManagment.App.Contracts/PaymentInstrument/CreateBankPaymentInstrument.cs
new file mode 100644
index 00000000..e88f4f78
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentInstrument/CreateBankPaymentInstrument.cs
@@ -0,0 +1,37 @@
+namespace CompanyManagment.App.Contracts.PaymentInstrument;
+
+///
+/// ایجاد اطلاعات بانکی
+///
+public class CreateBankPaymentInstrument
+{
+ ///
+ /// آیدی عنوان
+ ///
+ public long PaymentInstrumentGroupId { get; set; }
+
+ ///
+ /// نام صاحب حساب
+ ///
+ public string AccountHolderName { get; set; }
+
+ ///
+ /// شماره کارت
+ ///
+ public string CardNumber { get; set; }
+
+ ///
+ /// شماره حساب
+ ///
+ public string AccountNumber { get; set; }
+
+ ///
+ /// شماره حساب
+ ///
+ public string IBan { get; set; }
+
+ ///
+ /// آیا احزار هویت شده است
+ ///
+ public bool IsAuth { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PaymentInstrument/CreateBankPaymentInstrumentGroup.cs b/CompanyManagment.App.Contracts/PaymentInstrument/CreateBankPaymentInstrumentGroup.cs
new file mode 100644
index 00000000..59f9734b
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentInstrument/CreateBankPaymentInstrumentGroup.cs
@@ -0,0 +1,12 @@
+namespace CompanyManagment.App.Contracts.PaymentInstrument;
+
+///
+/// ایجاد عنوان
+///
+public class CreateBankPaymentInstrumentGroup
+{
+ ///
+ /// نام
+ ///
+ public string Name { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PaymentInstrument/CreatePosPaymentInstrument.cs b/CompanyManagment.App.Contracts/PaymentInstrument/CreatePosPaymentInstrument.cs
new file mode 100644
index 00000000..8b77492c
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentInstrument/CreatePosPaymentInstrument.cs
@@ -0,0 +1,22 @@
+namespace CompanyManagment.App.Contracts.PaymentInstrument;
+
+///
+///
+///
+public class CreatePosPaymentInstrument
+{
+ ///
+ /// آیدی عنوان
+ ///
+ public long PaymentInstrumentGroupId { get; set; }
+
+ ///
+ /// شناسه دستگاه پوز
+ ///
+ public string PosTerminalId { get; set; }
+
+ ///
+ /// توضیحات
+ ///
+ public string Description { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PaymentInstrument/EditBankPaymentInstrumentGroup.cs b/CompanyManagment.App.Contracts/PaymentInstrument/EditBankPaymentInstrumentGroup.cs
new file mode 100644
index 00000000..ec9240af
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentInstrument/EditBankPaymentInstrumentGroup.cs
@@ -0,0 +1,12 @@
+namespace CompanyManagment.App.Contracts.PaymentInstrument;
+
+///
+/// ویرایش عنوان
+///
+public class EditBankPaymentInstrumentGroup : CreateBankPaymentInstrumentGroup
+{
+ ///
+ /// آیدی
+ ///
+ public long Id { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PaymentInstrument/GetPaymentInstrumentListViewModel.cs b/CompanyManagment.App.Contracts/PaymentInstrument/GetPaymentInstrumentListViewModel.cs
new file mode 100644
index 00000000..dbe7e876
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentInstrument/GetPaymentInstrumentListViewModel.cs
@@ -0,0 +1,73 @@
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.PaymentInstrument;
+
+public class GetPaymentInstrumentListViewModel
+{
+ ///
+ /// تعداد آیتم
+ ///
+ public int Count { get; set; }
+
+ ///
+ /// لیست گروهی
+ ///
+ public List GropedViewModels { get; set; }
+}
+public class PaymentInstrumentGroupedViewModel
+{
+ ///
+ /// نام
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// آیتم های گروه
+ ///
+ public List Items { get; set; }
+}
+///
+///
+///
+public class PaymentInstrumentItemsViewModel
+{
+ ///
+ /// آیدی
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// شماره کارت
+ ///
+ public string CardNumber { get; set; }
+
+ ///
+ /// شماره حساب
+ ///
+ public string AccountNumber { get; set; }
+
+ ///
+ /// شماره شبا
+ ///
+ public string IBan { get; set; }
+
+ ///
+ /// شناسه دستگاه
+ ///
+ public string PosTerminalId { get; set; }
+
+ ///
+ /// توضیحات
+ ///
+ public string Description { get; set; }
+
+ ///
+ /// نام صاحب حساب
+ ///
+ public string AccountHolderName { get; set; }
+
+ ///
+ /// نوع
+ ///
+ public PaymentInstrumentType Type { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PaymentInstrument/IPaymentInstrumentApplication.cs b/CompanyManagment.App.Contracts/PaymentInstrument/IPaymentInstrumentApplication.cs
new file mode 100644
index 00000000..65ec1098
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentInstrument/IPaymentInstrumentApplication.cs
@@ -0,0 +1,63 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using _0_Framework.Application;
+using Microsoft.AspNetCore.Mvc;
+
+namespace CompanyManagment.App.Contracts.PaymentInstrument;
+
+///
+/// اپلیکیشن جاری شرکا
+///
+public interface IPaymentInstrumentApplication
+{
+ ///
+ /// ایجاد حساب اطلاعات بانکی
+ ///
+ ///
+ ///
+ Task CreateBankAccount(CreateBankPaymentInstrument command);
+ Task CreateBankAccount(List commands);
+
+ ///
+ /// ایجاد اطلاعات دستگاه پوز
+ ///
+ ///
+ ///
+ Task CreatePos(CreatePosPaymentInstrument command);
+ Task CreatePos(List commands);
+
+ ///
+ /// گرفتن لیست
+ ///
+ ///
+ ///
+ Task GetList(PaymentInstrumentSearchModel searchModel);
+
+ ///
+ /// ایجاد عنوان
+ ///
+ ///
+ ///
+ Task CreateGroup(CreateBankPaymentInstrumentGroup command);
+
+ ///
+ /// ویرایش عنوان
+ ///
+ ///
+ Task EditGroup(EditBankPaymentInstrumentGroup command);
+
+ ///
+ /// حذف عنوان
+ ///
+ ///
+ ///
+ Task DeleteGroup(long id);
+
+ Task> GetGroup();
+
+ Task> PosTerminalIdSelectList(string search, string selected);
+ Task> IbanSelectList(string search, string selected);
+ Task> AccountNumberSelectList(string search, string selected);
+ Task> CardNumberSelectList(string search, string selected);
+ Task> AccountHolderNameSelectList(string search, string selected);
+}
diff --git a/CompanyManagment.App.Contracts/PaymentInstrument/IbanSelectListViewModel.cs b/CompanyManagment.App.Contracts/PaymentInstrument/IbanSelectListViewModel.cs
new file mode 100644
index 00000000..bc934189
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentInstrument/IbanSelectListViewModel.cs
@@ -0,0 +1,5 @@
+using _0_Framework.Application;
+
+namespace CompanyManagment.App.Contracts.PaymentInstrument;
+
+public class IbanSelectListViewModel:SelectListViewModel;
diff --git a/CompanyManagment.App.Contracts/PaymentInstrument/PaymentInstrumentGroupsViewModel.cs b/CompanyManagment.App.Contracts/PaymentInstrument/PaymentInstrumentGroupsViewModel.cs
new file mode 100644
index 00000000..f6dfb983
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentInstrument/PaymentInstrumentGroupsViewModel.cs
@@ -0,0 +1,5 @@
+namespace CompanyManagment.App.Contracts.PaymentInstrument;
+
+public class PaymentInstrumentGroupsViewModel:EditBankPaymentInstrumentGroup
+{
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PaymentInstrument/PaymentInstrumentSearchModel.cs b/CompanyManagment.App.Contracts/PaymentInstrument/PaymentInstrumentSearchModel.cs
new file mode 100644
index 00000000..a14116e9
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentInstrument/PaymentInstrumentSearchModel.cs
@@ -0,0 +1,38 @@
+namespace CompanyManagment.App.Contracts.PaymentInstrument;
+
+///
+/// سرچ مدل
+///
+public class PaymentInstrumentSearchModel
+{
+ ///
+ /// نام صاحب حساب
+ ///
+ public string AccountHolderName { get; set; }
+
+ ///
+ /// شناسه دستگاه
+ ///
+ public string PosTerminalId { get; set; }
+
+ ///
+ /// شماره کارت
+ ///
+ public string CardNumber { get; set; }
+
+ ///
+ /// شماره حساب
+ ///
+ public string AccountNumber { get; set; }
+
+ ///
+ /// شماره شبا
+ ///
+ public string IBan { get; set; }
+
+ ///
+ /// ایندکس صفحه
+ ///
+ public int PageIndex { get; set; }
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PaymentInstrument/PaymentInstrumentType.cs b/CompanyManagment.App.Contracts/PaymentInstrument/PaymentInstrumentType.cs
new file mode 100644
index 00000000..9d0f9ef0
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentInstrument/PaymentInstrumentType.cs
@@ -0,0 +1,15 @@
+namespace CompanyManagment.App.Contracts.PaymentInstrument;
+///
+/// نوع حساب های جاری شرکا
+///
+public enum PaymentInstrumentType
+{
+ ///
+ /// حساب بانکی
+ ///
+ BankAccount,
+ ///
+ /// دستگاه پوز
+ ///
+ Pos
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PaymentInstrument/PosTerminalSelectListViewModel.cs b/CompanyManagment.App.Contracts/PaymentInstrument/PosTerminalSelectListViewModel.cs
new file mode 100644
index 00000000..4dfc930b
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentInstrument/PosTerminalSelectListViewModel.cs
@@ -0,0 +1,7 @@
+using _0_Framework.Application;
+
+namespace CompanyManagment.App.Contracts.PaymentInstrument;
+
+public class PosTerminalSelectListViewModel:SelectListViewModel
+{
+}
diff --git a/CompanyManagment.App.Contracts/PaymentTransaction/CreatePaymentTransaction.cs b/CompanyManagment.App.Contracts/PaymentTransaction/CreatePaymentTransaction.cs
new file mode 100644
index 00000000..5546b5b7
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentTransaction/CreatePaymentTransaction.cs
@@ -0,0 +1,20 @@
+namespace CompanyManagment.App.Contracts.PaymentTransaction;
+
+public class CreatePaymentTransaction
+{
+ ///
+ /// شناسه طرف قرارداد
+ ///
+ public long ContractingPartyId { get; set; }
+
+
+ ///
+ /// مبلغ تراکنش
+ ///
+ public double Amount { get; set; }
+
+ ///
+ /// مسیر برگشت پس از پرداخت
+ ///
+ public string CallBackUrl { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PaymentTransaction/GetPaymentTransactionListSearchModel.cs b/CompanyManagment.App.Contracts/PaymentTransaction/GetPaymentTransactionListSearchModel.cs
new file mode 100644
index 00000000..71873675
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentTransaction/GetPaymentTransactionListSearchModel.cs
@@ -0,0 +1,43 @@
+namespace CompanyManagment.App.Contracts.PaymentTransaction;
+
+///
+/// مدل جستجو برای دریافت لیست تراکنشهای پرداخت.
+/// شامل فیلترهایی مانند نام طرف قرارداد یا صاحب حساب، بازه تاریخ، بازه مبلغ و وضعیت تراکنش.
+///
+public class GetPaymentTransactionListSearchModel
+{
+ ///
+ /// آیدی طرف حساب
+ ///
+ public long ContractingPartyId{ get; set; }
+
+ ///
+ /// تاریخ شروع بازه جستجو (به صورت رشته)
+ ///
+ public string FromDate { get; set; }
+
+ ///
+ /// تاریخ پایان بازه جستجو (به صورت رشته)
+ ///
+ public string ToDate { get; set; }
+
+ ///
+ /// حداقل مبلغ تراکنش جهت جستجو
+ ///
+ public double FromAmount { get; set; }
+
+ ///
+ /// حداکثر مبلغ تراکنش جهت جستجو
+ ///
+ public double ToAmount { get; set; }
+
+ ///
+ /// وضعیت تراکنش جهت فیلتر کردن نتایج
+ ///
+ public PaymentTransactionStatus? StatusEnum { get; set; }
+
+ ///
+ /// شماره صفحه برای پیادهسازی pagination
+ ///
+ public int PageIndex { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PaymentTransaction/GetPaymentTransactionListViewModel.cs b/CompanyManagment.App.Contracts/PaymentTransaction/GetPaymentTransactionListViewModel.cs
new file mode 100644
index 00000000..d8bb9e4e
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentTransaction/GetPaymentTransactionListViewModel.cs
@@ -0,0 +1,73 @@
+namespace CompanyManagment.App.Contracts.PaymentTransaction;
+
+///
+/// مدل نمایش اطلاعات هر تراکنش پرداخت در لیست تراکنشها.
+/// شامل جزئیاتی مانند تاریخ و زمان پرداخت، نام طرف حساب، اطلاعات بانکی، وضعیت و مبلغ تراکنش.
+///
+public class GetPaymentTransactionListViewModel
+{
+ ///
+ /// آیدی تراکنش پرداخت
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// تاریخ پرداخت
+ ///
+ public string PaymentDate { get; set; }
+
+ ///
+ /// زمان پرداخت
+ ///
+ public string PaymentTime { get; set; }
+
+ ///
+ /// نام طرف حساب
+ ///
+ public string ContractingPartyName { get; set; }
+
+ ///
+ /// نام صاحب حساب بانکی
+ ///
+ public string BankAccountHolderName { get; set; }
+
+ ///
+ /// نام بانک
+ ///
+ public string BankName { get; set; }
+
+ ///
+ /// شماره کارت
+ ///
+ public string CardNumber { get; set; }
+
+ ///
+ /// شماره شبا
+ ///
+ public string ShebaNumber { get; set; }
+
+ ///
+ /// شماره حساب بانکی
+ ///
+ public string AccountNumber { get; set; }
+
+ ///
+ /// وضعیت تراکنش به صورت متنی
+ ///
+ public string Status { get; set; }
+
+ ///
+ /// وضعیت تراکنش به صورت Enum
+ ///
+ public PaymentTransactionStatus StatusEnum { get; set; }
+
+ ///
+ /// مبلغ تراکنش
+ ///
+ public double Amount { get; set; }
+
+ ///
+ /// شناسه یکتای تراکنش
+ ///
+ public string TransactionId { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PaymentTransaction/IPaymentTransactionApplication.cs b/CompanyManagment.App.Contracts/PaymentTransaction/IPaymentTransactionApplication.cs
new file mode 100644
index 00000000..3e86b7cf
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentTransaction/IPaymentTransactionApplication.cs
@@ -0,0 +1,105 @@
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using _0_Framework.Application;
+using _0_Framework.Application.PaymentGateway;
+
+namespace CompanyManagment.App.Contracts.PaymentTransaction;
+
+///
+///
+///
+public interface IPaymentTransactionApplication
+{
+ ///
+ /// لیست تراکنش های پرداخت را بر اساس فیلتر مشخص شده برمی گرداند.
+ ///
+ ///
+ ///
+ Task> GetPaymentTransactionList(
+ GetPaymentTransactionListSearchModel searchModel);
+ ///
+ /// ایجاد تراکنش
+ ///
+ ///
+ ///
+ Task Create(CreatePaymentTransaction command);
+
+ Task GetWalletAmount(CancellationToken cancellationToken);
+ ///
+ /// گرفتن جزئیات تراکنش
+ ///
+ ///
+ ///
+ Task GetDetails(long id);
+
+ ///
+ /// تغییر وضعیت تراکنش به ناموفق
+ ///
+ ///
+ ///
+ ///
+ OperationResult SetFailed(long paymentTransactionId);
+
+ ///
+ /// تغییر وضعیت تراکنش به موفق
+ ///
+ ///
+ ///
+ ///
+ ///
+ OperationResult SetSuccess(long paymentTransactionId, string cardNumber, string bankName);
+
+ Task SetTransactionId(long id, string transactionId);
+}
+
+public class PaymentTransactionDetailsViewModel
+{
+ ///
+ /// آیدی
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// تاریخ و زمان انجام پرداخت
+ ///
+ public DateTime TransactionDate { get; set; }
+
+ ///
+ /// شناسه طرف حساب
+ ///
+ public long ContractingPartyId { get; set; }
+
+ ///
+ /// نام طرف حساب
+ ///
+ public string ContractingPartyName { get; set; }
+
+ ///
+ /// نام بانک
+ ///
+ public string BankName { get; set; }
+
+ ///
+ /// شماره کارت
+ ///
+ public string CardNumber { get; set; }
+
+ ///
+ /// وضعیت تراکنش پرداخت
+ ///
+ public PaymentTransactionStatus Status { get; set; }
+
+ ///
+ /// مبلغ تراکنش
+ ///
+ public double Amount { get; set; }
+
+ ///
+ /// شناسه یکتای تراکنش
+ ///
+ public string TransactionId { get; set; }
+
+ public string CallBackUrl { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PaymentTransaction/PaymentTransactionStatus.cs b/CompanyManagment.App.Contracts/PaymentTransaction/PaymentTransactionStatus.cs
new file mode 100644
index 00000000..33ef76f2
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PaymentTransaction/PaymentTransactionStatus.cs
@@ -0,0 +1,21 @@
+namespace CompanyManagment.App.Contracts.PaymentTransaction;
+
+///
+/// وضعیت تراکنش درگاه پرداخت
+///
+public enum PaymentTransactionStatus
+{
+ ///
+ /// تراکنش در انتظار انجام است.
+ ///
+ Pending,
+ ///
+ /// تراکنش با شکست مواجه شد.
+ ///
+ Failed,
+ ///
+ /// تراکنش با موفقیت انجام شد.
+ ///
+ Success,
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PersonalContractingParty/ContractingPartyGetListSearchModel.cs b/CompanyManagment.App.Contracts/PersonalContractingParty/ContractingPartyGetListSearchModel.cs
new file mode 100644
index 00000000..fd2f7f9a
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PersonalContractingParty/ContractingPartyGetListSearchModel.cs
@@ -0,0 +1,37 @@
+using _0_Framework.Application.Enums;
+
+namespace CompanyManagment.App.Contracts.PersonalContractingParty;
+
+public class ContractingPartyGetListSearchModel
+{
+ ///
+ /// تعدادی که برای لیست بعدی آیتم باید رد کنه
+ ///
+ public int PageIndex { get; set; }
+
+ ///
+ /// نام شرکت یا نام و نام خانوادگی طرف حساب
+ ///
+ public string FullNameOrCompanyName { get; set; }
+
+ ///
+ /// شناسه ملی یا شماره ملی
+ ///
+ public string NationalIdOrNationalCode { get; set; }
+
+ ///
+ /// نام معرف
+ ///
+ public string RepresentativeName { get; set; }
+
+ ///
+ /// نوع طرف حساب
+ ///
+ public LegalType ContractingPartyType { get; set; }
+
+ ///
+ /// وضعیت طرف حساب
+ ///
+ public ActivationStatus ContractingPartyStatus { get; set; }
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PersonalContractingParty/ContractingPartyGetListViewModel.cs b/CompanyManagment.App.Contracts/PersonalContractingParty/ContractingPartyGetListViewModel.cs
new file mode 100644
index 00000000..9fd90608
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PersonalContractingParty/ContractingPartyGetListViewModel.cs
@@ -0,0 +1,68 @@
+using System.Collections.Generic;
+using _0_Framework.Application.Enums;
+
+namespace CompanyManagment.App.Contracts.PersonalContractingParty;
+
+public record ContractingPartyGetListEmployerViewModel(long EmployerId, string EmployerName);
+
+public class ContractingPartyGetListViewModel
+{
+ ///
+ /// آیدی طرف حساب
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// کد طرف حساب
+ ///
+ public int ArchiveCode { get; set; }
+
+ ///
+ /// شناسه ملی یا شماره ملی
+ ///
+ public string NationalIdOrNationalCode { get; set; }
+
+ ///
+ /// نام طرف حساب
+ ///
+ public string ContractingPartyName { get; set; }
+
+ ///
+ /// لیست کارفرما ها
+ ///
+ public ICollection Employers { get; set; }
+
+ ///
+ /// تعداد بلاک
+ ///
+ public int BlockTimes { get; set; }
+
+ ///
+ /// آیا بلاک هست
+ ///
+ public bool IsBlock { get; set; }
+
+ ///
+ /// آیا دارای قرارداد مالی است
+ ///
+ public bool HasInstitutionContract { get; set; }
+
+ ///
+ /// نوع طرف حساب
+ ///
+ public LegalType ContractingPartyType { get; set; }
+
+ ///
+ /// وضعیت طرف حساب
+ ///
+ public ActivationStatus Status { get; set; }
+
+
+ public string Address { get; set; }
+ public string PhoneNumber { get; set; }
+ public string NationalId { get; set; }
+ public string RepresentativeName { get; set; }
+
+
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PersonalContractingParty/ContractingPartySelectListViewModel.cs b/CompanyManagment.App.Contracts/PersonalContractingParty/ContractingPartySelectListViewModel.cs
new file mode 100644
index 00000000..29186b6b
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PersonalContractingParty/ContractingPartySelectListViewModel.cs
@@ -0,0 +1,8 @@
+using _0_Framework.Application;
+
+namespace CompanyManagment.App.Contracts.PersonalContractingParty;
+
+public class ContractingPartySelectListViewModel: SelectListViewModel
+{
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PersonalContractingParty/CreateLegalContractingParty.cs b/CompanyManagment.App.Contracts/PersonalContractingParty/CreateLegalContractingParty.cs
new file mode 100644
index 00000000..996070fc
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PersonalContractingParty/CreateLegalContractingParty.cs
@@ -0,0 +1,74 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace CompanyManagment.App.Contracts.PersonalContractingParty;
+
+public class CreateLegalContractingParty
+{
+ ///
+ /// آیدی معرف
+ ///
+ [Required]
+ public long RepresentativeId { get; set; }
+
+ ///
+ /// نام شرکت
+ ///
+ [Required]
+ public string CompanyName { get; set; }
+
+ ///
+ /// شناسه ملی
+ ///
+ [Required]
+ public string NationalId { get; set; }
+
+ ///
+ /// کد طرف حساب
+ ///
+ [Required]
+ public int ArchiveCode { get; set; }
+
+ ///
+ /// نام مستعار
+ ///
+ public string SureName { get; set; }
+
+ ///
+ /// شماره ثبت
+ ///
+ public string RegisterId { get; set; }
+
+
+
+ ///
+ /// شماره تلفن
+ ///
+ public string PhoneNumber { get; set; }
+
+ ///
+ /// شماره تلفن نماینده
+ ///
+ public string AgentPhone { get; set; }
+
+ ///
+ /// استان
+ ///
+ public string State { get; set; }
+
+ ///
+ /// شهر
+ ///
+ public string City { get; set; }
+
+ ///
+ /// محله
+ ///
+ public string Zone { get; set; }
+
+ ///
+ /// نشانی
+ ///
+ public string Address { get; set; }
+
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PersonalContractingParty/CreateRealContractingParty.cs b/CompanyManagment.App.Contracts/PersonalContractingParty/CreateRealContractingParty.cs
new file mode 100644
index 00000000..e35fe25c
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PersonalContractingParty/CreateRealContractingParty.cs
@@ -0,0 +1,77 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace CompanyManagment.App.Contracts.PersonalContractingParty;
+
+public class CreateRealContractingParty
+{
+ ///
+ /// نام
+ ///
+ [Required]
+ public string FName { get; set; }
+
+ ///
+ /// نام خانوادگی
+ ///
+ [Required]
+ public string LName { get; set; }
+
+ ///
+ /// آیدی معرف
+ ///
+ [Required]
+ public long RepresentativeId { get; set; }
+
+ ///
+ /// کد ملی
+ ///
+ [Required]
+ public string NationalCode { get; set; }
+
+ ///
+ /// شماره شناسنامه
+ ///
+ [Required]
+ public string IdNumber { get; set; }
+
+ ///
+ /// کد طرف حساب
+ ///
+ [Required]
+ public int ArchiveCode { get; set; }
+
+ ///
+ /// نام مستعار
+ ///
+ public string SureName { get; set; }
+
+ ///
+ /// شماره تلفن
+ ///
+ public string PhoneNumber { get; set; }
+
+ ///
+ /// شماره تلفن نماینده
+ ///
+ public string AgentPhone { get; set; }
+
+ ///
+ /// استان
+ ///
+ public string State { get; set; }
+
+ ///
+ /// شهر
+ ///
+ public string City { get; set; }
+
+ ///
+ /// محله
+ ///
+ public string Zone { get; set; }
+
+ ///
+ /// نشانی
+ ///
+ public string Address { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PersonalContractingParty/EditLegalContractingParty.cs b/CompanyManagment.App.Contracts/PersonalContractingParty/EditLegalContractingParty.cs
new file mode 100644
index 00000000..a55c28da
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PersonalContractingParty/EditLegalContractingParty.cs
@@ -0,0 +1,12 @@
+namespace CompanyManagment.App.Contracts.PersonalContractingParty;
+
+///
+/// ویرایش طرف حساب حقوقی
+///
+public class EditLegalContractingParty:CreateLegalContractingParty
+{
+ ///
+ /// آیدی طرف حساب
+ ///
+ public long Id { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PersonalContractingParty/EditRealContractingParty.cs b/CompanyManagment.App.Contracts/PersonalContractingParty/EditRealContractingParty.cs
new file mode 100644
index 00000000..04150cc5
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PersonalContractingParty/EditRealContractingParty.cs
@@ -0,0 +1,13 @@
+namespace CompanyManagment.App.Contracts.PersonalContractingParty;
+
+///
+/// ویرایش طرف حساب حقیقی
+///
+public class EditRealContractingParty:CreateRealContractingParty
+{
+ ///
+ /// آیدی طرف حساب
+ ///
+ public long Id { get; set; }
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PersonalContractingParty/GetContractingPartyNationalCodeOrNationalIdViewModel.cs b/CompanyManagment.App.Contracts/PersonalContractingParty/GetContractingPartyNationalCodeOrNationalIdViewModel.cs
new file mode 100644
index 00000000..5258c58a
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PersonalContractingParty/GetContractingPartyNationalCodeOrNationalIdViewModel.cs
@@ -0,0 +1,12 @@
+namespace CompanyManagment.App.Contracts.PersonalContractingParty;
+
+///
+/// شماره ملی یا شناسه ملی بر اساس حقیقی یا حقوقی بودن
+///
+public class GetContractingPartyNationalCodeOrNationalIdViewModel
+{
+ ///
+ /// شماره ملی یا شناسه ملی
+ ///
+ public string NationalCodeOrNationalId { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PersonalContractingParty/GetLegalContractingPartyDetailsViewModel.cs b/CompanyManagment.App.Contracts/PersonalContractingParty/GetLegalContractingPartyDetailsViewModel.cs
new file mode 100644
index 00000000..787ffec5
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PersonalContractingParty/GetLegalContractingPartyDetailsViewModel.cs
@@ -0,0 +1,83 @@
+namespace CompanyManagment.App.Contracts.PersonalContractingParty;
+
+///
+/// ویو مدل جزئیات طرف حساب حقوقی
+///
+public class GetLegalContractingPartyDetailsViewModel
+{
+ ///
+ /// آیدی طرف حساب
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// نام کامل شرکت(به همراه نام مستعار)ء
+ ///
+ public string CompanyFullName { get; set; }
+
+ ///
+ /// نام شرکت (بدون نام مستعار)ء
+ ///
+ public string CompanyName { get; set; }
+
+ ///
+ /// نام مستعار
+ ///
+ public string SureName { get; set; }
+
+ ///
+ /// شماره ثبت
+ ///
+ public string RegisterId { get; set; }
+
+ ///
+ /// شماره ملی
+ ///
+ public string NationalId { get; set; }
+
+ ///
+ /// شماره تماس
+ ///
+ public string PhoneNumber { get; set; }
+
+ ///
+ /// شماره تماس نماینده
+ ///
+ public string AgentPhone { get; set; }
+
+ ///
+ /// آدرس
+ ///
+ public string Address { get; set; }
+
+ ///
+ /// معرف
+ ///
+ public string RepresentativeName { get; set; }
+
+ ///
+ /// آیدی معرف
+ ///
+ public long RepresentativeId { get; set; }
+
+ ///
+ /// کد طرف حساب
+ ///
+ public int ArchiveCode { get; set; }
+
+ ///
+ /// استان
+ ///
+ public string State { get; set; }
+
+ ///
+ /// شهر
+ ///
+ public string City { get; set; }
+
+ ///
+ /// محله
+ ///
+ public string Zone { get; set; }
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PersonalContractingParty/GetRealContractingPartyDetailsViewModel.cs b/CompanyManagment.App.Contracts/PersonalContractingParty/GetRealContractingPartyDetailsViewModel.cs
new file mode 100644
index 00000000..165871a6
--- /dev/null
+++ b/CompanyManagment.App.Contracts/PersonalContractingParty/GetRealContractingPartyDetailsViewModel.cs
@@ -0,0 +1,94 @@
+using System.Runtime.CompilerServices;
+using Microsoft.AspNetCore.Builder;
+
+namespace CompanyManagment.App.Contracts.PersonalContractingParty;
+
+///
+/// ویو مدل جزئیات طرف حساب حقیقی
+///
+public class GetRealContractingPartyDetailsViewModel
+{
+ ///
+ /// آیدی طرف حساب
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// نام
+ ///
+ public string FName { get; set; }
+
+ ///
+ /// نام خانوادگی
+ ///
+ public string LName { get; set; }
+
+ ///
+ /// نام و نام خانوادگی
+ ///
+ public string FullName { get; set; }
+
+ ///
+ /// کد ملی
+ ///
+ public string NationalCode { get; set; }
+
+ ///
+ /// شماره شناسنامه
+ ///
+ public string IdNumber { get; set; }
+
+ ///
+ /// شماره تلفن
+ ///
+ public string PhoneNumber { get; set; }
+
+ ///
+ /// شماره تلفن نماینده
+ ///
+ public string AgentPhone { get; set; }
+
+ ///
+ /// آدرس
+ ///
+ public string Address { get; set; }
+
+
+ ///
+ /// نام معرف
+ ///
+ public string RepresentativeName { get; set; }
+
+ ///
+ /// آیدی معرف
+ ///
+ public long RepresentativeId { get; set; }
+
+ ///
+ /// نام مستعار
+ ///
+ public string SureName { get; set; }
+
+ ///
+ /// کد طرف حساب
+ ///
+ public int ArchiveCode { get; set; }
+
+
+ ///
+ /// استان
+ ///
+ public string State { get; set; }
+
+ ///
+ /// شهر
+ ///
+ public string City { get; set; }
+
+ ///
+ /// محله
+ ///
+ public string Zone { get; set; }
+
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PersonalContractingParty/IPersonalContractingPartyApp.cs b/CompanyManagment.App.Contracts/PersonalContractingParty/IPersonalContractingPartyApp.cs
index b3303f0a..6f387207 100644
--- a/CompanyManagment.App.Contracts/PersonalContractingParty/IPersonalContractingPartyApp.cs
+++ b/CompanyManagment.App.Contracts/PersonalContractingParty/IPersonalContractingPartyApp.cs
@@ -1,5 +1,6 @@
using _0_Framework.Application;
using System.Collections.Generic;
+using System.Threading.Tasks;
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
@@ -54,4 +55,81 @@ public interface IPersonalContractingPartyApp
#endregion
+
+ #region Api
+ ///
+ /// لیست طرف حساب ها
+ ///
+ ///
+ ///
+ Task> GetList(ContractingPartyGetListSearchModel searchModel);
+
+ ///
+ /// لیست طرف حساب برای سلکت لیست سرچ
+ ///
+ ///
+ ///
+ ///
+ Task> GetSelectList(string search, long id);
+
+ ///
+ /// ایجاد طرف حساب حقیقی
+ ///
+ ///
+ ///
+ Task CreateReal(CreateRealContractingParty command);
+
+ ///
+ /// ایجاد ظرف حساب حقوقی
+ ///
+ ///
+ ///
+ Task CreateLegal(CreateLegalContractingParty command);
+
+
+ ///
+ /// لیستی از شماره ملی یا شناسه ملی بر اساس حقیقی یا حقوقی بودن
+ ///
+ ///
+ Task> GetNationalCodeOrNationalId();
+
+
+ ///
+ /// حذف طرف حساب. در صورتی که طرف حساب دارای قرارداد مالی یا دارای کارفرما باشد غیرفعال میشود
+ ///
+ ///
+ ///
+ Task> Delete(long id);
+
+ ///
+ /// ویرایش طرف حساب حقیقی
+ ///
+ ///
+ ///
+ OperationResult EditRealApi(EditRealContractingParty command);
+
+
+ ///
+ /// ویرایش طرف حساب حقوقی
+ ///
+ ///
+ ///
+ OperationResult EditLegal(EditLegalContractingParty command);
+
+ ///
+ /// گرفتن جزئیات طرف حساب حقوقی
+ ///
+ ///
+ ///
+ Task GetRealDetails(long id);
+
+ ///
+ /// گرفتن جزئیات طرف حساب حقوقی
+ ///
+ ///
+ ///
+ Task GetLegalDetails(long id);
+
+ #endregion
+
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PersonalContractingParty/PersonalContractingPartyViewModel.cs b/CompanyManagment.App.Contracts/PersonalContractingParty/PersonalContractingPartyViewModel.cs
index c2e955b2..44cc96b2 100644
--- a/CompanyManagment.App.Contracts/PersonalContractingParty/PersonalContractingPartyViewModel.cs
+++ b/CompanyManagment.App.Contracts/PersonalContractingParty/PersonalContractingPartyViewModel.cs
@@ -47,4 +47,6 @@ public class PersonalContractingPartyViewModel
public bool IsAuthenticated { get; set; }
public List EmployerList { get; set; }
+
+
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Report/AllReport.cs b/CompanyManagment.App.Contracts/Report/AllReport.cs
index 31ad2a8d..108f3c47 100644
--- a/CompanyManagment.App.Contracts/Report/AllReport.cs
+++ b/CompanyManagment.App.Contracts/Report/AllReport.cs
@@ -27,6 +27,8 @@ namespace CompanyManagment.App.Contracts.Report
public int ContractSignNotDone { get; set; }
public int ContractSignDone { get; set; }
+ public int ContractSignToBe { get; set; }
+
//تصفیه
public int AllCheckout { get; set; }
public int CheckoutNotDone { get; set; }
@@ -34,6 +36,8 @@ namespace CompanyManagment.App.Contracts.Report
public int CheckoutSignNotDone { get; set; }
public int CheckoutSignDone { get; set; }
+ public int CheckoutSignToBe { get; set; }
+
}
diff --git a/CompanyManagment.App.Contracts/Report/IReportApplication.cs b/CompanyManagment.App.Contracts/Report/IReportApplication.cs
index 754371fe..5fb8ff10 100644
--- a/CompanyManagment.App.Contracts/Report/IReportApplication.cs
+++ b/CompanyManagment.App.Contracts/Report/IReportApplication.cs
@@ -10,21 +10,23 @@ namespace CompanyManagment.App.Contracts.Report
{
Task GetAllActiveWorkshops(string year, string month);
Task GetAllReports(string year, string month);
- WorkshopResult GetWorkshopContractDone(string year, string month, long accountId, List workshopList);
- WorkshopResult GetWorkshopContractSignDone(string year, string month, long accountId, List workshopList);
- WorkshopResult GetWorkshopCheckoutDone(string year, string month, long accountId, List workshopList);
- WorkshopResult GetWorkshopCheckoutSignDone(string year, string month, long accountId, List workshopList);
- List GetEmployeeContract(string year, string month, long workshopId);
- List GetEmployeeContractSign(string year, string month, long workshopId);
- List GetEmployeeCheckout(string year, string month, long workshopId);
- List GetEmployeeCheckoutSign(string year, string month, long workshopId);
- PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId,
+ Task GetWorkshopContractDone(string year, string month, long accountId, List workshopList);
+ Task GetWorkshopContractSignDone(string year, string month, long accountId,
List workshopList);
- PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId,
+ Task GetWorkshopCheckoutDone(string year, string month, long accountId, List workshopList);
+ Task GetWorkshopCheckoutSignDone(string year, string month, long accountId,
List workshopList);
- PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId,
+ Task> GetEmployeeContract(string year, string month, long workshopId);
+ Task> GetEmployeeContractSign(string year, string month, long workshopId);
+ Task> GetEmployeeCheckout(string year, string month, long workshopId);
+ Task> GetEmployeeCheckoutSign(string year, string month, long workshopId);
+ Task GetPrintAllContractDone(string year, string month, long accountId,
List workshopList);
- PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId,
+ Task GetPrintAllContractSignDone(string year, string month, long accountId,
+ List workshopList);
+ Task GetPrintAllCheckoutDone(string year, string month, long accountId,
+ List workshopList);
+ Task GetPrintAllCheckoutSignDone(string year, string month, long accountId,
List workshopList);
}
}
diff --git a/CompanyManagment.App.Contracts/Representative/CreateLegalRepresentative.cs b/CompanyManagment.App.Contracts/Representative/CreateLegalRepresentative.cs
new file mode 100644
index 00000000..05bdfd2a
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Representative/CreateLegalRepresentative.cs
@@ -0,0 +1,46 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace CompanyManagment.App.Contracts.Representative;
+
+public class CreateLegalRepresentative
+{
+
+ ///
+ /// نام حقوقی
+ ///
+ [Required(ErrorMessage = "این مقدار نمی تواند خالی باشد")]
+ public string LegalName { get; set; }
+
+
+ ///
+ /// شناسه ثبت
+ ///
+ [RegularExpression("^[0-9]*$", ErrorMessage = "لطفا فقط عدد وارد کنید")]
+ public string RegisterId { get; set; }
+
+
+ ///
+ /// شناسه ملی
+ ///
+ [RegularExpression("[0-9]{11}", ErrorMessage = "لطفا فقط عدد 11 رقمی وارد کنید")]
+ public string NationalId { get; set; }
+
+
+ ///
+ /// شماره تلفن
+ ///
+ [DataType(DataType.PhoneNumber)]
+ [RegularExpression(@"^\(?([0-9]{4})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$", ErrorMessage = "لطفا شماره تلفن معتبر وارد کنید")]
+ public string Phone { get; set; }
+
+ ///
+ /// شماره تلفن نماینده
+ ///
+ [RegularExpression("^[0-9]*$", ErrorMessage = "لطفا فقط عدد وارد کنید")]
+ public string AgentPhone { get; set; }
+
+ ///
+ /// آدرس
+ ///
+ public string Address { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Representative/CreateRealRepresentative.cs b/CompanyManagment.App.Contracts/Representative/CreateRealRepresentative.cs
new file mode 100644
index 00000000..35967dab
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Representative/CreateRealRepresentative.cs
@@ -0,0 +1,54 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace CompanyManagment.App.Contracts.Representative;
+
+public class CreateRealRepresentative
+{
+
+
+ ///
+ /// نام کوچک
+ ///
+ [Required(ErrorMessage = "این مقدار نمی تواند خالی باشد")]
+ public string FName { get; set; }
+
+ ///
+ /// نام خانوادگی
+ ///
+ [Required(ErrorMessage = "این مقدار نمی تواند خالی باشد")]
+ public string LName { get; set; }
+
+
+ ///
+ /// کد ملی
+ ///
+ [RegularExpression("^[0-9]*$", ErrorMessage = "لطفا فقط عدد وارد کنید")]
+ public string Nationalcode { get; set; }
+
+
+ ///
+ /// شماره شناسنامه
+ ///
+ [MaxLength(12)]
+ [MinLength(1)]
+ [RegularExpression("^[0-9]*$", ErrorMessage = "لطفا فقط عدد وارد کنید")]
+ public string IdNumber { get; set; }
+
+
+ ///
+ /// شماره تلفن
+ ///
+ [DataType(DataType.PhoneNumber)]
+ [RegularExpression(@"^\(?([0-9]{4})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$", ErrorMessage = "لطفا شماره تلفن معتبر وارد کنید")]
+ public string Phone { get; set; }
+
+
+ [RegularExpression("^[0-9]*$", ErrorMessage = "لطفا فقط عدد وارد کنید")]
+ public string AgentPhone { get; set; }
+
+ ///
+ /// آدرس
+ ///
+ public string Address { get; set; }
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Representative/EditLegalRepresentative.cs b/CompanyManagment.App.Contracts/Representative/EditLegalRepresentative.cs
new file mode 100644
index 00000000..36e9198f
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Representative/EditLegalRepresentative.cs
@@ -0,0 +1,6 @@
+namespace CompanyManagment.App.Contracts.Representative;
+
+public class EditLegalRepresentative : CreateLegalRepresentative
+{
+ public long Id { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Representative/EditRealRepresentative.cs b/CompanyManagment.App.Contracts/Representative/EditRealRepresentative.cs
new file mode 100644
index 00000000..0ee00e20
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Representative/EditRealRepresentative.cs
@@ -0,0 +1,6 @@
+namespace CompanyManagment.App.Contracts.Representative;
+
+public class EditRealRepresentative : CreateRealRepresentative
+{
+ public long Id { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Representative/GetSelectListRepresentativeViewModel.cs b/CompanyManagment.App.Contracts/Representative/GetSelectListRepresentativeViewModel.cs
new file mode 100644
index 00000000..6a4fbfd9
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Representative/GetSelectListRepresentativeViewModel.cs
@@ -0,0 +1,8 @@
+using _0_Framework.Application;
+
+namespace CompanyManagment.App.Contracts.Representative;
+
+///
+/// ویو مدل سلکت لیست برای معرف
+///
+public class GetSelectListRepresentativeViewModel:SelectListViewModel;
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Representative/IRepresentativeApplication.cs b/CompanyManagment.App.Contracts/Representative/IRepresentativeApplication.cs
index 7c751c5d..ece54ff7 100644
--- a/CompanyManagment.App.Contracts/Representative/IRepresentativeApplication.cs
+++ b/CompanyManagment.App.Contracts/Representative/IRepresentativeApplication.cs
@@ -24,8 +24,27 @@ public interface IRepresentativeApplication
OperationResult DeleteRepresentative(long id);
OperationResult Active(long id);
OperationResult DeActive(long id);
- #endregion
+ #endregion
+ #region Api
+
+ Task> GetList(RepresentativeGetListSearchModel searchModel);
+
+ bool HasAnyContractingParty(long id);
+
+
+ OperationResult CreateReal(CreateRealRepresentative command);
+ OperationResult CreateLegal(CreateLegalRepresentative command);
+ OperationResult EditReal(EditRealRepresentative command);
+ OperationResult EditLegal(EditLegalRepresentative command);
+
+ ///
+ /// لیست نام های معرف برای سلکت لیست
+ ///
+ ///
+ Task> GetSelectList();
+
+ #endregion
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Representative/RepresentativeGetListSearchModel.cs b/CompanyManagment.App.Contracts/Representative/RepresentativeGetListSearchModel.cs
new file mode 100644
index 00000000..f3ce1dba
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Representative/RepresentativeGetListSearchModel.cs
@@ -0,0 +1,41 @@
+using _0_Framework.Application.Enums;
+
+namespace CompanyManagment.App.Contracts.Representative;
+
+public class RepresentativeGetListSearchModel
+{
+
+ public int PageIndex { get; set; }
+
+ ///
+ /// نام شرکت یا نام و نام خانوادگی
+ ///
+ public string CompanyNameOrFullName { get; set; }
+
+ ///
+ /// شناسه ملی یا کدملی
+ ///
+ public string NationalCodeOrNationalId { get; set; }
+
+ ///
+ /// شماره شناسنامه
+ ///
+ public string IdNumber { get; set; }
+
+ ///
+ /// آیدی طرف حساب
+ ///
+ public long ContractingPartyId { get; set; }
+
+ ///
+ /// نوع معرف
+ ///
+ public LegalType RepresentativeType { get; set; }
+
+
+ ///
+ /// وضعیت معرف
+ ///
+ public ActivationStatus RepresentativeStatus { get; set; }
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Representative/RepresentativeGetListViewModel.cs b/CompanyManagment.App.Contracts/Representative/RepresentativeGetListViewModel.cs
new file mode 100644
index 00000000..2fed51e0
--- /dev/null
+++ b/CompanyManagment.App.Contracts/Representative/RepresentativeGetListViewModel.cs
@@ -0,0 +1,29 @@
+using _0_Framework.Application.Enums;
+
+namespace CompanyManagment.App.Contracts.Representative;
+
+public class RepresentativeGetListViewModel
+{
+ ///
+ /// آیدی معرف
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// نام حقیقی یا نام حقوقی
+ ///
+ public string RealNameOrLegalName { get; set; }
+
+ ///
+ /// کدملی یا شناسه ملی
+ ///
+ public string NationalIdOrNationalCode { get; set; }
+
+ ///
+ /// آیا این معرف طرف حسابی دارد؟
+ ///
+ public bool HasAnyContractingParty { get; set; }
+
+ public ActivationStatus RepresentativeStatus { get; set; }
+ public LegalType RepresentativeType { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/RollCall/IRollCallMandatoryApplication.cs b/CompanyManagment.App.Contracts/RollCall/IRollCallMandatoryApplication.cs
index ce101b2b..f765d919 100644
--- a/CompanyManagment.App.Contracts/RollCall/IRollCallMandatoryApplication.cs
+++ b/CompanyManagment.App.Contracts/RollCall/IRollCallMandatoryApplication.cs
@@ -8,7 +8,8 @@ namespace CompanyManagment.App.Contracts.RollCall;
public interface IRollCallMandatoryApplication
{
bool HasRollCallRecord(long employeeId, long workshopId, DateTime contractStart);
- ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute);
+ ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute, double dailyWageUnAffected, bool totalLeaveCompute);
+
///
/// گزارش نوبت کاری حضور غیاب
diff --git a/CompanyManagment.App.Contracts/SalaryAid/ISalaryAidApplication.cs b/CompanyManagment.App.Contracts/SalaryAid/ISalaryAidApplication.cs
index ebaccead..ff068485 100644
--- a/CompanyManagment.App.Contracts/SalaryAid/ISalaryAidApplication.cs
+++ b/CompanyManagment.App.Contracts/SalaryAid/ISalaryAidApplication.cs
@@ -22,5 +22,5 @@ public interface ISalaryAidApplication
SalaryAidsGroupedViewModel GetSearchListAsGrouped(SalaryAidSearchViewModel searchModel);
#endregion
- OperationResult CreateRange(List commands);
+ Task CreateRangeAsync(List commands);
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/TemporaryClientRegistration/ContractingPartyTempViewModel.cs b/CompanyManagment.App.Contracts/TemporaryClientRegistration/ContractingPartyTempViewModel.cs
index 5067c36f..87e5a00a 100644
--- a/CompanyManagment.App.Contracts/TemporaryClientRegistration/ContractingPartyTempViewModel.cs
+++ b/CompanyManagment.App.Contracts/TemporaryClientRegistration/ContractingPartyTempViewModel.cs
@@ -8,4 +8,8 @@ public class ContractingPartyTempViewModel : CreateContractingPartyTemp
///
public string DateOfBirthFa { get; set; }
+ public string Address { get; set; }
+ public string City { get; set; }
+ public long RepresentativeId { get; set; }
+
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/TemporaryClientRegistration/CreateInstitutionContractTemp.cs b/CompanyManagment.App.Contracts/TemporaryClientRegistration/CreateInstitutionContractTemp.cs
index 85594646..21a72843 100644
--- a/CompanyManagment.App.Contracts/TemporaryClientRegistration/CreateInstitutionContractTemp.cs
+++ b/CompanyManagment.App.Contracts/TemporaryClientRegistration/CreateInstitutionContractTemp.cs
@@ -67,7 +67,7 @@ public class CreateInstitutionContractTemp
/// -
/// Completed ثبت نام تکمیل شده
///
- public string RegistrationStatus { get; set; }
+ public InstitutionContractTempStatus RegistrationStatus { get; set; }
///
/// آی دی پیامک ارسال شده
diff --git a/CompanyManagment.App.Contracts/TemporaryClientRegistration/CreateWorkshopTemp.cs b/CompanyManagment.App.Contracts/TemporaryClientRegistration/CreateWorkshopTemp.cs
index bf051dea..83e3b675 100644
--- a/CompanyManagment.App.Contracts/TemporaryClientRegistration/CreateWorkshopTemp.cs
+++ b/CompanyManagment.App.Contracts/TemporaryClientRegistration/CreateWorkshopTemp.cs
@@ -16,20 +16,7 @@ public class CreateWorkshopTemp
/// ای دی طرف حساب
///
public long ContractingPartyTempId { get; set; }
-
- ///
- /// جمع کل مبالغ سرویس ها برای کارگاه
- /// Double
- ///
- public double WorkshopServicesAmount { get; set; }
-
- ///
- /// جمع کل مبالغ سرویس ها برای کارگاه
- /// فارسی
- ///
- public string WorkshopServicesAmountStr { get; set; }
-
-
+
#region ServiceSelection
///
@@ -46,6 +33,7 @@ public class CreateWorkshopTemp
/// حضورغباب
///
public bool RollCall { get; set; }
+ public bool RollCallInPerson { get; set; }
///
/// فیش غیر رسمی
diff --git a/CompanyManagment.App.Contracts/TemporaryClientRegistration/ITemporaryClientRegistrationApplication.cs b/CompanyManagment.App.Contracts/TemporaryClientRegistration/ITemporaryClientRegistrationApplication.cs
index 17ed2570..f2cc87c8 100644
--- a/CompanyManagment.App.Contracts/TemporaryClientRegistration/ITemporaryClientRegistrationApplication.cs
+++ b/CompanyManagment.App.Contracts/TemporaryClientRegistration/ITemporaryClientRegistrationApplication.cs
@@ -1,7 +1,11 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Threading.Tasks;
using _0_Framework.Application;
+using _0_Framework.Application.Enums;
+using CompanyManagment.App.Contracts.InstitutionContract;
using CompanyManagment.App.Contracts.InstitutionPlan;
+using Microsoft.AspNetCore.Mvc;
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
@@ -15,7 +19,7 @@ public interface ITemporaryClientRegistrationApplication
///
///
Task> CreateContractingPartyTemp(string nationalCode, string dateOfBirth, string mobile);
-
+
///
/// تکمیل اطلاعات
///
@@ -38,7 +42,7 @@ public interface ITemporaryClientRegistrationApplication
///
///
///
- Task CreateOrUpdateWorkshopTemp(List command);
+ Task CreateOrUpdateWorkshopTemp(List command, long contractingPartyTempId);
///
/// دریافت جمع کل خدمات برای یک کارگاه
@@ -51,18 +55,32 @@ public interface ITemporaryClientRegistrationApplication
/// دریافت مبالغ بررسی و پرداخت
///
///
- ///
+ ///
///
///
Task GetTotalPaymentAndWorkshopList(long contractingPartyTempId,
- string periodModel = "12", string paymentModel = "OneTime");
+ InstitutionContractDuration duration = InstitutionContractDuration.TwelveMonths, string paymentModel = "OneTime", string contractStartType = "currentMonth");
+
+ ///
+ /// دریافت مبالغ بررسی و پرداخت با لیست کارگاه ها
+ /// این متد برای زمانی است که کارگاه ها در مرحله ثبت نام موقت هستند
+ /// و هنوز در دیتابیس ثبت نشده اند
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ Task GetTotalPaymentAndWorkshopList(double totalPaymentMonth,
+ InstitutionContractDuration duration , bool hasInPersonContract);
///
/// ایجاد یا ویرایش قرارداد موقت
///
///
///
- Task CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax);
+ Task CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax, DateTime contractStart);
///
/// دریافت کد برای کلاینت
@@ -92,4 +110,15 @@ public interface ITemporaryClientRegistrationApplication
///
///
Task PayOffCompleted(long contractingPartyTempId);
-}
\ No newline at end of file
+
+
+
+
+ ///
+ /// ارسال لینک تایید قوانین و مقررات به طرف حساب
+ ///
+ ///
+ ///
+ Task SendAgreementLink(long contractingPartyTempId);
+}
+
diff --git a/CompanyManagment.App.Contracts/TemporaryClientRegistration/InstitutionContractTempViewModel.cs b/CompanyManagment.App.Contracts/TemporaryClientRegistration/InstitutionContractTempViewModel.cs
index 5f1ea794..4a571649 100644
--- a/CompanyManagment.App.Contracts/TemporaryClientRegistration/InstitutionContractTempViewModel.cs
+++ b/CompanyManagment.App.Contracts/TemporaryClientRegistration/InstitutionContractTempViewModel.cs
@@ -3,4 +3,14 @@
public class InstitutionContractTempViewModel : CreateInstitutionContractTemp
{
public long Id { get; set; }
+}
+
+public enum InstitutionContractTempStatus
+{
+ BeforeSendVerifyCode,
+ VerifyCodeSent,
+ PendingToCompletion,
+ ReceivedCodeFromClient,
+ Completed
+
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/TemporaryClientRegistration/MonthlyInstallment.cs b/CompanyManagment.App.Contracts/TemporaryClientRegistration/MonthlyInstallment.cs
new file mode 100644
index 00000000..efa53d67
--- /dev/null
+++ b/CompanyManagment.App.Contracts/TemporaryClientRegistration/MonthlyInstallment.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.TemporaryClientRegistration;
+
+public class MonthlyInstallment
+{
+ ///
+ /// مبلغ قسط ماهانه
+ ///
+ public string InstallmentAmountStr { get; set; }
+
+ ///
+ /// تاریخ قسط ماهانه
+ ///
+ public string InstalmentDate { get; set; }
+
+ ///
+ /// شمارنده قسط
+ ///
+ public string InstallmentCounter{ get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/TemporaryClientRegistration/ReviewAndPaymentViewModel.cs b/CompanyManagment.App.Contracts/TemporaryClientRegistration/ReviewAndPaymentViewModel.cs
index bc2478b3..d3e2a661 100644
--- a/CompanyManagment.App.Contracts/TemporaryClientRegistration/ReviewAndPaymentViewModel.cs
+++ b/CompanyManagment.App.Contracts/TemporaryClientRegistration/ReviewAndPaymentViewModel.cs
@@ -1,86 +1,85 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
+using CompanyManagment.App.Contracts.InstitutionContract;
+using CompanyManagment.App.Contracts.Workshop;
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
public class ReviewAndPaymentViewModel
{
- ///
- /// جمع کل
- /// double
- ///
- public double SumOfWorkshopsPaymentDouble { get; set; }
///
- /// جمع کل
- /// string
+ /// تخفیف
///
- public string SumOfWorkshopsPaymentPaymentStr { get; set; }
-
-
-
+ public string Discount { get; set; }
///
- /// مبلغ پرداخت بدون مالیات
- /// Double
+ /// مقدار جمع مبلغ کارگاه ها
///
- public double WithoutTaxPaymentDouble { get; set; }
+ public string SumOfWorkshopsPayment { get; set; }
///
/// مبلغ پرداخت بدون مالیات
/// string
///
- public string WithoutTaxPaymentStr { get; set; }
-
-
- ///
- /// مبلغ پرداخت کامل
- /// Double
- ///
- public double TotalPaymentDouble { get; set; }
+ public string OneTimeWithoutTaxPaymentStr { get; set; }
///
/// مبلغ پرداخت کامل
/// string
///
- public string TotalPaymentStr { get; set; }
-
+ public string OneTimeTotalPaymentStr { get; set; }
///
- /// مالیات بر ارزش افزوده
- /// Double
+ /// مبلغ پرداخت بدون مالیات ماهانه
+ /// string
///
- public double ValueAddedTaxDouble { get; set; }
+ public string MonthlyWithoutTaxPaymentStr { get; set; }
+ ///
+ /// مبلغ پرداخت کامل ماهانه
+ /// string
+ ///
+ public string MonthlyTotalPaymentStr { get; set; }
+
///
/// مالیات بر ارزش افزوده
/// string
///
- public string ValueAddedTaxSt { get; set; }
-
-
-
+ public string MonthlyValueAddedTaxStr { get; set; }
+
+ public string OneTimeValueAddedTaxStr { get; set; }
///
- /// بازه قرداد
- /// با عدد مشخص میشود
- /// مثلا یک ماه عدد 1
+ /// لیست اقساط ماهیانه
///
- public string PeriodModel { get; set; }
+ public List MonthlyInstallments { get; set; }
///
- /// OneTime پرداخت یکجا
- /// -
- /// Monthly پرداخت ماهانه
+ /// شروع قرارداد - شمسی
///
- public string PaymentModel { get; set; }
+ public string ContractStartFa { get; set; }
///
- /// لیست کارگاه های ایجاد شده
+ /// شروع قرارداد - میلادی
///
- public List WorkshopTempViewList { get; set; }
+ public DateTime ContractStartGr { get; set; }
///
- /// آی دی طرف حساب
+ /// تاریخ پایان قرارداد
+ /// -
+ /// میلادی
///
- public long ContractingPartTempId { get; set; }
+ public DateTime ContractEndGr { get; set; }
+
+ ///
+ /// تاریخ پایان قرارداد
+ /// -
+ /// شمسی
+ ///
+ public string ContractEndFa { get; set; }
+
+ public string DailyCompensation { get; set; }
+ public string Obligation { get; set; }
+ public string DiscountedAmountForOneMonth { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/TemporaryClientRegistration/WorkshopTempViewModel.cs b/CompanyManagment.App.Contracts/TemporaryClientRegistration/WorkshopTempViewModel.cs
index c0bc27f2..21f9b570 100644
--- a/CompanyManagment.App.Contracts/TemporaryClientRegistration/WorkshopTempViewModel.cs
+++ b/CompanyManagment.App.Contracts/TemporaryClientRegistration/WorkshopTempViewModel.cs
@@ -3,4 +3,18 @@
public class WorkshopTempViewModel : CreateWorkshopTemp
{
public long Id { get; set; }
+
+ ///
+ /// جمع کل مبالغ سرویس ها برای کارگاه
+ /// Double
+ ///
+ public double WorkshopServicesAmount { get; set; }
+
+ ///
+ /// جمع کل مبالغ سرویس ها برای کارگاه
+ /// فارسی
+ ///
+ public string WorkshopServicesAmountStr { get; set; }
+
+ public long WorkshopId { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/WorkingHoursTemp/CreateWorkingHoursTemp.cs b/CompanyManagment.App.Contracts/WorkingHoursTemp/CreateWorkingHoursTemp.cs
index a3ec46ad..52c5e421 100644
--- a/CompanyManagment.App.Contracts/WorkingHoursTemp/CreateWorkingHoursTemp.cs
+++ b/CompanyManagment.App.Contracts/WorkingHoursTemp/CreateWorkingHoursTemp.cs
@@ -311,4 +311,9 @@ public class CreateWorkingHoursTemp
public string WeeklyWorkingTime { get; set; }
public long ContractId { get; set; }
public long WorknigHoursId { get; set; }
+
+ ///
+ /// دستمزد روزانه قبل از تاثیر ساعت کار
+ ///
+ public double DailySalaryUnAffected { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Workshop/CreateWorkshop.cs b/CompanyManagment.App.Contracts/Workshop/CreateWorkshop.cs
index 57b654cd..98355cbc 100644
--- a/CompanyManagment.App.Contracts/Workshop/CreateWorkshop.cs
+++ b/CompanyManagment.App.Contracts/Workshop/CreateWorkshop.cs
@@ -151,5 +151,6 @@ public class CreateWorkshop
/// تصفیه حساب بصورت استاتیک محاصبه شود
///
public bool IsStaticCheckout { get; set; }
+
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Workshop/DTOs/AutoExtensionEmployeeListDto.cs b/CompanyManagment.App.Contracts/Workshop/DTOs/AutoExtensionEmployeeListDto.cs
index f92c4330..a431a8be 100644
--- a/CompanyManagment.App.Contracts/Workshop/DTOs/AutoExtensionEmployeeListDto.cs
+++ b/CompanyManagment.App.Contracts/Workshop/DTOs/AutoExtensionEmployeeListDto.cs
@@ -1,4 +1,6 @@
-namespace CompanyManagment.App.Contracts.Workshop.DTOs;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace CompanyManagment.App.Contracts.Workshop.DTOs;
public class AutoExtensionEmployeeListDto
{
@@ -32,6 +34,17 @@ public class AutoExtensionEmployeeListDto
public bool EmployeeHasCreateContract { get; set; }
+ ///
+ /// دستمزد روزانه دریافت شده از سمت فرانت
+ ///
+ public string DailySalaryUnAffectedStr => "0";
+
+ ///
+ /// مزد سالانه نرمال دریافت از سمت فرانت
+ ///
+ public string NormalDailyWage => "0";
+
+
public string ContarctStart { get; set; }
public string ContractEnd { get; set; }
diff --git a/CompanyManagment.App.Contracts/Workshop/IWorkshopApplication.cs b/CompanyManagment.App.Contracts/Workshop/IWorkshopApplication.cs
index d1eee693..9e9ec0ac 100644
--- a/CompanyManagment.App.Contracts/Workshop/IWorkshopApplication.cs
+++ b/CompanyManagment.App.Contracts/Workshop/IWorkshopApplication.cs
@@ -4,6 +4,7 @@ using System.Threading.Tasks;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Account;
using CompanyManagment.App.Contracts.Workshop.DTOs;
+using Microsoft.AspNetCore.Mvc;
namespace CompanyManagment.App.Contracts.Workshop;
@@ -85,8 +86,179 @@ public interface IWorkshopApplication
Task> GetWorkshopsForLeftWorkTemp(long accountId);
Task GetWorkshopsForLeftWorkTempCount(long accountId);
- Task> GetSelectList(string search);
+ Task> GetSelectList(string search, long id);
#endregion
+
+ Task> CreateWorkshopWorkflowRegistration(CreateWorkshopWorkflowRegistration command);
+}
+
+public class CreateWorkshopWorkflowRegistration
+{
+ ///
+ /// شناسه جزئیات کارگاه قرارداد نهاد مرتبط
+ ///
+ public long InstitutionContractWorkshopInitialId { get; set; }
+ ///
+ /// نام کارگاه
+ ///
+ public string WorkshopName { get; set; }
+ ///
+ /// نام مستعار
+ ///
+ public string SureName { get; set; }
+ ///
+ /// نوع مالکیت
+ ///
+ public string TypeOfOwnership { get; set; }
+ ///
+ /// کد بایگانی
+ ///
+ public string ArchiveCode { get; set; }
+ ///
+ /// نام نماینده
+ ///
+ public string AgentName { get; set; }
+ ///
+ /// شناسه طرف قرارداد
+ ///
+ public long ContractingPartyId { get; set; }
+ ///
+ /// شهر
+ ///
+ public string City { get; set; }
+ ///
+ /// استان
+ ///
+ public string Province { get; set; }
+ ///
+ /// آدرس
+ ///
+ public string Address { get; set; }
+ ///
+ /// شناسه حساب کارشناس ارشد قرارداد
+ ///
+ public long SeniorContractAccountId { get; set; }
+ ///
+ /// شناسه حساب کارشناس قرارداد
+ ///
+ public long JuniorContractAccountId { get; set; }
+ ///
+ /// شناسه حساب کارشناس ارشد بیمه
+ ///
+ public long SeniorInsuranceAccountId { get; set; }
+ ///
+ /// شناسه حساب کارشناس بیمه
+ ///
+ public long JuniorInsuranceAccountId { get; set; }
+ ///
+ /// باز بودن در تعطیلات
+ ///
+ public bool WorkingInHoliday { get; set; }
+ ///
+ /// محاسبه نوبت کاری در فیش حقوقی
+ ///
+ public bool RotatingShiftCompute { get; set; }
+
+ ///
+ /// ایجاد قرارداد
+ ///
+ public bool CreateContract { get; set; }
+ ///
+ /// امضاء قراداد
+ ///
+ public bool SignContract { get; set; }
+ ///
+ /// ایجات تصفیه حساب
+ ///
+ public bool CreateCheckout { get; set; }
+ ///
+ /// امضاء تصفیه حساب
+ ///
+ public bool SignCheckout { get; set; }
+ ///
+ /// تصفیه حساب بصورت استاتیک محاصبه شود
+ ///
+ public bool IsStaticCheckout { get; set; }
+ ///
+ /// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
+ /// این آیتم
+ /// True
+ /// است
+ ///
+ public IsActive CutContractEndOfYear { get; set; }
+ ///
+ /// سرویس تصفیه حساب سفارشی
+ ///
+ public string HasCustomizeCheckoutService { get; set; }
+
+ ///
+ /// محاسبه اضافه کار فیش حقوقی در لیست بیمه
+ ///
+ public bool InsuranceCheckoutOvertime { get; set; }
+ ///
+ /// محاسبه حق اولاد در لیست بیمه
+ ///
+ public bool InsuranceCheckoutFamilyAllowance { get; set; }
+ ///
+ /// حضور و غیاب رایگان ویژه
+ ///
+ public string HasRollCallFreeVip { get; set; }
+ ///
+ /// مدت قرارداد
+ ///
+ public string ContractTerm { get; set; }
+ ///
+ /// مخفی کردن کل پرداخت
+ ///
+ public bool TotalPaymentHide { get; set; }
+ ///
+ /// نوع ارسال بیمه
+ ///
+ public string TypeOfInsuranceSend { get; set; }
+ ///
+ /// کد بیمه
+ ///
+ public string InsuranceCode { get; set; }
+
+ ///
+ /// مشمول دستمزد مقطوع
+ ///
+ public bool FixedSalary { get; set; }
+
+ ///
+ /// صنف
+ ///
+ public long InsuranceJobId { get; set; }
+
+ ///
+ /// جمعیت شهر
+ ///
+ public string Population { get; set; }
+
+ ///
+ /// شماره تماس نماینده کارگاه
+ ///
+ public string AgentPhone { get; set; }
+
+ public string TypeOfContract { get; set; }
+ ///
+ /// ردیف پیمان
+ ///
+ public string AgreementNumber { get; set; }
+
+ ///
+ /// نوع محاسبه طلب مرخصی
+ ///
+ public string ComputeOptions { get; set; }
+
+ ///
+ /// نوع محسبه عیدی و پاداش
+ ///
+ public string BonusesOptions { get; set; }
+ ///
+ /// نوع محاسبه سنوات
+ ///
+ public string YearsOptions { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Workshop/createContractModel.cs b/CompanyManagment.App.Contracts/Workshop/createContractModel.cs
index 347d21f6..678af61e 100644
--- a/CompanyManagment.App.Contracts/Workshop/createContractModel.cs
+++ b/CompanyManagment.App.Contracts/Workshop/createContractModel.cs
@@ -38,6 +38,46 @@ public class createContractModel
public long YearlySalaryId { get; set; }
public long EmployerId { get; set; }
-
+
+ ///
+ /// دستمزد روزانه خام بعد از تاثیر ساعت کار
+ ///
+ public double DailySalaryAffected { get; set; }
+
+ ///
+ /// پایه سنوات بعد از تاثیر ساعت کار
+ ///
+ public double BaseYearAffected { get; set; }
+
+
+ ///
+ /// دستمزد روزانه قبل از تاثیر ساعت کار
+ ///
+ public double DailySalaryUnAffected { get; set; }
+
+ ///
+ /// دستمزد روزانه دریافت شده از سمت فرانت
+ ///
+ public string DailySalaryUnAffectedStr { get; set; }
+
+ ///
+ /// مزد سالانه نرمال دریافت از سمت فرانت
+ ///
+ public string NormalDailyWage { get; set; }
+
+ ///
+ /// پایه سنوات قبل از تاثیر ساعت کار
+ ///
+ public double BaseYearUnAffected { get; set; }
+
+ ///
+ /// آیا دستمزد روزانه دستی وارد شده است؟
+ ///
+ public bool HasManualDailyWage { get; set; }
+
+ ///
+ /// نوع دستمزد انتخاب شده
+ ///
+ public string DailyWageType { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/YearlySalary/BaseYearDataViewModel.cs b/CompanyManagment.App.Contracts/YearlySalary/BaseYearDataViewModel.cs
new file mode 100644
index 00000000..058e3dc2
--- /dev/null
+++ b/CompanyManagment.App.Contracts/YearlySalary/BaseYearDataViewModel.cs
@@ -0,0 +1,97 @@
+using System;
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.YearlySalary;
+
+///
+/// دیتای پایه سنوات از اولین شروع بکار پرسنل
+///
+public class BaseYearDataViewModel
+{
+ ///
+ /// آی دی پرسنل
+ ///
+ public long EmployeeId { get; set; }
+
+ ///
+ /// آی دی کارگاه
+ ///
+ public long WorkshopId { get; set; }
+
+
+ ///
+ /// پایه سنوات محاسبه شده نهایی
+ ///
+ public double BaseYearResult { get; set; }
+
+ ///
+ /// اولین روز شروع بکار
+ ///
+ public string FirstWorkDayInLeftWork { get; set; }
+
+ ///
+ /// لیست تمام پایه سنوات های محاسبه شده
+ ///
+ public List BaseYearDataList { get; set; }
+}
+
+///
+/// لیست تمام پایه سنوات های محاسبه شده
+///
+public class BaseYearDataList
+{
+ ///
+ /// پایه سنوات
+ ///
+ public double BaseYear { get; set; }
+
+ ///
+ /// تاریخ میلادی شروع محاسبه پایه سنوات
+ ///
+ public DateTime StartDateGr { get; set; }
+
+ ///
+ /// تاریخ میلادی پایان محاسبه پایه سنوات
+ ///
+ public DateTime EndDateGr { get; set; }
+
+ ///
+ /// تاریخ شمسی شروع محاسبه پایه سنوات
+ ///
+ public string StartDateFa { get; set; }
+
+ ///
+ /// تاریخ شمسی پایان محاسبه پایه سنوات
+ ///
+ public string EndDateFa { get; set; }
+
+ ///
+ /// سالی که در آن پایه سنوات تعلق گرفته
+ ///
+ public string Year { get; set; }
+
+ ///
+ ///روزی که پایه سنوات تعلق گرفته
+ ///یا شروع بکار. ترک کار
+ /// شمسی
+ ///
+ public string BaseYearPayDay { get; set; }
+
+ ///
+ /// روزی که پایه سنوات تعلق گرفته
+ ///یا شروع بکار. ترک کار
+ /// میلادی
+ ///
+ public DateTime BaseYearPayDayGr { get; set; }
+
+
+
+ ///
+ /// آیا تاریخ شروع بکار دارد
+ ///
+ public bool HasStartWork { get; set; }
+ ///
+ /// آیا تاریخ پایان کار دارد
+ ///
+ public bool HasLeftWork { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/YearlySalary/IYearlySalaryApplication.cs b/CompanyManagment.App.Contracts/YearlySalary/IYearlySalaryApplication.cs
index 42e5b33e..1ed7d4c5 100644
--- a/CompanyManagment.App.Contracts/YearlySalary/IYearlySalaryApplication.cs
+++ b/CompanyManagment.App.Contracts/YearlySalary/IYearlySalaryApplication.cs
@@ -2,7 +2,9 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using _0_Framework.Application;
+using CompanyManagment.App.Contracts.Contract;
using CompanyManagment.App.Contracts.Holiday;
+using CompanyManagment.App.Contracts.LeftWork;
namespace CompanyManagment.App.Contracts.YearlySalary;
@@ -14,6 +16,35 @@ public interface IYearlySalaryApplication
OperationResult Err();
EditYearlySalary GetDetails(long id);
List GetYearlySalary();
+
+ ///
+ /// متد ارتقاء مزد دلخواه
+ ///
+ ///
+ ///
+ ///
+ ///
+ Task UpgradeManualDailyWage(DateTime newContractStart, DateTime lastContractStart,
+ double lastContractManualDailyWage);
+
+ ///
+ /// متد محاسبه پایه سنوات و لیست پایه سنوات های پرسنل
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ Task BaseYearComputeByContractId(long contractId);
+ ///
+ /// دریافت مزد روزانه بر اساس تاریخ شروع و پایان
+ ///
+ ///
+ ///
+ ///
+ Task<(double dailyWage, long yearlySalaryId)> GetDailyWageByStartEnd(DateTime start, DateTime end);
+
List Search(YearlySalarySearchModel searchModel);
EditYearlySalary GetDetailsBySearchModel(YearlySalarySearchModel searchModel);
diff --git a/CompanyManagment.Application/AuthorizedBankDetailsApplication.cs b/CompanyManagment.Application/AuthorizedBankDetailsApplication.cs
new file mode 100644
index 00000000..b3a88421
--- /dev/null
+++ b/CompanyManagment.Application/AuthorizedBankDetailsApplication.cs
@@ -0,0 +1,70 @@
+using System;
+using System.Collections.Generic;
+using _0_Framework.Application;
+using Company.Application.Contracts.AuthorizedBankDetails;
+using Company.Domain.AuthorizedBankDetailsAgg;
+
+namespace CompanyManagment.Application
+{
+ public class AuthorizedBankDetailsApplication : IAuthorizedBankDetailsApplication
+ {
+ private readonly IAuthorizedBankDetailsRepository _authorizedBankDetailsRepository;
+
+ public AuthorizedBankDetailsApplication(IAuthorizedBankDetailsRepository authorizedBankDetailsRepository)
+ {
+ _authorizedBankDetailsRepository = authorizedBankDetailsRepository;
+ }
+
+ public OperationResult Create(CreateAuthorizedBankDetails command)
+ {
+ var operation = new OperationResult();
+
+ if (_authorizedBankDetailsRepository.Exists(x => x.CardNumber == command.CardNumber &&
+ x.AccountNumber == command.AccountNumber &&
+ x.IBan == command.IBan))
+ return operation.Failed(ApplicationMessages.DuplicatedRecord);
+
+ var ownersList = new List();
+ if (command.OwnersList != null && command.OwnersList.Count > 0)
+ {
+ foreach (var owner in command.OwnersList)
+ {
+ var bankDetailsOwner = new AuthorizedBankDetailsOwner(
+ owner.FName,
+ owner.LName,
+ owner.NationalIdentifier,
+ owner.CustomerType
+ );
+ ownersList.Add(bankDetailsOwner);
+ }
+ }
+
+ var authorizedBankDetails = new AuthorizedBankDetails(
+ command.CardNumber,
+ command.AccountNumber,
+ command.IBan,
+ command.BankName,
+ ownersList
+ );
+
+ _authorizedBankDetailsRepository.Create(authorizedBankDetails);
+ _authorizedBankDetailsRepository.SaveChanges();
+ return operation.Succcedded();
+ }
+
+ public EditAuthorizedBankDetails GetDetails(long id)
+ {
+ return _authorizedBankDetailsRepository.GetDetails(id);
+ }
+
+ public List Search(AuthorizedBankDetailsSearchModel searchModel)
+ {
+ return _authorizedBankDetailsRepository.Search(searchModel);
+ }
+
+ public AuthorizedBankDetailsViewModel GetByIban(string iban)
+ {
+ return _authorizedBankDetailsRepository.GetByIban(iban);
+ }
+ }
+}
diff --git a/CompanyManagment.Application/AuthorizedPersonApplication.cs b/CompanyManagment.Application/AuthorizedPersonApplication.cs
new file mode 100644
index 00000000..075e1e38
--- /dev/null
+++ b/CompanyManagment.Application/AuthorizedPersonApplication.cs
@@ -0,0 +1,119 @@
+using System.Collections.Generic;
+using System.Linq;
+using _0_Framework.Application;
+using Company.Domain.AuthorizedPersonAgg;
+using CompanyManagment.App.Contracts.AuthorizedPerson;
+
+namespace CompanyManagment.Application;
+
+public class AuthorizedPersonApplication : IAuthorizedPersonApplication
+{
+ private readonly IAuthorizedPersonRepository _authorizedPersonRepository;
+
+ public AuthorizedPersonApplication(IAuthorizedPersonRepository authorizedPersonRepository)
+ {
+ _authorizedPersonRepository = authorizedPersonRepository;
+ }
+
+ public OperationResult Create(CreateAuthorizedPerson command)
+ {
+ var operation = new OperationResult();
+
+ if (_authorizedPersonRepository.ExistsByNationalCode(command.NationalCode))
+ return operation.Failed("شخص با این کد ملی قبلاً ثبت شده است");
+
+ var authorizedPerson = new AuthorizedPerson(
+ command.NationalCode, command.FirstName, command.LastName,
+ command.FatherName, command.BirthDate, command.Gender,
+ command.DeathStatus, command.ShenasnameSeri,
+ command.ShenasnameSerial, command.ShenasnamehNumber);
+
+ _authorizedPersonRepository.Create(authorizedPerson);
+ _authorizedPersonRepository.SaveChanges();
+
+ return operation.Succcedded();
+ }
+
+ public OperationResult CreateFromUidResponse(CreateAuthorizedPerson command)
+ {
+ var operation = new OperationResult();
+
+ var existingPerson = _authorizedPersonRepository.GetByNationalCode(command.NationalCode);
+ if (existingPerson != null)
+ {
+ existingPerson.UpdatePersonalInfo(command.FirstName, command.LastName,
+ command.FatherName, command.Gender, command.DeathStatus);
+ _authorizedPersonRepository.SaveChanges();
+ return operation.Succcedded();
+ }
+
+ var authorizedPerson = new AuthorizedPerson(
+ command.NationalCode, command.FirstName, command.LastName,
+ command.FatherName, command.BirthDate, command.Gender,
+ command.DeathStatus, command.ShenasnameSeri,
+ command.ShenasnameSerial, command.ShenasnamehNumber);
+
+ _authorizedPersonRepository.Create(authorizedPerson);
+ _authorizedPersonRepository.SaveChanges();
+
+ return operation.Succcedded();
+ }
+
+ public AuthorizedPersonViewModel GetByNationalCode(string nationalCode)
+ {
+ var authorizedPerson = _authorizedPersonRepository.GetByNationalCode(nationalCode);
+ if (authorizedPerson == null) return null;
+
+ return new AuthorizedPersonViewModel
+ {
+ Id = authorizedPerson.id,
+ NationalCode = authorizedPerson.NationalCode,
+ FirstName = authorizedPerson.FirstName,
+ LastName = authorizedPerson.LastName,
+ FatherName = authorizedPerson.FatherName,
+ BirthDate = authorizedPerson.BirthDate,
+ Gender = authorizedPerson.Gender,
+ DeathStatus = authorizedPerson.DeathStatus,
+ ShenasnameSeri = authorizedPerson.ShenasnameSeri,
+ ShenasnameSerial = authorizedPerson.ShenasnameSerial,
+ ShenasnamehNumber = authorizedPerson.ShenasnamehNumber,
+ IsVerified = authorizedPerson.IsVerified,
+ VerificationDate = authorizedPerson.VerificationDate?.ToString("yyyy/MM/dd HH:mm"),
+ CreationDate = authorizedPerson.CreationDate.ToString("yyyy/MM/dd HH:mm")
+ };
+ }
+
+ public List Search(string nationalCode = null, string firstName = null, string lastName = null)
+ {
+ var allPersons = _authorizedPersonRepository.Get();
+
+ var filteredPersons = allPersons.Where(x =>
+ (string.IsNullOrEmpty(nationalCode) || x.NationalCode.Contains(nationalCode)) &&
+ (string.IsNullOrEmpty(firstName) || x.FirstName.Contains(firstName)) &&
+ (string.IsNullOrEmpty(lastName) || x.LastName.Contains(lastName)))
+ .Select(x => new AuthorizedPersonViewModel
+ {
+ Id = x.id,
+ NationalCode = x.NationalCode,
+ FirstName = x.FirstName,
+ LastName = x.LastName,
+ FatherName = x.FatherName,
+ BirthDate = x.BirthDate,
+ Gender = x.Gender,
+ DeathStatus = x.DeathStatus,
+ ShenasnameSeri = x.ShenasnameSeri,
+ ShenasnameSerial = x.ShenasnameSerial,
+ ShenasnamehNumber = x.ShenasnamehNumber,
+ IsVerified = x.IsVerified,
+ VerificationDate = x.VerificationDate?.ToString("yyyy/MM/dd HH:mm"),
+ CreationDate = x.CreationDate.ToString("yyyy/MM/dd HH:mm")
+ }).ToList();
+
+ return filteredPersons;
+ }
+
+ public bool ExistsByNationalCode(string nationalCode)
+ {
+ return _authorizedPersonRepository.ExistsByNationalCode(nationalCode);
+ }
+}
diff --git a/CompanyManagment.Application/CheckoutApplication.cs b/CompanyManagment.Application/CheckoutApplication.cs
index 7f6e34a5..8768f70e 100644
--- a/CompanyManagment.Application/CheckoutApplication.cs
+++ b/CompanyManagment.Application/CheckoutApplication.cs
@@ -152,17 +152,38 @@ public class CheckoutApplication : ICheckoutApplication
var housingAllowance = command.HousingAllowance.MoneyToDouble();
//حق تاهل
var marriedAllowance = command.MarriedAllowance.MoneyToDouble();
- var MontlyYearsBunos =
- _yearlySalaryRepository.GetMontlyBunosYears(command.WeeklyTime, command.ContractStartGr, command.ContractEndGr, dayliWage, command.WorkingWeeklyTime, command.officialholiday, command.friday, command.TotalHolidaysAndNotH, command.TotalHolidaysAndNotM, command.Basic, command.FridayStarttoEnd, command.DailFeeComplete, command.HasRollCall, command.HolidayWorking, command.ShiftWork);
- //دستمزد ماهانه
- var monthlyWage = MontlyYearsBunos.MontlyWage;
- //سنوات
- var years = command.YearsPay;
+ //var MontlyYearsBunos =
+ //_yearlySalaryRepository.GetMontlyBunosYears(command.WeeklyTime, command.ContractStartGr, command.ContractEndGr, dayliWage, command.WorkingWeeklyTime, command.officialholiday, command.friday, command.TotalHolidaysAndNotH, command.TotalHolidaysAndNotM, command.Basic, command.FridayStarttoEnd, command.DailFeeComplete, command.HasRollCall, command.HolidayWorking, command.ShiftWork);
+ //دستمزد ماهانه
+
+ #region Salary
+
+ var totalDays = (command.ContractEndGr - command.ContractStartGr).TotalDays + 1;
+
+ var mandatoryDays = totalDays - command.FridayStarttoEnd - command.officialholiday;
+
+ if (!command.HasRollCall && command.ShiftWork != "4")
+ mandatoryDays = totalDays - command.FridayStarttoEnd;
+ var monthlyWage = command.DailySalaryAffected * totalDays;
+
+ //پایه سنوات
+ var bacicYears = command.BaseYearAffected * totalDays;
+ #endregion
+
+ //سنوات
+ var years = command.YearsPay;
//عیدی و پاداش
var bunos = command.BonusesPay;
- //پایه سنوات
- var bacicYears = MontlyYearsBunos.BasicYears;
- var sumOfWorkingDays = MontlyYearsBunos.SumOfWorkingDay;
+
+ //فاطمه احمدژاد === موقت عیدی و پاداش و سنوات حساب نشه
+ if (command.EmployeeId == 45104 && command.WorkshopId == 315)
+ {
+ years = 0;
+
+ bunos = 0;
+ }
+
+ var sumOfWorkingDays = $"{totalDays}";
if (command.friday > 0)
{
var fridayPercent = dayliWage * 40 / 100;
@@ -172,8 +193,19 @@ public class CheckoutApplication : ICheckoutApplication
//حق بیمه سهم کارگر
#region InsuranceDeduction
- var insuranceOverTime = command.HasInsuranceChekoutOverTime ? command.OvertimePay : 0;
- var insuranceDeduction = (monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance + insuranceOverTime) * 7 / 100;
+ double insuranceDeduction = 0;
+ bool hasInsuranceShareTheSameAsList = false;
+ if (command.InsuranceDeduction == 0)
+ {
+ var insuranceOverTime = command.HasInsuranceChekoutOverTime ? command.OvertimePay : 0;
+ insuranceDeduction = (monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance + insuranceOverTime) * 7 / 100;
+ }
+ else
+ {
+ insuranceDeduction = command.InsuranceDeduction;
+ hasInsuranceShareTheSameAsList = true;
+ }
+
#endregion
@@ -184,7 +216,8 @@ public class CheckoutApplication : ICheckoutApplication
{
command.AbsenceDeduction = command.AbsenceDeduction - command.OvertimePay;
command.OvertimePay = 0;
- }
+ command.OverTimeWorkValue = "00:00";
+ }
else
{
command.OvertimePay = command.OvertimePay - command.AbsenceDeduction;
@@ -199,11 +232,11 @@ public class CheckoutApplication : ICheckoutApplication
.Select(x => new CheckoutSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa, x.CalculationDateTimeGe, x.CalculationDateTimeFa, x.Id)).ToList();
command.SalaryAidDeduction = salaryAids.Sum(x => x.Amount.MoneyToDouble());
-
-
+
var loanInstallments = _rollCallMandatoryRepository.LoanInstallmentForCheckout(command.EmployeeId,
- command.WorkshopId, command.ContractStartGr, command.ContractEndGr)
- .Select(x => new CheckoutLoanInstallment(x.Amount, x.Month, x.Year, x.IsActive, x.RemainingAmount, x.LoanAmount, x.Id)).ToList();
+ command.WorkshopId, command.ContractStartGr, command.HasLeft ? DateTime.MaxValue : command.ContractEndGr)
+ .Select(x =>
+ new CheckoutLoanInstallment(x.Amount, x.Month, x.Year, x.IsActive, x.RemainingAmount, x.LoanAmount, x.Id)).ToList();
command.InstallmentDeduction = loanInstallments.Sum(x => x.AmountForMonth.MoneyToDouble());
@@ -345,8 +378,7 @@ public class CheckoutApplication : ICheckoutApplication
{
command.Signature = "0";
}
-
-
+
var checkout = new Checkout(command.EmployeeFullName, command.FathersName, command.NationalCode
, command.DateOfBirth, command.EmployeeId, command.WorkshopName, command.WorkshopId, command.ContractNo, command.ContractStartGr, command.ContractEndGr, month, year,
@@ -354,7 +386,7 @@ public class CheckoutApplication : ICheckoutApplication
, command.OvertimePay, command.NightworkPay, command.FridayPay, 0, command.ShiftPay, familyAllowance, bunos, years, command.LeavePay, insuranceDeduction, 0, command.InstallmentDeduction, command.SalaryAidDeduction, command.AbsenceDeduction, sumOfWorkingDays,
command.ArchiveCode, command.PersonnelCode, totalClaims, totalDeductions, totalPayment, command.Signature, marriedAllowance, command.LeaveCheckout, command.CreditLeaves, command.AbsencePeriod, command.AverageHoursPerDay, command.HasRollCall, command.OverTimeWorkValue, command.OverNightWorkValue
, command.FridayWorkValue, command.RotatingShiftValue, command.AbsenceValue, command.TotalDayOfLeaveCompute, command.TotalDayOfYearsCompute, command.TotalDayOfBunosesCompute,
- loanInstallments, salaryAids,checkoutRollCall);
+ loanInstallments, salaryAids,checkoutRollCall,command.EmployeeMandatoryHours, hasInsuranceShareTheSameAsList);
_checkoutRepository.CreateCkeckout(checkout).GetAwaiter().GetResult();
//_checkoutRepository.SaveChanges();
@@ -497,6 +529,7 @@ public class CheckoutApplication : ICheckoutApplication
x.TotalPresentTimeStr =
Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-");
x.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-");
+
}
});
diff --git a/CompanyManagment.Application/ContactUsApplication.cs b/CompanyManagment.Application/ContactUsApplication.cs
new file mode 100644
index 00000000..d1912132
--- /dev/null
+++ b/CompanyManagment.Application/ContactUsApplication.cs
@@ -0,0 +1,70 @@
+using System.Text.RegularExpressions;
+using _0_Framework.Application;
+using Company.Domain.ContactUsAgg;
+using CompanyManagment.App.Contracts.ContactUs;
+
+namespace CompanyManagment.Application;
+
+public class ContactUsApplication : IContactUsApplication
+{
+ private readonly IContactUsRepository _contactUsRepository;
+
+ public ContactUsApplication(IContactUsRepository contactUsRepository)
+ {
+ _contactUsRepository = contactUsRepository;
+ }
+
+ public OperationResult Create(CreateContactUs command)
+ {
+ var op = new OperationResult();
+ if (string.IsNullOrWhiteSpace(command.FirstName))
+ {
+ return op.Failed("لطفا نام خود را وارد کنید");
+ }
+
+ if (string.IsNullOrWhiteSpace(command.LastName))
+ {
+ return op.Failed("لطفا نام خانوادگی خود را وارد کنید");
+ }
+
+ if (string.IsNullOrWhiteSpace(command.Email))
+ {
+ return op.Failed("لطفا ایمیل خود را وارد کنید");
+ }
+
+ if (string.IsNullOrWhiteSpace(command.PhoneNumber))
+ {
+ return op.Failed("لطفا شماره تماس خود را وارد کنید");
+ }
+
+ if (!Regex.IsMatch(command.PhoneNumber, @"^(\+98|0)?9\d{9}$"))
+ {
+ return op.Failed("شماره تماس وارد شده نامعتبر است");
+ }
+
+ if (!Regex.IsMatch(command.Email, @"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$"))
+ {
+ return op.Failed("ایمیل وارد شده نامعتبر است");
+ }
+
+ if (string.IsNullOrWhiteSpace(command.Title))
+ {
+ return op.Failed("لطفا عنوان پیغام خود را وارد کنید");
+ }
+
+ if (string.IsNullOrWhiteSpace(command.Message))
+ {
+ return op.Failed("لطفا پیغام خود را وارد کنید");
+ }
+
+ var entity = new ContactUs(command.FirstName, command.LastName, command.Email, command.PhoneNumber,
+ command.Title, command.Message);
+
+ _contactUsRepository.Create(entity);
+
+ _contactUsRepository.SaveChanges();
+
+ return op.Succcedded();
+
+ }
+}
\ No newline at end of file
diff --git a/CompanyManagment.Application/ContractApplication.cs b/CompanyManagment.Application/ContractApplication.cs
index 4d670a54..085616ea 100644
--- a/CompanyManagment.Application/ContractApplication.cs
+++ b/CompanyManagment.Application/ContractApplication.cs
@@ -78,6 +78,11 @@ public class ContractApplication : IContractApplication
}
+ public async Task GetManualDailWage(long workshopId, long employeeId, long yearlySalaryId, DateTime contractStart)
+ {
+ return await _contractRepository.GetManualDailWage(workshopId, employeeId, yearlySalaryId, contractStart);
+ }
+
public OperationResult Create(CreateContract command)
{
var yearlysalaryList = _yearlySalaryRepository.GetYearlySalary();
@@ -142,7 +147,9 @@ public class ContractApplication : IContractApplication
yearlySalarId,
start, end, command.DayliWage, command.ArchiveCode, getWorkdate, setContractDate,
command.JobType, command.ContractType, command.WorkshopAddress1, command.WorkshopAddress2,
- command.ConsumableItems, command.JobTypeId, command.HousingAllowance, command.AgreementSalary, command.WorkingHoursWeekly, command.FamilyAllowance, command.ContractPeriod);
+ command.ConsumableItems, command.JobTypeId, command.HousingAllowance, command.AgreementSalary,
+ command.WorkingHoursWeekly, command.FamilyAllowance, command.ContractPeriod,command.DailySalaryAffected,
+ command.BaseYearAffected, command.DailySalaryUnAffected,command.BaseYearUnAffected, command.HasManualDailyWage, command.DailyWageType);
_contractRepository.Create(makeContract);
_contractRepository.SaveChanges();
@@ -356,7 +363,9 @@ public class ContractApplication : IContractApplication
command.YearlySalaryId,
start, end, command.DayliWage, command.ArchiveCode, getWorkdate, setContractDate,
command.JobName, command.ContractType, command.WorkshopAddress1, command.WorkshopAddress2,
- command.ConsumableItems, command.JobId, command.HousingAllowance, "0", command.WorkingHoursWeekly, command.FamilyAllowance, command.ContractPeriod);
+ command.ConsumableItems, command.JobId, command.HousingAllowance, "0", command.WorkingHoursWeekly, command.FamilyAllowance, command.ContractPeriod,
+ command.DailySalaryAffected,
+ command.BaseYearAffected, command.DailySalaryUnAffected, command.BaseYearUnAffected, command.HasManualDailyWage, command.DailyWageType);
_contractRepository.Create(makeContract);
_contractRepository.SaveChanges();
diff --git a/CompanyManagment.Application/ContractingPartyBankAccountsApplication.cs b/CompanyManagment.Application/ContractingPartyBankAccountsApplication.cs
new file mode 100644
index 00000000..c06e5729
--- /dev/null
+++ b/CompanyManagment.Application/ContractingPartyBankAccountsApplication.cs
@@ -0,0 +1,219 @@
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading.Tasks;
+using _0_Framework.Application;
+using _0_Framework.Application.UID;
+using _0_Framework.Exceptions;
+using Company.Domain.ContarctingPartyAgg;
+using Company.Domain.ContractingPartyBankAccountsAgg;
+using CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
+using CompanyManagment.App.Contracts.PersonalContractingParty;
+
+namespace CompanyManagment.Application;
+
+public class ContractingPartyBankAccountsApplication : IContractingPartyBankAccountsApplication
+{
+ private readonly IContractingPartyBankAccountsRepository _contractingPartyBankAccountsRepository;
+ private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository;
+ private readonly IUidService _uidService;
+
+ public ContractingPartyBankAccountsApplication(
+ IContractingPartyBankAccountsRepository contractingPartyBankAccountsRepository,
+ IPersonalContractingPartyRepository personalContractingPartyRepository, IUidService uidService)
+ {
+ _contractingPartyBankAccountsRepository = contractingPartyBankAccountsRepository;
+ _personalContractingPartyRepository = personalContractingPartyRepository;
+ _uidService = uidService;
+ }
+
+ public async Task Create(CreateContractingPartyBankAccounts command)
+ {
+ var operationResult = new OperationResult();
+
+ if (!_personalContractingPartyRepository.Exists(x => x.id == command.ContractingPartyId))
+ return operationResult.Failed("طرف حساب مورد نظر یافت نشد");
+
+ if (string.IsNullOrWhiteSpace(command.CardNumber))
+ return operationResult.Failed("شماره کارت خود را وارد کنید");
+
+ if (string.IsNullOrWhiteSpace(command.AccountNumber))
+ return operationResult.Failed("شماره حساب خود را وارد کنید");
+
+ if (string.IsNullOrWhiteSpace(command.IBan))
+ return operationResult.Failed("شماره شبا خود را وارد کنید");
+
+ if (string.IsNullOrWhiteSpace(command.AccountHolderName))
+ return operationResult.Failed("نام صاحب حساب را وارد کنید");
+
+ var entity = new ContractingPartyBankAccount(command.ContractingPartyId, command.CardNumber,
+ command.AccountHolderName, command.AccountNumber, command.IBan, command.IsAuth);
+
+ await _contractingPartyBankAccountsRepository.CreateAsync(entity);
+
+ await _contractingPartyBankAccountsRepository.SaveChangesAsync();
+
+ return operationResult.Succcedded();
+ }
+
+ public async Task Create(List commands)
+ {
+ var operationResult = new OperationResult();
+ foreach (var command in commands)
+ {
+ if (!_personalContractingPartyRepository.Exists(x => x.id == command.ContractingPartyId))
+ return operationResult.Failed("طرف حساب مورد نظر یافت نشد");
+
+ if (command.IsAuth)
+ {
+ if (string.IsNullOrWhiteSpace(command.CardNumber))
+ return operationResult.Failed("شماره کارت خود را وارد کنید");
+
+ if (string.IsNullOrWhiteSpace(command.AccountNumber))
+ return operationResult.Failed("شماره حساب خود را وارد کنید");
+
+ if (string.IsNullOrWhiteSpace(command.IBan))
+ return operationResult.Failed("شماره شبا خود را وارد کنید");
+ }
+ else if (string.IsNullOrWhiteSpace(command.CardNumber) &&
+ string.IsNullOrWhiteSpace(command.AccountNumber) &&
+ string.IsNullOrWhiteSpace(command.IBan))
+ {
+ return operationResult.Failed(
+ " حداقل یکی از اطلاعات بانکی را وارد کنید: شماره کارت، شماره حساب یا شماره شبا");
+ }
+
+ if (string.IsNullOrWhiteSpace(command.AccountHolderName))
+ {
+ return operationResult.Failed("نام صاحب حساب را وارد کنید");
+ }
+
+
+ var entity = new ContractingPartyBankAccount(command.ContractingPartyId, command.CardNumber,
+ command.AccountHolderName, command.AccountNumber, command.IBan, command.IsAuth);
+
+ await _contractingPartyBankAccountsRepository.CreateAsync(entity);
+ }
+
+ await _contractingPartyBankAccountsRepository.SaveChangesAsync();
+
+ return operationResult.Succcedded();
+ }
+
+ public async Task GetList(
+ ContractingPartyBankAccountSearchModel searchModel)
+ {
+ return await _contractingPartyBankAccountsRepository.GetList(searchModel);
+ }
+
+ public async Task> ContractingPartyOrAccountHolderNameSelectList(string search,
+ string selected)
+ {
+ return await _contractingPartyBankAccountsRepository.ContractingPartyOrAccountHolderNameSelectList(search,
+ selected);
+ }
+
+ public async Task> CardNumberSelectList(string search, string selected)
+ {
+ return await _contractingPartyBankAccountsRepository.CardNumberSelectList(search, selected);
+ }
+
+ public async Task> IBanSelectList(string search, string selected)
+ {
+ return await _contractingPartyBankAccountsRepository.IBanSelectList(search, selected);
+ }
+
+ public async Task> AccountNumberSelectList(string search, string selected)
+ {
+ return await _contractingPartyBankAccountsRepository.AccountNumberSelectList(search, selected);
+ }
+
+ public async Task> GetAccountHolderNameSelectList(string search, string selected)
+ {
+ return await _contractingPartyBankAccountsRepository.GetAccountHolderNameSelectList(search, selected);
+ }
+
+ public async Task> ContractingPartyNamesSelectList(string search, string selected)
+ {
+ return await _contractingPartyBankAccountsRepository.ContractingPartyNamesSelectList(search, selected);
+ }
+
+ public async Task InquiryContractingPartyBankDetails(
+ InquiryContractingPartyBankDetailsRequest command)
+ {
+ var iBan = command.IBan;
+ var cardNumber = command.CardNumber;
+ var accountNumber = command.AccountNumber;
+ var uidBank = command.UidBank;
+ ContractingPartyBankInquiryResponse result = new ContractingPartyBankInquiryResponse();
+ if (!string.IsNullOrWhiteSpace(iBan))
+ {
+ if (!iBan.IsvalidIban())
+ {
+ throw new BadRequestException("شماره شبا وارد شده معتبر نمی باشد");
+ }
+
+ var response = await _uidService.IbanInquiry(iBan);
+ if (response.ResponseContext.Status.Code != 0)
+ {
+ throw new BadRequestException("خطای احراز هویت. کد خطا: " + response.ResponseContext.Status.Code);
+ }
+
+ var owner = response.Owners.FirstOrDefault();
+ var ownerFirstName = owner != null ? $"{owner.FirstName} {owner.LastName}" : "";
+ result.FullName = ownerFirstName;
+ result.AccountNumber = response.AccountBasicInformation.AccountNumber;
+ result.Iban = response.AccountBasicInformation.Iban;
+ }
+ else if (!string.IsNullOrWhiteSpace(cardNumber))
+ {
+ if (!cardNumber.IsValidCardNumber())
+ {
+ throw new BadRequestException("شماره کارت وارد شده معتبر نمی باشد");
+ }
+
+ var bankCardRes = await _uidService.CardToIban(cardNumber);
+ if (bankCardRes.ResponseContext.Status.Code != 0)
+ {
+ throw new BadRequestException("خطای احراز هویت. کد خطا: " + bankCardRes.ResponseContext.Status.Code);
+ }
+
+ var response = await _uidService.IbanInquiry(bankCardRes.Iban);
+ if (response.ResponseContext.Status.Code != 0)
+ {
+ throw new BadRequestException("خطای احراز هویت. کد خطا: " + response.ResponseContext.Status.Code);
+ }
+
+ var owner = response.Owners.FirstOrDefault();
+ var ownerFirstName = owner != null ? $"{owner.FirstName} {owner.LastName}" : "";
+ result.FullName = ownerFirstName;
+ result.AccountNumber = response.AccountBasicInformation.AccountNumber;
+ result.CardNumber = cardNumber;
+ result.Iban = response.AccountBasicInformation.Iban;
+ }
+ else if (!string.IsNullOrWhiteSpace(accountNumber))
+ {
+ var accountNumberRes = await _uidService.AccountToIban(accountNumber, uidBank.Value);
+ if (accountNumberRes.ResponseContext.Status.Code != 0)
+ {
+ throw new BadRequestException(
+ "خطای احراز هویت. کد خطا: " + accountNumberRes.ResponseContext.Status.Code);
+ }
+
+ var response = await _uidService.IbanInquiry(accountNumberRes.Iban);
+
+ var owner = response.Owners.FirstOrDefault();
+ var ownerFirstName = owner != null ? $"{owner.FirstName} {owner.LastName}" : "";
+ result.FullName = ownerFirstName;
+ result.AccountNumber = response.AccountBasicInformation.AccountNumber;
+ result.Iban = response.AccountBasicInformation.Iban;
+ }
+ else
+ {
+ throw new BadRequestException(
+ "حداقل یکی از اطلاعات بانکی را وارد کنید: شماره کارت، شماره حساب یا شماره شبا");
+ }
+
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/CompanyManagment.Application/CustomizeCheckoutApplication.cs b/CompanyManagment.Application/CustomizeCheckoutApplication.cs
index 7e325e2c..8c41e745 100644
--- a/CompanyManagment.Application/CustomizeCheckoutApplication.cs
+++ b/CompanyManagment.Application/CustomizeCheckoutApplication.cs
@@ -319,7 +319,10 @@ namespace CompanyManagment.Application
if (workshopId == 170)
{
- var exceptionEmployeeIds = _customizeWorkshopGroupSettingsRepository.GetEmployeeSettingsByGroupSettingsId(117).Select(x => x.EmployeeId).ToList();
+ var exceptionEmployeeIds = _customizeWorkshopGroupSettingsRepository
+ .GetEmployeeSettingsByGroupSettingsId(117)
+ .Select(x => x.EmployeeId)
+ .Where(x=> workshopLeftWorksInMonth.Select(l=>l.EmployeeId).Contains(x)).ToList();
foreach (var employeesId in exceptionEmployeeIds)
{
@@ -370,7 +373,9 @@ namespace CompanyManagment.Application
Color = color,
PersonnelCode = personnelCodes.FirstOrDefault(y => x.Id == y.EmployeeId)?.PersonnelCode.ToString() ?? "-"
};
- }).OrderByDescending(x => x.IsEligible).ThenByDescending(x => x.Reason).ToList();
+ }).OrderBy(x => x.Color switch { "orange" => 0, "white" => 1, "red" => 2, "green" => 3, "black" => 4, _ => 5 })
+ .ToList();
+
return op.Succcedded(employees);
}
}
diff --git a/CompanyManagment.Application/CustomizeCheckoutTempApplication.cs b/CompanyManagment.Application/CustomizeCheckoutTempApplication.cs
index a6fb6511..750e9a96 100644
--- a/CompanyManagment.Application/CustomizeCheckoutTempApplication.cs
+++ b/CompanyManagment.Application/CustomizeCheckoutTempApplication.cs
@@ -249,7 +249,10 @@ namespace CompanyManagment.Application
if (workshopId == 170)
{
- var exceptionEmployeeIds = _customizeWorkshopGroupSettingsRepository.GetEmployeeSettingsByGroupSettingsId(117).Select(x => x.EmployeeId).ToList();
+ var exceptionEmployeeIds = _customizeWorkshopGroupSettingsRepository
+ .GetEmployeeSettingsByGroupSettingsId(117)
+ .Select(x => x.EmployeeId)
+ .Where(x=> workshopLeftWorksInMonth.Select(l=>l.EmployeeId).Contains(x)).ToList();
foreach (var employeesId in exceptionEmployeeIds)
{
diff --git a/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs b/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs
index 0167d8c4..b4f19256 100644
--- a/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs
+++ b/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs
@@ -154,7 +154,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
}
- var offDays = command.OffDays.Select(x => new WeeklyOffDay(x)).ToList();
+ var offDays = command.OffDays?.Select(x => new WeeklyOffDay(x)).ToList()??[];
var record = new CustomizeWorkshopSettings(workshopId, shiftCollection, command.LeavePermittedDays,
command.WorkshopShiftStatus, command.HolidayWork, offDays);
@@ -390,7 +390,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
//var commandOffDayHashSet = command.WeeklyOffDays.ToHashSet();
var commandOffDayHashSet = command.WeeklyOffDays?.ToHashSet() ?? [];
- var groupOffDayHashSet = customizeWorkshopGroupSettings.WeeklyOffDays.Select(x => x.DayOfWeek).ToHashSet();
+ var groupOffDayHashSet = customizeWorkshopGroupSettings.WeeklyOffDays?.Select(x => x.DayOfWeek).ToHashSet()??[];
if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular)
{
@@ -669,7 +669,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
#endregion
- var offDays = weeklyOffDays.Select(x => new WeeklyOffDay(x)).ToList();
+ var offDays = weeklyOffDays?.Select(x => new WeeklyOffDay(x)).ToList()??[];
using var transActionScope = new TransactionScope();
entity.ChangeWorkshopShifts(shiftCollection, workshopShiftStatus, holidayWork, offDays);
@@ -723,7 +723,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
//var commandOffDayHashSet = command.OffDayOfWeeks.ToHashSet();
var commandOffDayHashSet = command.OffDayOfWeeks?.ToHashSet() ?? [];
- var workshopOffDayHashSet = workshopSettings.WeeklyOffDays.Select(x => x.DayOfWeek).ToHashSet();
+ var workshopOffDayHashSet = workshopSettings.WeeklyOffDays?.Select(x => x.DayOfWeek).ToHashSet()??[];
if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular)
{
@@ -871,7 +871,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
bool isChanged = false;
var commandOffDayHashSet = command.WeeklyOffDays?.ToHashSet()??[];
- var groupOffDayHashSet = groupSettings.WeeklyOffDays.Select(x => x.DayOfWeek).ToHashSet();
+ var groupOffDayHashSet = groupSettings.WeeklyOffDays?.Select(x => x.DayOfWeek).ToHashSet()??[];
if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular)
{
@@ -1034,7 +1034,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
}
- var weeklyOffDays = command.WeeklyOffDays.Select(x => new WeeklyOffDay(x)).ToList();
+ var weeklyOffDays = command.WeeklyOffDays?.Select(x => new WeeklyOffDay(x)).ToList()??[];
using var transaction = new TransactionScope();
entity.SimpleEdit(employeesShifts, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime,
@@ -1442,7 +1442,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
var commandOffDayHashSet = command.WeeklyOffDays?.ToHashSet()??[];
- var entityOffDayHashSet = entity.WeeklyOffDays.Select(x => x.DayOfWeek).ToHashSet();
+ var entityOffDayHashSet = entity.WeeklyOffDays?.Select(x => x.DayOfWeek).ToHashSet()??[];
bool isChanged;
if (fridayPay == entity.FridayPay && overTimePay == entity.OverTimePay && baseYearsPay == entity.BaseYearsPay && bonusesPay == entity.BonusesPay
@@ -1536,7 +1536,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
}).ToList(),
//FridayWork = entity.FridayWork,
HolidayWork = entity.HolidayWork,
- WeeklyOffDays = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList(),
+ WeeklyOffDays = entity.WeeklyOffDays?.Select(x=>x.DayOfWeek).ToList()??[],
CustomizeRotatingShiftsViewModels = entity.CustomizeRotatingShifts.Select(x => new CustomizeRotatingShiftsViewModel()
{
StartTime = x.StartTime.ToString("HH:mm"),
diff --git a/CompanyManagment.Application/EmployeeAplication.cs b/CompanyManagment.Application/EmployeeAplication.cs
index 5842c8eb..47624e1f 100644
--- a/CompanyManagment.Application/EmployeeAplication.cs
+++ b/CompanyManagment.Application/EmployeeAplication.cs
@@ -60,7 +60,7 @@ public class EmployeeAplication : RepositoryBase, IEmployeeAppli
private readonly IEmployeeClientTempRepository _employeeClientTempRepository;
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
private readonly IEmployeeAuthorizeTempRepository _employeeAuthorizeTempRepository;
- private readonly ILeftWorkInsuranceRepository _leftWorkInsuranceRepository ;
+ private readonly ILeftWorkInsuranceRepository _leftWorkInsuranceRepository;
public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context, IWorkshopRepository workShopRepository, IWebHostEnvironment webHostEnvironment, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IEmployeeDocumentsRepository employeeDocumentsRepository, IEmployeeBankInformationApplication employeeBankInformationApplication, ILeftWorkTempRepository leftWorkTempRepository, IUidService uidService, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, IEmployeeClientTempRepository employeeClientTempRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository, ILeftWorkRepository leftWorkRepository, IEmployeeAuthorizeTempRepository employeeAuthorizeTempRepository, ILeftWorkInsuranceRepository leftWorkInsuranceRepository) : base(context)
{
@@ -105,7 +105,7 @@ public class EmployeeAplication : RepositoryBase, IEmployeeAppli
//}
-
+
if (command.Address != null && command.State == null)
{
@@ -179,8 +179,13 @@ public class EmployeeAplication : RepositoryBase, IEmployeeAppli
else
{
- nationalCodValid = false;
- return opration.Failed("کد ملی وارد شده نا معتبر است");
+
+
+ nationalCodValid = false;
+ return opration.Failed("کد ملی وارد شده نا معتبر است");
+
+
+
}
}
catch (Exception)
@@ -198,9 +203,9 @@ public class EmployeeAplication : RepositoryBase, IEmployeeAppli
}
}
-
-
+
+
string initial = "1300/10/11";
var dateOfBirth = command.DateOfBirth != null ? command.DateOfBirth.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
var dateOfIssue = command.DateOfIssue != null ? command.DateOfIssue.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
@@ -225,7 +230,7 @@ public class EmployeeAplication : RepositoryBase, IEmployeeAppli
return opration.Succcedded(employeeData.id);
-
+
}
public OperationResult Edit(EditEmployee command)
@@ -240,7 +245,7 @@ public class EmployeeAplication : RepositoryBase