Compare commits
497 Commits
Feature/Bg
...
Feature/Re
| Author | SHA1 | Date | |
|---|---|---|---|
| f5d95b21b0 | |||
| 1f7785581c | |||
| d44a9224be | |||
| 13a2cd78cd | |||
| 91fc560355 | |||
| 8acb25dd67 | |||
|
|
397280d0a2 | ||
| 5975a92aa1 | |||
| 0cec7c0cce | |||
| be6cb6430f | |||
| f863fb065f | |||
| 76aa1eae88 | |||
| d0b29e7643 | |||
| f1106deff9 | |||
| 94a5741906 | |||
| 221d06a0fc | |||
| 2b993fb746 | |||
|
|
5b3c7e471e | ||
|
|
330a3ca839 | ||
| 7c4cf1e2ed | |||
| 1d2c4f26f1 | |||
| 761ac352df | |||
| ecfb7af386 | |||
| 92fd8d6b0e | |||
| 4f68d141e8 | |||
| 75ea35596b | |||
| a0e2b969c0 | |||
| 8efffe8b75 | |||
| fdf7fa0d3c | |||
| 5cde26e7f3 | |||
| b448c43bb7 | |||
| 6045153865 | |||
| 5d16020c6a | |||
| 987e5acca4 | |||
| 9ebbe00a95 | |||
| b576a8dd6b | |||
| 69279b320c | |||
| a360a20478 | |||
| aad1645edd | |||
| af1388f0d7 | |||
| 4d0cf13d40 | |||
| 6584558e6a | |||
| 561f742eb5 | |||
| 560ea04f33 | |||
| ed5681256d | |||
| a1a361a09c | |||
| ccd99c5184 | |||
| f29fac2631 | |||
| 4707c389ae | |||
| a403b9f960 | |||
| 6a0abf2545 | |||
| 7a58423eb3 | |||
| 83ef2a1177 | |||
| 3fa05b99dd | |||
| 70164ae498 | |||
| c5d6dcbbc3 | |||
| d70ea10d2d | |||
| db225fea18 | |||
| bd331c8afe | |||
| 9f7d267afb | |||
| 7abbd489bb | |||
| 35811775f3 | |||
| b78a06e743 | |||
| 4ce82679ff | |||
| e1161245cf | |||
| 8e83b32856 | |||
| 8eeec345d1 | |||
| 780a610e91 | |||
| e095f4e07d | |||
| 4a3ac6e096 | |||
| 2bbe616127 | |||
| f64e6ac176 | |||
| 9095ed28e1 | |||
| a1ad139730 | |||
| dbe7aebf37 | |||
| 7eca8226b3 | |||
| 8912215bbc | |||
| 6c5f224fda | |||
| 437f419c2d | |||
| 04ec2ed5a4 | |||
| fc1258e985 | |||
|
|
c7f5310c56 | ||
| 7b3d1f527c | |||
| dbbee73e2a | |||
| 21df40af3b | |||
| 6d0072c8ac | |||
|
|
f50fdd7f91 | ||
| 76013946bd | |||
| 024b8cfaa9 | |||
| b8c738bd14 | |||
| 126cbff54f | |||
| 2e97d3238d | |||
| ea0be6b865 | |||
| 896c891f70 | |||
| 11207a785c | |||
|
|
87cde91ad0 | ||
|
|
55f62da928 | ||
| bfb7f4e38c | |||
|
|
5a7f233568 | ||
|
|
9d83de947f | ||
|
|
f4c3aa1889 | ||
| 8fb10ba5b0 | |||
| b5465f5501 | |||
| bcb42cc05e | |||
| ee9f802486 | |||
| 72d082d5f2 | |||
| 983f629cd6 | |||
| 0e3e783c5c | |||
| 136a9775ea | |||
| a6fdfd13f9 | |||
| 9bf8153d95 | |||
|
|
d0928804ee | ||
|
|
67f199e86f | ||
| 8893b53d9a | |||
| e49f635b4e | |||
| 04d9b84eb6 | |||
| 39d887c4c3 | |||
| 2e0d005ab9 | |||
| f90bb3dfc6 | |||
| 2d0365bc6e | |||
| dba90c9a3f | |||
| 0e360836f7 | |||
| 0753095415 | |||
| 7725384a87 | |||
| 94f16c8a49 | |||
| f5c3e6351c | |||
| 6bfc0a8d67 | |||
| 413bd3aad9 | |||
| 031f05937d | |||
| 84060e83f5 | |||
|
|
85936cad63 | ||
|
|
6f805d9abe | ||
| 0acb691c54 | |||
| 90c6eef199 | |||
| 52f310353f | |||
| 71f7b05490 | |||
| 7681f4e95b | |||
| 681ac6eb1a | |||
| 349b96ba08 | |||
| c38aa29009 | |||
| 914a7def53 | |||
| 2b6864c024 | |||
| cf2849e47e | |||
| c0cbf20450 | |||
| 75cc5a3e5f | |||
| 6603427845 | |||
| 3d12f3b4d2 | |||
| c87d734b5a | |||
| b47759244e | |||
| 7905dff7c6 | |||
| 0ebca7c613 | |||
| 57dae3d8f1 | |||
| 81d78affa0 | |||
| 32e118d6f7 | |||
| 68748ab8a6 | |||
| 7777ad52de | |||
| b8b8d9c3c4 | |||
|
|
04710e321a | ||
|
|
b9ff14757b | ||
| 58152ae2d6 | |||
| f51c42a359 | |||
| 0373a7e6be | |||
| 957284be7f | |||
| c01bc80608 | |||
| f387d0c535 | |||
| 27109b3472 | |||
| d1f64dd1b0 | |||
| ffc6969ee7 | |||
| 9beed6cf45 | |||
| 868bb3f17a | |||
| c3bbd9af98 | |||
| 56cce8c93d | |||
| c13a77e53d | |||
| 523cbc744b | |||
| e53f3a721a | |||
| 79b14ec958 | |||
| 72435f2d47 | |||
| bd72dada76 | |||
| df00f5cbac | |||
| e79dabbb2d | |||
| f527c59603 | |||
| 112369c2a5 | |||
| 518719a6b8 | |||
| 53eab1be67 | |||
| 90ee299b87 | |||
| e6e81cd1c9 | |||
|
|
21aa17d856 | ||
| b8d6911756 | |||
| 2e8f098937 | |||
| c9cae74cd4 | |||
|
|
abe8774d6f | ||
|
|
eab0441f00 | ||
| 13250d9f62 | |||
| e77eb217f7 | |||
| 39200da4b5 | |||
| 49050a8990 | |||
| 9474f3ff1a | |||
| ad4cffffcd | |||
|
|
b3cf56eb1c | ||
|
|
20dbd0121f | ||
|
|
74c7b1ebbd | ||
|
|
b2c6ad2541 | ||
| 8eded713da | |||
|
|
18e559f1ae | ||
|
|
e1dfd8c8e1 | ||
|
|
b1c9b2669d | ||
|
|
116f40d87d | ||
|
|
6a982a80f7 | ||
|
|
c3cb3df3d3 | ||
|
|
604ac76a1a | ||
|
|
f9947dc138 | ||
|
|
3b12be04b5 | ||
|
|
5a1d2640c3 | ||
|
|
de0e21f98b | ||
|
|
80ed1e9469 | ||
|
|
0609c66e0a | ||
|
|
add5b8ef8e | ||
|
|
c5091c53a4 | ||
|
|
3f1664a844 | ||
|
|
fdc5ea950f | ||
|
|
39d62eb02d | ||
|
|
a42ef19470 | ||
|
|
7ae7d8fc07 | ||
|
|
2bc7766ba1 | ||
|
|
d780f24b36 | ||
|
|
d7b49f8fc3 | ||
|
|
82d035b7e1 | ||
|
|
e80621280c | ||
|
|
1c6b0ac292 | ||
|
|
7d3a1dad71 | ||
|
|
b5fc98a47b | ||
|
|
01bc8ef01b | ||
|
|
ca350aa795 | ||
|
|
58c015b151 | ||
|
|
14480eb683 | ||
|
|
882a295413 | ||
|
|
785e364efc | ||
|
|
bd83ed3880 | ||
|
|
fae3c7cbd3 | ||
|
|
052b94a66e | ||
|
|
369757aebe | ||
|
|
38d8e88fd6 | ||
|
|
bcedb0d690 | ||
|
|
3662502db1 | ||
|
|
0701b334e4 | ||
|
|
631bf3a920 | ||
|
|
874bce1113 | ||
|
|
1daaeff194 | ||
|
|
9cd00a1886 | ||
|
|
1f897fa0c9 | ||
|
|
5f7c27e45c | ||
|
|
824a80d1fe | ||
|
|
9e2ec49247 | ||
|
|
f5137d0bab | ||
|
|
881bdfa7ae | ||
|
|
e063870b36 | ||
|
|
fe8335af55 | ||
|
|
179ff95d54 | ||
|
|
5c3119d3d2 | ||
|
|
0c56240158 | ||
|
|
2e703c49f7 | ||
|
|
e9dbfb411a | ||
|
|
40a02dbede | ||
|
|
030ce880f8 | ||
|
|
2b8cc9d05a | ||
|
|
0136e219a1 | ||
|
|
60ed37b965 | ||
|
|
5355e74830 | ||
|
|
87609773e5 | ||
|
|
6112e969b6 | ||
|
|
3e4c57d813 | ||
|
|
efc510a09b | ||
|
|
a6c1ae7971 | ||
|
|
8bf707056e | ||
|
|
ee72c95d55 | ||
|
|
f4f8ab8272 | ||
|
|
1c6def5d70 | ||
|
|
87e0181a8d | ||
|
|
66d566847e | ||
|
|
29fed23805 | ||
|
|
a26f079969 | ||
|
|
dbfffafbee | ||
|
|
b2a70bc5a9 | ||
|
|
5053b69295 | ||
|
|
77458978b5 | ||
|
|
969a707000 | ||
|
|
57b625f3b2 | ||
|
|
62572a9b64 | ||
|
|
6d0b7de149 | ||
|
|
34d8e068df | ||
|
|
3a1dfa7e11 | ||
|
|
866725e3b4 | ||
|
|
7e3f7d1dcf | ||
|
|
7772bff9f4 | ||
|
|
033461641a | ||
|
|
83a251ad3b | ||
|
|
cdf282a17a | ||
|
|
4bc3fd2fbc | ||
|
|
c826c3614d | ||
|
|
b8ea59b814 | ||
|
|
f82d0d5925 | ||
|
|
701ebaeb96 | ||
|
|
a1d57b291c | ||
|
|
e7d43316ad | ||
|
|
bdc5ccae13 | ||
|
|
d37ad552df | ||
|
|
df39072944 | ||
|
|
9c04fd439d | ||
|
|
2b3067dab2 | ||
|
|
6f8ced3192 | ||
|
|
86682a28e2 | ||
|
|
5720c30f7a | ||
|
|
c90a68a8cc | ||
|
|
a71205aa2b | ||
|
|
641dcc1767 | ||
|
|
b1a15bfa54 | ||
|
|
c40b457d1f | ||
|
|
f7166ca17f | ||
|
|
d4f9c810ea | ||
|
|
09574150b6 | ||
|
|
7ccf600885 | ||
|
|
a7b7bfc745 | ||
|
|
170a0ddba0 | ||
|
|
33a736ab5d | ||
|
|
fa5e079db5 | ||
|
|
ec2defab69 | ||
|
|
a344c3f3a6 | ||
|
|
8f76b8c082 | ||
|
|
e34fef37d7 | ||
|
|
5e7bfe0634 | ||
|
|
23723e4b7a | ||
|
|
859f8ea8ca | ||
|
|
2732ec09b2 | ||
|
|
3744b5f470 | ||
|
|
13d93b3e1d | ||
|
|
db78fb1cd4 | ||
|
|
7ce2142517 | ||
|
|
98146b4aa7 | ||
|
|
5f65c13b45 | ||
|
|
8bde7aa3d1 | ||
|
|
584425b3af | ||
|
|
2f60883ea2 | ||
|
|
da8579d2a6 | ||
|
|
41503101b6 | ||
|
|
1cd4cd4b49 | ||
|
|
7afa112e63 | ||
|
|
3aa5668696 | ||
|
|
df1e6f62b8 | ||
|
|
76e5a93ee5 | ||
|
|
469a8808d1 | ||
|
|
d3157780ea | ||
|
|
2d2dc24280 | ||
|
|
362b306c48 | ||
|
|
b0c02d47c4 | ||
|
|
6869ccb436 | ||
|
|
605fe16ced | ||
|
|
856ed38f08 | ||
|
|
dfb78db2fa | ||
|
|
13ebe2fc2a | ||
|
|
54fbbc964f | ||
|
|
4a3515ad65 | ||
|
|
f0daa0b283 | ||
|
|
82f68d1bbe | ||
|
|
48c2186110 | ||
|
|
72fe632516 | ||
|
|
b92aaaffa0 | ||
|
|
2a315ff7ae | ||
|
|
49b84b50a5 | ||
|
|
204355acd6 | ||
|
|
e1ac481dc3 | ||
|
|
8fd3930393 | ||
|
|
b2694ca281 | ||
|
|
b82456f172 | ||
|
|
c04a8f86a4 | ||
|
|
e0f7ff5ec7 | ||
|
|
7cb3551dc8 | ||
|
|
873a30ecd1 | ||
|
|
c048e89da8 | ||
|
|
c91df337d4 | ||
|
|
b88cda4007 | ||
|
|
5902472b86 | ||
|
|
9aa8855a46 | ||
|
|
9556be42ea | ||
|
|
3ebaeb645c | ||
|
|
366ad25a3a | ||
|
|
463e4bc080 | ||
|
|
785309c731 | ||
|
|
f0126d365d | ||
|
|
b77538218f | ||
|
|
e877aca832 | ||
|
|
f66293a637 | ||
|
|
4aa710b7d6 | ||
|
|
2547fec258 | ||
|
|
acb572d94a | ||
|
|
5ff08ebb2f | ||
|
|
fd122fe582 | ||
|
|
25903856b2 | ||
|
|
d1b7e0c3e1 | ||
|
|
9c0d5b65be | ||
|
|
ac4bd3453a | ||
|
|
77e03f3d7f | ||
|
|
a9008beb24 | ||
|
|
a30d5b68d7 | ||
|
|
93c72e16e7 | ||
|
|
290e1639e8 | ||
|
|
3650b46b8e | ||
|
|
734de19bc2 | ||
|
|
398bb35815 | ||
|
|
697bd9fefe | ||
|
|
2743493a11 | ||
|
|
f9de490c13 | ||
|
|
f374ff3012 | ||
|
|
563fe563c0 | ||
|
|
c75e3464d7 | ||
|
|
e3a5fb578b | ||
|
|
8cb99b2862 | ||
|
|
57b2ad3445 | ||
|
|
3befd6f0d9 | ||
|
|
8f10aa54a8 | ||
|
|
efbd74479b | ||
|
|
8432b2660e | ||
|
|
2f9426bdaf | ||
|
|
5477519464 | ||
|
|
f92257b251 | ||
|
|
5efe58d23d | ||
|
|
648ca44ebb | ||
|
|
3232c979aa | ||
|
|
ce8a0b397d | ||
|
|
c1fcaa1726 | ||
|
|
e1fd94db04 | ||
|
|
882f38d000 | ||
|
|
29560370d8 | ||
|
|
7841e8c336 | ||
|
|
a114cc8242 | ||
|
|
473132d66a | ||
|
|
9124f50577 | ||
|
|
7a13150223 | ||
|
|
f7059bcaeb | ||
|
|
4c4e848f52 | ||
|
|
7984f18516 | ||
|
|
94aa4fda51 | ||
|
|
2d2207565e | ||
|
|
3f8b85906f | ||
|
|
346756c766 | ||
|
|
20f208ac0e | ||
|
|
2b602e4199 | ||
|
|
9557f860bb | ||
|
|
cf0dc95b5c | ||
|
|
c7f7b17866 | ||
|
|
d9259bf7c4 | ||
|
|
55dc4c891f | ||
|
|
daa2a0fdc1 | ||
|
|
6d6ce93f74 | ||
|
|
a71433f751 | ||
|
|
68d1a8d9fe | ||
|
|
a1dfc17ce9 | ||
|
|
99a8cc181d | ||
|
|
05cd8832d5 | ||
|
|
a4bcb1ac55 | ||
|
|
6cec0e39ec | ||
|
|
08bf8395c4 | ||
|
|
bc6378beca | ||
|
|
08adccb2f1 | ||
|
|
5e24071175 | ||
|
|
ebc377603a | ||
|
|
b70dbc8a6b | ||
|
|
a34d81318b | ||
|
|
00357df859 | ||
|
|
ba8e07c63a | ||
|
|
f87b203939 | ||
|
|
79807569dc | ||
|
|
bda666b989 | ||
|
|
9eca54276b | ||
|
|
de64933d06 | ||
|
|
44763da729 | ||
|
|
1f3bf123c4 | ||
|
|
7a33b7da46 | ||
|
|
da6573a147 | ||
|
|
6a6ec2610d | ||
|
|
d9717033cf | ||
|
|
beafd047bf | ||
|
|
7c3abeb463 | ||
|
|
040f40df52 | ||
|
|
ac66df98f5 | ||
|
|
8da9f09663 | ||
|
|
591de9acd8 | ||
|
|
be282fa548 | ||
|
|
1b88cebdf2 | ||
|
|
12356c927b | ||
|
|
b73898f5ea | ||
|
|
51e8686668 | ||
|
|
133b99d5fc | ||
|
|
6c814d5dce | ||
|
|
9879857a97 | ||
|
|
e3f29e5efa | ||
|
|
b97039ee15 | ||
|
|
4ff2596864 |
48
.github/workflows/dotnet-developPublish.yml
vendored
Normal file
48
.github/workflows/dotnet-developPublish.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Deploy Development ASP.NET Core App to IIS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- Main
|
||||
|
||||
env:
|
||||
DOTNET_ENVIRONMENT: Development
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET SDK
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '8.0.x' # یا نسخه پروژهت
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
|
||||
- name: Build
|
||||
run: dotnet build --configuration Release
|
||||
|
||||
- name: Publish
|
||||
run: dotnet publish --configuration Release --output ./publish /p:EnvironmentName=Development --no-build
|
||||
|
||||
- name: Deploy to IIS via Web Deploy
|
||||
shell: powershell
|
||||
run: |
|
||||
$publishFolder = Resolve-Path ./publish
|
||||
& "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" `
|
||||
-verb:sync `
|
||||
-source:contentPath="$publishFolder" `
|
||||
-dest:contentPath="dadmehrg",computerName="https://171.22.24.15:8172/msdeploy.axd?site=dadmehrg",userName="Administrator",password="R2rNpdnetP3j>q5b18",authType="Basic" `
|
||||
-allowUntrusted `
|
||||
-enableRule:AppOffline
|
||||
|
||||
|
||||
env:
|
||||
SERVER_HOST: your-server-ip-or-domain
|
||||
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
|
||||
DEPLOY_PASSWORD: ${{ secrets.DEPLOY_PASSWORD }}
|
||||
@@ -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>
|
||||
|
||||
@@ -3,4 +3,6 @@
|
||||
public class AppSettingConfiguration
|
||||
{
|
||||
public string Domain { get; set; }
|
||||
public string ClientDomain =>"client"+Domain;
|
||||
public string AdminDomain =>"admin"+Domain;
|
||||
}
|
||||
@@ -42,6 +42,7 @@ public class AuthHelper : IAuthHelper
|
||||
result.WorkshopName = claims.FirstOrDefault(x => x is { Type: "WorkshopName" })?.Value;
|
||||
result.Permissions = Tools.DeserializeFromBsonList<int>(claims.FirstOrDefault(x => x is { Type: "permissions" })?.Value);
|
||||
result.RoleName = claims.FirstOrDefault(x => x is { Type: "RoleName" })?.Value;
|
||||
result.WorkshopId = long.Parse(claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value??"0");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -76,7 +77,7 @@ public class AuthHelper : IAuthHelper
|
||||
|
||||
#region Vafa
|
||||
|
||||
public void UpdateWorkshopSlugClaim(string newWorkshopSlug, string newWorkshopName)
|
||||
public void UpdateWorkshopSlugClaim(string newWorkshopSlug, string newWorkshopName,long newWorkshopId)
|
||||
{
|
||||
var user = _contextAccessor.HttpContext.User;
|
||||
|
||||
@@ -85,6 +86,7 @@ public class AuthHelper : IAuthHelper
|
||||
var claimsIdentity = (ClaimsIdentity)user.Identity;
|
||||
var existingClaimSlug = claimsIdentity.FindFirst("WorkshopSlug");
|
||||
var existingClaimName = claimsIdentity.FindFirst("WorkshopName");
|
||||
var existingWorkshopId = claimsIdentity.FindFirst("WorkshopId");
|
||||
|
||||
if (existingClaimSlug != null)
|
||||
{
|
||||
@@ -96,9 +98,14 @@ public class AuthHelper : IAuthHelper
|
||||
claimsIdentity.RemoveClaim(existingClaimName);
|
||||
}
|
||||
|
||||
if (existingWorkshopId != null)
|
||||
{
|
||||
claimsIdentity.RemoveClaim(existingWorkshopId);
|
||||
}
|
||||
|
||||
claimsIdentity.AddClaim(new Claim("WorkshopSlug", newWorkshopSlug));
|
||||
claimsIdentity.AddClaim(new Claim("WorkshopName", newWorkshopName));
|
||||
claimsIdentity.AddClaim(new Claim("WorkshopId",newWorkshopId.ToString()));
|
||||
|
||||
|
||||
var authProperties = new AuthenticationProperties
|
||||
@@ -128,8 +135,16 @@ public class AuthHelper : IAuthHelper
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
public long GetWorkshopId()
|
||||
{
|
||||
return long.Parse(_contextAccessor.HttpContext?.User.Claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value ?? "0");
|
||||
|
||||
|
||||
}
|
||||
|
||||
public string CurrentAccountRole()
|
||||
{
|
||||
@@ -182,6 +197,7 @@ public class AuthHelper : IAuthHelper
|
||||
//mahanChanges
|
||||
new("workshopList",workshopBson),
|
||||
new("WorkshopSlug",slug),
|
||||
new("WorkshopId", account.WorkshopId.ToString()),
|
||||
new("WorkshopName",account.WorkshopName??"")
|
||||
|
||||
};
|
||||
|
||||
@@ -20,6 +20,7 @@ public class AuthViewModel
|
||||
|
||||
public int? PositionValue { get; set; }
|
||||
public string WorkshopSlug { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public string WorkshopName { get; set; }
|
||||
public List<WorkshopClaim> WorkshopList { get; set; }
|
||||
|
||||
|
||||
@@ -17,11 +17,12 @@ public interface IAuthHelper
|
||||
|
||||
#region Vafa
|
||||
|
||||
void UpdateWorkshopSlugClaim(string workshopSlug, string workshopName);
|
||||
void UpdateWorkshopSlugClaim(string workshopSlug, string workshopName, long workshopId);
|
||||
|
||||
#endregion
|
||||
long CurrentSubAccountId();
|
||||
string GetWorkshopSlug();
|
||||
string GetWorkshopName();
|
||||
long GetWorkshopId();
|
||||
(long Id, UserType userType, long roleId) GetUserTypeWithId();
|
||||
}
|
||||
15
0_Framework/Application/PagedResult.cs
Normal file
15
0_Framework/Application/PagedResult.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace _0_Framework.Application;
|
||||
|
||||
|
||||
public class PagedResult<T> where T : class
|
||||
{
|
||||
public int TotalCount { get; set; }
|
||||
public List<T> List { get; set; }
|
||||
}
|
||||
public class PagedResult<T,TMeta>:PagedResult<T> where T : class
|
||||
{
|
||||
public TMeta? Meta { get; set; }
|
||||
}
|
||||
7
0_Framework/Application/PaginationRequest.cs
Normal file
7
0_Framework/Application/PaginationRequest.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace _0_Framework.Application;
|
||||
|
||||
public class PaginationRequest
|
||||
{
|
||||
public int PageIndex { get; set; } = 1;
|
||||
public int PageSize { get; set; } = 30;
|
||||
}
|
||||
@@ -24,7 +24,7 @@ public class AqayePardakhtPaymentGateway:IPaymentGateway
|
||||
{
|
||||
_httpClient = httpClientFactory.CreateClient();
|
||||
|
||||
if (appSetting.Value.Domain == ".dad-mehr.ir")
|
||||
if (appSetting.Value.Domain == ".dadmehrg.ir")
|
||||
{
|
||||
_pin = "7349F84E81AB584862D9";
|
||||
}
|
||||
|
||||
@@ -26,7 +26,10 @@ public interface ISmsService
|
||||
#region Mahan
|
||||
|
||||
Task<double> GetCreditAmount();
|
||||
SmsResult TaskReminderSms(string number, string taskCount);
|
||||
|
||||
public Task<bool> SendInstitutionVerificationLink(string number,string fullName, Guid institutionId);
|
||||
|
||||
public Task<bool> SendInstitutionVerificationCode(string number, string code);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
7
0_Framework/Application/Sms/OtpResultViewModel.cs
Normal file
7
0_Framework/Application/Sms/OtpResultViewModel.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace _0_Framework.Application.Sms;
|
||||
|
||||
public class OtpResultViewModel
|
||||
{
|
||||
public int ExpireTimeSec { get; set; }
|
||||
public int ReSendTimeSec { get; set; }
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
namespace _0_Framework.Application.Sms;
|
||||
|
||||
public class SmsResult
|
||||
{
|
||||
public SmsResult()
|
||||
{
|
||||
IsSuccedded = false;
|
||||
}
|
||||
|
||||
public bool IsSuccedded { get; set; }
|
||||
public string Message { get; set; }
|
||||
public byte StatusCode { get; set; }
|
||||
public int MessageId { get; set; }
|
||||
|
||||
public SmsResult Succedded(byte statusCode, string message, int messageId)
|
||||
{
|
||||
IsSuccedded = true;
|
||||
Message = message;
|
||||
StatusCode = statusCode;
|
||||
MessageId = messageId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SmsResult Failed(byte statusCode, string message, int messageId)
|
||||
{
|
||||
IsSuccedded = false;
|
||||
Message = message;
|
||||
StatusCode = statusCode;
|
||||
MessageId = messageId;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -331,34 +331,27 @@ public class SmsService : ISmsService
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public SmsResult TaskReminderSms(string number, string taskCount)
|
||||
public async Task<bool> SendInstitutionVerificationLink(string number,string fullName, Guid institutionId)
|
||||
{
|
||||
var tamplateId = 909433;
|
||||
var result = new SmsResult();
|
||||
var smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
|
||||
var sendResult = smsIr.VerifySendAsync(number, tamplateId,
|
||||
new VerifySendParameter[]
|
||||
{
|
||||
new("TASKCOUNT", taskCount),
|
||||
});
|
||||
Thread.Sleep(500);
|
||||
|
||||
|
||||
if (sendResult.IsCompletedSuccessfully)
|
||||
var guidStr=institutionId.ToString();
|
||||
var firstPart = guidStr.Substring(0, 15);
|
||||
var secondPart = guidStr.Substring(15);
|
||||
var verificationSendResult =await SmsIr.VerifySendAsync(number, 527519, new VerifySendParameter[]
|
||||
{
|
||||
var status = sendResult.Result.Status;
|
||||
var message = sendResult.Result.Message;
|
||||
var messaeId = sendResult.Result.Data.MessageId;
|
||||
return result.Succedded(status, message, messaeId);
|
||||
}
|
||||
else
|
||||
new("FULLNAME", fullName),
|
||||
new("CODE1",firstPart),
|
||||
new("CODE2",secondPart)
|
||||
});
|
||||
return verificationSendResult.Status == 0;
|
||||
}
|
||||
|
||||
public async Task<bool> SendInstitutionVerificationCode(string number, string code)
|
||||
{
|
||||
var verificationSendResult =await SmsIr.VerifySendAsync(number, 965348, new VerifySendParameter[]
|
||||
{
|
||||
var status = sendResult.Result.Status;
|
||||
var message = sendResult.Result.Message;
|
||||
var messaeId = sendResult.Result.Data.MessageId;
|
||||
return result.Failed(status, message, messaeId);
|
||||
}
|
||||
new("VERIFYCODE", code)
|
||||
});
|
||||
return verificationSendResult.Status == 0;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -30,8 +30,9 @@ public static class StaticWorkshopAccounts
|
||||
/// 380 - افروز نظری
|
||||
/// 381 - مهدی قربانی
|
||||
/// 392 - عمار حسن دوست
|
||||
/// 20 - سمیرا الهی نیا
|
||||
/// </summary>
|
||||
public static List<long> StaticAccountIds = [2, 3, 380, 381, 392];
|
||||
public static List<long> StaticAccountIds = [2, 3, 380, 381, 392, 20];
|
||||
|
||||
/// <summary>
|
||||
/// این تاریخ در جدول اکانت لفت ورک به این معنیست
|
||||
|
||||
@@ -477,26 +477,42 @@ public static class Tools
|
||||
string bb = string.Empty;
|
||||
bool isNegative = false;
|
||||
|
||||
for (int x = 0; x < myMoney.Length; x++)
|
||||
try
|
||||
{
|
||||
if (char.IsDigit(myMoney[x]))
|
||||
if (!string.IsNullOrWhiteSpace(myMoney))
|
||||
{
|
||||
bb += myMoney[x];
|
||||
}
|
||||
else if (myMoney[x] == '-' && bb.Length == 0)
|
||||
{
|
||||
// اگر علامت منفی قبل از اولین عدد آمد، در نظر بگیر
|
||||
isNegative = true;
|
||||
}
|
||||
}
|
||||
for (int x = 0; x < myMoney.Length; x++)
|
||||
{
|
||||
if (char.IsDigit(myMoney[x]))
|
||||
{
|
||||
bb += myMoney[x];
|
||||
}
|
||||
else if (myMoney[x] == '-' && bb.Length == 0)
|
||||
{
|
||||
// اگر علامت منفی قبل از اولین عدد آمد، در نظر بگیر
|
||||
isNegative = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (bb.Length > 0)
|
||||
{
|
||||
double res = double.Parse(bb);
|
||||
return isNegative ? -res : res;
|
||||
if (bb.Length > 0)
|
||||
{
|
||||
double res = double.Parse(bb);
|
||||
return isNegative ? -res : res;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class UidBasicInformation
|
||||
{
|
||||
"GENDER_MALE" => Application.Gender.Male,
|
||||
"GENDER_FEMALE" => Application.Gender.Female,
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
_ => Application.Gender.None
|
||||
};
|
||||
}
|
||||
public record IdentificationInformation(string NationalId, string BirthDate, string ShenasnameSeri, string ShenasnameSerial, string ShenasnamehNumber);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,7 @@ public class BaseCustomizeEntity : EntityBase
|
||||
|
||||
public BreakTime BreakTime { get; protected set; }
|
||||
|
||||
public List<WeeklyOffDay> WeeklyOffDays { get; set; }
|
||||
public List<WeeklyOffDay> WeeklyOffDays { get; set; } = [];
|
||||
|
||||
public void FridayWorkToWeeklyDayOfWeek()
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
|
||||
namespace _0_Framework.Domain;
|
||||
|
||||
@@ -17,4 +18,6 @@ public interface IRepository<TKey, T> where T:class
|
||||
bool Exists(Expression<Func<T, bool>> expression);
|
||||
void SaveChanges();
|
||||
Task SaveChangesAsync();
|
||||
Task<IDbContextTransaction> BeginTransactionAsync();
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace _0_Framework.Exceptions;
|
||||
|
||||
@@ -14,5 +15,13 @@ public class BadRequestException:Exception
|
||||
Details = details;
|
||||
}
|
||||
|
||||
public BadRequestException(string message, Dictionary<string, object?> extra) :
|
||||
base(message)
|
||||
{
|
||||
Extra = extra;
|
||||
}
|
||||
|
||||
public string Details { get; }
|
||||
public Dictionary<string,object> Extra { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Diagnostics;
|
||||
@@ -24,37 +25,42 @@ public class CustomExceptionHandler : IExceptionHandler
|
||||
"Error Message: {exceptionMessage}, Time of occurrence {time}",
|
||||
exception.Message, DateTime.UtcNow);
|
||||
|
||||
(string Detail, string Title, int StatusCode) details = exception switch
|
||||
(string Detail, string Title, int StatusCode, Dictionary<string, object>? Extra) details = exception switch
|
||||
{
|
||||
InternalServerException =>
|
||||
(
|
||||
exception.Message,
|
||||
exception.GetType().Name,
|
||||
context.Response.StatusCode = StatusCodes.Status500InternalServerError
|
||||
context.Response.StatusCode = StatusCodes.Status500InternalServerError,
|
||||
null
|
||||
),
|
||||
BadRequestException =>
|
||||
BadRequestException bre =>
|
||||
(
|
||||
exception.Message,
|
||||
exception.GetType().Name,
|
||||
context.Response.StatusCode = StatusCodes.Status400BadRequest
|
||||
context.Response.StatusCode = StatusCodes.Status400BadRequest,
|
||||
bre.Extra
|
||||
),
|
||||
NotFoundException =>
|
||||
(
|
||||
exception.Message,
|
||||
exception.GetType().Name,
|
||||
context.Response.StatusCode = StatusCodes.Status404NotFound
|
||||
context.Response.StatusCode = StatusCodes.Status404NotFound,
|
||||
null
|
||||
),
|
||||
UnAuthorizeException =>
|
||||
(
|
||||
exception.Message,
|
||||
exception.GetType().Name,
|
||||
context.Response.StatusCode = StatusCodes.Status401Unauthorized
|
||||
context.Response.StatusCode = StatusCodes.Status401Unauthorized,
|
||||
null
|
||||
),
|
||||
_ =>
|
||||
(
|
||||
exception.Message,
|
||||
exception.GetType().Name,
|
||||
context.Response.StatusCode = StatusCodes.Status500InternalServerError
|
||||
context.Response.StatusCode = StatusCodes.Status500InternalServerError,
|
||||
null
|
||||
)
|
||||
};
|
||||
|
||||
@@ -63,9 +69,12 @@ public class CustomExceptionHandler : IExceptionHandler
|
||||
Title = details.Title,
|
||||
Detail = details.Detail,
|
||||
Status = details.StatusCode,
|
||||
Instance = context.Request.Path
|
||||
Instance = context.Request.Path,
|
||||
Extensions = details.Extra ?? new Dictionary<string, object>()
|
||||
};
|
||||
|
||||
|
||||
|
||||
problemDetails.Extensions.Add("traceId", context.TraceIdentifier);
|
||||
|
||||
await context.Response.WriteAsJsonAsync(problemDetails, cancellationToken: cancellationToken);
|
||||
|
||||
8
0_Framework/InfraStructure/Mongo/MongoDbConfig.cs
Normal file
8
0_Framework/InfraStructure/Mongo/MongoDbConfig.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace _0_Framework.InfraStructure.Mongo;
|
||||
|
||||
public class MongoDbConfig
|
||||
{
|
||||
public string ConnectionString { get; set; } = null!;
|
||||
|
||||
public string DatabaseName { get; set; } = null!;
|
||||
}
|
||||
@@ -5,14 +5,14 @@ namespace _0_Framework.InfraStructure;
|
||||
|
||||
public static class QueryableExtensions
|
||||
{
|
||||
public static IQueryable<T> ApplyPagination<T>(this IQueryable<T> query, int page, int pageSize)
|
||||
public static IQueryable<T> ApplyPagination<T>(this IQueryable<T> query, int page, int pageSize = 30)
|
||||
{
|
||||
if (page <= 0) page = 1;
|
||||
if (pageSize <= 0) pageSize = 10;
|
||||
|
||||
return query.Skip((page - 1) * pageSize).Take(pageSize);
|
||||
}
|
||||
public static IEnumerable<T> ApplyPagination<T>(this IEnumerable<T> source, int page, int pageSize)
|
||||
public static IEnumerable<T> ApplyPagination<T>(this IEnumerable<T> source, int page, int pageSize = 30)
|
||||
{
|
||||
if (page <= 0) page = 1;
|
||||
if (pageSize <= 0) pageSize = 10;
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
|
||||
namespace _0_Framework.InfraStructure
|
||||
{
|
||||
@@ -70,5 +71,10 @@ namespace _0_Framework.InfraStructure
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task<IDbContextTransaction> BeginTransactionAsync()
|
||||
{
|
||||
return await _context.Database.BeginTransactionAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,4 +64,6 @@ public interface IAccountApplication
|
||||
/// <param name="userName"></param>
|
||||
/// <returns></returns>
|
||||
public bool CheckExistClientAccount(string userName);
|
||||
List<AccountViewModel> GetAdminAccountsNew();
|
||||
|
||||
}
|
||||
@@ -259,7 +259,8 @@ public class AccountApplication : IAccountApplication
|
||||
var workshop = workshopList.First();
|
||||
authViewModel.WorkshopName = workshop.Name;
|
||||
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
|
||||
}
|
||||
authViewModel.WorkshopId = workshop.Id;
|
||||
}
|
||||
}
|
||||
|
||||
_authHelper.Signin(authViewModel);
|
||||
@@ -317,6 +318,7 @@ public class AccountApplication : IAccountApplication
|
||||
var workshop = workshopList.First();
|
||||
authViewModel.WorkshopName = workshop.WorkshopName;
|
||||
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.WorkshopId);
|
||||
authViewModel.WorkshopId = workshop.WorkshopId;
|
||||
}
|
||||
_authHelper.Signin(authViewModel);
|
||||
idAutoriz = 2;
|
||||
@@ -368,6 +370,7 @@ public class AccountApplication : IAccountApplication
|
||||
var workshop = workshopList.First();
|
||||
authViewModel.WorkshopName = workshop.Name;
|
||||
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
|
||||
authViewModel.WorkshopId = workshop.Id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,6 +518,7 @@ public class AccountApplication : IAccountApplication
|
||||
var workshop = authViewModel.WorkshopList.First();
|
||||
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
|
||||
authViewModel.WorkshopName = workshop.Name;
|
||||
authViewModel.WorkshopId = workshop.Id;
|
||||
}
|
||||
_authHelper.Signin(authViewModel);
|
||||
return operation.Succcedded(2);
|
||||
@@ -795,4 +799,8 @@ public class AccountApplication : IAccountApplication
|
||||
return _accountRepository.CheckExistClientAccount(userName);
|
||||
}
|
||||
|
||||
public List<AccountViewModel> GetAdminAccountsNew()
|
||||
{
|
||||
return _accountRepository.GetAdminAccountsNew();
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\0_Framework\0_Framework.csproj" />
|
||||
<ProjectReference Include="..\..\AccountManagement.Configuration\AccountManagement.Configuration.csproj" />
|
||||
<ProjectReference Include="..\..\PersonalContractingParty.Config\PersonalContractingParty.Config.csproj" />
|
||||
<ProjectReference Include="..\..\Query.Bootstrapper\Query.Bootstrapper.csproj" />
|
||||
<ProjectReference Include="..\..\WorkFlow\Infrastructure\WorkFlow.Infrastructure.Config\WorkFlow.Infrastructure.Config.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,32 +0,0 @@
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace BackgroundJobs.Task
|
||||
{
|
||||
public class FileUploader : IFileUploader
|
||||
{
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
|
||||
public FileUploader(IWebHostEnvironment webHostEnvironment)
|
||||
{
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
}
|
||||
|
||||
public string Upload(IFormFile file, string path)
|
||||
{
|
||||
if (file == null) return "";
|
||||
|
||||
var directoryPath = $"{_webHostEnvironment.WebRootPath}\\ProductPictures\\{path}";
|
||||
|
||||
if (!Directory.Exists(directoryPath))
|
||||
Directory.CreateDirectory(directoryPath);
|
||||
|
||||
var fileName = $"{DateTime.Now.ToFileName()}-{file.FileName}";
|
||||
var filePath = $"{directoryPath}\\{fileName}";
|
||||
var output = System.IO.File.Create(filePath);
|
||||
file.CopyTo(output);
|
||||
return $"{path}/{fileName}";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
using Hangfire;
|
||||
|
||||
namespace BackgroundJobs.Task.Jobs;
|
||||
|
||||
public class JobSchedulerRegistrator
|
||||
{
|
||||
private readonly IBackgroundJobClient _backgroundJobClient;
|
||||
private readonly SmsReminder _smsReminder;
|
||||
private static DateTime? _lastRunDateMorning;
|
||||
private static DateTime? _lastRunDateEvening;
|
||||
|
||||
public JobSchedulerRegistrator(SmsReminder smsReminder, IBackgroundJobClient backgroundJobClient)
|
||||
{
|
||||
_smsReminder = smsReminder;
|
||||
_backgroundJobClient = backgroundJobClient;
|
||||
}
|
||||
|
||||
public void Register()
|
||||
{
|
||||
RecurringJob.AddOrUpdate(
|
||||
"Task.SmsReminderChecker",
|
||||
() => SmsReminderCheckAndSchedule(),
|
||||
"*/5 * * * *" // هر 5 دقیقه یکبار چک کن
|
||||
);
|
||||
}
|
||||
|
||||
public void SmsReminderCheckAndSchedule()
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
|
||||
var startMorning = new TimeSpan(9, 0, 0);
|
||||
var endMorning = new TimeSpan(9, 40, 0);
|
||||
|
||||
var startEvening = new TimeSpan(15, 30, 0);
|
||||
var endEvening = new TimeSpan(15, 40, 0);
|
||||
|
||||
// صبح
|
||||
if (now.DayOfWeek != DayOfWeek.Friday &&
|
||||
now.TimeOfDay >= startMorning &&
|
||||
now.TimeOfDay < endMorning)
|
||||
{
|
||||
if (_lastRunDateMorning?.Date != now.Date)
|
||||
{
|
||||
_backgroundJobClient.Enqueue(() => _smsReminder.Execute());
|
||||
_lastRunDateMorning = now;
|
||||
}
|
||||
}
|
||||
|
||||
// عصر - پنجشنبه و جمعه تعطیل است
|
||||
if (now.DayOfWeek != DayOfWeek.Friday &&
|
||||
now.DayOfWeek != DayOfWeek.Thursday &&
|
||||
now.TimeOfDay >= startEvening &&
|
||||
now.TimeOfDay < endEvening)
|
||||
{
|
||||
if (_lastRunDateEvening?.Date != now.Date)
|
||||
{
|
||||
_backgroundJobClient.Enqueue(() => _smsReminder.Execute());
|
||||
_lastRunDateEvening = now;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
using _0_Framework.Application.Sms;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using AccountMangement.Infrastructure.EFCore;
|
||||
using Company.Domain.SmsResultAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SmsResult = Company.Domain.SmsResultAgg.SmsResult;
|
||||
|
||||
namespace BackgroundJobs.Task.Jobs;
|
||||
public class SmsReminder
|
||||
{
|
||||
private readonly AccountContext _accountContext;
|
||||
private readonly ISmsService _smsService;
|
||||
private readonly ISmsResultRepository _smsResultRepository;
|
||||
|
||||
public SmsReminder(ISmsService smsService, AccountContext accountContext, ISmsResultRepository smsResultRepository)
|
||||
{
|
||||
_smsService = smsService;
|
||||
_accountContext = accountContext;
|
||||
_smsResultRepository = smsResultRepository;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
//var accounts = _accountContext.Accounts.Where(x => x.PositionId > 0 && x.IsActiveString == "true").Select(x => new AccountViewModel() { Id = x.id, Mobile = x.Mobile, Fullname = x.Fullname }).ToList();
|
||||
//Thread.Sleep(300);
|
||||
//var accounts = new List<AccountViewModel>() { new AccountViewModel() { Mobile = "09114221321", Id = 2 } };
|
||||
var accounts= _accountContext.Accounts.Where(x => x.Username.ToLower()=="mahan").Select(x => new AccountViewModel() { Id = x.id, Mobile = x.Mobile, Fullname = x.Fullname }).ToList();
|
||||
var smsVM = accounts.Select(x => new AccountSmsTaskViewModel()
|
||||
{
|
||||
Mobile = x.Mobile,
|
||||
AccountId = x.Id,
|
||||
FullName = x.Fullname,
|
||||
TaskCount = GetLateTasksCount(x.Id)
|
||||
}).Where(x => x.TaskCount > 0 && !string.IsNullOrEmpty(x.Mobile) && x.Mobile.Length == 11).ToList();
|
||||
Thread.Sleep(300);
|
||||
|
||||
|
||||
foreach (var viewmodel in smsVM)
|
||||
{
|
||||
var smsResult = _smsService.TaskReminderSms(viewmodel.Mobile, $"{viewmodel.TaskCount}");
|
||||
Thread.Sleep(1000);
|
||||
var createSmsResult = new SmsResult(smsResult.MessageId, smsResult.Message, "یادآور وظایف",
|
||||
viewmodel.FullName, viewmodel.Mobile, viewmodel.AccountId, viewmodel.AccountId);
|
||||
_smsResultRepository.Create(createSmsResult);
|
||||
_smsResultRepository.SaveChanges();
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
private int GetLateTasksCount(long accountId)
|
||||
{
|
||||
var positionValue = _accountContext.Accounts
|
||||
.Where(x => x.id == accountId)
|
||||
.Include(p => p.Position)
|
||||
.Select(x => x.Position.PositionValue)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (positionValue == 0)
|
||||
return 0;
|
||||
|
||||
|
||||
DateTime now = DateTime.Now;
|
||||
int overdueTasksCount;
|
||||
|
||||
if (positionValue == 1)
|
||||
{
|
||||
overdueTasksCount = _accountContext.Assigns.Include(x => x.Task).Where(x => x.AssignedId == accountId &&
|
||||
x.AssignerId == accountId && x.Task.Assigns.Count == 1 &&
|
||||
!x.IsCancel && !x.IsCanceledRequest &&
|
||||
!x.IsDone && !x.TimeRequest && !x.IsDoneRequest && x.EndTaskDate.Date <= DateTime.Now.Date && x.Task.IsActiveString == "true")
|
||||
.GroupBy(x => x.TaskId).Select(x => x.First()).Count();
|
||||
|
||||
//overdueTasksCount = _accountContext.Tasks.Include(x =>
|
||||
// x.Assigns).Count(x => !x.Assigns.Any(a => a.IsCancel) && !x.Assigns.Any(a => a.IsCanceledRequest) &&
|
||||
// !x.Assigns.Any(a => a.IsDone) && !x.Assigns.Any(a => a.IsDoneRequest) &&
|
||||
// !x.Assigns.Any(a => a.TimeRequest)
|
||||
// && x.Assigns.Any(a => a.AssignedId == accountId && a.AssignerId == accountId) &&
|
||||
// (x.Assigns.First(a => a.AssignedId == accountId && a.AssignerId == accountId)
|
||||
// .EndTaskDate.Date <= DateTime.Now.Date) && x.Assigns.Count == 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
overdueTasksCount = _accountContext.Assigns
|
||||
.Include(x => x.Task)
|
||||
.Where(x => x.AssignedId == accountId &&
|
||||
!x.IsCancel && !x.IsCanceledRequest &&
|
||||
!x.IsDone && !x.TimeRequest && !x.IsDoneRequest && x.EndTaskDate.Date <= DateTime.Now.Date && x.Task.IsActiveString == "true")
|
||||
.GroupBy(x => x.TaskId).Select(x => x.First()).Count();
|
||||
}
|
||||
|
||||
|
||||
//overdueTasksCount = _accountContext.Tasks.Include(x =>
|
||||
// x.Assigns).Count(x => !x.Assigns.Any(a => a.IsCancel) && !x.Assigns.Any(a => a.IsCanceledRequest) &&
|
||||
// !x.Assigns.Any(a => a.IsDone) && !x.Assigns.Any(a => a.IsDoneRequest) &&
|
||||
// !x.Assigns.Any(a => a.TimeRequest)
|
||||
// && x.Assigns.Any(a => a.AssignedId == accountId) &&
|
||||
// (x.Assigns.First(a => a.AssignedId == accountId).EndTaskDate.Date <= DateTime.Now.Date));
|
||||
|
||||
|
||||
var overdueRequestsCount = _accountContext.Assigns.Include(x => x.Task)
|
||||
.Where(x => (x.IsCanceledRequest
|
||||
|| x.IsDoneRequest || x.TimeRequest) && !x.IsCancel && !x.IsDone &&
|
||||
x.Task.IsActiveString == "true" &&
|
||||
x.Task.SenderId == accountId).GroupBy(x => x.TaskId).Select(x => x.First()).Count();
|
||||
|
||||
return overdueTasksCount + overdueRequestsCount;
|
||||
}
|
||||
|
||||
}
|
||||
public class AccountSmsTaskViewModel
|
||||
{
|
||||
public int TaskCount { get; set; }
|
||||
public long AccountId { get; set; }
|
||||
public string Mobile { get; set; }
|
||||
public string FullName { get; set; }
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using BackgroundJobs.Task.Jobs;
|
||||
|
||||
namespace BackgroundJobs.Task;
|
||||
|
||||
public class JobsBootstrapper
|
||||
{
|
||||
public static void Configure(IServiceCollection services)
|
||||
{
|
||||
var currentNamespace = typeof(JobSchedulerRegistrator).Namespace; // همون namespace کلاس
|
||||
|
||||
var assembly = typeof(JobSchedulerRegistrator).Assembly;
|
||||
|
||||
var jobTypes = assembly.GetTypes()
|
||||
.Where(t =>
|
||||
t is { IsClass: true, IsAbstract: false, Namespace: not null } &&
|
||||
t.Namespace.StartsWith(currentNamespace, StringComparison.Ordinal))
|
||||
.ToList();
|
||||
|
||||
foreach (var jobType in jobTypes)
|
||||
{
|
||||
services.AddTransient(jobType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Sms;
|
||||
using _0_Framework.Application.UID;
|
||||
using AccountManagement.Configuration;
|
||||
using BackgroundJobs.Task;
|
||||
using BackgroundJobs.Task.Jobs;
|
||||
using Hangfire;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using PersonalContractingParty.Config;
|
||||
using Query.Bootstrapper;
|
||||
using WorkFlow.Infrastructure.Config;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
var hangfireConnectionString = builder.Configuration.GetConnectionString("HangfireDb");
|
||||
builder.Services.AddHangfire(x => x.UseSqlServerStorage(hangfireConnectionString));
|
||||
builder.Services.AddHangfireServer();
|
||||
var connectionString = builder.Configuration.GetConnectionString("MesbahDb");
|
||||
var connectionStringTestDb = builder.Configuration.GetConnectionString("TestDb");
|
||||
builder.Services.AddSingleton<IPasswordHasher, PasswordHasher>();
|
||||
builder.Services.AddTransient<IAuthHelper, AuthHelper>();
|
||||
builder.Services.AddTransient<ISmsService, SmsService>();
|
||||
builder.Services.AddTransient<IUidService, UidService>();
|
||||
builder.Services.AddTransient<IFileUploader, FileUploader>();
|
||||
builder.Services.Configure<AppSettingConfiguration>(builder.Configuration);
|
||||
|
||||
PersonalBootstrapper.Configure(builder.Services, connectionString);
|
||||
TestDbBootStrapper.Configure(builder.Services, connectionStringTestDb);
|
||||
AccountManagementBootstrapper.Configure(builder.Services, connectionString);
|
||||
WorkFlowBootstrapper.Configure(builder.Services, connectionString);
|
||||
QueryBootstrapper.Configure(builder.Services);
|
||||
JobsBootstrapper.Configure(builder.Services);
|
||||
builder.Services.AddHttpClient();
|
||||
builder.Services.AddHttpContextAccessor();
|
||||
var app = builder.Build();
|
||||
|
||||
app.MapHangfireDashboard();
|
||||
app.MapGet("/", () => "Hello World!");
|
||||
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var jobScheduler = scope.ServiceProvider.GetRequiredService<JobSchedulerRegistrator>();
|
||||
jobScheduler.Register();
|
||||
}
|
||||
|
||||
app.Run();
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:56492",
|
||||
"sslPort": 44378
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "http://localhost:5216",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"https": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "https://localhost:7222;http://localhost:5216",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
{
|
||||
"DetailedErrors": true,
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
//تست
|
||||
//"MesbahDb": "Data Source=DESKTOP-NUE119G\\MSNEW;Initial Catalog=Mesbah_db;Integrated Security=True"
|
||||
|
||||
//server
|
||||
//"MesbahDb": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;",
|
||||
|
||||
|
||||
//local
|
||||
"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",
|
||||
|
||||
//dad-mehr
|
||||
//"MesbahDb": "Data Source=.;Initial Catalog=teamWork;Integrated Security=True;TrustServerCertificate=true;",
|
||||
|
||||
"TestDb": "Data Source=.;Initial Catalog=TestDb;Integrated Security=True;TrustServerCertificate=true;",
|
||||
|
||||
//mahan Docker
|
||||
//"MesbahDb": "Data Source=localhost,5069;Initial Catalog=mesbah_db;User ID=sa;Password=YourPassword123;TrustServerCertificate=True;",
|
||||
"HangfireDb": "Data Source=.;Initial Catalog=hangfire_db;Integrated Security=True;TrustServerCertificate=true;"
|
||||
},
|
||||
|
||||
"GoogleRecaptchaV3": {
|
||||
"SiteKey": "6Lfhp_AnAAAAAB79WkrMoHd1k8ir4m8VvfjE7FTH",
|
||||
"SecretKey": "6Lfhp_AnAAAAANjDDY6DPrbbUQS7k6ZCRmrVP5Lb"
|
||||
},
|
||||
"SmsSecrets": {
|
||||
"ApiKey": "Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa",
|
||||
"SecretKey": "dadmehr"
|
||||
},
|
||||
"Domain": ".gozareshgir.ir",
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
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);
|
||||
}
|
||||
@@ -30,7 +30,7 @@ public class Checkout : EntityBase
|
||||
string overNightWorkValue, string fridayWorkValue, string rotatingShifValue, string absenceValue,
|
||||
string totalDayOfLeaveCompute, string totalDayOfYearsCompute, string totalDayOfBunosesCompute,
|
||||
ICollection<CheckoutLoanInstallment> loanInstallments,
|
||||
ICollection<CheckoutSalaryAid> salaryAids,CheckoutRollCall checkoutRollCall)
|
||||
ICollection<CheckoutSalaryAid> salaryAids,CheckoutRollCall checkoutRollCall,TimeSpan employeeMandatoryHours)
|
||||
{
|
||||
EmployeeFullName = employeeFullName;
|
||||
FathersName = fathersName;
|
||||
@@ -90,8 +90,10 @@ public class Checkout : EntityBase
|
||||
LoanInstallments = loanInstallments;
|
||||
SalaryAids = salaryAids;
|
||||
CheckoutRollCall = checkoutRollCall;
|
||||
EmployeeMandatoryHours = employeeMandatoryHours;
|
||||
}
|
||||
|
||||
|
||||
public string EmployeeFullName { get; private set; }
|
||||
public string IsActiveString { get; private set; }
|
||||
public string Signature { get; private set; }
|
||||
@@ -193,7 +195,16 @@ public class Checkout : EntityBase
|
||||
/// </summary>
|
||||
public string TotalDayOfBunosesCompute { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// دارای تداخل مبلغ است. این در زمانی اتفاق می افتد که فیش مبلغ آن تغییر کرده ولی به دلیل مسائل قانونی امکان صدور دوباره آن وجود ندارد
|
||||
/// </summary>
|
||||
public bool HasAmountConflict { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ساعت موظفی پرسنل در ماه
|
||||
/// </summary>
|
||||
public TimeSpan EmployeeMandatoryHours { get; set; }
|
||||
|
||||
#region valueObjects
|
||||
|
||||
public ICollection<CheckoutLoanInstallment> LoanInstallments { get; set; } = [];
|
||||
@@ -316,6 +327,16 @@ public class Checkout : EntityBase
|
||||
{
|
||||
CheckoutRollCall = checkoutRollCall;
|
||||
}
|
||||
|
||||
public void SetAmountConflict(bool hasAmountConflict)
|
||||
{
|
||||
HasAmountConflict = hasAmountConflict;
|
||||
}
|
||||
|
||||
public void SetEmployeeMandatoryHours(TimeSpan employeeMandatoryHours)
|
||||
{
|
||||
EmployeeMandatoryHours = employeeMandatoryHours;
|
||||
}
|
||||
}
|
||||
|
||||
public class CheckoutRollCall
|
||||
|
||||
@@ -78,4 +78,6 @@ public interface ICheckoutRepository : IRepository<long, Checkout>
|
||||
long workshopId, DateTime start, DateTime end);
|
||||
|
||||
#endregion
|
||||
|
||||
Task<Checkout> GetByWorkshopIdEmployeeIdInDate(long workshopId, long employeeId, DateTime inDate);
|
||||
}
|
||||
@@ -10,6 +10,7 @@ namespace Company.Domain.ClassifiedSalaryAgg
|
||||
{
|
||||
public class ClassifiedSalary : EntityBase
|
||||
{
|
||||
//test//test
|
||||
public ClassifiedSalary(double group1, double group2, double group3, double group4, double group5, double group6, double group7, double group8, double group9, double group10, double group11, double group12, double group13, double group14, double group15, double group16, double group17, double group18, double group19, double group20, DateTime startDate, DateTime endDate, int year)
|
||||
{
|
||||
Group1 = group1;
|
||||
|
||||
@@ -18,4 +18,8 @@
|
||||
<Folder Include="CheckoutAgg\ValueObjects\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MongoDB.Bson" Version="3.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -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);
|
||||
@@ -74,4 +74,6 @@ public interface IPersonalContractingPartyRepository :IRepository<long, Personal
|
||||
Task<GetRealContractingPartyDetailsViewModel> GetRealDetails(long id);
|
||||
Task<GetLegalContractingPartyDetailsViewModel> GetLegalDetails(long id);
|
||||
|
||||
Task<PersonalContractingParty> GetByNationalCode(string nationalCode);
|
||||
Task<PersonalContractingParty> GetByRegisterId(string registerId);
|
||||
}
|
||||
@@ -73,12 +73,27 @@ 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; }
|
||||
|
||||
/// <summary>
|
||||
/// نام مدیر عامل (فقط برای طرف حقوقی)
|
||||
/// </summary>
|
||||
public string CeoFName { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام خانوادگی مدیر عامل (فقط برای طرف حقوقی)
|
||||
/// </summary>
|
||||
public string CeoLName { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -94,7 +109,8 @@ public class PersonalContractingParty : EntityBase
|
||||
public PersonalContractingParty(string fName, string lName, string nationalcode, string idNumber,
|
||||
/*string legalName,*/ string registerId, string nationalId, string isLegal,
|
||||
string phone, string agentPhone, string address,long representativeId,
|
||||
string representativeFullName, int archiveCode, string state,string city, string zone, string sureName)
|
||||
string representativeFullName, int archiveCode, string state,string city,
|
||||
string zone, string sureName,string ceoFName,string ceoLName,string legalPosition=null)
|
||||
{
|
||||
|
||||
FName = fName;
|
||||
@@ -120,8 +136,9 @@ public class PersonalContractingParty : EntityBase
|
||||
IsActiveString = "true";
|
||||
IsBlock = "false";
|
||||
BlockTimes = 0;
|
||||
|
||||
|
||||
LegalPosition = legalPosition;
|
||||
CeoFName = ceoFName;
|
||||
CeoLName = ceoLName;
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +168,7 @@ public class PersonalContractingParty : EntityBase
|
||||
}
|
||||
|
||||
public void EditLegal(string lName, string registerId, string nationalId, string phone, string agentPhone, string address, long representativeId, string representativeFullName, int archiveCode,
|
||||
string state, string city, string zone, string sureName)
|
||||
string state, string city, string zone, string sureName,string legalPosition = null)
|
||||
{
|
||||
|
||||
LName = lName;
|
||||
@@ -168,6 +185,8 @@ public class PersonalContractingParty : EntityBase
|
||||
State = state;
|
||||
City = city;
|
||||
Zone = zone;
|
||||
if (legalPosition != null)
|
||||
LegalPosition = legalPosition;
|
||||
|
||||
|
||||
}
|
||||
@@ -203,7 +222,8 @@ public class PersonalContractingParty : EntityBase
|
||||
IsAuthenticated = true;
|
||||
}
|
||||
|
||||
public void Authentication(string fName, string lName, string fatherName,string idNumber, string idNumberSeri, string idNumberSerial, string dateOfBirth, Gender gender)
|
||||
public void Authentication(string fName, string lName, string fatherName,string idNumber,
|
||||
string idNumberSeri, string idNumberSerial, string dateOfBirth, Gender gender,string phone)
|
||||
{
|
||||
this.FName = fName;
|
||||
this.LName = lName;
|
||||
@@ -214,6 +234,22 @@ public class PersonalContractingParty : EntityBase
|
||||
this.IdNumber = idNumber;
|
||||
this.Gender = gender;
|
||||
this.IsAuthenticated = true;
|
||||
Phone = phone;
|
||||
}
|
||||
|
||||
public void LegalAuthentication(string fName, string lName, string fatherName,string idNumber, string idNumberSeri,
|
||||
string idNumberSerial, string dateOfBirth, Gender gender,string phone)
|
||||
{
|
||||
CeoFName = fName;
|
||||
CeoLName = lName;
|
||||
this.FatherName = fatherName;
|
||||
this.IdNumberSeri = idNumberSeri;
|
||||
this.IdNumberSerial = idNumberSerial;
|
||||
this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : null;
|
||||
this.IdNumber = idNumber;
|
||||
this.Gender = gender;
|
||||
this.IsAuthenticated = true;
|
||||
Phone = phone;
|
||||
}
|
||||
|
||||
public void RegisterComplete(string fatherName, string idNumberSeri, string idNumberSerial, DateTime dateOfBirth, Gender gender)
|
||||
|
||||
@@ -17,7 +17,7 @@ public class Contract : EntityBase
|
||||
public Contract(long personnelCode, long employeeId, long employerId,
|
||||
long workshopIds, long yearlySalaryId, DateTime contarctStart, DateTime contractEnd, string dayliWage,
|
||||
string archiveCode, DateTime getWorkDate, DateTime setContractDate, string jobType,
|
||||
string contractType, string workshopAddress1, string workshopAddress2, string consumableItems, long jobTypeId, string housingAllowance, string agreementSalary, string workingHoursWeekly, string familyAllowance, string contractPeriod)
|
||||
string contractType, string workshopAddress1, string workshopAddress2, string consumableItems, long jobTypeId, string housingAllowance, string agreementSalary, string workingHoursWeekly, string familyAllowance, string contractPeriod, double dailySalaryAffected, double baseYearAffected, double dailySalaryUnAffected, double baseYearUnAffected, bool hasManualDailyWage, string dailyWageType)
|
||||
{
|
||||
PersonnelCode = personnelCode;
|
||||
EmployeeId = employeeId;
|
||||
@@ -45,6 +45,19 @@ public class Contract : EntityBase
|
||||
WorkingHoursWeekly = workingHoursWeekly;
|
||||
FamilyAllowance = familyAllowance;
|
||||
ContractPeriod = contractPeriod;
|
||||
|
||||
//پراپرتی های جدید برای دستمزد دلخواه
|
||||
#region NewManualDailyWage
|
||||
DailySalaryAffected = dailySalaryAffected;
|
||||
BaseYearAffected = baseYearAffected;
|
||||
DailySalaryUnAffected = dailySalaryUnAffected;
|
||||
BaseYearUnAffected = baseYearUnAffected;
|
||||
HasManualDailyWage = hasManualDailyWage;
|
||||
DailyWageType = dailyWageType;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Signature = "0";
|
||||
|
||||
|
||||
@@ -65,7 +78,42 @@ public class Contract : EntityBase
|
||||
public DateTime SetContractDate { get; private set; }
|
||||
public string JobType { get; private set; }
|
||||
public string ContractType { get; private set; }
|
||||
/// <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; }
|
||||
@@ -89,6 +137,7 @@ public class Contract : EntityBase
|
||||
|
||||
public Contract()
|
||||
{
|
||||
|
||||
WorkingHoursList = new List<WorkingHours>();
|
||||
}
|
||||
public void Edit(long pesrsonnelCode, long employeeId, long employerId, long workshopId, long yearlySalaryId,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
@@ -9,6 +10,24 @@ namespace Company.Domain.ContractAgg;
|
||||
|
||||
public interface IContractRepository : IRepository<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);
|
||||
|
||||
|
||||
@@ -8,10 +8,12 @@ namespace Company.Domain.ContractingPartyBankAccountsAgg;
|
||||
|
||||
public interface IContractingPartyBankAccountsRepository:IRepository<long,ContractingPartyBankAccount>
|
||||
{
|
||||
Task<OperationResult<List<GetContractingPartyBankAccountViewModel>>> GetList(ContractingPartyBankAccountSearchModel searchModel);
|
||||
Task<OperationResult<List<string>>> ContractingPartyOrAccountHolderNameSelectList(string search, string selected);
|
||||
Task<OperationResult<List<string>>> IBanSelectList(string search, string selected);
|
||||
Task<GetContractingPartyBankAccountViewModel> GetList(ContractingPartyBankAccountSearchModel searchModel);
|
||||
Task<List<string>> ContractingPartyOrAccountHolderNameSelectList(string search, string selected);
|
||||
Task<List<string>> IBanSelectList(string search, string selected);
|
||||
|
||||
Task<OperationResult<List<string>>> CardNumberSelectList(string search, string selected);
|
||||
Task<OperationResult<List<string>>> AccountNumberSelectList(string search, string selected);
|
||||
Task<List<string>> CardNumberSelectList(string search, string selected);
|
||||
Task<List<string>> AccountNumberSelectList(string search, string selected);
|
||||
Task<List<string>> GetAccountHolderNameSelectList(string search, string selected);
|
||||
Task<List<string>> ContractingPartyNamesSelectList(string search, string selected);
|
||||
}
|
||||
@@ -374,6 +374,13 @@ public class CustomizeCheckout : EntityBase
|
||||
TotalPayment = TotalPayment - previousAmount + newAmount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// آیا مغایرت مبلغ دارد
|
||||
/// </summary>
|
||||
public bool HasAmountConflict { get; private set; }
|
||||
|
||||
|
||||
public void SetHasAmountConflict(bool hasConflict)
|
||||
{
|
||||
HasAmountConflict = hasConflict;
|
||||
}
|
||||
}
|
||||
@@ -377,4 +377,16 @@ public class CustomizeCheckoutTemp : EntityBase
|
||||
{
|
||||
TotalPayment = TotalPayment - previousAmount + newAmount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// آیا مغایرت مبلغ دارد
|
||||
/// </summary>
|
||||
public bool HasAmountConflict { get; private set; }
|
||||
|
||||
|
||||
|
||||
public void SetHasAmountConflict(bool hasConflict)
|
||||
{
|
||||
HasAmountConflict = hasConflict;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,12 +13,15 @@ namespace Company.Domain.FinancialStatmentAgg;
|
||||
public interface IFinancialStatmentRepository : IRepository<long, FinancialStatment>
|
||||
{
|
||||
|
||||
[Obsolete("این متد منسوخ شده است. لطفاً از متد GetDetailsByContractingParty استفاده کنید.")]
|
||||
FinancialStatmentViewModel GetDetailsByContractingPartyId(long contractingPartyId);
|
||||
List<FinancialStatmentViewModel> Search(FinancialStatmentSearchModel searchModel);
|
||||
Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(long accountId,
|
||||
ClientFinancialStatementSearchModel searchModel);
|
||||
FinancialStatementSearchModel searchModel);
|
||||
|
||||
Task<OperationResult<ClientFinancialStatementViewModel>> GetDetailsByPublicId(string publicId);
|
||||
Task<GetFinancialStatementBalanceAmount> GetBalanceAmount(long id);
|
||||
Task<double> GetClientDebtAmount(long accountId);
|
||||
Task<FinancialStatmentDetailsByContractingPartyViewModel> GetDetailsByContractingParty(long contractingPartyId,FinancialStatementSearchModel searchModel);
|
||||
Task<FinancialStatment> GetByContractingPartyId(long contractingPartyId);
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
@@ -43,4 +44,20 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
||||
/// <param name="endOfMonth"></param>
|
||||
/// <param name="description"></param>
|
||||
void RollcallServiceCreateTransaction();
|
||||
|
||||
Task<PagedResult<GetInstitutionContractListItemsViewModel>> GetList(InstitutionContractListSearchModel searchModel);
|
||||
Task<GetInstitutionContractListStatsViewModel> GetListStats(InstitutionContractListSearchModel searchModel);
|
||||
Task<List<RegistrationWorkflowMainListViewModel>> RegistrationWorkflowMainList();
|
||||
Task<List<RegistrationWorkflowItemsViewModel>> RegistrationWorkflowItems(long institutionContractId);
|
||||
Task<InstitutionContractWorkshopInitial> GetInstitutionWorkshopInitialDetails(long institutionWorkshopInitialId);
|
||||
Task<InstitutionContract> GetIncludeWorkshopDetailsAsync(long institutionContractId);
|
||||
void UpdateStatusIfNeeded(long institutionContractId);
|
||||
Task<GetInstitutionVerificationDetailsViewModel> GetVerificationDetails(Guid id);
|
||||
Task<InstitutionContract> GetByPublicIdAsync(Guid id);
|
||||
Task<InstitutionContractExtensionInquiryResult> GetExtensionInquiry(long previousContractId);
|
||||
Task<InstitutionContractExtensionWorkshopsResponse> GetExtensionWorkshops(InstitutionContractExtensionWorkshopsRequest request);
|
||||
Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(InstitutionContractExtensionPlanRequest request);
|
||||
Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(InstitutionContractExtensionPaymentRequest request);
|
||||
Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
|
||||
Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search, string selected);
|
||||
}
|
||||
@@ -1,17 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Security.Cryptography;
|
||||
using _0_Framework.Domain;
|
||||
using Company.Domain.InstitutionContractContactInfoAgg;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
namespace Company.Domain.InstitutionContractAgg;
|
||||
|
||||
public class InstitutionContract : EntityBase
|
||||
{
|
||||
public InstitutionContract(string contractNo, long representativeId, string representativeName, long contractingPartyId,
|
||||
public InstitutionContract(string contractNo, long representativeId, string representativeName,
|
||||
long contractingPartyId,
|
||||
string contractingPartyName, DateTime contractDateGr, string contractDateFa, string state, string city,
|
||||
string address, DateTime contractStartGr, string contractStartFa, DateTime contractEndGr,
|
||||
string contractEndFa, double contractAmount, double dailyCompenseation, double obligation,
|
||||
double totalAmount, int extensionNo, string workshopManualCount, string employeeManualCount, string description, string officialCompany,string typeOfcontract, string hasValueAddedTax, double valueAddedTax)
|
||||
double totalAmount, int extensionNo, string workshopManualCount, string employeeManualCount, string description,
|
||||
string officialCompany, string typeOfcontract, string hasValueAddedTax, double valueAddedTax,
|
||||
List<InstitutionContractWorkshopInitial> workshopDetails, long lawId)
|
||||
{
|
||||
ContractNo = contractNo;
|
||||
RepresentativeId = representativeId;
|
||||
@@ -43,67 +49,124 @@ public class InstitutionContract : EntityBase
|
||||
TypeOfContract = typeOfcontract;
|
||||
HasValueAddedTax = hasValueAddedTax;
|
||||
ValueAddedTax = valueAddedTax;
|
||||
VerificationStatus = InstitutionContractVerificationStatus.PendingForVerify;
|
||||
ContactInfoList = [];
|
||||
Installments = [];
|
||||
WorkshopGroup = new InstitutionContractWorkshopGroup(id, workshopDetails);
|
||||
PublicId = Guid.NewGuid();
|
||||
LawId = lawId;
|
||||
}
|
||||
|
||||
public long LawId { get; private set; }
|
||||
|
||||
public string ContractNo { get; private set; }
|
||||
|
||||
public long RepresentativeId { get; private set; }
|
||||
|
||||
public string RepresentativeName { get; private set; }
|
||||
|
||||
public long ContractingPartyId { get; private set; }
|
||||
|
||||
public string ContractingPartyName { get; private set; }
|
||||
|
||||
public DateTime ContractDateGr { get; private set; }
|
||||
|
||||
public string ContractDateFa { get; private set; }
|
||||
|
||||
public string State { get; private set; }
|
||||
|
||||
public string City { get; private set; }
|
||||
|
||||
public string Address { get; private set; }
|
||||
|
||||
//public long ContactInfoId { get; private set; }
|
||||
public DateTime ContractStartGr { get; private set; }
|
||||
|
||||
public string ContractStartFa { get; private set; }
|
||||
|
||||
public DateTime ContractEndGr { get; private set; }
|
||||
|
||||
public string ContractEndFa { get; private set; }
|
||||
|
||||
|
||||
// مبلغ قرارداد
|
||||
public double ContractAmount { get; private set; }
|
||||
|
||||
|
||||
//خسارت روزانه
|
||||
public double DailyCompenseation { get; private set; }
|
||||
|
||||
//وجه التزام
|
||||
public double Obligation { get; private set; }
|
||||
|
||||
// مبلغ کل قرارداد
|
||||
public double TotalAmount { get; private set; }
|
||||
|
||||
public string WorkshopManualCount { get; private set; }
|
||||
|
||||
public string EmployeeManualCount { get; private set; }
|
||||
|
||||
public string IsActiveString { get; private set; }
|
||||
|
||||
public int ExtensionNo { get; private set; }
|
||||
|
||||
public string Description { get; private set; }
|
||||
|
||||
public string Signature { get; private set; }
|
||||
|
||||
public string OfficialCompany { get; private set; }
|
||||
|
||||
public string TypeOfContract { get; private set; }
|
||||
public string HasValueAddedTax { get; set; }
|
||||
public double ValueAddedTax { get; set; }
|
||||
|
||||
public string HasValueAddedTax { get; private set; }
|
||||
|
||||
public double ValueAddedTax { get; private set; }
|
||||
|
||||
public Guid PublicId { get; private set; }
|
||||
|
||||
public string VerifyCode { get; private set; }
|
||||
public DateTime VerifyCodeCreation { get; private set; }
|
||||
|
||||
[NotMapped]
|
||||
public bool VerifyCodeExpired => VerifyCodeCreation.Add(ExpireTime) <= DateTime.Now;
|
||||
|
||||
[NotMapped]
|
||||
public bool CanResendVerifyCode => VerifyCodeCreation.Add(ReSendTime) <= DateTime.Now;
|
||||
|
||||
[NotMapped] public TimeSpan ExpireTime => TimeSpan.FromMinutes(5);
|
||||
|
||||
|
||||
|
||||
[NotMapped] public TimeSpan ReSendTime => TimeSpan.FromMinutes(2);
|
||||
|
||||
public bool IsInstallment { get; set; }
|
||||
|
||||
public InstitutionContractVerificationStatus VerificationStatus { get; private set; }
|
||||
|
||||
public InstitutionContractWorkshopGroup WorkshopGroup { get; private set; }
|
||||
|
||||
public List<InstitutionContractContactInfo> ContactInfoList { get; set; }
|
||||
|
||||
public List<InstitutionContractInstallment> Installments { get; set; }
|
||||
|
||||
public List<InstitutionContractAmendment> Amendments { get; private set; }
|
||||
|
||||
public InstitutionContract()
|
||||
{
|
||||
|
||||
ContactInfoList = new List<InstitutionContractContactInfo>();
|
||||
ContactInfoList = [];
|
||||
Installments = [];
|
||||
}
|
||||
|
||||
public void Edit(DateTime contractDateGr, string contractDateFa, string state, string city, string address,
|
||||
DateTime contractStartGr, string contractStartFa, DateTime contractEndGr, string contractEndFa,
|
||||
double contractAmount, double dailyCompenseation, double obligation, double totalAmount,
|
||||
string workshopManualCount, string employeeManualCount, string description, string officialCompany,
|
||||
string workshopManualCount, string employeeManualCount, string description, string officialCompany,
|
||||
string typeOfcontract, double valueAddedTax, string hasValueAddedTax)
|
||||
{
|
||||
|
||||
ContractDateGr = contractDateGr;
|
||||
ContractDateFa = contractDateFa;
|
||||
State = state;
|
||||
City = city;
|
||||
Address = address;
|
||||
|
||||
|
||||
ContractStartGr = contractStartGr;
|
||||
ContractStartFa = contractStartFa;
|
||||
ContractEndGr = contractEndGr;
|
||||
@@ -124,13 +187,11 @@ public class InstitutionContract : EntityBase
|
||||
|
||||
public void Active()
|
||||
{
|
||||
|
||||
this.IsActiveString = "true";
|
||||
}
|
||||
|
||||
public void DeActive()
|
||||
{
|
||||
|
||||
this.IsActiveString = "false";
|
||||
}
|
||||
|
||||
@@ -148,4 +209,132 @@ public class InstitutionContract : EntityBase
|
||||
{
|
||||
this.Signature = "0";
|
||||
}
|
||||
|
||||
public void Verified()
|
||||
{
|
||||
VerificationStatus = InstitutionContractVerificationStatus.Verified;
|
||||
}
|
||||
|
||||
public void SetPendingWorkflow()
|
||||
{
|
||||
VerificationStatus = InstitutionContractVerificationStatus.PendingWorkflow;
|
||||
}
|
||||
|
||||
public void SetInstallments(List<InstitutionContractInstallment> installments)
|
||||
{
|
||||
Installments = installments;
|
||||
IsInstallment = true;
|
||||
}
|
||||
|
||||
|
||||
public void SetVerifyCode(string code)
|
||||
{
|
||||
VerifyCode = code;
|
||||
VerifyCodeCreation = DateTime.Now;
|
||||
}
|
||||
|
||||
public void SetWorkshopGroup(InstitutionContractWorkshopGroup workshopGroup)
|
||||
{
|
||||
WorkshopGroup = workshopGroup;
|
||||
}
|
||||
|
||||
public void SetAmount(double totalAmount, double tax, double oneMonthPayment)
|
||||
{
|
||||
ContractAmount = oneMonthPayment;
|
||||
TotalAmount = totalAmount;
|
||||
ValueAddedTax = tax;
|
||||
HasValueAddedTax = tax > 0 ? "true" : "false";
|
||||
}
|
||||
|
||||
public void ClearGroup()
|
||||
{
|
||||
WorkshopGroup = null;
|
||||
}
|
||||
}
|
||||
|
||||
public class InstitutionContractAmendment : EntityBase
|
||||
{
|
||||
public long InstitutionContractId { get; set; }
|
||||
public InstitutionContract InstitutionContract { get; set; }
|
||||
public List<InstitutionContractInstallment> Installments { get; set; }
|
||||
public double Amount { get; set; }
|
||||
public bool HasInstallment { get; set; }
|
||||
public string VerifyCode { get; set; }
|
||||
public DateTime VerificationCreation { get; set; }
|
||||
public List<InstitutionContractAmendmentChange> AmendmentChanges { get; set; }
|
||||
}
|
||||
|
||||
public class InstitutionContractAmendmentChange : EntityBase
|
||||
{
|
||||
public long InstitutionContractAmendmentId { get; private set; }
|
||||
public InstitutionContractAmendment InstitutionContractAmendment { get; private set; }
|
||||
public InstitutionContractAmendmentChangeType ChangeType { get; private set; }
|
||||
public DateTime ChangeDateGr { 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; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد پرسنل
|
||||
/// </summary>
|
||||
public int? PersonnelCount { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد کارگاه
|
||||
/// </summary>
|
||||
public long? WorkshopDetailsId { get; private set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public enum InstitutionContractAmendmentChangeType
|
||||
{
|
||||
PersonCount,
|
||||
Services,
|
||||
WorkshopCreated
|
||||
}
|
||||
|
||||
public enum InstitutionContractVerificationStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// در انتظار تایید
|
||||
/// </summary>
|
||||
PendingForVerify = 0,
|
||||
|
||||
/// <summary>
|
||||
/// در انتظار کارپوشه
|
||||
/// </summary>
|
||||
PendingWorkflow = 1,
|
||||
|
||||
/// <summary>
|
||||
/// تایید شده
|
||||
/// </summary>
|
||||
Verified = 2
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace Company.Domain.InstitutionContractAgg;
|
||||
|
||||
public class InstitutionContractInstallment
|
||||
{
|
||||
public InstitutionContractInstallment(DateTime installmentDateGr, double amount,
|
||||
string description)
|
||||
{
|
||||
InstallmentDateGr = installmentDateGr;
|
||||
InstallmentDateFa = installmentDateGr.ToFarsi();
|
||||
Amount = amount;
|
||||
Description = description;
|
||||
}
|
||||
|
||||
public long Id { get; private set; }
|
||||
public DateTime InstallmentDateGr { get; private set; }
|
||||
public string InstallmentDateFa { get; private set; }
|
||||
public double Amount { get; private set; }
|
||||
public string Description { get; private set; }
|
||||
|
||||
public long InstitutionContractId { get; private set; }
|
||||
public long? InstitutionContractAmendmentId { get; private set; }
|
||||
|
||||
public InstitutionContract InstitutionContract { get; private set; }
|
||||
public InstitutionContractAmendment InstitutionContractAmendment { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.InstitutionContractAgg;
|
||||
|
||||
public class InstitutionContractWorkshopBase:EntityBase
|
||||
{
|
||||
protected InstitutionContractWorkshopBase(){}
|
||||
public InstitutionContractWorkshopBase(string workshopName, bool hasRollCallPlan,bool hasRollCallPlanInPerson,
|
||||
bool hasCustomizeCheckoutPlan, bool hasContractPlan,bool hasContractPlanInPerson,bool hasInsurancePlan,bool hasInsurancePlanInPerson,
|
||||
int personnelCount, double price )
|
||||
{
|
||||
WorkshopName = workshopName;
|
||||
Services = new WorkshopServices(hasInsurancePlan, hasInsurancePlanInPerson,
|
||||
hasContractPlan, hasContractPlanInPerson, hasRollCallPlan, hasRollCallPlanInPerson,hasCustomizeCheckoutPlan);
|
||||
PersonnelCount = personnelCount;
|
||||
Price = price;
|
||||
Employers = [];
|
||||
}
|
||||
/// <summary>
|
||||
/// شناسه کارگاه
|
||||
/// </summary>
|
||||
public long? WorkshopId { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; private set; }
|
||||
|
||||
public WorkshopServices Services { get; set; } = new (false, false,
|
||||
false, false, false,
|
||||
false, false);
|
||||
public int PersonnelCount { get; private set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شناسه قرارداد نهاد مرتبط
|
||||
/// </summary>
|
||||
public long InstitutionContractId { get; private set; }
|
||||
|
||||
|
||||
public double Price { get; private set; }
|
||||
|
||||
|
||||
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(employerId));
|
||||
}
|
||||
}
|
||||
public void AddEmployer(long employerId)
|
||||
{
|
||||
if (Employers.Exists(x => x.EmployerId == employerId))
|
||||
return;
|
||||
|
||||
Employers.Add(new InstitutionContractWorkshopDetailEmployer(employerId));
|
||||
}
|
||||
|
||||
// ⚡️ Equality Implementation
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is not InstitutionContractWorkshopBase other)
|
||||
return false;
|
||||
|
||||
return WorkshopName == other.WorkshopName &&
|
||||
PersonnelCount == other.PersonnelCount &&
|
||||
Price == other.Price &&
|
||||
Services == other.Services;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(WorkshopName, PersonnelCount, Price, Services);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework_b.Domain;
|
||||
|
||||
namespace Company.Domain.InstitutionContractAgg;
|
||||
|
||||
public class InstitutionContractWorkshopCurrent:InstitutionContractWorkshopBase
|
||||
{
|
||||
private InstitutionContractWorkshopCurrent(){}
|
||||
public InstitutionContractWorkshopCurrent(string workshopName, bool hasRollCallPlan,
|
||||
bool hasRollCallPlanInPerson, bool hasCustomizeCheckoutPlan, bool hasContractPlan,
|
||||
bool hasContractPlanInPerson, bool hasInsurancePlan, bool hasInsurancePlanInPerson,
|
||||
int personnelCount, double price,long institutionContractWorkshopGroupId,InstitutionContractWorkshopGroup workshopGroup,long workshopId) : base(workshopName, hasRollCallPlan,
|
||||
hasRollCallPlanInPerson, hasCustomizeCheckoutPlan, hasContractPlan,
|
||||
hasContractPlanInPerson, hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, price)
|
||||
{
|
||||
InstitutionContractWorkshopGroupId = institutionContractWorkshopGroupId;
|
||||
WorkshopGroup = workshopGroup;
|
||||
WorkshopId = workshopId;
|
||||
}
|
||||
public long InstitutionContractWorkshopGroupId { get; private set; }
|
||||
public InstitutionContractWorkshopGroup WorkshopGroup { get; private set; }
|
||||
public long InitialWorkshopId { get; private set; }
|
||||
public InstitutionContractWorkshopInitial WorkshopInitial { get; private set; }
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using _0_Framework_b.Domain;
|
||||
|
||||
namespace Company.Domain.InstitutionContractAgg;
|
||||
|
||||
public class InstitutionContractWorkshopGroup : EntityBase
|
||||
{
|
||||
private InstitutionContractWorkshopGroup()
|
||||
{
|
||||
}
|
||||
|
||||
public long InstitutionContractId { get; private set; }
|
||||
public InstitutionContract InstitutionContract { get; set; }
|
||||
public List<InstitutionContractWorkshopInitial> InitialWorkshops { get; private set; }
|
||||
public List<InstitutionContractWorkshopCurrent> CurrentWorkshops { get; private set; }
|
||||
public DateTime LastModifiedDate { get; private set; }
|
||||
|
||||
[NotMapped]
|
||||
public bool HasChanges =>
|
||||
!InitialWorkshops.Cast<InstitutionContractWorkshopBase>()
|
||||
.SequenceEqual(CurrentWorkshops.Cast<InstitutionContractWorkshopBase>());
|
||||
|
||||
public InstitutionContractWorkshopGroup(long institutionContractId,
|
||||
List<InstitutionContractWorkshopInitial> initialDetails)
|
||||
{
|
||||
InstitutionContractId = institutionContractId;
|
||||
var initialWorkshops = initialDetails.ToList();
|
||||
InitialWorkshops = initialWorkshops.ToList();
|
||||
LastModifiedDate = DateTime.Now;
|
||||
}
|
||||
|
||||
public void UpdateCurrentWorkshops(List<InstitutionContractWorkshopCurrent> updatedDetails)
|
||||
{
|
||||
CurrentWorkshops = updatedDetails.ToList();
|
||||
LastModifiedDate = DateTime.Now;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
namespace Company.Domain.InstitutionContractAgg;
|
||||
|
||||
public class InstitutionContractWorkshopInitial:InstitutionContractWorkshopBase
|
||||
{
|
||||
private InstitutionContractWorkshopInitial(){}
|
||||
public InstitutionContractWorkshopInitial(string workshopName, bool hasRollCallPlan,
|
||||
bool hasRollCallPlanInPerson, bool hasCustomizeCheckoutPlan, bool hasContractPlan,
|
||||
bool hasContractPlanInPerson, bool hasInsurancePlan, bool hasInsurancePlanInPerson,
|
||||
int personnelCount, double price) : base(workshopName, hasRollCallPlan,
|
||||
hasRollCallPlanInPerson, hasCustomizeCheckoutPlan, hasContractPlan, hasContractPlanInPerson,
|
||||
hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, price)
|
||||
{
|
||||
WorkshopCreated = false;
|
||||
}
|
||||
|
||||
public long InstitutionContractWorkshopGroupId { get; private set; }
|
||||
public InstitutionContractWorkshopGroup WorkshopGroup { get; private set; }
|
||||
public bool WorkshopCreated { get; private set; }
|
||||
|
||||
public InstitutionContractWorkshopCurrent? WorkshopCurrent { get; private set; }
|
||||
public long? InstitutionContractWorkshopCurrentId { get; private set; }
|
||||
|
||||
public void SetWorkshopId(long workshopId)
|
||||
{
|
||||
WorkshopId = workshopId;
|
||||
WorkshopCreated = true;
|
||||
WorkshopCurrent = new InstitutionContractWorkshopCurrent(WorkshopName,Services.RollCall,Services.RollCallInPerson,
|
||||
Services.CustomizeCheckout,Services.Contract,Services.ContractInPerson,Services.Insurance,
|
||||
Services.InsuranceInPerson,PersonnelCount,Price,InstitutionContractWorkshopGroupId,WorkshopGroup,workshopId);
|
||||
WorkshopCurrent.SetEmployers(Employers.Select(x=>x.EmployerId).ToList());
|
||||
}
|
||||
|
||||
public static InstitutionContractWorkshopInitial CreateManual(string workshopName, bool hasRollCallPlan,
|
||||
bool hasRollCallPlanInPerson, bool hasCustomizeCheckoutPlan, bool hasContractPlan,
|
||||
bool hasContractPlanInPerson, bool hasInsurancePlan, bool hasInsurancePlanInPerson,
|
||||
int personnelCount, double price, long workshopId,List<long> employerIds)
|
||||
{
|
||||
|
||||
var entity = new InstitutionContractWorkshopInitial(workshopName, hasRollCallPlan,
|
||||
hasRollCallPlanInPerson, hasCustomizeCheckoutPlan, hasContractPlan, hasContractPlanInPerson,
|
||||
hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, price);
|
||||
entity.WorkshopCreated = true;
|
||||
entity.WorkshopId = workshopId;
|
||||
entity.SetEmployers(employerIds);
|
||||
return entity;
|
||||
}
|
||||
|
||||
public void SetWorkshopGroup(InstitutionContractWorkshopGroup entityWorkshopGroup)
|
||||
{
|
||||
InstitutionContractWorkshopGroupId = entityWorkshopGroup.id;
|
||||
WorkshopGroup = entityWorkshopGroup;
|
||||
}
|
||||
}
|
||||
|
||||
public class InstitutionContractWorkshopDetailEmployer : EntityBase
|
||||
{
|
||||
public long EmployerId { get; private set; }
|
||||
|
||||
public InstitutionContractWorkshopDetailEmployer(long employerId)
|
||||
{
|
||||
EmployerId = employerId;
|
||||
}
|
||||
|
||||
private InstitutionContractWorkshopDetailEmployer() { }
|
||||
}
|
||||
23
Company.Domain/InstitutionContractAgg/WorkshopServices.cs
Normal file
23
Company.Domain/InstitutionContractAgg/WorkshopServices.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace Company.Domain.InstitutionContractAgg;
|
||||
public record WorkshopServices
|
||||
{
|
||||
public WorkshopServices(bool insurance, bool insuranceInPerson, bool contract, bool contractInPerson, bool rollCall, bool rollCallInPerson, bool customizeCheckout)
|
||||
{
|
||||
Insurance = insurance;
|
||||
InsuranceInPerson = insuranceInPerson;
|
||||
Contract = contract;
|
||||
ContractInPerson = contractInPerson;
|
||||
RollCall = rollCall;
|
||||
CustomizeCheckout = customizeCheckout;
|
||||
RollCallInPerson = rollCallInPerson;
|
||||
}
|
||||
|
||||
public bool Insurance { get; private set; }
|
||||
public bool InsuranceInPerson { get; private set; }
|
||||
public bool Contract { get; private set; }
|
||||
public bool ContractInPerson { get; private set; }
|
||||
public bool RollCall { get; private set; }
|
||||
|
||||
public bool RollCallInPerson { get; private set; }
|
||||
public bool CustomizeCheckout { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace Company.Domain.InstitutionContractInsertTempAgg;
|
||||
|
||||
public interface IInstitutionContractExtenstionTempRepository
|
||||
{
|
||||
Task Create(InstitutionContractExtensionTemp institutionContract);
|
||||
|
||||
Task<InstitutionContractExtensionTemp> GetPreviousExtenstionData(long contractingPartyId);
|
||||
Task Remove(Guid id);
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace Company.Domain.InstitutionContractInsertTempAgg;
|
||||
|
||||
public class InstitutionContractExtensionTemp
|
||||
{
|
||||
public InstitutionContractExtensionTemp(long previousContractingPartyId)
|
||||
{
|
||||
Id = Guid.NewGuid();
|
||||
PreviousId = previousContractingPartyId;
|
||||
}
|
||||
|
||||
[BsonId] // Specifies this field as the _id in MongoDB
|
||||
[BsonRepresentation(BsonType.String)] // Ensures the GUID is stored as a string
|
||||
public Guid Id { get; set; }
|
||||
public long PreviousId { get; set; }
|
||||
public string Address { get; set; }
|
||||
public string City { get; set; }
|
||||
public string Province { get; set; }
|
||||
public List<EditContactInfo> ContactInfos { get; set; }
|
||||
|
||||
public List<InstitutionContractExtensionTempWorkshop> Workshops { get; set; }
|
||||
|
||||
public InstitutionContractExtensionPlanDetail OneMonth { get; set; }
|
||||
public InstitutionContractExtensionPlanDetail ThreeMonths { get; set; }
|
||||
public InstitutionContractExtensionPlanDetail SixMonths { get; set; }
|
||||
public InstitutionContractExtensionPlanDetail TwelveMonths { get; set; }
|
||||
public InstitutionContractExtensionPaymentMonthly MonthlyPayment { get; set; }
|
||||
public InstitutionContractExtensionPaymentOneTime OneTimePayment { get; set; }
|
||||
|
||||
public bool HasContractInPerson { get; set; }
|
||||
|
||||
public InstitutionContractDuration? Duration { get; set; }
|
||||
|
||||
public void SetContractingPartyInfos(string address, string city, string province, List<EditContactInfo> contactInfos)
|
||||
{
|
||||
Address = address;
|
||||
City = city;
|
||||
Province = province;
|
||||
ContactInfos = contactInfos;
|
||||
}
|
||||
|
||||
public void SetWorkshopsAndPlanAmounts(List<InstitutionContractExtensionTempWorkshop> workshops,
|
||||
InstitutionContractExtensionPlanDetail oneMonth,
|
||||
InstitutionContractExtensionPlanDetail threeMonth, InstitutionContractExtensionPlanDetail sixMonth,
|
||||
InstitutionContractExtensionPlanDetail twelveMonth, bool hasContractInPerson)
|
||||
{
|
||||
Workshops = workshops;
|
||||
OneMonth = oneMonth;
|
||||
ThreeMonths = threeMonth;
|
||||
SixMonths = sixMonth;
|
||||
TwelveMonths = twelveMonth;
|
||||
HasContractInPerson = hasContractInPerson;
|
||||
}
|
||||
|
||||
public void SetAmountAndDuration(InstitutionContractDuration duration,InstitutionContractExtensionPaymentMonthly monthly,
|
||||
InstitutionContractExtensionPaymentOneTime oneTime)
|
||||
{
|
||||
Duration = duration;
|
||||
MonthlyPayment = monthly;
|
||||
OneTimePayment = oneTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class InstitutionContractExtenstionTempPlan
|
||||
{
|
||||
public InstitutionContractExtenstionTempPlan(string contractStart, string contractEnd,
|
||||
string oneMonthPaymentDiscounted, string oneMonthDiscount, string oneMonthOriginalPayment,
|
||||
string totalPayment, string dailyCompensation, string obligation)
|
||||
{
|
||||
ContractStart = contractStart;
|
||||
ContractEnd = contractEnd;
|
||||
OneMonthPaymentDiscounted = oneMonthPaymentDiscounted;
|
||||
OneMonthDiscount = oneMonthDiscount;
|
||||
OneMonthOriginalPayment = oneMonthOriginalPayment;
|
||||
TotalPayment = totalPayment;
|
||||
DailyCompensation = dailyCompensation;
|
||||
Obligation = obligation;
|
||||
}
|
||||
|
||||
public string ContractStart { get; set; }
|
||||
public string ContractEnd { get; set; }
|
||||
public string OneMonthPaymentDiscounted { get; set; }
|
||||
public string OneMonthDiscount { get; set; }
|
||||
public string OneMonthOriginalPayment { get; set; }
|
||||
public string TotalPayment { get; set; }
|
||||
public string DailyCompensation { get; set; }
|
||||
public string Obligation { get; set; }
|
||||
}
|
||||
|
||||
public class InstitutionContractExtensionTempWorkshop
|
||||
{
|
||||
public InstitutionContractExtensionTempWorkshop(string workshopName, int countPerson, bool contractAndCheckout, bool contractAndCheckoutInPerson,
|
||||
bool insurance, bool insuranceInPerson,
|
||||
bool rollCall,bool rollCallInPerson, bool customizeCheckout,double price,long workshopId)
|
||||
{
|
||||
WorkshopName = workshopName;
|
||||
CountPerson = countPerson;
|
||||
ContractAndCheckout = contractAndCheckout;
|
||||
Insurance = insurance;
|
||||
RollCall = rollCall;
|
||||
CustomizeCheckout = customizeCheckout;
|
||||
ContractAndCheckoutInPerson = contractAndCheckoutInPerson;
|
||||
InsuranceInPerson = insuranceInPerson;
|
||||
RollCallInPerson = rollCallInPerson;
|
||||
Price = price;
|
||||
WorkshopId = workshopId;
|
||||
}
|
||||
|
||||
public long WorkshopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد پرسنل
|
||||
/// </summary>
|
||||
public int CountPerson { get; private set; }
|
||||
|
||||
|
||||
#region ServiceSelection
|
||||
|
||||
/// <summary>
|
||||
/// قرارداد و تصفیه
|
||||
/// </summary>
|
||||
public bool ContractAndCheckout { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// بیمه
|
||||
/// </summary>
|
||||
public bool Insurance { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// حضورغباب
|
||||
/// </summary>
|
||||
public bool RollCall { get; private set; }
|
||||
|
||||
public bool RollCallInPerson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// فیش غیر رسمی
|
||||
/// </summary>
|
||||
public bool CustomizeCheckout { get;private set; }
|
||||
|
||||
/// <summary>
|
||||
/// خدمات حضوری قرداد و تصفیه
|
||||
/// </summary>
|
||||
public bool ContractAndCheckoutInPerson { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// خدمات حضوری بیمه
|
||||
/// </summary>
|
||||
public bool InsuranceInPerson { get; private set; }
|
||||
|
||||
public double Price{ get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
@@ -25,5 +25,6 @@ public interface IInsuranceJobRepositpry:IRepository<long, InsuranceJob>
|
||||
OperationResult EditInsuranceJob(EditInsuranceJob command);
|
||||
|
||||
|
||||
Task<List<InsuranceJobSelectListViewModel>> GetSelectList();
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,8 @@ public interface IInsuranceListRepository:IRepository<long, InsuranceList>
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel);
|
||||
|
||||
#endregion
|
||||
|
||||
Task<List<InsuranceListViewModel>> GetNotCreatedWorkshop(InsuranceListSearchModel searchModel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
116
Company.Domain/LawAgg/Law.cs
Normal file
116
Company.Domain/LawAgg/Law.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.Law;
|
||||
using System.Text.Json;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Company.Domain.LawAgg
|
||||
{
|
||||
public class Law : EntityBase
|
||||
{
|
||||
private Law(){}
|
||||
public string Title { get; private set; }
|
||||
public bool IsActive { get; private set; }
|
||||
public List<LawItem> Items { get; private set; }
|
||||
public LawType Type { get; private set; }
|
||||
public string HeadTitle { get; private set; }
|
||||
public string NotificationsJson { get; private set; }
|
||||
public int Version { get; private set; }
|
||||
|
||||
[NotMapped]
|
||||
public List<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, int version = 1)
|
||||
{
|
||||
Title = title;
|
||||
IsActive = true; // آخرین نسخه فعال است
|
||||
Items = new List<LawItem>();
|
||||
Type = lawType;
|
||||
Notifications = notifications ?? new List<string>();
|
||||
HeadTitle = headTitle;
|
||||
Version = version;
|
||||
}
|
||||
|
||||
public void Edit(string title)
|
||||
{
|
||||
Title = title;
|
||||
}
|
||||
|
||||
public void AddItem(string header, string details, int orderNumber)
|
||||
{
|
||||
Items.Add(new LawItem(header, details, orderNumber));
|
||||
}
|
||||
|
||||
public void SetItem(List<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 void SetAsLatestVersion()
|
||||
{
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public void SetAsOldVersion()
|
||||
{
|
||||
IsActive = false;
|
||||
}
|
||||
|
||||
public Law CreateNewVersion(string title, List<string> notifications, string headTitle, List<LawItem> items)
|
||||
{
|
||||
var newVersion = new Law(
|
||||
title,
|
||||
this.Type,
|
||||
notifications,
|
||||
headTitle,
|
||||
this.Version + 1
|
||||
);
|
||||
|
||||
newVersion.SetItem(items);
|
||||
newVersion.SetAsLatestVersion();
|
||||
|
||||
return newVersion;
|
||||
}
|
||||
}
|
||||
|
||||
public class LawItem
|
||||
{
|
||||
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);
|
||||
LeavErrorViewModel CheckErrors(DateTime startLeav, DateTime endLeav, long employeeId, long workshopId,bool isInvalid);
|
||||
LeaveViewModel LeavOnChekout(DateTime starContract, DateTime endContract, long employeeId, long workshopId);
|
||||
List<LeaveMainViewModel> searchClient(LeaveSearchModel searchModel);
|
||||
LeavePrintViewModel PrintOne(long id);
|
||||
|
||||
@@ -8,7 +8,9 @@ public class Leave: EntityBase
|
||||
{
|
||||
public Leave(DateTime startLeave, DateTime endLeave,
|
||||
string leaveHourses, long workshopId, long employeeId,
|
||||
string paidLeaveType, string leaveType, string employeeFullName, string workshopName, bool isAccepted, string decription, int year, int month, TimeSpan shiftDuration, bool hasShiftDuration)
|
||||
string paidLeaveType, string leaveType, string employeeFullName, string workshopName,
|
||||
bool isAccepted, string decription, int year, int month, TimeSpan shiftDuration,
|
||||
bool hasShiftDuration,bool isInvalid)
|
||||
{
|
||||
StartLeave = startLeave;
|
||||
EndLeave = endLeave;
|
||||
@@ -25,6 +27,7 @@ public class Leave: EntityBase
|
||||
Month = month;
|
||||
ShiftDuration = shiftDuration;
|
||||
HasShiftDuration = hasShiftDuration;
|
||||
IsInvalid = isInvalid;
|
||||
}
|
||||
|
||||
public DateTime StartLeave { get; private set; }
|
||||
@@ -43,6 +46,10 @@ public class Leave: EntityBase
|
||||
|
||||
public TimeSpan ShiftDuration { get; private set; }
|
||||
public bool HasShiftDuration { get; private set; }
|
||||
/// <summary>
|
||||
///آیا فاقد اعتبار است. فاقد اعتبار ها فقط برای فیش های غیررسمی مورد استفاده قرار میگیرند
|
||||
/// </summary>
|
||||
public bool IsInvalid { get; private set; }
|
||||
|
||||
public void Edit(DateTime startLeave, DateTime endLeave,
|
||||
string leaveHourses, long workshopId, long employeeId,
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.PaymentInstrument;
|
||||
|
||||
namespace Company.Domain.PaymentInstrumentAgg;
|
||||
|
||||
public interface IPaymentInstrumentGroupRepository:IRepository<long,PaymentInstrumentGroup>
|
||||
{
|
||||
void Remove(PaymentInstrumentGroup paymentInstrumentGroup);
|
||||
Task<List<PaymentInstrumentGroupsViewModel>> GetList();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.PaymentInstrument;
|
||||
|
||||
namespace Company.Domain.PaymentInstrumentAgg;
|
||||
|
||||
public interface IPaymentInstrumentRepository:IRepository<long,PaymentInstrument>
|
||||
{
|
||||
Task<GetPaymentInstrumentListViewModel> GetList(PaymentInstrumentSearchModel searchModel);
|
||||
Task<List<PosTerminalSelectListViewModel>> GetPosTerminalSelectList(string search);
|
||||
Task<List<string>> PosTerminalIdSelectList(string search, string selected);
|
||||
Task<List<string>> IbanSelectList(string search, string selected);
|
||||
Task<List<string>> AccountNumberSelectList(string search, string selected);
|
||||
Task<List<string>> CardNumberSelectList(string search, string selected);
|
||||
Task<List<string>> AccountHolderNameSelectList(string search, string selected);
|
||||
|
||||
}
|
||||
52
Company.Domain/PaymentInstrumentAgg/PaymentInstrument.cs
Normal file
52
Company.Domain/PaymentInstrumentAgg/PaymentInstrument.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.PaymentInstrument;
|
||||
|
||||
namespace Company.Domain.PaymentInstrumentAgg;
|
||||
|
||||
public class PaymentInstrument:EntityBase
|
||||
{
|
||||
private PaymentInstrument(string cardNumber, string accountHolderName, string accountNumber,string iBan,bool isAuth,long paymentInstrumentGroupId)
|
||||
{
|
||||
CardNumber = cardNumber;
|
||||
AccountHolderName = accountHolderName;
|
||||
AccountNumber = accountNumber;
|
||||
IBan = iBan;
|
||||
IsAuth = isAuth;
|
||||
PaymentInstrumentGroupId = paymentInstrumentGroupId;
|
||||
Type = PaymentInstrumentType.BankAccount;
|
||||
}
|
||||
|
||||
private PaymentInstrument(string posTerminalId , string description,long paymentInstrumentGroupId)
|
||||
{
|
||||
PosTerminalId = posTerminalId;
|
||||
Description = description;
|
||||
PaymentInstrumentGroupId = paymentInstrumentGroupId;
|
||||
Type = PaymentInstrumentType.Pos;
|
||||
}
|
||||
|
||||
public static PaymentInstrument CreatePosType(string posTerminalId, string description, long paymentInstrumentGroupId)
|
||||
{
|
||||
return new PaymentInstrument(posTerminalId, description, paymentInstrumentGroupId);
|
||||
}
|
||||
|
||||
public static PaymentInstrument CreateBankAccount(string cardNumber, string accountHolderName, string accountNumber,
|
||||
string iBan, bool isAuth, long paymentInstrumentGroupId)
|
||||
{
|
||||
return new PaymentInstrument(cardNumber, accountHolderName, accountNumber, iBan, isAuth, paymentInstrumentGroupId);
|
||||
}
|
||||
|
||||
public string CardNumber { get; private set; }
|
||||
public string AccountHolderName { get; private set; }
|
||||
public string AccountNumber { get; private set; }
|
||||
public string IBan { get; private set; }
|
||||
|
||||
public string PosTerminalId { get; private set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
public PaymentInstrumentType Type { get; private set; }
|
||||
|
||||
public bool IsAuth { get; private set; }
|
||||
|
||||
public long PaymentInstrumentGroupId { get; private set; }
|
||||
public PaymentInstrumentGroup PaymentInstrumentGroup { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.PaymentInstrumentAgg;
|
||||
|
||||
public class PaymentInstrumentGroup:EntityBase
|
||||
{
|
||||
public PaymentInstrumentGroup(string name)
|
||||
{
|
||||
Name = name;
|
||||
IsActive = IsActive.True;
|
||||
}
|
||||
|
||||
public string Name { get; private set; }
|
||||
public IsActive IsActive { get; private set; }
|
||||
public List<PaymentInstrument> PaymentInstruments { get; set; }
|
||||
|
||||
public void Edit(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public void DeActive()
|
||||
{
|
||||
IsActive = IsActive.False;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute, double dailyWageUnAffected, bool totalLeaveCompute);
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.Reward;
|
||||
using CompanyManagment.App.Contracts.SalaryAid;
|
||||
@@ -21,4 +22,5 @@ public interface ISalaryAidRepository:IRepository<long,SalaryAid>
|
||||
|
||||
SalaryAidsGroupedViewModel GetSearchListAsGrouped(SalaryAidSearchViewModel searchModel);
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ public interface IWorkshopRepository : IRepository<long, Workshop>
|
||||
Task<List<WorkshopWithLeftWorkTempEmployeesDto>> GetWorkshopsForLeftWorkTemp(long accountId);
|
||||
Task<int> GetWorkshopsForLeftWorkTempCount(long accountId);
|
||||
Task<List<WorkshopSelectListViewModel>> GetSelectList(string search, long id);
|
||||
int GetLastArchiveCode();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -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,6 +6,7 @@ using CompanyManagment.App.Contracts.YearlySalary;
|
||||
using System.Threading.Tasks;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Holiday;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
|
||||
namespace Company.Domain.YearlySalaryAgg;
|
||||
|
||||
@@ -17,10 +18,50 @@ public interface IYearlySalaryRepository : IRepository<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>
|
||||
/// <param name="contractStart"></param>
|
||||
/// <param name="contractEnd"></param>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="leftWorkList"></param>
|
||||
/// <returns></returns>
|
||||
Task<BaseYearDataViewModel> BaseYearCompute(DateTime contractStart, DateTime contractEnd, long employeeId,
|
||||
long workshopId, List<LeftWorkViewModel> leftWorkList);
|
||||
DayliFeeViewModel DayliFeeComputing(DateTime startDateW,DateTime contractStart, DateTime endDateW, long employeeId, long workshopId,List<LeftWorkViewModel> leftWorkList);
|
||||
Task<DayliFeeViewModel> DayliFeeComputingAsync(DateTime startDateW, DateTime contractStart, DateTime endDateW, long employeeId, long workshopId, List<LeftWorkViewModel> leftWorkList);
|
||||
string ConsumableItems(DateTime endDateW);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.AccessControl;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.ContractAgg;
|
||||
@@ -66,6 +68,11 @@ public class Employer : EntityBase
|
||||
public string SanaPassword { get; private set; }
|
||||
|
||||
public string EmployerNo { get; set; }
|
||||
public bool IsAuth { get; set; }
|
||||
public string IdNumberSerial { get; set; }
|
||||
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
public PersonalContractingParty ContractingParty { get; set; }
|
||||
|
||||
//public List<Workshop> Workshops { get; private set; }
|
||||
@@ -227,4 +234,35 @@ public class Employer : EntityBase
|
||||
this.IsActive = false;
|
||||
this.Address = "false";
|
||||
}
|
||||
|
||||
public void Authentication(string fName, string lName, string fatherName,string idNumber,
|
||||
string idNumberSeri, string idNumberSerial, string dateOfBirth, Gender gender,string phone)
|
||||
{
|
||||
this.FName = fName;
|
||||
this.LName = lName;
|
||||
this.FatherName = fatherName;
|
||||
this.IdNumberSeri = idNumberSeri;
|
||||
this.IdNumberSerial = idNumberSerial;
|
||||
this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : new();
|
||||
this.IdNumber = idNumber;
|
||||
this.Gender = gender == _0_Framework.Application.Gender.Male? "مرد" : "زن";
|
||||
this.IsAuth = true;
|
||||
Phone = phone;
|
||||
}
|
||||
|
||||
|
||||
public void LegalAuthentication(string fName, string lName, string fatherName,string idNumber, string idNumberSeri,
|
||||
string idNumberSerial, string dateOfBirth, Gender gender,string phone)
|
||||
{
|
||||
FName = fName;
|
||||
EmployerLName = lName;
|
||||
this.FatherName = fatherName;
|
||||
this.IdNumberSeri = idNumberSeri;
|
||||
this.IdNumberSerial = idNumberSerial;
|
||||
this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : new();
|
||||
this.IdNumber = idNumber;
|
||||
this.Gender =gender == _0_Framework.Application.Gender.Male? "مرد" : "زن";
|
||||
this.IsAuth = true;
|
||||
Phone = phone;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Company.Domain.empolyerAgg;
|
||||
|
||||
@@ -34,7 +36,7 @@ public interface IEmployerRepository : IRepository<long, Employer>
|
||||
|
||||
List<EmployerViewModel> GetEmployersHasWorkshop();
|
||||
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search,long id);
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id, LegalType? legalType);
|
||||
|
||||
|
||||
#endregion
|
||||
@@ -68,5 +70,5 @@ public interface IEmployerRepository : IRepository<long, Employer>
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId, long institutionWorkshopDetailsId);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Company.Domain\Company.Domain.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MongoDB.Driver" Version="3.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,32 @@
|
||||
using Company.Domain.InstitutionContractInsertTempAgg;
|
||||
using MongoDB.Driver;
|
||||
|
||||
namespace CompanyManagement.Infrastructure.Mongo.InstitutionContractInsertTempRepo;
|
||||
|
||||
public class InstitutionContractExtenstionTempRepository:IInstitutionContractExtenstionTempRepository
|
||||
{
|
||||
private readonly IMongoCollection<InstitutionContractExtensionTemp> _institutionExtenstionTemp;
|
||||
|
||||
public InstitutionContractExtenstionTempRepository(IMongoDatabase database)
|
||||
{
|
||||
_institutionExtenstionTemp = database.GetCollection<InstitutionContractExtensionTemp>("InstitutionContractExtenstionTemp");
|
||||
}
|
||||
|
||||
public async Task Create(InstitutionContractExtensionTemp institutionContract)
|
||||
{
|
||||
await _institutionExtenstionTemp.InsertOneAsync(institutionContract);
|
||||
}
|
||||
|
||||
public async Task<InstitutionContractExtensionTemp> GetPreviousExtenstionData(long contractingPartyId)
|
||||
{
|
||||
var entity = await _institutionExtenstionTemp
|
||||
.Find(x => x.PreviousId == contractingPartyId)
|
||||
.FirstOrDefaultAsync();
|
||||
return entity;
|
||||
}
|
||||
|
||||
public async Task Remove(Guid id)
|
||||
{
|
||||
await _institutionExtenstionTemp.DeleteOneAsync(x=>x.Id == id);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -141,7 +141,9 @@ public class CheckoutViewModel
|
||||
public List<LoanInstallmentViewModel> InstallmentViewModels { get; set; }
|
||||
public List<SalaryAidViewModel> SalaryAidViewModels { get; set; }
|
||||
public CheckoutRollCallViewModel CheckoutRollCall { get; set; }
|
||||
|
||||
public bool HasAmountConflict { get; set; }
|
||||
public string EmployeeMandatoryHoursStr { get; set; }
|
||||
public TimeSpan EmployeeMandatoryHoursTimeSpan { get; set; }
|
||||
}
|
||||
|
||||
public class CheckoutRollCallViewModel
|
||||
|
||||
@@ -135,6 +135,11 @@ public class CreateCheckout
|
||||
/// </summary>
|
||||
public string TotalDayOfBunosesCompute { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ساعت موظفی پرسنل برای این ماه
|
||||
/// </summary>
|
||||
public TimeSpan EmployeeMandatoryHours { get; set; }
|
||||
|
||||
public bool HolidayWorking { get; set; }
|
||||
|
||||
public string ShiftWork { get; set; }
|
||||
@@ -155,4 +160,37 @@ public class CreateCheckout
|
||||
public TimeSpan TotalPaidLeave { get; set; }
|
||||
public TimeSpan TotalSickLeave { get; set; }
|
||||
|
||||
public bool HasLeft { get; set; }
|
||||
|
||||
|
||||
/// <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; }
|
||||
}
|
||||
@@ -56,5 +56,28 @@ public class ComputingViewModel
|
||||
public TimeSpan TotalPaidLeave { get; set; }
|
||||
public TimeSpan TotalSickLeave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ساعت موظفی پرسنل برای این ماه
|
||||
/// </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 List<string> holidays;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
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,7 +140,36 @@ 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,6 +7,14 @@ 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);
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
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; }
|
||||
}
|
||||
@@ -6,6 +6,16 @@ namespace CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
|
||||
/// لیست اطلاعات بانکی طرف حساب
|
||||
/// </summary>
|
||||
public class GetContractingPartyBankAccountViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// تعداد
|
||||
/// </summary>
|
||||
public int Count { get; set; }
|
||||
public List<ContractingPartyBankAccountsGroupedViewModel> List { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class ContractingPartyBankAccountsGroupedViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// لیست حساب های بانکی
|
||||
@@ -27,6 +37,7 @@ public class GetContractingPartyBankAccountViewModel
|
||||
/// </summary>
|
||||
public string WorkshopName { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// حساب بانکی طرف حساب
|
||||
/// </summary>
|
||||
|
||||
@@ -18,14 +18,14 @@ public interface IContractingPartyBankAccountsApplication
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> Create(CreateContractingPartyBankAccounts command);
|
||||
Task<OperationResult> Create(List<CreateContractingPartyBankAccounts> commands);
|
||||
|
||||
/// <summary>
|
||||
/// لیست اطلاعات طرف حساب بانکی
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult<List<GetContractingPartyBankAccountViewModel>>> GetList(
|
||||
ContractingPartyBankAccountSearchModel searchModel);
|
||||
Task<GetContractingPartyBankAccountViewModel> GetList(ContractingPartyBankAccountSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست جستجو برای نام طرف حساب / صاحب حساب
|
||||
@@ -33,7 +33,7 @@ public interface IContractingPartyBankAccountsApplication
|
||||
/// <param name="search">نام جستجو</param>
|
||||
/// <param name="selected">نام سلکت شده</param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult<List<string>>> ContractingPartyOrAccountHolderNameSelectList(string search, string selected);
|
||||
Task<List<string>> ContractingPartyOrAccountHolderNameSelectList(string search, string selected);
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست شماره کارت
|
||||
@@ -41,7 +41,7 @@ public interface IContractingPartyBankAccountsApplication
|
||||
/// <param name="search">نام جستجو</param>
|
||||
/// <param name="selected">نام سلکت شده</param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult<List<string>>> CardNumberSelectList(string search, string selected);
|
||||
Task<List<string>> CardNumberSelectList(string search, string selected);
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست شماره شبا
|
||||
@@ -49,7 +49,7 @@ public interface IContractingPartyBankAccountsApplication
|
||||
/// <param name="search">نام جستجو</param>
|
||||
/// <param name="selected">نام سلکت شده</param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult<List<string>>> IBanSelectList(string search, string selected);
|
||||
Task<List<string>> IBanSelectList(string search, string selected);
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست شماره حساب
|
||||
@@ -57,6 +57,22 @@ public interface IContractingPartyBankAccountsApplication
|
||||
/// <param name="search">نام جستجو</param>
|
||||
/// <param name="selected">نام سلکت شده</param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult<List<string>>> AccountNumberSelectList(string search, string selected);
|
||||
Task<List<string>> AccountNumberSelectList(string search, string selected);
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست نام صاحبان حساب
|
||||
/// </summary>
|
||||
/// <param name="search">نام جستجو</param>
|
||||
/// <param name="selected">نام سلکت شده</param>
|
||||
/// <returns></returns>
|
||||
Task<List<string>> GetAccountHolderNameSelectList(string search, string selected);
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست نام طرف حسابها
|
||||
/// </summary>
|
||||
/// <param name="search">نام جستجو</param>
|
||||
/// <param name="selected">نام سلکت شده</param>
|
||||
/// <returns></returns>
|
||||
Task<List<string>> ContractingPartyNamesSelectList(string search, string selected);
|
||||
}
|
||||
|
||||
|
||||
@@ -109,6 +109,8 @@ namespace CompanyManagment.App.Contracts.CustomizeCheckout
|
||||
public List<CustomizeRotatingShift> CustomizeRotatingShifts { get; set; }
|
||||
public List<CustomizeSifts> RegularShift { get; set; }
|
||||
|
||||
public bool HasAmountConflict { get; set; }
|
||||
|
||||
//public bool HasLeft { get; set; }
|
||||
//public string IsBlockCantracingParty { get; set; }
|
||||
//public string IsActiveString { get; set; }
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Transactions;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
@@ -43,8 +47,9 @@ public interface IEmployerApplication
|
||||
/// </summary>
|
||||
/// <param name="search"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="legalType"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id);
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id, LegalType? legalType = null);
|
||||
|
||||
#endregion
|
||||
#region NewByHeydari
|
||||
@@ -125,4 +130,293 @@ 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);
|
||||
Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId, long institutionWorkshopDetailsId);
|
||||
}
|
||||
|
||||
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 long EmployerId { get; set; }
|
||||
/// <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 InstitutionWorkshopInitialId { 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; }
|
||||
|
||||
public string IdNumberSeri { get; set; }
|
||||
public string IdNumberSerial { 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; }
|
||||
|
||||
public string IdNumberSeri { get; set; }
|
||||
public string IdNumberSerial { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// کلاس ویرایش کارفرما در گردش کار - شامل اطلاعات کارفرمای حقیقی و حقوقی
|
||||
/// </summary>
|
||||
public class EditEmployerWorkflowRegistration : CreateEmployerWorkflowRegistration
|
||||
{
|
||||
/// <summary>
|
||||
/// شناسه کارفرما
|
||||
/// </summary>
|
||||
public long EmployerId { get; set; }
|
||||
}
|
||||
|
||||
@@ -30,5 +30,5 @@ public class ClientFinancialStatementViewModel
|
||||
/// <summary>
|
||||
/// تراکنش ها
|
||||
/// </summary>
|
||||
public List<ClientFinancialTransactionViewModel> Transactions { get; set; }
|
||||
public List<FinancialTransactionDetailViewModel> Transactions { get; set; }
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace CompanyManagment.App.Contracts.FinancialStatment;
|
||||
|
||||
public class ClientFinancialStatementSearchModel
|
||||
public class FinancialStatementSearchModel
|
||||
{
|
||||
/// <summary>
|
||||
/// از تاریخ
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user