Compare commits

...

65 Commits

Author SHA1 Message Date
45002b88c4 fix: update absence terminology to 'عدم حضور' across multiple files 2025-10-22 11:18:55 +03:30
85e2481680 feat: enhance financial statement retrieval with contracting party validation and creation 2025-10-21 13:50:42 +03:30
232a834dc9 feat: add resend verification link end point added 2025-10-21 11:41:23 +03:30
78458f24e5 feat: add entry and exit time differences to roll call reports 2025-10-20 15:43:59 +03:30
syntax24
dbddccf011 add inew permission admin > workflow > institution-contract 2025-10-19 23:06:14 +03:30
488454d354 feat: add authorized bank details functionality with repository and application layers 2025-10-19 13:20:54 +03:30
4126a7370f fix: handle nullable UidBank in account number conversion 2025-10-19 12:17:33 +03:30
7aff8ba59f fix: fix url workflow institution contract 2025-10-18 19:55:06 +03:30
950f2884ac Merge branch 'Main' 2025-10-18 09:20:10 +03:30
2edf150ef6 Merge branch 'Feature/Registeration-workflow/add-existed-employer' 2025-10-18 09:03:26 +03:30
df9c268959 Merge branch 'Feature/contracting-party-bank-account/add-inquiry' 2025-10-18 09:03:18 +03:30
3c6303e817 feat: add financial contracts card to workflow page 2025-10-16 18:06:44 +03:30
23386fda76 Merge branch 'Feature/contracting-party-bank-account/add-inquiry' into Main 2025-10-16 16:02:40 +03:30
119f4496cd feat: add endpoint to retrieve UID banks with Persian names 2025-10-16 16:01:49 +03:30
ce4fc33daa Merge branch 'Feature/Registeration-workflow/add-existed-employer' into Main 2025-10-16 15:42:21 +03:30
f5d95b21b0 feat: enhance employer gender handling in registration workflow 2025-10-16 15:41:49 +03:30
6e83904e11 Merge branch 'Feature/Registeration-workflow/add-existed-employer' into Main 2025-10-16 15:27:30 +03:30
1f7785581c feat: streamline employer removal process from workshop details 2025-10-16 15:26:53 +03:30
9140f1ea0b Merge branch 'Feature/contracting-party-bank-account/add-inquiry' into Main 2025-10-16 14:00:37 +03:30
81e6094817 feat: add bank inquiry functionality and validation methods for IBAN and card numbers 2025-10-16 13:52:05 +03:30
e5c0a7db58 Merge branch 'Feature/Registeration-workflow/add-existed-employer' into Main 2025-10-16 12:17:10 +03:30
d44a9224be feat: prevent duplicate employer registration in workshop 2025-10-16 12:16:31 +03:30
a5e68cbd90 feat: remove deprecated account info endpoints and update request context structure in UidService 2025-10-16 10:20:02 +03:30
37a6920a74 feat: implement account information retrieval methods in DashboardController and UidService 2025-10-16 09:20:47 +03:30
db40ab567c refactor: update InstitutionContractAmendment and InstitutionContractAmendmentChange constructors for improved encapsulation 2025-10-16 08:01:10 +03:30
5f324a6fa1 refactor: rename zInstitutionContractExtensionPaymentResponse to InstitutionContractExtensionPaymentResponse 2025-10-15 18:06:20 +03:30
d1703ad20e refactor: remove unused classes and rename InstitutionContractExtensionPaymentResponse 2025-10-15 17:50:52 +03:30
2f38470746 Merge branch 'Feature/InstitutionContract/upgrade' into Main
# Conflicts:
#	Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs
#	CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs
#	CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs
2025-10-15 17:49:23 +03:30
23c02abe65 feat: add endpoint to retrieve amendment workshops by institution contract ID 2025-10-15 17:34:16 +03:30
475142744f Merge branch 'Feature/admin-dashboard/add-date-details' into Main 2025-10-15 16:33:51 +03:30
230cde7c15 feat: enhance AdminDashboardViewModel to include date details for improved dashboard insights 2025-10-15 16:33:14 +03:30
13a2cd78cd feat: improve institution contract retrieval and ensure account creation consistency 2025-10-15 12:28:30 +03:30
4aa3c10466 feat: update API endpoint for bank inquiries in UidService 2025-10-15 11:57:12 +03:30
91fc560355 feat: enhance registration workflow by adding account creation for contracting parties 2025-10-15 11:32:23 +03:30
8acb25dd67 feat: refactor financial transaction list processing for improved readability and performance 2025-10-15 10:54:09 +03:30
9297bdefb5 feat: add bank inquiry methods and UidBanks enum for bank identification 2025-10-15 10:38:50 +03:30
61b326aed4 feat: enhance InstitutionContractAmendment with lawId and improve constructor logic 2025-10-15 08:27:00 +03:30
Mahan Chamani
397280d0a2 Merge pull request #2 from samsyntax24/Main
Main
2025-10-14 12:11:11 +00:00
5975a92aa1 Merge branch 'Feature/Registeration-workflow/add-existed-employer' into Main 2025-10-14 15:15:03 +03:30
0cec7c0cce feat: update institution contract retrieval to use WorkshopGroup's InstitutionContractId 2025-10-14 15:14:36 +03:30
be6cb6430f Merge branch 'Fix/institution-contract/list-search' into Main
# Conflicts:
#	ServiceHost/Areas/Admin/Controllers/RegistrationWorkflowController.cs
2025-10-14 14:21:58 +03:30
f863fb065f feat: update search functionality in InstitutionContractRepository and add edit route in RegistrationWorkflowController 2025-10-14 14:20:56 +03:30
76aa1eae88 Merge branch 'Fix/institution-contract/list-search' into Main 2025-10-14 14:06:21 +03:30
d0b29e7643 feat: add GetInstitutionContractSelectList method for improved search functionality 2025-10-14 14:05:44 +03:30
f1106deff9 feat: add authentication fields and workflow registration retrieval for employers 2025-10-14 12:10:50 +03:30
94a5741906 feat: add optional legal type parameter to employer selection list retrieval 2025-10-14 10:33:08 +03:30
221d06a0fc Merge branch 'Feature/Registeration-workflow/add-existed-employer' into Main 2025-10-14 09:59:19 +03:30
2b993fb746 feat: enhance employer selection with optional legal type filtering 2025-10-14 09:58:49 +03:30
756e06cc2f feat: implement amendment features in InstitutionContract, including payment and workshop retrieval 2025-10-14 09:51:29 +03:30
syntax24
5b3c7e471e web.config remove new tag 2025-10-13 15:45:12 +03:30
syntax24
330a3ca839 web.config change 2025-10-13 15:34:53 +03:30
7c4cf1e2ed feat: add edit laws and regulations link to the menu 2025-10-13 15:14:24 +03:30
1d2c4f26f1 Merge branch 'Feature/law/add-edit-law' 2025-10-13 13:02:18 +03:30
761ac352df Merge branch 'Feature/Registeration-workflow/add-existed-employer' into Main 2025-10-13 12:56:47 +03:30
ecfb7af386 feat: implement archive code retrieval for workshops in registration workflow 2025-10-13 12:43:53 +03:30
92fd8d6b0e feat: add support for existing employers in registration workflow 2025-10-13 11:33:42 +03:30
4f68d141e8 Merge branch 'Feature/Insurance/add-not-created-tab' 2025-10-13 11:17:40 +03:30
75ea35596b refactor: comment out conditional checks in Index.js for clarity 2025-10-13 11:17:13 +03:30
a0e2b969c0 fix insitution contract convetor for multi employer workshops 2025-10-13 10:47:29 +03:30
8efffe8b75 feat: add LawId to InstitutionContract and related classes for improved contract management 2025-10-13 09:29:59 +03:30
fdf7fa0d3c feat: add versioning to Law entity and implement version management in LawApplication 2025-10-13 09:02:17 +03:30
5cde26e7f3 fix: update dashboard links to use Next URLs 2025-10-13 08:00:20 +03:30
b448c43bb7 Merge branch 'Feature/Insurance/add-not-created-tab' 2025-10-13 07:49:13 +03:30
6045153865 fix: duplicate insurance record in not created insurances 2025-10-13 07:48:45 +03:30
5d16020c6a feat: optimize join queries in InsuranceListRepository for improved data retrieval 2025-10-12 12:23:56 +03:30
88 changed files with 35974 additions and 940 deletions

