Compare commits
33 Commits
Feature/ad
...
Feature/ro
| Author | SHA1 | Date | |
|---|---|---|---|
| 78458f24e5 | |||
|
|
dbddccf011 | ||
| 488454d354 | |||
| 4126a7370f | |||
| 7aff8ba59f | |||
| 950f2884ac | |||
| 2edf150ef6 | |||
| df9c268959 | |||
| 3c6303e817 | |||
| 23386fda76 | |||
| 119f4496cd | |||
| ce4fc33daa | |||
| f5d95b21b0 | |||
| 6e83904e11 | |||
| 1f7785581c | |||
| 9140f1ea0b | |||
| 81e6094817 | |||
| e5c0a7db58 | |||
| d44a9224be | |||
| a5e68cbd90 | |||
| 37a6920a74 | |||
| db40ab567c | |||
| 5f324a6fa1 | |||
| d1703ad20e | |||
| 2f38470746 | |||
| 23c02abe65 | |||
| 475142744f | |||
| 13a2cd78cd | |||
| 4aa3c10466 | |||
| 91fc560355 | |||
| 9297bdefb5 | |||
| 61b326aed4 | |||
| 756e06cc2f |
@@ -204,8 +204,7 @@ public class SmsService : ISmsService
|
||||
int pageSize = 100; // max: 100
|
||||
SmsIr smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
|
||||
var response = await smsIr.GetArchivedReportAsync(pageNumber, pageSize, unixTimestamp, unixTimestamp2);
|
||||
|
||||
|
||||
|
||||
MessageReportResult[] messages = response.Data;
|
||||
foreach (var message in messages)
|
||||
{
|
||||
|
||||
@@ -1512,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}$");
|
||||
}
|
||||
/// <summary>
|
||||
/// این متد حروف عربی را به فارسی در میاورد. مثال: علي را به علی تبدیل میکند
|
||||
/// </summary>
|
||||
|
||||
@@ -110,6 +110,53 @@ public interface IUidService
|
||||
{
|
||||
Task<PersonalInfoResponse> GetPersonalInfo(string nationalCode , string birthDate);
|
||||
Task<MatchMobileWithNationalCodeResponse> IsMachPhoneWithNationalCode(string nationalCode , string phoneNumber);
|
||||
Task<IbanInquiryResponse> IbanInquiry (string iban);
|
||||
Task<AccountToIbanResponse> AccountToIban(string accountNumber, UidBanks bank);
|
||||
Task<CardToNumberResponse> 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<IbanInquiryOwner> 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; }
|
||||
}
|
||||
|
||||
117
0_Framework/Application/UID/UidBanks.cs
Normal file
117
0_Framework/Application/UID/UidBanks.cs
Normal file
@@ -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
|
||||
}
|
||||
27
0_Framework/Application/UID/UidBanksExtension.cs
Normal file
27
0_Framework/Application/UID/UidBanksExtension.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
|
||||
namespace _0_Framework.Application.UID
|
||||
{
|
||||
public static class UidBanksExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// دریافت نام فارسی بانک
|
||||
/// </summary>
|
||||
/// <param name="bank">بانک</param>
|
||||
/// <returns>نام فارسی بانک</returns>
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<AuthorizedBankDetailsOwner>();
|
||||
}
|
||||
|
||||
public AuthorizedBankDetails(string cardNumber, string accountNumber, string ban, string bankName, List<AuthorizedBankDetailsOwner> ownersList)
|
||||
{
|
||||
CardNumber = cardNumber;
|
||||
AccountNumber = accountNumber;
|
||||
IBan = ban;
|
||||
BankName = bankName;
|
||||
OwnersList = ownersList ?? new List<AuthorizedBankDetailsOwner>();
|
||||
}
|
||||
|
||||
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<AuthorizedBankDetailsOwner> 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; }
|
||||
}
|
||||
}
|
||||
@@ -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<long, AuthorizedBankDetails>
|
||||
{
|
||||
EditAuthorizedBankDetails GetDetails(long id);
|
||||
List<AuthorizedBankDetailsViewModel> Search(AuthorizedBankDetailsSearchModel searchModel);
|
||||
AuthorizedBankDetailsViewModel GetByIban(string iban);
|
||||
}
|
||||
}
|
||||
@@ -54,10 +54,23 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
||||
void UpdateStatusIfNeeded(long institutionContractId);
|
||||
Task<GetInstitutionVerificationDetailsViewModel> GetVerificationDetails(Guid id);
|
||||
Task<InstitutionContract> GetByPublicIdAsync(Guid id);
|
||||
|
||||
#region Extension
|
||||
|
||||
Task<InstitutionContractExtensionInquiryResult> GetExtensionInquiry(long previousContractId);
|
||||
Task<InstitutionContractExtensionWorkshopsResponse> GetExtensionWorkshops(InstitutionContractExtensionWorkshopsRequest request);
|
||||
Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(InstitutionContractExtensionPlanRequest request);
|
||||
Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(InstitutionContractExtensionPaymentRequest request);
|
||||
Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Upgrade(Amendment)
|
||||
|
||||
Task<InstitutionContractAmendmentWorkshopsResponse> GetAmendmentWorkshops(long institutionContractId);
|
||||
Task<InsitutionContractAmendmentPaymentResponse> GetAmendmentPaymentDetails(InsitutionContractAmendmentPaymentRequest request);
|
||||
|
||||
#endregion
|
||||
|
||||
Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search, string selected);
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
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;
|
||||
using OfficeOpenXml.Table.PivotTable;
|
||||
|
||||
namespace Company.Domain.InstitutionContractAgg;
|
||||
|
||||
@@ -119,26 +121,23 @@ public class InstitutionContract : EntityBase
|
||||
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; }
|
||||
|
||||
[NotMapped]
|
||||
public bool VerifyCodeExpired => VerifyCodeCreation.Add(ExpireTime) <= DateTime.Now;
|
||||
|
||||
[NotMapped]
|
||||
public bool CanResendVerifyCode => VerifyCodeCreation.Add(ReSendTime) <= DateTime.Now;
|
||||
|
||||
[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; }
|
||||
@@ -254,6 +253,19 @@ public class InstitutionContract : EntityBase
|
||||
|
||||
public class InstitutionContractAmendment : EntityBase
|
||||
{
|
||||
private InstitutionContractAmendment(){}
|
||||
public InstitutionContractAmendment(long institutionContractId,
|
||||
List<InstitutionContractInstallment> 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<InstitutionContractInstallment> Installments { get; set; }
|
||||
@@ -262,10 +274,39 @@ public class InstitutionContractAmendment : EntityBase
|
||||
public string VerifyCode { get; set; }
|
||||
public DateTime VerificationCreation { get; set; }
|
||||
public List<InstitutionContractAmendmentChange> AmendmentChanges { get; set; }
|
||||
|
||||
public long LawId { get; set; }
|
||||
|
||||
public void SetVerifyCode(string code)
|
||||
{
|
||||
VerifyCode = code;
|
||||
VerificationCreation = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
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; }
|
||||
@@ -310,8 +351,6 @@ public class InstitutionContractAmendmentChange : EntityBase
|
||||
/// تعداد کارگاه
|
||||
/// </summary>
|
||||
public long? WorkshopDetailsId { get; private set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public enum InstitutionContractAmendmentChangeType
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace Company.Domain.InstitutionContractInsertTempAgg;
|
||||
namespace Company.Domain.InstitutionContractExtensionTempAgg;
|
||||
|
||||
public interface IInstitutionContractExtenstionTempRepository
|
||||
{
|
||||
@@ -5,7 +5,7 @@ using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace Company.Domain.InstitutionContractInsertTempAgg;
|
||||
namespace Company.Domain.InstitutionContractExtensionTempAgg;
|
||||
|
||||
public class InstitutionContractExtensionTemp
|
||||
{
|
||||
@@ -30,8 +30,8 @@ public class InstitutionContractExtensionTemp
|
||||
public InstitutionContractExtensionPlanDetail ThreeMonths { get; set; }
|
||||
public InstitutionContractExtensionPlanDetail SixMonths { get; set; }
|
||||
public InstitutionContractExtensionPlanDetail TwelveMonths { get; set; }
|
||||
public InstitutionContractExtensionPaymentMonthly MonthlyPayment { get; set; }
|
||||
public InstitutionContractExtensionPaymentOneTime OneTimePayment { get; set; }
|
||||
public InstitutionContractPaymentMonthlyViewModel MonthlyPayment { get; set; }
|
||||
public InstitutionContractPaymentOneTimeViewModel OneTimePayment { get; set; }
|
||||
|
||||
public bool HasContractInPerson { get; set; }
|
||||
|
||||
@@ -58,8 +58,8 @@ public class InstitutionContractExtensionTemp
|
||||
HasContractInPerson = hasContractInPerson;
|
||||
}
|
||||
|
||||
public void SetAmountAndDuration(InstitutionContractDuration duration,InstitutionContractExtensionPaymentMonthly monthly,
|
||||
InstitutionContractExtensionPaymentOneTime oneTime)
|
||||
public void SetAmountAndDuration(InstitutionContractDuration duration,InstitutionContractPaymentMonthlyViewModel monthly,
|
||||
InstitutionContractPaymentOneTimeViewModel oneTime)
|
||||
{
|
||||
Duration = duration;
|
||||
MonthlyPayment = monthly;
|
||||
@@ -12,9 +12,7 @@ public class CaseHistoryRollCallExcelForEmployeeViewModel
|
||||
public string EmployeeFullName { get; set; }
|
||||
public string TotalWorkingHoursFa { get; set; }
|
||||
public string TotalWorkingTimeSpan { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
public List<RollCallItemForEmployeeExcelViewModel> 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
|
||||
|
||||
@@ -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 $"";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Company.Domain.InstitutionContractInsertTempAgg;
|
||||
using Company.Domain.InstitutionContractExtensionTempAgg;
|
||||
using MongoDB.Driver;
|
||||
|
||||
namespace CompanyManagement.Infrastructure.Mongo.InstitutionContractInsertTempRepo;
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<AuthorizedBankDetailsOwnerViewModel> Owners { get; set; }
|
||||
}
|
||||
@@ -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<CreateAuthorizedBankDetailsOwner> 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; }
|
||||
}
|
||||
}
|
||||
@@ -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<AuthorizedBankDetailsOwnerViewModel> 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; }
|
||||
}
|
||||
}
|
||||
@@ -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<AuthorizedBankDetailsViewModel> Search(AuthorizedBankDetailsSearchModel searchModel);
|
||||
AuthorizedBankDetailsViewModel GetByIban(string iban);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
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;
|
||||
@@ -74,5 +76,27 @@ public interface IContractingPartyBankAccountsApplication
|
||||
/// <param name="selected">نام سلکت شده</param>
|
||||
/// <returns></returns>
|
||||
Task<List<string>> ContractingPartyNamesSelectList(string search, string selected);
|
||||
|
||||
/// <summary>
|
||||
/// احراز هویت اطلاعات بانکی طرف حساب
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<ContractingPartyBankInquiryResponse> 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; }
|
||||
}
|
||||
|
||||
|
||||
@@ -102,13 +102,13 @@ public class WorkshopServicesViewModel
|
||||
public string InsuranceLabel => "ارسال لیست بیمه";
|
||||
|
||||
public bool InsuranceInPerson { get; set; }
|
||||
public string InsuranceInPersonLabel => "خدمات حضوری";
|
||||
public string InsuranceInPersonLabel => "خدمات مستقیم";
|
||||
|
||||
public bool Contract { get; set; }
|
||||
public string ContractLabel => "قرارداد و تصفیه حساب";
|
||||
|
||||
public bool ContractInPerson { get; set; }
|
||||
public string ContractInPersonLabel => "خدمات حضوری";
|
||||
public string ContractInPersonLabel => "خدمات مستقیم";
|
||||
|
||||
public bool RollCall { get; set; }
|
||||
public string RollCallLabel => "ساعت حضور و غیاب";
|
||||
|
||||
@@ -212,14 +212,57 @@ public interface IInstitutionContractApplication
|
||||
Task<OperationResult<OtpResultViewModel>> SendVerifyOtp(Guid id);
|
||||
Task<OperationResult> VerifyOtp(Guid publicId, string code);
|
||||
Task<InstitutionContractWorkshopDetailViewModel> GetWorkshopInitialDetails(long workshopDetailsId);
|
||||
|
||||
#region Extension
|
||||
|
||||
Task<InstitutionContractExtensionInquiryResult> GetExtensionInquiry(long previousContractId);
|
||||
Task<InstitutionContractExtensionWorkshopsResponse> GetExtensionWorkshops(InstitutionContractExtensionWorkshopsRequest request);
|
||||
Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(InstitutionContractExtensionPlanRequest request);
|
||||
|
||||
Task<InstitutionContractExtensionWorkshopsResponse> GetExtensionWorkshops(
|
||||
InstitutionContractExtensionWorkshopsRequest request);
|
||||
|
||||
Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(
|
||||
InstitutionContractExtensionPlanRequest request);
|
||||
|
||||
Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(
|
||||
InstitutionContractExtensionPaymentRequest request);
|
||||
|
||||
|
||||
Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
|
||||
Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search,string selected);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Upgrade (Amendment)
|
||||
|
||||
Task<InstitutionContractAmendmentWorkshopsResponse> GetAmendmentWorkshops(long institutionContractId);
|
||||
Task<InsitutionContractAmendmentPaymentResponse> GetAmendmentPaymentDetails(InsitutionContractAmendmentPaymentRequest request);
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class InsitutionContractAmendmentPaymentRequest
|
||||
{
|
||||
List<WorkshopTempViewModel> Workshops { get; set; }
|
||||
public long InstitutionContractId { get; set; }
|
||||
}
|
||||
|
||||
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; }
|
||||
}
|
||||
|
||||
public class InstitutionContractAmendmentWorkshopsResponse
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<WorkshopTempViewModel> Workshops { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class InstitutionContractSelectListViewModel : SelectListViewModel;
|
||||
@@ -241,19 +284,7 @@ public class InstitutionContractExtensionInquiryResponse
|
||||
public string NationalCode { get; set; }
|
||||
}
|
||||
|
||||
public class InstitutionContractExtensionCompleteRequest
|
||||
{
|
||||
public Guid TemporaryId { get; set; }
|
||||
public bool IsInstallment { get; set; }
|
||||
public long LawId { get; set; }
|
||||
}
|
||||
|
||||
public class InstitutionContractExtensionPaymentResponse
|
||||
{
|
||||
public InstitutionContractExtensionPaymentOneTime OneTime { get; set; }
|
||||
public InstitutionContractExtensionPaymentMonthly Monthly { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class InstitutionContractExtensionPaymentMonthly:InstitutionContractExtensionPaymentOneTime
|
||||
{
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
public class InstitutionContractExtensionPaymentResponse
|
||||
{
|
||||
public InstitutionContractPaymentOneTimeViewModel OneTime { get; set; }
|
||||
public InstitutionContractPaymentMonthlyViewModel Monthly { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
public class InstitutionContractPaymentOneTimeViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// مجموع مبالغ
|
||||
/// </summary>
|
||||
public string TotalAmount { get; set; }
|
||||
/// <summary>
|
||||
/// ارزش افزوده
|
||||
/// </summary>
|
||||
public string Tax { get; set; }
|
||||
/// <summary>
|
||||
/// مبلغ قابل پرداخت
|
||||
/// </summary>
|
||||
public string PaymentAmount { get; set; }
|
||||
}
|
||||
public class InstitutionContractPaymentMonthlyViewModel:InstitutionContractPaymentOneTimeViewModel
|
||||
{
|
||||
public List<MonthlyInstallment> Installments { get; set; }
|
||||
}
|
||||
@@ -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<AuthorizedBankDetailsOwner>();
|
||||
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<AuthorizedBankDetailsViewModel> Search(AuthorizedBankDetailsSearchModel searchModel)
|
||||
{
|
||||
return _authorizedBankDetailsRepository.Search(searchModel);
|
||||
}
|
||||
|
||||
public AuthorizedBankDetailsViewModel GetByIban(string iban)
|
||||
{
|
||||
return _authorizedBankDetailsRepository.GetByIban(iban);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
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;
|
||||
@@ -12,13 +16,15 @@ public class ContractingPartyBankAccountsApplication : IContractingPartyBankAcco
|
||||
{
|
||||
private readonly IContractingPartyBankAccountsRepository _contractingPartyBankAccountsRepository;
|
||||
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository;
|
||||
private readonly IUidService _uidService;
|
||||
|
||||
public ContractingPartyBankAccountsApplication(
|
||||
IContractingPartyBankAccountsRepository contractingPartyBankAccountsRepository,
|
||||
IPersonalContractingPartyRepository personalContractingPartyRepository)
|
||||
IPersonalContractingPartyRepository personalContractingPartyRepository, IUidService uidService)
|
||||
{
|
||||
_contractingPartyBankAccountsRepository = contractingPartyBankAccountsRepository;
|
||||
_personalContractingPartyRepository = personalContractingPartyRepository;
|
||||
_uidService = uidService;
|
||||
}
|
||||
|
||||
public async Task<OperationResult> Create(CreateContractingPartyBankAccounts command)
|
||||
@@ -69,18 +75,19 @@ public class ContractingPartyBankAccountsApplication : IContractingPartyBankAcco
|
||||
if (string.IsNullOrWhiteSpace(command.IBan))
|
||||
return operationResult.Failed("شماره شبا خود را وارد کنید");
|
||||
}
|
||||
else if(string.IsNullOrWhiteSpace(command.CardNumber) &&
|
||||
else if (string.IsNullOrWhiteSpace(command.CardNumber) &&
|
||||
string.IsNullOrWhiteSpace(command.AccountNumber) &&
|
||||
string.IsNullOrWhiteSpace(command.IBan))
|
||||
{
|
||||
return operationResult.Failed(" حداقل یکی از اطلاعات بانکی را وارد کنید: شماره کارت، شماره حساب یا شماره شبا");
|
||||
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);
|
||||
@@ -130,4 +137,83 @@ public class ContractingPartyBankAccountsApplication : IContractingPartyBankAcco
|
||||
{
|
||||
return await _contractingPartyBankAccountsRepository.ContractingPartyNamesSelectList(search, selected);
|
||||
}
|
||||
|
||||
public async Task<ContractingPartyBankInquiryResponse> 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;
|
||||
}
|
||||
}
|
||||
@@ -1340,6 +1340,10 @@ public class EmployerApplication : IEmployerApplication
|
||||
var workshopDetails =
|
||||
await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(command
|
||||
.InstitutionWorkshopInitialId);
|
||||
if (workshopDetails.Employers.Any(x => x.EmployerId == employer.id))
|
||||
{
|
||||
throw new BadRequestException("این کارفرما قبلا در این کارگاه ثبت شده است");
|
||||
}
|
||||
workshopDetails.AddEmployer(employer.id);
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
@@ -1387,12 +1391,14 @@ public class EmployerApplication : IEmployerApplication
|
||||
|
||||
// Get workshop details
|
||||
var workshopDetails =
|
||||
await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(institutionWorkshopDetailsId);
|
||||
await _institutionContractRepository
|
||||
.GetInstitutionWorkshopInitialDetails(institutionWorkshopDetailsId);
|
||||
if (workshopDetails == null)
|
||||
return operation.Failed("جزئیات کارگاه موسسه یافت نشد");
|
||||
|
||||
// Find and remove the employer from workshop details
|
||||
var employerDetail = workshopDetails.Employers.FirstOrDefault(e => e.EmployerId == employerId);
|
||||
var employerDetail = workshopDetails
|
||||
.Employers.FirstOrDefault(e => e.EmployerId == employerId);
|
||||
if (employerDetail == null)
|
||||
return operation.Failed("کارفرما در لیست کارگاه یافت نشد");
|
||||
|
||||
@@ -1400,10 +1406,7 @@ public class EmployerApplication : IEmployerApplication
|
||||
workshopDetails.Employers.Remove(employerDetail);
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
|
||||
// Delete the employer
|
||||
_EmployerRepository.Remove(employerId);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
command.DailyCompenseation, command.Obligation,
|
||||
command.TotalAmount, command.ExtensionNo, command.WorkshopManualCount, command.EmployeeManualCount,
|
||||
command.Description, command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax,
|
||||
command.ValueAddedTax, [],command.LawId);
|
||||
command.ValueAddedTax, [], command.LawId);
|
||||
|
||||
_institutionContractRepository.Create(createContract);
|
||||
_institutionContractRepository.SaveChanges();
|
||||
@@ -1046,7 +1046,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
command.Workshops.Count.ToString(),
|
||||
command.Workshops.Sum(x => x.PersonnelCount).ToString(), command.Description,
|
||||
"NotOfficial", "JobRelation", hasValueAddedTax,
|
||||
command.TaxAmount, workshopDetails,command.LawId);
|
||||
command.TaxAmount, workshopDetails, command.LawId);
|
||||
|
||||
|
||||
FinancialStatment financialStatement;
|
||||
@@ -1139,11 +1139,11 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
if (res.IsSuccedded)
|
||||
CreateContractingPartyAccount(contractingParty.id, res.SendId);
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
|
||||
await _smsService.SendInstitutionVerificationLink(contractingParty.Phone, contractingPartyFullName,
|
||||
entity.PublicId);
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
|
||||
await transaction.CommitAsync();
|
||||
return opration.Succcedded();
|
||||
@@ -1153,7 +1153,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Task<List<RegistrationWorkflowMainListViewModel>> RegistrationWorkflowMainList()
|
||||
{
|
||||
@@ -1249,8 +1249,31 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
|
||||
if (institutionContract.VerifyCode != code)
|
||||
return op.Failed("کد وارد شده صحیح نمی باشد");
|
||||
|
||||
var transaction = await _institutionContractRepository.BeginTransactionAsync();
|
||||
institutionContract.SetPendingWorkflow();
|
||||
|
||||
var phone = institutionContract.ContactInfoList.FirstOrDefault(x =>
|
||||
x.SendSms && x.Position == "طرف قرارداد" && x.PhoneType == "شماره همراه");
|
||||
if (phone !=null)
|
||||
{
|
||||
var userPass = contractingParty.IsLegal == "حقیقی"
|
||||
? contractingParty.Nationalcode
|
||||
: contractingParty.NationalId;
|
||||
var createAcc = new RegisterAccount
|
||||
{
|
||||
Fullname = contractingParty.LName,
|
||||
Username = userPass,
|
||||
Password = userPass,
|
||||
Mobile = phone.PhoneNumber,
|
||||
NationalCode = userPass
|
||||
};
|
||||
var res = _accountApplication.RegisterClient(createAcc);
|
||||
if (res.IsSuccedded)
|
||||
CreateContractingPartyAccount(contractingParty.id, res.SendId);
|
||||
}
|
||||
|
||||
await transaction.CommitAsync();
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
return op.Succcedded();
|
||||
}
|
||||
@@ -1274,7 +1297,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
RollCallInPerson = services.RollCallInPerson
|
||||
},
|
||||
WorkshopName = details.WorkshopName,
|
||||
ArchiveCode =newArchiveCode
|
||||
ArchiveCode = newArchiveCode
|
||||
};
|
||||
return res;
|
||||
}
|
||||
@@ -1290,12 +1313,14 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
return await _institutionContractRepository.GetExtensionWorkshops(request);
|
||||
}
|
||||
|
||||
public async Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(InstitutionContractExtensionPlanRequest request)
|
||||
public async Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(
|
||||
InstitutionContractExtensionPlanRequest request)
|
||||
{
|
||||
return await _institutionContractRepository.GetExtensionInstitutionPlan(request);
|
||||
}
|
||||
|
||||
public async Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(InstitutionContractExtensionPaymentRequest request)
|
||||
public async Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(
|
||||
InstitutionContractExtensionPaymentRequest request)
|
||||
{
|
||||
return await _institutionContractRepository.GetExtensionPaymentMethod(request);
|
||||
}
|
||||
@@ -1310,6 +1335,16 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
return await _institutionContractRepository.GetInstitutionContractSelectList(search,selected);
|
||||
}
|
||||
|
||||
public async Task<InstitutionContractAmendmentWorkshopsResponse> GetAmendmentWorkshops(long institutionContractId)
|
||||
{
|
||||
return await _institutionContractRepository.GetAmendmentWorkshops(institutionContractId);
|
||||
}
|
||||
|
||||
public Task<InsitutionContractAmendmentPaymentResponse> GetAmendmentPaymentDetails(InsitutionContractAmendmentPaymentRequest request)
|
||||
{
|
||||
return _institutionContractRepository.GetAmendmentPaymentDetails(request);
|
||||
}
|
||||
|
||||
|
||||
private async Task<OperationResult<PersonalContractingParty>> CreateLegalContractingPartyEntity(
|
||||
CreateInstitutionContractLegalPartyRequest request, long representativeId, string address, string city,
|
||||
@@ -1350,8 +1385,8 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
|
||||
if (request.IsAuth)
|
||||
{
|
||||
legalContractingParty.LegalAuthentication(request.FName,request.LName,request.FatherName,
|
||||
request.IdNumber,null,null,request.BirthDateFa,request.Gender,request.PhoneNumber);
|
||||
legalContractingParty.LegalAuthentication(request.FName, request.LName, request.FatherName,
|
||||
request.IdNumber, null, null, request.BirthDateFa, request.Gender, request.PhoneNumber);
|
||||
}
|
||||
|
||||
await _contractingPartyRepository.CreateAsync(legalContractingParty);
|
||||
@@ -1396,7 +1431,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
if (request.IsAuth)
|
||||
{
|
||||
personalContractingParty.Authentication(request.FName, request.LName, request.FatherName,
|
||||
request.IdNumber, null,null, request.BirthDateFa, request.Gender,request.PhoneNumber);
|
||||
request.IdNumber, null, null, request.BirthDateFa, request.Gender, request.PhoneNumber);
|
||||
}
|
||||
|
||||
await _contractingPartyRepository.CreateAsync(personalContractingParty);
|
||||
@@ -1513,4 +1548,4 @@ public class WorkshopsAndEmployeeViewModel
|
||||
public int ArchiveCode { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
@@ -1,5 +1,6 @@
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using Company.Domain.AndroidApkVersionAgg;
|
||||
using Company.Domain.AuthorizedBankDetailsAgg;
|
||||
using Company.Domain.BankAgg;
|
||||
using Company.Domain.BillAgg;
|
||||
using Company.Domain.Board;
|
||||
@@ -201,6 +202,9 @@ public class CompanyContext : DbContext
|
||||
|
||||
public DbSet<InstitutionContractContactInfoTemp> InstitutionContractContactInfoTemps { get; set; }
|
||||
|
||||
public DbSet<AuthorizedBankDetails> AuthorizedBankDetails { get; set; }
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Pooya
|
||||
@@ -309,7 +313,6 @@ public class CompanyContext : DbContext
|
||||
|
||||
public DbSet<Employer> Employers { get; set; }
|
||||
|
||||
|
||||
public CompanyContext(DbContextOptions<CompanyContext> options) :base(options)
|
||||
{
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
using Company.Domain.AuthorizedBankDetailsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping
|
||||
{
|
||||
public class AuthorizedBankDetailsMapping : IEntityTypeConfiguration<AuthorizedBankDetails>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<AuthorizedBankDetails> builder)
|
||||
{
|
||||
builder.ToTable("AuthorizedBankDetails");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
builder.Property(x => x.CardNumber).HasMaxLength(50);
|
||||
builder.Property(x => x.AccountNumber).HasMaxLength(50);
|
||||
builder.Property(x => x.IBan).HasMaxLength(50);
|
||||
builder.Property(x => x.BankName).HasMaxLength(100);
|
||||
|
||||
// Configure owners as owned entities (value objects)
|
||||
builder.OwnsMany(x => x.OwnersList, ownersBuilder =>
|
||||
{
|
||||
ownersBuilder.ToTable("AuthorizedBankDetailsOwners");
|
||||
ownersBuilder.WithOwner().HasForeignKey("AuthorizedBankDetailsId");
|
||||
ownersBuilder.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
ownersBuilder.HasKey("Id");
|
||||
|
||||
ownersBuilder.Property(x => x.FName).HasMaxLength(100);
|
||||
ownersBuilder.Property(x => x.LName).HasMaxLength(100);
|
||||
ownersBuilder.Property(x => x.NationalIdentifier).HasMaxLength(20);
|
||||
ownersBuilder.Property(x => x.CustomerType).HasMaxLength(50);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
11048
CompanyManagment.EFCore/Migrations/20251019092906_add authorized bank details.Designer.cs
generated
Normal file
11048
CompanyManagment.EFCore/Migrations/20251019092906_add authorized bank details.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addauthorizedbankdetails : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AuthorizedBankDetails",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CardNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
AccountNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
IBan = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
BankName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table => { table.PrimaryKey("PK_AuthorizedBankDetails", x => x.id); });
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AuthorizedBankDetailsOwners",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
FName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
LName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
NationalIdentifier = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
CustomerType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
AuthorizedBankDetailsId = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AuthorizedBankDetailsOwners", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AuthorizedBankDetailsOwners_AuthorizedBankDetails_AuthorizedBankDetailsId",
|
||||
column: x => x.AuthorizedBankDetailsId,
|
||||
principalTable: "AuthorizedBankDetails",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AuthorizedBankDetailsOwners_AuthorizedBankDetailsId",
|
||||
table: "AuthorizedBankDetailsOwners",
|
||||
column: "AuthorizedBankDetailsId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AuthorizedBankDetailsOwners");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AuthorizedBankDetails");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,6 +90,38 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("AndroidApkVersions", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.AuthorizedBankDetailsAgg.AuthorizedBankDetails", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<string>("AccountNumber")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("BankName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("CardNumber")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("IBan")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("AuthorizedBankDetails", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.AuthorizedPersonAgg.AuthorizedPerson", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -3209,6 +3241,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("InstitutionContractId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("LawId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime>("VerificationCreation")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -6870,6 +6905,48 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("EmployerWorkshop");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.AuthorizedBankDetailsAgg.AuthorizedBankDetails", b =>
|
||||
{
|
||||
b.OwnsMany("Company.Domain.AuthorizedBankDetailsAgg.AuthorizedBankDetailsOwner", "OwnersList", b1 =>
|
||||
{
|
||||
b1.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<int>("Id"));
|
||||
|
||||
b1.Property<long>("AuthorizedBankDetailsId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("CustomerType")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b1.Property<string>("FName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b1.Property<string>("LName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b1.Property<string>("NationalIdentifier")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b1.HasKey("Id");
|
||||
|
||||
b1.HasIndex("AuthorizedBankDetailsId");
|
||||
|
||||
b1.ToTable("AuthorizedBankDetailsOwners", (string)null);
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("AuthorizedBankDetailsId");
|
||||
});
|
||||
|
||||
b.Navigation("OwnersList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.Board.Board", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.BoardType.BoardType", "BoardType")
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework_b.InfraStructure;
|
||||
using Company.Application.Contracts.AuthorizedBankDetails;
|
||||
using Company.Domain.AuthorizedBankDetailsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository
|
||||
{
|
||||
public class AuthorizedBankDetailsRepository : RepositoryBase<long, AuthorizedBankDetails>, IAuthorizedBankDetailsRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
|
||||
public AuthorizedBankDetailsRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public EditAuthorizedBankDetails GetDetails(long id)
|
||||
{
|
||||
var authorizedBankDetails = _context.AuthorizedBankDetails
|
||||
.Include(x => x.OwnersList)
|
||||
.FirstOrDefault(x => x.id == id);
|
||||
|
||||
if (authorizedBankDetails == null)
|
||||
return new EditAuthorizedBankDetails();
|
||||
|
||||
var result = new EditAuthorizedBankDetails
|
||||
{
|
||||
Id = authorizedBankDetails.id,
|
||||
CardNumber = authorizedBankDetails.CardNumber,
|
||||
AccountNumber = authorizedBankDetails.AccountNumber,
|
||||
IBan = authorizedBankDetails.IBan,
|
||||
BankName = authorizedBankDetails.BankName,
|
||||
OwnersList = authorizedBankDetails.OwnersList.Select(o => new AuthorizedBankDetailsOwnerViewModel
|
||||
{
|
||||
FName = o.FName,
|
||||
LName = o.LName,
|
||||
NationalIdentifier = o.NationalIdentifier,
|
||||
CustomerType = o.CustomerType
|
||||
}).ToList()
|
||||
};
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<AuthorizedBankDetailsViewModel> Search(AuthorizedBankDetailsSearchModel searchModel)
|
||||
{
|
||||
var query = _context.AuthorizedBankDetails
|
||||
.Include(x => x.OwnersList)
|
||||
.Select(x => new AuthorizedBankDetailsViewModel
|
||||
{
|
||||
Id = x.id,
|
||||
CardNumber = x.CardNumber,
|
||||
AccountNumber = x.AccountNumber,
|
||||
IBan = x.IBan,
|
||||
});
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.CardNumber))
|
||||
query = query.Where(x => x.CardNumber.Contains(searchModel.CardNumber));
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.AccountNumber))
|
||||
query = query.Where(x => x.AccountNumber.Contains(searchModel.AccountNumber));
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.IBan))
|
||||
query = query.Where(x => x.IBan.Contains(searchModel.IBan));
|
||||
|
||||
// if (!string.IsNullOrWhiteSpace(searchModel.BankName))
|
||||
// query = query.Where(x => x.BankName.Contains(searchModel.BankName));
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.NationalIdentifier))
|
||||
query = query.Where(x =>
|
||||
_context.AuthorizedBankDetails
|
||||
.Include(a => a.OwnersList)
|
||||
.Any(a => a.id == x.Id &&
|
||||
a.OwnersList.Any(o => o.NationalIdentifier.Contains(searchModel.NationalIdentifier))));
|
||||
|
||||
return query.OrderByDescending(x => x.Id).ToList();
|
||||
}
|
||||
|
||||
public AuthorizedBankDetailsViewModel GetByIban(string iban)
|
||||
{
|
||||
return _context.AuthorizedBankDetails
|
||||
.Include(x => x.OwnersList)
|
||||
.Where(x => x.IBan == iban)
|
||||
.Select(x => new AuthorizedBankDetailsViewModel
|
||||
{
|
||||
Id = x.id,
|
||||
CardNumber = x.CardNumber,
|
||||
AccountNumber = x.AccountNumber,
|
||||
IBan = x.IBan,
|
||||
BankName = x.BankName,
|
||||
NationalIdentifier = x.OwnersList.FirstOrDefault().NationalIdentifier,
|
||||
Owners = x.OwnersList.Select(o=> new AuthorizedBankDetailsOwnerViewModel()
|
||||
{
|
||||
FName = o.FName,
|
||||
LName = o.LName,
|
||||
NationalIdentifier = o.NationalIdentifier,
|
||||
CustomerType = o.CustomerType
|
||||
}).ToList()
|
||||
})
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -592,7 +592,7 @@ public class EmployerRepository : RepositoryBase<long, Employer>, IEmployerRepos
|
||||
var legalTypeValue = legalType == LegalType.Real ? "حقیقی" : "حقوقی";
|
||||
query = query.Where(x => x.IsLegal == legalTypeValue);
|
||||
}
|
||||
|
||||
|
||||
var viewModelQuery = query.Select(x => new EmployerSelectListViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
@@ -1078,7 +1078,12 @@ public class EmployerRepository : RepositoryBase<long, Employer>, IEmployerRepos
|
||||
PlaceOfIssue = employer.PlaceOfIssue,
|
||||
DateOfIssue = employer.DateOfIssue.ToFarsi(),
|
||||
FatherName = employer.FatherName,
|
||||
Gender = employer.Gender == "مرد" ? Gender.Male : Gender.Female,
|
||||
Gender = employer.Gender switch
|
||||
{
|
||||
null => Gender.None,
|
||||
"مرد" => Gender.Male,
|
||||
_ => Gender.Female
|
||||
},
|
||||
GovernmentSystemInfo = governmentSystemInfo,
|
||||
IsAuth = employer.IsAuth,
|
||||
PhoneNumber = employer.Phone,
|
||||
@@ -1110,7 +1115,6 @@ public class EmployerRepository : RepositoryBase<long, Employer>, IEmployerRepos
|
||||
CeoIdNumber = employer.IdNumber,
|
||||
IdNumberSeri = employer.IdNumberSeri,
|
||||
TelephoneNumber = employer.IdNumber
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1123,7 +1127,6 @@ public class EmployerRepository : RepositoryBase<long, Employer>, IEmployerRepos
|
||||
InstitutionWorkshopInitialId = contractWorkshopInitial.id,
|
||||
RealEmployer = realEmployer,
|
||||
LegalEmployer = legalEmployer,
|
||||
|
||||
};
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ using Company.Domain.FinancialStatmentAgg;
|
||||
using Company.Domain.FinancialTransactionAgg;
|
||||
using Company.Domain.InstitutionContractAgg;
|
||||
using Company.Domain.InstitutionContractContactInfoAgg;
|
||||
using Company.Domain.InstitutionContractInsertTempAgg;
|
||||
using Company.Domain.InstitutionContractExtensionTempAgg;
|
||||
using Company.Domain.InstitutionPlanAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
@@ -1476,6 +1476,11 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
case InstitutionContractListStatus.Deactive:
|
||||
joinedQuery = joinedQuery.Where(x => x.contract.ContractEndGr < now);
|
||||
break;
|
||||
|
||||
case InstitutionContractListStatus.PendingForVerify:
|
||||
joinedQuery = joinedQuery.Where(x =>
|
||||
x.contract.VerificationStatus == InstitutionContractVerificationStatus.PendingForVerify);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1820,9 +1825,11 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
|
||||
public async Task<InstitutionContract> GetByPublicIdAsync(Guid id)
|
||||
{
|
||||
return await _context.InstitutionContractSet.FirstOrDefaultAsync(x => x.PublicId == id);
|
||||
return await _context.InstitutionContractSet.Include(x=>x.ContactInfoList).FirstOrDefaultAsync(x => x.PublicId == id);
|
||||
}
|
||||
|
||||
#region Extension
|
||||
|
||||
public async Task<InstitutionContractExtensionInquiryResult> GetExtensionInquiry(long previousContractId)
|
||||
{
|
||||
var institutionContracts = await _context.InstitutionContractSet
|
||||
@@ -2035,7 +2042,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
res.ThreeMonths =
|
||||
CalculateInstitutionPlan(InstitutionContractDuration.ThreeMonths, amount, false, newContractStart);
|
||||
|
||||
res.SixMonths =
|
||||
res.SixMonths =
|
||||
CalculateInstitutionPlan(InstitutionContractDuration.SixMonths, amount, false, newContractStart);
|
||||
|
||||
res.TwelveMonths = CalculateInstitutionPlan(InstitutionContractDuration.TwelveMonths, amount, false,
|
||||
@@ -2046,7 +2053,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
.Select(x => new InstitutionContractExtensionTempWorkshop(x.WorkshopName, x.CountPerson,
|
||||
x.ContractAndCheckout, x.ContractAndCheckoutInPerson,
|
||||
x.Insurance, x.InsuranceInPerson, x.RollCall, x.RollCall,
|
||||
x.RollCallInPerson, x.WorkshopServicesAmount,x.WorkshopId)).ToList();
|
||||
x.RollCallInPerson, x.WorkshopServicesAmount, x.WorkshopId)).ToList();
|
||||
|
||||
institutionTemp.SetWorkshopsAndPlanAmounts(workshops, res.OneMonth, res.ThreeMonths, res.SixMonths,
|
||||
res.TwelveMonths, hasInPerson);
|
||||
@@ -2275,7 +2282,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
}
|
||||
|
||||
var today = DateTime.Today;
|
||||
if (request.IsInstallment && payment is InstitutionContractExtensionPaymentMonthly monthly)
|
||||
if (request.IsInstallment && payment is InstitutionContractPaymentMonthlyViewModel monthly)
|
||||
{
|
||||
var installments = monthly.Installments.Select(x =>
|
||||
new InstitutionContractInstallment(x.InstalmentDate.ToGeorgianDateTime(),
|
||||
@@ -2331,6 +2338,55 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public async Task<InstitutionContractAmendmentWorkshopsResponse> GetAmendmentWorkshops(long institutionContractId)
|
||||
{
|
||||
var institutionContract = await _context.InstitutionContractSet
|
||||
.Include(x => x.WorkshopGroup)
|
||||
.ThenInclude(x => x.CurrentWorkshops)
|
||||
.FirstOrDefaultAsync(x => x.id == institutionContractId);
|
||||
|
||||
var workshops = institutionContract.WorkshopGroup.CurrentWorkshops.Select(x => new WorkshopTempViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
ContractAndCheckout = x.Services.Contract,
|
||||
ContractAndCheckoutInPerson = x.Services.ContractInPerson,
|
||||
CustomizeCheckout = x.Services.CustomizeCheckout,
|
||||
CountPerson = x.PersonnelCount,
|
||||
Insurance = x.Services.Insurance,
|
||||
InsuranceInPerson = x.Services.InsuranceInPerson,
|
||||
RollCall = x.Services.RollCall,
|
||||
WorkshopName = x.WorkshopName,
|
||||
WorkshopServicesAmountStr = x.Price.ToMoney(),
|
||||
WorkshopServicesAmount = x.Price,
|
||||
WorkshopId = x.WorkshopId ?? 0,
|
||||
RollCallInPerson = x.Services.RollCallInPerson,
|
||||
|
||||
}).ToList();
|
||||
var res = new InstitutionContractAmendmentWorkshopsResponse()
|
||||
{
|
||||
Workshops = workshops
|
||||
};
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<InsitutionContractAmendmentPaymentResponse> GetAmendmentPaymentDetails(InsitutionContractAmendmentPaymentRequest request)
|
||||
{
|
||||
var institutionContract =await _context.InstitutionContractSet
|
||||
.Include(x => x.WorkshopGroup)
|
||||
.ThenInclude(x => x.CurrentWorkshops)
|
||||
.FirstOrDefaultAsync(x => x.id == request.InstitutionContractId);
|
||||
if (institutionContract == null)
|
||||
throw new NotFoundException("قرارداد مالی یافت نشد");
|
||||
|
||||
var amendmentStart = DateTime.Now;
|
||||
var amendmentEnd = institutionContract.ContractEndGr;
|
||||
//TODO : محاسبه مبلغ بر اساس کارگاه های انتخاب شده
|
||||
var res = new InsitutionContractAmendmentPaymentResponse();
|
||||
return res;
|
||||
|
||||
}
|
||||
public async Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search,
|
||||
string selected)
|
||||
{
|
||||
|
||||
@@ -1517,7 +1517,9 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
StartDate = y.StartDate.Value.ToString("HH:mm"),
|
||||
EndDate = y.EndDate!.Value.ToString("HH:mm"),
|
||||
StartDateGr = y.StartDate.Value,
|
||||
EndDateGr = y.EndDate.Value
|
||||
EndDateGr = y.EndDate.Value,
|
||||
EntryTimeDifferences = CalculateEntryTimeDifferences( y.EarlyEntryDuration, y.LateEntryDuration),
|
||||
ExitTimeDifferences = CalculateExitTimeDifferences(y.EarlyExitDuration, y.LateExitDuration)
|
||||
}),
|
||||
TotalWorkingHoursSpan = new TimeSpan(rollCallsList.Where(y => x.Date == y.ShiftDate.Date)
|
||||
.Sum(y => (y.EndDate!.Value - y.StartDate.Value).Ticks)),
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Json;
|
||||
using System.Text;
|
||||
@@ -7,6 +9,7 @@ using Newtonsoft.Json;
|
||||
using CompanyManagment.App.Contracts.AuthorizedPerson;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.UID;
|
||||
using Company.Application.Contracts.AuthorizedBankDetails;
|
||||
|
||||
namespace CompanyManagment.EFCore.Services;
|
||||
|
||||
@@ -14,15 +17,21 @@ public class UidService : IUidService
|
||||
{
|
||||
private readonly HttpClient _httpClient;
|
||||
private readonly IAuthorizedPersonApplication _authorizedPersonApplication;
|
||||
private const string BaseUrl = "https://json-api.uid.ir/api/inquiry/";
|
||||
private readonly IAuthorizedBankDetailsApplication _authorizedBankDetailsApplication;
|
||||
private const string BaseUrl = "https://json-api.uid.ir/api/";
|
||||
|
||||
public const string BusinessToken = "5e03dd4e-999d-466f-92d8-7c0b1f66a8e9";
|
||||
public const string BusinessId = "98ed67ca-d441-4978-a748-e8bebce010eb";
|
||||
|
||||
|
||||
public UidService(IAuthorizedPersonApplication authorizedPersonApplication)
|
||||
public UidService(IAuthorizedPersonApplication authorizedPersonApplication, IAuthorizedBankDetailsApplication authorizedBankDetailsApplication)
|
||||
{
|
||||
_httpClient = new HttpClient()
|
||||
{
|
||||
BaseAddress = new Uri(BaseUrl)
|
||||
};
|
||||
_authorizedPersonApplication = authorizedPersonApplication;
|
||||
_authorizedBankDetailsApplication = authorizedBankDetailsApplication;
|
||||
}
|
||||
|
||||
public async Task<PersonalInfoResponse> GetPersonalInfo(string nationalCode, string birthDate)
|
||||
@@ -53,7 +62,7 @@ public class UidService : IUidService
|
||||
|
||||
try
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("person/v2", contentType);
|
||||
var requestResult = await _httpClient.PostAsync("inquiry/person/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<PersonalInfoResponse>();
|
||||
@@ -138,11 +147,134 @@ public class UidService : IUidService
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
|
||||
var requestResult = await _httpClient.PostAsync("inquiry/mobile/owner/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<MatchMobileWithNationalCodeResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
|
||||
public async Task<IbanInquiryResponse> IbanInquiry(string iban)
|
||||
{
|
||||
// First check if bank details exist in database
|
||||
var existingBankDetails = _authorizedBankDetailsApplication.GetByIban(iban);
|
||||
if (existingBankDetails != null)
|
||||
{
|
||||
// Return data from database instead of calling API
|
||||
return CreateIbanInquiryResponseFromDatabase(existingBankDetails);
|
||||
}
|
||||
|
||||
// If not found in database, call UID API
|
||||
var request = new
|
||||
{
|
||||
iban,
|
||||
requestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
try
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("inquiry/iban/v2", contentType);
|
||||
requestResult.EnsureSuccessStatusCode();
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<IbanInquiryResponse>();
|
||||
|
||||
if (responseResult.ResponseContext.Status.Code == 0)
|
||||
{
|
||||
var entity = new CreateAuthorizedBankDetails
|
||||
{
|
||||
IBan = iban,
|
||||
AccountNumber = responseResult?.AccountBasicInformation?.AccountNumber ?? "",
|
||||
BankName = responseResult?.AccountBasicInformation?.BankInformation?.BankName ?? "",
|
||||
OwnersList = responseResult?.Owners.Select(x=> new CreateAuthorizedBankDetailsOwner()
|
||||
{
|
||||
FName = x.FirstName,
|
||||
LName = x.LastName,
|
||||
NationalIdentifier = x.NationalIdentifier,
|
||||
CustomerType = x.CustomerType
|
||||
}).ToList() ?? []
|
||||
};
|
||||
_authorizedBankDetailsApplication.Create(entity);
|
||||
}
|
||||
|
||||
return responseResult;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new IbanInquiryResponse
|
||||
{
|
||||
ResponseContext = new ResponseContext(new UidStatus(14, "خطا در دریافت اطلاعات از سرویس"))
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private IbanInquiryResponse CreateIbanInquiryResponseFromDatabase(AuthorizedBankDetailsViewModel bankDetails)
|
||||
{
|
||||
var accountBasicInfo = new IbanInquiryAccountBasicInformation
|
||||
{
|
||||
Iban = bankDetails.IBan,
|
||||
AccountNumber = bankDetails.AccountNumber,
|
||||
BankInformation = new IbanInquiryBankInformation
|
||||
{
|
||||
BankName = bankDetails.BankName
|
||||
},
|
||||
AccountStatus = "Active"
|
||||
};
|
||||
|
||||
var owners = new List<IbanInquiryOwner>();
|
||||
|
||||
// Add owner information if available
|
||||
if (bankDetails.Owners.Any())
|
||||
{
|
||||
var owner = bankDetails.Owners.First();
|
||||
owners.Add(new IbanInquiryOwner
|
||||
{
|
||||
NationalIdentifier = owner.NationalIdentifier,
|
||||
FirstName = owner.FName,
|
||||
LastName = owner.LName,
|
||||
CustomerType = owner.CustomerType
|
||||
});
|
||||
}
|
||||
|
||||
var responseContext = new ResponseContext(new UidStatus(0, "Success - از دیتابیس"));
|
||||
|
||||
return new IbanInquiryResponse
|
||||
{
|
||||
AccountBasicInformation = accountBasicInfo,
|
||||
Owners = owners,
|
||||
ResponseContext = responseContext
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<AccountToIbanResponse> AccountToIban(string accountNumber, UidBanks bank)
|
||||
{
|
||||
var request = new
|
||||
{
|
||||
accountNumber,
|
||||
bank,
|
||||
requestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
var requestResult = await _httpClient.PostAsync("account-to-iban", contentType);
|
||||
requestResult.EnsureSuccessStatusCode();
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<AccountToIbanResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
|
||||
public async Task<CardToNumberResponse> CardToIban(string cardNumber)
|
||||
{
|
||||
var request = new
|
||||
{
|
||||
cardNumber,
|
||||
requestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
var requestResult = await _httpClient.PostAsync("inquiry/card", contentType);
|
||||
requestResult.EnsureSuccessStatusCode();
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<CardToNumberResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using _0_Framework.Application.UID;
|
||||
using Company.Application.Contracts.AuthorizedBankDetails;
|
||||
using Company.Domain.BillAgg;
|
||||
using Company.Domain.Board;
|
||||
using Company.Domain.ChapterAgg;
|
||||
@@ -209,6 +210,7 @@ using Company.Domain.ContactUsAgg;
|
||||
using CompanyManagment.App.Contracts.ContactUs;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using Company.Domain.AuthorizedBankDetailsAgg;
|
||||
using Company.Domain.ContractingPartyBankAccountsAgg;
|
||||
using Company.Domain.PaymentInstrumentAgg;
|
||||
using Company.Domain.PaymentTransactionAgg;
|
||||
@@ -218,7 +220,7 @@ using CompanyManagment.App.Contracts.PaymentInstrument;
|
||||
using CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
using CompanyManagment.App.Contracts.AuthorizedPerson;
|
||||
using Company.Domain.AuthorizedPersonAgg;
|
||||
using Company.Domain.InstitutionContractInsertTempAgg;
|
||||
using Company.Domain.InstitutionContractExtensionTempAgg;
|
||||
using Company.Domain.LawAgg;
|
||||
using CompanyManagement.Infrastructure.Mongo.InstitutionContractInsertTempRepo;
|
||||
using CompanyManagment.App.Contracts.Law;
|
||||
@@ -472,6 +474,9 @@ public class PersonalBootstrapper
|
||||
services.AddTransient<ILawApplication,LawApplication>();
|
||||
services.AddTransient<ILawRepository,LawRepository>();
|
||||
|
||||
services.AddTransient<IAuthorizedBankDetailsRepository, AuthorizedBankDetailsRepository>();
|
||||
services.AddTransient<IAuthorizedBankDetailsApplication, AuthorizedBankDetailsApplication>();
|
||||
|
||||
services
|
||||
.AddTransient<IInstitutionContractExtenstionTempRepository, InstitutionContractExtenstionTempRepository>();
|
||||
#endregion
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.UID;
|
||||
using Bogus;
|
||||
using CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -43,4 +44,16 @@ public class ContractingPartyBankAccountController : AdminBaseController
|
||||
return operationResult;
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("uid-banks")]
|
||||
public async Task<IActionResult> GetUidBanks()
|
||||
{
|
||||
var banks = Enum.GetValues(typeof(UidBanks)).Cast<UidBanks>().Select(x =>
|
||||
new {
|
||||
Lable = x.GetPersianName(),
|
||||
Value = x
|
||||
});
|
||||
return Ok(banks);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Sms;
|
||||
using _0_Framework.Application.UID;
|
||||
using AccountManagement.Application.Contracts.Task;
|
||||
using AccountManagement.Application.Contracts.Ticket;
|
||||
using CompanyManagment.App.Contracts.ClientDashboard;
|
||||
@@ -16,14 +17,16 @@ public class DashboardController : AdminBaseController
|
||||
private readonly IHolidayItemApplication _holidayItemApplication;
|
||||
private readonly ITaskApplication _taskApplication;
|
||||
private readonly ITicketApplication _ticketApplication;
|
||||
private readonly IUidService _uidService;
|
||||
private long UserId;
|
||||
|
||||
public DashboardController(ISmsService smsService, IHolidayItemApplication holidayItemApplication, ITaskApplication taskApplication,IAuthHelper authHelper, ITicketApplication ticketApplication)
|
||||
public DashboardController(ISmsService smsService, IHolidayItemApplication holidayItemApplication, ITaskApplication taskApplication,IAuthHelper authHelper, ITicketApplication ticketApplication, IUidService uidService)
|
||||
{
|
||||
_smsService = smsService;
|
||||
_holidayItemApplication = holidayItemApplication;
|
||||
_taskApplication = taskApplication;
|
||||
_ticketApplication = ticketApplication;
|
||||
_uidService = uidService;
|
||||
UserId = authHelper.CurrentAccountId();
|
||||
}
|
||||
[HttpGet]
|
||||
|
||||
@@ -229,26 +229,9 @@ public class PaymentInstrumentController:AdminBaseController
|
||||
|
||||
|
||||
[HttpPost("bank-account-inquiry")]
|
||||
public async Task<ActionResult<OperationResult<BankInquiryResponse>>> GetBankInquiry([FromBody]BankInquiryRequest command)
|
||||
public async Task<ActionResult<ContractingPartyBankInquiryResponse>> GetBankInquiry([FromBody]InquiryContractingPartyBankDetailsRequest command)
|
||||
{
|
||||
if ((!string.IsNullOrWhiteSpace(command.AccountNumber) && command.AccountNumber.StartsWith("111111")) || (!string.IsNullOrWhiteSpace(command.CardNumber)&&command.CardNumber.StartsWith("111111")) || (!string.IsNullOrWhiteSpace(command.IBan)&&command.IBan.StartsWith("1111111")))
|
||||
{
|
||||
return new OperationResult<BankInquiryResponse>().Succcedded(new BankInquiryResponse()
|
||||
{
|
||||
AccountNumber = "1111111",
|
||||
IBan = "111111111111111111111111",
|
||||
CardNumber = "1111111111111111",
|
||||
AccountHolderName = "تست تستی",
|
||||
BankName = "تست بانک",
|
||||
});
|
||||
}else if ((!string.IsNullOrWhiteSpace(command.AccountNumber) && command.AccountNumber.StartsWith("222222")) || (!string.IsNullOrWhiteSpace(command.CardNumber)&&command.CardNumber.StartsWith("222222")) || (!string.IsNullOrWhiteSpace(command.CardNumber)&&command.CardNumber.StartsWith("222222")))
|
||||
{
|
||||
return new OperationResult<BankInquiryResponse>().Failed("دیتای وارد شده نامعتبر است");
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InternalServerException("ارور سمت سرور");
|
||||
}
|
||||
return await _contractingPartyBankAccountsApplication.InquiryContractingPartyBankDetails(command);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -520,6 +520,13 @@ public class institutionContractController : AdminBaseController
|
||||
var res =await _institutionContractApplication.ExtensionComplete(request);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpGet("amendment/workshops/{institutionContractId}")]
|
||||
public async Task<ActionResult<InstitutionContractAmendmentWorkshopsResponse>> GetAmendmentWorkshops(long institutionContractId)
|
||||
{
|
||||
var res =await _institutionContractApplication.GetAmendmentWorkshops(institutionContractId);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -871,6 +871,14 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn" />
|
||||
</label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="1004" class="check-btn"> <span style="bottom: 2px;position: relative"> قرارداد های مالی </span> </label>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@* بررسی مدارک پرسنل *@
|
||||
<div class="parent-check">
|
||||
|
||||
@@ -881,6 +881,15 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn" />
|
||||
</label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="1004" class="check-btn"> <span style="bottom: 2px;position: relative"> قرارداد های مالی </span> </label>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@* بررسی مدارک پرسنل *@
|
||||
<div class="parent-check">
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
@page
|
||||
@using _0_Framework.Application
|
||||
@using Microsoft.Extensions.Options
|
||||
@model ServiceHost.Areas.AdminNew.Pages.Company.WorkFlow.IndexModel
|
||||
@inject IOptions<AppSettingConfiguration> AppSetting;
|
||||
|
||||
@{
|
||||
}
|
||||
|
||||
@@ -122,6 +126,22 @@
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="gwb-card" permission="1004">
|
||||
<a href="https://admin@(AppSetting.Value.Domain)/workflow/institution-contract" class="click loadingButton">
|
||||
<div class="d-flex align-items-center justify-content-between p-1 w-100">
|
||||
<div class="d-flex align-items-center">
|
||||
<img src="~/AssetsClient/images/insuranceList.png" alt="" class="img-fluid mx-1" width="50px" />
|
||||
<div class="text-start ms-1">
|
||||
<div class="card-title">قرارداد های مالی</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner-loading loading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@* <div class="gwb-card">
|
||||
<a asp-page="/Company/WorkFlow/Insurance" class="click loadingButton">
|
||||
|
||||
@@ -382,7 +382,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
IsAbsent = x.IsAbsent,
|
||||
TotalWorkingHours = x.TotalWorkingHours,
|
||||
StartsItems = string.Join(Environment.NewLine, x.RollCallTimesList.Select(tr=>tr.StartDate)),
|
||||
EndsItems= string.Join(Environment.NewLine, x.RollCallTimesList.Select(tr=>tr.EndDate))
|
||||
EndsItems= string.Join(Environment.NewLine, x.RollCallTimesList.Select(tr=>tr.EndDate)),
|
||||
EnterTimeDifferences = string.Join(Environment.NewLine, x.RollCallTimesList.Select(tr=>tr.EntryTimeDifferences)),
|
||||
ExitTimeDifferences = string.Join(Environment.NewLine, x.RollCallTimesList.Select(tr=>tr.ExitTimeDifferences))
|
||||
}).ToList()
|
||||
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<h6 class="m-0">پرینت حضور و غیاب انفرادی @Model.PersianMonthName ماه @Model.PersianYear</h6>
|
||||
</div>
|
||||
|
||||
```````
|
||||
<div class="modal-body" id="divTablescrollbar">
|
||||
<div class="row main-table">
|
||||
|
||||
@@ -121,7 +121,17 @@
|
||||
<span class="m-0">@item.DateFa</span>
|
||||
</td>
|
||||
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
|
||||
-
|
||||
@if (item.RollCallTimesList.Any())
|
||||
{
|
||||
@foreach (var rollCallItem in item.RollCallTimesList)
|
||||
{
|
||||
<div>@(rollCallItem.EntryTimeDifferences ?? "-")</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>-</span>
|
||||
}
|
||||
</td>
|
||||
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
|
||||
@if (item.RollCallTimesList.Any())
|
||||
@@ -150,7 +160,17 @@
|
||||
}
|
||||
</td>
|
||||
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
|
||||
-
|
||||
@if (item.RollCallTimesList.Any())
|
||||
{
|
||||
@foreach (var rollCallItem in item.RollCallTimesList)
|
||||
{
|
||||
<div>@(rollCallItem.ExitTimeDifferences ?? "-")</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>-</span>
|
||||
}
|
||||
</td>
|
||||
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
|
||||
@item.TotalWorkingHours
|
||||
|
||||
Reference in New Issue
Block a user