Compare commits
144 Commits
Feature/Le
...
Feature/ac
| Author | SHA1 | Date | |
|---|---|---|---|
| bd72dada76 | |||
| e79dabbb2d | |||
| f527c59603 | |||
| 112369c2a5 | |||
| 518719a6b8 | |||
| 53eab1be67 | |||
|
|
21aa17d856 | ||
| b8d6911756 | |||
| 2e8f098937 | |||
| c9cae74cd4 | |||
|
|
abe8774d6f | ||
|
|
eab0441f00 | ||
| 13250d9f62 | |||
| e77eb217f7 | |||
| 39200da4b5 | |||
| 49050a8990 | |||
| 9474f3ff1a | |||
| ad4cffffcd | |||
|
|
18e559f1ae | ||
|
|
e1dfd8c8e1 | ||
|
|
b1c9b2669d | ||
|
|
116f40d87d | ||
|
|
6a982a80f7 | ||
|
|
604ac76a1a | ||
|
|
5a1d2640c3 | ||
|
|
de0e21f98b | ||
|
|
80ed1e9469 | ||
|
|
0609c66e0a | ||
|
|
add5b8ef8e | ||
|
|
c5091c53a4 | ||
|
|
3f1664a844 | ||
|
|
fdc5ea950f | ||
|
|
39d62eb02d | ||
|
|
a42ef19470 | ||
|
|
7ae7d8fc07 | ||
|
|
2bc7766ba1 | ||
|
|
d780f24b36 | ||
|
|
d7b49f8fc3 | ||
|
|
14480eb683 | ||
|
|
882a295413 | ||
|
|
785e364efc | ||
|
|
bd83ed3880 | ||
|
|
fae3c7cbd3 | ||
|
|
052b94a66e | ||
|
|
369757aebe | ||
|
|
38d8e88fd6 | ||
|
|
bcedb0d690 | ||
|
|
3662502db1 | ||
|
|
0701b334e4 | ||
|
|
631bf3a920 | ||
|
|
874bce1113 | ||
|
|
1f897fa0c9 | ||
|
|
5f7c27e45c | ||
|
|
824a80d1fe | ||
|
|
9e2ec49247 | ||
|
|
f5137d0bab | ||
|
|
881bdfa7ae | ||
|
|
e063870b36 | ||
|
|
fe8335af55 | ||
|
|
5c3119d3d2 | ||
|
|
0c56240158 | ||
|
|
2e703c49f7 | ||
|
|
e9dbfb411a | ||
|
|
40a02dbede | ||
|
|
030ce880f8 | ||
|
|
2b8cc9d05a | ||
|
|
0136e219a1 | ||
|
|
60ed37b965 | ||
|
|
5355e74830 | ||
|
|
87609773e5 | ||
|
|
6112e969b6 | ||
|
|
3e4c57d813 | ||
|
|
efc510a09b | ||
|
|
a6c1ae7971 | ||
|
|
8bf707056e | ||
|
|
ee72c95d55 | ||
|
|
f4f8ab8272 | ||
|
|
1c6def5d70 | ||
|
|
87e0181a8d | ||
|
|
66d566847e | ||
|
|
dbfffafbee | ||
|
|
969a707000 | ||
|
|
57b625f3b2 | ||
|
|
62572a9b64 | ||
|
|
6d0b7de149 | ||
|
|
34d8e068df | ||
|
|
3a1dfa7e11 | ||
|
|
866725e3b4 | ||
|
|
7772bff9f4 | ||
|
|
033461641a | ||
|
|
83a251ad3b | ||
|
|
cdf282a17a | ||
|
|
4bc3fd2fbc | ||
|
|
c826c3614d | ||
|
|
b8ea59b814 | ||
|
|
f82d0d5925 | ||
|
|
701ebaeb96 | ||
|
|
a1d57b291c | ||
|
|
e7d43316ad | ||
|
|
bdc5ccae13 | ||
|
|
d37ad552df | ||
|
|
9c04fd439d | ||
|
|
2b3067dab2 | ||
|
|
86682a28e2 | ||
|
|
5720c30f7a | ||
|
|
c90a68a8cc | ||
|
|
a71205aa2b | ||
|
|
641dcc1767 | ||
|
|
b1a15bfa54 | ||
|
|
d4f9c810ea | ||
|
|
09574150b6 | ||
|
|
7ccf600885 | ||
|
|
170a0ddba0 | ||
|
|
33a736ab5d | ||
|
|
e34fef37d7 | ||
|
|
23723e4b7a | ||
|
|
859f8ea8ca | ||
|
|
3744b5f470 | ||
|
|
db78fb1cd4 | ||
|
|
8bde7aa3d1 | ||
|
|
76e5a93ee5 | ||
|
|
469a8808d1 | ||
|
|
d3157780ea | ||
|
|
2d2dc24280 | ||
|
|
362b306c48 | ||
|
|
b0c02d47c4 | ||
|
|
6869ccb436 | ||
|
|
605fe16ced | ||
|
|
dfb78db2fa | ||
|
|
f0daa0b283 | ||
|
|
82f68d1bbe | ||
|
|
48c2186110 | ||
|
|
72fe632516 | ||
|
|
2a315ff7ae | ||
|
|
204355acd6 | ||
|
|
e1ac481dc3 | ||
|
|
8fd3930393 | ||
|
|
b2694ca281 | ||
|
|
7cb3551dc8 | ||
|
|
c048e89da8 | ||
|
|
5902472b86 | ||
|
|
9aa8855a46 | ||
|
|
9556be42ea | ||
|
|
3ebaeb645c |
2
.github/workflows/dotnet-developPublish.yml
vendored
2
.github/workflows/dotnet-developPublish.yml
vendored
@@ -37,7 +37,7 @@ jobs:
|
||||
& "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" `
|
||||
-verb:sync `
|
||||
-source:contentPath="$publishFolder" `
|
||||
-dest:contentPath="dadmehrg",computerName="https://171.22.24.15:8172/msdeploy.axd?site=dadmehrg",userName=".\deployuser",password="R2rNpdnetP3j>q5b18",authType="Basic" `
|
||||
-dest:contentPath="dadmehrg",computerName="https://171.22.24.15:8172/msdeploy.axd?site=dadmehrg",userName="Administrator",password="R2rNpdnetP3j>q5b18",authType="Basic" `
|
||||
-allowUntrusted `
|
||||
-enableRule:AppOffline
|
||||
|
||||
|
||||
@@ -21,4 +21,19 @@
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Application\UID\UidService.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Application\AuthorizedPerson\AuthorizedPersonApplication.cs" />
|
||||
<Compile Remove="Application\AuthorizedPerson\IAuthorizedPersonApplication.cs" />
|
||||
<Compile Remove="Domain\AuthorizedPersonAgg\IAuthorizedPersonRepository.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Domain\AuthorizedPersonAgg\" />
|
||||
<Folder Include="InfraStructure\AuthorizedPerson\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -477,42 +477,26 @@ public static class Tools
|
||||
string bb = string.Empty;
|
||||
bool isNegative = false;
|
||||
|
||||
try
|
||||
for (int x = 0; x < myMoney.Length; x++)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(myMoney))
|
||||
if (char.IsDigit(myMoney[x]))
|
||||
{
|
||||
for (int x = 0; x < myMoney.Length; x++)
|
||||
{
|
||||
if (char.IsDigit(myMoney[x]))
|
||||
{
|
||||
bb += myMoney[x];
|
||||
}
|
||||
else if (myMoney[x] == '-' && bb.Length == 0)
|
||||
{
|
||||
// اگر علامت منفی قبل از اولین عدد آمد، در نظر بگیر
|
||||
isNegative = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (bb.Length > 0)
|
||||
{
|
||||
double res = double.Parse(bb);
|
||||
return isNegative ? -res : res;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bb += myMoney[x];
|
||||
}
|
||||
else
|
||||
else if (myMoney[x] == '-' && bb.Length == 0)
|
||||
{
|
||||
return 0;
|
||||
// اگر علامت منفی قبل از اولین عدد آمد، در نظر بگیر
|
||||
isNegative = true;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
if (bb.Length > 0)
|
||||
{
|
||||
double res = double.Parse(bb);
|
||||
return isNegative ? -res : res;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Json;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace _0_Framework.Application.UID;
|
||||
|
||||
public class UidService : IUidService
|
||||
{
|
||||
private readonly HttpClient _httpClient;
|
||||
private const string BaseUrl = "https://json-api.uid.ir/api/inquiry/";
|
||||
|
||||
public UidService()
|
||||
{
|
||||
_httpClient = new HttpClient()
|
||||
{
|
||||
BaseAddress = new Uri(BaseUrl)
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<PersonalInfoResponse> GetPersonalInfo(string nationalCode, string birthDate)
|
||||
{
|
||||
var request = new PersonalInfoRequest
|
||||
{
|
||||
BirthDate = birthDate,
|
||||
NationalId = nationalCode,
|
||||
RequestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
try
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("person/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<PersonalInfoResponse>();
|
||||
if (responseResult.BasicInformation != null)
|
||||
{
|
||||
responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName?.ToPersian();
|
||||
responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName?.ToPersian();
|
||||
responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName?.ToPersian();
|
||||
}
|
||||
|
||||
return responseResult;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
return new PersonalInfoResponse(new UidBasicInformation(),
|
||||
new IdentificationInformation(default, default, default, default, default), new RegistrationStatus(),
|
||||
new ResponseContext(new UidStatus(14, "")));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public async Task<MatchMobileWithNationalCodeResponse> IsMachPhoneWithNationalCode(string nationalCode, string phoneNumber)
|
||||
{
|
||||
var request = new PersonalInfoRequest
|
||||
{
|
||||
MobileNumber = phoneNumber,
|
||||
NationalId = nationalCode,
|
||||
RequestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<MatchMobileWithNationalCodeResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
}
|
||||
@@ -64,4 +64,6 @@ public interface IAccountApplication
|
||||
/// <param name="userName"></param>
|
||||
/// <returns></returns>
|
||||
public bool CheckExistClientAccount(string userName);
|
||||
List<AccountViewModel> GetAdminAccountsNew();
|
||||
|
||||
}
|
||||
@@ -799,4 +799,8 @@ public class AccountApplication : IAccountApplication
|
||||
return _accountRepository.CheckExistClientAccount(userName);
|
||||
}
|
||||
|
||||
public List<AccountViewModel> GetAdminAccountsNew()
|
||||
{
|
||||
return _accountRepository.GetAdminAccountsNew();
|
||||
}
|
||||
}
|
||||
51
Company.Domain/AuthorizedPersonAgg/AuthorizedPerson.cs
Normal file
51
Company.Domain/AuthorizedPersonAgg/AuthorizedPerson.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.AuthorizedPersonAgg;
|
||||
|
||||
public class AuthorizedPerson : EntityBase
|
||||
{
|
||||
public string NationalCode { get; private set; }
|
||||
public string FirstName { get; private set; }
|
||||
public string LastName { get; private set; }
|
||||
public string FatherName { get; private set; }
|
||||
public string BirthDate { get; private set; }
|
||||
public string Gender { get; private set; }
|
||||
public string DeathStatus { get; private set; }
|
||||
public string ShenasnameSeri { get; private set; }
|
||||
public string ShenasnameSerial { get; private set; }
|
||||
public string ShenasnamehNumber { get; private set; }
|
||||
public bool IsVerified { get; private set; }
|
||||
public DateTime? VerificationDate { get; private set; }
|
||||
|
||||
public AuthorizedPerson(string nationalCode, string firstName, string lastName, string fatherName,
|
||||
string birthDate, string gender, string deathStatus, string shenasnameSeri,
|
||||
string shenasnameSerial, string shenasnamehNumber)
|
||||
{
|
||||
NationalCode = nationalCode;
|
||||
FirstName = firstName;
|
||||
LastName = lastName;
|
||||
FatherName = fatherName;
|
||||
BirthDate = birthDate;
|
||||
Gender = gender;
|
||||
DeathStatus = deathStatus;
|
||||
ShenasnameSeri = shenasnameSeri;
|
||||
ShenasnameSerial = shenasnameSerial;
|
||||
ShenasnamehNumber = shenasnamehNumber;
|
||||
IsVerified = true;
|
||||
VerificationDate = DateTime.Now;
|
||||
}
|
||||
|
||||
public void UpdatePersonalInfo(string firstName, string lastName, string fatherName,
|
||||
string gender, string deathStatus)
|
||||
{
|
||||
FirstName = firstName;
|
||||
LastName = lastName;
|
||||
FatherName = fatherName;
|
||||
Gender = gender;
|
||||
DeathStatus = deathStatus;
|
||||
VerificationDate = DateTime.Now;
|
||||
}
|
||||
|
||||
protected AuthorizedPerson() { }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.AuthorizedPersonAgg;
|
||||
|
||||
public interface IAuthorizedPersonRepository : IRepository<long, AuthorizedPerson>
|
||||
{
|
||||
AuthorizedPerson GetByNationalCode(string nationalCode);
|
||||
bool ExistsByNationalCode(string nationalCode);
|
||||
}
|
||||
@@ -10,7 +10,7 @@ namespace Company.Domain.ClassifiedSalaryAgg
|
||||
{
|
||||
public class ClassifiedSalary : EntityBase
|
||||
{
|
||||
//test//test
|
||||
//test
|
||||
public ClassifiedSalary(double group1, double group2, double group3, double group4, double group5, double group6, double group7, double group8, double group9, double group10, double group11, double group12, double group13, double group14, double group15, double group16, double group17, double group18, double group19, double group20, DateTime startDate, DateTime endDate, int year)
|
||||
{
|
||||
Group1 = group1;
|
||||
|
||||
@@ -15,7 +15,7 @@ public interface IPersonalContractingPartyRepository :IRepository<long, Personal
|
||||
EditPersonalContractingParty GetDetailsToEdit(long id);
|
||||
string GetFullName(long id);
|
||||
List<PersonalContractingPartyViewModel> Search(PersonalContractingPartySearchModel searchModel2);
|
||||
int GetLastArchiveCode();
|
||||
int GetLastNewArchiveCode();
|
||||
#region Mahan
|
||||
|
||||
List<string> SearchByName(string name);
|
||||
|
||||
@@ -73,12 +73,16 @@ public class PersonalContractingParty : EntityBase
|
||||
/// آیا از طریق ای پی ای احراز هویت شده است
|
||||
/// </summary>
|
||||
public bool IsAuthenticated { get; private set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// جنسیت
|
||||
/// </summary>
|
||||
public Gender Gender { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// سمت و صاحب امضاء اوراق (فقط برای طرف حقوقی)
|
||||
/// </summary>
|
||||
public string LegalPosition { get; private set; }
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -94,7 +98,7 @@ public class PersonalContractingParty : EntityBase
|
||||
public PersonalContractingParty(string fName, string lName, string nationalcode, string idNumber,
|
||||
/*string legalName,*/ string registerId, string nationalId, string isLegal,
|
||||
string phone, string agentPhone, string address,long representativeId,
|
||||
string representativeFullName, int archiveCode, string state,string city, string zone, string sureName)
|
||||
string representativeFullName, int archiveCode, string state,string city, string zone, string sureName,string legalPosition=null)
|
||||
{
|
||||
|
||||
FName = fName;
|
||||
@@ -120,8 +124,7 @@ public class PersonalContractingParty : EntityBase
|
||||
IsActiveString = "true";
|
||||
IsBlock = "false";
|
||||
BlockTimes = 0;
|
||||
|
||||
|
||||
LegalPosition = legalPosition;
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +154,7 @@ public class PersonalContractingParty : EntityBase
|
||||
}
|
||||
|
||||
public void EditLegal(string lName, string registerId, string nationalId, string phone, string agentPhone, string address, long representativeId, string representativeFullName, int archiveCode,
|
||||
string state, string city, string zone, string sureName)
|
||||
string state, string city, string zone, string sureName,string legalPosition = null)
|
||||
{
|
||||
|
||||
LName = lName;
|
||||
@@ -168,6 +171,8 @@ public class PersonalContractingParty : EntityBase
|
||||
State = state;
|
||||
City = city;
|
||||
Zone = zone;
|
||||
if (legalPosition != null)
|
||||
LegalPosition = legalPosition;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class Contract : EntityBase
|
||||
public Contract(long personnelCode, long employeeId, long employerId,
|
||||
long workshopIds, long yearlySalaryId, DateTime contarctStart, DateTime contractEnd, string dayliWage,
|
||||
string archiveCode, DateTime getWorkDate, DateTime setContractDate, string jobType,
|
||||
string contractType, string workshopAddress1, string workshopAddress2, string consumableItems, long jobTypeId, string housingAllowance, string agreementSalary, string workingHoursWeekly, string familyAllowance, string contractPeriod, double dailySalaryAffected, double baseYearAffected, double dailySalaryUnAffected, double baseYearUnAffected, bool hasManualDailyWage, string dailyWageType)
|
||||
string contractType, string workshopAddress1, string workshopAddress2, string consumableItems, long jobTypeId, string housingAllowance, string agreementSalary, string workingHoursWeekly, string familyAllowance, string contractPeriod)
|
||||
{
|
||||
PersonnelCode = personnelCode;
|
||||
EmployeeId = employeeId;
|
||||
@@ -45,19 +45,6 @@ public class Contract : EntityBase
|
||||
WorkingHoursWeekly = workingHoursWeekly;
|
||||
FamilyAllowance = familyAllowance;
|
||||
ContractPeriod = contractPeriod;
|
||||
|
||||
//پراپرتی های جدید برای دستمزد دلخواه
|
||||
#region NewManualDailyWage
|
||||
DailySalaryAffected = dailySalaryAffected;
|
||||
BaseYearAffected = baseYearAffected;
|
||||
DailySalaryUnAffected = dailySalaryUnAffected;
|
||||
BaseYearUnAffected = baseYearUnAffected;
|
||||
HasManualDailyWage = hasManualDailyWage;
|
||||
DailyWageType = dailyWageType;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Signature = "0";
|
||||
|
||||
|
||||
@@ -78,42 +65,7 @@ public class Contract : EntityBase
|
||||
public DateTime SetContractDate { get; private set; }
|
||||
public string JobType { get; private set; }
|
||||
public string ContractType { get; private set; }
|
||||
/// <summary>
|
||||
/// مزد تجمیعی یعد از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public string DayliWage { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه خام بعد از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double DailySalaryAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پایه سنوات بعد از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double BaseYearAffected { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه قبل از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double DailySalaryUnAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پایه سنوات قبل از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double BaseYearUnAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا دستمزد روزانه دستی وارد شده است؟
|
||||
/// </summary>
|
||||
public bool HasManualDailyWage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع دستمزد انتخاب شده
|
||||
/// </summary>
|
||||
public string DailyWageType { get; set; }
|
||||
|
||||
public string IsActiveString { get; private set; }
|
||||
public string ArchiveCode { get; private set; }
|
||||
public string WorkshopAddress1 { get; private set; }
|
||||
@@ -137,7 +89,6 @@ public class Contract : EntityBase
|
||||
|
||||
public Contract()
|
||||
{
|
||||
|
||||
WorkingHoursList = new List<WorkingHours>();
|
||||
}
|
||||
public void Edit(long pesrsonnelCode, long employeeId, long employerId, long workshopId, long yearlySalaryId,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
@@ -10,24 +9,6 @@ namespace Company.Domain.ContractAgg;
|
||||
|
||||
public interface IContractRepository : IRepository<long, Contract>
|
||||
{
|
||||
/// <summary>
|
||||
/// دریافت مزد ارتقاء یافته
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="yearlySalaryId"></param>
|
||||
/// <returns></returns>
|
||||
Task<double> GetManualDailWage(long workshopId, long employeeId, long yearlySalaryId, DateTime contractStart);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست مزد ارتقاء یافته
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="contractStart"></param>
|
||||
/// <returns></returns>
|
||||
Task<UpgradeManualDailyWageModel> GetManualDailWageList(long workshopId, long employeeId,
|
||||
DateTime contractStart);
|
||||
EditContract GetDetails(long id);
|
||||
EditContract GetContractByStartEnd(DateTime start, DateTime end, long workshopId, long employeeId);
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ public class FinancialStatment : EntityBase
|
||||
ContractingPartyId = contractingPartyId;
|
||||
ContractingPartyName = contractingPartyName;
|
||||
PublicId = Guid.NewGuid();
|
||||
FinancialTransactionList = [];
|
||||
}
|
||||
|
||||
public FinancialStatment()
|
||||
@@ -37,4 +38,12 @@ public class FinancialStatment : EntityBase
|
||||
{
|
||||
PublicId = Guid.NewGuid();
|
||||
}
|
||||
|
||||
public void AddFinancialTransaction(FinancialTransaction financialTransaction)
|
||||
{
|
||||
if (financialTransaction == null)
|
||||
throw new ArgumentNullException(nameof(financialTransaction));
|
||||
FinancialTransactionList.Add(financialTransaction);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -47,4 +47,9 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
||||
|
||||
Task<PagedResult<GetInstitutionContractListItemsViewModel>> GetList(InstitutionContractListSearchModel searchModel);
|
||||
Task<GetInstitutionContractListStatsViewModel> GetListStats(InstitutionContractListSearchModel searchModel);
|
||||
Task<List<RegistrationWorkflowMainListViewModel>> RegistrationWorkflowMainList();
|
||||
Task<List<RegistrationWorkflowItemsViewModel>> RegistrationWorkflowItems(long institutionContractId);
|
||||
Task<InstitutionContractWorkshopDetail> GetInstitutionWorkshopDetails(long institutionWorkshopDetailsId);
|
||||
Task<InstitutionContract> GetIncludeWorkshopDetailsAsync(long institutionContractId);
|
||||
void UpdateStatusIfNeeded(long institutionContractId);
|
||||
}
|
||||
@@ -1,17 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using Company.Domain.InstitutionContractContactInfoAgg;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
namespace Company.Domain.InstitutionContractAgg;
|
||||
|
||||
public class InstitutionContract : EntityBase
|
||||
{
|
||||
public InstitutionContract(string contractNo, long representativeId, string representativeName, long contractingPartyId,
|
||||
public InstitutionContract(string contractNo, long representativeId, string representativeName,
|
||||
long contractingPartyId,
|
||||
string contractingPartyName, DateTime contractDateGr, string contractDateFa, string state, string city,
|
||||
string address, DateTime contractStartGr, string contractStartFa, DateTime contractEndGr,
|
||||
string contractEndFa, double contractAmount, double dailyCompenseation, double obligation,
|
||||
double totalAmount, int extensionNo, string workshopManualCount, string employeeManualCount, string description, string officialCompany,string typeOfcontract, string hasValueAddedTax, double valueAddedTax)
|
||||
double totalAmount, int extensionNo, string workshopManualCount, string employeeManualCount, string description,
|
||||
string officialCompany, string typeOfcontract, string hasValueAddedTax, double valueAddedTax)
|
||||
{
|
||||
ContractNo = contractNo;
|
||||
RepresentativeId = representativeId;
|
||||
@@ -43,6 +48,10 @@ public class InstitutionContract : EntityBase
|
||||
TypeOfContract = typeOfcontract;
|
||||
HasValueAddedTax = hasValueAddedTax;
|
||||
ValueAddedTax = valueAddedTax;
|
||||
Status = InstitutionContractStatus.Incomplete;
|
||||
ContactInfoList = [];
|
||||
WorkshopDetails = [];
|
||||
Installments = [];
|
||||
}
|
||||
|
||||
public string ContractNo { get; private set; }
|
||||
@@ -55,21 +64,24 @@ public class InstitutionContract : EntityBase
|
||||
public string ContractDateFa { get; private set; }
|
||||
public string State { get; private set; }
|
||||
public string City { get; private set; }
|
||||
|
||||
public string Address { get; private set; }
|
||||
|
||||
//public long ContactInfoId { get; private set; }
|
||||
public DateTime ContractStartGr { get; private set; }
|
||||
public string ContractStartFa { get; private set; }
|
||||
public DateTime ContractEndGr { get; private set; }
|
||||
public string ContractEndFa { get; private set; }
|
||||
|
||||
|
||||
// مبلغ قرارداد
|
||||
public double ContractAmount { get; private set; }
|
||||
|
||||
|
||||
//خسارت روزانه
|
||||
public double DailyCompenseation { get; private set; }
|
||||
|
||||
//وجه التزام
|
||||
public double Obligation { get; private set; }
|
||||
|
||||
// مبلغ کل قرارداد
|
||||
public double TotalAmount { get; private set; }
|
||||
public string WorkshopManualCount { get; private set; }
|
||||
@@ -82,28 +94,33 @@ public class InstitutionContract : EntityBase
|
||||
public string TypeOfContract { get; private set; }
|
||||
public string HasValueAddedTax { get; set; }
|
||||
public double ValueAddedTax { get; set; }
|
||||
public InstitutionContractStatus Status { get; private set; }
|
||||
|
||||
public List<InstitutionContractWorkshopDetail> WorkshopDetails { get; set; }
|
||||
|
||||
public List<InstitutionContractContactInfo> ContactInfoList { get; set; }
|
||||
|
||||
public List<InstitutionContractInstallment> Installments { get; set; }
|
||||
|
||||
public InstitutionContract()
|
||||
{
|
||||
|
||||
ContactInfoList = new List<InstitutionContractContactInfo>();
|
||||
ContactInfoList = [];
|
||||
WorkshopDetails = [];
|
||||
Installments = [];
|
||||
}
|
||||
|
||||
public void Edit(DateTime contractDateGr, string contractDateFa, string state, string city, string address,
|
||||
DateTime contractStartGr, string contractStartFa, DateTime contractEndGr, string contractEndFa,
|
||||
double contractAmount, double dailyCompenseation, double obligation, double totalAmount,
|
||||
string workshopManualCount, string employeeManualCount, string description, string officialCompany,
|
||||
string workshopManualCount, string employeeManualCount, string description, string officialCompany,
|
||||
string typeOfcontract, double valueAddedTax, string hasValueAddedTax)
|
||||
{
|
||||
|
||||
ContractDateGr = contractDateGr;
|
||||
ContractDateFa = contractDateFa;
|
||||
State = state;
|
||||
City = city;
|
||||
Address = address;
|
||||
|
||||
|
||||
ContractStartGr = contractStartGr;
|
||||
ContractStartFa = contractStartFa;
|
||||
ContractEndGr = contractEndGr;
|
||||
@@ -124,13 +141,11 @@ public class InstitutionContract : EntityBase
|
||||
|
||||
public void Active()
|
||||
{
|
||||
|
||||
this.IsActiveString = "true";
|
||||
}
|
||||
|
||||
public void DeActive()
|
||||
{
|
||||
|
||||
this.IsActiveString = "false";
|
||||
}
|
||||
|
||||
@@ -148,4 +163,177 @@ public class InstitutionContract : EntityBase
|
||||
{
|
||||
this.Signature = "0";
|
||||
}
|
||||
|
||||
public void Complete()
|
||||
{
|
||||
Status = InstitutionContractStatus.Completed;
|
||||
}
|
||||
|
||||
public void SetWorkshopDetails(List<InstitutionContractWorkshopDetail> commandWorkshops)
|
||||
{
|
||||
WorkshopDetails = commandWorkshops;
|
||||
}
|
||||
|
||||
public void SetInstallments(List<InstitutionContractInstallment> installments)
|
||||
{
|
||||
Installments = installments;
|
||||
}
|
||||
}
|
||||
|
||||
public class InstitutionContractWorkshopDetail:EntityBase
|
||||
{
|
||||
public InstitutionContractWorkshopDetail(string workshopName, bool hasRollCallPlan,
|
||||
bool hasCustomizeCheckoutPlan, bool hasContractPlan,bool hasContractPlanInPerson,bool hasInsurancePlan,bool hasInsurancePlanInPerson,
|
||||
int personnelCount, double price)
|
||||
{
|
||||
WorkshopName = workshopName;
|
||||
HasRollCallPlan = hasRollCallPlan;
|
||||
HasCustomizeCheckoutPlan = hasCustomizeCheckoutPlan;
|
||||
HasContractPlan = hasContractPlan;
|
||||
HasContractPlanInPerson = hasContractPlanInPerson;
|
||||
HasInsurancePlan = hasInsurancePlan;
|
||||
HasInsurancePlanInPerson = hasInsurancePlanInPerson;
|
||||
PersonnelCount = personnelCount;
|
||||
WorkshopCreated = false;
|
||||
Price = price;
|
||||
Employers = [];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// شناسه کارگاه
|
||||
/// </summary>
|
||||
public long? WorkshopId { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن حضور و غیاب
|
||||
/// </summary>
|
||||
public bool HasRollCallPlan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن فیش غیر رسمی
|
||||
/// </summary>
|
||||
public bool HasCustomizeCheckoutPlan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن قرارداد و تصفیه
|
||||
/// </summary>
|
||||
public bool HasContractPlan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن قرارداد و تصفیه حضوری
|
||||
/// </summary>
|
||||
public bool HasContractPlanInPerson { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن بیمه
|
||||
/// </summary>
|
||||
public bool HasInsurancePlan { get; private set; }
|
||||
/// <summary>
|
||||
/// پلن بیمه حضوری
|
||||
/// </summary>
|
||||
public bool HasInsurancePlanInPerson { get; private set; }
|
||||
|
||||
public int PersonnelCount { get; private set; }
|
||||
|
||||
public bool WorkshopCreated { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه قرارداد نهاد مرتبط
|
||||
/// </summary>
|
||||
public long InstitutionContractId { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Navigation property to InstitutionContract
|
||||
/// </summary>
|
||||
public InstitutionContract InstitutionContract { get; private set; }
|
||||
|
||||
public double Price { get; private set; }
|
||||
|
||||
|
||||
private InstitutionContractWorkshopDetail()
|
||||
{
|
||||
}
|
||||
public List<InstitutionContractWorkshopDetailEmployer> Employers { get; private set; } = new();
|
||||
|
||||
public void SetEmployers(List<long> employerIds)
|
||||
{
|
||||
Employers.Clear();
|
||||
foreach (var employerId in employerIds)
|
||||
{
|
||||
Employers.Add(new InstitutionContractWorkshopDetailEmployer(id, employerId));
|
||||
}
|
||||
}
|
||||
public void AddEmployer(long employerId)
|
||||
{
|
||||
if (Employers.Exists(x => x.EmployerId == employerId))
|
||||
return;
|
||||
|
||||
Employers.Add(new InstitutionContractWorkshopDetailEmployer(id, employerId));
|
||||
}
|
||||
|
||||
public void Edit(bool hasAttendancePlan, bool hasUnofficialPayslipPlan, bool hasContractSettlementPlan)
|
||||
{
|
||||
HasRollCallPlan = hasAttendancePlan;
|
||||
HasCustomizeCheckoutPlan = hasUnofficialPayslipPlan;
|
||||
HasContractPlan = hasContractSettlementPlan;
|
||||
}
|
||||
|
||||
public void SetWorkshopId(long workshopId)
|
||||
{
|
||||
WorkshopId = workshopId;
|
||||
WorkshopCreated = true;
|
||||
}
|
||||
}
|
||||
|
||||
public enum InstitutionContractStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// ناتمام - قرارداد هنوز تکمیل نشده و نیاز به انجام کارهای بیشتر دارد
|
||||
/// </summary>
|
||||
Incomplete = 0,
|
||||
|
||||
/// <summary>
|
||||
/// تکمیل شده - قرارداد به طور کامل انجام شده و نهایی شده است
|
||||
/// </summary>
|
||||
Completed = 1
|
||||
}
|
||||
|
||||
public class InstitutionContractInstallment
|
||||
{
|
||||
public InstitutionContractInstallment(DateTime installmentDateGr, double amount,
|
||||
string description)
|
||||
{
|
||||
InstallmentDateGr = installmentDateGr;
|
||||
InstallmentDateFa = installmentDateGr.ToFarsi();
|
||||
Amount = amount;
|
||||
Description = description;
|
||||
}
|
||||
|
||||
public long Id { get; private set; }
|
||||
public DateTime InstallmentDateGr { get; private set; }
|
||||
public string InstallmentDateFa { get; private set; }
|
||||
public double Amount { get; private set; }
|
||||
public string Description { get; private set; }
|
||||
|
||||
public long InstitutionContractId { get; private set; }
|
||||
|
||||
public InstitutionContract InstitutionContract { get; private set; }
|
||||
}
|
||||
public class InstitutionContractWorkshopDetailEmployer : EntityBase
|
||||
{
|
||||
public long InstitutionContractWorkshopDetailId { get; private set; }
|
||||
public long EmployerId { get; private set; }
|
||||
|
||||
public InstitutionContractWorkshopDetailEmployer(long institutionContractWorkshopDetailId, long employerId)
|
||||
{
|
||||
InstitutionContractWorkshopDetailId = institutionContractWorkshopDetailId;
|
||||
EmployerId = employerId;
|
||||
}
|
||||
|
||||
private InstitutionContractWorkshopDetailEmployer() { }
|
||||
}
|
||||
15
Company.Domain/LawAgg/ILawRepository.cs
Normal file
15
Company.Domain/LawAgg/ILawRepository.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using _0_Framework.Domain;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using CompanyManagment.App.Contracts.Law;
|
||||
|
||||
namespace Company.Domain.LawAgg
|
||||
{
|
||||
public interface ILawRepository : IRepository<long, Law>
|
||||
{
|
||||
Task<Law> GetWithItems(long id);
|
||||
Task<List<Law>> GetActive();
|
||||
Task<LawViewModel> GetByType(LawType type);
|
||||
Task<List<LawViewModel>> GetList(LawSearchModel searchModel);
|
||||
}
|
||||
}
|
||||
89
Company.Domain/LawAgg/Law.cs
Normal file
89
Company.Domain/LawAgg/Law.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.Law;
|
||||
using System.Text.Json;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Company.Domain.LawAgg
|
||||
{
|
||||
public class Law : EntityBase
|
||||
{
|
||||
private Law(){}
|
||||
public string Title { get; private set; }
|
||||
public bool IsActive { get; private set; }
|
||||
public List<LawItem> Items { get; private set; }
|
||||
public LawType Type { get; private set; }
|
||||
public string HeadTitle { get; private set; }
|
||||
public string NotificationsJson { get; private set; }
|
||||
|
||||
[NotMapped]
|
||||
public List<string> Notifications
|
||||
{
|
||||
get => string.IsNullOrEmpty(NotificationsJson)
|
||||
? new List<string>()
|
||||
: JsonSerializer.Deserialize<List<string>>(NotificationsJson);
|
||||
set => NotificationsJson = JsonSerializer.Serialize(value);
|
||||
}
|
||||
|
||||
public Law(string title, LawType lawType, List<string> notifications, string headTitle )
|
||||
{
|
||||
Title = title;
|
||||
IsActive = true;
|
||||
Items = new List<LawItem>();
|
||||
Type = lawType;
|
||||
Notifications = notifications ?? new List<string>();
|
||||
HeadTitle = headTitle;
|
||||
}
|
||||
|
||||
public void Edit(string title)
|
||||
{
|
||||
Title = title;
|
||||
}
|
||||
|
||||
public void AddItem(string header, string details, int orderNumber)
|
||||
{
|
||||
Items.Add(new LawItem(header, details, orderNumber));
|
||||
}
|
||||
|
||||
|
||||
public void SetItem(List<LawItem> items)
|
||||
{
|
||||
Items = items ?? new List<LawItem>();
|
||||
}
|
||||
public void RemoveItem(int orderNumber)
|
||||
{
|
||||
var item = Items.Find(x => x.OrderNumber == orderNumber);
|
||||
if (item != null)
|
||||
Items.Remove(item);
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
{
|
||||
IsActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
public class LawItem
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Header { get; private set; }
|
||||
public string Details { get; private set; }
|
||||
public int OrderNumber { get; private set; }
|
||||
public long LawId { get; set; }
|
||||
|
||||
protected LawItem() { }
|
||||
|
||||
public LawItem(string header, string details, int orderNumber)
|
||||
{
|
||||
Header = header;
|
||||
Details = details;
|
||||
OrderNumber = orderNumber;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public interface ILeaveRepository : IRepository<long, Leave>
|
||||
|
||||
bool CheckContractExist(DateTime myDate,long employeeId, long workshopId);
|
||||
|
||||
LeavErrorViewModel CheckErrors(DateTime startLeav, DateTime endLeav, long employeeId, long workshopId,bool isInvalid);
|
||||
LeavErrorViewModel CheckErrors(DateTime startLeav, DateTime endLeav, long employeeId, long workshopId);
|
||||
LeaveViewModel LeavOnChekout(DateTime starContract, DateTime endContract, long employeeId, long workshopId);
|
||||
List<LeaveMainViewModel> searchClient(LeaveSearchModel searchModel);
|
||||
LeavePrintViewModel PrintOne(long id);
|
||||
|
||||
@@ -8,9 +8,7 @@ public class Leave: EntityBase
|
||||
{
|
||||
public Leave(DateTime startLeave, DateTime endLeave,
|
||||
string leaveHourses, long workshopId, long employeeId,
|
||||
string paidLeaveType, string leaveType, string employeeFullName, string workshopName,
|
||||
bool isAccepted, string decription, int year, int month, TimeSpan shiftDuration,
|
||||
bool hasShiftDuration,bool isInvalid)
|
||||
string paidLeaveType, string leaveType, string employeeFullName, string workshopName, bool isAccepted, string decription, int year, int month, TimeSpan shiftDuration, bool hasShiftDuration)
|
||||
{
|
||||
StartLeave = startLeave;
|
||||
EndLeave = endLeave;
|
||||
@@ -27,7 +25,6 @@ public class Leave: EntityBase
|
||||
Month = month;
|
||||
ShiftDuration = shiftDuration;
|
||||
HasShiftDuration = hasShiftDuration;
|
||||
IsInvalid = isInvalid;
|
||||
}
|
||||
|
||||
public DateTime StartLeave { get; private set; }
|
||||
@@ -46,10 +43,6 @@ public class Leave: EntityBase
|
||||
|
||||
public TimeSpan ShiftDuration { get; private set; }
|
||||
public bool HasShiftDuration { get; private set; }
|
||||
/// <summary>
|
||||
///آیا فاقد اعتبار است. فاقد اعتبار ها فقط برای فیش های غیررسمی مورد استفاده قرار میگیرند
|
||||
/// </summary>
|
||||
public bool IsInvalid { get; private set; }
|
||||
|
||||
public void Edit(DateTime startLeave, DateTime endLeave,
|
||||
string leaveHourses, long workshopId, long employeeId,
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Company.Domain.RollCallAgg;
|
||||
|
||||
public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
||||
{
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute, double dailyWageUnAffected, bool totalLeaveCompute);
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute, bool totalLeaveCompute);
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
|
||||
|
||||
@@ -21,6 +21,8 @@ public class ContractingPartyTemp : EntityBase
|
||||
IdNumberSerial = idNumberSerial;
|
||||
Gender = gender;
|
||||
DateOfBirth = dateOfBirth;
|
||||
PublicId = Guid.NewGuid();
|
||||
Status = ContractingPartyTempStatus.InComplete;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -91,10 +93,34 @@ public class ContractingPartyTemp : EntityBase
|
||||
/// </summary>
|
||||
public string Address { get; private set; }
|
||||
|
||||
public ContractingPartyTempStatus Status { get; set; }
|
||||
|
||||
public string VerifyCode { get; set; }
|
||||
public DateTime VerifyCodeSentDateTime { get; set; }
|
||||
|
||||
public Guid PublicId { get; set; }
|
||||
|
||||
public void UpdateAddress(string state, string city, string address)
|
||||
{
|
||||
this.State = state;
|
||||
this.City = city;
|
||||
this.Address = address;
|
||||
}
|
||||
|
||||
public void SetCompleted()
|
||||
{
|
||||
Status = ContractingPartyTempStatus.Completed;
|
||||
}
|
||||
|
||||
public void SetVerifyCode(string verifyCode)
|
||||
{
|
||||
VerifyCode = verifyCode;
|
||||
VerifyCodeSentDateTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ContractingPartyTempStatus
|
||||
{
|
||||
InComplete,
|
||||
Completed
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.TemporaryClientRegistrationAgg;
|
||||
|
||||
public interface IInstitutionContractContactInfoTempRepository : IRepository<long, InstitutionContractContactInfoTemp>
|
||||
{
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework_b.Domain;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
namespace Company.Domain.TemporaryClientRegistrationAgg;
|
||||
@@ -17,10 +18,5 @@ public interface IInstitutionContractTempRepository : IRepository<long, Institut
|
||||
/// <returns></returns>
|
||||
Task<InstitutionContractTempViewModel> GetInstitutionContractTemp(long id,long contractingPartyTempId);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست طرف حساب هایی که ثبت نام آنها تکمیل شده
|
||||
/// جهت نمایش در کارپوشه
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<RegistrationWorkflowMainList>> GetAllCompletedRegistration();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.TemporaryClientRegistrationAgg;
|
||||
|
||||
public class InstitutionContractContactInfoTemp : EntityBase
|
||||
{
|
||||
public InstitutionContractContactInfoTemp(string phoneType, string position, string phoneNumber,
|
||||
string fullName, long institutionContractTempId, bool sendSms)
|
||||
{
|
||||
PhoneType = phoneType;
|
||||
Position = position;
|
||||
PhoneNumber = phoneNumber;
|
||||
FullName = fullName;
|
||||
InstitutionContractTempId = institutionContractTempId;
|
||||
SendSms = sendSms;
|
||||
}
|
||||
|
||||
public string PhoneType { get; private set; }
|
||||
public long InstitutionContractTempId { get; private set; }
|
||||
public string Position { get; private set; }
|
||||
public string PhoneNumber { get; private set; }
|
||||
public string FullName { get; private set; }
|
||||
public bool SendSms { get; private set; }
|
||||
public InstitutionContractTemp InstitutionContractTemp { get; set; }
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application.UID;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
namespace Company.Domain.TemporaryClientRegistrationAgg;
|
||||
|
||||
public class InstitutionContractTemp : EntityBase
|
||||
{
|
||||
public InstitutionContractTemp(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, string registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
|
||||
public InstitutionContractTemp(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, InstitutionContractTempStatus registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
|
||||
{
|
||||
ContractingPartyTempId = contractingPartyTempId;
|
||||
PaymentModel = paymentModel;
|
||||
@@ -22,6 +24,7 @@ public class InstitutionContractTemp : EntityBase
|
||||
MessageId = messageId;
|
||||
SendVerifyCodeTime = sendVerifyCodeTime;
|
||||
VerifyCodeEndTime = verifyCodeEndTime;
|
||||
PublicId = Guid.NewGuid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -87,7 +90,7 @@ public class InstitutionContractTemp : EntityBase
|
||||
/// -
|
||||
/// Completed ثبت نام تکمیل شده
|
||||
/// </summary>
|
||||
public string RegistrationStatus { get; private set; }
|
||||
public InstitutionContractTempStatus RegistrationStatus { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی پیامک ارسال شده
|
||||
@@ -104,8 +107,16 @@ public class InstitutionContractTemp : EntityBase
|
||||
/// </summary>
|
||||
public DateTime? VerifyCodeEndTime{ get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیدی عمومی
|
||||
/// برای نمایش در آدرس
|
||||
/// </summary>
|
||||
public Guid PublicId { get; set; }
|
||||
|
||||
public void Edit(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, string registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
|
||||
public List<InstitutionContractContactInfoTemp> ContactInfoList { get; set; }
|
||||
|
||||
|
||||
public void Edit(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, InstitutionContractTempStatus registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
|
||||
{
|
||||
ContractingPartyTempId = contractingPartyTempId;
|
||||
PaymentModel = paymentModel;
|
||||
@@ -122,7 +133,7 @@ public class InstitutionContractTemp : EntityBase
|
||||
VerifyCodeEndTime = verifyCodeEndTime;
|
||||
}
|
||||
|
||||
public void Update(string verifyCode, string registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
|
||||
public void Update(string verifyCode, InstitutionContractTempStatus registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
|
||||
{
|
||||
VerifyCode = verifyCode;
|
||||
RegistrationStatus = registrationStatus;
|
||||
@@ -131,9 +142,10 @@ public class InstitutionContractTemp : EntityBase
|
||||
VerifyCodeEndTime = verifyCodeEndTime;
|
||||
}
|
||||
|
||||
public void ChangeRegistrationStatus(string registrationStatus)
|
||||
public void ChangeRegistrationStatus(InstitutionContractTempStatus registrationStatus)
|
||||
{
|
||||
RegistrationStatus = registrationStatus;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,14 +76,13 @@ public class Workshop : EntityBase
|
||||
|
||||
ClientEmployeeWorkshopList = new List<ClientEmployeeWorkshop>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public Workshop(string workshopName,string workshopSureName, string insuranceCode, string typeOfOwnership, string archiveCode, string agentName, string agentPhone,
|
||||
string state, string city, string address, string typeOfInsuranceSend, string typeOfContract, string contractTerm,
|
||||
string agreementNumber, bool fixedSalary, string population,long? insuranceJobId, string zoneName, bool addBonusesPay, bool addYearsPay, bool addLeavePay, bool totalPaymentHide,
|
||||
bool isClassified, string computeOptions, string bonusesOptions, string yearsOptions, string hasRollCallFreeVip, bool workshopHolidayWorking,
|
||||
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance, bool createContract, bool signContract, bool createCheckout, bool signCheckout, IsActive cutContractEndOfYear, bool rotatingShiftCompute, bool isStaticCheckout)
|
||||
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance, bool createContract, bool signContract, bool createCheckout, bool signCheckout,
|
||||
IsActive cutContractEndOfYear, bool rotatingShiftCompute, bool isStaticCheckout,long contractingPartyId)
|
||||
{
|
||||
WorkshopName = workshopName;
|
||||
WorkshopSureName = workshopSureName;
|
||||
@@ -134,6 +133,7 @@ public class Workshop : EntityBase
|
||||
CutContractEndOfYear = cutContractEndOfYear;
|
||||
RotatingShiftCompute = rotatingShiftCompute;
|
||||
IsStaticCheckout = isStaticCheckout;
|
||||
ContractingPartyId = contractingPartyId;
|
||||
}
|
||||
|
||||
|
||||
@@ -233,6 +233,8 @@ public class Workshop : EntityBase
|
||||
/// </summary>
|
||||
public bool IsStaticCheckout { get; private set; }
|
||||
|
||||
public long ContractingPartyId { get; private set; }
|
||||
|
||||
public Workshop()
|
||||
{
|
||||
RollCallServicesList = new List<RollCallService>();
|
||||
@@ -344,4 +346,10 @@ public class Workshop : EntityBase
|
||||
this.IsActiveString = "false";
|
||||
ArchiveCode = "b-" + archiveCode;
|
||||
}
|
||||
}
|
||||
|
||||
public enum WorkshopRegistrationStatus
|
||||
{
|
||||
NotRegistered = 0,
|
||||
Registered = 1
|
||||
}
|
||||
@@ -6,7 +6,6 @@ using CompanyManagment.App.Contracts.YearlySalary;
|
||||
using System.Threading.Tasks;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Holiday;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
|
||||
namespace Company.Domain.YearlySalaryAgg;
|
||||
|
||||
@@ -18,39 +17,11 @@ public interface IYearlySalaryRepository : IRepository<long, YearlySalary>
|
||||
void TestDayliFeeCompute();
|
||||
List<string> GetYears();
|
||||
List<YearlySalaryViewModel> GetYearlySalary();
|
||||
|
||||
/// <summary>
|
||||
/// دریافت مزد روزانه فیش حقوقی
|
||||
/// </summary>
|
||||
/// <param name="contract"></param>
|
||||
/// <param name="checkoutStart"></param>
|
||||
/// <param name="checkoutEnd"></param>
|
||||
/// <returns></returns>
|
||||
Task<double> GetCheckoutDailyWage(EditContract contract, DateTime checkoutStart, DateTime checkoutEnd);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت مزد روزانه بر اساس تاریخ شروع و پایان
|
||||
/// </summary>
|
||||
/// <param name="start"></param>
|
||||
/// <param name="end"></param>
|
||||
/// <returns></returns>
|
||||
Task<(double dailyWage, long yearlySalaryId)> GetDailyWageByStartEnd(DateTime start, DateTime end);
|
||||
|
||||
MontlywageBunosYearsViewModel GetMontlyBunosYears(TimeSpan weeklyTime, DateTime contractStart,DateTime contractEnd, double daylyWage, string weeklyWorkingTime, int officialholiday, int friday, string totalHoursH, string totalHorsM, string basic, int fridayStartToEnd, double dayliFeeComplete, bool hasRollCall, bool holidaysWorking,string shiftWork);
|
||||
double GetLeavePay(DateTime contractStart, DateTime contractEnd, double daylyWage, double consumableItem, double housingAllowance, double familyAllowance , string weeklyWorkingTime, int officialholiday, int friday, string totalHoursH, string totalHorsM);
|
||||
double GetOverTimeWorking(double dayliWage, string overTimeWorkH, string overTimeWorkM);
|
||||
double GetOverNightWorking(double dayliWage, string overNightWorkH, string overNightWorkM, string weeklyWorkingTime, int officialholiday, int friday, DateTime contractStart, DateTime contractEnd, string totalHoursH, string totalHorsM);
|
||||
|
||||
/// <summary>
|
||||
/// متد ارتقاء مزد دلخواه
|
||||
/// </summary>
|
||||
/// <param name="newContractStart"></param>
|
||||
/// <param name="lastContractStart"></param>
|
||||
/// <param name="lastContractManualDailyWage"></param>
|
||||
/// <returns></returns>
|
||||
Task<UpgradeManualDailyWageModel> UpgradeManualDailyWage(DateTime newContractStart, DateTime lastContractStart,
|
||||
double lastContractManualDailyWage);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// متد محاسبه پایه سنوات و لیست پایه سنوات های پرسنل
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace CompanyManagment.App.Contracts.AuthorizedPerson;
|
||||
|
||||
public class AuthorizedPersonViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string NationalCode { get; set; }
|
||||
public string FirstName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string FatherName { get; set; }
|
||||
public string BirthDate { get; set; }
|
||||
public string Gender { get; set; }
|
||||
public string DeathStatus { get; set; }
|
||||
public string ShenasnameSeri { get; set; }
|
||||
public string ShenasnameSerial { get; set; }
|
||||
public string ShenasnamehNumber { get; set; }
|
||||
public bool IsVerified { get; set; }
|
||||
public string VerificationDate { get; set; }
|
||||
public string CreationDate { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace CompanyManagment.App.Contracts.AuthorizedPerson;
|
||||
|
||||
public class CreateAuthorizedPerson
|
||||
{
|
||||
public string NationalCode { get; set; }
|
||||
public string FirstName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string FatherName { get; set; }
|
||||
public string BirthDate { get; set; }
|
||||
public string Gender { get; set; }
|
||||
public string DeathStatus { get; set; }
|
||||
public string ShenasnameSeri { get; set; }
|
||||
public string ShenasnameSerial { get; set; }
|
||||
public string ShenasnamehNumber { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.AuthorizedPerson;
|
||||
|
||||
public interface IAuthorizedPersonApplication
|
||||
{
|
||||
OperationResult Create(CreateAuthorizedPerson command);
|
||||
OperationResult CreateFromUidResponse(CreateAuthorizedPerson command);
|
||||
AuthorizedPersonViewModel GetByNationalCode(string nationalCode);
|
||||
List<AuthorizedPersonViewModel> Search(string nationalCode = null, string firstName = null, string lastName = null);
|
||||
bool ExistsByNationalCode(string nationalCode);
|
||||
}
|
||||
@@ -160,37 +160,4 @@ public class CreateCheckout
|
||||
public TimeSpan TotalPaidLeave { get; set; }
|
||||
public TimeSpan TotalSickLeave { get; set; }
|
||||
|
||||
public bool HasLeft { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه خام بعد از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double DailySalaryAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پایه سنوات بعد از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double BaseYearAffected { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه قبل از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double DailySalaryUnAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه دریافت شده از سمت فرانت
|
||||
/// </summary>
|
||||
public string DailySalaryUnAffectedStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مزد سالانه نرمال دریافت از سمت فرانت
|
||||
/// </summary>
|
||||
public string NormalDailyWage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پایه سنوات قبل از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double BaseYearUnAffected { get; set; }
|
||||
}
|
||||
@@ -61,23 +61,9 @@ public class ComputingViewModel
|
||||
/// </summary>
|
||||
public TimeSpan EmployeeMandatoryHours { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// پایه سنوات قبل از تاثیر ساعت کار
|
||||
/// مجموع مرخصی های پرسنل در این فیش حقوقی
|
||||
/// </summary>
|
||||
public double BaseYearUnAffected { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// پایه سنوات بعد از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double BaseYearAffected { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه خام بعد از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double DailySalaryAffected { get; set; }
|
||||
|
||||
//public TimeSpan TotalLeaveOnThisCheckout { get; set; }
|
||||
//public List<string> holidays;
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
using CompanyManagment.App.Contracts.YearlySalary;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Contract;
|
||||
/// <summary>
|
||||
/// نمایش نحوه محاسبه پایه سنوات و دستمزد روزانه
|
||||
/// </summary>
|
||||
public class ContractDailyWageAndBaseYearReport
|
||||
{
|
||||
/// <summary>
|
||||
/// لیست داده های محاسبه پایه سنوات
|
||||
/// </summary>
|
||||
public BaseYearDataViewModel BaseYearDataViewModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پایه سنوات متاثر از ساعت کار
|
||||
/// </summary>
|
||||
public string BaseYearAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه متاثر از ساعت کار
|
||||
/// </summary>
|
||||
public string DailySalaryAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه بدون تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public string DailySalaryUnAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه تجمیعی
|
||||
/// </summary>
|
||||
public string DailyWage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ قراداد
|
||||
/// </summary>
|
||||
public string ContractDate { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// نوع دستمزد انتخاب شده
|
||||
/// </summary>
|
||||
public string DailyWageType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست ارتقاء
|
||||
/// </summary>
|
||||
public List<UpgradeManualDailyWageList> UpgradeManualDailyWageLists { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پرسنل
|
||||
/// </summary>
|
||||
public string EmployeeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا با متد جدید محاسبه شده
|
||||
/// </summary>
|
||||
public bool OldComputeMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا محاسبات با مقادیر ذخیره شده مغایرت دارد
|
||||
/// </summary>
|
||||
public bool Contradiction { get; set; }
|
||||
}
|
||||
@@ -140,36 +140,7 @@ public class CreateContract
|
||||
public string ConvertMonth { get; set; }
|
||||
public string FormStep { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه خام بعد از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double DailySalaryAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پایه سنوات بعد از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double BaseYearAffected { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه قبل از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double DailySalaryUnAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پایه سنوات قبل از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double BaseYearUnAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا دستمزد روزانه دستی وارد شده است؟
|
||||
/// </summary>
|
||||
public bool HasManualDailyWage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع دستمزد انتخاب شده
|
||||
/// </summary>
|
||||
public string DailyWageType { get; set; }
|
||||
|
||||
public List<ContractViweModel> Contracts { get; set; }
|
||||
public List<WorkshopViewModel> Workshops { get; set; }
|
||||
public List<EmployerViewModel> Employers { get; set; }
|
||||
|
||||
@@ -7,14 +7,6 @@ namespace CompanyManagment.App.Contracts.Contract;
|
||||
|
||||
public interface IContractApplication
|
||||
{
|
||||
/// <summary>
|
||||
/// دریافت مزد ارتقاء یافته
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="yearlySalaryId"></param>
|
||||
/// <returns></returns>
|
||||
Task<double> GetManualDailWage(long workshopId, long employeeId, long yearlySalaryId, DateTime contractStart);
|
||||
OperationResult Create(CreateContract command);
|
||||
OperationResult CreateNew(createContractModel command);
|
||||
OperationResult Edit(EditContract command);
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Contract;
|
||||
|
||||
/// <summary>
|
||||
/// ویو مدل رتقاء دستمزد روزانه و لیست ارتقاء
|
||||
/// </summary>
|
||||
public class UpgradeManualDailyWageModel
|
||||
{
|
||||
/// <summary>
|
||||
/// دستمزد روزانه
|
||||
/// </summary>
|
||||
public double DailyWage{ get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// لیست ارتقاء
|
||||
/// </summary>
|
||||
public List<UpgradeManualDailyWageList> UpgradeManualDailyWageLists { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// لیست ارتقاء
|
||||
/// </summary>
|
||||
public class UpgradeManualDailyWageList
|
||||
{
|
||||
/// <summary>
|
||||
/// تاریخ شروع و پایان بازه ارتقاء
|
||||
/// </summary>
|
||||
public string StartEndDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه
|
||||
/// </summary>
|
||||
public string DailyWage { get; set; }
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Transactions;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
|
||||
@@ -125,4 +128,282 @@ public interface IEmployerApplication
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
Task<OperationResult> CreateWorkflowRegistration(CreateEmployerWorkflowRegistration command);
|
||||
/// <summary>
|
||||
/// ویرایش کارفرما در گردش کار ثبت نام
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> EditWorkflowRegistration(EditEmployerWorkflowRegistration command);
|
||||
|
||||
/// <summary>
|
||||
/// حذف کارفرما از گردش کار ثبت نام
|
||||
/// </summary>
|
||||
/// <param name="employerId">شناسه کارفرما</param>
|
||||
/// <param name="institutionWorkshopDetailsId">شناسه جزئیات کارگاه موسسه</param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> DeleteWorkflowRegistration(long employerId, long institutionWorkshopDetailsId);
|
||||
|
||||
Task<OperationResult<AuthenticateUserViewModel>> AuthenticateEmployer(string nationalCode, string dateOfBirth, string mobile);
|
||||
}
|
||||
|
||||
public class AuthenticateUserViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// نام
|
||||
/// </summary>
|
||||
public string FName { get; set; }
|
||||
/// <summary>
|
||||
/// نام خانوادگی
|
||||
/// </summary>
|
||||
public string LName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پدر
|
||||
/// </summary>
|
||||
public string FatherName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنسیت
|
||||
/// </summary>
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
|
||||
public string DateOfBirth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سریال شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شماره همراه
|
||||
/// </summary>
|
||||
public string Phone { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// کلاس ثبت کارفرما در گردش کار - شامل اطلاعات کارفرمای حقیقی و حقوقی
|
||||
/// </summary>
|
||||
public class CreateEmployerWorkflowRegistration
|
||||
{
|
||||
/// <summary>
|
||||
/// اطلاعات کارفرمای حقیقی
|
||||
/// </summary>
|
||||
public CreateRealEmployerWorkflowRegistration RealEmployer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات کارفرمای حقوقی
|
||||
/// </summary>
|
||||
public CreateLegalEmployerWorkflowRegistration LegalEmployer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع حقوقی
|
||||
/// </summary>
|
||||
public LegalType LegalType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه جزئیات کارگاه موسسه
|
||||
/// </summary>
|
||||
public long InstitutionWorkshopDetailsId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه قرارداد موسسه
|
||||
/// </summary>
|
||||
public long InstitutionContractId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه طرف قرارداد
|
||||
/// </summary>
|
||||
public long ContractingPartyId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// کلاس ثبت کارفرمای حقوقی در گردش کار - شامل اطلاعات شرکت و مدیرعامل
|
||||
/// </summary>
|
||||
public class CreateLegalEmployerWorkflowRegistration
|
||||
{
|
||||
/// <summary>
|
||||
/// نام شرکت
|
||||
/// </summary>
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره ثبت
|
||||
/// </summary>
|
||||
public string RegisterId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ملی شرکت
|
||||
/// </summary>
|
||||
public string NationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنسیت
|
||||
/// </summary>
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت احراز هویت
|
||||
/// </summary>
|
||||
public bool IsAuth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی مدیرعامل
|
||||
/// </summary>
|
||||
public string CeoNationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه مدیرعامل
|
||||
/// </summary>
|
||||
public string CeoIdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام مدیرعامل
|
||||
/// </summary>
|
||||
public string CeoFName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام خانوادگی مدیرعامل
|
||||
/// </summary>
|
||||
public string CeoLName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پدر مدیرعامل
|
||||
/// </summary>
|
||||
public string CeoFatherName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ تولد مدیرعامل
|
||||
/// </summary>
|
||||
public string CeoDateOfBirth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محل صدور شناسنامه مدیرعامل
|
||||
/// </summary>
|
||||
public string CeoPlaceOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ صدور شناسنامه مدیرعامل
|
||||
/// </summary>
|
||||
public string CeoDateOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره موبایل
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن ثابت
|
||||
/// </summary>
|
||||
public string TelephoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات سیستم دولتی
|
||||
/// </summary>
|
||||
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// کلاس ثبت کارفرمای حقیقی در گردش کار - شامل اطلاعات شخصی کارفرما
|
||||
/// </summary>
|
||||
public class CreateRealEmployerWorkflowRegistration
|
||||
{
|
||||
/// <summary>
|
||||
/// جنسیت
|
||||
/// </summary>
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت احراز هویت
|
||||
/// </summary>
|
||||
public bool IsAuth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام
|
||||
/// </summary>
|
||||
public string FName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام خانوادگی
|
||||
/// </summary>
|
||||
public string LName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پدر
|
||||
/// </summary>
|
||||
public string FatherName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ تولد
|
||||
/// </summary>
|
||||
public string DateOfBirth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره موبایل
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محل صدور شناسنامه
|
||||
/// </summary>
|
||||
public string PlaceOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ صدور شناسنامه
|
||||
/// </summary>
|
||||
public string DateOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات سیستم دولتی
|
||||
/// </summary>
|
||||
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن
|
||||
/// </summary>
|
||||
public string Telephone { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// کلاس ویرایش کارفرما در گردش کار - شامل اطلاعات کارفرمای حقیقی و حقوقی
|
||||
/// </summary>
|
||||
public class EditEmployerWorkflowRegistration : CreateEmployerWorkflowRegistration
|
||||
{
|
||||
/// <summary>
|
||||
/// شناسه کارفرما
|
||||
/// </summary>
|
||||
public long EmployerId { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,29 +1,316 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Security.AccessControl;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// درخواست ایجاد قرارداد نهاد
|
||||
/// </summary>
|
||||
public class CreateInstitutionContractRequest
|
||||
{
|
||||
public List<CreateContactInfo> ContactInfos { get; set; }
|
||||
public long ContractingPartyId { get; set; }
|
||||
/// <summary>
|
||||
/// نوع حقوقی طرف قرارداد (حقیقی یا حقوقی)
|
||||
/// </summary>
|
||||
public LegalType ContractingPartyLegalType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات شخص حقیقی
|
||||
/// </summary>
|
||||
public CreateInstitutionContractRealPartyRequest RealParty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات شخص حقوقی
|
||||
/// </summary>
|
||||
public CreateInstitutionContractLegalPartyRequest LegalParty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیدی معرف
|
||||
/// </summary>
|
||||
public long RepresentativeId { get; set; }
|
||||
public string TypeOfContract { get; set; }
|
||||
public string ContractDateFa { get; set; }
|
||||
public string ContractStartFa { get; set; }
|
||||
public string ContractEndFa { get; set; }
|
||||
public string Address { get; set; }
|
||||
public string State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت زمان قرارداد
|
||||
/// </summary>
|
||||
public InstitutionContractDuration Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// استان
|
||||
/// </summary>
|
||||
public string Province { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شهر
|
||||
/// </summary>
|
||||
public string City { get; set; }
|
||||
public string OfficialCompany { get; set; }
|
||||
public string HasValueAddedTax { get; set; }
|
||||
public string ContractAmountString { get; set; }
|
||||
public string DailyCompenseationString { get; set; }
|
||||
public string ObligationString { get; set; }
|
||||
public string TotalAmountString { get; set; }
|
||||
public string ValueAddedTaxStr { get; set; }
|
||||
public string WorkshopManualCount { get; set; }
|
||||
public string EmployeeManualCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آدرس
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات تماس
|
||||
/// </summary>
|
||||
public List<CreateContactInfo> ContactInfos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارگاههای مورد نظر برای قرارداد
|
||||
/// </summary>
|
||||
public List<CreateInstitutionContractWorkshopDetail> Workshops { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد (فارسی)
|
||||
/// </summary>
|
||||
public string ContractStartFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ خسارت روزانه
|
||||
/// </summary>
|
||||
public double DailyCompensation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وجه التزام
|
||||
/// </summary>
|
||||
public double Obligation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// توضیحات
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
public int ExtensionNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ کل قرارداد
|
||||
/// </summary>
|
||||
public double TotalAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا قرارداد اقساطی است؟
|
||||
/// </summary>
|
||||
public bool IsInstallment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مالیات ارزش افزوده
|
||||
/// </summary>
|
||||
public double TaxAmount { get; set; }
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// مدت زمان قرارداد نهاد
|
||||
/// </summary>
|
||||
public enum InstitutionContractDuration
|
||||
{
|
||||
/// <summary>
|
||||
/// یک ماهه
|
||||
/// </summary>
|
||||
OneMonth = 1,
|
||||
|
||||
/// <summary>
|
||||
/// سه ماهه
|
||||
/// </summary>
|
||||
ThreeMonths = 3,
|
||||
|
||||
/// <summary>
|
||||
/// شش ماهه
|
||||
/// </summary>
|
||||
SixMonths = 6,
|
||||
|
||||
/// <summary>
|
||||
/// دوازده ماهه
|
||||
/// </summary>
|
||||
TwelveMonths = 12
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// جزئیات کارگاه در درخواست ایجاد قرارداد نهاد
|
||||
/// </summary>
|
||||
public class CreateInstitutionContractWorkshopDetail
|
||||
{
|
||||
/// <summary>
|
||||
/// شناسه کارگاه (اختیاری - در صورت وجود کارگاه از قبل)
|
||||
/// </summary>
|
||||
public long? WorkshopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن حضور و غیاب
|
||||
/// </summary>
|
||||
public bool HasRollCallPlan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن فیش غیر رسمی
|
||||
/// </summary>
|
||||
public bool HasCustomizeCheckoutPlan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن قرارداد و تصفیه
|
||||
/// </summary>
|
||||
public bool HasContractPlan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن قرارداد و تصفیه حضوری
|
||||
/// </summary>
|
||||
public bool HasContractPlanInPerson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پلن بیمه
|
||||
/// </summary>
|
||||
public bool HasInsurancePlan { get; set; }
|
||||
/// <summary>
|
||||
/// پلن بیمه حضوری
|
||||
/// </summary>
|
||||
public bool HasInsurancePlanInPerson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد پرسنل کارگاه
|
||||
/// </summary>
|
||||
public int PersonnelCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ
|
||||
/// </summary>
|
||||
public double Price { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// درخواست ایجاد طرف حقیقی در قرارداد نهاد
|
||||
/// </summary>
|
||||
public class CreateInstitutionContractRealPartyRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ تولد فارسی
|
||||
/// </summary>
|
||||
public string BirthDateFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت احراز هویت
|
||||
/// </summary>
|
||||
public bool IsAuth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام
|
||||
/// </summary>
|
||||
public string FName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام خانوادگی
|
||||
/// </summary>
|
||||
public string LName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پدر
|
||||
/// </summary>
|
||||
public string FatherName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه موقت طرف قرارداد
|
||||
/// </summary>
|
||||
public long ContractingPartyTempId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنسیت
|
||||
/// </summary>
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// درخواست ایجاد طرف حقوقی در قرارداد نهاد
|
||||
/// </summary>
|
||||
public class CreateInstitutionContractLegalPartyRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// نام شرکت
|
||||
/// </summary>
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره ثبت
|
||||
/// </summary>
|
||||
public string RegisterId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ملی شرکت
|
||||
/// </summary>
|
||||
public string NationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن شرکت
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه موقت طرف قرارداد
|
||||
/// </summary>
|
||||
public long ContractingPartyTempId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی نماینده قانونی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ تولد نماینده قانونی فارسی
|
||||
/// </summary>
|
||||
public string BirthDateFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام نماینده قانونی
|
||||
/// </summary>
|
||||
public string FName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام خانوادگی نماینده قانونی
|
||||
/// </summary>
|
||||
public string LName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پدر نماینده قانونی
|
||||
/// </summary>
|
||||
public string FatherName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه نماینده قانونی
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت احراز هویت نماینده قانونی
|
||||
/// </summary>
|
||||
public bool IsAuth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سمت نماینده قانونی در شرکت
|
||||
/// </summary>
|
||||
public string Position { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنسیت نماینده قانونی
|
||||
/// </summary>
|
||||
public Gender Gender { get; set; }
|
||||
}
|
||||
@@ -3,4 +3,5 @@ namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
public class EditInstitutionContractRequest:CreateInstitutionContractRequest
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long ContractingPartyId { get; set; }
|
||||
}
|
||||
@@ -77,10 +77,12 @@ public class GetInstitutionContractListItemsViewModel
|
||||
/// <summary>
|
||||
/// وضعیت قرارداد
|
||||
/// </summary>
|
||||
public InstitutionContractStatus Status { get; set; }
|
||||
public InstitutionContractListStatus ListStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا منقضی شده است
|
||||
/// </summary>
|
||||
public bool IsExpired { get; set; }
|
||||
|
||||
public long ContractingPartyId { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
@@ -10,53 +11,149 @@ using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
/// <summary>
|
||||
/// رابط اپلیکیشن قراردادهای مؤسسه
|
||||
/// مدیریت عملیات مربوط به قراردادهای مالی مؤسسات
|
||||
/// </summary>
|
||||
public interface IInstitutionContractApplication
|
||||
{
|
||||
/// <summary>
|
||||
/// ایجاد قرارداد جدید
|
||||
/// </summary>
|
||||
/// <param name="command">اطلاعات قرارداد جدید</param>
|
||||
/// <returns>نتیجه عملیات</returns>
|
||||
OperationResult Create(CreateInstitutionContract command);
|
||||
|
||||
/// <summary>
|
||||
/// تمدید قرارداد موجود
|
||||
/// </summary>
|
||||
/// <param name="command">اطلاعات قرارداد برای تمدید</param>
|
||||
/// <returns>نتیجه عملیات</returns>
|
||||
OperationResult Extension(CreateInstitutionContract command);
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش قرارداد موجود
|
||||
/// </summary>
|
||||
/// <param name="command">اطلاعات جدید قرارداد</param>
|
||||
/// <returns>نتیجه عملیات</returns>
|
||||
OperationResult Edit(EditInstitutionContract command);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت جزئیات قرارداد برای ویرایش
|
||||
/// </summary>
|
||||
/// <param name="id">شناسه قرارداد</param>
|
||||
/// <returns>اطلاعات قرارداد</returns>
|
||||
EditInstitutionContract GetDetails(long id);
|
||||
|
||||
/// <summary>
|
||||
/// جستجو در قراردادها
|
||||
/// </summary>
|
||||
/// <param name="searchModel">مدل جستجو</param>
|
||||
/// <returns>لیست قراردادها</returns>
|
||||
List<InstitutionContractViewModel> Search(InstitutionContractSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// جستجوی جدید در قراردادها
|
||||
/// </summary>
|
||||
/// <param name="searchModel">مدل جستجو</param>
|
||||
/// <returns>لیست قراردادها</returns>
|
||||
List<InstitutionContractViewModel> NewSearch(InstitutionContractSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت اطلاعات قزداد های مالی فعال
|
||||
/// دریافت اطلاعات قرارداد های مالی فعال
|
||||
///دارای کارگاه
|
||||
/// جهت ست کردن سرویس ها از طریق اکسل
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<InstitutionContractViewModel> GetInstitutionContractToSetServicesExcelImport();
|
||||
|
||||
/// <summary>
|
||||
/// چاپ مجموعه قراردادها
|
||||
/// </summary>
|
||||
/// <param name="id">لیست شناسه قراردادها</param>
|
||||
/// <returns>لیست قراردادها برای چاپ</returns>
|
||||
List<InstitutionContractViewModel> PrintAll(List<long> id);
|
||||
|
||||
/// <summary>
|
||||
/// چاپ یک قرارداد
|
||||
/// </summary>
|
||||
/// <param name="id">شناسه قرارداد</param>
|
||||
/// <returns>اطلاعات قرارداد برای چاپ</returns>
|
||||
InstitutionContractViewModel PrintOne(long id);
|
||||
|
||||
/// <summary>
|
||||
/// فعال کردن قرارداد
|
||||
/// </summary>
|
||||
/// <param name="id">شناسه قرارداد</param>
|
||||
/// <returns>نتیجه عملیات</returns>
|
||||
OperationResult Active(long id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// غیرفعال کردن قرارداد
|
||||
/// </summary>
|
||||
/// <param name="id">شناسه قرارداد</param>
|
||||
/// <returns>نتیجه عملیات</returns>
|
||||
OperationResult DeActive(long id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// غیرفعال کردن قرارداد (حالت آبی)
|
||||
/// </summary>
|
||||
/// <param name="id">شناسه قرارداد</param>
|
||||
/// <returns>نتیجه عملیات</returns>
|
||||
OperationResult DeActiveBlue(long id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// غیرفعال کردن تمام اتصالات قرارداد
|
||||
/// </summary>
|
||||
/// <param name="id">شناسه قرارداد</param>
|
||||
/// <returns>نتیجه عملیات</returns>
|
||||
OperationResult DeActiveAllConnections(long id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// فعال کردن مجدد تمام اتصالات قرارداد
|
||||
/// </summary>
|
||||
/// <param name="id">شناسه قرارداد</param>
|
||||
/// <returns>نتیجه عملیات</returns>
|
||||
OperationResult ReActiveAllConnections(long id);
|
||||
|
||||
/// <summary>
|
||||
/// فعال کردن مجدد تمام قراردادها بعد از ایجاد قرارداد جدید
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyId">شناسه طرف قرارداد</param>
|
||||
void ReActiveAllAfterCreateNew(long contractingPartyId);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// حذف قرارداد
|
||||
/// </summary>
|
||||
/// <param name="id">شناسه قرارداد</param>
|
||||
void RemoveContract(long id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// امضای قرارداد
|
||||
/// </summary>
|
||||
/// <param name="id">شناسه قرارداد</param>
|
||||
/// <returns>نتیجه عملیات</returns>
|
||||
OperationResult Sign(long id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// لغو امضای قرارداد
|
||||
/// </summary>
|
||||
/// <param name="id">شناسه قرارداد</param>
|
||||
/// <returns>نتیجه عملیات</returns>
|
||||
OperationResult UnSign(long id);
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد حساب کاربری برای طرف قرارداد
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyid">شناسه طرف قرارداد</param>
|
||||
/// <param name="accountId">شناسه حساب کاربری</param>
|
||||
void CreateContractingPartyAccount(long contractingPartyid, long accountId);
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه مبلغ قرارداد بر اساس تعداد افراد
|
||||
/// </summary>
|
||||
/// <param name="countPerson">تعداد افراد</param>
|
||||
/// <returns>مبلغ قرارداد</returns>
|
||||
double GetcontractAmount(int countPerson);
|
||||
|
||||
#region Api
|
||||
@@ -82,12 +179,14 @@ public interface IInstitutionContractApplication
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateAsync(CreateInstitutionContractRequest command);
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> EditAsync(EditInstitutionContractRequest command);
|
||||
|
||||
/// <summary>
|
||||
/// تمدید قرارداد
|
||||
/// </summary>
|
||||
@@ -95,39 +194,108 @@ public interface IInstitutionContractApplication
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> ExtensionَAsync(CreateInstitutionContractRequest command);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست طرف حساب هایی که ثبت نام آنها تکمیل شده
|
||||
/// جهت نمایش در کارپوشه
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<RegistrationWorkflowMainListViewModel>> RegistrationWorkflowMainList();
|
||||
/// <summary>
|
||||
/// دریافت آیتم های کارپوشه ثبت نام
|
||||
/// </summary>
|
||||
/// <param name="institutionContractId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<RegistrationWorkflowItemsViewModel>> RegistrationWorkflowItems(long institutionContractId);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class GetInstitutionContractListStatsViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the total outstanding debt of institution contracts.
|
||||
/// This property aggregates the liabilities of the respective contracts and provides
|
||||
/// a single metric to measure financial obligations.
|
||||
/// مجموع بدهی قراردادهای مؤسسه
|
||||
/// این ویژگی بدهیهای قراردادهای مربوطه را تجمیع میکند و
|
||||
/// یک معیار واحد برای اندازهگیری تعهدات مالی ارائه میدهد
|
||||
/// </summary>
|
||||
public double TotalDebt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents the total monetary value associated with institution contracts.
|
||||
/// This property consolidates the aggregate amount from relevant contracts
|
||||
/// for financial reporting and analysis.
|
||||
/// مجموع ارزش پولی مرتبط با قراردادهای مؤسسه
|
||||
/// این ویژگی مبلغ کل قراردادهای مربوطه را برای
|
||||
/// گزارشگیری و تجزیه و تحلیل مالی تجمیع میکند
|
||||
/// </summary>
|
||||
public double TotalAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of counts for institution contracts categorized by their status.
|
||||
/// This property provides the count of contracts for each status defined in the
|
||||
/// InstitutionContractStatus enumeration, enabling analysis and monitoring of contract distribution.
|
||||
/// مجموعهای از تعداد قراردادهای مؤسسه دستهبندی شده بر اساس وضعیت
|
||||
/// این ویژگی تعداد قراردادها را برای هر وضعیت تعریف شده در
|
||||
/// شمارش InstitutionContractStatus ارائه میدهد که امکان تجزیه و تحلیل و نظارت بر توزیع قراردادها را فراهم میکند
|
||||
/// </summary>
|
||||
public List<InstitutionContractStatusCount> Counts { get; set; }
|
||||
public List<InstitutionContractStatusCount> Counts { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// شمارش وضعیت قراردادهای مؤسسه
|
||||
/// نمایش تعداد قراردادها برای هر وضعیت خاص
|
||||
/// </summary>
|
||||
public class InstitutionContractStatusCount
|
||||
{
|
||||
public InstitutionContractStatus Status { get; set; }
|
||||
/// <summary>
|
||||
/// وضعیت لیست قرارداد
|
||||
/// </summary>
|
||||
public InstitutionContractListStatus ListStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد قراردادها در این وضعیت
|
||||
/// </summary>
|
||||
public int Count { get; set; }
|
||||
}
|
||||
public class ExtenstionInstitutionContractRequest:EditInstitutionContractRequest
|
||||
|
||||
/// <summary>
|
||||
/// درخواست تمدید قرارداد مؤسسه
|
||||
/// شامل اطلاعات قرارداد قبلی برای فرآیند تمدید
|
||||
/// </summary>
|
||||
public class ExtenstionInstitutionContractRequest : EditInstitutionContractRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// شناسه قرارداد قبلی که قرار است تمدید شود
|
||||
/// </summary>
|
||||
public long PreviousContractId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// مدل نمایش اقساط قرارداد مؤسسه
|
||||
/// شامل اطلاعات مربوط به هر قسط از قرارداد
|
||||
/// </summary>
|
||||
public class InstitutionContractInstallmentViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// شناسه یکتای قسط
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ میلادی قسط
|
||||
/// </summary>
|
||||
public DateTime InstallmentDateGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ فارسی قسط
|
||||
/// </summary>
|
||||
public string InstallmentDateFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ قسط
|
||||
/// </summary>
|
||||
public double Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// توضیحات قسط
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه قرارداد مؤسسه مربوط به این قسط
|
||||
/// </summary>
|
||||
public long InstitutionContractId { get; set; }
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class InstitutionContractListSearchModel :PaginationRequest
|
||||
/// <summary>
|
||||
/// تب
|
||||
/// </summary>
|
||||
public InstitutionContractStatus? Status { get; set; }
|
||||
public InstitutionContractListStatus? Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// فعال / غیرفعال
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
public enum InstitutionContractStatus
|
||||
public enum InstitutionContractListStatus
|
||||
{
|
||||
Active,
|
||||
Deactive,
|
||||
@@ -8,5 +8,5 @@ public enum InstitutionContractStatus
|
||||
Block,
|
||||
Free,
|
||||
PendingForRenewal,
|
||||
WithoutWorkshop,
|
||||
WithoutWorkshop
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
public class RegistrationWorkflowMainListViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// شناسه قرارداد موسسه
|
||||
/// </summary>
|
||||
public long InstitutionContractId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کامل طرف حساب
|
||||
/// </summary>
|
||||
public string ContractingPartyFullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره همراه
|
||||
/// </summary>
|
||||
public string Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد کارگاههای انجام شده
|
||||
/// </summary>
|
||||
public int DoneWorkshops { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد کارگاههای انجام نشده
|
||||
/// </summary>
|
||||
public int UnDoneWorkshops { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد کل کارگاهها
|
||||
/// </summary>
|
||||
public int TotalWorkshops { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ
|
||||
/// </summary>
|
||||
public double Amount { get; set; }
|
||||
|
||||
public long ContractingPartyId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// مدل نمایش آیتمهای گردش کار ثبت نام
|
||||
/// </summary>
|
||||
public class RegistrationWorkflowItemsViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// لیست کارفرمایان
|
||||
/// </summary>
|
||||
public List<RegistrationWorkflowItemsEmployerViewModel> Employers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد پرسنل
|
||||
/// </summary>
|
||||
public int PersonnelCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// قیمت
|
||||
/// </summary>
|
||||
public double Price { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت انجام شدن
|
||||
/// </summary>
|
||||
public bool IsDone { get; set; }
|
||||
|
||||
public long WorkshopDetailsId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// مدل نمایش کارفرما در آیتمهای گردش کار ثبت نام
|
||||
/// </summary>
|
||||
public class RegistrationWorkflowItemsEmployerViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// نام و نام خانوادگی
|
||||
/// </summary>
|
||||
public string FullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
}
|
||||
37
CompanyManagment.App.Contracts/Law/ILawApplication.cs
Normal file
37
CompanyManagment.App.Contracts/Law/ILawApplication.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using _0_Framework.Application;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.AccessControl;
|
||||
using System.Threading.Tasks;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Law
|
||||
{
|
||||
public interface ILawApplication
|
||||
{
|
||||
OperationResult Create(CreateLaw command);
|
||||
OperationResult Edit(EditLaw command);
|
||||
OperationResult Activate(long id);
|
||||
OperationResult Deactivate(long id);
|
||||
OperationResult ActivateByType(LawType type);
|
||||
OperationResult DeactivateByType(LawType type);
|
||||
EditLaw GetDetails(long id);
|
||||
Task<List<LawViewModel>> GetList(LawSearchModel searchModel);
|
||||
Task<LawViewModel> GetLawWithItems(long id);
|
||||
Task<LawViewModel> GetLawByType(LawType type);
|
||||
OperationResult UpsertLaw(EditLaw command);
|
||||
}
|
||||
|
||||
public class LawSearchModel
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string Text { get; set; }
|
||||
}
|
||||
|
||||
public enum LawType
|
||||
{
|
||||
/// <summary>
|
||||
/// ثبت نام
|
||||
/// </summary>
|
||||
Register
|
||||
}
|
||||
}
|
||||
47
CompanyManagment.App.Contracts/Law/LawViewModel.cs
Normal file
47
CompanyManagment.App.Contracts/Law/LawViewModel.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Law
|
||||
{
|
||||
public class LawViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public List<LawItemViewModel> Items { get; set; }
|
||||
public LawType Type { get; set; }
|
||||
public string HeadTitle { get; set; }
|
||||
public List<string> Notifications { get; set; }
|
||||
}
|
||||
|
||||
public class LawItemViewModel
|
||||
{
|
||||
public string Header { get; set; }
|
||||
public string Details { get; set; }
|
||||
// public int OrderNumber { get; set; }
|
||||
}
|
||||
|
||||
public class CreateLaw
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public List<LawItemViewModel> Items { get; set; }
|
||||
public LawType Type { get; set; }
|
||||
public string HeadTitle { get; set; }
|
||||
public List<string> Notifications { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class EditLaw
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
public List<LawItemViewModel> Items { get; set; }
|
||||
public LawType Type { get; set; }
|
||||
public string HeadTitle { get; set; }
|
||||
public List<string> Notifications { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -37,5 +37,4 @@ public class CreateLeave
|
||||
public List<CustomizeRotatingShiftsViewModel> RotatingShifts { get; set; }
|
||||
public bool HasRollCall { get; set; }
|
||||
public CustomizeRotatingShiftsViewModel SelectedShift { get; set; }
|
||||
public bool IsInvallid { get; set; }
|
||||
}
|
||||
@@ -14,8 +14,5 @@ namespace CompanyManagment.App.Contracts.Leave
|
||||
public string LeftWorlErrMessage { get; set; }
|
||||
public bool HasNotContract { get; set; }
|
||||
public string ContractErrMessage { get; set; }
|
||||
|
||||
public bool HasHolidayError { get; set; }
|
||||
public string HolidayErrorMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,5 +27,4 @@ public class LeavePrintViewModel
|
||||
public string MonthGr { get; set; }
|
||||
public int PrintCounter { get; set; }
|
||||
public List<EmprViewModel> EmployerList { get; set; }
|
||||
public bool IsInvalid { get; set; }
|
||||
}
|
||||
|
||||
@@ -20,5 +20,4 @@ public class LeaveSearchModel
|
||||
public int Year { get; set; }
|
||||
public int Month { get; set; }
|
||||
public int PageIndex { get; set; }
|
||||
public bool IsInvalid { get; set; }
|
||||
}
|
||||
@@ -27,5 +27,4 @@ public class LeaveViewModel
|
||||
|
||||
public TimeSpan ShiftDuration { get; set; }
|
||||
public bool HasShiftDuration { get; set; }
|
||||
public bool IsInvalid { get; set; }
|
||||
}
|
||||
@@ -8,8 +8,7 @@ namespace CompanyManagment.App.Contracts.RollCall;
|
||||
public interface IRollCallMandatoryApplication
|
||||
{
|
||||
bool HasRollCallRecord(long employeeId, long workshopId, DateTime contractStart);
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute, double dailyWageUnAffected, bool totalLeaveCompute);
|
||||
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute, bool totalLeaveCompute);
|
||||
|
||||
/// <summary>
|
||||
/// گزارش نوبت کاری حضور غیاب
|
||||
|
||||
@@ -67,7 +67,7 @@ public class CreateInstitutionContractTemp
|
||||
/// -
|
||||
/// Completed ثبت نام تکمیل شده
|
||||
/// </summary>
|
||||
public string RegistrationStatus { get; set; }
|
||||
public InstitutionContractTempStatus RegistrationStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی پیامک ارسال شده
|
||||
|
||||
@@ -16,20 +16,7 @@ public class CreateWorkshopTemp
|
||||
/// ای دی طرف حساب
|
||||
/// </summary>
|
||||
public long ContractingPartyTempId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جمع کل مبالغ سرویس ها برای کارگاه
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double WorkshopServicesAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جمع کل مبالغ سرویس ها برای کارگاه
|
||||
/// فارسی
|
||||
/// </summary>
|
||||
public string WorkshopServicesAmountStr { get; set; }
|
||||
|
||||
|
||||
|
||||
#region ServiceSelection
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
@@ -16,7 +19,7 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// <param name="mobile"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult<ContractingPartyTempViewModel>> CreateContractingPartyTemp(string nationalCode, string dateOfBirth, string mobile);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// تکمیل اطلاعات
|
||||
/// </summary>
|
||||
@@ -52,11 +55,25 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// دریافت مبالغ بررسی و پرداخت
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <param name="periodModel"></param>
|
||||
/// <param name="duration"></param>
|
||||
/// <param name="paymentModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId,
|
||||
string periodModel = "12", string paymentModel = "OneTime", string contractStartType = "currentMonth");
|
||||
InstitutionContractDuration duration = InstitutionContractDuration.TwelveMonths, string paymentModel = "OneTime", string contractStartType = "currentMonth");
|
||||
|
||||
/// <summary>
|
||||
/// دریافت مبالغ بررسی و پرداخت با لیست کارگاه ها
|
||||
/// این متد برای زمانی است که کارگاه ها در مرحله ثبت نام موقت هستند
|
||||
/// و هنوز در دیتابیس ثبت نشده اند
|
||||
/// </summary>
|
||||
/// <param name="totalPaymentMonth"></param>
|
||||
/// <param name="duration"></param>
|
||||
/// <param name="hasInPersonContract"></param>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <param name="paymentModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(double totalPaymentMonth,
|
||||
InstitutionContractDuration duration , bool hasInPersonContract);
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد یا ویرایش قرارداد موقت
|
||||
@@ -94,10 +111,14 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> PayOffCompleted(long contractingPartyTempId);
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست طرف حساب هایی که ثبت نام آنها تکمیل شده
|
||||
/// جهت نمایش در کارپوشه
|
||||
/// ارسال لینک تایید قوانین و مقررات به طرف حساب
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<RegistrationWorkflowMainList>> RegistrationWorkflowMainList();
|
||||
}
|
||||
Task<OperationResult> SendAgreementLink(long contractingPartyTempId);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,4 +3,14 @@
|
||||
public class InstitutionContractTempViewModel : CreateInstitutionContractTemp
|
||||
{
|
||||
public long Id { get; set; }
|
||||
}
|
||||
|
||||
public enum InstitutionContractTempStatus
|
||||
{
|
||||
BeforeSendVerifyCode,
|
||||
VerifyCodeSent,
|
||||
PendingToCompletion,
|
||||
ReceivedCodeFromClient,
|
||||
Completed
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
public class RegistrationWorkflowMainList
|
||||
{
|
||||
/// <summary>
|
||||
/// آی دی طرف حساب ثبت شده موقت
|
||||
/// </summary>
|
||||
public long ContractingPartyTempId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// نام کامل طرف حساب
|
||||
/// </summary>
|
||||
public string ContractingPartyFullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره همراه
|
||||
/// </summary>
|
||||
public string Phone { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,30 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
public class ReviewAndPaymentViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// جمع کل
|
||||
/// double
|
||||
/// </summary>
|
||||
public double SumOfWorkshopsPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جمع کل
|
||||
/// string
|
||||
/// تخفیف
|
||||
/// </summary>
|
||||
public string SumOfWorkshopsPaymentPaymentStr { get; set; }
|
||||
|
||||
|
||||
|
||||
public string Discount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// Double
|
||||
/// مقدار جمع مبلغ کارگاه ها
|
||||
/// </summary>
|
||||
public double OneTimeWithoutTaxPaymentDouble { get; set; }
|
||||
public string SumOfWorkshopsPayment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
@@ -32,118 +24,44 @@ public class ReviewAndPaymentViewModel
|
||||
/// </summary>
|
||||
public string OneTimeWithoutTaxPaymentStr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double OneTimeTotalPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// string
|
||||
/// </summary>
|
||||
public string OneTimeTotalPaymentStr { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double MonthlyWithoutTaxPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// مبلغ پرداخت بدون مالیات ماهانه
|
||||
/// string
|
||||
/// </summary>
|
||||
public string MonthlyWithoutTaxPaymentStr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double MonthlyTotalPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// string
|
||||
/// مبلغ پرداخت کامل ماهانه
|
||||
/// string
|
||||
/// </summary>
|
||||
public string MonthlyTotalPaymentStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مالیات بر ارزش افزوده
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double ValueAddedTaxDouble { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مالیات بر ارزش افزوده
|
||||
/// string
|
||||
/// </summary>
|
||||
public string ValueAddedTaxSt { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// بازه قرداد
|
||||
/// با عدد مشخص میشود
|
||||
/// مثلا یک ماه عدد 1
|
||||
/// </summary>
|
||||
public string PeriodModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// OneTime پرداخت یکجا
|
||||
/// -
|
||||
/// Monthly پرداخت ماهانه
|
||||
/// </summary>
|
||||
public string PaymentModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارگاه های ایجاد شده
|
||||
/// </summary>
|
||||
public List<WorkshopTempViewModel> WorkshopTempViewList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی طرف حساب
|
||||
/// </summary>
|
||||
public long ContractingPartTempId { get; set; }
|
||||
public string ValueAddedTaxStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست اقساط ماهیانه
|
||||
/// </summary>
|
||||
public List<MonthlyInstallment> MonthlyInstallments { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شروع قرارداد - شمسی
|
||||
/// </summary>
|
||||
public string ContractStartFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه جاری
|
||||
/// -
|
||||
/// شمسی
|
||||
/// شروع قرارداد - میلادی
|
||||
/// </summary>
|
||||
public string ContractStartCurrentMonthFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه جاری
|
||||
/// -
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractStartCurrentMonthGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه بعد
|
||||
/// -
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string ContractStartNextMonthFa{ get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه بعد
|
||||
/// -
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractStartNextMonthGr { get; set; }
|
||||
public DateTime ContractStartGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان قرارداد
|
||||
@@ -158,4 +76,8 @@ public class ReviewAndPaymentViewModel
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string ContractEndFa { get; set; }
|
||||
|
||||
public string DailyCompensation { get; set; }
|
||||
public string Obligation { get; set; }
|
||||
public string DiscountedAmountForOneMonth { get; set; }
|
||||
}
|
||||
@@ -3,4 +3,16 @@
|
||||
public class WorkshopTempViewModel : CreateWorkshopTemp
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جمع کل مبالغ سرویس ها برای کارگاه
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double WorkshopServicesAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جمع کل مبالغ سرویس ها برای کارگاه
|
||||
/// فارسی
|
||||
/// </summary>
|
||||
public string WorkshopServicesAmountStr { get; set; }
|
||||
}
|
||||
@@ -311,9 +311,4 @@ public class CreateWorkingHoursTemp
|
||||
public string WeeklyWorkingTime { get; set; }
|
||||
public long ContractId { get; set; }
|
||||
public long WorknigHoursId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه قبل از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double DailySalaryUnAffected { get; set; }
|
||||
}
|
||||
@@ -151,5 +151,6 @@ public class CreateWorkshop
|
||||
/// تصفیه حساب بصورت استاتیک محاصبه شود
|
||||
/// </summary>
|
||||
public bool IsStaticCheckout { get; set; }
|
||||
|
||||
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
namespace CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
|
||||
public class AutoExtensionEmployeeListDto
|
||||
{
|
||||
@@ -34,17 +32,6 @@ public class AutoExtensionEmployeeListDto
|
||||
public bool EmployeeHasCreateContract { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه دریافت شده از سمت فرانت
|
||||
/// </summary>
|
||||
public string DailySalaryUnAffectedStr => "0";
|
||||
|
||||
/// <summary>
|
||||
/// مزد سالانه نرمال دریافت از سمت فرانت
|
||||
/// </summary>
|
||||
public string NormalDailyWage => "0";
|
||||
|
||||
|
||||
public string ContarctStart { get; set; }
|
||||
public string ContractEnd { get; set; }
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Workshop;
|
||||
|
||||
@@ -89,4 +90,167 @@ public interface IWorkshopApplication
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
Task<ActionResult<OperationResult>> CreateWorkshopWorkflowRegistration(CreateWorkshopWorkflowRegistration command);
|
||||
}
|
||||
|
||||
public class CreateWorkshopWorkflowRegistration
|
||||
{
|
||||
/// <summary>
|
||||
/// شناس<D8A7><D8B3> جزئیات کارگاه قرارداد مؤسسه
|
||||
/// </summary>
|
||||
public long InstitutionContractWorkshopDetailId { get; set; }
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; set; }
|
||||
/// <summary>
|
||||
/// نام مستعار
|
||||
/// </summary>
|
||||
public string SureName { get; set; }
|
||||
/// <summary>
|
||||
/// نوع مالکیت
|
||||
/// </summary>
|
||||
public string TypeOfOwnership { get; set; }
|
||||
/// <summary>
|
||||
/// کد بایگانی
|
||||
/// </summary>
|
||||
public string ArchiveCode { get; set; }
|
||||
/// <summary>
|
||||
/// نام نماینده
|
||||
/// </summary>
|
||||
public string AgentName { get; set; }
|
||||
/// <summary>
|
||||
/// شناسه طرف قرارداد
|
||||
/// </summary>
|
||||
public long ContractingPartyId { get; set; }
|
||||
/// <summary>
|
||||
/// شهر
|
||||
/// </summary>
|
||||
public string City { get; set; }
|
||||
/// <summary>
|
||||
/// استان
|
||||
/// </summary>
|
||||
public string Province { get; set; }
|
||||
/// <summary>
|
||||
/// آدرس
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
/// <summary>
|
||||
/// شناسه حساب کارشناس ارشد قرارداد
|
||||
/// </summary>
|
||||
public long SeniorContractAccountId { get; set; }
|
||||
/// <summary>
|
||||
/// شناسه حساب کارشناس قرارداد
|
||||
/// </summary>
|
||||
public long JuniorContractAccountId { get; set; }
|
||||
/// <summary>
|
||||
/// شناسه حساب کارشناس ارشد بیمه
|
||||
/// </summary>
|
||||
public long SeniorInsuranceAccountId { get; set; }
|
||||
/// <summary>
|
||||
/// شناسه حساب کارشناس بیمه
|
||||
/// </summary>
|
||||
public long JuniorInsuranceAccountId { get; set; }
|
||||
/// <summary>
|
||||
/// باز بودن در تعطیلات
|
||||
/// </summary>
|
||||
public bool OpenInHolidays { get; set; }
|
||||
/// <summary>
|
||||
/// محاسبه نوبت کاری در فیش حقوقی
|
||||
/// </summary>
|
||||
public bool RotatingShiftCompute { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد قرارداد
|
||||
/// </summary>
|
||||
public bool CreateContract { get; set; }
|
||||
/// <summary>
|
||||
/// امضاء قراداد
|
||||
/// </summary>
|
||||
public bool SignContract { get; set; }
|
||||
/// <summary>
|
||||
/// ایجات تصف<D8B5><D981>ه حساب
|
||||
/// </summary>
|
||||
public bool CreateCheckout { get; set; }
|
||||
/// <summary>
|
||||
/// امضاء تصفیه حساب
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; set; }
|
||||
/// <summary>
|
||||
/// تصفیه حساب بصورت استاتیک محاصبه شود
|
||||
/// </summary>
|
||||
public bool IsStaticCheckout { get; set; }
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; set; }
|
||||
/// <summary>
|
||||
/// سرویس تصفیه حساب سفارشی
|
||||
/// </summary>
|
||||
public string HasCustomizeCheckoutService { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه اضافه کار فیش حقوقی در لیست بیمه
|
||||
/// </summary>
|
||||
public bool InsuranceCheckoutOvertime { get; set; }
|
||||
/// <summary>
|
||||
/// محاسبه حق اولاد در لیست بیمه
|
||||
/// </summary>
|
||||
public bool InsuranceCheckoutFamilyAllowance { get; set; }
|
||||
/// <summary>
|
||||
/// حضور و غیاب رایگان ویژه
|
||||
/// </summary>
|
||||
public string HasRollCallFreeVip { get; set; }
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// </summary>
|
||||
public string ContractTerm { get; set; }
|
||||
/// <summary>
|
||||
/// مخفی کردن کل پرداخت
|
||||
/// </summary>
|
||||
public bool TotalPaymentHide { get; set; }
|
||||
/// <summary>
|
||||
/// نوع ارسال بیمه
|
||||
/// </summary>
|
||||
public string TypeOfInsuranceSend { get; set; }
|
||||
/// <summary>
|
||||
/// کد بیمه
|
||||
/// </summary>
|
||||
public string InsuranceCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مشمول دستمزد مقطوع
|
||||
/// </summary>
|
||||
public bool FixedSalary { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// صنف
|
||||
/// </summary>
|
||||
public long InsuranceJobId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جمعیت شهر
|
||||
/// </summary>
|
||||
public string Population { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تماس نماینده کارگاه
|
||||
/// </summary>
|
||||
public string AgentPhone { get; set; }
|
||||
|
||||
public string TypeOfContract { get; set; }
|
||||
/// <summary>
|
||||
/// ردیف پیمان
|
||||
/// </summary>
|
||||
public string AgreementNumber { get; set; }
|
||||
|
||||
public string ComputeOptions { get; set; }
|
||||
public bool AddYearsPay { get; set; }
|
||||
public bool AddLeavePay { get; set; }
|
||||
public string BonusesOptions { get; set; }
|
||||
public string YearsOptions { get; set; }
|
||||
}
|
||||
@@ -38,46 +38,6 @@ public class createContractModel
|
||||
|
||||
public long YearlySalaryId { get; set; }
|
||||
public long EmployerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه خام بعد از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double DailySalaryAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پایه سنوات بعد از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double BaseYearAffected { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه قبل از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double DailySalaryUnAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد روزانه دریافت شده از سمت فرانت
|
||||
/// </summary>
|
||||
public string DailySalaryUnAffectedStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مزد سالانه نرمال دریافت از سمت فرانت
|
||||
/// </summary>
|
||||
public string NormalDailyWage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پایه سنوات قبل از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double BaseYearUnAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا دستمزد روزانه دستی وارد شده است؟
|
||||
/// </summary>
|
||||
public bool HasManualDailyWage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع دستمزد انتخاب شده
|
||||
/// </summary>
|
||||
public string DailyWageType { get; set; }
|
||||
|
||||
|
||||
}
|
||||
@@ -24,11 +24,6 @@ public class BaseYearDataViewModel
|
||||
/// </summary>
|
||||
public double BaseYearResult { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اولین روز شروع بکار
|
||||
/// </summary>
|
||||
public string FirstWorkDayInLeftWork { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست تمام پایه سنوات های محاسبه شده
|
||||
/// </summary>
|
||||
@@ -69,29 +64,4 @@ public class BaseYearDataList
|
||||
/// سالی که در آن پایه سنوات تعلق گرفته
|
||||
/// </summary>
|
||||
public string Year { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///روزی که پایه سنوات تعلق گرفته
|
||||
///یا شروع بکار. ترک کار
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string BaseYearPayDay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// روزی که پایه سنوات تعلق گرفته
|
||||
///یا شروع بکار. ترک کار
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime BaseYearPayDayGr { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// آیا تاریخ شروع بکار دارد
|
||||
/// </summary>
|
||||
public bool HasStartWork { get; set; }
|
||||
/// <summary>
|
||||
/// آیا تاریخ پایان کار دارد
|
||||
/// </summary>
|
||||
public bool HasLeftWork { get; set; }
|
||||
}
|
||||
@@ -2,9 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.Holiday;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.YearlySalary;
|
||||
|
||||
@@ -16,35 +14,6 @@ public interface IYearlySalaryApplication
|
||||
OperationResult Err();
|
||||
EditYearlySalary GetDetails(long id);
|
||||
List<YearlySalaryViewModel> GetYearlySalary();
|
||||
|
||||
/// <summary>
|
||||
/// متد ارتقاء مزد دلخواه
|
||||
/// </summary>
|
||||
/// <param name="newContractStart"></param>
|
||||
/// <param name="lastContractStart"></param>
|
||||
/// <param name="lastContractManualDailyWage"></param>
|
||||
/// <returns></returns>
|
||||
Task<UpgradeManualDailyWageModel> UpgradeManualDailyWage(DateTime newContractStart, DateTime lastContractStart,
|
||||
double lastContractManualDailyWage);
|
||||
|
||||
/// <summary>
|
||||
/// متد محاسبه پایه سنوات و لیست پایه سنوات های پرسنل
|
||||
/// </summary>
|
||||
/// <param name="contractStart"></param>
|
||||
/// <param name="contractEnd"></param>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="leftWorkList"></param>
|
||||
/// <returns></returns>
|
||||
Task<BaseYearDataViewModel> BaseYearComputeByContractId(long contractId);
|
||||
/// <summary>
|
||||
/// دریافت مزد روزانه بر اساس تاریخ شروع و پایان
|
||||
/// </summary>
|
||||
/// <param name="start"></param>
|
||||
/// <param name="end"></param>
|
||||
/// <returns></returns>
|
||||
Task<(double dailyWage, long yearlySalaryId)> GetDailyWageByStartEnd(DateTime start, DateTime end);
|
||||
|
||||
List<YearlySalaryViewModel> Search(YearlySalarySearchModel searchModel);
|
||||
EditYearlySalary GetDetailsBySearchModel(YearlySalarySearchModel searchModel);
|
||||
|
||||
|
||||
119
CompanyManagment.Application/AuthorizedPersonApplication.cs
Normal file
119
CompanyManagment.Application/AuthorizedPersonApplication.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.AuthorizedPersonAgg;
|
||||
using CompanyManagment.App.Contracts.AuthorizedPerson;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class AuthorizedPersonApplication : IAuthorizedPersonApplication
|
||||
{
|
||||
private readonly IAuthorizedPersonRepository _authorizedPersonRepository;
|
||||
|
||||
public AuthorizedPersonApplication(IAuthorizedPersonRepository authorizedPersonRepository)
|
||||
{
|
||||
_authorizedPersonRepository = authorizedPersonRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateAuthorizedPerson command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
if (_authorizedPersonRepository.ExistsByNationalCode(command.NationalCode))
|
||||
return operation.Failed("شخص با این کد ملی قبلاً ثبت شده است");
|
||||
|
||||
var authorizedPerson = new AuthorizedPerson(
|
||||
command.NationalCode, command.FirstName, command.LastName,
|
||||
command.FatherName, command.BirthDate, command.Gender,
|
||||
command.DeathStatus, command.ShenasnameSeri,
|
||||
command.ShenasnameSerial, command.ShenasnamehNumber);
|
||||
|
||||
_authorizedPersonRepository.Create(authorizedPerson);
|
||||
_authorizedPersonRepository.SaveChanges();
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult CreateFromUidResponse(CreateAuthorizedPerson command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
var existingPerson = _authorizedPersonRepository.GetByNationalCode(command.NationalCode);
|
||||
if (existingPerson != null)
|
||||
{
|
||||
existingPerson.UpdatePersonalInfo(command.FirstName, command.LastName,
|
||||
command.FatherName, command.Gender, command.DeathStatus);
|
||||
_authorizedPersonRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
var authorizedPerson = new AuthorizedPerson(
|
||||
command.NationalCode, command.FirstName, command.LastName,
|
||||
command.FatherName, command.BirthDate, command.Gender,
|
||||
command.DeathStatus, command.ShenasnameSeri,
|
||||
command.ShenasnameSerial, command.ShenasnamehNumber);
|
||||
|
||||
_authorizedPersonRepository.Create(authorizedPerson);
|
||||
_authorizedPersonRepository.SaveChanges();
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public AuthorizedPersonViewModel GetByNationalCode(string nationalCode)
|
||||
{
|
||||
var authorizedPerson = _authorizedPersonRepository.GetByNationalCode(nationalCode);
|
||||
if (authorizedPerson == null) return null;
|
||||
|
||||
return new AuthorizedPersonViewModel
|
||||
{
|
||||
Id = authorizedPerson.id,
|
||||
NationalCode = authorizedPerson.NationalCode,
|
||||
FirstName = authorizedPerson.FirstName,
|
||||
LastName = authorizedPerson.LastName,
|
||||
FatherName = authorizedPerson.FatherName,
|
||||
BirthDate = authorizedPerson.BirthDate,
|
||||
Gender = authorizedPerson.Gender,
|
||||
DeathStatus = authorizedPerson.DeathStatus,
|
||||
ShenasnameSeri = authorizedPerson.ShenasnameSeri,
|
||||
ShenasnameSerial = authorizedPerson.ShenasnameSerial,
|
||||
ShenasnamehNumber = authorizedPerson.ShenasnamehNumber,
|
||||
IsVerified = authorizedPerson.IsVerified,
|
||||
VerificationDate = authorizedPerson.VerificationDate?.ToString("yyyy/MM/dd HH:mm"),
|
||||
CreationDate = authorizedPerson.CreationDate.ToString("yyyy/MM/dd HH:mm")
|
||||
};
|
||||
}
|
||||
|
||||
public List<AuthorizedPersonViewModel> Search(string nationalCode = null, string firstName = null, string lastName = null)
|
||||
{
|
||||
var allPersons = _authorizedPersonRepository.Get();
|
||||
|
||||
var filteredPersons = allPersons.Where(x =>
|
||||
(string.IsNullOrEmpty(nationalCode) || x.NationalCode.Contains(nationalCode)) &&
|
||||
(string.IsNullOrEmpty(firstName) || x.FirstName.Contains(firstName)) &&
|
||||
(string.IsNullOrEmpty(lastName) || x.LastName.Contains(lastName)))
|
||||
.Select(x => new AuthorizedPersonViewModel
|
||||
{
|
||||
Id = x.id,
|
||||
NationalCode = x.NationalCode,
|
||||
FirstName = x.FirstName,
|
||||
LastName = x.LastName,
|
||||
FatherName = x.FatherName,
|
||||
BirthDate = x.BirthDate,
|
||||
Gender = x.Gender,
|
||||
DeathStatus = x.DeathStatus,
|
||||
ShenasnameSeri = x.ShenasnameSeri,
|
||||
ShenasnameSerial = x.ShenasnameSerial,
|
||||
ShenasnamehNumber = x.ShenasnamehNumber,
|
||||
IsVerified = x.IsVerified,
|
||||
VerificationDate = x.VerificationDate?.ToString("yyyy/MM/dd HH:mm"),
|
||||
CreationDate = x.CreationDate.ToString("yyyy/MM/dd HH:mm")
|
||||
}).ToList();
|
||||
|
||||
return filteredPersons;
|
||||
}
|
||||
|
||||
public bool ExistsByNationalCode(string nationalCode)
|
||||
{
|
||||
return _authorizedPersonRepository.ExistsByNationalCode(nationalCode);
|
||||
}
|
||||
}
|
||||
@@ -152,38 +152,17 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
var housingAllowance = command.HousingAllowance.MoneyToDouble();
|
||||
//حق تاهل
|
||||
var marriedAllowance = command.MarriedAllowance.MoneyToDouble();
|
||||
//var MontlyYearsBunos =
|
||||
//_yearlySalaryRepository.GetMontlyBunosYears(command.WeeklyTime, command.ContractStartGr, command.ContractEndGr, dayliWage, command.WorkingWeeklyTime, command.officialholiday, command.friday, command.TotalHolidaysAndNotH, command.TotalHolidaysAndNotM, command.Basic, command.FridayStarttoEnd, command.DailFeeComplete, command.HasRollCall, command.HolidayWorking, command.ShiftWork);
|
||||
//دستمزد ماهانه
|
||||
|
||||
#region Salary
|
||||
|
||||
var totalDays = (command.ContractEndGr - command.ContractStartGr).TotalDays + 1;
|
||||
|
||||
var mandatoryDays = totalDays - command.FridayStarttoEnd - command.officialholiday;
|
||||
|
||||
if (!command.HasRollCall && command.ShiftWork != "4")
|
||||
mandatoryDays = totalDays - command.FridayStarttoEnd;
|
||||
var monthlyWage = command.DailySalaryAffected * totalDays;
|
||||
|
||||
//پایه سنوات
|
||||
var bacicYears = command.BaseYearAffected * totalDays;
|
||||
#endregion
|
||||
|
||||
//سنوات
|
||||
var years = command.YearsPay;
|
||||
var MontlyYearsBunos =
|
||||
_yearlySalaryRepository.GetMontlyBunosYears(command.WeeklyTime, command.ContractStartGr, command.ContractEndGr, dayliWage, command.WorkingWeeklyTime, command.officialholiday, command.friday, command.TotalHolidaysAndNotH, command.TotalHolidaysAndNotM, command.Basic, command.FridayStarttoEnd, command.DailFeeComplete, command.HasRollCall, command.HolidayWorking, command.ShiftWork);
|
||||
//دستمزد ماهانه
|
||||
var monthlyWage = MontlyYearsBunos.MontlyWage;
|
||||
//سنوات
|
||||
var years = command.YearsPay;
|
||||
//عیدی و پاداش
|
||||
var bunos = command.BonusesPay;
|
||||
|
||||
//فاطمه احمدژاد === موقت عیدی و پاداش و سنوات حساب نشه
|
||||
if (command.EmployeeId == 45104 && command.WorkshopId == 315)
|
||||
{
|
||||
years = 0;
|
||||
|
||||
bunos = 0;
|
||||
}
|
||||
|
||||
var sumOfWorkingDays = $"{totalDays}";
|
||||
//پایه سنوات
|
||||
var bacicYears = MontlyYearsBunos.BasicYears;
|
||||
var sumOfWorkingDays = MontlyYearsBunos.SumOfWorkingDay;
|
||||
if (command.friday > 0)
|
||||
{
|
||||
var fridayPercent = dayliWage * 40 / 100;
|
||||
@@ -221,11 +200,11 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
.Select(x => new CheckoutSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa, x.CalculationDateTimeGe, x.CalculationDateTimeFa, x.Id)).ToList();
|
||||
|
||||
command.SalaryAidDeduction = salaryAids.Sum(x => x.Amount.MoneyToDouble());
|
||||
|
||||
|
||||
|
||||
var loanInstallments = _rollCallMandatoryRepository.LoanInstallmentForCheckout(command.EmployeeId,
|
||||
command.WorkshopId, command.ContractStartGr, command.HasLeft ? DateTime.MaxValue : command.ContractEndGr)
|
||||
.Select(x =>
|
||||
new CheckoutLoanInstallment(x.Amount, x.Month, x.Year, x.IsActive, x.RemainingAmount, x.LoanAmount, x.Id)).ToList();
|
||||
command.WorkshopId, command.ContractStartGr, command.ContractEndGr)
|
||||
.Select(x => new CheckoutLoanInstallment(x.Amount, x.Month, x.Year, x.IsActive, x.RemainingAmount, x.LoanAmount, x.Id)).ToList();
|
||||
|
||||
command.InstallmentDeduction = loanInstallments.Sum(x => x.AmountForMonth.MoneyToDouble());
|
||||
|
||||
|
||||
@@ -78,11 +78,6 @@ public class ContractApplication : IContractApplication
|
||||
}
|
||||
|
||||
|
||||
public async Task<double> GetManualDailWage(long workshopId, long employeeId, long yearlySalaryId, DateTime contractStart)
|
||||
{
|
||||
return await _contractRepository.GetManualDailWage(workshopId, employeeId, yearlySalaryId, contractStart);
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateContract command)
|
||||
{
|
||||
var yearlysalaryList = _yearlySalaryRepository.GetYearlySalary();
|
||||
@@ -147,9 +142,7 @@ public class ContractApplication : IContractApplication
|
||||
yearlySalarId,
|
||||
start, end, command.DayliWage, command.ArchiveCode, getWorkdate, setContractDate,
|
||||
command.JobType, command.ContractType, command.WorkshopAddress1, command.WorkshopAddress2,
|
||||
command.ConsumableItems, command.JobTypeId, command.HousingAllowance, command.AgreementSalary,
|
||||
command.WorkingHoursWeekly, command.FamilyAllowance, command.ContractPeriod,command.DailySalaryAffected,
|
||||
command.BaseYearAffected, command.DailySalaryUnAffected,command.BaseYearUnAffected, command.HasManualDailyWage, command.DailyWageType);
|
||||
command.ConsumableItems, command.JobTypeId, command.HousingAllowance, command.AgreementSalary, command.WorkingHoursWeekly, command.FamilyAllowance, command.ContractPeriod);
|
||||
|
||||
_contractRepository.Create(makeContract);
|
||||
_contractRepository.SaveChanges();
|
||||
@@ -363,9 +356,7 @@ public class ContractApplication : IContractApplication
|
||||
command.YearlySalaryId,
|
||||
start, end, command.DayliWage, command.ArchiveCode, getWorkdate, setContractDate,
|
||||
command.JobName, command.ContractType, command.WorkshopAddress1, command.WorkshopAddress2,
|
||||
command.ConsumableItems, command.JobId, command.HousingAllowance, "0", command.WorkingHoursWeekly, command.FamilyAllowance, command.ContractPeriod,
|
||||
command.DailySalaryAffected,
|
||||
command.BaseYearAffected, command.DailySalaryUnAffected, command.BaseYearUnAffected, command.HasManualDailyWage, command.DailyWageType);
|
||||
command.ConsumableItems, command.JobId, command.HousingAllowance, "0", command.WorkingHoursWeekly, command.FamilyAllowance, command.ContractPeriod);
|
||||
_contractRepository.Create(makeContract);
|
||||
_contractRepository.SaveChanges();
|
||||
|
||||
|
||||
@@ -319,10 +319,7 @@ namespace CompanyManagment.Application
|
||||
|
||||
if (workshopId == 170)
|
||||
{
|
||||
var exceptionEmployeeIds = _customizeWorkshopGroupSettingsRepository
|
||||
.GetEmployeeSettingsByGroupSettingsId(117)
|
||||
.Select(x => x.EmployeeId)
|
||||
.Where(x=> workshopLeftWorksInMonth.Select(l=>l.EmployeeId).Contains(x)).ToList();
|
||||
var exceptionEmployeeIds = _customizeWorkshopGroupSettingsRepository.GetEmployeeSettingsByGroupSettingsId(117).Select(x => x.EmployeeId).ToList();
|
||||
foreach (var employeesId in exceptionEmployeeIds)
|
||||
{
|
||||
|
||||
|
||||
@@ -249,10 +249,7 @@ namespace CompanyManagment.Application
|
||||
|
||||
if (workshopId == 170)
|
||||
{
|
||||
var exceptionEmployeeIds = _customizeWorkshopGroupSettingsRepository
|
||||
.GetEmployeeSettingsByGroupSettingsId(117)
|
||||
.Select(x => x.EmployeeId)
|
||||
.Where(x=> workshopLeftWorksInMonth.Select(l=>l.EmployeeId).Contains(x)).ToList();
|
||||
var exceptionEmployeeIds = _customizeWorkshopGroupSettingsRepository.GetEmployeeSettingsByGroupSettingsId(117).Select(x => x.EmployeeId).ToList();
|
||||
foreach (var employeesId in exceptionEmployeeIds)
|
||||
{
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,21 +2,31 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Exceptions;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Company.Domain.empolyerAgg;
|
||||
using Company.Domain.FinancialStatmentAgg;
|
||||
using Company.Domain.FinancialTransactionAgg;
|
||||
using Company.Domain.InstitutionContractAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using Company.Domain.RepresentativeAgg;
|
||||
using Company.Domain.TemporaryClientRegistrationAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using CompanyManagment.App.Contracts.FinancialStatment;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using CompanyManagment.EFCore.Migrations;
|
||||
using PersianTools.Core;
|
||||
using ConnectedPersonnelViewModel = CompanyManagment.App.Contracts.Workshop.ConnectedPersonnelViewModel;
|
||||
using FinancialStatment = Company.Domain.FinancialStatmentAgg.FinancialStatment;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -30,13 +40,20 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
private readonly IWorkshopRepository _workshopRepository;
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IContractingPartyTempRepository _contractingPartyTempRepository;
|
||||
private readonly IFinancialStatmentRepository _financialStatmentRepository;
|
||||
private readonly IContactInfoApplication _contactInfoApplication;
|
||||
private readonly IAccountApplication _accountApplication;
|
||||
|
||||
|
||||
public InstitutionContractApplication(IInstitutionContractRepository institutionContractRepository,
|
||||
IPersonalContractingPartyRepository contractingPartyRepository,
|
||||
IRepresentativeRepository representativeRepository, IEmployerRepository employerRepository,
|
||||
IWorkshopRepository workshopRepository, ILeftWorkRepository leftWorkRepository,
|
||||
IFinancialStatmentApplication financialStatmentApplication, IWorkshopApplication workshopApplication)
|
||||
IFinancialStatmentApplication financialStatmentApplication, IWorkshopApplication workshopApplication,
|
||||
IContractingPartyTempRepository contractingPartyTempRepository,
|
||||
IFinancialStatmentRepository financialStatmentRepository, IContactInfoApplication contactInfoApplication,
|
||||
IAccountApplication accountApplication)
|
||||
{
|
||||
_institutionContractRepository = institutionContractRepository;
|
||||
_contractingPartyRepository = contractingPartyRepository;
|
||||
@@ -46,6 +63,10 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
_financialStatmentApplication = financialStatmentApplication;
|
||||
_workshopApplication = workshopApplication;
|
||||
_contractingPartyTempRepository = contractingPartyTempRepository;
|
||||
_financialStatmentRepository = financialStatmentRepository;
|
||||
_contactInfoApplication = contactInfoApplication;
|
||||
_accountApplication = accountApplication;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateInstitutionContract command)
|
||||
@@ -901,352 +922,349 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
|
||||
public async Task<OperationResult> CreateAsync(CreateInstitutionContractRequest command)
|
||||
{
|
||||
string contractingPartyName = String.Empty;
|
||||
bool dateMessages = false;
|
||||
string dateMaessageResult = String.Empty;
|
||||
var opration = new OperationResult();
|
||||
if (_institutionContractRepository.Exists(x =>
|
||||
x.ContractingPartyId == command.ContractingPartyId && x.RepresentativeId == command.RepresentativeId &&
|
||||
x.TypeOfContract == command.TypeOfContract))
|
||||
return opration.Failed(
|
||||
"برای این معرف و طرف حساب قبلا قرارداد ایجاد شده است، شما میتوانید از تمدید استفاده کنید");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.ContractDateFa))
|
||||
{
|
||||
dateMaessageResult = "تاریخ قراراداد اجباری است. ";
|
||||
dateMessages = true;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.ContractStartFa))
|
||||
{
|
||||
dateMaessageResult += "تاریخ شروع قراراداد اجباری است. ";
|
||||
dateMessages = true;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.ContractEndFa))
|
||||
{
|
||||
dateMaessageResult += "تاریخ پایان قراراداد اجباری است. ";
|
||||
dateMessages = true;
|
||||
}
|
||||
|
||||
if (dateMessages)
|
||||
return opration.Failed(dateMaessageResult);
|
||||
|
||||
if (command.RepresentativeId < 1 && command.ContractingPartyId > 1)
|
||||
{
|
||||
return opration.Failed("معرف را انتخاب کنید");
|
||||
}
|
||||
else if (command.ContractingPartyId < 1 && command.RepresentativeId > 1)
|
||||
{
|
||||
return opration.Failed("طرف حساب را انتخاب کنید");
|
||||
}
|
||||
else if (command.ContractingPartyId < 1 && command.RepresentativeId < 1)
|
||||
{
|
||||
return opration.Failed("معرف و طرف حساب را انتخاب کنید");
|
||||
}
|
||||
|
||||
var syear = command.ContractStartFa.Substring(0, 4);
|
||||
var smonth = command.ContractStartFa.Substring(5, 2);
|
||||
var sday = command.ContractStartFa.Substring(8, 2);
|
||||
var contractingParty = _contractingPartyRepository.GetDetails(command.ContractingPartyId);
|
||||
//شماره قرارداد
|
||||
var transaction = await _contractingPartyRepository.BeginTransactionAsync();
|
||||
|
||||
OperationResult<PersonalContractingParty> contractingPartyResult = command.ContractingPartyLegalType switch
|
||||
{
|
||||
LegalType.Legal => await CreateLegalContractingPartyEntity(command.LegalParty, command.RepresentativeId),
|
||||
LegalType.Real => await CreateRealContractingPartyEntity(command.RealParty, command.RepresentativeId),
|
||||
_ => throw new BadRequestException("نوع طرف قرارداد مشخص نشده است")
|
||||
};
|
||||
|
||||
if (!contractingPartyResult.IsSuccedded)
|
||||
return opration.Failed(contractingPartyResult.Message);
|
||||
|
||||
var contractingParty = contractingPartyResult.Data;
|
||||
|
||||
var contractNo = $"{syear}{smonth}{sday}/{contractingParty.ArchiveCode}/0";
|
||||
|
||||
///////////////////////
|
||||
if (command.ContactInfos.Count == 0)
|
||||
return opration.Failed("ورود شماره تماس برای ارسال پیامک الزامیست");
|
||||
var accountContact = command.ContactInfos.Where(x =>
|
||||
x.SendSmsString == "true" && x.Position == "طرف قرارداد" && x.PhoneType == "شماره همراه" &&
|
||||
!string.IsNullOrWhiteSpace(x.PhoneNumber)).ToList();
|
||||
if (accountContact.Count == 0)
|
||||
return opration.Failed("ورود شماره همراه با سمت طرف قرارداد برای ساخت حساب کاربری الزامیست");
|
||||
var accountContactCount = command.ContactInfos
|
||||
.Where(x => x.PhoneType == "شماره همراه" && x.Position == "طرف قرارداد").ToList();
|
||||
if (accountContactCount.Count > 1)
|
||||
return opration.Failed("فقط یکی از شماره تلفن ها میتواند سمت طرف قرارداد داشته باشد");
|
||||
var representative = _representativeRepository.Get(command.RepresentativeId);
|
||||
if (representative == null)
|
||||
return opration.Failed("معرف مورد نظر یافت نشد");
|
||||
|
||||
contractingPartyName = contractingParty.LName;
|
||||
//نام معرف
|
||||
var representative = _representativeRepository.GetDetails(command.RepresentativeId).FullName;
|
||||
if (command.ContractStartFa.TryToGeorgianDateTime(out var contractStartGr) == false)
|
||||
return opration.Failed("تاریخ شروع قرارداد معتبر نیست");
|
||||
|
||||
var contractStartGr = command.ContractStartFa.ToGeorgianDateTime();
|
||||
var contractEndGr = command.ContractEndFa.ToGeorgianDateTime();
|
||||
|
||||
var contractDateGr = command.ContractDateFa.ToGeorgianDateTime();
|
||||
|
||||
if (command.Address != null && command.State == null)
|
||||
if (command.IsInstallment && !command.Workshops.Any(x=>x.HasContractPlanInPerson || x.HasInsurancePlanInPerson))
|
||||
{
|
||||
return opration.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||
return opration.Failed("برای قراردادهای اقساطی حداقل یک کارگاه باید دارای طرح حضوری باشد");
|
||||
}
|
||||
contractStartGr.AddMonthsFa((int)command.Duration, out var contractEndGr);
|
||||
contractEndGr = contractEndGr.ToFarsi().FindeEndOfMonth().ToGeorgianDateTime();
|
||||
|
||||
var today = DateTime.Today;
|
||||
|
||||
var contractDateGr = today;
|
||||
var contractDateFa = contractDateGr.ToFarsi();
|
||||
|
||||
|
||||
var hasValueAddedTax = command.TaxAmount > 0 ? "true" : "false";
|
||||
|
||||
var contractingPartyFullName = contractingParty.FName + " " + contractingParty.LName;
|
||||
|
||||
var entity = new InstitutionContract(contractNo, command.RepresentativeId, representative.FullName,
|
||||
contractingParty.id,
|
||||
contractingPartyFullName, contractDateGr, contractDateFa, command.Province, command.City, command.Address,
|
||||
contractStartGr,
|
||||
contractStartGr.ToFarsi(), contractEndGr, contractEndGr.ToFarsi(), 0, command.DailyCompensation,
|
||||
command.Obligation, command.TotalAmount, 0,
|
||||
command.Workshops.Count.ToString(),
|
||||
command.Workshops.Sum(x => x.PersonnelCount).ToString(), command.Description,
|
||||
"NotOfficial", "JobRelation", hasValueAddedTax
|
||||
, command.TaxAmount);
|
||||
|
||||
|
||||
var workshopDetails = command.Workshops.Select(x =>
|
||||
new InstitutionContractWorkshopDetail(x.WorkshopName, x.HasRollCallPlan, x.HasCustomizeCheckoutPlan,
|
||||
x.HasContractPlan, x.HasContractPlanInPerson,x.HasInsurancePlan,x.HasInsurancePlanInPerson,x.PersonnelCount, x.Price)).ToList();
|
||||
|
||||
var financialStatement = new FinancialStatment(contractingParty.id, contractingPartyFullName);
|
||||
|
||||
if (command.IsInstallment)
|
||||
{
|
||||
var installments =
|
||||
CalculateInstallment(command.TotalAmount, (int)command.Duration, command.ContractStartFa, true);
|
||||
|
||||
// دریافت مبلغ اولین قسط
|
||||
//این کار برای این هست که اولین قسط باید با تاریخ امروز باشد و باید به وضعیت مالی بدهی ایجاد شود که یوزر اولین بدهی را وارد کند
|
||||
var firstInstallmentAmount = installments.First().Amount;
|
||||
|
||||
// حذف اولین قسط
|
||||
installments.RemoveAt(0);
|
||||
|
||||
// ایجاد قسط جدید با تاریخ امروز
|
||||
var todayInstallment = new InstitutionContractInstallment(DateTime.Today, firstInstallmentAmount, "");
|
||||
|
||||
var financialTransaction = new FinancialTransaction(0, today, today.ToFarsi(),
|
||||
"قسط اول سرویس", "debt", "بابت خدمات", firstInstallmentAmount, 0, 0);
|
||||
|
||||
financialStatement.AddFinancialTransaction(financialTransaction);
|
||||
|
||||
// اضافه کردن قسط جدید به ابتدای لیست
|
||||
installments.Insert(0, todayInstallment);
|
||||
|
||||
entity.SetInstallments(installments);
|
||||
}
|
||||
else
|
||||
{
|
||||
var financialTransaction = new FinancialTransaction(0, today, today.ToFarsi(),
|
||||
"پرداخت کل سرویس", "debt", "بابت خدمات", command.TotalAmount, 0, 0);
|
||||
financialStatement.AddFinancialTransaction(financialTransaction);
|
||||
}
|
||||
|
||||
if ((command.Address != null && command.State != null) && command.City == "شهرستان")
|
||||
entity.SetWorkshopDetails(workshopDetails);
|
||||
await _financialStatmentRepository.CreateAsync(financialStatement);
|
||||
await _institutionContractRepository.CreateAsync(entity);
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
|
||||
var mainContactInfo = new CreateContactInfo
|
||||
{
|
||||
return opration.Failed("لطفا شهر را انتخاب کنید");
|
||||
InstitutionContractId = entity.id,
|
||||
PhoneType = "شماره همراه",
|
||||
Position = "طرف قرارداد",
|
||||
PhoneNumber = contractingParty.Phone,
|
||||
FnameLname = contractingPartyFullName,
|
||||
SendSms = true
|
||||
};
|
||||
_contactInfoApplication.Create(mainContactInfo);
|
||||
|
||||
foreach (var contactInfo in command.ContactInfos)
|
||||
{
|
||||
if (contactInfo.PhoneNumber != null)
|
||||
{
|
||||
var contactinfo = new CreateContactInfo
|
||||
{
|
||||
InstitutionContractId = entity.id,
|
||||
PhoneType = contactInfo.PhoneType,
|
||||
Position = contactInfo.Position,
|
||||
PhoneNumber = contactInfo.PhoneNumber,
|
||||
FnameLname = contactInfo.FnameLname,
|
||||
SendSms = contactInfo.SendSmsString == "true" ? true : false
|
||||
};
|
||||
_contactInfoApplication.Create(contactinfo);
|
||||
}
|
||||
}
|
||||
|
||||
if (command.Address == null && command.State != null)
|
||||
var userPass = contractingParty.IsLegal == "حقیقی"
|
||||
? contractingParty.Nationalcode
|
||||
: contractingParty.NationalId;
|
||||
var createAcc = new RegisterAccount
|
||||
{
|
||||
return opration.Failed("لطفا آدرس را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.OfficialCompany))
|
||||
return opration.Failed("رسمی یا غیر رسمی بودن پرداخت را مشخص کنید");
|
||||
if (command.OfficialCompany == "Official" && string.IsNullOrWhiteSpace(command.HasValueAddedTax))
|
||||
return opration.Failed("وضعیت ارزش افزوده را مشخص کنید");
|
||||
if (string.IsNullOrWhiteSpace(command.TypeOfContract))
|
||||
return opration.Failed("عنوان قرارداد را انتخاب کنید");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.ContractAmountString))
|
||||
command.ContractAmountString = "0";
|
||||
if (string.IsNullOrWhiteSpace(command.DailyCompenseationString))
|
||||
command.DailyCompenseationString = "0";
|
||||
if (string.IsNullOrWhiteSpace(command.ObligationString))
|
||||
command.ObligationString = "0";
|
||||
if (string.IsNullOrWhiteSpace(command.TotalAmountString))
|
||||
command.TotalAmountString = "0";
|
||||
Fullname = contractingParty.LName,
|
||||
Username = userPass,
|
||||
Password = userPass,
|
||||
Mobile = contractingParty.Phone,
|
||||
NationalCode = userPass
|
||||
};
|
||||
var res = _accountApplication.RegisterClient(createAcc);
|
||||
if (res.IsSuccedded)
|
||||
CreateContractingPartyAccount(contractingParty.id, res.SendId);
|
||||
|
||||
var valueAddedTax = string.IsNullOrWhiteSpace(command.ValueAddedTaxStr)
|
||||
? 0
|
||||
: command.ValueAddedTaxStr.MoneyToDouble();
|
||||
var contractAmountStr = command.ContractAmountString.ToDoubleMoney();
|
||||
var contractAmount = Convert.ToDouble(contractAmountStr);
|
||||
var DailyCompenseationStr = command.DailyCompenseationString.ToDoubleMoney();
|
||||
var dailyCompenseation = Convert.ToDouble(DailyCompenseationStr);
|
||||
var ObligationStr = command.ObligationString.ToDoubleMoney();
|
||||
var obligation = Convert.ToDouble(ObligationStr);
|
||||
var TotalAmountStr = command.TotalAmountString.ToDoubleMoney();
|
||||
var totalAmount = Convert.ToDouble(TotalAmountStr);
|
||||
//var hasValueAddedTax = "false";
|
||||
//double valueAddedTax = 0;
|
||||
//if (command.HasValueAddedTax == "true")
|
||||
//{
|
||||
// hasValueAddedTax = "true";
|
||||
// valueAddedTax = command.ContractAmount * 0.1;
|
||||
// command.ContractAmount += valueAddedTax;
|
||||
//}
|
||||
|
||||
var createContract = new InstitutionContract(contractNo, command.RepresentativeId, representative,
|
||||
command.ContractingPartyId,
|
||||
contractingPartyName, contractDateGr, command.ContractDateFa, command.State, command.City,
|
||||
command.Address, contractStartGr,
|
||||
command.ContractStartFa, contractEndGr, command.ContractEndFa, contractAmount,
|
||||
dailyCompenseation, obligation,
|
||||
totalAmount, 0, command.WorkshopManualCount, command.EmployeeManualCount, command.Description,
|
||||
command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax, valueAddedTax);
|
||||
|
||||
_institutionContractRepository.Create(createContract);
|
||||
_institutionContractRepository.SaveChanges();
|
||||
return opration.Succcedded(createContract.id);
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
await transaction.CommitAsync();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<OperationResult> EditAsync(EditInstitutionContractRequest command)
|
||||
{
|
||||
bool dateMessages = false;
|
||||
string dateMaessageResult = String.Empty;
|
||||
var opration = new OperationResult();
|
||||
var ContractEdit = _institutionContractRepository.Get(command.Id);
|
||||
if (ContractEdit == null)
|
||||
opration.Failed("رکورد مورد نظر وجود ندارد");
|
||||
|
||||
var contractStartGr = command.ContractStartFa.ToGeorgianDateTime();
|
||||
var contractEndGr = command.ContractEndFa.ToGeorgianDateTime();
|
||||
|
||||
var contractDateGr = command.ContractDateFa.ToGeorgianDateTime();
|
||||
|
||||
if (_institutionContractRepository.Exists(x =>
|
||||
x.ContractingPartyId == ContractEdit.ContractingPartyId &&
|
||||
((contractStartGr >= x.ContractStartGr && contractStartGr <= x.ContractEndGr) ||
|
||||
(contractEndGr >= x.ContractStartGr && contractEndGr <= x.ContractEndGr)) && x.id != command.Id &&
|
||||
x.TypeOfContract == command.TypeOfContract))
|
||||
return opration.Failed("در بازه تاریخ وارد شده قرارداد دیگری وجود دارد");
|
||||
//if (_institutionContractRepository.Exists(x =>
|
||||
// x.ContractingPartyId == ContractEdit.ContractingPartyId && (x.ContractStartGr <= contractDateGr || x.ContractDateGr <= contractDateGr) && x.id != command.Id))
|
||||
// return opration.Failed("تاریخ عقد قرارداد با قرارداد دیگری تداخل دارد");
|
||||
if (string.IsNullOrWhiteSpace(command.ContractDateFa))
|
||||
{
|
||||
dateMaessageResult = "تاریخ قراراداد اجباری است. ";
|
||||
dateMessages = true;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.ContractStartFa))
|
||||
{
|
||||
dateMaessageResult += "تاریخ شروع قراراداد اجباری است. ";
|
||||
dateMessages = true;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.ContractEndFa))
|
||||
{
|
||||
dateMaessageResult += "تاریخ پایان قراراداد اجباری است. ";
|
||||
dateMessages = true;
|
||||
}
|
||||
|
||||
if (dateMessages)
|
||||
return opration.Failed(dateMaessageResult);
|
||||
if (command.Address != null && command.State == null)
|
||||
{
|
||||
return opration.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||
}
|
||||
|
||||
if ((command.Address != null && command.State != null) && command.City == "شهرستان")
|
||||
{
|
||||
return opration.Failed("لطفا شهر را انتخاب کنید");
|
||||
}
|
||||
|
||||
if (command.Address == null && command.State != null)
|
||||
{
|
||||
return opration.Failed("لطفا آدرس را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.OfficialCompany))
|
||||
return opration.Failed("رسمی یا غیر رسمی بودن پرداخت را مشخص کنید");
|
||||
if (command.OfficialCompany == "Official" && string.IsNullOrWhiteSpace(command.HasValueAddedTax))
|
||||
return opration.Failed("وضعیت ارزش افزوده را مشخص کنید");
|
||||
if (string.IsNullOrWhiteSpace(command.TypeOfContract))
|
||||
return opration.Failed("عنوان قرارداد را انتخاب کنید");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.ContractAmountString))
|
||||
command.ContractAmountString = "0";
|
||||
if (string.IsNullOrWhiteSpace(command.DailyCompenseationString))
|
||||
command.DailyCompenseationString = "0";
|
||||
if (string.IsNullOrWhiteSpace(command.ObligationString))
|
||||
command.ObligationString = "0";
|
||||
if (string.IsNullOrWhiteSpace(command.TotalAmountString))
|
||||
command.TotalAmountString = "0";
|
||||
|
||||
var valueAddedTax = command.ValueAddedTaxStr.MoneyToDouble();
|
||||
var contractAmountStr = command.ContractAmountString.ToDoubleMoney();
|
||||
var contractAmount = Convert.ToDouble(contractAmountStr);
|
||||
var DailyCompenseationStr = command.DailyCompenseationString.ToDoubleMoney();
|
||||
var dailyCompenseation = Convert.ToDouble(DailyCompenseationStr);
|
||||
var ObligationStr = command.ObligationString.ToDoubleMoney();
|
||||
var obligation = Convert.ToDouble(ObligationStr);
|
||||
var TotalAmountStr = command.TotalAmountString.ToDoubleMoney();
|
||||
var totalAmount = Convert.ToDouble(TotalAmountStr);
|
||||
|
||||
ContractEdit.Edit(contractDateGr, command.ContractDateFa, command.State, command.City, command.Address,
|
||||
contractStartGr,
|
||||
command.ContractStartFa, contractEndGr, command.ContractEndFa, contractAmount,
|
||||
dailyCompenseation,
|
||||
obligation, totalAmount, command.WorkshopManualCount, command.EmployeeManualCount,
|
||||
command.Description, command.OfficialCompany, command.TypeOfContract, valueAddedTax,
|
||||
command.HasValueAddedTax);
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
return opration.Succcedded(command.Id);
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public async Task<OperationResult> ExtensionَAsync(CreateInstitutionContractRequest command)
|
||||
{
|
||||
bool dateMessages = false;
|
||||
string dateMaessageResult = String.Empty;
|
||||
var opration = new OperationResult();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
command.ExtensionNo += 1;
|
||||
if (_institutionContractRepository.Exists(x =>
|
||||
x.ExtensionNo == command.ExtensionNo && x.ContractingPartyId == command.ContractingPartyId &&
|
||||
x.TypeOfContract == command.TypeOfContract))
|
||||
return opration.Failed("برای این قرارداد قبلا تمدید ایجاد شده است");
|
||||
public Task<List<RegistrationWorkflowMainListViewModel>> RegistrationWorkflowMainList()
|
||||
{
|
||||
return _institutionContractRepository.RegistrationWorkflowMainList();
|
||||
}
|
||||
|
||||
public Task<List<RegistrationWorkflowItemsViewModel>> RegistrationWorkflowItems(long institutionContractId)
|
||||
{
|
||||
return _institutionContractRepository.RegistrationWorkflowItems(institutionContractId);
|
||||
}
|
||||
|
||||
private async Task<OperationResult<PersonalContractingParty>> CreateLegalContractingPartyEntity(
|
||||
CreateInstitutionContractLegalPartyRequest request, long representativeId)
|
||||
{
|
||||
var opration = new OperationResult<PersonalContractingParty>();
|
||||
|
||||
if (_contractingPartyRepository.Exists(x =>
|
||||
x.LName == request.CompanyName && x.RegisterId == request.RegisterId))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
if (representativeId < 1)
|
||||
return opration.Failed("لطفا معرف را انتخاب کنید");
|
||||
|
||||
if (_contractingPartyRepository.Exists(x =>
|
||||
x.LName == request.CompanyName && x.NationalId == request.NationalId))
|
||||
return opration.Failed("نام شرکت وارد شده تکراری است");
|
||||
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.ContractDateFa))
|
||||
if (_contractingPartyRepository.Exists(x =>
|
||||
x.RegisterId == request.RegisterId && x.LName != request.CompanyName))
|
||||
return opration.Failed("شماره ثبت وارد شده تکراری است");
|
||||
|
||||
|
||||
if (_contractingPartyRepository.Exists(x =>
|
||||
x.NationalId == request.NationalId && x.LName != request.CompanyName))
|
||||
{
|
||||
dateMaessageResult = "تاریخ قراراداد اجباری است. ";
|
||||
dateMessages = true;
|
||||
return opration.Failed("شناسه ملی وارد شده تکراری است");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.ContractStartFa))
|
||||
var archiveCode = _contractingPartyRepository.GetLastNewArchiveCode();
|
||||
|
||||
|
||||
var representative = _representativeRepository.GetDetails(representativeId);
|
||||
var legalContractingParty = new PersonalContractingParty("*", request.CompanyName,
|
||||
"*", "*", request.RegisterId, request.NationalId,
|
||||
"حقوقی",
|
||||
request.PhoneNumber, request.PhoneNumber, null, representativeId, representative.FullName,
|
||||
archiveCode, null, null, null, null, request.Position);
|
||||
|
||||
|
||||
await _contractingPartyRepository.CreateAsync(legalContractingParty);
|
||||
await _contractingPartyRepository.SaveChangesAsync();
|
||||
|
||||
return opration.Succcedded(legalContractingParty);
|
||||
}
|
||||
|
||||
private async Task<OperationResult<PersonalContractingParty>> CreateRealContractingPartyEntity(
|
||||
CreateInstitutionContractRealPartyRequest request, long representativeId)
|
||||
{
|
||||
var operation = new OperationResult<PersonalContractingParty>();
|
||||
|
||||
if (_contractingPartyRepository.Exists(x =>
|
||||
x.LName == request.LName && x.Nationalcode == request.NationalCode))
|
||||
return operation.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
if (representativeId < 1)
|
||||
return operation.Failed("لطفا معرف را انتخاب کنید");
|
||||
|
||||
if (_contractingPartyRepository.Exists(x => x.Nationalcode == request.NationalCode))
|
||||
{
|
||||
dateMaessageResult += "تاریخ شروع قراراداد اجباری است. ";
|
||||
dateMessages = true;
|
||||
return operation.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.ContractEndFa))
|
||||
var archiveCode = _contractingPartyRepository.GetLastNewArchiveCode();
|
||||
|
||||
if (request.NationalCode.NationalCodeValid() != "valid")
|
||||
{
|
||||
dateMaessageResult += "تاریخ پایان قراراداد اجباری است. ";
|
||||
dateMessages = true;
|
||||
return operation.Failed("کد ملی وارد شده نا معتبر است");
|
||||
}
|
||||
|
||||
if (dateMessages)
|
||||
return opration.Failed(dateMaessageResult);
|
||||
var representative = _representativeRepository.GetDetails(representativeId);
|
||||
|
||||
var firstContract =
|
||||
_institutionContractRepository.GetFirstContract(command.ContractingPartyId, command.TypeOfContract);
|
||||
if (representative == null)
|
||||
return operation.Failed("معرف مورد نظر یافت نشد");
|
||||
|
||||
var syear = firstContract.ContractStartFa.Substring(0, 4);
|
||||
var smonth = firstContract.ContractStartFa.Substring(5, 2);
|
||||
var sday = firstContract.ContractStartFa.Substring(8, 2);
|
||||
var contractingParty = _contractingPartyRepository.GetDetails(command.ContractingPartyId);
|
||||
//شماره قرارداد
|
||||
var contractNo = $"{syear}{smonth}{sday}/{contractingParty.ArchiveCode}/{command.ExtensionNo}";
|
||||
var personalContractingParty = new PersonalContractingParty(request.FName, request.LName,
|
||||
request.NationalCode, request.IdNumber, "*", "*",
|
||||
"حقیقی",
|
||||
request.PhoneNumber, request.PhoneNumber, null, representativeId, representative.FullName, archiveCode,
|
||||
null, null, null, null);
|
||||
|
||||
|
||||
var contractStartGr = command.ContractStartFa.ToGeorgianDateTime();
|
||||
var contractEndGr = command.ContractEndFa.ToGeorgianDateTime();
|
||||
await _contractingPartyRepository.CreateAsync(personalContractingParty);
|
||||
await _contractingPartyRepository.SaveChangesAsync();
|
||||
|
||||
var contractDateGr = command.ContractDateFa.ToGeorgianDateTime();
|
||||
if (_institutionContractRepository.Exists(x =>
|
||||
((contractStartGr >= x.ContractStartGr && contractStartGr <= x.ContractEndGr) ||
|
||||
(contractEndGr >= x.ContractStartGr && contractEndGr <= x.ContractEndGr)) &&
|
||||
x.TypeOfContract == command.TypeOfContract && x.ContractingPartyId == command.ContractingPartyId))
|
||||
return opration.Failed("تاریخ شروع و پایان وارد شده با قرارداد دیگری تداخل دارد");
|
||||
if (command.Address != null && command.State == null)
|
||||
return operation.Succcedded(personalContractingParty);
|
||||
}
|
||||
|
||||
private List<InstitutionContractInstallment> CalculateInstallment(double amount, int installmentCount,
|
||||
string loanStartDate, bool getRounded)
|
||||
{
|
||||
int day = Convert.ToInt32(loanStartDate.Substring(8, 2));
|
||||
int month = Convert.ToInt32(loanStartDate.Substring(5, 2));
|
||||
int year = Convert.ToInt32(loanStartDate.Substring(0, 4));
|
||||
|
||||
var installments = new List<InstitutionContractInstallment>();
|
||||
|
||||
|
||||
bool endOfMonth = day == 31;
|
||||
|
||||
|
||||
var dividedAmount = amount / installmentCount;
|
||||
|
||||
double moneyPerMonth = 0;
|
||||
|
||||
if (getRounded)
|
||||
moneyPerMonth = Math.Floor(dividedAmount / 1000) * 1000;
|
||||
else
|
||||
moneyPerMonth = Math.Floor(dividedAmount);
|
||||
|
||||
double lastLoan = amount - (moneyPerMonth * (installmentCount - 1));
|
||||
|
||||
if (endOfMonth)
|
||||
{
|
||||
return opration.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||
}
|
||||
for (int i = 1; i < installmentCount; i++)
|
||||
{
|
||||
var installment =
|
||||
new InstitutionContractInstallment(loanStartDate.ToGeorgianDateTime(), moneyPerMonth, "");
|
||||
|
||||
if ((command.Address != null && command.State != null) && command.City == "شهرستان")
|
||||
installments.Add(installment);
|
||||
|
||||
if (month == 12)
|
||||
{
|
||||
year++;
|
||||
month = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
month++;
|
||||
}
|
||||
|
||||
loanStartDate = $"{year:0000}/{month:00}/01".FindeEndOfMonth();
|
||||
}
|
||||
|
||||
var lastInstallment = new InstitutionContractInstallment(loanStartDate.ToGeorgianDateTime(), lastLoan, "");
|
||||
|
||||
installments.Add(lastInstallment);
|
||||
return installments;
|
||||
}
|
||||
else
|
||||
{
|
||||
return opration.Failed("لطفا شهر را انتخاب کنید");
|
||||
for (int i = 1; i < installmentCount; i++)
|
||||
{
|
||||
var installment =
|
||||
new InstitutionContractInstallment(loanStartDate.ToGeorgianDateTime(), moneyPerMonth, "");
|
||||
|
||||
installments.Add(installment);
|
||||
var endDay = 0;
|
||||
|
||||
if (month == 12)
|
||||
{
|
||||
year++;
|
||||
month = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
month++;
|
||||
}
|
||||
|
||||
if (day == 30)
|
||||
{
|
||||
if (month == 12)
|
||||
{
|
||||
var lastYearDay =
|
||||
Convert.ToInt32($"{year:0000}/{month:00}/1".FindeEndOfMonth().Substring(8, 2));
|
||||
endDay = lastYearDay == 30 ? lastYearDay : 29;
|
||||
}
|
||||
}
|
||||
|
||||
loanStartDate =
|
||||
endDay == 0 ? $"{year:0000}/{month:00}/{day:00}" : $"{year:0000}/{month:00}/{endDay:00}";
|
||||
}
|
||||
|
||||
var lastInstallment = new InstitutionContractInstallment(loanStartDate.ToGeorgianDateTime(), lastLoan, "");
|
||||
installments.Add(lastInstallment);
|
||||
return installments;
|
||||
}
|
||||
|
||||
if (command.Address == null && command.State != null)
|
||||
{
|
||||
return opration.Failed("لطفا آدرس را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.OfficialCompany))
|
||||
return opration.Failed("رسمی یا غیر رسمی بودن پرداخت را مشخص کنید");
|
||||
if (command.OfficialCompany == "Official" && string.IsNullOrWhiteSpace(command.HasValueAddedTax))
|
||||
return opration.Failed("وضعیت ارزش افزوده را مشخص کنید");
|
||||
if (string.IsNullOrWhiteSpace(command.TypeOfContract))
|
||||
return opration.Failed("عنوان قرارداد را انتخاب کنید");
|
||||
if (string.IsNullOrWhiteSpace(command.ContractAmountString))
|
||||
command.ContractAmountString = "0";
|
||||
if (string.IsNullOrWhiteSpace(command.DailyCompenseationString))
|
||||
command.DailyCompenseationString = "0";
|
||||
if (string.IsNullOrWhiteSpace(command.ObligationString))
|
||||
command.ObligationString = "0";
|
||||
if (string.IsNullOrWhiteSpace(command.TotalAmountString))
|
||||
command.TotalAmountString = "0";
|
||||
var valueAddedTax = string.IsNullOrWhiteSpace(command.ValueAddedTaxStr)
|
||||
? 0
|
||||
: command.ValueAddedTaxStr.MoneyToDouble();
|
||||
var contractAmountStr = command.ContractAmountString.ToDoubleMoney();
|
||||
var contractAmount = Convert.ToDouble(contractAmountStr);
|
||||
var DailyCompenseationStr = command.DailyCompenseationString.ToDoubleMoney();
|
||||
var dailyCompenseation = Convert.ToDouble(DailyCompenseationStr);
|
||||
var ObligationStr = command.ObligationString.ToDoubleMoney();
|
||||
var obligation = Convert.ToDouble(ObligationStr);
|
||||
var TotalAmountStr = command.TotalAmountString.ToDoubleMoney();
|
||||
var totalAmount = Convert.ToDouble(TotalAmountStr);
|
||||
var contractingPartyName = contractingParty.LName;
|
||||
var representative = _representativeRepository.GetDetails(command.RepresentativeId).FullName;
|
||||
|
||||
var createContract = new InstitutionContract(contractNo, command.RepresentativeId, representative,
|
||||
command.ContractingPartyId,
|
||||
contractingPartyName, contractDateGr, command.ContractDateFa, command.State, command.City,
|
||||
command.Address, contractStartGr,
|
||||
command.ContractStartFa, contractEndGr, command.ContractEndFa, contractAmount,
|
||||
dailyCompenseation, obligation,
|
||||
totalAmount, command.ExtensionNo, command.WorkshopManualCount, command.EmployeeManualCount,
|
||||
command.Description, command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax,
|
||||
valueAddedTax);
|
||||
|
||||
_institutionContractRepository.Create(createContract);
|
||||
_institutionContractRepository.SaveChanges();
|
||||
|
||||
|
||||
|
||||
return opration.Succcedded(createContract.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
256
CompanyManagment.Application/LawApplication.cs
Normal file
256
CompanyManagment.Application/LawApplication.cs
Normal file
@@ -0,0 +1,256 @@
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.LawAgg;
|
||||
using CompanyManagment.App.Contracts.Law;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class LawApplication : ILawApplication
|
||||
{
|
||||
private readonly ILawRepository _lawRepository;
|
||||
|
||||
public LawApplication(ILawRepository lawRepository)
|
||||
{
|
||||
_lawRepository = lawRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateLaw command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
if (_lawRepository.Exists(x => x.Type == command.Type))
|
||||
{
|
||||
return operation.Failed("این قانون قبلا ثبت شده است");
|
||||
}
|
||||
|
||||
var law = new Law(command.Title, command.Type, command.Notifications, command.HeadTitle);
|
||||
if (command.Items == null || command.Items.Count == 0)
|
||||
{
|
||||
return operation.Failed("باید حداقل یک بند برای قانون باید ثبت شود");
|
||||
}
|
||||
|
||||
var orderNumber = 1;
|
||||
foreach (var item in command.Items)
|
||||
{
|
||||
law.AddItem(item.Header, item.Details, orderNumber);
|
||||
orderNumber++;
|
||||
}
|
||||
|
||||
_lawRepository.Create(law);
|
||||
_lawRepository.SaveChanges();
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult Edit(EditLaw command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
var law = _lawRepository.Get(command.Id);
|
||||
|
||||
if (law == null)
|
||||
return operation.Failed(ApplicationMessages.RecordNotFound);
|
||||
|
||||
if (command.Items == null || command.Items.Count == 0)
|
||||
{
|
||||
return operation.Failed("باید حداقل یک بند برای قانون باید ثبت شود");
|
||||
}
|
||||
var orderNumber = 1;
|
||||
var lawItems = command.Items.Select(x =>
|
||||
{
|
||||
var res = new LawItem(x.Header, x.Details, orderNumber);
|
||||
orderNumber++;
|
||||
return res;
|
||||
}).ToList();
|
||||
|
||||
law.Edit(command.Title);
|
||||
|
||||
law.SetItem(lawItems);
|
||||
|
||||
_lawRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult UpsertLaw(EditLaw command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
// Validate items
|
||||
if (command.Items == null || command.Items.Count == 0)
|
||||
{
|
||||
return operation.Failed("باید حداقل یک بند برای قانون باید ثبت شود");
|
||||
}
|
||||
|
||||
// Check if law exists by type
|
||||
var existingLaw = _lawRepository.Get().FirstOrDefault(x => x.Type == command.Type);
|
||||
|
||||
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 orderNumber = 1;
|
||||
foreach (var item in command.Items)
|
||||
{
|
||||
law.AddItem(item.Header, item.Details, orderNumber);
|
||||
orderNumber++;
|
||||
}
|
||||
|
||||
_lawRepository.Create(law);
|
||||
_lawRepository.SaveChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
// If law exists, update it
|
||||
var orderNumber = 1;
|
||||
var lawItems = command.Items.Select(x =>
|
||||
{
|
||||
var res = new LawItem(x.Header, x.Details, orderNumber);
|
||||
orderNumber++;
|
||||
return res;
|
||||
}).ToList();
|
||||
|
||||
existingLaw.Edit(command.Title);
|
||||
existingLaw.SetItem(lawItems);
|
||||
|
||||
_lawRepository.SaveChanges();
|
||||
}
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult Activate(long id)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
var law = _lawRepository.Get(id);
|
||||
|
||||
if (law == null)
|
||||
return operation.Failed(ApplicationMessages.RecordNotFound);
|
||||
|
||||
law.Activate();
|
||||
_lawRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult Deactivate(long id)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
var law = _lawRepository.Get(id);
|
||||
|
||||
if (law == null)
|
||||
return operation.Failed(ApplicationMessages.RecordNotFound);
|
||||
|
||||
law.Deactivate();
|
||||
_lawRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult ActivateByType(LawType type)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
var law = _lawRepository.Get().FirstOrDefault(x => x.Type == type);
|
||||
|
||||
if (law == null)
|
||||
{
|
||||
// If law doesn't exist, create a new active one with default values
|
||||
var newLaw = new Law(GetDefaultTitleForLawType(type), type, new List<string>(), "");
|
||||
newLaw.Activate();
|
||||
_lawRepository.Create(newLaw);
|
||||
_lawRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
law.Activate();
|
||||
_lawRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult DeactivateByType(LawType type)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
var law = _lawRepository.Get().FirstOrDefault(x => x.Type == type);
|
||||
|
||||
if (law == null)
|
||||
return operation.Failed("قانون مورد نظر یافت نشد");
|
||||
|
||||
law.Deactivate();
|
||||
_lawRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public EditLaw GetDetails(long id)
|
||||
{
|
||||
var law = _lawRepository.Get(id);
|
||||
return new EditLaw
|
||||
{
|
||||
Id = law.id,
|
||||
Title = law.Title,
|
||||
Type = law.Type,
|
||||
Items = law.Items.OrderBy(x => x.OrderNumber).Select(x => new LawItemViewModel
|
||||
{
|
||||
Header = x.Header,
|
||||
Details = x.Details
|
||||
}).ToList()
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<List<LawViewModel>> GetList(LawSearchModel searchModel)
|
||||
{
|
||||
// Get filtered laws from database
|
||||
return await _lawRepository.GetList(searchModel);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private string GetDefaultTitleForLawType(LawType lawType)
|
||||
{
|
||||
return lawType switch
|
||||
{
|
||||
LawType.Register => "قوانین ثبت نام",
|
||||
_ => $"قوانین {lawType}"
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<LawViewModel> GetLawWithItems(long id)
|
||||
{
|
||||
var law = await _lawRepository.GetWithItems(id);
|
||||
if (law == null)
|
||||
return null;
|
||||
|
||||
return new LawViewModel
|
||||
{
|
||||
Id = law.id,
|
||||
Title = law.Title,
|
||||
IsActive = law.IsActive,
|
||||
CreatedAt = law.CreationDate,
|
||||
Type = law.Type,
|
||||
Items = law.Items.OrderBy(x=>x.OrderNumber).Select(x => new LawItemViewModel
|
||||
{
|
||||
Header = x.Header,
|
||||
Details = x.Details,
|
||||
}).ToList()
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<LawViewModel> GetLawByType(LawType type)
|
||||
{
|
||||
var lawViewModel = await _lawRepository.GetByType(type);
|
||||
|
||||
// If no law exists for this type, return a default empty law
|
||||
if (lawViewModel == null)
|
||||
{
|
||||
return new LawViewModel
|
||||
{
|
||||
Id = 0,
|
||||
Title = GetDefaultTitleForLawType(type),
|
||||
IsActive = false,
|
||||
CreatedAt = DateTime.Now,
|
||||
Type = type,
|
||||
Items = new List<LawItemViewModel>()
|
||||
};
|
||||
}
|
||||
|
||||
return lawViewModel;
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class LeaveApplication : ILeaveApplication
|
||||
|
||||
var end = command.PaidLeaveType == "ساعتی" ? start : command.EndLeave.ToGeorgianDateTime();
|
||||
|
||||
var checkErr = _leaveRepository.CheckErrors(start, end, command.EmployeeId, command.WorkshopId,command.IsInvallid);
|
||||
var checkErr = _leaveRepository.CheckErrors(start, end, command.EmployeeId, command.WorkshopId);
|
||||
|
||||
// start = new DateTime(start.Year, start.Month, start.Day, startH.Hours, startH.Minutes, startH.Seconds);
|
||||
//end = new DateTime(end.Year, end.Month, end.Day, endH.Hours, endH.Minutes, endH.Seconds);
|
||||
@@ -96,10 +96,8 @@ public class LeaveApplication : ILeaveApplication
|
||||
return op.Failed(checkErr.ContractErrMessage);
|
||||
if (checkErr.HasLeftWork)
|
||||
return op.Failed(checkErr.LeftWorlErrMessage);
|
||||
//if (checkErr.HasHolidayError)
|
||||
// return op.Failed(checkErr.HolidayErrorMessage);
|
||||
|
||||
if (start > end)
|
||||
if (start > end)
|
||||
return op.Failed("تارخ شروع از پایان بزرگتر است");
|
||||
|
||||
|
||||
@@ -182,30 +180,29 @@ public class LeaveApplication : ILeaveApplication
|
||||
shiftDuration = shiftEndDateTime - shiftStartDateTime;
|
||||
hasShiftDuration = true;
|
||||
}
|
||||
else if (employeeSettings is { WorkshopShiftStatus: WorkshopShiftStatus.Irregular })
|
||||
{
|
||||
if ((end - start).TotalDays > 1)
|
||||
{
|
||||
return op.Failed("شما نمیتوانید بیشتر از یک روز مرخصی روزانه ثبت کنید");
|
||||
}
|
||||
|
||||
var isActive = _rollCallEmployeeStatusApplication.IsActiveInPeriod(command.EmployeeId, command.WorkshopId, start, start);
|
||||
if (isActive)
|
||||
{
|
||||
shiftDuration = employeeSettings.IrregularShift.WorkshopIrregularShifts switch
|
||||
{
|
||||
WorkshopIrregularShifts.TwelveThirtySix => TimeSpan.FromHours(12),
|
||||
WorkshopIrregularShifts.TwelveTwentyFour => TimeSpan.FromHours(12),
|
||||
WorkshopIrregularShifts.TwentyFourFortyEight => TimeSpan.FromHours(24),
|
||||
WorkshopIrregularShifts.TwentyFourTwentyFour => TimeSpan.FromHours(24),
|
||||
_ => new TimeSpan()
|
||||
};
|
||||
hasShiftDuration = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else if (employeeSettings is { WorkshopShiftStatus: WorkshopShiftStatus.Irregular })
|
||||
{
|
||||
if ((end - start).TotalDays > 1)
|
||||
{
|
||||
return op.Failed("شما نمیتوانید بیشتر از یک روز مرخصی روزانه ثبت کنید");
|
||||
}
|
||||
|
||||
var isActive = _rollCallEmployeeStatusApplication.IsActiveInPeriod(command.EmployeeId, command.WorkshopId, start, start);
|
||||
if (isActive)
|
||||
{
|
||||
shiftDuration = employeeSettings.IrregularShift.WorkshopIrregularShifts switch
|
||||
{
|
||||
WorkshopIrregularShifts.TwelveThirtySix => TimeSpan.FromHours(12),
|
||||
WorkshopIrregularShifts.TwelveTwentyFour => TimeSpan.FromHours(12),
|
||||
WorkshopIrregularShifts.TwentyFourFortyEight => TimeSpan.FromHours(24),
|
||||
WorkshopIrregularShifts.TwentyFourTwentyFour => TimeSpan.FromHours(24),
|
||||
_ => new TimeSpan()
|
||||
};
|
||||
hasShiftDuration = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -238,8 +235,7 @@ public class LeaveApplication : ILeaveApplication
|
||||
var employeeFullName = _employeeRepository.GetDetails(command.EmployeeId).EmployeeFullName;
|
||||
var workshopName = _workshopRepository.GetDetails(command.WorkshopId).WorkshopName;
|
||||
var leave = new Leave(start, end, totalhourses, command.WorkshopId, command.EmployeeId
|
||||
, command.PaidLeaveType, command.LeaveType, employeeFullName, workshopName, command.IsAccepted, command.Decription,
|
||||
year, month, shiftDuration, hasShiftDuration,command.IsInvallid);
|
||||
, command.PaidLeaveType, command.LeaveType, employeeFullName, workshopName, command.IsAccepted, command.Decription, year, month, shiftDuration, hasShiftDuration);
|
||||
_leaveRepository.Create(leave);
|
||||
_leaveRepository.SaveChanges();
|
||||
|
||||
@@ -301,15 +297,13 @@ public class LeaveApplication : ILeaveApplication
|
||||
return op.Failed("لطفا تاریخ پایان را وارد کنید");
|
||||
var start = command.StartLeave.ToGeorgianDateTime();
|
||||
var end = command.PaidLeaveType == "ساعتی" ? start : command.EndLeave.ToGeorgianDateTime();
|
||||
var checkErr = _leaveRepository.CheckErrors(start, end, command.EmployeeId, command.WorkshopId,command.IsInvallid);
|
||||
var checkErr = _leaveRepository.CheckErrors(start, end, command.EmployeeId, command.WorkshopId);
|
||||
|
||||
|
||||
if (checkErr.HasChekout)
|
||||
return op.Failed(checkErr.CheckoutErrMessage);
|
||||
if (checkErr.HasLeftWork)
|
||||
return op.Failed(checkErr.LeftWorlErrMessage);
|
||||
if (checkErr.HasHolidayError)
|
||||
return op.Failed(checkErr.HolidayErrorMessage);
|
||||
if (start > end)
|
||||
return op.Failed("تارخ شروع از پایان بزرگتر است");
|
||||
|
||||
|
||||
@@ -200,7 +200,8 @@ public class LoanApplication : ILoanApplication
|
||||
DateGr = loanStartDate.ToGeorgianDateTime(),
|
||||
Month = loanStartDate.Substring(5, 2),
|
||||
Year = loanStartDate.Substring(0, 4),
|
||||
Day = loanStartDate.Substring(8, 2)
|
||||
Day = loanStartDate.Substring(8, 2),
|
||||
AmountDouble = moneyPerMonth
|
||||
};
|
||||
|
||||
installments.Add(installment);
|
||||
@@ -225,7 +226,8 @@ public class LoanApplication : ILoanApplication
|
||||
DateGr = loanStartDate.ToGeorgianDateTime(),
|
||||
Month = loanStartDate.Substring(5, 2),
|
||||
Year = loanStartDate.Substring(0, 4),
|
||||
Day = loanStartDate.Substring(8, 2)
|
||||
Day = loanStartDate.Substring(8, 2),
|
||||
AmountDouble = lastLoan
|
||||
|
||||
};
|
||||
installments.Add(lastInstallment);
|
||||
@@ -243,7 +245,8 @@ public class LoanApplication : ILoanApplication
|
||||
DateGr = loanStartDate.ToGeorgianDateTime(),
|
||||
Month = loanStartDate.Substring(5, 2),
|
||||
Year = loanStartDate.Substring(0, 4),
|
||||
Day = loanStartDate.Substring(8, 2)
|
||||
Day = loanStartDate.Substring(8, 2),
|
||||
AmountDouble = moneyPerMonth
|
||||
};
|
||||
|
||||
installments.Add(installment);
|
||||
@@ -278,7 +281,8 @@ public class LoanApplication : ILoanApplication
|
||||
DateGr = loanStartDate.ToGeorgianDateTime(),
|
||||
Month = loanStartDate.Substring(5, 2),
|
||||
Year = loanStartDate.Substring(0, 4),
|
||||
Day = loanStartDate.Substring(8, 2)
|
||||
Day = loanStartDate.Substring(8, 2),
|
||||
AmountDouble = lastLoan
|
||||
|
||||
};
|
||||
installments.Add(lastInstallment);
|
||||
|
||||
@@ -370,7 +370,7 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
|
||||
public int GetLastArchiveCode()
|
||||
{
|
||||
return _personalContractingPartyRepository.GetLastArchiveCode();
|
||||
return _personalContractingPartyRepository.GetLastNewArchiveCode();
|
||||
}
|
||||
#region Mahan
|
||||
public List<string> SearchByName(string name)
|
||||
|
||||
@@ -21,11 +21,9 @@ public class RollCallMandatoryApplication : IRollCallMandatoryApplication
|
||||
return _rollCallMandatoryRepository.Exists(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date);
|
||||
}
|
||||
|
||||
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute, double dailyWageUnAffected, bool totalLeaveCompute)
|
||||
|
||||
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute,bool totalLeaveCompute)
|
||||
{
|
||||
return _rollCallMandatoryRepository.MandatoryCompute(employeeId,workshopId, contractStart, contractEnd, command, holidayWorking, isStaticCheckout, rotatingShiftCompute, dailyWageUnAffected, totalLeaveCompute);
|
||||
|
||||
return _rollCallMandatoryRepository.MandatoryCompute(employeeId,workshopId, contractStart, contractEnd, command, holidayWorking, isStaticCheckout, rotatingShiftCompute, totalLeaveCompute);
|
||||
}
|
||||
|
||||
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd,
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Sms;
|
||||
using _0_Framework.Application.UID;
|
||||
using _0_Framework.Exceptions;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.InstitutionPlanAgg;
|
||||
using Company.Domain.TemporaryClientRegistrationAgg;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using IPE.SmsIrClient.Models.Results;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PersianTools.Core;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
@@ -28,7 +31,11 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
private readonly IInstitutionContractTempRepository _institutionContractTempRepository;
|
||||
private readonly ISmsService _smsService;
|
||||
|
||||
public TemporaryClientRegistrationApplication(IContractingPartyTempRepository contractingPartyTempRepository, IPersonalContractingPartyRepository personalContractingPartyRepository, IUidService uidService, IWorkshopTempRepository workshopTempRepository, IPlanPercentageRepository planPercentageRepository, IWorkshopServicesTempRepository workshopServicesTempRepository, IInstitutionContractTempRepository institutionContractTempRepository, ISmsService smsService)
|
||||
public TemporaryClientRegistrationApplication(IContractingPartyTempRepository contractingPartyTempRepository,
|
||||
IPersonalContractingPartyRepository personalContractingPartyRepository, IUidService uidService,
|
||||
IWorkshopTempRepository workshopTempRepository, IPlanPercentageRepository planPercentageRepository,
|
||||
IWorkshopServicesTempRepository workshopServicesTempRepository,
|
||||
IInstitutionContractTempRepository institutionContractTempRepository, ISmsService smsService)
|
||||
{
|
||||
_contractingPartyTempRepository = contractingPartyTempRepository;
|
||||
_personalContractingPartyRepository = personalContractingPartyRepository;
|
||||
@@ -47,7 +54,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// <param name="dateOfBirth"></param>
|
||||
/// <param name="mobile"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<OperationResult<ContractingPartyTempViewModel>> CreateContractingPartyTemp(string nationalCode, string dateOfBirth, string mobile)
|
||||
public async Task<OperationResult<ContractingPartyTempViewModel>> CreateContractingPartyTemp(string nationalCode,
|
||||
string dateOfBirth, string mobile)
|
||||
{
|
||||
var op = new OperationResult<ContractingPartyTempViewModel>();
|
||||
|
||||
@@ -67,12 +75,11 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (!mobile.IsMobileValid())
|
||||
return op.Failed("شماره همراه نا معتبر است");
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
var getExistContractingParty = await _contractingPartyTempRepository.CheckExistOrAuthenticated(nationalCode, dateOfBirth);
|
||||
var getExistContractingParty =
|
||||
await _contractingPartyTempRepository.CheckExistOrAuthenticated(nationalCode, dateOfBirth);
|
||||
|
||||
//اگر طرف حساب قبلا در دیتابیس وجود داشت
|
||||
if (getExistContractingParty)
|
||||
@@ -96,8 +103,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
|
||||
if (institutionContractTemp != null)
|
||||
{
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "Completed")
|
||||
if (institutionContractTemp.RegistrationStatus == InstitutionContractTempStatus.Completed)
|
||||
return op.Failed("شما قبلا ثبت نام خود را تکمیل نموده اید");
|
||||
}
|
||||
|
||||
@@ -106,8 +112,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (getExistTemp.Phone != mobile)
|
||||
return op.Failed("شما قبلا با شماره همراه دیگری ثبت نام نموده اید");
|
||||
return op.Succcedded(getExistTemp);
|
||||
|
||||
}
|
||||
|
||||
//چک کردن مطابقت شماره همراه و کد ملی
|
||||
var isMachMobilAndNationalCode = await _uidService.IsMachPhoneWithNationalCode(nationalCode, mobile);
|
||||
if (isMachMobilAndNationalCode == null)
|
||||
@@ -119,13 +125,17 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
var apiRespons = await _uidService.GetPersonalInfo(nationalCode, dateOfBirth);
|
||||
|
||||
if (apiRespons == null)
|
||||
return op.Failed("خطا در سرویس احراز هویت");
|
||||
throw new InternalServerException("خطا در سرویس احراز هویت");
|
||||
|
||||
if (apiRespons.ResponseContext.Status.Code ==14)
|
||||
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
|
||||
|
||||
if (apiRespons.ResponseContext.Status.Code != 0)
|
||||
return op.Failed($"{apiRespons.ResponseContext.Status.Message}");
|
||||
|
||||
var idNumber = apiRespons.IdentificationInformation.ShenasnamehNumber == "0"
|
||||
? apiRespons.IdentificationInformation.NationalId
|
||||
: apiRespons.IdentificationInformation.ShenasnamehNumber;
|
||||
? apiRespons.IdentificationInformation.NationalId
|
||||
: apiRespons.IdentificationInformation.ShenasnamehNumber;
|
||||
|
||||
//ایجاد طرف حساب موقت
|
||||
var createTemp = new ContractingPartyTemp(apiRespons.BasicInformation.FirstName,
|
||||
@@ -148,9 +158,6 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
|
||||
return op.Succcedded(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -161,7 +168,6 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// <param name="city"></param>
|
||||
/// <param name="address"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public async Task<OperationResult> UpdateAddress(long id, string state, string city, string address)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
@@ -191,7 +197,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command, long contractingPartyTempId)
|
||||
public async Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command,
|
||||
long contractingPartyTempId)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
var updateWorkshopList = command.Where(x => x.Id > 0).ToList();
|
||||
@@ -202,6 +209,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
var oldWorkshops = await _workshopTempRepository.GetWorkshopTemp(contractingPartyTempId);
|
||||
|
||||
#region Update
|
||||
|
||||
if (updateWorkshopList.Count > 0)
|
||||
{
|
||||
var updateListIds = updateWorkshopList.Select(x => x.Id).ToList();
|
||||
@@ -213,7 +221,6 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
|
||||
foreach (var workshop in updateWorkshopList)
|
||||
{
|
||||
|
||||
if (string.IsNullOrWhiteSpace(workshop.WorkshopName))
|
||||
return op.Failed("نام مجموعه نمی تواند خالی باشد");
|
||||
if (workshop.CountPerson == 0)
|
||||
@@ -235,7 +242,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (plan.OnlineAndInPersonSumAmountDouble > 0)
|
||||
{
|
||||
//ویرایش مشخصات کارگاه
|
||||
existWorkshops.Edit(workshop.WorkshopName, workshop.CountPerson, plan.OnlineAndInPersonSumAmountDouble);
|
||||
existWorkshops.Edit(workshop.WorkshopName, workshop.CountPerson,
|
||||
plan.OnlineAndInPersonSumAmountDouble);
|
||||
await _workshopTempRepository.SaveChangesAsync();
|
||||
|
||||
//حذف سرویس های قبلی
|
||||
@@ -248,7 +256,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
//سرویس خدمات حضوری قرارداد
|
||||
if (workshop.ContractAndCheckoutInPerson)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("ContractAndCheckoutInPerson", workshop.CountPerson, workshop.Id));
|
||||
new WorkshopServicesTemp("ContractAndCheckoutInPerson", workshop.CountPerson,
|
||||
workshop.Id));
|
||||
|
||||
//سرویس بیمه
|
||||
if (workshop.Insurance)
|
||||
@@ -270,12 +279,10 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
|
||||
await _workshopServicesTempRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Create
|
||||
@@ -284,7 +291,6 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
{
|
||||
foreach (var workshop in createNewWorkshopList)
|
||||
{
|
||||
|
||||
if (string.IsNullOrWhiteSpace(workshop.WorkshopName))
|
||||
return op.Failed("نام مجموعه نمی تواند خالی باشد");
|
||||
if (workshop.CountPerson == 0)
|
||||
@@ -302,23 +308,22 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
var plan = _planPercentageRepository.GetInstitutionPlanForWorkshop(workshop);
|
||||
if (plan.OnlineAndInPersonSumAmountDouble > 0)
|
||||
{
|
||||
|
||||
|
||||
var createNewWorkshopTemp = new WorkshopTemp(workshop.WorkshopName, workshop.CountPerson,
|
||||
workshop.ContractingPartyTempId, plan.OnlineAndInPersonSumAmountDouble);
|
||||
await _workshopTempRepository.CreateAsync(createNewWorkshopTemp);
|
||||
await _workshopTempRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
|
||||
//سرویس قرداد
|
||||
if (workshop.ContractAndCheckout)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("ContractAndCheckout", workshop.CountPerson, createNewWorkshopTemp.id));
|
||||
new WorkshopServicesTemp("ContractAndCheckout", workshop.CountPerson,
|
||||
createNewWorkshopTemp.id));
|
||||
//سرویس خدمات حضوری قرارداد
|
||||
if (workshop.ContractAndCheckoutInPerson)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("ContractAndCheckoutInPerson", workshop.CountPerson, createNewWorkshopTemp.id));
|
||||
new WorkshopServicesTemp("ContractAndCheckoutInPerson", workshop.CountPerson,
|
||||
createNewWorkshopTemp.id));
|
||||
|
||||
//سرویس بیمه
|
||||
if (workshop.Insurance)
|
||||
@@ -327,7 +332,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
//سرویس خدمات حضوری بیمه
|
||||
if (workshop.InsuranceInPerson)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("InsuranceInPerson", workshop.CountPerson, createNewWorkshopTemp.id));
|
||||
new WorkshopServicesTemp("InsuranceInPerson", workshop.CountPerson,
|
||||
createNewWorkshopTemp.id));
|
||||
|
||||
//سرویس حضورغیاب
|
||||
if (workshop.RollCall)
|
||||
@@ -336,11 +342,11 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
//سرویس فیش غیر رسمی
|
||||
if (workshop.CustomizeCheckout)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("CustomizeCheckout", workshop.CountPerson, createNewWorkshopTemp.id));
|
||||
new WorkshopServicesTemp("CustomizeCheckout", workshop.CountPerson,
|
||||
createNewWorkshopTemp.id));
|
||||
|
||||
await _workshopServicesTempRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,125 +373,257 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId, string periodModel = "12", string paymentModel = "OneTime", string contractStartType = "currentMonth")
|
||||
public async Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId,
|
||||
InstitutionContractDuration duration = InstitutionContractDuration.TwelveMonths,
|
||||
string paymentModel = "OneTime", string contractStartType = "currentMonth")
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
// //دریافت کارگاه ها
|
||||
// var workshops = await _workshopTempRepository.GetWorkshopTemp(contractingPartyTempId);
|
||||
//
|
||||
// double totalPayment1MonthDouble = 0;
|
||||
//
|
||||
// //بدست آوردن جمع کل برای یک ماه
|
||||
// foreach (var workshop in workshops)
|
||||
// {
|
||||
// totalPayment1MonthDouble += workshop.WorkshopServicesAmount;
|
||||
// }
|
||||
//
|
||||
// if (totalPayment1MonthDouble == 0)
|
||||
// return new ReviewAndPaymentViewModel();
|
||||
//
|
||||
// var result = new ReviewAndPaymentViewModel();
|
||||
//
|
||||
// int months = 0;
|
||||
// months = (int)duration;
|
||||
// //رند کردن مبالغ کارگاه ها
|
||||
// var roundAmount = (((Convert.ToInt64(totalPayment1MonthDouble))) / 1000000) * 1000000;
|
||||
// double roundAmount2 = roundAmount;
|
||||
// //بدست آوردن جمع کل مبالغ کارگاه بر اساس مدت قراداد
|
||||
// result.SumOfWorkshopsPaymentDouble = months * roundAmount2;
|
||||
// result.SumOfWorkshopsPaymentPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
//
|
||||
//
|
||||
// result.Duration = duration;
|
||||
// result.PaymentModel = paymentModel;
|
||||
//
|
||||
//
|
||||
// var tenPercent = result.SumOfWorkshopsPaymentDouble * 10 / 100;
|
||||
// //مالیات
|
||||
// result.ValueAddedTaxDouble = tenPercent;
|
||||
// result.ValueAddedTaxStr = tenPercent.ToMoney();
|
||||
// //پرداخت یکجا
|
||||
//
|
||||
// #region OneTimePaymentResult
|
||||
//
|
||||
// double discountOneTimePeyment = result.SumOfWorkshopsPaymentDouble - tenPercent;
|
||||
//
|
||||
//
|
||||
// //مبلغ بدون مالیات و با تخفیف
|
||||
// result.OneTimeWithoutTaxPaymentDouble = discountOneTimePeyment;
|
||||
// result.OneTimeWithoutTaxPaymentStr = discountOneTimePeyment.ToMoney();
|
||||
//
|
||||
// //مبلغ با مالیات
|
||||
// result.OneTimeTotalPaymentDouble = discountOneTimePeyment + tenPercent;
|
||||
// result.OneTimeTotalPaymentStr = result.OneTimeTotalPaymentDouble.ToMoney();
|
||||
//
|
||||
// #endregion
|
||||
//
|
||||
// //پرداخت ماهیانه
|
||||
//
|
||||
// #region MonthlyPaymentResult
|
||||
//
|
||||
// //مبلغ بدون مالیات
|
||||
// result.MonthlyWithoutTaxPaymentDouble = result.SumOfWorkshopsPaymentDouble;
|
||||
// result.MonthlyWithoutTaxPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
//
|
||||
// // مبلغ با مالیات
|
||||
// result.MonthlyTotalPaymentDouble = result.SumOfWorkshopsPaymentDouble + tenPercent;
|
||||
// result.MonthlyTotalPaymentStr = result.MonthlyTotalPaymentDouble.ToMoney();
|
||||
// var installmentList = new List<MonthlyInstallment>();
|
||||
//
|
||||
// var startDate = (DateTime.Now).ToFarsi();
|
||||
// result.ContractStartCurrentMonthFa = $"{startDate.Substring(0, 8)}01";
|
||||
// result.ContractStartCurrentMonthGr = result.ContractStartCurrentMonthFa.ToGeorgianDateTime();
|
||||
// startDate = result.ContractStartCurrentMonthFa;
|
||||
//
|
||||
// result.ContractStartNextMonthGr = ((startDate.FindeEndOfMonth()).ToGeorgianDateTime()).AddDays(1);
|
||||
// result.ContractStartNextMonthFa = result.ContractStartNextMonthGr.ToFarsi();
|
||||
//
|
||||
// if (contractStartType == "nextMonth")
|
||||
// startDate = result.ContractStartNextMonthFa;
|
||||
//
|
||||
//
|
||||
// var findeEnd = Tools.FindEndOfContract(startDate, ((int)duration).ToString());
|
||||
// var contractEndDate = findeEnd.endDateGr;
|
||||
// result.ContractEndGr = contractEndDate;
|
||||
// result.ContractEndFa = contractEndDate.ToFarsi();
|
||||
//
|
||||
// if (duration == InstitutionContractDuration.OneMonth)
|
||||
// {
|
||||
// installmentList.Add(new MonthlyInstallment()
|
||||
// {
|
||||
// InstallmentAmountStr = result.MonthlyTotalPaymentStr,
|
||||
// InstallmentCounter = "سررسید پرداخت اول",
|
||||
// InstalmentDate = (DateTime.Now).ToFarsi()
|
||||
// });
|
||||
// result.MonthlyInstallments = installmentList;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// int instalmentCount = (int)duration;
|
||||
// var instalmentAmount = result.MonthlyTotalPaymentDouble / instalmentCount;
|
||||
// var findEndOfMonth = startDate.FindeEndOfMonth();
|
||||
// for (int i = 1; i <= instalmentCount; i++)
|
||||
// {
|
||||
// if (i == 1)
|
||||
// {
|
||||
// startDate = (DateTime.Now).ToFarsi();
|
||||
// }
|
||||
// else if (i > 1)
|
||||
// {
|
||||
// var currentMonthStart = ((findEndOfMonth.ToGeorgianDateTime()).AddDays(1)).ToFarsi();
|
||||
// startDate = currentMonthStart.FindeEndOfMonth();
|
||||
// findEndOfMonth = startDate;
|
||||
// }
|
||||
//
|
||||
// installmentList.Add(new MonthlyInstallment()
|
||||
// {
|
||||
// InstallmentAmountStr = instalmentAmount.ToMoney(),
|
||||
// InstallmentCounter = i switch
|
||||
// {
|
||||
// 1 => "سررسید پرداخت اول",
|
||||
// 2 => "سررسید پرداخت دوم",
|
||||
// 3 => "سررسید پرداخت سوم",
|
||||
// 4 => "سررسید پرداخت چهارم",
|
||||
// 5 => "سررسید پرداخت پنجم",
|
||||
// 6 => "سررسید پرداخت ششم",
|
||||
// 7 => "سررسید پرداخت هفتم",
|
||||
// 8 => "سررسید پرداخت هشتم",
|
||||
// 9 => "سررسید پرداخت نهم",
|
||||
// 10 => "سررسید پرداخت دهم",
|
||||
// 11 => "سررسید پرداخت یازدهم",
|
||||
// 12 => "سررسید پرداخت دوازدهم",
|
||||
// _ => "سررسید پرداخت دوازدهم",
|
||||
// },
|
||||
// InstalmentDate = startDate
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// #endregion
|
||||
//
|
||||
// result.MonthlyInstallments = installmentList;
|
||||
// result.ContractingPartTempId = contractingPartyTempId;
|
||||
//
|
||||
// return result;
|
||||
}
|
||||
|
||||
|
||||
public async Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(double totalPaymentMonth,
|
||||
InstitutionContractDuration duration, bool hasInPersonContract)
|
||||
{
|
||||
//دریافت کارگاه ها
|
||||
var workshops = await _workshopTempRepository.GetWorkshopTemp(contractingPartyTempId);
|
||||
|
||||
double totalPayment1MonthDouble = 0;
|
||||
|
||||
//بدست آوردن جمع کل برای یک ماه
|
||||
foreach (var workshop in workshops)
|
||||
{
|
||||
totalPayment1MonthDouble += workshop.WorkshopServicesAmount;
|
||||
}
|
||||
// //بدست آوردن جمع کل برای یک ماه
|
||||
// foreach (var workshop in workshops)
|
||||
// {
|
||||
// totalPayment1MonthDouble += workshop.WorkshopServicesAmount;
|
||||
// }
|
||||
|
||||
totalPayment1MonthDouble = totalPaymentMonth;
|
||||
if (totalPayment1MonthDouble == 0)
|
||||
return new ReviewAndPaymentViewModel();
|
||||
|
||||
var result = new ReviewAndPaymentViewModel();
|
||||
|
||||
int months = 0;
|
||||
months = periodModel switch
|
||||
{
|
||||
"1" => 1,
|
||||
"3" => 3,
|
||||
"6" => 6,
|
||||
"12" => 12,
|
||||
_ => 12,
|
||||
};
|
||||
var months = (int)duration;
|
||||
//رند کردن مبالغ کارگاه ها
|
||||
var roundAmount = (((Convert.ToInt64(totalPayment1MonthDouble))) / 1000000) * 1000000;
|
||||
double roundAmount2 = roundAmount;
|
||||
|
||||
double roundAmount2 = totalPayment1MonthDouble;
|
||||
//بدست آوردن جمع کل مبالغ کارگاه بر اساس مدت قراداد
|
||||
result.SumOfWorkshopsPaymentDouble = months * roundAmount2;
|
||||
result.SumOfWorkshopsPaymentPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
var sumOfWorkshopsPaymentDouble = months * roundAmount2;
|
||||
result.SumOfWorkshopsPayment = roundAmount2.ToMoney();
|
||||
var installmentstart = (DateTime.Now).ToFarsi();
|
||||
|
||||
var originalDay = int.Parse(installmentstart.Substring(8, 2));
|
||||
result.ContractStartFa = installmentstart;
|
||||
result.ContractStartGr = result.ContractStartFa.ToGeorgianDateTime();
|
||||
|
||||
result.PeriodModel = periodModel;
|
||||
result.PaymentModel = paymentModel;
|
||||
|
||||
|
||||
var tenPercent = result.SumOfWorkshopsPaymentDouble * 10 / 100;
|
||||
//مالیات
|
||||
result.ValueAddedTaxDouble = tenPercent;
|
||||
result.ValueAddedTaxSt = tenPercent.ToMoney();
|
||||
//پرداخت یکجا
|
||||
#region OneTimePaymentResult
|
||||
|
||||
double discountOneTimePeyment = result.SumOfWorkshopsPaymentDouble - tenPercent;
|
||||
|
||||
|
||||
//مبلغ بدون مالیات و با تخفیف
|
||||
result.OneTimeWithoutTaxPaymentDouble = discountOneTimePeyment;
|
||||
result.OneTimeWithoutTaxPaymentStr = discountOneTimePeyment.ToMoney();
|
||||
|
||||
//مبلغ با مالیات
|
||||
result.OneTimeTotalPaymentDouble = discountOneTimePeyment + tenPercent;
|
||||
result.OneTimeTotalPaymentStr = result.OneTimeTotalPaymentDouble.ToMoney();
|
||||
|
||||
#endregion
|
||||
|
||||
//پرداخت ماهیانه
|
||||
#region MonthlyPaymentResult
|
||||
|
||||
//مبلغ بدون مالیات
|
||||
result.MonthlyWithoutTaxPaymentDouble = result.SumOfWorkshopsPaymentDouble;
|
||||
result.MonthlyWithoutTaxPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
|
||||
// مبلغ با مالیات
|
||||
result.MonthlyTotalPaymentDouble = result.SumOfWorkshopsPaymentDouble + tenPercent;
|
||||
result.MonthlyTotalPaymentStr = result.MonthlyTotalPaymentDouble.ToMoney();
|
||||
var installmentList = new List<MonthlyInstallment>();
|
||||
|
||||
var startDate = (DateTime.Now).ToFarsi();
|
||||
result.ContractStartCurrentMonthFa = $"{startDate.Substring(0, 8)}01";
|
||||
result.ContractStartCurrentMonthGr = result.ContractStartCurrentMonthFa.ToGeorgianDateTime();
|
||||
startDate = result.ContractStartCurrentMonthFa;
|
||||
|
||||
result.ContractStartNextMonthGr = ((startDate.FindeEndOfMonth()).ToGeorgianDateTime()).AddDays(1);
|
||||
result.ContractStartNextMonthFa = result.ContractStartNextMonthGr.ToFarsi();
|
||||
|
||||
if (contractStartType == "nextMonth")
|
||||
startDate = result.ContractStartNextMonthFa;
|
||||
|
||||
|
||||
|
||||
var findeEnd = Tools.FindEndOfContract(startDate, periodModel);
|
||||
var findeEnd = Tools.FindEndOfContract(installmentstart, ((int)duration).ToString());
|
||||
var contractEndDate = findeEnd.endDateGr;
|
||||
result.ContractEndGr = contractEndDate;
|
||||
result.ContractEndFa = contractEndDate.ToFarsi();
|
||||
|
||||
if (periodModel == "1")
|
||||
if (hasInPersonContract)
|
||||
{
|
||||
var tenPercent = sumOfWorkshopsPaymentDouble * 10 / 100;
|
||||
//مالیات
|
||||
result.ValueAddedTaxStr = tenPercent.ToMoney();
|
||||
//پرداخت یکجا
|
||||
|
||||
installmentList.Add(new MonthlyInstallment()
|
||||
{
|
||||
InstallmentAmountStr = result.MonthlyTotalPaymentStr,
|
||||
InstallmentCounter = "سررسید پرداخت اول",
|
||||
InstalmentDate = (DateTime.Now).ToFarsi()
|
||||
#region OneTimePaymentResult
|
||||
|
||||
});
|
||||
result.MonthlyInstallments = installmentList;
|
||||
}
|
||||
else
|
||||
{
|
||||
int instalmentCount = Convert.ToInt32(periodModel);
|
||||
var instalmentAmount = result.MonthlyTotalPaymentDouble / instalmentCount;
|
||||
var findEndOfMonth = startDate.FindeEndOfMonth();
|
||||
double discountOneTimePeyment = sumOfWorkshopsPaymentDouble - tenPercent;
|
||||
|
||||
|
||||
//مبلغ بدون مالیات و با تخفیف
|
||||
result.OneTimeWithoutTaxPaymentStr = discountOneTimePeyment.ToMoney();
|
||||
|
||||
//مبلغ با مالیات
|
||||
var oneTimePayment = discountOneTimePeyment + tenPercent;
|
||||
result.OneTimeTotalPaymentStr = oneTimePayment.ToMoney();
|
||||
result.DiscountedAmountForOneMonth = roundAmount2.ToMoney();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
//پرداخت ماهیانه
|
||||
|
||||
#region MonthlyPaymentResult
|
||||
|
||||
//مبلغ بدون مالیات
|
||||
|
||||
result.MonthlyWithoutTaxPaymentStr = sumOfWorkshopsPaymentDouble.ToMoney();
|
||||
|
||||
// مبلغ با مالیات
|
||||
var monthlyTotalPaymentDouble = sumOfWorkshopsPaymentDouble + tenPercent;
|
||||
result.MonthlyTotalPaymentStr = monthlyTotalPaymentDouble.ToMoney();
|
||||
var installmentList = new List<MonthlyInstallment>();
|
||||
|
||||
|
||||
int instalmentCount = (int)duration;
|
||||
var instalmentAmount = monthlyTotalPaymentDouble / instalmentCount;
|
||||
int currentInstallmentStartDay = int.Parse(installmentstart.Substring(8, 2));
|
||||
bool endOfMonth = currentInstallmentStartDay == 31;
|
||||
|
||||
// Loop through each installment period
|
||||
for (int i = 1; i <= instalmentCount; i++)
|
||||
{
|
||||
string installmentDate;
|
||||
// For first installment, use the initial date
|
||||
if (i == 1)
|
||||
{
|
||||
startDate = (DateTime.Now).ToFarsi();
|
||||
|
||||
installmentDate = installmentstart;
|
||||
}
|
||||
else if (i > 1)
|
||||
else
|
||||
{
|
||||
var currentMonthStart = ((findEndOfMonth.ToGeorgianDateTime()).AddDays(1)).ToFarsi();
|
||||
startDate = currentMonthStart.FindeEndOfMonth();
|
||||
findEndOfMonth = startDate;
|
||||
var currentDay = int.Parse(installmentstart.Substring(8, 2));
|
||||
var currentMonth = int.Parse(installmentstart.Substring(5, 2));
|
||||
var currentYear = int.Parse(installmentstart.Substring(0, 4));
|
||||
|
||||
// Get next month's date
|
||||
var nextMonthFa = installmentstart.ToGeorgianDateTime().AddMonthsFa(1, out var nextMonth);
|
||||
var maxDayInNextMonth = int.Parse(nextMonthFa.FindeEndOfMonth().Substring(8, 2));
|
||||
|
||||
// Use original day if possible, otherwise use last day of month
|
||||
var dayToUse = Math.Min(originalDay, maxDayInNextMonth);
|
||||
installmentDate = nextMonthFa.Substring(0, 8) + dayToUse.ToString("D2");
|
||||
|
||||
// Update installmentstart for next iteration
|
||||
installmentstart = installmentDate;
|
||||
}
|
||||
|
||||
installmentList.Add(new MonthlyInstallment()
|
||||
@@ -493,34 +631,52 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
InstallmentAmountStr = instalmentAmount.ToMoney(),
|
||||
InstallmentCounter = i switch
|
||||
{
|
||||
1 => "سررسید پرداخت اول",
|
||||
2 => "سررسید پرداخت دوم",
|
||||
3 => "سررسید پرداخت سوم",
|
||||
4 => "سررسید پرداخت چهارم",
|
||||
5 => "سررسید پرداخت پنجم",
|
||||
6 => "سررسید پرداخت ششم",
|
||||
7 => "سررسید پرداخت هفتم",
|
||||
8 => "سررسید پرداخت هشتم",
|
||||
9 => "سررسید پرداخت نهم",
|
||||
10 => "سررسید پرداخت دهم",
|
||||
11 => "سررسید پرداخت یازدهم",
|
||||
12 => "سررسید پرداخت دوازدهم",
|
||||
_ => "سررسید پرداخت دوازدهم",
|
||||
1 => "اول",
|
||||
2 => "دوم",
|
||||
3 => "سوم",
|
||||
4 => "چهارم",
|
||||
5 => "پنجم",
|
||||
6 => "ششم",
|
||||
7 => "هفتم",
|
||||
8 => "هشتم",
|
||||
9 => "نهم",
|
||||
10 => "دهم",
|
||||
11 => "یازدهم",
|
||||
12 => "دوازدهم",
|
||||
_ => "دوازدهم",
|
||||
},
|
||||
InstalmentDate = startDate
|
||||
|
||||
InstalmentDate = installmentDate
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
result.MonthlyInstallments = installmentList;
|
||||
}
|
||||
else
|
||||
{
|
||||
var discount = duration switch
|
||||
{
|
||||
InstitutionContractDuration.OneMonth => 0,
|
||||
InstitutionContractDuration.ThreeMonths => 5,
|
||||
InstitutionContractDuration.SixMonths => 10,
|
||||
InstitutionContractDuration.TwelveMonths => 15,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(duration), duration, null)
|
||||
};
|
||||
|
||||
var oneMonthDiscountAmount = (roundAmount2 * discount) / 100;
|
||||
var totalDiscount = oneMonthDiscountAmount * months;
|
||||
var discountedPayment = sumOfWorkshopsPaymentDouble - totalDiscount;
|
||||
result.Discount = oneMonthDiscountAmount.ToMoney();
|
||||
result.DiscountedAmountForOneMonth = (roundAmount2 - oneMonthDiscountAmount).ToMoney();
|
||||
var taxDouble = (discountedPayment * 10)/100;
|
||||
result.ValueAddedTaxStr =taxDouble.ToMoney();
|
||||
result.OneTimeWithoutTaxPaymentStr = discountedPayment.ToMoney();
|
||||
result.OneTimeTotalPaymentStr =( discountedPayment + taxDouble).ToMoney();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
result.MonthlyInstallments = installmentList;
|
||||
result.ContractingPartTempId = contractingPartyTempId;
|
||||
|
||||
result.DailyCompensation = ((roundAmount2 * 10) / 100).ToMoney();
|
||||
result.Obligation = result.OneTimeWithoutTaxPaymentStr;
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -528,13 +684,12 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax, DateTime contractStart)
|
||||
public async Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId,
|
||||
string periodModel, string paymentModel, double totalPayment, double valueAddedTax, DateTime contractStart)
|
||||
{
|
||||
|
||||
var op = new OperationResult();
|
||||
|
||||
|
||||
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
var contractStartDate = contractStart;
|
||||
@@ -545,7 +700,10 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
{
|
||||
var periodModelInt = Convert.ToInt32(periodModel);
|
||||
|
||||
var create = new InstitutionContractTemp(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractStartDate, contractEndDate, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
var create = new InstitutionContractTemp(contractingPartyTempId, paymentModel, periodModel, totalPayment,
|
||||
contractStartDate, contractEndDate, "official", valueAddedTax, "",
|
||||
InstitutionContractTempStatus.BeforeSendVerifyCode, 0, null,
|
||||
null);
|
||||
_institutionContractTempRepository.Create(create);
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
|
||||
@@ -560,11 +718,13 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (institutionContractTemp.VerifyCodeEndTime != null)
|
||||
{
|
||||
var spaning = (DateTime.Now - institutionContractTemp.VerifyCodeEndTime.Value);
|
||||
if (institutionContractTemp.RegistrationStatus == "VerifyCodeSent" && spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0))
|
||||
if (institutionContractTemp.RegistrationStatus == InstitutionContractTempStatus.VerifyCodeSent &&
|
||||
spaning > new TimeSpan(0, 0, 0) &&
|
||||
spaning < new TimeSpan(0, 1, 0))
|
||||
return op.Failed("شما به تازگی پیامک دریافت نموده اید دو دقیقه صبر کنید و دوباره تلاش کنید");
|
||||
}
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "Completed")
|
||||
if (institutionContractTemp.RegistrationStatus == InstitutionContractTempStatus.Completed)
|
||||
return op.Failed("شما قبلا ثبت نام خود را تکمیل نموده اید");
|
||||
|
||||
|
||||
@@ -572,17 +732,17 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
var contractstart = DateTime.Now;
|
||||
var contractEnd = DateTime.Now.AddMonths(periodModelInt);
|
||||
var update = _institutionContractTempRepository.Get(institutionContractTemp.Id);
|
||||
update.Edit(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractStartDate, contractEndDate, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
update.Edit(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractStartDate,
|
||||
contractEndDate, "official", valueAddedTax, "", InstitutionContractTempStatus.BeforeSendVerifyCode, 0,
|
||||
null, null);
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
|
||||
|
||||
//temporary
|
||||
var res = await PayOffCompleted(contractingPartyTempId);
|
||||
if (!res.IsSuccedded)
|
||||
return op.Failed(res.Message);
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -594,27 +754,25 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// <returns></returns>
|
||||
public async Task<OperationResult> ReceivedCodeFromServer(long contractingPartyTempId)
|
||||
{
|
||||
|
||||
var op = new OperationResult();
|
||||
|
||||
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
if (institutionContractTemp == null)
|
||||
return op.Failed("خطا");
|
||||
|
||||
var update = _institutionContractTempRepository.Get(institutionContractTemp.Id);
|
||||
|
||||
|
||||
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "BeforeSendVerifyCode")
|
||||
if (institutionContractTemp.RegistrationStatus == InstitutionContractTempStatus.BeforeSendVerifyCode)
|
||||
{
|
||||
//ساخت کد شش رقمی
|
||||
Random generator = new Random();
|
||||
String code = generator.Next(1, 1000000).ToString("D6");
|
||||
//ارسال اس ام اس
|
||||
var getContractingPaty = _contractingPartyTempRepository.GetByContractingPartyTempId(contractingPartyTempId);
|
||||
var getContractingPaty =
|
||||
_contractingPartyTempRepository.GetByContractingPartyTempId(contractingPartyTempId);
|
||||
var sendResult = await _smsService.SendVerifyCodeToClient(getContractingPaty.Phone, code);
|
||||
|
||||
if (!sendResult.IsSuccedded)
|
||||
@@ -626,18 +784,16 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
//تغییر وضعیت به ارسال شده
|
||||
if (update != null)
|
||||
{
|
||||
update.Update(code, "VerifyCodeSent", sendResult.MessageId, DateTime.Now, DateTime.Now.AddMinutes(2));
|
||||
update.Update(code, InstitutionContractTempStatus.VerifyCodeSent, sendResult.MessageId, DateTime.Now,
|
||||
DateTime.Now.AddMinutes(2));
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
return op.Succcedded(1, "کد برای شما پیامک شد");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "VerifyCodeSent")
|
||||
if (institutionContractTemp.RegistrationStatus == InstitutionContractTempStatus.VerifyCodeSent)
|
||||
|
||||
{
|
||||
|
||||
if (DateTime.Now < institutionContractTemp.VerifyCodeEndTime.Value)
|
||||
return op.Failed("کد دریافت شده را وارد کنید");
|
||||
var spaning = (DateTime.Now - institutionContractTemp.VerifyCodeEndTime.Value);
|
||||
@@ -650,14 +806,14 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
Random generator = new Random();
|
||||
String code = generator.Next(1, 1000000).ToString("D6");
|
||||
//ارسال اس ام اس
|
||||
var getContractingPaty = _contractingPartyTempRepository.GetByContractingPartyTempId(contractingPartyTempId);
|
||||
var getContractingPaty =
|
||||
_contractingPartyTempRepository.GetByContractingPartyTempId(contractingPartyTempId);
|
||||
var sendResult = await _smsService.SendVerifyCodeToClient(getContractingPaty.Phone, code);
|
||||
|
||||
if (!sendResult.IsSuccedded)
|
||||
return op.Failed($"{sendResult.Message}");
|
||||
|
||||
|
||||
|
||||
//ذخیره کد در دیتا بیس
|
||||
//ذخیره تاریخ ارسال و مهلت پایان
|
||||
//ذخیره آیدی پیامک
|
||||
@@ -665,21 +821,19 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
|
||||
if (update != null)
|
||||
{
|
||||
update.Update(code, "VerifyCodeSent", sendResult.MessageId, DateTime.Now, DateTime.Now.AddMinutes(2));
|
||||
update.Update(code, InstitutionContractTempStatus.VerifyCodeSent, sendResult.MessageId,
|
||||
DateTime.Now,
|
||||
DateTime.Now.AddMinutes(2));
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
return op.Succcedded(1, "کد برای شما پیامک شد");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//if (institutionContractTemp.RegistrationStatus == "ReceivedCodeFromClient")
|
||||
// return op.Succcedded(2, "انتقال به بخش پرداخت");
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "Completed")
|
||||
if (institutionContractTemp.RegistrationStatus == InstitutionContractTempStatus.Completed)
|
||||
return op.Failed("شما قبلا ثبت نام خود را تکمیل نموده اید");
|
||||
return op.Failed("خظا");
|
||||
}
|
||||
@@ -694,32 +848,27 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
public async Task<OperationResult> CheckVerifyCodeIsTrue(long contractingPartyTempId, string verifyCode)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
if (institutionContractTemp == null)
|
||||
var contractingPartyTemp = _contractingPartyTempRepository.Get( contractingPartyTempId);
|
||||
if (contractingPartyTemp == null)
|
||||
return op.Failed("خظا");
|
||||
if (institutionContractTemp.RegistrationStatus != "VerifyCodeSent")
|
||||
return op.Failed("خطا");
|
||||
|
||||
if (institutionContractTemp.VerifyCodeEndTime < DateTime.Now)
|
||||
if (contractingPartyTemp.Status != ContractingPartyTempStatus.InComplete)
|
||||
return op.Failed("شما قبلا ثبت نام خود را تکمیل نموده اید");
|
||||
|
||||
if (contractingPartyTemp.VerifyCodeSentDateTime.AddMinutes(2) < DateTime.Now)
|
||||
return op.Failed("کد شما منقضی شده است");
|
||||
|
||||
if (institutionContractTemp.SendVerifyCodeTime < DateTime.Now && institutionContractTemp.VerifyCodeEndTime >= DateTime.Now)
|
||||
if (contractingPartyTemp.VerifyCodeSentDateTime < DateTime.Now &&
|
||||
contractingPartyTemp.VerifyCodeSentDateTime >= DateTime.Now)
|
||||
{
|
||||
if (institutionContractTemp.VerifyCode == verifyCode)
|
||||
if (contractingPartyTemp.VerifyCode == verifyCode)
|
||||
{
|
||||
|
||||
|
||||
contractingPartyTemp.SetCompleted();
|
||||
await _contractingPartyTempRepository.SaveChangesAsync();
|
||||
return op.Succcedded();
|
||||
}
|
||||
else
|
||||
{
|
||||
return op.Failed("کد وارد شده صحیح نیست");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return op.Failed("کد وارد شده صحیح نیست");
|
||||
}
|
||||
|
||||
@@ -736,10 +885,10 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
|
||||
var temp = _contractingPartyTempRepository.GetByContractingPartyTempId(contractingPartyTempId);
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.Nationalcode == temp.NationalCode))
|
||||
x.Nationalcode == temp.NationalCode))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
var lastArchiveCode = _personalContractingPartyRepository.GetLastArchiveCode();
|
||||
var lastArchiveCode = _personalContractingPartyRepository.GetLastNewArchiveCode();
|
||||
var personalContractingParty = new PersonalContractingParty(temp.FName, temp.LName,
|
||||
temp.NationalCode, temp.IdNumber, "*", "*",
|
||||
"حقیقی",
|
||||
@@ -748,12 +897,13 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
_personalContractingPartyRepository.Create(personalContractingParty);
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
|
||||
personalContractingParty.RegisterComplete(temp.FatherName, temp.IdNumberSeri, temp.IdNumberSerial, temp.DateOfBirth, temp.Gender);
|
||||
personalContractingParty.RegisterComplete(temp.FatherName, temp.IdNumberSeri, temp.IdNumberSerial,
|
||||
temp.DateOfBirth, temp.Gender);
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
var update = _institutionContractTempRepository.Get(institutionContractTemp.Id);
|
||||
update.ChangeRegistrationStatus("Completed");
|
||||
update.ChangeRegistrationStatus(InstitutionContractTempStatus.PendingToCompletion);
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
|
||||
|
||||
@@ -761,10 +911,24 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<RegistrationWorkflowMainList>> RegistrationWorkflowMainList()
|
||||
public async Task<OperationResult> SendAgreementLink(long contractingPartyTempId)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
var contractingPartyTemp = _contractingPartyTempRepository.Get(contractingPartyTempId);
|
||||
if (contractingPartyTemp == null)
|
||||
throw new NotFoundException("طرف حساب یافت نشد");
|
||||
|
||||
return await _institutionContractTempRepository.GetAllCompletedRegistration();
|
||||
if (contractingPartyTemp.Status == ContractingPartyTempStatus.Completed)
|
||||
throw new BadRequestException("شما قبلا ثبت نام خود را تکمیل نموده اید");
|
||||
|
||||
Random generator = new Random();
|
||||
string verifyCode = generator.Next(1, 1000000).ToString("D6");
|
||||
contractingPartyTemp.SetVerifyCode(verifyCode);
|
||||
await _contractingPartyTempRepository.SaveChangesAsync();
|
||||
|
||||
await _smsService.SendVerifyCodeToClient(contractingPartyTemp.Phone, verifyCode);
|
||||
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,6 +19,7 @@ using CompanyManagment.App.Contracts.Workshop;
|
||||
using CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
using CompanyManagment.App.Contracts.WorkshopPlan;
|
||||
using CompanyManagment.EFCore.Migrations;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration.UserSecrets;
|
||||
using Microsoft.Identity.Client;
|
||||
@@ -39,7 +40,12 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
private readonly IRollCallServiceApplication _rollCallServiceApplication;
|
||||
private readonly IPasswordHasher _passwordHasher;
|
||||
|
||||
public WorkshopAppliction(IWorkshopRepository workshopRepository, ILeftWorkRepository leftWorkRepository, ILeftWorkInsuranceRepository leftWorkInsuranceRepository, IWorkshopPlanApplication workshopPlanApplication, IEmployeeApplication employeeApplication, IEmployeeChildrenApplication employeeChildrenApplication, IInstitutionContractRepository institutionContractRepository, IPersonalContractingPartyRepository personalContractingPartyRepository, IRollCallServiceApplication rollCallServiceApplication, IPasswordHasher passwordHasher)
|
||||
public WorkshopAppliction(IWorkshopRepository workshopRepository, ILeftWorkRepository leftWorkRepository,
|
||||
ILeftWorkInsuranceRepository leftWorkInsuranceRepository, IWorkshopPlanApplication workshopPlanApplication,
|
||||
IEmployeeApplication employeeApplication, IEmployeeChildrenApplication employeeChildrenApplication,
|
||||
IInstitutionContractRepository institutionContractRepository,
|
||||
IPersonalContractingPartyRepository personalContractingPartyRepository,
|
||||
IRollCallServiceApplication rollCallServiceApplication, IPasswordHasher passwordHasher)
|
||||
{
|
||||
_workshopRepository = workshopRepository;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
@@ -58,7 +64,7 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
bool createPlanValidations = false;
|
||||
var accountIds = new List<long>();
|
||||
var operation = new OperationResult();
|
||||
if (command.EmployerIdList==null)
|
||||
if (command.EmployerIdList == null)
|
||||
return operation.Failed("لطفا کارفرما را انتخاب نمایید");
|
||||
var employer = command.EmployerIdList.ToList();
|
||||
if (command.AccountIdsList != null)
|
||||
@@ -66,45 +72,49 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
accountIds = command.AccountIdsList.ToList();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(command.TypeOfInsuranceSend) && command.TypeOfInsuranceSend != "false" && string.IsNullOrEmpty(command.InsuranceCode))
|
||||
if (!string.IsNullOrEmpty(command.TypeOfInsuranceSend) && command.TypeOfInsuranceSend != "false" &&
|
||||
string.IsNullOrEmpty(command.InsuranceCode))
|
||||
return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode))
|
||||
return operation.Failed("موارد اجباری را پر کنید");
|
||||
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
|
||||
// return operation.Failed("نام کارگاه تکراری است");
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
|
||||
// return operation.Failed("نام کارگاه تکراری است");
|
||||
|
||||
if (command.ContractTerm != "1" && command.ContractTerm != "ForEver" && (command.CutContractEndOfYear != IsActive.False && command.CutContractEndOfYear != IsActive.True))
|
||||
return operation.Failed("لطفا تیک قرداداد منتهی به پایان سال را تعیین وضعیت کنید");
|
||||
if (command.ContractTerm != "1" && command.ContractTerm != "ForEver" &&
|
||||
(command.CutContractEndOfYear != IsActive.False && command.CutContractEndOfYear != IsActive.True))
|
||||
return operation.Failed("لطفا تیک قرداداد منتهی به پایان سال را تعیین وضعیت کنید");
|
||||
|
||||
if (command.ContractTerm == "1" && command.ContractTerm == "ForEver")
|
||||
command.CutContractEndOfYear = IsActive.None;
|
||||
if (!command.CreateContract)
|
||||
{
|
||||
command.SignContract = false;
|
||||
command.CreateCheckout = false;
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
if (command.ContractTerm == "1" && command.ContractTerm == "ForEver")
|
||||
command.CutContractEndOfYear = IsActive.None;
|
||||
if (!command.CreateContract)
|
||||
{
|
||||
command.SignContract = false;
|
||||
command.CreateCheckout = false;
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
|
||||
if (!command.CreateCheckout)
|
||||
{
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
if (!command.CreateCheckout)
|
||||
{
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
|
||||
|
||||
if (_workshopRepository.Exists(x => !string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode))
|
||||
if (_workshopRepository.Exists(x =>
|
||||
!string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode))
|
||||
return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
|
||||
if (!string.IsNullOrEmpty(command.Address) && string.IsNullOrEmpty(command.State))
|
||||
return operation.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||
if ((!string.IsNullOrEmpty(command.Address) && !string.IsNullOrEmpty(command.State)) && command.City == "شهرستان")
|
||||
if ((!string.IsNullOrEmpty(command.Address) && !string.IsNullOrEmpty(command.State)) &&
|
||||
command.City == "شهرستان")
|
||||
return operation.Failed("لطفا شهر را انتخاب کنید");
|
||||
if (string.IsNullOrEmpty(command.Address) && !string.IsNullOrEmpty(command.State))
|
||||
return operation.Failed("لطفا آدرس را وارد کنید");
|
||||
|
||||
|
||||
|
||||
if (command.FixedSalary)
|
||||
{
|
||||
if (command.InsuranceJobId == 0 || command.InsuranceJobId == null)
|
||||
@@ -115,12 +125,14 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
|
||||
if (command.IsClassified)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(command.CreatePlan.ExecutionDateFa) || command.CreatePlan.ExecutionDateFa.Length < 10)
|
||||
if (string.IsNullOrWhiteSpace(command.CreatePlan.ExecutionDateFa) ||
|
||||
command.CreatePlan.ExecutionDateFa.Length < 10)
|
||||
return operation.Failed("تاریخ اجرای طرح را بصورت صحیح وارد کنید");
|
||||
if(string.IsNullOrWhiteSpace(command.CreatePlan.IncludingDateFa) || command.CreatePlan.IncludingDateFa.Length <10)
|
||||
if (string.IsNullOrWhiteSpace(command.CreatePlan.IncludingDateFa) ||
|
||||
command.CreatePlan.IncludingDateFa.Length < 10)
|
||||
return operation.Failed("تاریخ شمول طرح را بصورت صحیح وارد کنید");
|
||||
var groupCounter = 0;
|
||||
// var planEmployeeCounter = command.CreatePlan.EditWorkshopPlanEmployeeList == null ? 0 : command.CreatePlan.EditWorkshopPlanEmployeeList.Count;
|
||||
// var planEmployeeCounter = command.CreatePlan.EditWorkshopPlanEmployeeList == null ? 0 : command.CreatePlan.EditWorkshopPlanEmployeeList.Count;
|
||||
for (int i = 0; i <= command.CreatePlan.EditGroupPlanlist.Count - 1; i++)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(command.CreatePlan.EditGroupPlanlist[i].AnnualSalaryStr)
|
||||
@@ -129,14 +141,12 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
&& command.CreatePlan.EditGroupPlanlist[i].JobIdList.Count > 0)
|
||||
{
|
||||
groupCounter += 1;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (groupCounter >= 1)
|
||||
{
|
||||
createPlanValidations = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -144,31 +154,37 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
return operation.Failed("وارد کردن اطلاعات تمامی گروه ها الزامی است");
|
||||
}
|
||||
}
|
||||
|
||||
//if (string.IsNullOrWhiteSpace(command.TypeOfInsuranceSend))
|
||||
// return operation.Failed("لطفا نوع ارسال لیست بیمه را مشخص کنید");
|
||||
var account = new AccountViewModel();
|
||||
var institutionContract = new InstitutionContract();
|
||||
|
||||
|
||||
if (command.HasRollCallFreeVip == "true")
|
||||
{
|
||||
institutionContract = _institutionContractRepository.InstitutionContractByEmployerId(employer.FirstOrDefault());
|
||||
institutionContract =
|
||||
_institutionContractRepository.InstitutionContractByEmployerId(employer.FirstOrDefault());
|
||||
if (institutionContract == null)
|
||||
return operation.Failed("بدلیل نداشتن قرار داد مالی نمیتوانید سرویس حضور غیاب را فعال کنید");
|
||||
account = _personalContractingPartyRepository.GetAccountByPersonalContractingParty(institutionContract.ContractingPartyId);
|
||||
if(account == null || account.ClientAreaPermission != "true")
|
||||
account = _personalContractingPartyRepository.GetAccountByPersonalContractingParty(institutionContract
|
||||
.ContractingPartyId);
|
||||
if (account == null || account.ClientAreaPermission != "true")
|
||||
return operation.Failed("بدلیل نداشتن حساب کاربری کلاینت نمیتوانید سرویس حضور غیاب را فعال کنید");
|
||||
|
||||
}
|
||||
var workshop = new Workshop(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode,
|
||||
|
||||
var workshop = new Workshop(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode,
|
||||
command.TypeOfOwnership,
|
||||
command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City,
|
||||
command.Address,
|
||||
command.TypeOfInsuranceSend, command.TypeOfContract,command.ContractTerm,command.AgreementNumber
|
||||
,command.FixedSalary, command.Population,command.InsuranceJobId,command.ZoneName,command.AddBonusesPay,
|
||||
command.AddYearsPay,command.AddLeavePay,command.TotalPaymentHide,command.IsClassified,command.ComputeOptions,
|
||||
command.BonusesOptions,command.YearsOptions,command.HasRollCallFreeVip,command.WorkshopHolidayWorking,
|
||||
command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance, command.CreateContract, command.SignContract,
|
||||
command.CreateCheckout, command.SignCheckout, command.CutContractEndOfYear,command.RotatingShiftCompute, command.IsStaticCheckout);
|
||||
command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber
|
||||
, command.FixedSalary, command.Population, command.InsuranceJobId, command.ZoneName, command.AddBonusesPay,
|
||||
command.AddYearsPay, command.AddLeavePay, command.TotalPaymentHide, command.IsClassified,
|
||||
command.ComputeOptions,
|
||||
command.BonusesOptions, command.YearsOptions, command.HasRollCallFreeVip, command.WorkshopHolidayWorking,
|
||||
command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance, command.CreateContract,
|
||||
command.SignContract,
|
||||
command.CreateCheckout, command.SignCheckout, command.CutContractEndOfYear, command.RotatingShiftCompute,
|
||||
command.IsStaticCheckout, institutionContract.ContractingPartyId);
|
||||
_workshopRepository.Create(workshop);
|
||||
_workshopRepository.SaveChanges();
|
||||
|
||||
@@ -184,20 +200,17 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
MaxPersonValid = 500,
|
||||
Duration = "12",
|
||||
HasCustomizeCheckoutService = command.HasCustomizeCheckoutService
|
||||
|
||||
};
|
||||
};
|
||||
_rollCallServiceApplication.Create(commandSave);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//مشاغل مقطوع
|
||||
if (createPlanValidations)
|
||||
{
|
||||
command.CreatePlan.WorkshopId = workshop.id;
|
||||
var creatPlan = _workshopPlanApplication.CreateWorkshopPlan(command.CreatePlan);
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach (var e in employer)
|
||||
{
|
||||
@@ -208,9 +221,7 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
var op = _workshopRepository.CreateAccountLeftWorkAndWorkshopAccounts(accountIds, workshop.id);
|
||||
|
||||
|
||||
|
||||
return operation.Succcedded();
|
||||
|
||||
}
|
||||
|
||||
public OperationResult Edit(EditWorkshop command)
|
||||
@@ -228,44 +239,48 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
{
|
||||
accountIds = command.AccountIdsList.ToList();
|
||||
}
|
||||
|
||||
if (workshop == null)
|
||||
operation.Failed("رکورد مورد نظر وجود ندارد");
|
||||
if (command.EmployerIdList == null)
|
||||
return operation.Failed("لطفا کارفرما را انتخاب نمایید");
|
||||
var employer = command.EmployerIdList.ToList();
|
||||
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
|
||||
// return operation.Failed(" نام کارگاه تکراری است ");
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
|
||||
// return operation.Failed(" نام کارگاه تکراری است ");
|
||||
|
||||
if (command.ContractTerm != "1" && command.ContractTerm != "ForEver" && (command.CutContractEndOfYear != IsActive.False && command.CutContractEndOfYear != IsActive.True))
|
||||
return operation.Failed("لطفا تیک قرداداد منتهی به پایان سال را تعیین وضعیت کنید");
|
||||
if (command.ContractTerm != "1" && command.ContractTerm != "ForEver" &&
|
||||
(command.CutContractEndOfYear != IsActive.False && command.CutContractEndOfYear != IsActive.True))
|
||||
return operation.Failed("لطفا تیک قرداداد منتهی به پایان سال را تعیین وضعیت کنید");
|
||||
|
||||
if (command.ContractTerm == "1" && command.ContractTerm == "ForEver")
|
||||
command.CutContractEndOfYear = IsActive.None;
|
||||
if (!command.CreateContract)
|
||||
{
|
||||
command.SignContract = false;
|
||||
command.CreateCheckout = false;
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
if (command.ContractTerm == "1" && command.ContractTerm == "ForEver")
|
||||
command.CutContractEndOfYear = IsActive.None;
|
||||
if (!command.CreateContract)
|
||||
{
|
||||
command.SignContract = false;
|
||||
command.CreateCheckout = false;
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
|
||||
if (!command.CreateCheckout)
|
||||
{
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
if (!command.CreateCheckout)
|
||||
{
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
|
||||
|
||||
if (command.TypeOfInsuranceSend != null && string.IsNullOrEmpty(command.InsuranceCode))
|
||||
if (command.TypeOfInsuranceSend != null && string.IsNullOrEmpty(command.InsuranceCode))
|
||||
return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
|
||||
if (_workshopRepository.Exists(x => !string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode && x.id != command.Id))
|
||||
if (_workshopRepository.Exists(x =>
|
||||
!string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode &&
|
||||
x.id != command.Id))
|
||||
return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
|
||||
if (command.Address != null && command.State == null)
|
||||
return operation.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||
if ((command.Address != null && command.State != null) && command.City == "شهرستان")
|
||||
return operation.Failed("لطفا شهر را انتخاب کنید");
|
||||
|
||||
if (command.Address == null && command.State != null)
|
||||
|
||||
if (command.Address == null && command.State != null)
|
||||
return operation.Failed("لطفا آدرس را وارد کنید");
|
||||
|
||||
if (command.ComputeOptions == "0")
|
||||
@@ -280,17 +295,19 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
if (string.IsNullOrWhiteSpace(command.Population))
|
||||
return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
|
||||
}
|
||||
|
||||
var account = new AccountViewModel();
|
||||
var institutionContract = new InstitutionContract();
|
||||
|
||||
|
||||
if (command.HasRollCallFreeVip == "true")
|
||||
{
|
||||
|
||||
institutionContract = _institutionContractRepository.InstitutionContractByEmployerId(employer.FirstOrDefault());
|
||||
institutionContract =
|
||||
_institutionContractRepository.InstitutionContractByEmployerId(employer.FirstOrDefault());
|
||||
if (institutionContract == null)
|
||||
return operation.Failed("بدلیل نداشتن قرار داد مالی نمیتوانید سرویس حضور غیاب را فعال کنید");
|
||||
account = _personalContractingPartyRepository.GetAccountByPersonalContractingParty(institutionContract.ContractingPartyId);
|
||||
account = _personalContractingPartyRepository.GetAccountByPersonalContractingParty(institutionContract
|
||||
.ContractingPartyId);
|
||||
if ((account == null || account.ClientAreaPermission != "true") && command.Id != 11)
|
||||
return operation.Failed("بدلیل نداشتن حساب کاربری کلاینت نمیتوانید سرویس حضور غیاب را فعال کنید");
|
||||
var searchService = _rollCallServiceApplication.GetAllServiceByWorkshopId(command.Id);
|
||||
@@ -309,7 +326,7 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
{
|
||||
var hasService = searchService.FirstOrDefault(x =>
|
||||
x.IsActiveString == "true" && x.StartService <= DateTime.Now &&
|
||||
x.EndService >= DateTime.Now );
|
||||
x.EndService >= DateTime.Now);
|
||||
if (hasService == null)
|
||||
{
|
||||
_rollCallServiceApplication.Create(commandSave);
|
||||
@@ -321,22 +338,18 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
hasService.HasCustomizeCheckoutService != "true")
|
||||
{
|
||||
_rollCallServiceApplication.AddCustomizeCheckoutServiceVip(hasService.Id);
|
||||
}else if (command.HasCustomizeCheckoutService == "false" &&
|
||||
hasService.HasCustomizeCheckoutService == "true")
|
||||
}
|
||||
else if (command.HasCustomizeCheckoutService == "false" &&
|
||||
hasService.HasCustomizeCheckoutService == "true")
|
||||
{
|
||||
_rollCallServiceApplication.StopVipService(hasService.Id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_rollCallServiceApplication.Create(commandSave);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -352,16 +365,18 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
workshop.Edit(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode, command.TypeOfOwnership,
|
||||
|
||||
workshop.Edit(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode, command.TypeOfOwnership,
|
||||
command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City,
|
||||
command.Address,
|
||||
command.TypeOfInsuranceSend, command.TypeOfContract,command.ContractTerm, command.AgreementNumber
|
||||
command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber
|
||||
, command.FixedSalary, command.Population, command.InsuranceJobId, command.ZoneName,
|
||||
command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay, command.TotalPaymentHide,command.IsClassified,
|
||||
command.ComputeOptions,command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip,
|
||||
command.WorkshopHolidayWorking, command.InsuranceCheckoutOvertime,command.InsuranceCheckoutFamilyAllowance,
|
||||
command.CreateContract, command.SignContract, command.CreateCheckout, command.SignCheckout, command.CutContractEndOfYear,command.RotatingShiftCompute, command.IsStaticCheckout);
|
||||
command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay, command.TotalPaymentHide,
|
||||
command.IsClassified,
|
||||
command.ComputeOptions, command.BonusesOptions, command.YearsOptions, command.HasRollCallFreeVip,
|
||||
command.WorkshopHolidayWorking, command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance,
|
||||
command.CreateContract, command.SignContract, command.CreateCheckout, command.SignCheckout,
|
||||
command.CutContractEndOfYear, command.RotatingShiftCompute, command.IsStaticCheckout);
|
||||
_workshopRepository.SaveChanges();
|
||||
|
||||
_workshopRepository.RemoveOldRelation(command.Id);
|
||||
@@ -369,18 +384,18 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
{
|
||||
_workshopRepository.EmployerWorkshop(workshop.id, e);
|
||||
}
|
||||
|
||||
var op = _workshopRepository.EditAccountLeftWorkAndWorkshopAccounts(accountIds, workshop.id);
|
||||
foreach (var item in leftWork)
|
||||
{
|
||||
var editLeft = _leftWorkRepository.Get(item.Id);
|
||||
|
||||
|
||||
editLeft.EditBonuses(command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay);
|
||||
_leftWorkRepository.SaveChanges();
|
||||
|
||||
}
|
||||
|
||||
transaction.Complete();
|
||||
return operation.Succcedded();
|
||||
|
||||
}
|
||||
|
||||
public string GetWorkshopFullname(long id)
|
||||
@@ -396,8 +411,7 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
{
|
||||
workshop.CreatePlan = _workshopPlanApplication.GetWorkshopPlanByWorkshopId(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return workshop;
|
||||
}
|
||||
@@ -411,6 +425,7 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
{
|
||||
return _workshopRepository.GetWorkshopAll();
|
||||
}
|
||||
|
||||
public List<WorkshopViewModel> GetWorkshopAccount()
|
||||
{
|
||||
return _workshopRepository.GetWorkshopAccount();
|
||||
@@ -436,13 +451,17 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
InsurancePerson = x.InsurancePerson,
|
||||
ContractLeft = x.ContractLeft,
|
||||
InsurancetLeft = x.InsurancetLeft,
|
||||
Black = ((x.ContractPerson && x.InsurancePerson && x.InsurancetLeft && x.ContractLeft) || (x.ContractPerson && !x.InsurancePerson && x.ContractLeft) || (x.InsurancePerson && !x.ContractPerson && x.InsurancetLeft)) ? true : false
|
||||
Black = ((x.ContractPerson && x.InsurancePerson && x.InsurancetLeft && x.ContractLeft) ||
|
||||
(x.ContractPerson && !x.InsurancePerson && x.ContractLeft) ||
|
||||
(x.InsurancePerson && !x.ContractPerson && x.InsurancetLeft))
|
||||
? true
|
||||
: false
|
||||
}).ToList();
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
#region Vafa
|
||||
|
||||
public List<PersonnelInfoViewModel> GetPersonnelInfo(PersonnelInfoSearchModel searchModel)
|
||||
{
|
||||
var res = _workshopRepository.GetPersonnelInfo(searchModel.WorkshopId);
|
||||
@@ -464,7 +483,11 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
InsurancePerson = x.InsurancePerson,
|
||||
ContractLeft = x.ContractLeft,
|
||||
InsuranceLeft = x.InsuranceLeft,
|
||||
Black = ((x.ContractPerson && x.InsurancePerson && x.InsuranceLeft && x.ContractLeft) || (x.ContractPerson && !x.InsurancePerson && x.ContractLeft) || (x.InsurancePerson && !x.ContractPerson && x.InsuranceLeft)) ? true : false,
|
||||
Black = ((x.ContractPerson && x.InsurancePerson && x.InsuranceLeft && x.ContractLeft) ||
|
||||
(x.ContractPerson && !x.InsurancePerson && x.ContractLeft) ||
|
||||
(x.InsurancePerson && !x.ContractPerson && x.InsuranceLeft))
|
||||
? true
|
||||
: false,
|
||||
LastStartContractWork = x.LastStartContractWork,
|
||||
LastLeftContractWork = x.LastLeftContractWork,
|
||||
LastStartInsuranceWork = x.LastStartInsuranceWork,
|
||||
@@ -514,7 +537,7 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
var workshop = _workshopRepository.Get(id);
|
||||
if (workshop == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
|
||||
var checkLeftWork = _leftWorkRepository.searchByWorkshopId(id);
|
||||
var checkInsurancLeftWork = _leftWorkInsuranceRepository.searchByWorkshopId(id);
|
||||
if (checkLeftWork.Count > 0 || checkInsurancLeftWork.Count > 0)
|
||||
@@ -525,14 +548,11 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
{
|
||||
workshop.DeActive(workshop.ArchiveCode);
|
||||
_workshopRepository.SaveChanges();
|
||||
return opration.Succcedded(id,"عملیت با موفقیت انجام شد");
|
||||
return opration.Succcedded(id, "عملیت با موفقیت انجام شد");
|
||||
}
|
||||
|
||||
|
||||
|
||||
//var s = workshop.ArchiveCode;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public WorkshopViewModel GetWorkshopInfo(long id)
|
||||
@@ -555,10 +575,8 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
|
||||
#region client
|
||||
|
||||
|
||||
public OperationResult Remove(long id)
|
||||
{
|
||||
|
||||
var opration = new OperationResult();
|
||||
|
||||
bool result = _workshopRepository.Remove(id);
|
||||
@@ -569,14 +587,15 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
}
|
||||
else
|
||||
return opration.Failed("حذف با خطا مواجه نشد");
|
||||
return opration;
|
||||
|
||||
return opration;
|
||||
}
|
||||
|
||||
public List<WorkshopViewModel> GetWorkshopByTextSearchForClient(string textSearch)
|
||||
{
|
||||
return _workshopRepository.GetWorkshopByTextSearchForClient(textSearch);
|
||||
}
|
||||
|
||||
public List<WorkshopViewModel> SearchForClient(WorkshopSearchModel searchModel)
|
||||
{
|
||||
return _workshopRepository.SearchForClient(searchModel);
|
||||
@@ -584,12 +603,12 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
|
||||
public OperationResult CreateForClient(CreateWorkshop command)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public OperationResult EditForClient(EditWorkshop command)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
//public OperationResult CreateForClient(CreateWorkshop command)
|
||||
//{
|
||||
@@ -650,7 +669,6 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
// _workshopRepository.SaveChanges();
|
||||
|
||||
|
||||
|
||||
// foreach (var e in employer)
|
||||
// {
|
||||
// _workshopRepository.EmployerWorkshop(workshop.id, e);
|
||||
@@ -660,7 +678,6 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
// _workshopRepository.CreateWorkshopAccounts(accountIds, workshop.id);
|
||||
|
||||
|
||||
|
||||
// return operation.Succcedded();
|
||||
|
||||
|
||||
@@ -749,6 +766,7 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
{
|
||||
return _workshopRepository.GetWorkshopAccountByAcountID(acountID);
|
||||
}
|
||||
|
||||
public bool CheckAccountWorkshop(long workshopId)
|
||||
{
|
||||
return _workshopRepository.CheckAccountWorkshop(workshopId);
|
||||
@@ -762,17 +780,13 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region NewByHeydari
|
||||
|
||||
public List<WorkshopViewModel> GetWorkshopByTextSearch(string searchText)
|
||||
{
|
||||
return _workshopRepository.GetWorkshopByTextSearch(searchText);
|
||||
|
||||
}
|
||||
|
||||
public List<WorkshopViewModel> SearchForMain(WorkshopSearchModel searchModel)
|
||||
{
|
||||
return _workshopRepository.SearchForMain(searchModel);
|
||||
@@ -789,7 +803,8 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
//var workshopObj = _workshopRepository.Get(id);
|
||||
//workshopObj.DeActive(workshopObj.ArchiveCode);
|
||||
//_workshopRepository.SaveChanges();
|
||||
return _workshopRepository.DeActiveAll(id); ;
|
||||
return _workshopRepository.DeActiveAll(id);
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -804,6 +819,7 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
|
||||
return opration;
|
||||
}
|
||||
|
||||
public OperationResult ActiveAll(long id)
|
||||
{
|
||||
return _workshopRepository.ActiveAll(id);
|
||||
@@ -814,7 +830,6 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
return _workshopRepository.PrintWorkshopList(searchModel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public AccountViewModel GetClientAccountByWorkshopId(long workshopId)
|
||||
{
|
||||
@@ -823,7 +838,6 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
}
|
||||
|
||||
|
||||
|
||||
//public List<ConnectedPersonnelViewModel> GetConnectedPersonnelsForMain(long workshopId)
|
||||
//{
|
||||
// return _workshopRepository.GetConnectedPersonnelsForMain(workshopId);
|
||||
@@ -833,9 +847,9 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
|
||||
|
||||
#region Pooya
|
||||
|
||||
public List<PersonnelInfoViewModel> GetPersonnelInfoRemastered(PersonnelInfoSearchModel searchModel)
|
||||
{
|
||||
|
||||
var res = _workshopRepository.GetPersonnelInfoRemastered(searchModel.WorkshopId);
|
||||
res = res.Select(x => new PersonnelInfoViewModel
|
||||
{
|
||||
@@ -886,23 +900,24 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
res = res.Where(x => x.MaritalStatus == searchModel.MaritalStatus).ToList();
|
||||
return res;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Insurance
|
||||
|
||||
public List<WorkshopViewModel> GetWorkshopSelectListInsuransce()
|
||||
{
|
||||
return _workshopRepository.GetWorkshopSelectListInsuransce();
|
||||
}
|
||||
{
|
||||
return _workshopRepository.GetWorkshopSelectListInsuransce();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mahan
|
||||
|
||||
public async Task<List<WorkshopWithStartedEmployeesDto>> GetWorkshopsForEmployeeStartWork(long accountId)
|
||||
{
|
||||
return await _workshopRepository.GetWorkshopsForEmployeeStartWork(accountId);
|
||||
|
||||
}
|
||||
|
||||
public async Task<int> GetWorkshopsForEmployeeStartWorkCount(long accountId)
|
||||
@@ -925,8 +940,189 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
return await _workshopRepository.GetSelectList(search, id);
|
||||
}
|
||||
|
||||
public async Task<ActionResult<OperationResult>> CreateWorkshopWorkflowRegistration(
|
||||
CreateWorkshopWorkflowRegistration command)
|
||||
{
|
||||
bool createPlanValidations = false;
|
||||
var operation = new OperationResult();
|
||||
var transaction = await _workshopRepository.BeginTransactionAsync();
|
||||
var contractWorkshopDetail =
|
||||
await _institutionContractRepository.GetInstitutionWorkshopDetails(command
|
||||
.InstitutionContractWorkshopDetailId);
|
||||
if (contractWorkshopDetail == null)
|
||||
return operation.Failed("جزئیات قرارداد موسسه یافت نشد");
|
||||
|
||||
var employerIds = contractWorkshopDetail.Employers.Select(x => x.EmployerId).ToList();
|
||||
|
||||
if (employerIds.Count == 0)
|
||||
return operation.Failed("لطفا کارفرما را انتخاب نمایید");
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(command.TypeOfInsuranceSend) && command.TypeOfInsuranceSend != "false" &&
|
||||
string.IsNullOrEmpty(command.InsuranceCode))
|
||||
return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode))
|
||||
return operation.Failed("موارد اجباری را پر کنید");
|
||||
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
|
||||
// return operation.Failed("نام کارگاه تکراری است");
|
||||
|
||||
if (command.ContractTerm != "1" && command.ContractTerm != "ForEver" &&
|
||||
(command.CutContractEndOfYear != IsActive.False && command.CutContractEndOfYear != IsActive.True))
|
||||
return operation.Failed("لطفا تیک قرداداد منتهی به پایان سال را تعیین وضعیت کنید");
|
||||
|
||||
if (command.ContractTerm == "1" && command.ContractTerm == "ForEver")
|
||||
command.CutContractEndOfYear = IsActive.None;
|
||||
if (!command.CreateContract)
|
||||
{
|
||||
command.SignContract = false;
|
||||
command.CreateCheckout = false;
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
|
||||
if (!command.CreateCheckout)
|
||||
{
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
|
||||
|
||||
if (_workshopRepository.Exists(x =>
|
||||
!string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode))
|
||||
return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
|
||||
if (!string.IsNullOrEmpty(command.Address) && string.IsNullOrEmpty(command.Province))
|
||||
return operation.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||
if ((!string.IsNullOrEmpty(command.Address) && !string.IsNullOrEmpty(command.Province)) &&
|
||||
command.City == "شهرستان")
|
||||
return operation.Failed("لطفا شهر را انتخاب کنید");
|
||||
if (string.IsNullOrEmpty(command.Address) && !string.IsNullOrEmpty(command.Province))
|
||||
return operation.Failed("لطفا آدرس را وارد کنید");
|
||||
|
||||
|
||||
if (command.FixedSalary)
|
||||
{
|
||||
if (command.InsuranceJobId == 0 || command.InsuranceJobId == null)
|
||||
return operation.Failed("لطفا صنف را انتخاب کنید");
|
||||
if (string.IsNullOrWhiteSpace(command.Population))
|
||||
return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
|
||||
}
|
||||
|
||||
// if (command.IsClassified)
|
||||
// {
|
||||
// if (string.IsNullOrWhiteSpace(command.CreatePlan.ExecutionDateFa) ||
|
||||
// command.CreatePlan.ExecutionDateFa.Length < 10)
|
||||
// return operation.Failed("تاریخ اجرای طرح را بصورت صحیح وارد کنید");
|
||||
// if (string.IsNullOrWhiteSpace(command.CreatePlan.IncludingDateFa) ||
|
||||
// command.CreatePlan.IncludingDateFa.Length < 10)
|
||||
// return operation.Failed("تاریخ شمول طرح را بصورت صحیح وارد کنید");
|
||||
// var groupCounter = 0;
|
||||
// // var planEmployeeCounter = command.CreatePlan.EditWorkshopPlanEmployeeList == null ? 0 : command.CreatePlan.EditWorkshopPlanEmployeeList.Count;
|
||||
// for (int i = 0; i <= command.CreatePlan.EditGroupPlanlist.Count - 1; i++)
|
||||
// {
|
||||
// if (!string.IsNullOrWhiteSpace(command.CreatePlan.EditGroupPlanlist[i].AnnualSalaryStr)
|
||||
// && !string.IsNullOrWhiteSpace(command.CreatePlan.EditGroupPlanlist[i].BaseSalaryStr)
|
||||
// && !string.IsNullOrWhiteSpace(command.CreatePlan.EditGroupPlanlist[i].JobSalaryStr)
|
||||
// && command.CreatePlan.EditGroupPlanlist[i].JobIdList.Count > 0)
|
||||
// {
|
||||
// groupCounter += 1;
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (groupCounter >= 1)
|
||||
// {
|
||||
// createPlanValidations = true;
|
||||
//
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// createPlanValidations = false;
|
||||
// return operation.Failed("وارد کردن اطلاعات تمامی گروه ها الزامی است");
|
||||
// }
|
||||
// }
|
||||
|
||||
//if (string.IsNullOrWhiteSpace(command.TypeOfInsuranceSend))
|
||||
// return operation.Failed("لطفا نوع ارسال لیست بیمه را مشخص کنید");
|
||||
var account = new AccountViewModel();
|
||||
|
||||
var institutionContract =
|
||||
await _institutionContractRepository.GetIncludeWorkshopDetailsAsync(contractWorkshopDetail
|
||||
.InstitutionContractId);
|
||||
if (institutionContract == null)
|
||||
{
|
||||
return operation.Failed("قرارداد مالی موسسه یافت نشد");
|
||||
}
|
||||
|
||||
if (command.HasRollCallFreeVip == "true")
|
||||
{
|
||||
// if (institutionContract == null)
|
||||
// return operation.Failed("بدلیل نداشتن قرار داد مالی نمیتوانید سرویس حضور غیاب را فعال کنید");
|
||||
|
||||
account = _personalContractingPartyRepository.GetAccountByPersonalContractingParty(institutionContract
|
||||
.ContractingPartyId);
|
||||
if (account == null || account.ClientAreaPermission != "true")
|
||||
return operation.Failed("بدلیل نداشتن حساب کاربری کلاینت نمیتوانید سرویس حضور غیاب را فعال کنید");
|
||||
}
|
||||
|
||||
var workshop = new Workshop(command.WorkshopName, command.SureName, command.InsuranceCode,
|
||||
command.TypeOfOwnership,
|
||||
command.ArchiveCode, command.AgentName, command.AgentPhone, command.Province, command.City,
|
||||
command.Address,
|
||||
command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber
|
||||
, command.FixedSalary, command.Population, command.InsuranceJobId, null, false,
|
||||
command.AddYearsPay, command.AddLeavePay, command.TotalPaymentHide, false,
|
||||
command.ComputeOptions,
|
||||
command.BonusesOptions, command.YearsOptions, command.HasRollCallFreeVip, command.OpenInHolidays,
|
||||
command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance, command.CreateContract,
|
||||
command.SignContract,
|
||||
command.CreateCheckout, command.SignCheckout, command.CutContractEndOfYear, command.RotatingShiftCompute,
|
||||
command.IsStaticCheckout, institutionContract.ContractingPartyId);
|
||||
await _workshopRepository.CreateAsync(workshop);
|
||||
await _workshopRepository.SaveChangesAsync();
|
||||
|
||||
if (command.HasRollCallFreeVip == "true")
|
||||
{
|
||||
var commandSave = new CreateRollCallService()
|
||||
{
|
||||
AccountId = account.Id,
|
||||
WorkshopId = workshop.id,
|
||||
ServiceType = "vip",
|
||||
EndService = institutionContract.ContractEndGr,
|
||||
Amount = 1000,
|
||||
MaxPersonValid = 500,
|
||||
Duration = "12",
|
||||
HasCustomizeCheckoutService = command.HasCustomizeCheckoutService
|
||||
};
|
||||
_rollCallServiceApplication.Create(commandSave);
|
||||
}
|
||||
|
||||
contractWorkshopDetail.SetWorkshopId(workshop.id);
|
||||
await _workshopRepository.SaveChangesAsync();
|
||||
|
||||
foreach (var e in employerIds)
|
||||
{
|
||||
_workshopRepository.EmployerWorkshop(workshop.id, e);
|
||||
}
|
||||
|
||||
var accountIds = StaticWorkshopAccounts.StaticAccountIds.ToList();
|
||||
accountIds.Add(command.SeniorContractAccountId);
|
||||
accountIds.Add(command.JuniorContractAccountId);
|
||||
accountIds.Add(command.SeniorInsuranceAccountId);
|
||||
accountIds.Add(command.JuniorInsuranceAccountId);
|
||||
|
||||
var op = _workshopRepository.CreateAccountLeftWorkAndWorkshopAccounts(accountIds.Distinct().ToList(),
|
||||
workshop.id);
|
||||
|
||||
_institutionContractRepository.UpdateStatusIfNeeded(institutionContract.id);
|
||||
|
||||
if (!op.IsSuccedded)
|
||||
return op;
|
||||
|
||||
await transaction.CommitAsync();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,17 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.YearlySalaryAgg;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.Holiday;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.YearlySalary;
|
||||
using CompanyManagment.EFCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -133,41 +128,6 @@ public class YearlySalaryApplication : IYearlySalaryApplication
|
||||
return _yearlySalaryRepository.GetYearlySalary();
|
||||
}
|
||||
|
||||
public Task<UpgradeManualDailyWageModel> UpgradeManualDailyWage(DateTime newContractStart, DateTime lastContractStart, double lastContractManualDailyWage)
|
||||
{
|
||||
return _yearlySalaryRepository.UpgradeManualDailyWage(newContractStart, lastContractStart,
|
||||
lastContractManualDailyWage);
|
||||
}
|
||||
|
||||
public async Task<BaseYearDataViewModel> BaseYearComputeByContractId(long contractId)
|
||||
{
|
||||
var contract = await _context.Contracts.FirstOrDefaultAsync(x => x.id == contractId);
|
||||
|
||||
var leftWorkList = await _context.LeftWorkList.Where(x=>x.EmployeeId ==contract.EmployeeId && x.WorkshopId == contract.WorkshopIds).Select(x => new LeftWorkViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
LeftWorkDate = x.LeftWorkDate.ToFarsi(),
|
||||
StartWorkDate = x.StartWorkDate.ToFarsi(),
|
||||
LeftWorkDateGr = x.LeftWorkDate,
|
||||
StartWorkDateGr = x.StartWorkDate,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
HasLeft = x.HasLeft,
|
||||
}).ToListAsync();
|
||||
|
||||
var baseYearResult = await _yearlySalaryRepository.BaseYearCompute(contract.ContarctStart, contract.ContractEnd,
|
||||
contract.EmployeeId, contract.WorkshopIds, leftWorkList);
|
||||
|
||||
return baseYearResult;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public async Task<(double dailyWage, long yearlySalaryId)> GetDailyWageByStartEnd(DateTime start, DateTime end)
|
||||
{
|
||||
return await _yearlySalaryRepository.GetDailyWageByStartEnd(start, end);
|
||||
}
|
||||
|
||||
public List<YearlySalaryViewModel> Search(YearlySalarySearchModel searchModel)
|
||||
{
|
||||
return _yearlySalaryRepository.Search(searchModel);
|
||||
|
||||
@@ -65,6 +65,7 @@ using Company.Domain.InsuranceYearlySalaryAgg;
|
||||
using Company.Domain.InsurancJobAgg;
|
||||
using Company.Domain.InsurancWorkshopInfoAgg;
|
||||
using Company.Domain.JobAgg;
|
||||
using Company.Domain.LawAgg;
|
||||
using Company.Domain.LeaveAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using Company.Domain.LeftWorkInsuranceAgg;
|
||||
@@ -118,6 +119,7 @@ using Company.Domain.YearlysSalaryTitleAgg;
|
||||
using CompanyManagment.EFCore.Mapping;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Conventions;
|
||||
using Company.Domain.AuthorizedPersonAgg;
|
||||
using Evidence = Company.Domain.Evidence.Evidence;
|
||||
using Zone = Company.Domain.ZoneAgg.Zone;
|
||||
|
||||
@@ -133,9 +135,7 @@ public class CompanyContext : DbContext
|
||||
public DbSet<EntityModule> EntityModules { get; set; }
|
||||
public DbSet<EntityModuleTextManager> EntityModuleTextManagers { get; set; }
|
||||
public DbSet<EntityBill> EntityBills { get; set; }
|
||||
|
||||
public DbSet<EntityContact> EntityContacts { get; set; }
|
||||
|
||||
//---------Files------------------------------
|
||||
public DbSet<Board> Boards { get; set; }
|
||||
public DbSet<BoardType> BoardTypes { get; set; }
|
||||
@@ -152,7 +152,6 @@ public class CompanyContext : DbContext
|
||||
public DbSet<FileTitle> FileTitles { get; set; }
|
||||
public DbSet<FileTiming> FileTimings { get; set; }
|
||||
public DbSet<FileState> FileStates { get; set; }
|
||||
|
||||
public DbSet<FileAlert> FileAlerts { get; set; }
|
||||
//-------Task Manager----------------------------
|
||||
//public DbSet<Task> Tasks { get; set; }
|
||||
@@ -191,10 +190,17 @@ public class CompanyContext : DbContext
|
||||
public DbSet<PaymentTransaction> PaymentTransactions { get; set; }
|
||||
|
||||
public DbSet<ContractingPartyBankAccount> ContractingPartyBankAccounts { get; set; }
|
||||
|
||||
public DbSet<Law> Laws { get; set; }
|
||||
|
||||
|
||||
public DbSet<PaymentInstrument> PaymentInstruments { get; set; }
|
||||
public DbSet<PaymentInstrumentGroup> PaymentInstrumentGroups { get; set; }
|
||||
public DbSet<AuthorizedPerson> AuthorizedPersons { get; set; }
|
||||
|
||||
|
||||
public DbSet<InstitutionContractContactInfoTemp> InstitutionContractContactInfoTemps { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Pooya
|
||||
@@ -261,13 +267,14 @@ public class CompanyContext : DbContext
|
||||
|
||||
public DbSet<DateSalary> DateSalaries { get; set; }
|
||||
public DbSet<DateSalaryItem> DateSalaryItems { get; set; }
|
||||
|
||||
|
||||
public DbSet<Percentage> Percentages { get; set; }
|
||||
public DbSet<InsuranceJobItem> InsuranceJobItems { get; set; }
|
||||
public DbSet<InsuranceJob> InsuranceJobs { get; set; }
|
||||
public DbSet<InsuranceJobAndJobs> InsuranceJobAndJobsSet { get; set; }
|
||||
public DbSet<InstitutionContractContactInfo> InstitutionContractContactInfos { get; set; }
|
||||
public DbSet<InstitutionContract> InstitutionContractSet { get; set; }
|
||||
public DbSet<InstitutionContractWorkshopDetail> InstitutionContractWorkshopDetails { get; set; }
|
||||
public DbSet<FileEmployer> FileEmployerSet { get; set; }
|
||||
public DbSet<FileEmployee> FileEmployeeSet { get; set; }
|
||||
public DbSet<Representative> RepresentativeSet { get; set; }
|
||||
@@ -279,14 +286,14 @@ public class CompanyContext : DbContext
|
||||
public DbSet<WorkingHours> WorkingHoursSet { get; set; }
|
||||
public DbSet<HolidayItem> HolidayItems { get; set; }
|
||||
public DbSet<Holiday> Holidays { get; set; }
|
||||
public DbSet<MandatoryHours> MandatoryHoursDbSet { get; set; }
|
||||
public DbSet<MandatoryHours> MandatoryHoursDbSet { get; set; }
|
||||
public DbSet<WorkshopEmployer> WorkshopEmployers { get; set; }
|
||||
public DbSet<Job> Jobs { get; set; }
|
||||
public DbSet<Job> Jobs { get; set; }
|
||||
public DbSet<Contract> Contracts { get; set; }
|
||||
public DbSet<YearlySalaryTitle> YearlySalaryTitles { get; set; }
|
||||
public DbSet<YearlySalaryItem> YearlySalaryItems { get; set; }
|
||||
public DbSet<YearlySalary> YearlySalaries { get; set; }
|
||||
public DbSet<EmployeeChildren> EmployeeChildrenSet { get; set; }
|
||||
public DbSet<EmployeeChildren> EmployeeChildrenSet { get; set; }
|
||||
public DbSet<Employee> Employees { get; set; }
|
||||
public DbSet<Workshop> Workshops { get; set; }
|
||||
public DbSet<PersonalContractingParty> PersonalContractingParties { get; set; }
|
||||
@@ -301,15 +308,17 @@ public class CompanyContext : DbContext
|
||||
public DbSet<Employer> Employers { get; set; }
|
||||
|
||||
|
||||
public CompanyContext(DbContextOptions<CompanyContext> options) : base(options)
|
||||
public CompanyContext(DbContextOptions<CompanyContext> options) :base(options)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public CompanyContext()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@@ -317,5 +326,6 @@ public class CompanyContext : DbContext
|
||||
modelBuilder.ApplyConfigurationsFromAssembly(assembly);
|
||||
modelBuilder.Entity<RollCall>().HasQueryFilter(x => x.RollCallModifyType != RollCallModifyType.Undefined);
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
}
|
||||
}
|
||||
60
CompanyManagment.EFCore/Mapping/AuthorizedPersonMapping.cs
Normal file
60
CompanyManagment.EFCore/Mapping/AuthorizedPersonMapping.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using Company.Domain.AuthorizedPersonAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class AuthorizedPersonMapping : IEntityTypeConfiguration<AuthorizedPerson>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<AuthorizedPerson> builder)
|
||||
{
|
||||
builder.ToTable("AuthorizedPersons");
|
||||
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
builder.Property(x => x.NationalCode)
|
||||
.HasMaxLength(10)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(x => x.FirstName)
|
||||
.HasMaxLength(100)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(x => x.LastName)
|
||||
.HasMaxLength(100)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(x => x.FatherName)
|
||||
.HasMaxLength(100);
|
||||
|
||||
builder.Property(x => x.BirthDate)
|
||||
.HasMaxLength(10);
|
||||
|
||||
builder.Property(x => x.Gender)
|
||||
.HasMaxLength(50);
|
||||
|
||||
builder.Property(x => x.DeathStatus)
|
||||
.HasMaxLength(50);
|
||||
|
||||
builder.Property(x => x.ShenasnameSeri)
|
||||
.HasMaxLength(10);
|
||||
|
||||
builder.Property(x => x.ShenasnameSerial)
|
||||
.HasMaxLength(10);
|
||||
|
||||
builder.Property(x => x.ShenasnamehNumber)
|
||||
.HasMaxLength(20);
|
||||
|
||||
builder.Property(x => x.IsVerified)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(x => x.VerificationDate);
|
||||
|
||||
builder.Property(x => x.CreationDate)
|
||||
.IsRequired();
|
||||
|
||||
// Index for better performance on NationalCode queries
|
||||
builder.HasIndex(x => x.NationalCode)
|
||||
.IsUnique();
|
||||
}
|
||||
}
|
||||
@@ -26,8 +26,6 @@ public class ContractMapping : IEntityTypeConfiguration<Contract>
|
||||
builder.Property(x => x.ContractPeriod).HasMaxLength(2).IsRequired(false);
|
||||
builder.Property(x => x.AgreementSalary).HasMaxLength(50).IsRequired(false);
|
||||
builder.Property(x => x.Signature).HasMaxLength(1).IsRequired(false);
|
||||
builder.Property(x=>x.DailyWageType).HasMaxLength(30).IsRequired(false);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -28,5 +28,8 @@ public class ContractingPartyTempMapping : IEntityTypeConfiguration<ContractingP
|
||||
v => v.ToString(),
|
||||
v => (Gender)Enum.Parse(typeof(Gender), v)).HasMaxLength(6);
|
||||
builder.Property(x => x.DateOfBirth);
|
||||
builder.Property(x => x.Status).HasConversion<string>().HasMaxLength(20);
|
||||
builder.Property(x => x.VerifyCode).HasMaxLength(12);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Company.Domain.TemporaryClientRegistrationAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class InstitutionContractContactInfoTempMapping : IEntityTypeConfiguration<InstitutionContractContactInfoTemp>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<InstitutionContractContactInfoTemp> builder)
|
||||
{
|
||||
builder.ToTable("InstitutionContractContactInfoTemp");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
builder.Property(x => x.FullName).HasMaxLength(50);
|
||||
builder.Property(x => x.PhoneNumber).HasMaxLength(20);
|
||||
builder.Property(x => x.PhoneType).HasMaxLength(20);
|
||||
builder.Property(x => x.Position).HasMaxLength(50);
|
||||
builder.HasOne(x => x.InstitutionContractTemp)
|
||||
.WithMany(x => x.ContactInfoList)
|
||||
.HasForeignKey(x => x.InstitutionContractTempId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Company.Domain.InstitutionContractAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class InstitutionContractInstallmentMapping : IEntityTypeConfiguration<InstitutionContractInstallment>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<InstitutionContractInstallment> builder)
|
||||
{
|
||||
builder.ToTable("InstitutionContractInstallments");
|
||||
builder.HasKey(x => x.Id);
|
||||
|
||||
builder.Property(x => x.InstallmentDateFa).HasMaxLength(10).IsRequired();
|
||||
builder.Property(x => x.Description).HasMaxLength(1000);
|
||||
builder.Property(x => x.Amount).IsRequired();
|
||||
|
||||
builder.HasOne(x => x.InstitutionContract)
|
||||
.WithMany(x => x.Installments)
|
||||
.HasForeignKey(x => x.InstitutionContractId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,16 @@ public class InstitutionContractMapping : IEntityTypeConfiguration<InstitutionCo
|
||||
builder.Property(x => x.TypeOfContract).HasMaxLength(30);
|
||||
builder.Property(x => x.HasValueAddedTax).HasMaxLength(10);
|
||||
|
||||
builder.Property(x => x.Status).HasConversion<string>().HasMaxLength(122);
|
||||
|
||||
// Configure simple relationship with WorkshopDetails for Include() support
|
||||
builder.HasMany(x => x.WorkshopDetails)
|
||||
.WithOne(x => x.InstitutionContract)
|
||||
.HasForeignKey(x => x.InstitutionContractId);
|
||||
|
||||
builder.HasMany(x => x.Installments)
|
||||
.WithOne(x => x.InstitutionContract)
|
||||
.HasForeignKey(x => x.InstitutionContractId);
|
||||
|
||||
builder.HasMany(x => x.ContactInfoList)
|
||||
.WithOne(x => x.InstitutionContracts)
|
||||
|
||||
@@ -11,7 +11,7 @@ public class InstitutionContractTempMapping : IEntityTypeConfiguration<Instituti
|
||||
builder.ToTable("InstitutionContractTemps");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
builder.Property(x => x.RegistrationStatus).HasMaxLength(30);
|
||||
builder.Property(x => x.RegistrationStatus).HasConversion<string>().HasMaxLength(30);
|
||||
builder.Property(x => x.PaymentModel).HasMaxLength(30);
|
||||
builder.Property(x => x.PeriodModel).HasMaxLength(3);
|
||||
builder.Property(x => x.OfficialCompany).HasMaxLength(30);
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using Company.Domain.InstitutionContractAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class InstitutionContractWorkshopDetailMapping : IEntityTypeConfiguration<InstitutionContractWorkshopDetail>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<InstitutionContractWorkshopDetail> builder)
|
||||
{
|
||||
builder.ToTable("InstitutionContractWorkshopDetail");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
builder.Property(x => x.WorkshopName).HasMaxLength(100);
|
||||
builder.Property(x => x.WorkshopId).IsRequired(false);
|
||||
|
||||
// Configure relationship with InstitutionContract
|
||||
builder.HasOne(x => x.InstitutionContract)
|
||||
.WithMany(x => x.WorkshopDetails)
|
||||
.HasForeignKey(x => x.InstitutionContractId);
|
||||
|
||||
// Configure OwnsMany relationship with Employers
|
||||
builder.OwnsMany(x => x.Employers, employer =>
|
||||
{
|
||||
employer.ToTable("InstitutionContractWorkshopDetailEmployers");
|
||||
employer.HasKey(x => x.id);
|
||||
employer.WithOwner().HasForeignKey(x => x.InstitutionContractWorkshopDetailId);
|
||||
employer.Property(x => x.EmployerId).IsRequired();
|
||||
employer.HasIndex(x => new { x.InstitutionContractWorkshopDetailId, x.EmployerId })
|
||||
.IsUnique();
|
||||
});
|
||||
}
|
||||
}
|
||||
35
CompanyManagment.EFCore/Mapping/LawMapping.cs
Normal file
35
CompanyManagment.EFCore/Mapping/LawMapping.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Company.Domain.LawAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping
|
||||
{
|
||||
public class LawMapping : IEntityTypeConfiguration<Law>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Law> builder)
|
||||
{
|
||||
builder.ToTable("Law");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
builder.Property(x => x.Title).HasMaxLength(255).IsRequired();
|
||||
builder.Property(x => x.IsActive).IsRequired();
|
||||
builder.Property(x => x.Type).HasConversion<string>().HasMaxLength(50);
|
||||
|
||||
builder.OwnsMany(x => x.Items, navigationBuilder =>
|
||||
{
|
||||
navigationBuilder.ToTable("LawItem");
|
||||
navigationBuilder.HasKey(x => x.Id);
|
||||
navigationBuilder.WithOwner().HasForeignKey(x => x.LawId);
|
||||
|
||||
navigationBuilder.Property(x => x.Header).HasMaxLength(255);
|
||||
navigationBuilder.Property(x => x.Details).IsRequired();
|
||||
navigationBuilder.Property(x => x.OrderNumber).IsRequired();
|
||||
});
|
||||
builder.Property(x => x.NotificationsJson)
|
||||
.HasColumnName("Notifications")
|
||||
.HasMaxLength(3000); // Set max length to 1000, adjust as needed
|
||||
|
||||
builder.Property(x => x.HeadTitle).HasMaxLength(200);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,6 @@ public class LeaveMapping : IEntityTypeConfiguration<Leave>
|
||||
builder.Property(x => x.IsAccepted);
|
||||
builder.Property(x => x.Decription).HasMaxLength(255);
|
||||
builder.Property(x => x.ShiftDuration).HasTimeSpanConversion();
|
||||
builder.HasQueryFilter(x => !x.IsInvalid);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,7 @@ public class PersonalContractingpartyMapping : IEntityTypeConfiguration<Personal
|
||||
builder.Property(x => x.Gender).HasConversion(
|
||||
v => v.ToString(),
|
||||
v => string.IsNullOrWhiteSpace(v) ? Gender.None : (Gender)Enum.Parse(typeof(Gender), v)).HasMaxLength(6);
|
||||
builder.Property(x=>x.LegalPosition).HasMaxLength(50);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ partial class WorkshopMapping : IEntityTypeConfiguration<Workshop>
|
||||
|
||||
builder.Property(x => x.CutContractEndOfYear).HasConversion(x => x.ToString()
|
||||
, x => ((IsActive)Enum.Parse(typeof(IsActive), x))).HasMaxLength(5);
|
||||
|
||||
|
||||
//builder.HasOne(x => x.Employer)
|
||||
// .WithMany(x => x.Workshops)
|
||||
// .HasForeignKey(x => x.EmployerId);
|
||||
|
||||
@@ -13,8 +13,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
[DbContext(typeof(CompanyContext))]
|
||||
[Migration("20251006134511_add isInvalid to leave")]
|
||||
partial class addisInvalidtoleave
|
||||
[Migration("20250812101131_AddInstitutionContractContactInfoTemp")]
|
||||
partial class AddInstitutionContractContactInfoTemp
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@@ -296,11 +296,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("EmployeeId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("EmployeeMandatoryHours")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<double>("FamilyAllowance")
|
||||
.HasColumnType("float");
|
||||
|
||||
@@ -756,12 +751,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)");
|
||||
|
||||
b.Property<double>("BaseYearAffected")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<double>("BaseYearUnAffected")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<string>("ConsumableItems")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
@@ -790,16 +779,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<double>("DailySalaryAffected")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<double>("DailySalaryUnAffected")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<string>("DailyWageType")
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<string>("DayliWage")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
@@ -819,9 +798,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("GetWorkDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("HasManualDailyWage")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("HousingAllowance")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
@@ -1092,9 +1068,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("FridayPay")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<bool>("HasAmountConflict")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<double>("InstallmentDeduction")
|
||||
.HasColumnType("float");
|
||||
|
||||
@@ -1244,9 +1217,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("FridayPay")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<bool>("HasAmountConflict")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<double>("InstallmentDeduction")
|
||||
.HasColumnType("float");
|
||||
|
||||
@@ -3743,9 +3713,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<bool>("IsAccepted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsInvalid")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LeaveHourses")
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
@@ -5422,6 +5389,46 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("ContractingPartyTemp", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractContactInfoTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<long>("InstitutionContractTempId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("PhoneType")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("Position")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<bool>("SendSms")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("InstitutionContractTempId");
|
||||
|
||||
b.ToTable("InstitutionContractContactInfoTemp", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -9775,6 +9782,17 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("TaxLeftWorkCategory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractContactInfoTemp", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", "InstitutionContractTemp")
|
||||
.WithMany("ContactInfoList")
|
||||
.HasForeignKey("InstitutionContractTempId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("InstitutionContractTemp");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopServicesTemp", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.TemporaryClientRegistrationAgg.WorkshopTemp", "WorkshopTemp")
|
||||
@@ -10158,6 +10176,11 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("TaxLeftWorkItemList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", b =>
|
||||
{
|
||||
b.Navigation("ContactInfoList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopTemp", b =>
|
||||
{
|
||||
b.Navigation("WorkshopServicesTemps");
|
||||
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddInstitutionContractContactInfoTemp : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "InstitutionContractContactInfoTemp",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
PhoneType = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
InstitutionContractTempId = table.Column<long>(type: "bigint", nullable: false),
|
||||
Position = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
PhoneNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
FullName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
SendSms = table.Column<bool>(type: "bit", nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_InstitutionContractContactInfoTemp", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_InstitutionContractContactInfoTemp_InstitutionContractTemps_InstitutionContractTempId",
|
||||
column: x => x.InstitutionContractTempId,
|
||||
principalTable: "InstitutionContractTemps",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InstitutionContractContactInfoTemp_InstitutionContractTempId",
|
||||
table: "InstitutionContractContactInfoTemp",
|
||||
column: "InstitutionContractTempId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "InstitutionContractContactInfoTemp");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
[DbContext(typeof(CompanyContext))]
|
||||
[Migration("20250822223255_ManualDailyWageToContract")]
|
||||
partial class ManualDailyWageToContract
|
||||
[Migration("20250816094851_Add law table")]
|
||||
partial class Addlawtable
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@@ -751,12 +751,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)");
|
||||
|
||||
b.Property<double>("BaseYearAffected")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<double>("BaseYearUnAffected")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<string>("ConsumableItems")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
@@ -785,12 +779,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<double>("DailySalaryAffected")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<double>("DailySalaryUnAffected")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<string>("DayliWage")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
@@ -810,9 +798,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("GetWorkDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("HasManualDailyWage")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("HousingAllowance")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
@@ -1083,9 +1068,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("FridayPay")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<bool>("HasAmountConflict")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<double>("InstallmentDeduction")
|
||||
.HasColumnType("float");
|
||||
|
||||
@@ -1235,9 +1217,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("FridayPay")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<bool>("HasAmountConflict")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<double>("InstallmentDeduction")
|
||||
.HasColumnType("float");
|
||||
|
||||
@@ -3703,6 +3682,30 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("Jobs", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.LawAgg.Law", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("Law", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.LeaveAgg.Leave", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -5410,6 +5413,46 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("ContractingPartyTemp", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractContactInfoTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<long>("InstitutionContractTempId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("PhoneType")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("Position")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<bool>("SendSms")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("InstitutionContractTempId");
|
||||
|
||||
b.ToTable("InstitutionContractContactInfoTemp", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -9479,6 +9522,43 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("Workshop");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.LawAgg.Law", b =>
|
||||
{
|
||||
b.OwnsMany("Company.Domain.LawAgg.LawItem", "Items", b1 =>
|
||||
{
|
||||
b1.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
|
||||
|
||||
b1.Property<string>("Details")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b1.Property<string>("Header")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)");
|
||||
|
||||
b1.Property<long>("LawId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<int>("OrderNumber")
|
||||
.HasColumnType("int");
|
||||
|
||||
b1.HasKey("Id");
|
||||
|
||||
b1.HasIndex("LawId");
|
||||
|
||||
b1.ToTable("LawItem", (string)null);
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("LawId");
|
||||
});
|
||||
|
||||
b.Navigation("Items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.LeftWorkAgg.LeftWork", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee")
|
||||
@@ -9763,6 +9843,17 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("TaxLeftWorkCategory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractContactInfoTemp", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", "InstitutionContractTemp")
|
||||
.WithMany("ContactInfoList")
|
||||
.HasForeignKey("InstitutionContractTempId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("InstitutionContractTemp");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopServicesTemp", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.TemporaryClientRegistrationAgg.WorkshopTemp", "WorkshopTemp")
|
||||
@@ -10146,6 +10237,11 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("TaxLeftWorkItemList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", b =>
|
||||
{
|
||||
b.Navigation("ContactInfoList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopTemp", b =>
|
||||
{
|
||||
b.Navigation("WorkshopServicesTemps");
|
||||
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Addlawtable : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Law",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Title = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
IsActive = table.Column<bool>(type: "bit", nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Law", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "LawItem",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Header = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
Details = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
OrderNumber = table.Column<int>(type: "int", nullable: false),
|
||||
LawId = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_LawItem", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_LawItem_Law_LawId",
|
||||
column: x => x.LawId,
|
||||
principalTable: "Law",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LawItem_LawId",
|
||||
table: "LawItem",
|
||||
column: "LawId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "LawItem");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Law");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
[DbContext(typeof(CompanyContext))]
|
||||
[Migration("20250827230053_DailyWageTypeoContract")]
|
||||
partial class DailyWageTypeoContract
|
||||
[Migration("20250816131730_Add Public Id to institution contract and contracting party")]
|
||||
partial class AddPublicIdtoinstitutioncontractandcontractingparty
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@@ -751,12 +751,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)");
|
||||
|
||||
b.Property<double>("BaseYearAffected")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<double>("BaseYearUnAffected")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<string>("ConsumableItems")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
@@ -785,16 +779,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<double>("DailySalaryAffected")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<double>("DailySalaryUnAffected")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<string>("DailyWageType")
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<string>("DayliWage")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
@@ -814,9 +798,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("GetWorkDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("HasManualDailyWage")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("HousingAllowance")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
@@ -1087,9 +1068,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("FridayPay")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<bool>("HasAmountConflict")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<double>("InstallmentDeduction")
|
||||
.HasColumnType("float");
|
||||
|
||||
@@ -1239,9 +1217,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("FridayPay")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<bool>("HasAmountConflict")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<double>("InstallmentDeduction")
|
||||
.HasColumnType("float");
|
||||
|
||||
@@ -3707,6 +3682,30 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("Jobs", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.LawAgg.Law", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("Law", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.LeaveAgg.Leave", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -5405,6 +5404,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(12)
|
||||
.HasColumnType("nvarchar(12)");
|
||||
|
||||
b.Property<Guid>("PublicId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("State")
|
||||
.HasMaxLength(35)
|
||||
.HasColumnType("nvarchar(35)");
|
||||
@@ -5414,6 +5416,46 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("ContractingPartyTemp", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractContactInfoTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<long>("InstitutionContractTempId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("PhoneType")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("Position")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<bool>("SendSms")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("InstitutionContractTempId");
|
||||
|
||||
b.ToTable("InstitutionContractContactInfoTemp", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -5449,9 +5491,12 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(3)
|
||||
.HasColumnType("nvarchar(3)");
|
||||
|
||||
b.Property<string>("RegistrationStatus")
|
||||
b.Property<Guid>("PublicId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("RegistrationStatus")
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("SendVerifyCodeTime")
|
||||
.HasColumnType("datetime2");
|
||||
@@ -9483,6 +9528,43 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("Workshop");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.LawAgg.Law", b =>
|
||||
{
|
||||
b.OwnsMany("Company.Domain.LawAgg.LawItem", "Items", b1 =>
|
||||
{
|
||||
b1.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
|
||||
|
||||
b1.Property<string>("Details")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b1.Property<string>("Header")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)");
|
||||
|
||||
b1.Property<long>("LawId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<int>("OrderNumber")
|
||||
.HasColumnType("int");
|
||||
|
||||
b1.HasKey("Id");
|
||||
|
||||
b1.HasIndex("LawId");
|
||||
|
||||
b1.ToTable("LawItem", (string)null);
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("LawId");
|
||||
});
|
||||
|
||||
b.Navigation("Items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.LeftWorkAgg.LeftWork", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee")
|
||||
@@ -9767,6 +9849,17 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("TaxLeftWorkCategory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractContactInfoTemp", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", "InstitutionContractTemp")
|
||||
.WithMany("ContactInfoList")
|
||||
.HasForeignKey("InstitutionContractTempId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("InstitutionContractTemp");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopServicesTemp", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.TemporaryClientRegistrationAgg.WorkshopTemp", "WorkshopTemp")
|
||||
@@ -10150,6 +10243,11 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("TaxLeftWorkItemList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", b =>
|
||||
{
|
||||
b.Navigation("ContactInfoList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopTemp", b =>
|
||||
{
|
||||
b.Navigation("WorkshopServicesTemps");
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user