View File

@@ -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)
{

View File

@@ -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>

View File

@@ -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; }
}

View 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
}

View 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();
}
}
}

View File

@@ -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; }
}
}

View File

@@ -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);
}
}

View File

@@ -54,9 +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);
}

View File

@@ -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;
@@ -17,7 +19,7 @@ public class InstitutionContract : EntityBase
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,
List<InstitutionContractWorkshopInitial> workshopDetails)
List<InstitutionContractWorkshopInitial> workshopDetails, long lawId)
{
ContractNo = contractNo;
RepresentativeId = representativeId;
@@ -54,8 +56,11 @@ public class InstitutionContract : EntityBase
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; }
@@ -116,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; }
@@ -251,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; }
@@ -259,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; }
@@ -307,8 +351,6 @@ public class InstitutionContractAmendmentChange : EntityBase
/// تعداد کارگاه
/// </summary>
public long? WorkshopDetailsId { get; private set; }
}
public enum InstitutionContractAmendmentChangeType

View File

@@ -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
{

View File

@@ -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;

View File

@@ -16,6 +16,7 @@ namespace Company.Domain.LawAgg
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<string> Notifications
@@ -26,14 +27,15 @@ namespace Company.Domain.LawAgg
set => NotificationsJson = JsonSerializer.Serialize(value);
}
public Law(string title, LawType lawType, List<string> notifications, string headTitle )
public Law(string title, LawType lawType, List<string> notifications, string headTitle, int version = 1)
{
Title = title;
IsActive = true;
IsActive = true; // آخرین نسخه فعال است
Items = new List<LawItem>();
Type = lawType;
Notifications = notifications ?? new List<string>();
HeadTitle = headTitle;
Version = version;
}
public void Edit(string title)
@@ -46,7 +48,6 @@ namespace Company.Domain.LawAgg
Items.Add(new LawItem(header, details, orderNumber));
}
public void SetItem(List<LawItem> items)
{
Items = items ?? new List<LawItem>();
@@ -67,6 +68,32 @@ namespace Company.Domain.LawAgg
{
IsActive = false;
}
public void SetAsLatestVersion()
{
IsActive = true;
}
public void SetAsOldVersion()
{
IsActive = false;
}
public Law CreateNewVersion(string title, List<string> notifications, string headTitle, List<LawItem> items)
{
var newVersion = new Law(
title,
this.Type,
notifications,
headTitle,
this.Version + 1
);
newVersion.SetItem(items);
newVersion.SetAsLatestVersion();
return newVersion;
}
}
public class LawItem

View File

@@ -70,6 +70,7 @@ public interface IWorkshopRepository : IRepository<long, Workshop>
Task<List<WorkshopWithLeftWorkTempEmployeesDto>> GetWorkshopsForLeftWorkTemp(long accountId);
Task<int> GetWorkshopsForLeftWorkTempCount(long accountId);
Task<List<WorkshopSelectListViewModel>> GetSelectList(string search, long id);
int GetLastArchiveCode();
#endregion

View File

@@ -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<Workshop> 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;
}
}

View File

@@ -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<long, Employer>
List<EmployerViewModel> GetEmployersHasWorkshop();
Task<List<EmployerSelectListViewModel>> GetSelectList(string search,long id);
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id, LegalType? legalType);
#endregion
@@ -68,5 +70,5 @@ public interface IEmployerRepository : IRepository<long, Employer>
#endregion
Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId, long institutionWorkshopDetailsId);
}

View File

@@ -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

View File

@@ -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 $"";
}
}
}

View File

@@ -1,4 +1,4 @@
using Company.Domain.InstitutionContractInsertTempAgg;
using Company.Domain.InstitutionContractExtensionTempAgg;
using MongoDB.Driver;
namespace CompanyManagement.Infrastructure.Mongo.InstitutionContractInsertTempRepo;

View File

@@ -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; }
}
}

View File

@@ -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; }
}

View File

@@ -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; }
}
}

View File

@@ -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; }
}
}

View File

@@ -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);
}
}

View File

@@ -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; }
}

View File

@@ -6,6 +6,7 @@ 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;
@@ -46,8 +47,9 @@ public interface IEmployerApplication
/// </summary>
/// <param name="search"></param>
/// <param name="id"></param>
/// <param name="legalType"></param>
/// <returns></returns>
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id);
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id, LegalType? legalType = null);
#endregion
#region NewByHeydari
@@ -145,6 +147,7 @@ public interface IEmployerApplication
Task<OperationResult> DeleteWorkflowRegistration(long employerId, long institutionWorkshopDetailsId);
Task<OperationResult<AuthenticateUserViewModel>> AuthenticateEmployer(string nationalCode, string dateOfBirth, string mobile);
Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId, long institutionWorkshopDetailsId);
}
public class AuthenticateUserViewModel
@@ -207,6 +210,11 @@ public class AuthenticateUserViewModel
/// </summary>
public class CreateEmployerWorkflowRegistration
{
/// <summary>
/// درزمانی که یوزر کارفرمایی رو انتخاب کرد که از قبل ثبت شده است
/// این فیلد باید مقدار داشته باشد
/// </summary>
public long EmployerId { get; set; }
/// <summary>
/// اطلاعات کارفرمای حقیقی
/// </summary>
@@ -323,7 +331,9 @@ public class CreateLegalEmployerWorkflowRegistration
/// اطلاعات سیستم دولتی
/// </summary>
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
public string IdNumberSeri { get; set; }
public string IdNumberSerial { get; set; }
}
/// <summary>
@@ -395,6 +405,9 @@ public class CreateRealEmployerWorkflowRegistration
/// شماره تلفن
/// </summary>
public string Telephone { get; set; }
public string IdNumberSeri { get; set; }
public string IdNumberSerial { get; set; }
}
/// <summary>

View File

@@ -8,6 +8,7 @@ namespace CompanyManagment.App.Contracts.InstitutionContract;
public class CreateInstitutionContract
{
public long LawId { get; set; }
public string ContractNo { get; set; }
[Required(ErrorMessage = "انتخاب معرف اجباری است")]

View File

@@ -100,6 +100,8 @@ public class CreateInstitutionContractRequest
public double TaxAmount { get; set; }
public double OneMonthAmount { get; set; }
public long LawId { get; set; }
}
/// <summary>
/// مدت زمان قرارداد نهاد

View File

@@ -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 => "ساعت حضور و غیاب";

View File

@@ -212,15 +212,63 @@ 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
Task<OperationResult> ResendVerifyLink(long institutionContractId);
}
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;
public class InstitutionContractExtensionInquiryResponse
{
public long Id { get; set; }
@@ -238,18 +286,7 @@ public class InstitutionContractExtensionInquiryResponse
public string NationalCode { get; set; }
}
public class InstitutionContractExtensionCompleteRequest
{
public Guid TemporaryId { get; set; }
public bool IsInstallment { get; set; }
}
public class InstitutionContractExtensionPaymentResponse
{
public InstitutionContractExtensionPaymentOneTime OneTime { get; set; }
public InstitutionContractExtensionPaymentMonthly Monthly { get; set; }
}
public class InstitutionContractExtensionPaymentMonthly:InstitutionContractExtensionPaymentOneTime
{

View File

@@ -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; }
}

View File

@@ -0,0 +1,8 @@
namespace CompanyManagment.App.Contracts.InstitutionContract;
public class InstitutionContractExtensionPaymentResponse
{
public InstitutionContractPaymentOneTimeViewModel OneTime { get; set; }
public InstitutionContractPaymentMonthlyViewModel Monthly { get; set; }
}

View File

@@ -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; }
}

View File

@@ -3,4 +3,6 @@ namespace CompanyManagment.App.Contracts.InstitutionContract;
public class InstitutionContractWorkshopDetailViewModel
{
public WorkshopServicesViewModel ServicesViewModel { get; set; }
public string WorkshopName { get; set; }
public int ArchiveCode { get; set; }
}

View File

@@ -14,6 +14,7 @@ namespace CompanyManagment.App.Contracts.Law
public LawType Type { get; set; }
public string HeadTitle { get; set; }
public List<string> Notifications { get; set; }
public int Version { get; set; }
}
public class LawItemViewModel

View File

@@ -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);
}
}
}

View File

@@ -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;
}
}

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Security.AccessControl;
using System.Threading.Tasks;
using System.Xml;
using _0_Framework.Application;
using _0_Framework.Application.Enums;
using _0_Framework.Application.UID;
@@ -13,6 +14,7 @@ using Company.Domain.WorkshopAgg;
using CompanyManagment.App.Contracts.Checkout;
using CompanyManagment.App.Contracts.Employer;
using CompanyManagment.EFCore.Repository;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Identity.Client;
namespace CompanyManagment.Application;
@@ -42,7 +44,6 @@ public class EmployerApplication : IEmployerApplication
}
public OperationResult Active(long id)
{
var opration = new OperationResult();
@@ -1029,7 +1030,7 @@ public class EmployerApplication : IEmployerApplication
}
#endregion
#region Api
public async Task<List<GetEmployerListViewModel>> GetEmployerList(GetEmployerSearchModel searchModel)
@@ -1285,9 +1286,10 @@ public class EmployerApplication : IEmployerApplication
return opration.Succcedded();
}
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id)
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id,
LegalType? legalType = null)
{
return await _EmployerRepository.GetSelectList(search, id);
return await _EmployerRepository.GetSelectList(search, id, legalType);
}
async Task<OperationResult<string>> IEmployerApplication.Remove(long id)
@@ -1312,19 +1314,36 @@ public class EmployerApplication : IEmployerApplication
{
var operation = new OperationResult();
var tranasction = await _EmployerRepository.BeginTransactionAsync();
OperationResult<Employer> createEmployerResult = command.LegalType switch
Employer employer;
if (command.EmployerId != 0)
{
LegalType.Real => await CreateRealEmployerRegistration(command.RealEmployer, command.ContractingPartyId),
LegalType.Legal => await CreateLegalEmployerRegistration(command.LegalEmployer, command.ContractingPartyId),
_ => throw new ArgumentOutOfRangeException()
};
var employer = createEmployerResult.Data;
employer = _EmployerRepository.Get(command.EmployerId);
if (employer == null)
throw new NotFoundException("کارفرمای مورد نظر یافت نشد");
}
else
{
OperationResult<Employer> createEmployerResult = command.LegalType switch
{
LegalType.Real =>
await CreateRealEmployerRegistration(command.RealEmployer, command.ContractingPartyId),
LegalType.Legal => await CreateLegalEmployerRegistration(command.LegalEmployer,
command.ContractingPartyId),
_ => throw new ArgumentOutOfRangeException()
};
employer = createEmployerResult.Data;
if (!createEmployerResult.IsSuccedded)
return operation.Failed(createEmployerResult.Message);
if (!createEmployerResult.IsSuccedded)
return operation.Failed(createEmployerResult.Message);
}
var workshopDetails =
await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(command.InstitutionWorkshopInitialId);
await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(command
.InstitutionWorkshopInitialId);
if (workshopDetails.Employers.Any(x => x.EmployerId == employer.id))
{
throw new BadRequestException("این کارفرما قبلا در این کارگاه ثبت شده است");
}
workshopDetails.AddEmployer(employer.id);
await _institutionContractRepository.SaveChangesAsync();
@@ -1335,7 +1354,7 @@ public class EmployerApplication : IEmployerApplication
public async Task<OperationResult> EditWorkflowRegistration(EditEmployerWorkflowRegistration command)
{
var operation = new OperationResult();
// Get the existing employer
var employer = _EmployerRepository.Get(command.EmployerId);
if (employer == null)
@@ -1364,55 +1383,55 @@ public class EmployerApplication : IEmployerApplication
public async Task<OperationResult> DeleteWorkflowRegistration(long employerId, long institutionWorkshopDetailsId)
{
var operation = new OperationResult();
// Check if employer exists
var employer = _EmployerRepository.Get(employerId);
if (employer == null)
return operation.Failed("کارفرمای مورد نظر یافت نشد");
// Get workshop details
var workshopDetails = await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(institutionWorkshopDetailsId);
var workshopDetails =
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("کارفرما در لیست کارگاه یافت نشد");
// Remove the employer from the list
workshopDetails.Employers.Remove(employerDetail);
await _institutionContractRepository.SaveChangesAsync();
// Delete the employer
_EmployerRepository.Remove(employerId);
await _EmployerRepository.SaveChangesAsync();
return operation.Succcedded();
}
public async Task<OperationResult<AuthenticateUserViewModel>> AuthenticateEmployer(string nationalCode,
string dateOfBirth,
string mobile)
{
var op = new OperationResult<AuthenticateUserViewModel>();
var dateOfBirthGr = dateOfBirth.ToGeorgianDateTime();
var isMachMobilAndNationalCode = await _uidService.IsMachPhoneWithNationalCode(nationalCode, mobile);
if (isMachMobilAndNationalCode == null)
return op.Failed("خطا در سرویس احراز هویت");
if (!isMachMobilAndNationalCode.IsMatched)
return op.Failed("شماره همراه وارد شده با کد ملی مطابقت ندارد");
var apiRespons = await _uidService.GetPersonalInfo(nationalCode, dateOfBirth);
if (apiRespons == null)
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
if (apiRespons.ResponseContext.Status.Code ==14)
if (apiRespons.ResponseContext.Status.Code == 14)
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
if (apiRespons.ResponseContext.Status.Code != 0)
return op.Failed($"{apiRespons.ResponseContext.Status.Message}");
@@ -1420,6 +1439,7 @@ public class EmployerApplication : IEmployerApplication
? apiRespons.IdentificationInformation.NationalId
: apiRespons.IdentificationInformation.ShenasnamehNumber;
var res = new AuthenticateUserViewModel()
{
DateOfBirth = dateOfBirth,
@@ -1436,6 +1456,12 @@ public class EmployerApplication : IEmployerApplication
return op.Succcedded(res);
}
public Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId,
long institutionWorkshopDetailsId)
{
return _EmployerRepository.GetWorkflowRegistrationForEdit(employerId, institutionWorkshopDetailsId);
}
private async Task<OperationResult<Employer>> CreateLegalEmployerRegistration(
CreateLegalEmployerWorkflowRegistration command, long contractingPartyId)
{
@@ -1502,6 +1528,11 @@ public class EmployerApplication : IEmployerApplication
command.GovernmentSystemInfo.EServiceUsername, command.GovernmentSystemInfo.EServicePassword,
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword,
command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword);
if (command.IsAuth)
{
legalEmployerData.LegalAuthentication(command.CeoFName,command.CeoLName,command.CeoFatherName,
command.CeoIdNumber,command.IdNumberSeri,command.IdNumberSerial,command.CeoDateOfBirth,command.Gender,command.PhoneNumber);
}
await _EmployerRepository.CreateAsync(legalEmployerData);
await _EmployerRepository.SaveChangesAsync();
@@ -1555,6 +1586,12 @@ public class EmployerApplication : IEmployerApplication
command.GovernmentSystemInfo.EServicePassword,
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword,
command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword);
if (command.IsAuth)
{
employerData.Authentication(command.FName, command.LName, command.FatherName, command.IdNumber,
command.IdNumberSeri,
command.IdNumberSerial, command.DateOfBirth, command.Gender, command.PhoneNumber);
}
await _EmployerRepository.CreateAsync(employerData);
await _EmployerRepository.SaveChangesAsync();
@@ -1664,5 +1701,6 @@ public class EmployerApplication : IEmployerApplication
await _EmployerRepository.SaveChangesAsync();
return operation.Succcedded();
}
#endregion
}

View File

@@ -209,7 +209,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
command.ContractStartFa, contractEndGr, command.ContractEndFa, command.ContractAmount,
command.DailyCompenseation, command.Obligation,
command.TotalAmount, 0, command.WorkshopManualCount, command.EmployeeManualCount, command.Description,
command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax, command.ValueAddedTax, []);
command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax, command.ValueAddedTax, [],command.LawId);
_institutionContractRepository.Create(createContract);
_institutionContractRepository.SaveChanges();
@@ -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.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.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();
}
@@ -1259,6 +1282,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
{
var details = await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(workshopDetailsId);
var services = details.Services;
var newArchiveCode = _workshopRepository.GetLastArchiveCode() + 1;
var res = new InstitutionContractWorkshopDetailViewModel()
{
@@ -1271,7 +1295,9 @@ public class InstitutionContractApplication : IInstitutionContractApplication
InsuranceInPerson = services.InsuranceInPerson,
RollCall = services.RollCall,
RollCallInPerson = services.RollCallInPerson
}
},
WorkshopName = details.WorkshopName,
ArchiveCode = newArchiveCode
};
return res;
}
@@ -1287,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);
}
@@ -1301,6 +1329,43 @@ public class InstitutionContractApplication : IInstitutionContractApplication
{
return await _institutionContractRepository.ExtensionComplete(request);
}
public async Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search, string selected)
{
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);
}
public async Task<OperationResult> ResendVerifyLink(long institutionContractId)
{
var institutionContract = _institutionContractRepository.Get(institutionContractId);
if (institutionContract == null)
{
throw new NotFoundException("رکورد مورد نظر یافت نشد");
}
if (institutionContract.VerificationStatus != InstitutionContractVerificationStatus.PendingForVerify)
{
throw new BadRequestException("این قرارداد مالی در وضعیت مناسبی برای ارسال مجدد لینک تایید نمی باشد");
}
var contractingParty = _contractingPartyRepository.Get(institutionContract.ContractingPartyId);
if (contractingParty == null)
throw new NotFoundException("طرف قرارداد یافت نشد");
var contractingPartyFullName = contractingParty.FName + " " + contractingParty.LName;
await _smsService.SendInstitutionVerificationLink(contractingParty.Phone, contractingPartyFullName,
institutionContract.PublicId);
return new OperationResult().Succcedded();
}
private async Task<OperationResult<PersonalContractingParty>> CreateLegalContractingPartyEntity(
@@ -1342,8 +1407,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);
@@ -1388,7 +1453,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);
@@ -1505,4 +1570,4 @@ public class WorkshopsAndEmployeeViewModel
public int ArchiveCode { get; set; }
}
#endregion
#endregion

View File

@@ -20,9 +20,16 @@ public class LawApplication : ILawApplication
public OperationResult Create(CreateLaw command)
{
var operation = new OperationResult();
if (_lawRepository.Exists(x => x.Type == command.Type))
// قبل از ایجاد قانون جدید، همه قوانین قدیمی از این نوع را غیرفعال می‌کنیم
var existingLaws = _lawRepository.Get().Where(x => x.Type == command.Type).ToList();
if (existingLaws.Any())
{
return operation.Failed("این قانون قبلا ثبت شده است");
foreach (var existingLaw in existingLaws)
{
existingLaw.Deactivate();
}
_lawRepository.SaveChanges();
}
var law = new Law(command.Title, command.Type, command.Notifications, command.HeadTitle);
@@ -56,6 +63,8 @@ public class LawApplication : ILawApplication
{
return operation.Failed("باید حداقل یک بند برای قانون باید ثبت شود");
}
// Create new items list for the new version
var orderNumber = 1;
var lawItems = command.Items.Select(x =>
{
@@ -63,12 +72,17 @@ public class LawApplication : ILawApplication
orderNumber++;
return res;
}).ToList();
law.Edit(command.Title);
law.SetItem(lawItems);
// Mark the current version as old version
law.SetAsOldVersion();
// Create a new version based on the old one
var newVersion = law.CreateNewVersion(command.Title, command.Notifications, command.HeadTitle, lawItems);
// Save the new version
_lawRepository.Create(newVersion);
_lawRepository.SaveChanges();
return operation.Succcedded();
}
@@ -82,13 +96,13 @@ public class LawApplication : ILawApplication
return operation.Failed("باید حداقل یک بند برای قانون باید ثبت شود");
}
// Check if law exists by type
var existingLaw = _lawRepository.Get().FirstOrDefault(x => x.Type == command.Type);
// Check if active law exists by type
var existingLaw = _lawRepository.Get().FirstOrDefault(x => x.Type == command.Type && x.IsActive);
if (existingLaw == null)
{
// If law doesn't exist, create a new one
var law = new Law(command.Title, command.Type,command.Notifications, command.HeadTitle);
var law = new Law(command.Title, command.Type, command.Notifications, command.HeadTitle);
var orderNumber = 1;
foreach (var item in command.Items)
@@ -102,7 +116,10 @@ public class LawApplication : ILawApplication
}
else
{
// If law exists, update it
// Mark the current version as old version
existingLaw.SetAsOldVersion();
// Create new items list for the new version
var orderNumber = 1;
var lawItems = command.Items.Select(x =>
{
@@ -111,9 +128,11 @@ public class LawApplication : ILawApplication
return res;
}).ToList();
existingLaw.Edit(command.Title);
existingLaw.SetItem(lawItems);
// Create a new version based on the old one
var newVersion = existingLaw.CreateNewVersion(command.Title, command.Notifications, command.HeadTitle, lawItems);
// Save the new version
_lawRepository.Create(newVersion);
_lawRepository.SaveChanges();
}
@@ -128,8 +147,17 @@ public class LawApplication : ILawApplication
if (law == null)
return operation.Failed(ApplicationMessages.RecordNotFound);
// غیرفعال کردن همه نسخه‌های قبلی از این نوع قانون
var otherLaws = _lawRepository.Get().Where(x => x.Type == law.Type && x.id != law.id).ToList();
foreach (var otherLaw in otherLaws)
{
otherLaw.Deactivate();
}
// فعال کردن این نسخه به عنوان آخرین نسخه
law.Activate();
_lawRepository.SaveChanges();
return operation.Succcedded();
}
@@ -149,9 +177,11 @@ public class LawApplication : ILawApplication
public OperationResult ActivateByType(LawType type)
{
var operation = new OperationResult();
var law = _lawRepository.Get().FirstOrDefault(x => x.Type == type);
if (law == null)
// غیرفعال کردن همه نسخه‌های قبلی از این نوع قانون
var existingLaws = _lawRepository.Get().Where(x => x.Type == type).ToList();
if (!existingLaws.Any())
{
// If law doesn't exist, create a new active one with default values
var newLaw = new Law(GetDefaultTitleForLawType(type), type, new List<string>(), "");
@@ -160,21 +190,36 @@ public class LawApplication : ILawApplication
_lawRepository.SaveChanges();
return operation.Succcedded();
}
law.Activate();
// فعال کردن آخرین نسخه (با بالاترین شماره نسخه)
var latestVersion = existingLaws.OrderByDescending(x => x.Version).First();
// غیرفعال کردن سایر نسخه‌ها
foreach (var law in existingLaws.Where(x => x.id != latestVersion.id))
{
law.Deactivate();
}
// فعال کردن آخرین نسخه
latestVersion.Activate();
_lawRepository.SaveChanges();
return operation.Succcedded();
}
public OperationResult DeactivateByType(LawType type)
{
var operation = new OperationResult();
var law = _lawRepository.Get().FirstOrDefault(x => x.Type == type);
var laws = _lawRepository.Get().Where(x => x.Type == type).ToList();
if (law == null)
if (!laws.Any())
return operation.Failed("قانون مورد نظر یافت نشد");
law.Deactivate();
foreach (var law in laws)
{
law.Deactivate();
}
_lawRepository.SaveChanges();
return operation.Succcedded();
}
@@ -187,6 +232,8 @@ public class LawApplication : ILawApplication
Id = law.id,
Title = law.Title,
Type = law.Type,
HeadTitle = law.HeadTitle,
Notifications = law.Notifications,
Items = law.Items.OrderBy(x => x.OrderNumber).Select(x => new LawItemViewModel
{
Header = x.Header,
@@ -197,10 +244,8 @@ public class LawApplication : ILawApplication
public async Task<List<LawViewModel>> GetList(LawSearchModel searchModel)
{
// Get filtered laws from database
// Get all laws from database, including version information
return await _lawRepository.GetList(searchModel);
}
private string GetDefaultTitleForLawType(LawType lawType)
@@ -225,6 +270,9 @@ public class LawApplication : ILawApplication
IsActive = law.IsActive,
CreatedAt = law.CreationDate,
Type = law.Type,
HeadTitle = law.HeadTitle,
Notifications = law.Notifications,
Version = law.Version,
Items = law.Items.OrderBy(x=>x.OrderNumber).Select(x => new LawItemViewModel
{
Header = x.Header,
@@ -235,6 +283,7 @@ public class LawApplication : ILawApplication
public async Task<LawViewModel> GetLawByType(LawType type)
{
// Only get the active (latest) version of the law
var lawViewModel = await _lawRepository.GetByType(type);
// If no law exists for this type, return a default empty law
@@ -247,6 +296,7 @@ public class LawApplication : ILawApplication
IsActive = false,
CreatedAt = DateTime.Now,
Type = type,
Version = 1,
Items = new List<LawItemViewModel>()
};
}

View File

@@ -1048,7 +1048,7 @@ public class WorkshopAppliction : IWorkshopApplication
var institutionContract =
await _institutionContractRepository.GetIncludeWorkshopDetailsAsync(contractWorkshopInitial
.InstitutionContractId);
.WorkshopGroup.InstitutionContractId);
if (institutionContract == null)
{
return operation.Failed("قرارداد مالی موسسه یافت نشد");

View File

@@ -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)
{

View File

@@ -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);
});
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class AddLawIdtoinstitutionContract : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "Version",
table: "Law",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<long>(
name: "LawId",
table: "InstitutionContracts",
type: "bigint",
nullable: false,
defaultValue: 0L);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Version",
table: "Law");
migrationBuilder.DropColumn(
name: "LawId",
table: "InstitutionContracts");
}
}
}

View File

@@ -0,0 +1,49 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class addauthenticatecolumnstoemployer : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "IdNumberSeri",
table: "Employers",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "IdNumberSerial",
table: "Employers",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsAuth",
table: "Employers",
type: "bit",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IdNumberSeri",
table: "Employers");
migrationBuilder.DropColumn(
name: "IdNumberSerial",
table: "Employers");
migrationBuilder.DropColumn(
name: "IsAuth",
table: "Employers");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -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");
}
}
}

View File

@@ -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")
@@ -3130,6 +3162,9 @@ namespace CompanyManagment.EFCore.Migrations
b.Property<bool>("IsInstallment")
.HasColumnType("bit");
b.Property<long>("LawId")
.HasColumnType("bigint");
b.Property<double>("Obligation")
.HasColumnType("float");
@@ -3206,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");
@@ -4073,6 +4111,9 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<int>("Version")
.HasColumnType("int");
b.HasKey("id");
b.ToTable("Law", (string)null);
@@ -6773,9 +6814,18 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(20)
.HasColumnType("nvarchar(20)");
b.Property<string>("IdNumberSeri")
.HasColumnType("nvarchar(max)");
b.Property<string>("IdNumberSerial")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsActive")
.HasColumnType("bit");
b.Property<bool>("IsAuth")
.HasColumnType("bit");
b.Property<string>("IsLegal")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
@@ -6855,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")

View File

@@ -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();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -10,6 +10,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AccountManagement.Application.Contracts.SubAccount;
using ZstdSharp.Unsafe;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
namespace CompanyManagment.EFCore.Repository;
@@ -266,16 +267,26 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
public async Task<FinancialStatmentDetailsByContractingPartyViewModel> GetDetailsByContractingParty(long contractingPartyId,FinancialStatementSearchModel searchModel)
{
var contractingParty = await _context.PersonalContractingParties
.FirstOrDefaultAsync(x=>x.id == contractingPartyId);
if (contractingParty == null)
throw new NotFoundException("طرف حساب یافت نشد");
var financialStatement = await _context.FinancialStatments
.Include(x=>x.FinancialTransactionList)
.FirstOrDefaultAsync(x=>x.ContractingPartyId == contractingPartyId);
if (financialStatement == null)
{
throw new NotFoundException("وضعیت مالی مورد نظر یافت نشد");
financialStatement = new FinancialStatment(contractingPartyId,contractingParty.FName+" "+contractingParty.LName);
await _context.AddAsync(financialStatement);
await _context.SaveChangesAsync();
}
bool searched = false;
#region Search
@@ -323,6 +334,71 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
}
#endregion
double balance = 0;
// var list = financialStatement.FinancialTransactionList.Select(t =>
// {
// if (!searched)
// {
// if (t.TypeOfTransaction == "debt")
// {
// balance += t.Deptor;
// }
// else
// {
// balance -= t.Creditor;
// }
// }
// return new FinancialTransactionDetailViewModel()
// {
// Id = t.id,
// DateTimeGr = t.TdateGr,
// DateFa = t.TdateGr.ToFarsi(),
// TimeFa = $"{t.TdateGr:HH:mm}",
// Description = t.DescriptionOption + " " + t.Description,
// Debtor = t.Deptor,
// Creditor = t.Creditor,
// Balance = balance,
// Type = t.TypeOfTransaction == "debt"
// ? FinancialTransactionType.Debt
// : FinancialTransactionType.Credit,
// TypeStr = t.TypeOfTransaction == "debt" ? "ایجاد درآمد" : "دریافت درآمد"
// };
// }).OrderByDescending(t => t.DateTimeGr).ToList();
var list = new List<FinancialTransactionDetailViewModel>();
foreach (var financialTransaction in financialStatement.FinancialTransactionList.OrderBy(t=>t.TdateGr))
{
if (!searched)
{
if (financialTransaction.TypeOfTransaction == "debt")
{
balance += financialTransaction.Deptor;
}
else
{
balance -= financialTransaction.Creditor;
}
}
var item = new FinancialTransactionDetailViewModel()
{
Id = financialTransaction.id,
DateTimeGr = financialTransaction.TdateGr,
DateFa = financialTransaction.TdateGr.ToFarsi(),
TimeFa = $"{financialTransaction.TdateGr:HH:mm}",
Description = financialTransaction.DescriptionOption + " " + financialTransaction.Description,
Debtor = financialTransaction.Deptor,
Creditor = financialTransaction.Creditor,
Balance = balance,
Type = financialTransaction.TypeOfTransaction == "debt"
? FinancialTransactionType.Debt
: FinancialTransactionType.Credit,
TypeStr = financialTransaction.TypeOfTransaction == "debt" ? "ایجاد درآمد" : "دریافت درآمد"
};
list.Add(item);
}
list.Reverse();
var res = new FinancialStatmentDetailsByContractingPartyViewModel()
{
Id = financialStatement.id,
@@ -330,35 +406,7 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
TotalCredit = financialStatement.FinancialTransactionList.Sum(x => x.Creditor),
TotalDebt = financialStatement.FinancialTransactionList.Sum(x => x.Deptor),
ContractingPartyName = financialStatement.ContractingPartyName,
List = financialStatement.FinancialTransactionList.Select(t =>
{
if (!searched)
{
if (t.TypeOfTransaction == "debt")
{
balance += t.Deptor;
}
else
{
balance -= t.Creditor;
}
}
return new FinancialTransactionDetailViewModel()
{
Id = t.id,
DateTimeGr = t.TdateGr,
DateFa = t.TdateGr.ToFarsi(),
TimeFa = $"{t.TdateGr:HH:mm}",
Description = t.DescriptionOption + " " + t.Description,
Debtor = t.Deptor,
Creditor = t.Creditor,
Balance = balance,
Type = t.TypeOfTransaction == "debt"
? FinancialTransactionType.Debt
: FinancialTransactionType.Credit,
TypeStr = t.TypeOfTransaction == "debt" ? "ایجاد درآمد" : "دریافت درآمد"
};
}).OrderByDescending(t => t.DateTimeGr).ToList(),
List = list,
};
return res;
}

View File

@@ -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;
@@ -1083,6 +1083,11 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
joinedQuery = joinedQuery.Where(x =>
x.contractingParty.RepresentativeFullName.Contains(keyword) ||
(x.contractingParty.FName + " " + x.contractingParty.LName).Contains(keyword) ||
(x.contractingParty.IsLegal == "حقیقی" ? x.contractingParty.SureName == null
? x.contractingParty.FName + " " + x.contractingParty.LName
: x.contractingParty.FName + " " + x.contractingParty.LName + " " + x.contractingParty.SureName
: x.contractingParty.SureName == null ? x.contractingParty.LName
: x.contractingParty.LName + " " + x.contractingParty.SureName).Contains(keyword)||
x.contractingParty.Employers.Any(e =>
e.FullName.Contains(keyword) ||
e.WorkshopEmployers.Any(we =>
@@ -1471,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
@@ -1815,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
@@ -2030,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,
@@ -2041,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);
@@ -2227,7 +2239,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
extensionNo, workshopsCount, employeeCount,
previousInstitutionContract.Description,
"NotOfficial", "JobRelation", hasValueAddedTax,
payment.Tax.MoneyToDouble(),[]);
payment.Tax.MoneyToDouble(),[],
request.LawId);
await CreateAsync(entity);
await SaveChangesAsync();
@@ -2269,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(),
@@ -2325,6 +2338,109 @@ 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)
{
var contractingParties = _context.PersonalContractingParties.Select(x => new InstitutionContractSelectListViewModel()
{
Id = x.id,
Text = x.IsLegal == "حقیقی" ? x.SureName == null
? x.FName + " " + x.LName
: x.FName + " " + x.LName + " " + x.SureName
: x.SureName == null ? x.LName
: x.LName + " " + x.SureName
});
var workshops = _context.Workshops.Select(x => new InstitutionContractSelectListViewModel()
{
Id = x.id,
Text = x.WorkshopFullName
});
var employers = _context.Employers.Select(x => new InstitutionContractSelectListViewModel()
{
Id = x.id,
Text = x.FName + " " + x.LName
});
var representatives = _context.RepresentativeSet.Select(x => new InstitutionContractSelectListViewModel()
{
Id = x.id,
Text = x.FName + " " + x.LName
});
var res = contractingParties
.Union(workshops)
.Union(employers)
.Union(representatives);
InstitutionContractSelectListViewModel idSelected = null;
if (!string.IsNullOrWhiteSpace(selected))
{
idSelected = await res.FirstOrDefaultAsync(x => x.Text == selected);
}
if (!string.IsNullOrWhiteSpace(search))
{
res = res.Where(x => x.Text.Contains(search));
}
var list = await res.Take(100).ToListAsync();
if (idSelected != null)
list.Add(idSelected);
return list.DistinctBy(x => x.Id).ToList();
}
private InstitutionContractExtensionPaymentResponse CalculateInPersonPayment(
InstitutionContractExtensionPlanDetail selectedPlan, double baseAmount, double tenPercent,

File diff suppressed because it is too large Load Diff

View File

@@ -49,7 +49,8 @@ public class LawRepository:RepositoryBase<long,Law>,ILawRepository
public async Task<List<LawViewModel>> GetList(LawSearchModel searchModel)
{
var query = _context.Laws.Include(x => x.Items).AsQueryable();
var query = _context.Laws.Include(x => x.Items)
.Where(x=>x.IsActive).AsQueryable();
if (!string.IsNullOrWhiteSpace(searchModel.Title))
query = query.Where(x => x.Title.Contains(searchModel.Title));

View File

@@ -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)),

View File

@@ -1181,6 +1181,33 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
return list.DistinctBy(x => x.Id).ToList();
}
public int GetLastArchiveCode()
{
var archiveCodes = _context.Workshops
.Where(x => !string.IsNullOrEmpty(x.ArchiveCode))
.Select(x => x.ArchiveCode)
.ToList();
int maxArchiveCode = 0;
foreach (var code in archiveCodes)
{
// Remove "b-" prefix if exists
string cleanCode = code.StartsWith("b-") ? code.Substring(2) : code;
// Try to parse the clean code to an integer
if (int.TryParse(cleanCode, out int codeValue))
{
if (codeValue > maxArchiveCode)
{
maxArchiveCode = codeValue;
}
}
}
return maxArchiveCode;
}
#endregion
#region NewByHeydari
//public List<WorkshopViewModel> GetWorkshopByWorkshopIds(List<long> workshopIds)

View File

@@ -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;
}
}

View File

@@ -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

View File

@@ -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);
}
}

View File

@@ -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]
@@ -58,8 +61,9 @@ public class DashboardController : AdminBaseController
var taskCount = await _taskApplication.RequestedAndOverdueTasksCount(UserId);
var ticketCount = _ticketApplication.GetAdminTicketsCount();
return new AdminDashboardViewModel(calenderList, taskCount, ticketCount);
return new AdminDashboardViewModel(calenderList, taskCount, ticketCount,todayPersian.Year,todayPersian.MonthOfYear,todayPersian.Day,todayPersian.DayOfWeek);
}
[HttpGet("sms-remaining")]
@@ -72,4 +76,4 @@ public class DashboardController : AdminBaseController
public record SmsRemainingResult(int Data);
public record AdminDashboardViewModel(List<CalenderViewModel> Calender, int TaskCount, int TicketCount);
public record AdminDashboardViewModel(List<CalenderViewModel> Calender, int TaskCount, int TicketCount,int Year,string Month,int Day,string DayOfWeek);

View File

@@ -1,4 +1,5 @@
using _0_Framework.Application;
using _0_Framework.Application.Enums;
using CompanyManagment.App.Contracts.Employer;
using Microsoft.AspNetCore.Mvc;
using ServiceHost.BaseControllers;
@@ -115,9 +116,9 @@ public class EmployerController : AdminBaseController
/// </summary>
/// <returns></returns>
[HttpGet("select_list")]
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id)
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id,LegalType? legalType=null)
{
return await _employerApplication.GetSelectList(search, id);
return await _employerApplication.GetSelectList(search, id,legalType);
}
}

View File

@@ -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);
}
}

View File

@@ -78,6 +78,13 @@ namespace ServiceHost.Areas.Admin.Controllers
var result = await _employerApplication.EditWorkflowRegistration(command);
return result;
}
[HttpGet("edit-employer/{employerId}/{institutionWorkshopDetailsId}")]
public async Task<ActionResult<EditEmployerWorkflowRegistration>> GetEmployerForEdit(long employerId, long institutionWorkshopDetailsId)
{
var result = await _employerApplication.GetWorkflowRegistrationForEdit(employerId, institutionWorkshopDetailsId);
return result;
}
/// <summary>
/// حذف کارفرما از گردش کار ثبت نام

View File

@@ -67,6 +67,14 @@ public class institutionContractController : AdminBaseController
{
return await _institutionContractApplication.GetList(searchModel);
}
[HttpGet("select-list")]
public async Task<ActionResult<List<InstitutionContractSelectListViewModel>>> GetContractingPartySelectList(string search,string selected)
{
var result = await _institutionContractApplication
.GetInstitutionContractSelectList(search,selected);
return result;
}
/// <summary>
/// وضعیت تب ها
@@ -512,6 +520,20 @@ 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;
}
[HttpPost("resend-verify-link/{institutionContractId}")]
public async Task<OperationResult> ResendVerifyLink(long institutionContractId)
{
var res = await _institutionContractApplication.ResendVerifyLink(institutionContractId);
return res;
}
}

View File

@@ -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"> &nbsp;<span style="bottom: 2px;position: relative"> قرارداد های مالی </span> </label>
</div>
</div>
@* بررسی مدارک پرسنل *@
<div class="parent-check">

View File

@@ -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"> &nbsp;<span style="bottom: 2px;position: relative"> قرارداد های مالی </span> </label>
</div>
</div>
@* بررسی مدارک پرسنل *@
<div class="parent-check">

View File

@@ -69,7 +69,7 @@
<ul>
<li>
<a asp-page="/Index" class="waves-effect btnDashboard">
<a href="https://admin@(AppSetting.Value.Domain)/dashboard" class="waves-effect btnDashboard">
<div class="menuTitle">
<i class="md md-home"></i>
<span> پیشخان </span>
@@ -473,6 +473,14 @@
</div>
</a>
</li>
<li permission="2">
<a href="https://admin@(AppSetting.Value.Domain)/law" class="waves-effect btnWorkFlow">
<div class="menuTitle">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"><path stroke-linejoin="round" d="M4 12.996v1.544c0 3.247 0 4.87.886 5.97q.27.334.603.603C6.59 22 8.211 22 11.456 22c.705 0 1.058 0 1.381-.114q.1-.036.197-.082c.31-.148.559-.397 1.058-.896l4.736-4.74c.579-.578.867-.867 1.02-1.235c.152-.367.152-.776.152-1.594V9.994c0-3.773 0-5.66-1.172-6.832c-.93-.932-2.314-1.123-4.736-1.162M13 21.5V21c0-2.83 0-4.245.879-5.124c.878-.88 2.293-.88 5.121-.88h.5"></path><path d="M8 9.773c1.767 0 3.2-1.466 3.2-3.273S9.767 3.227 8 3.227m0 6.546c-1.767 0-3.2-1.466-3.2-3.273S6.233 3.227 8 3.227m0 6.546V11m0-7.773V2M5.091 4.715l-1.09-.67M12 8.955l-1.09-.67m-.001-3.57l1.09-.67M4 8.955l1.09-.67"></path></g></svg>
<span> ویرایش قوانین و مقررات </span>
</div>
</a>
</li>
<li class="has_sub" permission="307">
<a class="waves-effect MainMenuItem">

View File

@@ -694,7 +694,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
await _context.SaveChangesAsync();
//TODO: set data for institution price
var workshops = item.contractingParty.Employers
.SelectMany(e => e.WorkshopEmployers.Select(we => we.Workshop)).ToList();
.SelectMany(e => e.WorkshopEmployers.Select(we => we.Workshop)).ToList()
.DistinctBy(x=>x.id).ToList();
var initialWorkshop = workshops
.Select(w =>
@@ -760,7 +761,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
foreach (var item in inPersonContracts)
{
var workshops = item.contractingParty.Employers
.SelectMany(e => e.WorkshopEmployers.Select(we => we.Workshop)).ToList();
.SelectMany(e => e.WorkshopEmployers.Select(we => we.Workshop)).ToList()
.DistinctBy(x=>x.id).ToList();
var initialWorkshop = workshops
.Select(w =>

View File

@@ -195,7 +195,7 @@
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
<div class="w-100 my-1">
<div class="absenceHeadColorTop" style="border-radius: 10px 10px 0 0;">غیبت</div>
<div class="absenceHeadColorTop" style="border-radius: 10px 10px 0 0;">عدم حضور</div>
<div class="Rtable-row Rtable-row--head align-items-center d-flex table-rollcall-absent absenceHeadColor">
<div class="Rtable-cell column-heading width1">ردیف</div>
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
@@ -328,7 +328,7 @@
<div class="btnsRollCallOnlline">
<button class="btnRollCallStatus active" onclick="loadRollCallStatus('all')">آنلاین</button>
<button class="btnRollCallStatus" onclick="loadRollCallStatus('leave')">مرخصی <span id="leaveCount"></span></button>
<button class="btnRollCallStatus" onclick="loadRollCallStatus('absent')">غیبت <span id="absentCount"></span></button>
<button class="btnRollCallStatus" onclick="loadRollCallStatus('absent')">عدم حضور <span id="absentCount"></span></button>
</div>
</div>
<div class="wrapper">

View File

@@ -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">

View File

@@ -126,7 +126,7 @@
<div id="sidebar-menu">
<ul>
<li>
<a asp-area="Admin" asp-page="/Index" class="waves-effect btnDashboard">
<a href="https://admin@(AppSetting.Value.Domain)/dashboard" class="waves-effect btnDashboard">
<div class="menuTitle">
<i class="md md-home"></i>
<span> پیشخان </span>
@@ -621,6 +621,14 @@
</div>
</a>
</li>
<li permission="2">
<a href="https://admin@(AppSetting.Value.Domain)/law" class="waves-effect btnWorkFlow">
<div class="menuTitle">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"><path stroke-linejoin="round" d="M4 12.996v1.544c0 3.247 0 4.87.886 5.97q.27.334.603.603C6.59 22 8.211 22 11.456 22c.705 0 1.058 0 1.381-.114q.1-.036.197-.082c.31-.148.559-.397 1.058-.896l4.736-4.74c.579-.578.867-.867 1.02-1.235c.152-.367.152-.776.152-1.594V9.994c0-3.773 0-5.66-1.172-6.832c-.93-.932-2.314-1.123-4.736-1.162M13 21.5V21c0-2.83 0-4.245.879-5.124c.878-.88 2.293-.88 5.121-.88h.5"></path><path d="M8 9.773c1.767 0 3.2-1.466 3.2-3.273S9.767 3.227 8 3.227m0 6.546c-1.767 0-3.2-1.466-3.2-3.273S6.233 3.227 8 3.227m0 6.546V11m0-7.773V2M5.091 4.715l-1.09-.67M12 8.955l-1.09-.67m-.001-3.57l1.09-.67M4 8.955l1.09-.67"></path></g></svg>
<span> ویرایش قوانین و مقررات </span>
</div>
</a>
</li>
<li class="has_sub" permission="307">
<a class="waves-effect MainMenuItem">
@@ -633,7 +641,7 @@
</span>
</a>
<ul class="list-unstyled sdf10">
<li permission="307"><a class="clik10" asp-area="Admin" asp-page="/Company/InstitutionContracts/Index">
<li permission="307"><a class="clik10" href="https://admin@(AppSetting.Value.Domain)/institution-contract">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
</svg>

View File

@@ -231,7 +231,7 @@
<div class="day-off-parent">
<div class="day-off-title mb-2">
روزهای تعطیل هفته
روزهای فعالیت مجموعه
</div>
<div class="day-off-button-container mb-3">

View File

@@ -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()
};

View File

@@ -234,7 +234,7 @@
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
<div class="w-100 my-1">
<div class="absenceHeadColorTop" style="border-radius: 10px 10px 0 0;">غیبت</div>
<div class="absenceHeadColorTop" style="border-radius: 10px 10px 0 0;">عدم حضور</div>
<div class="Rtable-row Rtable-row--head align-items-center d-flex table-rollcall-absent absenceHeadColor">
<div class="Rtable-cell column-heading width1">ردیف</div>
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
@@ -367,7 +367,7 @@
<div class="btnsRollCallOnlline">
<button class="btnRollCallStatus active" onclick="loadRollCallStatus('all')">آنلاین</button>
<button class="btnRollCallStatus" onclick="loadRollCallStatus('leave')">مرخصی <span id="leaveCount"></span></button>
<button class="btnRollCallStatus" onclick="loadRollCallStatus('absent')">غیبت <span id="absentCount"></span></button>
<button class="btnRollCallStatus" onclick="loadRollCallStatus('absent')">عدم حضور <span id="absentCount"></span></button>
</div>
</div>
<div class="wrapper">

View File

@@ -223,7 +223,7 @@
<div class="day-off-parent">
<div class="day-off-title mb-2">
روزهای تعطیل هفته
روزهای فعالیت مجموعه
</div>
<div class="day-off-button-container mb-3">

View File

@@ -383,7 +383,7 @@
<div class="day-off-parent">
<div class="day-off-title mb-2">
روزهای تعطیل هفته
روزهای فعالیت مجموعه
</div>
<div class="day-off-button-container mb-3">

View File

@@ -393,7 +393,7 @@
<div class="day-off-parent">
<div class="day-off-title mb-2">
روزهای تعطیل هفته
روزهای فعالیت مجموعه
</div>
<div class="day-off-button-container mb-3">

View File

@@ -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

View File

@@ -90,7 +90,7 @@
<div class="day-off-parent">
<div class="day-off-title mb-2">
روزهای تعطیل هفته
روزهای فعالیت مجموعه
</div>
<div class="day-off-button-container mb-3">

View File

@@ -154,7 +154,7 @@
<div class="day-off-parent">
<div class="day-off-title mb-2">
روزهای تعطیل هفته
روزهای فعالیت مجموعه
</div>
<div class="day-off-button-container mb-3">

View File

@@ -218,7 +218,7 @@
<div class="day-off-parent mb-4">
<div class="day-off-title mb-2">
روزهای تعطیل هفته
روزهای فعالیت مجموعه
</div>
<div class="day-off-button-container mb-3">

View File

@@ -168,7 +168,7 @@
<div class="day-off-parent">
<div class="day-off-title mb-2">
روزهای تعطیل هفته
روزهای فعالیت مجموعه
</div>
<div class="day-off-button-container mb-3">

View File

@@ -71,7 +71,7 @@
<li class="active" data-menu="absent">
<div class="d-flex align-items-center justify-content-between" id="clickAbsentTab">
<a href="javascript:void(0);">غیبت</a>
<a href="javascript:void(0);">عدم حضور</a>
<div>
<div id="CountAbsentLoading" class="spinner-grow text-danger" role="status" style="align-items: center;justify-content: center;display: flex;margin: 0 0 0 9px;">
<span class="visually-hidden">Loading...</span>
@@ -218,7 +218,7 @@
<div class="Rtable-row SubAccountRowMobile align-items-center position-relative openAction">
<div class="Rtable-cell d-md-block d-flex width2">
<div class="Rtable-cell--content text-start">
<div class="roleName">غیبت</div>
<div class="roleName">عدم حضور</div>
</div>
</div>
<div>

View File

@@ -7,6 +7,7 @@
</handlers>
<aspNetCore processPath="dotnet" arguments=".\ServiceHost.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="200000000" />

View File

@@ -823,7 +823,7 @@ function generateButtons(item, pathDSKKAR00, pathDSKWOR00) {
}
//if (item.inspectionDone && item.debtDone && item.employerApproved && item.confirmSentlist) {
if (item.inspectionDone || item.debtDone || item.employerApproved || item.confirmSentlist) {
// if (item.inspectionDone || item.debtDone || item.employerApproved || item.confirmSentlist) {
// Confirm List and Print Button
if (hasPermission_80215) {
html += `
@@ -839,7 +839,7 @@ function generateButtons(item, pathDSKKAR00, pathDSKWOR00) {
<span class="tw-flex md:tw-hidden tw-text-sm tw-text-white">پرینت</span>
</a>`;
}
}
// }
if (item.inspectionDone || item.debtDone || item.employerApproved || item.confirmSentlist) {
// Summary List and Print Button

View File

@@ -420,7 +420,7 @@ input:checked + .sliderEUP:before {
background-color: #ffffff;
background: rgba(209, 50, 50, 0.15);
transition: ease .2s;
width: 55px;
/*width: 55px;*/
}
.btn-workflow-rollcall-edit {

View File

@@ -292,7 +292,7 @@ function loadEmployeeListByWorkFlowsAbsents(date) {
</button>
<button type="button" class="btn-workflow-absent" onclick="confirmAbsentAlert(${rollCallItem.employeeId}, '${data.dateTimeFa}')">
<span class="mx-1">غیبت</span>
<span class="mx-1 text-nowrap">عدم حضور</span>
</button>
<button class="btn-workflow-rollcall-edit position-relative" onclick="showModalEditRollCall(${rollCallItem.employeeId}, '${data.dateTimeFa}')">
@@ -1028,7 +1028,7 @@ function showModalEditLeave(leaveId) {
function confirmAbsentAlert(employeeId, dateFa) {
swal({
title: "آیا از تایید این غیبت اطمینان دارید؟",
title: "آیا از تایید این عدم حضور اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,