diff --git a/0_Framework/0_Framework.csproj b/0_Framework/0_Framework.csproj
index ad747dc2..66522232 100644
--- a/0_Framework/0_Framework.csproj
+++ b/0_Framework/0_Framework.csproj
@@ -6,6 +6,7 @@
+
diff --git a/0_Framework/Application/AuthHelper.cs b/0_Framework/Application/AuthHelper.cs
index 12f820f8..2af2188f 100644
--- a/0_Framework/Application/AuthHelper.cs
+++ b/0_Framework/Application/AuthHelper.cs
@@ -56,6 +56,11 @@ public class AuthHelper : IAuthHelper
return Tools.DeserializeFromBsonList(permissions); //Mahan
}
+ public bool HasPermission(int permission)
+ {
+ return GetPermissions().Any(x => x == permission);
+ }
+
public long CurrentAccountId()
{
return IsAuthenticated()
@@ -199,7 +204,7 @@ public class AuthHelper : IAuthHelper
new("WorkshopSlug",slug),
new("WorkshopId", account.WorkshopId.ToString()),
new("WorkshopName",account.WorkshopName??""),
- new("pm.userId", account.PmUserId?.ToString() ?? "0"),
+ new("pm.userId", account.PmUserId.ToString()),
};
diff --git a/0_Framework/Application/Enums/TypeOfSmsSetting.cs b/0_Framework/Application/Enums/TypeOfSmsSetting.cs
index 9b4512b7..6d66fc47 100644
--- a/0_Framework/Application/Enums/TypeOfSmsSetting.cs
+++ b/0_Framework/Application/Enums/TypeOfSmsSetting.cs
@@ -33,4 +33,9 @@ public enum TypeOfSmsSetting
///
LegalAction,
+ ///
+ /// پیامک تایید قراداد
+ ///
+ InstitutionContractConfirm,
+
}
\ No newline at end of file
diff --git a/0_Framework/Application/FaceEmbedding/IFaceEmbeddingService.cs b/0_Framework/Application/FaceEmbedding/IFaceEmbeddingService.cs
index b5aab83b..78dbf735 100644
--- a/0_Framework/Application/FaceEmbedding/IFaceEmbeddingService.cs
+++ b/0_Framework/Application/FaceEmbedding/IFaceEmbeddingService.cs
@@ -11,6 +11,7 @@ public interface IFaceEmbeddingService
Task RefineEmbeddingAsync(long employeeId, long workshopId, float[] embedding, float confidence, Dictionary metadata = null);
Task DeleteEmbeddingAsync(long employeeId, long workshopId);
Task> GetEmbeddingAsync(long employeeId, long workshopId);
+ Task UpdateEmbeddingFullNameAsync(long employeeId, long workshopId, string newFullName);
}
public class FaceEmbeddingResponse
diff --git a/0_Framework/Application/IAuthHelper.cs b/0_Framework/Application/IAuthHelper.cs
index ab9cf572..d43ac069 100644
--- a/0_Framework/Application/IAuthHelper.cs
+++ b/0_Framework/Application/IAuthHelper.cs
@@ -12,6 +12,7 @@ public interface IAuthHelper
string CurrentAccountRole();
AuthViewModel CurrentAccountInfo();
List GetPermissions();
+ bool HasPermission(int permission);
long CurrentAccountId();
string CurrentAccountMobile();
diff --git a/0_Framework/Application/Sms/ISmsService.cs b/0_Framework/Application/Sms/ISmsService.cs
index 6171e87a..94e31299 100644
--- a/0_Framework/Application/Sms/ISmsService.cs
+++ b/0_Framework/Application/Sms/ISmsService.cs
@@ -27,8 +27,7 @@ public interface ISmsService
Task GetCreditAmount();
- public Task SendInstitutionCreationVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId);
- public Task SendInstitutionAmendmentVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId);
+ public Task SendInstitutionCreationVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId, string typeOfSms = null);
public Task SendInstitutionVerificationCode(string number, string code, string contractingPartyFullName,
long contractingPartyId, long institutionContractId);
diff --git a/0_Framework/Excel/ExcelGenerator.cs b/0_Framework/Excel/ExcelGenerator.cs
index 23d6382b..fb172b1f 100644
--- a/0_Framework/Excel/ExcelGenerator.cs
+++ b/0_Framework/Excel/ExcelGenerator.cs
@@ -17,7 +17,7 @@ public class ExcelGenerator
{
public ExcelGenerator()
{
- ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+ OfficeOpenXml.ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
}
public static byte[] GenerateExcel(List obj, string date = "") where T : class
{
diff --git a/0_Framework/Exceptions/Handler/CustomExceptionHandler.cs b/0_Framework/Exceptions/Handler/CustomExceptionHandler.cs
index e6fd9da1..3af1276d 100644
--- a/0_Framework/Exceptions/Handler/CustomExceptionHandler.cs
+++ b/0_Framework/Exceptions/Handler/CustomExceptionHandler.cs
@@ -1,7 +1,10 @@
-using System;
+#nullable enable
+using System;
using System.Collections.Generic;
+using System.Linq;
using System.Threading;
using System.Threading.Tasks;
+using FluentValidation;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@@ -27,6 +30,14 @@ public class CustomExceptionHandler : IExceptionHandler
(string Detail, string Title, int StatusCode, Dictionary? Extra) details = exception switch
{
+ ValidationException validationException =>
+ (
+ validationException.Errors.FirstOrDefault()?.ErrorMessage ?? "One or more validation errors occurred.",
+ "Validation Error",
+ context.Response.StatusCode = StatusCodes.Status400BadRequest,
+ null
+ ),
+
InternalServerException =>
(
exception.Message,
@@ -34,6 +45,7 @@ public class CustomExceptionHandler : IExceptionHandler
context.Response.StatusCode = StatusCodes.Status500InternalServerError,
null
),
+
BadRequestException bre =>
(
exception.Message,
@@ -41,6 +53,7 @@ public class CustomExceptionHandler : IExceptionHandler
context.Response.StatusCode = StatusCodes.Status400BadRequest,
bre.Extra
),
+
NotFoundException =>
(
exception.Message,
@@ -48,6 +61,7 @@ public class CustomExceptionHandler : IExceptionHandler
context.Response.StatusCode = StatusCodes.Status404NotFound,
null
),
+
UnAuthorizeException =>
(
exception.Message,
@@ -55,6 +69,7 @@ public class CustomExceptionHandler : IExceptionHandler
context.Response.StatusCode = StatusCodes.Status401Unauthorized,
null
),
+
_ =>
(
exception.Message,
@@ -73,8 +88,6 @@ public class CustomExceptionHandler : IExceptionHandler
Extensions = details.Extra ?? new Dictionary()
};
-
-
problemDetails.Extensions.Add("traceId", context.TraceIdentifier);
await context.Response.WriteAsJsonAsync(problemDetails, cancellationToken: cancellationToken);
diff --git a/0_Framework/InfraStructure/FaceEmbeddingService.cs b/0_Framework/InfraStructure/FaceEmbeddingService.cs
index 0b709ed5..148adc80 100644
--- a/0_Framework/InfraStructure/FaceEmbeddingService.cs
+++ b/0_Framework/InfraStructure/FaceEmbeddingService.cs
@@ -18,329 +18,387 @@ namespace _0_Framework.Infrastructure;
///
public class FaceEmbeddingService : IFaceEmbeddingService
{
- private readonly IHttpClientFactory _httpClientFactory;
- private readonly ILogger _logger;
- private readonly IFaceEmbeddingNotificationService _notificationService;
- private readonly string _apiBaseUrl;
+ private readonly IHttpClientFactory _httpClientFactory;
+ private readonly ILogger _logger;
+ private readonly IFaceEmbeddingNotificationService _notificationService;
+ private readonly string _apiBaseUrl;
- public FaceEmbeddingService(IHttpClientFactory httpClientFactory, ILogger logger,
- IFaceEmbeddingNotificationService notificationService = null)
- {
- _httpClientFactory = httpClientFactory;
- _logger = logger;
- _notificationService = notificationService;
- _apiBaseUrl = "http://localhost:8000";
- }
+ public FaceEmbeddingService(IHttpClientFactory httpClientFactory, ILogger logger,
+ IFaceEmbeddingNotificationService notificationService = null)
+ {
+ _httpClientFactory = httpClientFactory;
+ _logger = logger;
+ _notificationService = notificationService;
+ _apiBaseUrl = "http://localhost:8000";
+ }
- public async Task GenerateEmbeddingsAsync(long employeeId, long workshopId,
- string employeeFullName, string picture1Path, string picture2Path)
- {
- try
- {
- var httpClient = _httpClientFactory.CreateClient();
- httpClient.BaseAddress = new Uri(_apiBaseUrl);
- httpClient.Timeout = TimeSpan.FromSeconds(30);
+ public async Task GenerateEmbeddingsAsync(long employeeId, long workshopId,
+ string employeeFullName, string picture1Path, string picture2Path)
+ {
+ try
+ {
+ var httpClient = _httpClientFactory.CreateClient();
+ httpClient.BaseAddress = new Uri(_apiBaseUrl);
+ httpClient.Timeout = TimeSpan.FromSeconds(30);
- using var content = new MultipartFormDataContent();
+ using var content = new MultipartFormDataContent();
- // Add form fields
- content.Add(new StringContent(employeeId.ToString()), "employee_id");
- content.Add(new StringContent(workshopId.ToString()), "workshop_id");
- content.Add(new StringContent(employeeFullName ?? ""), "employee_full_name");
+ // Add form fields
+ content.Add(new StringContent(employeeId.ToString()), "employee_id");
+ content.Add(new StringContent(workshopId.ToString()), "workshop_id");
+ content.Add(new StringContent(employeeFullName ?? ""), "employee_full_name");
- // Add picture files
- if (File.Exists(picture1Path))
- {
- var picture1Bytes = await File.ReadAllBytesAsync(picture1Path);
- var picture1Content = new ByteArrayContent(picture1Bytes);
- picture1Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
- content.Add(picture1Content, "picture1", "1.jpg");
- }
- else
- {
- _logger.LogWarning("Picture1 not found at path: {Path}", picture1Path);
- return new OperationResult { IsSuccedded = false, Message = "تصویر اول یافت نشد" };
- }
+ // Add picture files
+ if (File.Exists(picture1Path))
+ {
+ var picture1Bytes = await File.ReadAllBytesAsync(picture1Path);
+ var picture1Content = new ByteArrayContent(picture1Bytes);
+ picture1Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
+ content.Add(picture1Content, "picture1", "1.jpg");
+ }
+ else
+ {
+ _logger.LogWarning("Picture1 not found at path: {Path}", picture1Path);
+ return new OperationResult { IsSuccedded = false, Message = "تصویر اول یافت نشد" };
+ }
- if (File.Exists(picture2Path))
- {
- var picture2Bytes = await File.ReadAllBytesAsync(picture2Path);
- var picture2Content = new ByteArrayContent(picture2Bytes);
- picture2Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
- content.Add(picture2Content, "picture2", "2.jpg");
- }
- else
- {
- _logger.LogWarning("Picture2 not found at path: {Path}", picture2Path);
- return new OperationResult { IsSuccedded = false, Message = "تصویر دوم یافت نشد" };
- }
+ if (File.Exists(picture2Path))
+ {
+ var picture2Bytes = await File.ReadAllBytesAsync(picture2Path);
+ var picture2Content = new ByteArrayContent(picture2Bytes);
+ picture2Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
+ content.Add(picture2Content, "picture2", "2.jpg");
+ }
+ else
+ {
+ _logger.LogWarning("Picture2 not found at path: {Path}", picture2Path);
+ return new OperationResult { IsSuccedded = false, Message = "تصویر دوم یافت نشد" };
+ }
- // Send request to Python API
- var response = await httpClient.PostAsync("embeddings", content);
+ // Send request to Python API
+ var response = await httpClient.PostAsync("embeddings", content);
- if (response.IsSuccessStatusCode)
- {
- var responseContent = await response.Content.ReadAsStringAsync();
- _logger.LogInformation("Embeddings generated successfully for Employee {EmployeeId}, Workshop {WorkshopId}",
- employeeId, workshopId);
+ if (response.IsSuccessStatusCode)
+ {
+ var responseContent = await response.Content.ReadAsStringAsync();
+ _logger.LogInformation(
+ "Embeddings generated successfully for Employee {EmployeeId}, Workshop {WorkshopId}",
+ employeeId, workshopId);
- // ارسال اطلاعرسانی به سایر سیستمها
- if (_notificationService != null)
- {
- await _notificationService.NotifyEmbeddingCreatedAsync(workshopId, employeeId, employeeFullName);
- }
+ // ارسال اطلاعرسانی به سایر سیستمها
+ if (_notificationService != null)
+ {
+ await _notificationService.NotifyEmbeddingCreatedAsync(workshopId, employeeId, employeeFullName);
+ }
- return new OperationResult
- {
- IsSuccedded = true,
- Message = "Embedding با موفقیت ایجاد شد"
- };
- }
- else
- {
- var errorContent = await response.Content.ReadAsStringAsync();
- _logger.LogError("Failed to generate embeddings. Status: {StatusCode}, Error: {Error}",
- response.StatusCode, errorContent);
+ return new OperationResult
+ {
+ IsSuccedded = true,
+ Message = "Embedding با موفقیت ایجاد شد"
+ };
+ }
+ else
+ {
+ var errorContent = await response.Content.ReadAsStringAsync();
+ _logger.LogError("Failed to generate embeddings. Status: {StatusCode}, Error: {Error}",
+ response.StatusCode, errorContent);
- return new OperationResult
- {
- IsSuccedded = false,
- Message = $"خطا در تولید Embedding: {response.StatusCode}"
- };
- }
- }
- catch (HttpRequestException ex)
- {
- _logger.LogError(ex, "HTTP error while calling embeddings API for Employee {EmployeeId}", employeeId);
- return new OperationResult
- {
- IsSuccedded = false,
- Message = "خطا در ارتباط با سرور Embedding"
- };
- }
- catch (Exception ex)
- {
- _logger.LogError(ex, "Error while calling embeddings API for Employee {EmployeeId}", employeeId);
- return new OperationResult
- {
- IsSuccedded = false,
- Message = "خطای غیرمنتظره در تولید Embedding"
- };
- }
- }
+ return new OperationResult
+ {
+ IsSuccedded = false,
+ Message = $"خطا در تولید Embedding: {response.StatusCode}"
+ };
+ }
+ }
+ catch (HttpRequestException ex)
+ {
+ _logger.LogError(ex, "HTTP error while calling embeddings API for Employee {EmployeeId}", employeeId);
+ return new OperationResult
+ {
+ IsSuccedded = false,
+ Message = "خطا در ارتباط با سرور Embedding"
+ };
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Error while calling embeddings API for Employee {EmployeeId}", employeeId);
+ return new OperationResult
+ {
+ IsSuccedded = false,
+ Message = "خطای غیرمنتظره در تولید Embedding"
+ };
+ }
+ }
- public async Task GenerateEmbeddingsFromStreamAsync(long employeeId, long workshopId,
- string employeeFullName, Stream picture1Stream, Stream picture2Stream)
- {
- try
- {
- var httpClient = _httpClientFactory.CreateClient();
- httpClient.BaseAddress = new Uri(_apiBaseUrl);
- httpClient.Timeout = TimeSpan.FromSeconds(30);
+ public async Task GenerateEmbeddingsFromStreamAsync(long employeeId, long workshopId,
+ string employeeFullName, Stream picture1Stream, Stream picture2Stream)
+ {
+ try
+ {
+ var httpClient = _httpClientFactory.CreateClient();
+ httpClient.BaseAddress = new Uri(_apiBaseUrl);
+ httpClient.Timeout = TimeSpan.FromSeconds(30);
- using var content = new MultipartFormDataContent();
+ using var content = new MultipartFormDataContent();
- // Add form fields
- content.Add(new StringContent(employeeId.ToString()), "employee_id");
- content.Add(new StringContent(workshopId.ToString()), "workshop_id");
- content.Add(new StringContent(employeeFullName ?? ""), "employee_full_name");
+ // Add form fields
+ content.Add(new StringContent(employeeId.ToString()), "employee_id");
+ content.Add(new StringContent(workshopId.ToString()), "workshop_id");
+ content.Add(new StringContent(employeeFullName ?? ""), "employee_full_name");
- // Add picture streams
- var picture1Content = new StreamContent(picture1Stream);
- picture1Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
- content.Add(picture1Content, "picture1", "1.jpg");
+ // Add picture streams
+ var picture1Content = new StreamContent(picture1Stream);
+ picture1Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
+ content.Add(picture1Content, "picture1", "1.jpg");
- var picture2Content = new StreamContent(picture2Stream);
- picture2Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
- content.Add(picture2Content, "picture2", "2.jpg");
+ var picture2Content = new StreamContent(picture2Stream);
+ picture2Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
+ content.Add(picture2Content, "picture2", "2.jpg");
- // Send request to Python API
- var response = await httpClient.PostAsync("embeddings", content);
+ // Send request to Python API
+ var response = await httpClient.PostAsync("embeddings", content);
- if (response.IsSuccessStatusCode)
- {
- _logger.LogInformation("Embeddings generated successfully from streams for Employee {EmployeeId}", employeeId);
-
- // ارسال اطلاعرسانی به سایر سیستمها
- if (_notificationService != null)
- {
- await _notificationService.NotifyEmbeddingCreatedAsync(workshopId, employeeId, employeeFullName);
- }
-
- return new OperationResult { IsSuccedded = true, Message = "Embedding با موفقیت ایجاد شد" };
- }
- else
- {
- var errorContent = await response.Content.ReadAsStringAsync();
- _logger.LogError("Failed to generate embeddings from streams. Status: {StatusCode}, Error: {Error}",
- response.StatusCode, errorContent);
+ if (response.IsSuccessStatusCode)
+ {
+ _logger.LogInformation("Embeddings generated successfully from streams for Employee {EmployeeId}",
+ employeeId);
- return new OperationResult
- {
- IsSuccedded = false,
- Message = $"خطا در تولید Embedding: {response.StatusCode}"
- };
- }
- }
- catch (Exception ex)
- {
- _logger.LogError(ex, "Error while generating embeddings from streams for Employee {EmployeeId}", employeeId);
- return new OperationResult
- {
- IsSuccedded = false,
- Message = "خطا در تولید Embedding"
- };
- }
- }
+ // ارسال اطلاعرسانی به سایر سیستمها
+ if (_notificationService != null)
+ {
+ await _notificationService.NotifyEmbeddingCreatedAsync(workshopId, employeeId, employeeFullName);
+ }
- public async Task RefineEmbeddingAsync(long employeeId, long workshopId, float[] embedding,
- float confidence, Dictionary metadata = null)
- {
- try
- {
- var httpClient = _httpClientFactory.CreateClient();
- httpClient.BaseAddress = new Uri(_apiBaseUrl);
- httpClient.Timeout = TimeSpan.FromSeconds(30);
+ return new OperationResult { IsSuccedded = true, Message = "Embedding با موفقیت ایجاد شد" };
+ }
+ else
+ {
+ var errorContent = await response.Content.ReadAsStringAsync();
+ _logger.LogError("Failed to generate embeddings from streams. Status: {StatusCode}, Error: {Error}",
+ response.StatusCode, errorContent);
- var requestBody = new
- {
- employeeId,
- workshopId,
- embedding,
- confidence,
- metadata = metadata ?? new Dictionary()
- };
+ return new OperationResult
+ {
+ IsSuccedded = false,
+ Message = $"خطا در تولید Embedding: {response.StatusCode}"
+ };
+ }
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Error while generating embeddings from streams for Employee {EmployeeId}",
+ employeeId);
+ return new OperationResult
+ {
+ IsSuccedded = false,
+ Message = "خطا در تولید Embedding"
+ };
+ }
+ }
- var response = await httpClient.PostAsJsonAsync("embeddings/refine", requestBody);
+ public async Task RefineEmbeddingAsync(long employeeId, long workshopId, float[] embedding,
+ float confidence, Dictionary metadata = null)
+ {
+ try
+ {
+ var httpClient = _httpClientFactory.CreateClient();
+ httpClient.BaseAddress = new Uri(_apiBaseUrl);
+ httpClient.Timeout = TimeSpan.FromSeconds(30);
- if (response.IsSuccessStatusCode)
- {
- _logger.LogInformation("Embedding refined successfully for Employee {EmployeeId}", employeeId);
-
- // ارسال اطلاعرسانی به سایر سیستمها
- if (_notificationService != null)
- {
- await _notificationService.NotifyEmbeddingRefinedAsync(workshopId, employeeId);
- }
-
- return new OperationResult { IsSuccedded = true, Message = "Embedding بهبود یافت" };
- }
- else
- {
- var errorContent = await response.Content.ReadAsStringAsync();
- _logger.LogError("Failed to refine embedding. Status: {StatusCode}, Error: {Error}",
- response.StatusCode, errorContent);
+ var requestBody = new
+ {
+ employeeId,
+ workshopId,
+ embedding,
+ confidence,
+ metadata = metadata ?? new Dictionary()
+ };
- return new OperationResult
- {
- IsSuccedded = false,
- Message = $"خطا در بهبود Embedding: {response.StatusCode}"
- };
- }
- }
- catch (Exception ex)
- {
- _logger.LogError(ex, "Error while refining embedding for Employee {EmployeeId}", employeeId);
- return new OperationResult
- {
- IsSuccedded = false,
- Message = "خطا در بهبود Embedding"
- };
- }
- }
+ var response = await httpClient.PostAsJsonAsync("embeddings/refine", requestBody);
- public async Task DeleteEmbeddingAsync(long employeeId, long workshopId)
- {
- try
- {
- var httpClient = _httpClientFactory.CreateClient();
- httpClient.BaseAddress = new Uri(_apiBaseUrl);
- httpClient.Timeout = TimeSpan.FromSeconds(30);
+ if (response.IsSuccessStatusCode)
+ {
+ _logger.LogInformation("Embedding refined successfully for Employee {EmployeeId}", employeeId);
- var response = await httpClient.DeleteAsync($"embeddings/{workshopId}/{employeeId}");
+ // ارسال اطلاعرسانی به سایر سیستمها
+ if (_notificationService != null)
+ {
+ await _notificationService.NotifyEmbeddingRefinedAsync(workshopId, employeeId);
+ }
- if (response.IsSuccessStatusCode)
- {
- _logger.LogInformation("Embedding deleted successfully for Employee {EmployeeId}", employeeId);
-
- // ارسال اطلاعرسانی به سایر سیستمها
- if (_notificationService != null)
- {
- await _notificationService.NotifyEmbeddingDeletedAsync(workshopId, employeeId);
- }
-
- return new OperationResult { IsSuccedded = true, Message = "Embedding حذف شد" };
- }
- else
- {
- var errorContent = await response.Content.ReadAsStringAsync();
- _logger.LogError("Failed to delete embedding. Status: {StatusCode}, Error: {Error}",
- response.StatusCode, errorContent);
+ return new OperationResult { IsSuccedded = true, Message = "Embedding بهبود یافت" };
+ }
+ else
+ {
+ var errorContent = await response.Content.ReadAsStringAsync();
+ _logger.LogError("Failed to refine embedding. Status: {StatusCode}, Error: {Error}",
+ response.StatusCode, errorContent);
- return new OperationResult
- {
- IsSuccedded = false,
- Message = $"خطا در حذف Embedding: {response.StatusCode}"
- };
- }
- }
- catch (Exception ex)
- {
- _logger.LogError(ex, "Error while deleting embedding for Employee {EmployeeId}", employeeId);
- return new OperationResult
- {
- IsSuccedded = false,
- Message = "خطا در حذف Embedding"
- };
- }
- }
+ return new OperationResult
+ {
+ IsSuccedded = false,
+ Message = $"خطا در بهبود Embedding: {response.StatusCode}"
+ };
+ }
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Error while refining embedding for Employee {EmployeeId}", employeeId);
+ return new OperationResult
+ {
+ IsSuccedded = false,
+ Message = "خطا در بهبود Embedding"
+ };
+ }
+ }
- public async Task> GetEmbeddingAsync(long employeeId, long workshopId)
- {
- try
- {
- var httpClient = _httpClientFactory.CreateClient();
- httpClient.BaseAddress = new Uri(_apiBaseUrl);
- httpClient.Timeout = TimeSpan.FromSeconds(30);
+ public async Task DeleteEmbeddingAsync(long employeeId, long workshopId)
+ {
+ try
+ {
+ var httpClient = _httpClientFactory.CreateClient();
+ httpClient.BaseAddress = new Uri(_apiBaseUrl);
+ httpClient.Timeout = TimeSpan.FromSeconds(30);
- var response = await httpClient.GetAsync($"embeddings/{workshopId}/{employeeId}");
+ var response = await httpClient.DeleteAsync($"embeddings/{workshopId}/{employeeId}");
- if (response.IsSuccessStatusCode)
- {
- var content = await response.Content.ReadAsStringAsync();
- var embeddingData = JsonSerializer.Deserialize(content,
- new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
+ if (response.IsSuccessStatusCode)
+ {
+ _logger.LogInformation("Embedding deleted successfully for Employee {EmployeeId}", employeeId);
- _logger.LogInformation("Embedding retrieved successfully for Employee {EmployeeId}", employeeId);
+ // ارسال اطلاعرسانی به سایر سیستمها
+ if (_notificationService != null)
+ {
+ await _notificationService.NotifyEmbeddingDeletedAsync(workshopId, employeeId);
+ }
- return new OperationResult
- {
- IsSuccedded = true,
- Message = "Embedding دریافت شد",
- Data = embeddingData
- };
- }
- else
- {
- var errorContent = await response.Content.ReadAsStringAsync();
- _logger.LogError("Failed to get embedding. Status: {StatusCode}, Error: {Error}",
- response.StatusCode, errorContent);
-
- return new OperationResult
- {
- IsSuccedded = false,
- Message = $"خطا در دریافت Embedding: {response.StatusCode}"
- };
- }
- }
- catch (Exception ex)
- {
- _logger.LogError(ex, "Error while getting embedding for Employee {EmployeeId}", employeeId);
- return new OperationResult
- {
- IsSuccedded = false,
- Message = "خطا در دریافت Embedding"
- };
- }
- }
-}
+ return new OperationResult { IsSuccedded = true, Message = "Embedding حذف شد" };
+ }
+ else
+ {
+ var errorContent = await response.Content.ReadAsStringAsync();
+ _logger.LogError("Failed to delete embedding. Status: {StatusCode}, Error: {Error}",
+ response.StatusCode, errorContent);
+
+ return new OperationResult
+ {
+ IsSuccedded = false,
+ Message = $"خطا در حذف Embedding: {response.StatusCode}"
+ };
+ }
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Error while deleting embedding for Employee {EmployeeId}", employeeId);
+ return new OperationResult
+ {
+ IsSuccedded = false,
+ Message = "خطا در حذف Embedding"
+ };
+ }
+ }
+
+ public async Task> GetEmbeddingAsync(long employeeId, long workshopId)
+ {
+ try
+ {
+ var httpClient = _httpClientFactory.CreateClient();
+ httpClient.BaseAddress = new Uri(_apiBaseUrl);
+ httpClient.Timeout = TimeSpan.FromSeconds(30);
+
+ var response = await httpClient.GetAsync($"embeddings/{workshopId}/{employeeId}");
+
+ if (response.IsSuccessStatusCode)
+ {
+ var content = await response.Content.ReadAsStringAsync();
+ var embeddingData = JsonSerializer.Deserialize(content,
+ new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
+
+ _logger.LogInformation("Embedding retrieved successfully for Employee {EmployeeId}", employeeId);
+
+ return new OperationResult
+ {
+ IsSuccedded = true,
+ Message = "Embedding دریافت شد",
+ Data = embeddingData
+ };
+ }
+ else
+ {
+ var errorContent = await response.Content.ReadAsStringAsync();
+ _logger.LogError("Failed to get embedding. Status: {StatusCode}, Error: {Error}",
+ response.StatusCode, errorContent);
+
+ return new OperationResult
+ {
+ IsSuccedded = false,
+ Message = $"خطا در دریافت Embedding: {response.StatusCode}"
+ };
+ }
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Error while getting embedding for Employee {EmployeeId}", employeeId);
+ return new OperationResult
+ {
+ IsSuccedded = false,
+ Message = "خطا در دریافت Embedding"
+ };
+ }
+ }
+
+ public async Task UpdateEmbeddingFullNameAsync(long employeeId, long workshopId,
+ string newFullName)
+ {
+ try
+ {
+ var httpClient = _httpClientFactory.CreateClient();
+ httpClient.BaseAddress = new Uri(_apiBaseUrl);
+ httpClient.Timeout = TimeSpan.FromSeconds(30);
+
+ var requestBody = new
+ {
+ employee_id = employeeId,
+ workshop_id = workshopId,
+ employee_full_name = newFullName
+ };
+
+ var response = await httpClient.PutAsJsonAsync("embeddings/update-name", requestBody);
+
+ if (response.IsSuccessStatusCode)
+ {
+ _logger.LogInformation("Employee Name Changed For {EmployeeId} In workshop ={WorkshopId}", employeeId,
+ workshopId);
+
+ // ارسال اطلاعرسانی به سایر سیستمها
+ if (_notificationService != null)
+ {
+ //await _notificationService.NotifyEmbeddingRefinedAsync(workshopId, employeeId);
+ }
+
+ return new OperationResult { IsSuccedded = true, Message = "عملیات با موفقیت انجام شد" };
+ }
+ else
+ {
+ var errorContent = await response.Content.ReadAsStringAsync();
+ _logger.LogError("Failed to refine embedding. Status: {StatusCode}, Error: {Error}",
+ response.StatusCode, errorContent);
+
+ return new OperationResult
+ {
+ IsSuccedded = false,
+ Message = $"خطا در بهبود Embedding: {response.StatusCode}"
+ };
+ }
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Error while Changing EmployeeFullName for Employee {EmployeeId}", employeeId);
+ return new OperationResult
+ {
+ IsSuccedded = false,
+ Message = "خطا در بهبود Embedding"
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/AccountManagement.Application.Contracts/Account/EditAccount.cs b/AccountManagement.Application.Contracts/Account/EditAccount.cs
index 41afe474..877edafc 100644
--- a/AccountManagement.Application.Contracts/Account/EditAccount.cs
+++ b/AccountManagement.Application.Contracts/Account/EditAccount.cs
@@ -1,6 +1,4 @@
-using System.Collections.Generic;
-
-namespace AccountManagement.Application.Contracts.Account;
+namespace AccountManagement.Application.Contracts.Account;
public class EditAccount : CreateAccount
{
diff --git a/AccountManagement.Application.Contracts/Account/EditClientAccount.cs b/AccountManagement.Application.Contracts/Account/EditClientAccount.cs
index eef61835..9d18014f 100644
--- a/AccountManagement.Application.Contracts/Account/EditClientAccount.cs
+++ b/AccountManagement.Application.Contracts/Account/EditClientAccount.cs
@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace AccountManagement.Application.Contracts.Account;
+namespace AccountManagement.Application.Contracts.Account;
public class EditClientAccount : RegisterAccount
{
diff --git a/AccountManagement.Application.Contracts/Account/IAccountApplication.cs b/AccountManagement.Application.Contracts/Account/IAccountApplication.cs
index 10b107ad..b1da0153 100644
--- a/AccountManagement.Application.Contracts/Account/IAccountApplication.cs
+++ b/AccountManagement.Application.Contracts/Account/IAccountApplication.cs
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Threading.Tasks;
-using AccountManagement.Application.Contracts.ProgramManager;
using Shared.Contracts.PmUser.Queries;
namespace AccountManagement.Application.Contracts.Account;
@@ -75,12 +74,8 @@ public interface IAccountApplication
void CameraLogin(CameraLoginRequest request);
- ///
- /// دریافت کاربر پروگرام منیجر با اکانت آی دی
- ///
- ///
- ///
- Task GetPmUserByAccountId(long accountId);
+ Task GetPmUserAsync(long accountId);
+
}
public class CameraLoginRequest
diff --git a/AccountManagement.Application.Contracts/Account/RegisterAccount.cs b/AccountManagement.Application.Contracts/Account/RegisterAccount.cs
index 78b9fcf0..d299dd88 100644
--- a/AccountManagement.Application.Contracts/Account/RegisterAccount.cs
+++ b/AccountManagement.Application.Contracts/Account/RegisterAccount.cs
@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using _0_Framework.Application;
+using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Http;
namespace AccountManagement.Application.Contracts.Account;
diff --git a/AccountManagement.Application.Contracts/Account/WorkshopSelectList.cs b/AccountManagement.Application.Contracts/Account/WorkshopSelectList.cs
index 8e17212f..48d952b8 100644
--- a/AccountManagement.Application.Contracts/Account/WorkshopSelectList.cs
+++ b/AccountManagement.Application.Contracts/Account/WorkshopSelectList.cs
@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace AccountManagement.Application.Contracts.Account;
+namespace AccountManagement.Application.Contracts.Account;
public class WorkshopSelectList
{
diff --git a/AccountManagement.Application.Contracts/ProgramManager/GetRoleDto.cs b/AccountManagement.Application.Contracts/ProgramManager/GetRoleDto.cs
deleted file mode 100644
index a3256abd..00000000
--- a/AccountManagement.Application.Contracts/ProgramManager/GetRoleDto.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System.Collections.Generic;
-
-namespace AccountManagement.Application.Contracts.ProgramManager;
-
-public record GetPmRolesDto
-{
- ///
- /// آی دی نقش
- ///
- public long Id { get; set; }
-
- ///
- /// نام نقش
- ///
- public string RoleName { get; set; }
-
- ///
- /// آی دی نقش در گزارشگیر
- ///
- public long? GozareshgirRoleId { get; set; }
-
- ///
- /// لیست کدهای دسترسی
- ///
- public List Permissions { get; set; }
-
-
-}
\ No newline at end of file
diff --git a/AccountManagement.Application/AccountApplication.cs b/AccountManagement.Application/AccountApplication.cs
index 0736293d..ff2fd102 100644
--- a/AccountManagement.Application/AccountApplication.cs
+++ b/AccountManagement.Application/AccountApplication.cs
@@ -2,13 +2,9 @@
using _0_Framework.Application.Sms;
using _0_Framework.Exceptions;
using AccountManagement.Application.Contracts.Account;
-using AccountManagement.Application.Contracts.ProgramManagerApiResult;
using AccountManagement.Domain.AccountAgg;
using AccountManagement.Domain.AccountLeftWorkAgg;
using AccountManagement.Domain.CameraAccountAgg;
-using AccountManagement.Domain.InternalApiCaller;
-using AccountManagement.Domain.PmDomains.PmRoleUserAgg;
-using AccountManagement.Domain.PmDomains.PmUserAgg;
using AccountManagement.Domain.PositionAgg;
using AccountManagement.Domain.RoleAgg;
using AccountManagement.Domain.SubAccountAgg;
@@ -17,25 +13,13 @@ using AccountManagement.Domain.SubAccountRoleAgg;
using Company.Domain._common;
using Company.Domain.WorkshopAgg;
using Company.Domain.WorkshopSubAccountAgg;
-using CompanyManagment.App.Contracts.Workshop;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.JsonPatch.Operations;
using Microsoft.AspNetCore.Mvc.Rendering;
-using Microsoft.EntityFrameworkCore;
-using Newtonsoft.Json;
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Linq;
-using System.Net.Http;
-using System.Runtime.InteropServices;
-using System.Security.Claims;
-using System.Text;
-using System.Threading;
using System.Threading.Tasks;
-using AccountManagement.Application.Contracts.ProgramManager;
+
using Shared.Contracts.PmUser.Commands;
-using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
using Shared.Contracts.PmUser.Queries;
//using AccountManagement.Domain.RoleAgg;
@@ -58,13 +42,13 @@ public class AccountApplication : IAccountApplication
private readonly ISubAccountRoleRepository _subAccountRoleRepository;
private readonly IWorkshopSubAccountRepository _workshopSubAccountRepository;
private readonly ISubAccountPermissionSubtitle1Repository _accountPermissionSubtitle1Repository;
- private readonly IPmUserRepository _pmUserRepository;
+
private readonly IUnitOfWork _unitOfWork;
private readonly IPmUserQueryService _pmUserQueryService;
private readonly IPmUserCommandService _pmUserCommandService;
public AccountApplication(IAccountRepository accountRepository, IPasswordHasher passwordHasher,
- IFileUploader fileUploader, IAuthHelper authHelper, IRoleRepository roleRepository, IWorker worker, ISmsService smsService, ICameraAccountRepository cameraAccountRepository, IPositionRepository positionRepository, IAccountLeftworkRepository accountLeftworkRepository, IWorkshopRepository workshopRepository, ISubAccountRepository subAccountRepository, ISubAccountRoleRepository subAccountRoleRepository, IWorkshopSubAccountRepository workshopSubAccountRepository, ISubAccountPermissionSubtitle1Repository accountPermissionSubtitle1Repository, IUnitOfWork unitOfWork, IPmUserRepository pmUserRepository, IPmUserQueryService pmUserQueryService, IPmUserCommandService pmUserCommandService)
+ IFileUploader fileUploader, IAuthHelper authHelper, IRoleRepository roleRepository, IWorker worker, ISmsService smsService, ICameraAccountRepository cameraAccountRepository, IPositionRepository positionRepository, IAccountLeftworkRepository accountLeftworkRepository, IWorkshopRepository workshopRepository, ISubAccountRepository subAccountRepository, ISubAccountRoleRepository subAccountRoleRepository, IWorkshopSubAccountRepository workshopSubAccountRepository, ISubAccountPermissionSubtitle1Repository accountPermissionSubtitle1Repository, IUnitOfWork unitOfWork, IPmUserQueryService pmUserQueryService, IPmUserCommandService pmUserCommandService)
{
_authHelper = authHelper;
_roleRepository = roleRepository;
@@ -78,7 +62,7 @@ public class AccountApplication : IAccountApplication
_workshopSubAccountRepository = workshopSubAccountRepository;
_accountPermissionSubtitle1Repository = accountPermissionSubtitle1Repository;
_unitOfWork = unitOfWork;
- _pmUserRepository = pmUserRepository;
+
_pmUserQueryService = pmUserQueryService;
_pmUserCommandService = pmUserCommandService;
_fileUploader = fileUploader;
@@ -171,6 +155,8 @@ public class AccountApplication : IAccountApplication
if (command.IsProgramManagerUser)
{
+ if (command.UserRoles == null)
+ return operation.Failed("حداقل یک نقش برای کاربر مدیریت پروژه لازم است");
var pmUserRoles = command.UserRoles.Where(x => x > 0).ToList();
var createPm = await _pmUserCommandService.Create(new CreatePmUserDto(command.Fullname, command.Username, account.Password, command.Mobile,
null, account.id, pmUserRoles));
@@ -268,6 +254,8 @@ public class AccountApplication : IAccountApplication
//);
var userResult =await _pmUserQueryService.GetPmUserDataByAccountId(account.id);
+ if (command.UserRoles == null)
+ return operation.Failed("حداقل یک نقش برای کاربر مدیریت پروژه لازم است");
var pmUserRoles = command.UserRoles.Where(x => x > 0).ToList();
//اگر کاربر در پروگرام منیجر قبلا ایجاد شده
@@ -412,6 +400,23 @@ public class AccountApplication : IAccountApplication
.Permissions
.Select(x => x.Code)
.ToList();
+ //PmPermission
+ var PmUserData = _pmUserQueryService.GetPmUserDataByAccountId(account.id).GetAwaiter().GetResult();
+ if (PmUserData.AccountId > 0 && PmUserData.IsActive)
+ {
+
+ var pmUserPermissions =
+ PmUserData.RoleListDto != null
+ ? PmUserData.RoleListDto
+ .SelectMany(x => x.Permissions)
+ .Where(p => p != 99)
+ .Distinct()
+ .ToList()
+ : new List();
+ permissions.AddRange(pmUserPermissions);
+ }
+
+
int? positionValue;
if (account.PositionId != null)
{
@@ -421,7 +426,7 @@ public class AccountApplication : IAccountApplication
{
positionValue = null;
}
- var pmUserId = _pmUserQueryService.GetCurrentPmUserIdFromAccountId(account.id).GetAwaiter().GetResult();
+ var pmUserId = PmUserData.AccountId > 0 ? PmUserData.AccountId : null;
var authViewModel = new AuthViewModel(account.id, account.RoleId, account.Fullname
, account.Username, account.Mobile, account.ProfilePhoto,
permissions, account.RoleName, account.AdminAreaPermission,
@@ -1015,8 +1020,8 @@ public class AccountApplication : IAccountApplication
_authHelper.CameraSignIn(authViewModel);
}
- public async Task GetPmUserByAccountId(long accountId)
+ public async Task GetPmUserAsync(long accountId)
{
- return await _pmUserRepository.GetPmUserByAccountId(accountId);
+ return await _pmUserQueryService.GetPmUserDataByAccountId(accountId);
}
}
\ No newline at end of file
diff --git a/AccountManagement.Application/CameraAccountApplication.cs b/AccountManagement.Application/CameraAccountApplication.cs
index bf0c02c2..d5a0ae24 100644
--- a/AccountManagement.Application/CameraAccountApplication.cs
+++ b/AccountManagement.Application/CameraAccountApplication.cs
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Account;
using AccountManagement.Application.Contracts.CameraAccount;
diff --git a/AccountManagement.Application/MediaApplication.cs b/AccountManagement.Application/MediaApplication.cs
index 354027da..48056abb 100644
--- a/AccountManagement.Application/MediaApplication.cs
+++ b/AccountManagement.Application/MediaApplication.cs
@@ -1,5 +1,4 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.IO;
using System.Linq;
using _0_Framework.Application;
diff --git a/AccountManagement.Application/RoleApplication.cs b/AccountManagement.Application/RoleApplication.cs
index eb25b1dd..b4d7a7db 100644
--- a/AccountManagement.Application/RoleApplication.cs
+++ b/AccountManagement.Application/RoleApplication.cs
@@ -4,13 +4,7 @@ using AccountManagement.Domain.RoleAgg;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-using AccountManagement.Application.Contracts.ProgramManagerApiResult;
-using AccountManagement.Domain.InternalApiCaller;
using Company.Domain._common;
-using AccountManagement.Application.Contracts.Ticket;
-using AccountManagement.Domain.PmDomains.PmPermissionAgg;
-using AccountManagement.Domain.PmDomains.PmRoleAgg;
-using AccountManagement.Domain.PmDomains.PmUserAgg;
using Microsoft.AspNetCore.Mvc.Rendering;
using Shared.Contracts.PmRole.Commands;
using GetPmRolesDto = Shared.Contracts.PmRole.Queries.GetPmRolesDto;
@@ -22,18 +16,15 @@ namespace AccountManagement.Application;
public class RoleApplication : IRoleApplication
{
private readonly IRoleRepository _roleRepository;
- private readonly IPmRoleRepository _pmRoleRepository;
- private readonly IPmUserRepository _pmUserRepository;
+
private readonly IPmRoleQueryService _pmRoleQueryService;
private readonly IPmRoleCommandService _pmRoleCommandService;
private readonly IUnitOfWork _unitOfWork;
- public RoleApplication(IRoleRepository roleRepository, IUnitOfWork unitOfWork, IPmRoleRepository pmRoleRepository, IPmUserRepository pmUserRepository, IPmRoleQueryService pmRoleQueryService, IPmRoleCommandService pmRoleCommandService)
+ public RoleApplication(IRoleRepository roleRepository, IUnitOfWork unitOfWork, IPmRoleQueryService pmRoleQueryService, IPmRoleCommandService pmRoleCommandService)
{
_roleRepository = roleRepository;
_unitOfWork = unitOfWork;
- _pmRoleRepository = pmRoleRepository;
- _pmUserRepository = pmUserRepository;
_pmRoleQueryService = pmRoleQueryService;
_pmRoleCommandService = pmRoleCommandService;
}
diff --git a/AccountManagement.Application/SubAccountApplication.cs b/AccountManagement.Application/SubAccountApplication.cs
index 8d2f592f..cd79c847 100644
--- a/AccountManagement.Application/SubAccountApplication.cs
+++ b/AccountManagement.Application/SubAccountApplication.cs
@@ -5,14 +5,11 @@ using AccountManagement.Domain.AccountAgg;
using AccountManagement.Domain.CameraAccountAgg;
using AccountManagement.Domain.SubAccountAgg;
using AccountManagement.Domain.SubAccountRoleAgg;
-using Company.Domain.WorkshopAccountAgg;
using Company.Domain.WorkshopSubAccountAgg;
-using CompanyManagment.App.Contracts.Workshop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
namespace AccountManagement.Application
diff --git a/AccountManagement.Application/TaskSubjectApplication.cs b/AccountManagement.Application/TaskSubjectApplication.cs
index 42383942..c27fa674 100644
--- a/AccountManagement.Application/TaskSubjectApplication.cs
+++ b/AccountManagement.Application/TaskSubjectApplication.cs
@@ -1,9 +1,7 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.TaskSubject;
using AccountManagement.Domain.TaskSubjectAgg;
-using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
namespace AccountManagement.Application;
diff --git a/AccountManagement.Configuration/PmDbBootstrapper.cs b/AccountManagement.Configuration/PmDbBootstrapper.cs
deleted file mode 100644
index 84d93fa8..00000000
--- a/AccountManagement.Configuration/PmDbBootstrapper.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using AccountManagement.Domain.PmDomains.PmRoleAgg;
-using AccountManagement.Domain.PmDomains.PmUserAgg;
-using AccountMangement.Infrastructure.EFCore.PmDbConetxt;
-using AccountMangement.Infrastructure.EFCore.Repository.PmRepositories;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace AccountManagement.Configuration;
-
-public class PmDbBootstrapper
-{
- public static void Configure(IServiceCollection services, string connectionString)
- {
- services.AddTransient();
- services.AddTransient();
- services.AddDbContext(x => x.UseSqlServer(connectionString));
- }
-}
\ No newline at end of file
diff --git a/AccountManagement.Domain/PmDomains/PmPermissionAgg/PmPermission.cs b/AccountManagement.Domain/PmDomains/PmPermissionAgg/PmPermission.cs
deleted file mode 100644
index 691a9954..00000000
--- a/AccountManagement.Domain/PmDomains/PmPermissionAgg/PmPermission.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using AccountManagement.Domain.PmDomains.PmRoleAgg;
-
-namespace AccountManagement.Domain.PmDomains.PmPermissionAgg;
-
-public class PmPermission
-{
- public long Id { get; private set; }
- public int Code { get; private set; }
- public PmRole Role { get; private set; }
-
- public PmPermission(int code)
- {
- Code = code;
- }
-}
\ No newline at end of file
diff --git a/AccountManagement.Domain/PmDomains/PmRoleAgg/IPmRoleRepository.cs b/AccountManagement.Domain/PmDomains/PmRoleAgg/IPmRoleRepository.cs
deleted file mode 100644
index 49cb7f4e..00000000
--- a/AccountManagement.Domain/PmDomains/PmRoleAgg/IPmRoleRepository.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using _0_Framework.Domain;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using AccountManagement.Application.Contracts.ProgramManager;
-
-namespace AccountManagement.Domain.PmDomains.PmRoleAgg;
-
-public interface IPmRoleRepository :IRepository
-{
- Task> GetPmRoleList(long? gozareshgirRoleId);
-
- Task GetPmRoleToEdit(long gozareshgirRoleId);
-
-}
-
diff --git a/AccountManagement.Domain/PmDomains/PmRoleAgg/PmRole.cs b/AccountManagement.Domain/PmDomains/PmRoleAgg/PmRole.cs
deleted file mode 100644
index ddb305ea..00000000
--- a/AccountManagement.Domain/PmDomains/PmRoleAgg/PmRole.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System.Collections.Generic;
-using _0_Framework.Domain;
-using AccountManagement.Domain.PmDomains.PmPermissionAgg;
-
-namespace AccountManagement.Domain.PmDomains.PmRoleAgg;
-
-public class PmRole : EntityBase
-{
- ///
- /// نام نقش
- ///
- public string RoleName { get; private set; }
-
-
- ///
- /// لیست پرمیشن کد ها
- ///
- public List PmPermission { get; private set; }
-
- ///
- /// ای دی نقش در گزارشگیر
- ///
- public long? GozareshgirRoleId { get; private set; }
-
-
- protected PmRole()
- {
- }
-
- public PmRole(string roleName,long? gozareshgirRolId, List permissions)
- {
- RoleName = roleName;
- PmPermission = permissions;
- GozareshgirRoleId = gozareshgirRolId;
-
- }
-
-
- public void Edit(string roleName, List permissions)
- {
- RoleName = roleName;
- PmPermission = permissions;
- }
-
-
-}
\ No newline at end of file
diff --git a/AccountManagement.Domain/PmDomains/PmRoleUserAgg/PmRoleUser.cs b/AccountManagement.Domain/PmDomains/PmRoleUserAgg/PmRoleUser.cs
deleted file mode 100644
index a7cf6355..00000000
--- a/AccountManagement.Domain/PmDomains/PmRoleUserAgg/PmRoleUser.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using AccountManagement.Domain.PmDomains.PmUserAgg;
-
-namespace AccountManagement.Domain.PmDomains.PmRoleUserAgg;
-
-public class PmRoleUser
-{
- public PmRoleUser(long roleId)
- {
- RoleId = roleId;
- }
-
- public long Id { get; private set; }
- public long RoleId { get; private set; }
-
-
- public PmUser User { get; set; }
-
-
-}
\ No newline at end of file
diff --git a/AccountManagement.Domain/PmDomains/PmUserAgg/IPmUserRepository.cs b/AccountManagement.Domain/PmDomains/PmUserAgg/IPmUserRepository.cs
deleted file mode 100644
index 52c28fc1..00000000
--- a/AccountManagement.Domain/PmDomains/PmUserAgg/IPmUserRepository.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using _0_Framework.Domain;
-using AccountManagement.Application.Contracts.ProgramManager;
-using System.Threading.Tasks;
-using Shared.Contracts.PmUser.Queries;
-
-namespace AccountManagement.Domain.PmDomains.PmUserAgg;
-
-public interface IPmUserRepository : IRepository
-{
- ///
- /// دریافت کاربر پروگرام منیجر جهتد ویرایش
- ///
- ///
- ///
- Task GetByPmUsertoEditbyAccountId(long accountId);
- ///
- /// دریافت کرابر پروگرام منیجر با اکانت آی دی در گزارشگیر
- ///
- ///
- ///
- Task GetPmUserByAccountId(long accountId);
-}
\ No newline at end of file
diff --git a/AccountManagement.Domain/PmDomains/PmUserAgg/PmUser.cs b/AccountManagement.Domain/PmDomains/PmUserAgg/PmUser.cs
deleted file mode 100644
index 6b0c531a..00000000
--- a/AccountManagement.Domain/PmDomains/PmUserAgg/PmUser.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-using System;
-using System.Collections.Generic;
-using _0_Framework.Domain;
-using AccountManagement.Domain.PmDomains.PmRoleUserAgg;
-
-
-namespace AccountManagement.Domain.PmDomains.PmUserAgg;
-
-///
-/// کاربر
-///
-public class PmUser : EntityBase
-{
- ///
- /// ایجاد
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public PmUser(string fullName, string userName, string password, string mobile, string email, long? accountId, List roles)
- {
- FullName = fullName;
- UserName = userName;
- Password = password;
- Mobile = mobile;
- Email = email;
- IsActive = true;
- AccountId = accountId;
- RoleUser = roles;
- }
-
- protected PmUser()
- {
-
- }
- ///
- /// نام و نام خانوادگی
- ///
- public string FullName { get; private set; }
-
- ///
- /// نام کاربری
- ///
- public string UserName { get; private set; }
-
- ///
- /// گذرواژه
- ///
- public string Password { get; private set; }
-
- ///
- /// مسیر عکس پروفایل
- ///
- public string ProfilePhotoPath { get; private set; }
-
- ///
- /// شماره موبایل
- ///
- public string Mobile { get; set; }
-
- ///
- /// ایمیل
- ///
- public string Email { get; private set; }
-
- ///
- /// فعال/غیر فعال بودن یوزر
- ///
- public bool IsActive { get; private set; }
-
-
- ///
- /// کد یکبارمصرف ورود
- ///
- public string VerifyCode { get; private set; }
-
- ///
- /// آی دی کاربر در گزارشگیر
- ///
- public long? AccountId { get; private set; }
-
-
- ///
- /// لیست پرمیشن کد ها
- ///
- public List RoleUser { get; private set; }
-
-
- ///
- /// آپدیت کاربر
- ///
- ///
- ///
- ///
- ///
- ///
- public void Edit(string fullName, string userName, string mobile, List roles, bool isActive)
- {
- FullName = fullName;
- UserName = userName;
- Mobile = mobile;
- RoleUser = roles;
- IsActive = isActive;
- }
-
- ///
- /// غیرفعال سازی
- ///
- public void DeActive()
- {
- IsActive = false;
- }
-
- ///
- /// فعال سازی
- ///
- public void ReActive()
- {
- IsActive = true;
- }
-
-
-}
\ No newline at end of file
diff --git a/AccountMangement.Infrastructure.EFCore/Mappings/PmMappings/PmRoleMapping.cs b/AccountMangement.Infrastructure.EFCore/Mappings/PmMappings/PmRoleMapping.cs
deleted file mode 100644
index 00324b3d..00000000
--- a/AccountMangement.Infrastructure.EFCore/Mappings/PmMappings/PmRoleMapping.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using AccountManagement.Domain.PmDomains.PmRoleAgg;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Metadata.Builders;
-
-namespace AccountMangement.Infrastructure.EFCore.Mappings.PmMappings;
-
-public class PmRoleMapping : IEntityTypeConfiguration
-{
- public void Configure(EntityTypeBuilder builder)
- {
- builder.ToTable("PmRoles", t => t.ExcludeFromMigrations());
- builder.HasKey(x => x.id);
-
- builder.Property(x => x.RoleName).HasMaxLength(100).IsRequired();
-
- builder.OwnsMany(x => x.PmPermission, navigationBuilder =>
- {
- navigationBuilder.HasKey(x => x.Id);
- navigationBuilder.ToTable("PmRolePermissions", t => t.ExcludeFromMigrations());
-
- navigationBuilder.WithOwner(x => x.Role);
- });
- }
-}
\ No newline at end of file
diff --git a/AccountMangement.Infrastructure.EFCore/Mappings/PmMappings/PmUserMapping.cs b/AccountMangement.Infrastructure.EFCore/Mappings/PmMappings/PmUserMapping.cs
deleted file mode 100644
index 9ee5e126..00000000
--- a/AccountMangement.Infrastructure.EFCore/Mappings/PmMappings/PmUserMapping.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using AccountManagement.Domain.PmDomains.PmUserAgg;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Metadata.Builders;
-
-namespace AccountMangement.Infrastructure.EFCore.Mappings.PmMappings;
-
-public class PmUserMapping :IEntityTypeConfiguration
-{
- public void Configure(EntityTypeBuilder builder)
- {
- builder.ToTable("Users");
- builder.HasKey(x => x.id);
-
- builder.Property(x => x.FullName).HasMaxLength(100).IsRequired();
- builder.Property(x => x.UserName).HasMaxLength(100).IsRequired();
- builder.Property(x => x.Password).HasMaxLength(1000).IsRequired();
- builder.Property(x => x.ProfilePhotoPath).HasMaxLength(500).IsRequired(false);
- builder.Property(x => x.Mobile).HasMaxLength(20).IsRequired();
- builder.Property(x => x.Email).HasMaxLength(150).IsRequired(false); ;
- builder.Property(x => x.VerifyCode).HasMaxLength(10).IsRequired(false);
- builder.OwnsMany(x => x.RoleUser, navigationBuilder =>
- {
- navigationBuilder.HasKey(x => x.Id);
- navigationBuilder.ToTable("RoleUsers");
- navigationBuilder.WithOwner(x => x.User);
- });
-
-
- }
-}
\ No newline at end of file
diff --git a/AccountMangement.Infrastructure.EFCore/PmDbConetxt/PmDbContext.cs b/AccountMangement.Infrastructure.EFCore/PmDbConetxt/PmDbContext.cs
deleted file mode 100644
index a668490e..00000000
--- a/AccountMangement.Infrastructure.EFCore/PmDbConetxt/PmDbContext.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using AccountManagement.Domain.PmDomains.PmRoleAgg;
-using AccountManagement.Domain.PmDomains.PmUserAgg;
-using AccountMangement.Infrastructure.EFCore.Mappings;
-using AccountMangement.Infrastructure.EFCore.Mappings.PmMappings;
-using Microsoft.EntityFrameworkCore;
-
-namespace AccountMangement.Infrastructure.EFCore.PmDbConetxt;
-
-public class PmDbContext : DbContext
-{
- public PmDbContext(DbContextOptions options) : base(options)
- {
-
- }
- public DbSet Users { get; set; } = null!;
- public DbSet PmRoles { get; set; } = null!;
-
-
- public PmDbContext()
- {
-
- }
-
-
- protected override void OnModelCreating(ModelBuilder modelBuilder)
- {
- var assembly = typeof(PmUserMapping).Assembly;
- modelBuilder.ApplyConfigurationsFromAssembly(assembly);
- //SubAccountPermissionSeeder.Seed(modelBuilder);
- base.OnModelCreating(modelBuilder);
- }
-}
\ No newline at end of file
diff --git a/AccountMangement.Infrastructure.EFCore/Repository/PmRepositories/PmRoleRepository.cs b/AccountMangement.Infrastructure.EFCore/Repository/PmRepositories/PmRoleRepository.cs
deleted file mode 100644
index e3f93e53..00000000
--- a/AccountMangement.Infrastructure.EFCore/Repository/PmRepositories/PmRoleRepository.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using _0_Framework.InfraStructure;
-using AccountManagement.Application.Contracts.ProgramManager;
-using AccountManagement.Domain.PmDomains.PmRoleAgg;
-using AccountMangement.Infrastructure.EFCore.PmDbConetxt;
-using Microsoft.EntityFrameworkCore;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
-
-namespace AccountMangement.Infrastructure.EFCore.Repository.PmRepositories;
-
-public class PmRoleRepository : RepositoryBase, IPmRoleRepository
-{
- private readonly PmDbContext _pmDbContext;
- public PmRoleRepository(PmDbContext context) : base(context)
- {
- _pmDbContext = context;
- }
-
- public async Task> GetPmRoleList(long? gozareshgirRoleId)
- {
- var query = _pmDbContext.PmRoles.AsQueryable();
- if (gozareshgirRoleId != null && gozareshgirRoleId > 0)
- query = query.Where(x => x.GozareshgirRoleId == gozareshgirRoleId);
- var res = await query
- .Select(p => new GetPmRolesDto()
- {
- Id = p.id,
- RoleName = p.RoleName,
- GozareshgirRoleId = p.GozareshgirRoleId,
- Permissions = p.PmPermission.Select(x => x.Code).ToList()
-
- })
- .ToListAsync();
-
- return res;
- }
-
-
-
- public async Task GetPmRoleToEdit(long gozareshgirRoleId)
- {
- return await _pmDbContext.PmRoles.FirstOrDefaultAsync(x => x.GozareshgirRoleId == gozareshgirRoleId);
-
- }
-
-}
\ No newline at end of file
diff --git a/AccountMangement.Infrastructure.EFCore/Repository/PmRepositories/PmUserRepository.cs b/AccountMangement.Infrastructure.EFCore/Repository/PmRepositories/PmUserRepository.cs
deleted file mode 100644
index e4915a65..00000000
--- a/AccountMangement.Infrastructure.EFCore/Repository/PmRepositories/PmUserRepository.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using _0_Framework.InfraStructure;
-using AccountManagement.Application.Contracts.ProgramManager;
-using AccountManagement.Domain.PmDomains.PmUserAgg;
-using AccountMangement.Infrastructure.EFCore.PmDbConetxt;
-using Microsoft.EntityFrameworkCore;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Shared.Contracts.PmUser.Queries;
-
-namespace AccountMangement.Infrastructure.EFCore.Repository.PmRepositories;
-
-public class PmUserRepository :RepositoryBase, IPmUserRepository
-{
- private readonly PmDbContext _pmDbContext;
- public PmUserRepository(PmDbContext context, PmDbContext pmDbContext) : base(context)
- {
- _pmDbContext = pmDbContext;
- }
- public async Task GetByPmUsertoEditbyAccountId(long accountId)
- {
- return await _pmDbContext.Users.FirstOrDefaultAsync(x => x.AccountId == accountId);
- }
-
- public async Task GetPmUserByAccountId(long accountId)
- {
- var query = await _pmDbContext.Users.FirstOrDefaultAsync(x => x.AccountId == accountId);
- if (query == null)
- return new GetPmUserDto();
- List roles = query.RoleUser.Select(x => x.RoleId).ToList();
- return new GetPmUserDto()
- {
- FullName = query.FullName,
- UserName = query.UserName,
- ProfilePhotoPath = query.ProfilePhotoPath,
- Mobile = query.Mobile,
- IsActive = query.IsActive,
- AccountId = query.AccountId,
- Roles = roles,
- RoleListDto = await _pmDbContext.PmRoles.Where(x => roles.Contains(x.id)).Select(x => new RoleListDto()
- {
- RoleName = x.RoleName,
- RoleId = x.id,
- Permissions = x.PmPermission.Select(x => x.Code).ToList()
- }).ToListAsync(),
- };
- }
-}
\ No newline at end of file
diff --git a/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/BackgroundInstitutionContract.Task.csproj b/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/BackgroundInstitutionContract.Task.csproj
index d003ac92..3032b3a1 100644
--- a/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/BackgroundInstitutionContract.Task.csproj
+++ b/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/BackgroundInstitutionContract.Task.csproj
@@ -12,6 +12,7 @@
+
diff --git a/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Jobs/JobSchedulerRegistrator.cs b/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Jobs/JobSchedulerRegistrator.cs
index 1425a1a7..b4487ac7 100644
--- a/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Jobs/JobSchedulerRegistrator.cs
+++ b/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Jobs/JobSchedulerRegistrator.cs
@@ -1,5 +1,6 @@
using _0_Framework.Application;
+using _0_Framework.Application.Sms;
using Company.Domain.ContarctingPartyAgg;
using Company.Domain.InstitutionContractAgg;
using Hangfire;
@@ -13,13 +14,15 @@ public class JobSchedulerRegistrator
private readonly IInstitutionContractRepository _institutionContractRepository;
private static DateTime? _lastRunCreateTransaction;
private static DateTime? _lastRunSendMonthlySms;
+ private readonly ISmsService _smsService;
- public JobSchedulerRegistrator(SmsReminder smsReminder, IBackgroundJobClient backgroundJobClient, IInstitutionContractRepository institutionContractRepository)
+ public JobSchedulerRegistrator(SmsReminder smsReminder, IBackgroundJobClient backgroundJobClient, IInstitutionContractRepository institutionContractRepository, ISmsService smsService)
{
_smsReminder = smsReminder;
_backgroundJobClient = backgroundJobClient;
_institutionContractRepository = institutionContractRepository;
+ _smsService = smsService;
}
public void Register()
@@ -47,6 +50,11 @@ public class JobSchedulerRegistrator
() => SendBlockSms(),
"*/1 * * * *" // هر 1 دقیقه یکبار چک کن
);
+ RecurringJob.AddOrUpdate(
+ "InstitutionContract.SendInstitutionContractConfirmSms",
+ () => SendInstitutionContractConfirmSms(),
+ "*/1 * * * *" // هر 1 دقیقه یکبار چک کن
+ );
}
@@ -86,8 +94,8 @@ public class JobSchedulerRegistrator
}
catch (Exception e)
{
- //_smsService.Alarm("09114221321", "خطا-ایجاد سند مالی");
-
+ await _smsService.Alarm("09114221321", "خطا-ایجاد سند مالی");
+
}
}
@@ -146,4 +154,15 @@ public class JobSchedulerRegistrator
await _institutionContractRepository.SendBlockSmsForBackgroundTask();
}
+
+ ///
+ /// ارسال پیامک یادآور تایید قراداد مالی
+ ///
+ ///
+ [DisableConcurrentExecution(timeoutInSeconds: 100)]
+ public async System.Threading.Tasks.Task SendInstitutionContractConfirmSms()
+ {
+ await _institutionContractRepository.SendInstitutionContractConfirmSmsTask();
+ }
+
}
\ No newline at end of file
diff --git a/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/NullBoardNotificationPublisher.cs b/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/NullBoardNotificationPublisher.cs
new file mode 100644
index 00000000..ddb1796b
--- /dev/null
+++ b/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/NullBoardNotificationPublisher.cs
@@ -0,0 +1,10 @@
+using GozareshgirProgramManager.Application.Interfaces;
+using GozareshgirProgramManager.Domain.ProjectAgg.Enums;
+
+public class NullBoardNotificationPublisher:IBoardNotificationPublisher
+{
+ public Task SendProjectStatusChanged(long userId, TaskSectionStatus oldStatus, TaskSectionStatus newStatus, Guid sectionId)
+ {
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
diff --git a/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Program.cs b/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Program.cs
index dda9d58e..c08fcf29 100644
--- a/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Program.cs
+++ b/BackgroundInstitutionContract/BackgroundInstitutionContract.Task/Program.cs
@@ -7,11 +7,17 @@ using BackgroundInstitutionContract.Task;
using BackgroundInstitutionContract.Task.Jobs;
using CompanyManagment.App.Contracts.Hubs;
using CompanyManagment.EFCore.Services;
+using GozareshgirProgramManager.Application._Bootstrapper;
+using GozareshgirProgramManager.Application.Interfaces;
+using GozareshgirProgramManager.Application.Modules.Users.Commands.CreateUser;
+using GozareshgirProgramManager.Infrastructure;
+using GozareshgirProgramManager.Infrastructure.Persistence.Seed;
using Hangfire;
using Microsoft.AspNetCore.Identity;
using MongoDB.Driver;
using PersonalContractingParty.Config;
using Query.Bootstrapper;
+using Shared.Contracts.PmUser.Queries;
using WorkFlow.Infrastructure.Config;
var builder = WebApplication.CreateBuilder(args);
@@ -26,7 +32,7 @@ builder.Services.AddTransient();
builder.Services.AddTransient();
builder.Services.AddTransient();
builder.Services.Configure(builder.Configuration);
-
+builder.Services.AddScoped();
#region MongoDb
var mongoConnectionSection = builder.Configuration.GetSection("MongoDb");
@@ -38,10 +44,15 @@ builder.Services.AddSingleton(mongoDatabase);
#endregion
+builder.Services.AddProgramManagerApplication();
+builder.Services.AddProgramManagerInfrastructure(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();
diff --git a/Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs b/Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs
index 74f06914..4d045c9a 100644
--- a/Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs
+++ b/Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs
@@ -142,6 +142,11 @@ public interface IInstitutionContractRepository : IRepository
Task SendReminderSmsToContractingParties(List smsListData, string typeOfSms, string sendMessStart, string sendMessEnd);
+ ///
+ /// ارسال پیامک یادآور تایید قراداد مالی
+ ///
+ ///
+ Task SendInstitutionContractConfirmSmsTask();
#endregion
#region CreateMontlyTransaction
diff --git a/Company.Domain/InstitutionContractAgg/InstitutionContract.cs b/Company.Domain/InstitutionContractAgg/InstitutionContract.cs
index c21948de..159fda16 100644
--- a/Company.Domain/InstitutionContractAgg/InstitutionContract.cs
+++ b/Company.Domain/InstitutionContractAgg/InstitutionContract.cs
@@ -98,6 +98,11 @@ public class InstitutionContract : EntityBase
// مبلغ قرارداد
public double ContractAmount { get; private set; }
+ public double ContractAmountWithTax => !IsOldContract ? ContractAmount + ContractAmountTax
+ : ContractAmount;
+
+ public double ContractAmountTax => ContractAmount*0.10;
+
//خسارت روزانه
public double DailyCompenseation { get; private set; }
@@ -159,6 +164,10 @@ public class InstitutionContract : EntityBase
public List Amendments { get; private set; }
+ public InstitutionContractSigningType? SigningType { get; private set; }
+
+ public bool IsOldContract => LawId== 0;
+
public InstitutionContract()
{
ContactInfoList = [];
@@ -268,6 +277,11 @@ public class InstitutionContract : EntityBase
Amendments.Add(amendment);
}
}
+ public void SetSigningType(InstitutionContractSigningType signingType)
+ {
+ SigningType = signingType;
+ }
+}
public class InstitutionContractAmendment : EntityBase
{
diff --git a/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopCurrent.cs b/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopCurrent.cs
index b030af3f..1f884553 100644
--- a/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopCurrent.cs
+++ b/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopCurrent.cs
@@ -11,13 +11,14 @@ public class InstitutionContractWorkshopCurrent:InstitutionContractWorkshopBase
bool hasRollCallPlanInPerson, bool hasCustomizeCheckoutPlan, bool hasContractPlan,
bool hasContractPlanInPerson, bool hasInsurancePlan, bool hasInsurancePlanInPerson,
int personnelCount, double price,long institutionContractWorkshopGroupId,
- InstitutionContractWorkshopGroup workshopGroup,long workshopId,bool isAmendment) : base(workshopName, hasRollCallPlan,
+ InstitutionContractWorkshopGroup workshopGroup,long workshopId,bool isAmendment, long initialWorkshopId) : base(workshopName, hasRollCallPlan,
hasRollCallPlanInPerson, hasCustomizeCheckoutPlan, hasContractPlan,
hasContractPlanInPerson, hasInsurancePlan, hasInsurancePlanInPerson, personnelCount, price,isAmendment)
{
InstitutionContractWorkshopGroupId = institutionContractWorkshopGroupId;
WorkshopGroup = workshopGroup;
WorkshopId = workshopId;
+ InitialWorkshopId = initialWorkshopId;
}
public long InstitutionContractWorkshopGroupId { get; private set; }
public InstitutionContractWorkshopGroup WorkshopGroup { get; private set; }
diff --git a/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopGroup.cs b/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopGroup.cs
index d69130e6..d807018e 100644
--- a/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopGroup.cs
+++ b/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopGroup.cs
@@ -44,4 +44,10 @@ public class InstitutionContractWorkshopGroup : EntityBase
CurrentWorkshops = updatedDetails.ToList();
LastModifiedDate = DateTime.Now;
}
+
+ public void AddCurrentWorkshop(InstitutionContractWorkshopCurrent currentWorkshop)
+ {
+ CurrentWorkshops.Add(currentWorkshop);
+ LastModifiedDate = DateTime.Now;
+ }
}
\ No newline at end of file
diff --git a/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopInitial.cs b/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopInitial.cs
index f4953d6c..bd0dfeb9 100644
--- a/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopInitial.cs
+++ b/Company.Domain/InstitutionContractAgg/InstitutionContractWorkshopInitial.cs
@@ -32,7 +32,7 @@ public class InstitutionContractWorkshopInitial:InstitutionContractWorkshopBase
WorkshopCurrent = new InstitutionContractWorkshopCurrent(WorkshopName,Services.RollCall,Services.RollCallInPerson,
Services.CustomizeCheckout,Services.Contract,Services.ContractInPerson,Services.Insurance,
Services.InsuranceInPerson,PersonnelCount,Price,InstitutionContractWorkshopGroupId,WorkshopGroup,workshopId,
- IsAmendment);
+ IsAmendment, id);
WorkshopCurrent.SetEmployers(Employers.Select(x=>x.EmployerId).ToList());
}
diff --git a/Company.Domain/InstitutionPlanAgg/IPlanPercentageRepository.cs b/Company.Domain/InstitutionPlanAgg/IPlanPercentageRepository.cs
index b8406a4f..ad2575f3 100644
--- a/Company.Domain/InstitutionPlanAgg/IPlanPercentageRepository.cs
+++ b/Company.Domain/InstitutionPlanAgg/IPlanPercentageRepository.cs
@@ -2,6 +2,7 @@
using CompanyManagment.App.Contracts.InstitutionPlan;
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
using System.Collections.Generic;
+using System.Threading.Tasks;
namespace Company.Domain.InstitutionPlanAgg;
@@ -26,4 +27,10 @@ public interface IPlanPercentageRepository : IRepository
///
///
InstitutionPlanViewModel GetInstitutionPlanForWorkshop(WorkshopTempViewModel command);
+
+ ///
+ /// دریافت دیتای مودال ایجاد
+ ///
+ ///
+ Task GetCreateModalData();
}
\ No newline at end of file
diff --git a/Company.Domain/InsuranceListAgg/IInsuranceListRepository.cs b/Company.Domain/InsuranceListAgg/IInsuranceListRepository.cs
index 214df689..b8b95235 100644
--- a/Company.Domain/InsuranceListAgg/IInsuranceListRepository.cs
+++ b/Company.Domain/InsuranceListAgg/IInsuranceListRepository.cs
@@ -73,6 +73,7 @@ public interface IInsuranceListRepository:IRepository
Task GetInsuranceOperationDetails(long id);
Task GetTabCounts(InsuranceListSearchModel searchModel);
+ Task> GetInsuranceClientList(InsuranceClientSearchModel searchModel);
#endregion
diff --git a/Company.Domain/WorkshopAgg/Workshop.cs b/Company.Domain/WorkshopAgg/Workshop.cs
index 99226c05..2fe015b4 100644
--- a/Company.Domain/WorkshopAgg/Workshop.cs
+++ b/Company.Domain/WorkshopAgg/Workshop.cs
@@ -316,7 +316,10 @@ public class Workshop : EntityBase
IsStaticCheckout = isStaticCheckout;
}
-
+ public void AddContractingPartyId(long contractingPartyId)
+ {
+ ContractingPartyId = contractingPartyId;
+ }
public void Active(string archiveCode)
{
this.IsActive = true;
diff --git a/CompanyManagement.Infrastructure.Excel/CWS/CustomizeWorkshopGroupSettingExcelGenerator.cs b/CompanyManagement.Infrastructure.Excel/CWS/CustomizeWorkshopGroupSettingExcelGenerator.cs
index 4d27f8bc..9a828e93 100644
--- a/CompanyManagement.Infrastructure.Excel/CWS/CustomizeWorkshopGroupSettingExcelGenerator.cs
+++ b/CompanyManagement.Infrastructure.Excel/CWS/CustomizeWorkshopGroupSettingExcelGenerator.cs
@@ -26,7 +26,7 @@ public class CustomizeWorkshopGroupSettingExcelGenerator
{
public static byte[] Generate(List groups)
{
- ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+ ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
using (var package = new ExcelPackage())
{
var worksheet = package.Workbook.Worksheets.Add("GroupsAndEmployees");
diff --git a/CompanyManagement.Infrastructure.Excel/CaseManagement/CaseManagementExcelGenerator.cs b/CompanyManagement.Infrastructure.Excel/CaseManagement/CaseManagementExcelGenerator.cs
index 1387a76a..17d3ad48 100644
--- a/CompanyManagement.Infrastructure.Excel/CaseManagement/CaseManagementExcelGenerator.cs
+++ b/CompanyManagement.Infrastructure.Excel/CaseManagement/CaseManagementExcelGenerator.cs
@@ -24,7 +24,7 @@ public class CaseManagementExcelGenerator
};
public static byte[] GenerateCheckoutTempExcelInfo(List data)
{
- OfficeOpenXml.ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+ OfficeOpenXml.ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
using var package = new ExcelPackage();
CreateSheet(data, package,"همه");
CreateSheet(data.Where(x=>x.Status ==2).ToList(), package,"فعال");
diff --git a/CompanyManagement.Infrastructure.Excel/Checkout/CustomizeCheckoutExcelGenerator.cs b/CompanyManagement.Infrastructure.Excel/Checkout/CustomizeCheckoutExcelGenerator.cs
index 313b456a..68c3f6e4 100644
--- a/CompanyManagement.Infrastructure.Excel/Checkout/CustomizeCheckoutExcelGenerator.cs
+++ b/CompanyManagement.Infrastructure.Excel/Checkout/CustomizeCheckoutExcelGenerator.cs
@@ -46,7 +46,7 @@ public class CustomizeCheckoutExcelGenerator
};
public static byte[] GenerateCheckoutTempExcelInfo(List data, List selectedParameters)
{
- OfficeOpenXml.ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+ ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
using var package = new ExcelPackage();
var worksheet = package.Workbook.Worksheets.Add("Sheet1");
diff --git a/CompanyManagement.Infrastructure.Excel/EmployeeBankInfo/EmployeeBankInfoExcelGenerator.cs b/CompanyManagement.Infrastructure.Excel/EmployeeBankInfo/EmployeeBankInfoExcelGenerator.cs
index 9e71b3b3..ec3f14ea 100644
--- a/CompanyManagement.Infrastructure.Excel/EmployeeBankInfo/EmployeeBankInfoExcelGenerator.cs
+++ b/CompanyManagement.Infrastructure.Excel/EmployeeBankInfo/EmployeeBankInfoExcelGenerator.cs
@@ -7,7 +7,7 @@ public class EmployeeBankInfoExcelGenerator
{
public static byte[] Generate(List list)
{
- ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+ ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
using var package = new ExcelPackage();
var worksheet = package.Workbook.Worksheets.Add("EmployeeBankInfo");
@@ -166,7 +166,7 @@ public class EmployeeBankInfoExcelGenerator
public static byte[] Generate2(List list)
{
- ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+ ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
using var package = new ExcelPackage();
foreach (var employee in list)
{
@@ -220,4 +220,4 @@ public class EmployeeBankInfoExcelGenerator
cell.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
cell.Style.Fill.PatternType = ExcelFillStyle.Solid;
}
-}
\ No newline at end of file
+}
diff --git a/CompanyManagement.Infrastructure.Excel/InstitutionContract/InstitutionContractExcelGenerator.cs b/CompanyManagement.Infrastructure.Excel/InstitutionContract/InstitutionContractExcelGenerator.cs
index 67098ba7..e17f21df 100644
--- a/CompanyManagement.Infrastructure.Excel/InstitutionContract/InstitutionContractExcelGenerator.cs
+++ b/CompanyManagement.Infrastructure.Excel/InstitutionContract/InstitutionContractExcelGenerator.cs
@@ -13,7 +13,7 @@ public class InstitutionContractExcelGenerator
public static byte[] GenerateExcel(List institutionContractViewModels)
{
- ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+ ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
using var package = new ExcelPackage();
var allWorksheet = package.Workbook.Worksheets.Add("همه");
diff --git a/CompanyManagement.Infrastructure.Excel/RollCall/RollCallExcelGenerator.cs b/CompanyManagement.Infrastructure.Excel/RollCall/RollCallExcelGenerator.cs
index b7455351..8c749dd4 100644
--- a/CompanyManagement.Infrastructure.Excel/RollCall/RollCallExcelGenerator.cs
+++ b/CompanyManagement.Infrastructure.Excel/RollCall/RollCallExcelGenerator.cs
@@ -8,7 +8,7 @@ public class RollCallExcelGenerator : ExcelGenerator
{
public static byte[] CaseHistoryExcelForEmployee(CaseHistoryRollCallExcelForEmployeeViewModel data)
{
- OfficeOpenXml.ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+ OfficeOpenXml.ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
using var package = new OfficeOpenXml.ExcelPackage();
var worksheet = package.Workbook.Worksheets.Add("Sheet1");
var rollCalls = data.RollCalls;
@@ -181,7 +181,7 @@ public class RollCallExcelGenerator : ExcelGenerator
public static byte[] CaseHistoryExcelForOneDay(CaseHistoryRollCallForOneDayViewModel data)
{
- OfficeOpenXml.ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+ OfficeOpenXml.ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
using var package = new OfficeOpenXml.ExcelPackage();
var worksheet = package.Workbook.Worksheets.Add("Sheet1");
var rollCalls = data.RollCalls;
diff --git a/CompanyManagement.Infrastructure.Excel/SalaryAid/SalaryAidImportExcel.cs b/CompanyManagement.Infrastructure.Excel/SalaryAid/SalaryAidImportExcel.cs
index fe393695..fc45ab9b 100644
--- a/CompanyManagement.Infrastructure.Excel/SalaryAid/SalaryAidImportExcel.cs
+++ b/CompanyManagement.Infrastructure.Excel/SalaryAid/SalaryAidImportExcel.cs
@@ -43,7 +43,7 @@ public class SalaryAidImportExcel
ValidData = []
};
- ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+ ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
if (file == null || file.Length == 0)
{
diff --git a/CompanyManagement.Infrastructure.Excel/WorkshopsRollCall/WorkshopRollCallExcelExporter.cs b/CompanyManagement.Infrastructure.Excel/WorkshopsRollCall/WorkshopRollCallExcelExporter.cs
index 86676126..23032db6 100644
--- a/CompanyManagement.Infrastructure.Excel/WorkshopsRollCall/WorkshopRollCallExcelExporter.cs
+++ b/CompanyManagement.Infrastructure.Excel/WorkshopsRollCall/WorkshopRollCallExcelExporter.cs
@@ -9,7 +9,7 @@ public class WorkshopRollCallExcelExporter
{
public static byte[] Export(List workshops)
{
- ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+ ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
using (var package = new ExcelPackage())
{
var ws = package.Workbook.Worksheets.Add("Workshops");
diff --git a/CompanyManagment.App.Contracts/Employee/IEmployeeApplication.cs b/CompanyManagment.App.Contracts/Employee/IEmployeeApplication.cs
index 89e15168..1e40cf51 100644
--- a/CompanyManagment.App.Contracts/Employee/IEmployeeApplication.cs
+++ b/CompanyManagment.App.Contracts/Employee/IEmployeeApplication.cs
@@ -60,7 +60,7 @@ public interface IEmployeeApplication
///
Task>
ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(string nationalCode,
- string birthDate, long workshopId);
+ string birthDate,bool authorizedCanceled, long workshopId);
///
/// پرسنل هایی که در کارگاهی از سمت ادمین شروع به کار کرده اند
diff --git a/CompanyManagment.App.Contracts/EmployeeDocuments/WorkshopWithEmployeeDocumentsViewModel.cs b/CompanyManagment.App.Contracts/EmployeeDocuments/WorkshopWithEmployeeDocumentsViewModel.cs
index bfc63e07..df9aedd1 100644
--- a/CompanyManagment.App.Contracts/EmployeeDocuments/WorkshopWithEmployeeDocumentsViewModel.cs
+++ b/CompanyManagment.App.Contracts/EmployeeDocuments/WorkshopWithEmployeeDocumentsViewModel.cs
@@ -13,5 +13,6 @@ namespace CompanyManagment.App.Contracts.EmployeeDocuments
public string EmployerName { get; set; }
public List SubmittedItems { get; set; }
public int EmployeesWithoutDocumentCount { get; set; }
+ public long EmployeeId { get; set; }
}
}
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/ContractSigningType.cs b/CompanyManagment.App.Contracts/InstitutionContract/ContractSigningType.cs
new file mode 100644
index 00000000..42617ac6
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/ContractSigningType.cs
@@ -0,0 +1,17 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public enum InstitutionContractSigningType
+{
+ ///
+ /// قدیمی
+ ///
+ Legacy = 0,
+ ///
+ /// الکترونیکی با کد یکبار مصرف
+ ///
+ OtpBased = 1,
+ ///
+ /// به صورت فیزیکی
+ ///
+ Physical = 2
+}
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs b/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs
index 2a6cc678..468d1ebc 100644
--- a/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs
+++ b/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs
@@ -7,7 +7,6 @@ using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.Application.Sms;
using CompanyManagment.App.Contracts.Checkout;
-using CompanyManagment.App.Contracts.Law;
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
using CompanyManagment.App.Contracts.Workshop;
using CompanyManagment.App.Contracts.WorkshopPlan;
@@ -265,26 +264,16 @@ public interface IInstitutionContractApplication
Task GetContractWorkshopsDetails(long id);
Task GetAmendmentVerificationDetails(Guid id, long amendmentId);
+ Task SetPendingWorkflow(long entityId,InstitutionContractSigningType signingType);
Task GetIdByInstallmentId(long installmentId);
-
-}
-
-public class InstitutionContractDiscountResponse
-{
- public InstitutionContractDiscountOneTimeViewModel OneTime { get; set; }
- public InstitutionContractDiscountMonthlyViewModel Monthly { get; set; }
-}
-
-public class InstitutionContractDiscountMonthlyViewModel:InstitutionContractDiscountOneTimeViewModel
-{
- public List Installments { get; set; }
-}
-
-public class InstitutionContractDiscountOneTimeViewModel
-{
///
- /// مجموع مبالغ
+ /// تایید قرارداد مالی به صورت دستی
+ ///
+ ///
///
+ Task VerifyInstitutionContractManually(long institutionContractId);
+
+
public string TotalAmount { get; set; }
///
/// ارزش افزوده
@@ -410,42 +399,4 @@ public class InstitutionContractAmendmentWorkshopsResponse
public class InstitutionContractSelectListViewModel : SelectListViewModel;
-public class InstitutionContractExtensionInquiryResponse
-{
- public long Id { get; set; }
- public string FName { get; set; }
- public string LName { get; set; }
- public string DateOfBirthFa { get; set; }
- public string FatherName { get; set; }
- public string IdNumberSerial { get; set; }
- public string IdNumber { get; set; }
- public string Address { get; set; }
- public string Phone { get; set; }
- public string City { get; set; }
- public string State { get; set; }
- public long RepresentativeId { get; set; }
- public string NationalCode { get; set; }
-}
-
-
-
-public class InstitutionContractExtensionPaymentMonthly:InstitutionContractExtensionPaymentOneTime
-{
- public List Installments { get; set; }
-}
-
-public class InstitutionContractExtensionPaymentOneTime
-{
- ///
- /// مجموع مبالغ
- ///
- public string TotalAmount { get; set; }
- ///
- /// ارزش افزوده
- ///
- public string Tax { get; set; }
- ///
- /// مبلغ قابل پرداخت
- ///
- public string PaymentAmount { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InsertAmendmentTempWorkshopResponse.cs b/CompanyManagment.App.Contracts/InstitutionContract/InsertAmendmentTempWorkshopResponse.cs
new file mode 100644
index 00000000..04551e9d
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InsertAmendmentTempWorkshopResponse.cs
@@ -0,0 +1,9 @@
+using System;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InsertAmendmentTempWorkshopResponse
+{
+ public Guid WorkshopTempId { get; set; }
+ public string Amount { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractAmendmentWorkshopsResponse.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractAmendmentWorkshopsResponse.cs
new file mode 100644
index 00000000..4e5409ef
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractAmendmentWorkshopsResponse.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractAmendmentWorkshopsResponse
+{
+ ///
+ ///
+ ///
+ public List Workshops { get; set; }
+
+ public Guid TempId { get; set; }
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractDiscountResponse.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractDiscountResponse.cs
new file mode 100644
index 00000000..7e987a7a
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractDiscountResponse.cs
@@ -0,0 +1,38 @@
+using System.Collections.Generic;
+using CompanyManagment.App.Contracts.TemporaryClientRegistration;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractDiscountResponse
+{
+ public InstitutionContractDiscountOneTimeViewModel OneTime { get; set; }
+ public InstitutionContractDiscountMonthlyViewModel Monthly { get; set; }
+}
+public class InstitutionContractDiscountMonthlyViewModel:InstitutionContractDiscountOneTimeViewModel
+{
+ public List Installments { get; set; }
+}
+
+public class InstitutionContractDiscountOneTimeViewModel
+{
+ ///
+ /// مجموع مبالغ
+ ///
+ public string TotalAmount { get; set; }
+ ///
+ /// ارزش افزوده
+ ///
+ public string Tax { get; set; }
+ ///
+ /// مبلغ قابل پرداخت
+ ///
+ public string PaymentAmount { get; set; }
+
+ public string DiscountedAmount { get; set; }
+
+ public int DiscountPercetage { get; set; }
+
+ public string Obligation { get; set; }
+
+ public string OneMonthAmount { get; set; }
+}
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionInquiryResponse.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionInquiryResponse.cs
new file mode 100644
index 00000000..e90f846e
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionInquiryResponse.cs
@@ -0,0 +1,18 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractExtensionInquiryResponse
+{
+ public long Id { get; set; }
+ public string FName { get; set; }
+ public string LName { get; set; }
+ public string DateOfBirthFa { get; set; }
+ public string FatherName { get; set; }
+ public string IdNumberSerial { get; set; }
+ public string IdNumber { get; set; }
+ public string Address { get; set; }
+ public string Phone { get; set; }
+ public string City { get; set; }
+ public string State { get; set; }
+ public long RepresentativeId { get; set; }
+ public string NationalCode { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPaymentOneTime.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPaymentOneTime.cs
new file mode 100644
index 00000000..fbaf87f2
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractExtensionPaymentOneTime.cs
@@ -0,0 +1,24 @@
+using System.Collections.Generic;
+using CompanyManagment.App.Contracts.TemporaryClientRegistration;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractExtensionPaymentMonthly:InstitutionContractExtensionPaymentOneTime
+{
+ public List Installments { get; set; }
+}
+public class InstitutionContractExtensionPaymentOneTime
+{
+ ///
+ /// مجموع مبالغ
+ ///
+ public string TotalAmount { get; set; }
+ ///
+ /// ارزش افزوده
+ ///
+ public string Tax { get; set; }
+ ///
+ /// مبلغ قابل پرداخت
+ ///
+ public string PaymentAmount { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractPrintViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractPrintViewModel.cs
new file mode 100644
index 00000000..df913c85
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractPrintViewModel.cs
@@ -0,0 +1,28 @@
+using System.Collections.Generic;
+using CompanyManagment.App.Contracts.Law;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractPrintViewModel
+{
+ public InstitutionContratVerificationParty FirstParty { get; set; }
+ public InstitutionContratVerificationParty SecondParty { get; set; }
+ public string ContractNo { get; set; }
+ public string CreationDate { get; set; }
+ public string ContractStart { get; set; }
+ public string ContractEnd { get; set; }
+ public List Workshops { get; set; }
+ public string TotalPrice { get; set; }
+ public string TaxPrice { get; set; }
+ public string PaymentPrice { get; set; }
+ public string OneMonthPrice { get; set; }
+ public string VerifyCode { get; set; }
+ public string VerifyDate { get; set; }
+ public string VerifyTime { get; set; }
+ public string VerifierFullName { get; set; }
+ public string VerifierPhoneNumber { get; set; }
+ public LawViewModel LawViewModel { get; set; }
+ public string Obligation { get; set; }
+ public string OneMonthWithoutTax { get; set; }
+ public string OneMonthTax { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractResetDiscountForCreateRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractResetDiscountForCreateRequest.cs
new file mode 100644
index 00000000..c491ebe2
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractResetDiscountForCreateRequest.cs
@@ -0,0 +1,10 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractResetDiscountForCreateRequest
+{
+ public int DiscountPercentage { get; set; }
+ public double TotalAmount { get; set; }
+ public bool IsInstallment { get; set; }
+ public InstitutionContractDuration Duration { get; set; }
+ public double OneMonthAmount { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractResetDiscountForExtensionRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractResetDiscountForExtensionRequest.cs
new file mode 100644
index 00000000..7011e364
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractResetDiscountForExtensionRequest.cs
@@ -0,0 +1,9 @@
+using System;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractResetDiscountForExtensionRequest
+{
+ public Guid TempId { get; set; }
+ public bool IsInstallment { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractSelectListViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractSelectListViewModel.cs
new file mode 100644
index 00000000..878e4933
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractSelectListViewModel.cs
@@ -0,0 +1,5 @@
+using _0_Framework.Application;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractSelectListViewModel : SelectListViewModel;
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractSetDiscountForExtensionRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractSetDiscountForExtensionRequest.cs
new file mode 100644
index 00000000..3df40e5e
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractSetDiscountForExtensionRequest.cs
@@ -0,0 +1,11 @@
+using System;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractSetDiscountForExtensionRequest
+{
+ public Guid TempId { get; set; }
+ public int DiscountPercentage { get; set; }
+ public double TotalAmount { get; set; }
+ public bool IsInstallment { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractSetDiscountRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractSetDiscountRequest.cs
new file mode 100644
index 00000000..d39286fc
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractSetDiscountRequest.cs
@@ -0,0 +1,10 @@
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public class InstitutionContractSetDiscountRequest
+{
+ public int DiscountPercentage { get; set; }
+ public double TotalAmount { get; set; }
+ public InstitutionContractDuration Duration { get; set; }
+ public double OneMonthAmount { get; set; }
+ public bool IsInstallment { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractViewModel.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractViewModel.cs
index 2b3032cc..1e7ee84c 100644
--- a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractViewModel.cs
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionContractViewModel.cs
@@ -76,5 +76,7 @@ public class InstitutionContractViewModel
public bool IsInstallment { get; set; }
public InstitutionContractVerificationStatus VerificationStatus { get; set; }
+ public InstitutionContractSigningType? SigningType { get; set; }
+
public List InstallmentList { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionContract/InstitutionCreationVerificationSmsDto.cs b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionCreationVerificationSmsDto.cs
new file mode 100644
index 00000000..b0151e87
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionContract/InstitutionCreationVerificationSmsDto.cs
@@ -0,0 +1,12 @@
+using System;
+
+namespace CompanyManagment.App.Contracts.InstitutionContract;
+
+public record InstitutionCreationVerificationSmsDto
+{
+ public string Number{ get; set; }
+ public string FullName { get; set; }
+ public Guid InstitutionId { get; set; }
+ public long ContractingPartyId { get; set; }
+ public long InstitutionContractId { get; set; }
+};
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionPlan/CreateServiceAmountDto.cs b/CompanyManagment.App.Contracts/InstitutionPlan/CreateServiceAmountDto.cs
new file mode 100644
index 00000000..6800b2f5
--- /dev/null
+++ b/CompanyManagment.App.Contracts/InstitutionPlan/CreateServiceAmountDto.cs
@@ -0,0 +1,51 @@
+namespace CompanyManagment.App.Contracts.InstitutionPlan;
+
+public class CreateServiceAmountDto
+{
+ ///
+ /// آی دی
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// قرارداد و تصفیه
+ /// درصد از مزد روزانه
+ /// string
+ ///
+ public string ContractAndCheckoutPercentStr { get; set; }
+
+ ///
+ /// بیمه
+ /// درصد از مزد روزانه
+ /// string
+ ///
+ public string InsurancePercentStr { get; set; }
+
+ ///
+ /// حضورغباب
+ /// درصد از مزد روزانه
+ /// string
+ ///
+ public string RollCallPercentStr { get; set; }
+
+ ///
+ /// فیش غیر رسمی
+ /// درصد از مزد روزانه
+ /// string
+ ///
+ public string CustomizeCheckoutPercentStr { get; set; }
+
+ ///
+ /// خدمات حضوری قرداد و تصفیه
+ /// درصد از مزد روزانه
+ /// string
+ ///
+ public string ContractAndCheckoutInPersonPercentStr { get; set; }
+
+ ///
+ /// خدمات حضوری بیمه
+ /// درصد از مزد روزانه
+ /// string
+ ///
+ public string InsuranceInPersonPercentStr { get; set; }
+}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InstitutionPlan/IInstitutionPlanApplication.cs b/CompanyManagment.App.Contracts/InstitutionPlan/IInstitutionPlanApplication.cs
index 2e2293c0..2eb91460 100644
--- a/CompanyManagment.App.Contracts/InstitutionPlan/IInstitutionPlanApplication.cs
+++ b/CompanyManagment.App.Contracts/InstitutionPlan/IInstitutionPlanApplication.cs
@@ -1,6 +1,7 @@
-using System.Collections.Generic;
-using _0_Framework.Application;
+using _0_Framework.Application;
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
+using System.Collections.Generic;
+using System.Threading.Tasks;
namespace CompanyManagment.App.Contracts.InstitutionPlan;
@@ -34,4 +35,18 @@ public interface IInstitutionPlanApplication
///
///
InstitutionPlanViewModel GetInstitutionPlanForWorkshop(WorkshopTempViewModel command);
+
+
+ ///
+ /// دریافت دیتای درصد سرویس برای مودال ایجاد
+ ///
+ ///
+ Task GetCreateModalData();
+
+ ///
+ /// ایجاد درصد سرویس
+ ///
+ ///
+ ///
+ Task CreateInstitutionPlanPercentage(CreateServiceAmountDto command);
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InsuranceList/IInsuranceListApplication.cs b/CompanyManagment.App.Contracts/InsuranceList/IInsuranceListApplication.cs
index 9d48019c..1a36dafb 100644
--- a/CompanyManagment.App.Contracts/InsuranceList/IInsuranceListApplication.cs
+++ b/CompanyManagment.App.Contracts/InsuranceList/IInsuranceListApplication.cs
@@ -90,8 +90,27 @@ public interface IInsuranceListApplication
Task GetInsuranceOperationDetails(long id);
Task GetTabCounts(InsuranceListSearchModel searchModel);
+ Task> GetInsuranceClientList(InsuranceClientSearchModel searchModel);
+
#endregion
Task> GetNotCreatedWorkshop(InsuranceListSearchModel searchModel);
+}
+
+public class InsuranceClientSearchModel:PaginationRequest
+{
+ public int Year { get; set; }
+ public int Month { get; set; }
+ public string Sorting { get; set; }
+}
+public class InsuranceClientListViewModel
+{
+ public long Id { get; set; }
+ public string Year { get; set; }
+ public string Month { get; set; }
+ public long WorkShopId { get; set; }
+ public int YearInt { get; set; }
+ public string MonthName { get; set; }
+ public int MonthInt { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/RollCallEmployee/IRollCallEmployeeApplication.cs b/CompanyManagment.App.Contracts/RollCallEmployee/IRollCallEmployeeApplication.cs
index b736b0bc..8691b2f1 100644
--- a/CompanyManagment.App.Contracts/RollCallEmployee/IRollCallEmployeeApplication.cs
+++ b/CompanyManagment.App.Contracts/RollCallEmployee/IRollCallEmployeeApplication.cs
@@ -1,6 +1,7 @@
using _0_Framework.Application;
using System.Collections.Generic;
using System.Linq;
+using System.Threading.Tasks;
namespace CompanyManagment.App.Contracts.RollCallEmployee;
diff --git a/CompanyManagment.Application/EmployeeAplication.cs b/CompanyManagment.Application/EmployeeAplication.cs
index 5d10be05..5323a5ed 100644
--- a/CompanyManagment.Application/EmployeeAplication.cs
+++ b/CompanyManagment.Application/EmployeeAplication.cs
@@ -1263,7 +1263,7 @@ public class EmployeeAplication : RepositoryBase, IEmployeeAppli
System.IO.File.WriteAllBytes(filePath, bytes);
}
public async Task>
- ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(string nationalCode, string birthDate, long workshopId)
+ ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(string nationalCode, string birthDate,bool authorizedCanceled, long workshopId)
{
var op = new OperationResult();
@@ -1279,65 +1279,25 @@ public class EmployeeAplication : RepositoryBase, IEmployeeAppli
var employee = _EmployeeRepository.GetByNationalCodeIgnoreQueryFilter(nationalCode);
- if (employee == null)
+ if (employee == null && !authorizedCanceled)
{
var personalInfo = await _uidService.GetPersonalInfo(nationalCode, birthDate);
-
- if (personalInfo.ResponseContext.Status.Code == 14)
+ if (personalInfo != null)
{
- return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeByNationalCodeInWorkshopViewModel() { AuthorizedCanceled = true });
- }
- if (personalInfo.ResponseContext.Status.Code != 0)
- {
- return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
- }
+ if (personalInfo.ResponseContext.Status.Code == 14)
+ {
+ return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeByNationalCodeInWorkshopViewModel() { AuthorizedCanceled = true });
+ }
+ if (personalInfo.ResponseContext.Status.Code != 0)
+ {
+ return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
+ }
- var basicInfo = personalInfo.BasicInformation;
- var identityInfo = personalInfo.IdentificationInformation;
- DateTime apiBirthDate = identityInfo.BirthDate.ToGeorgianDateTime();
+ var basicInfo = personalInfo.BasicInformation;
+ var identityInfo = personalInfo.IdentificationInformation;
+ DateTime apiBirthDate = identityInfo.BirthDate.ToGeorgianDateTime();
- var dateOfIssue = new DateTime(1922, 1, 1);
-
- var gender = basicInfo.GenderEnum switch
- {
- Gender.Female => "زن",
- Gender.Male => "مرد",
- _ => throw new AggregateException()
- };
-
- var idNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber;
-
- var newEmployee = new Employee(basicInfo.FirstName, basicInfo.LastName, basicInfo.FatherName, apiBirthDate,
- dateOfIssue, null, identityInfo.NationalId, idNumber, gender, "ایرانی", identityInfo.ShenasnameSerial, identityInfo.ShenasnameSeri);
- newEmployee.Authorized();
- await _EmployeeRepository.CreateAsync(newEmployee);
- await _EmployeeRepository.SaveChangesAsync();
-
- return op.Succcedded(new EmployeeByNationalCodeInWorkshopViewModel()
- {
- EmployeeId = newEmployee.id,
- EmployeeFName = newEmployee.FName,
- Gender = newEmployee.Gender,
- Nationality = newEmployee.Nationality,
- EmployeeLName = newEmployee.LName
- });
- }
-
- if (_leftWorkTempRepository.ExistsIgnoreQueryFilter(x =>
- x.EmployeeId == employee.id && x.WorkshopId == workshopId && x.LeftWorkType == LeftWorkTempType.StartWork))
- {
- return op.Failed("این پرسنل در کارگاه شما قبلا افزوده شده است و در انتظار تایید میباشد");
- }
-
- if (employee.IsAuthorized == false)
- {
- var personalInfoResponse = await _uidService.GetPersonalInfo(nationalCode, birthDate);
-
- if (personalInfoResponse.ResponseContext.Status.Code == 0)
- {
- var basicInfo = personalInfoResponse.BasicInformation;
- var identityInfo = personalInfoResponse.IdentificationInformation;
- var apiBirthDate = identityInfo.BirthDate.ToGeorgianDateTime();
+ var dateOfIssue = new DateTime(1922, 1, 1);
var gender = basicInfo.GenderEnum switch
{
@@ -1348,31 +1308,90 @@ public class EmployeeAplication : RepositoryBase, IEmployeeAppli
var idNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber;
-
- employee.Edit(basicInfo.FirstName, basicInfo.LastName, basicInfo.FatherName, apiBirthDate,
- employee.DateOfIssue, employee.PlaceOfIssue, identityInfo.NationalId, idNumber,
- gender, "ایرانی", employee.Phone, employee.Address, employee.State, employee.City,
- employee.MaritalStatus, employee.MilitaryService, employee.LevelOfEducation,
- employee.FieldOfStudy, employee.BankCardNumber, employee.BankBranch, employee.InsuranceCode, employee.InsuranceHistoryByYear,
- employee.InsuranceHistoryByMonth, employee.NumberOfChildren,
- employee.OfficePhone, employee.MclsUserName, employee.MclsPassword,
- employee.EserviceUserName, employee.EservicePassword, employee.TaxOfficeUserName,
- employee.TaxOfficepassword, employee.SanaUserName, employee.SanaPassword);
-
- employee.Authorized();
-
+ var newEmployee = new Employee(basicInfo.FirstName, basicInfo.LastName, basicInfo.FatherName, apiBirthDate,
+ dateOfIssue, null, identityInfo.NationalId, idNumber, gender, "ایرانی", identityInfo.ShenasnameSerial, identityInfo.ShenasnameSeri);
+ newEmployee.Authorized();
+ await _EmployeeRepository.CreateAsync(newEmployee);
await _EmployeeRepository.SaveChangesAsync();
+ return op.Succcedded(new EmployeeByNationalCodeInWorkshopViewModel()
+ {
+ EmployeeId = newEmployee.id,
+ EmployeeFName = newEmployee.FName,
+ Gender = newEmployee.Gender,
+ Nationality = newEmployee.Nationality,
+ EmployeeLName = newEmployee.LName
+ });
}
else
+ {
+ return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeByNationalCodeInWorkshopViewModel() { AuthorizedCanceled = true });
+ }
+
+
+
+
+ }
+ else if (employee == null && authorizedCanceled)
+ {
+ return op.Succcedded(new EmployeeByNationalCodeInWorkshopViewModel());
+ }
+
+ if (_leftWorkTempRepository.ExistsIgnoreQueryFilter(x =>
+ x.EmployeeId == employee.id && x.WorkshopId == workshopId && x.LeftWorkType == LeftWorkTempType.StartWork))
+ {
+ return op.Failed("این پرسنل در کارگاه شما قبلا افزوده شده است و در انتظار تایید میباشد");
+ }
+
+ var personalInfoResponse = await _uidService.GetPersonalInfo(nationalCode, birthDate);
+ if (personalInfoResponse != null)
+ {
+ if (employee.IsAuthorized == false)
+ {
+
+
+ if (personalInfoResponse.ResponseContext.Status.Code == 0)
+ {
+ var basicInfo = personalInfoResponse.BasicInformation;
+ var identityInfo = personalInfoResponse.IdentificationInformation;
+ var apiBirthDate = identityInfo.BirthDate.ToGeorgianDateTime();
+
+ var gender = basicInfo.GenderEnum switch
+ {
+ Gender.Female => "زن",
+ Gender.Male => "مرد",
+ _ => throw new AggregateException()
+ };
+
+ var idNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber;
+
+
+ employee.Edit(basicInfo.FirstName, basicInfo.LastName, basicInfo.FatherName, apiBirthDate,
+ employee.DateOfIssue, employee.PlaceOfIssue, identityInfo.NationalId, idNumber,
+ gender, "ایرانی", employee.Phone, employee.Address, employee.State, employee.City,
+ employee.MaritalStatus, employee.MilitaryService, employee.LevelOfEducation,
+ employee.FieldOfStudy, employee.BankCardNumber, employee.BankBranch, employee.InsuranceCode, employee.InsuranceHistoryByYear,
+ employee.InsuranceHistoryByMonth, employee.NumberOfChildren,
+ employee.OfficePhone, employee.MclsUserName, employee.MclsPassword,
+ employee.EserviceUserName, employee.EservicePassword, employee.TaxOfficeUserName,
+ employee.TaxOfficepassword, employee.SanaUserName, employee.SanaPassword);
+
+ employee.Authorized();
+
+ await _EmployeeRepository.SaveChangesAsync();
+
+ }
+ else
+ {
+ return op.Failed("کد ملی با تاریخ تولد وارد شده مطابقت ندارد");
+ }
+ }
+ else if (employee.DateOfBirth.ToFarsi() != birthDate || employee.NationalCode != nationalCode)
{
return op.Failed("کد ملی با تاریخ تولد وارد شده مطابقت ندارد");
}
}
- else if (employee.DateOfBirth.ToFarsi() != birthDate || employee.NationalCode != nationalCode)
- {
- return op.Failed("کد ملی با تاریخ تولد وارد شده مطابقت ندارد");
- }
+
var leftWorkViewModel = _leftWorkRepository.GetLastLeftWorkByEmployeeIdAndWorkshopId(workshopId, employee.id);
if (leftWorkViewModel == null)
diff --git a/CompanyManagment.Application/InstitutionContractApplication.cs b/CompanyManagment.Application/InstitutionContractApplication.cs
index 71f17431..edd04758 100644
--- a/CompanyManagment.Application/InstitutionContractApplication.cs
+++ b/CompanyManagment.Application/InstitutionContractApplication.cs
@@ -1537,7 +1537,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
return (await _institutionContractRepository.PrintAllAsync([id])).FirstOrDefault();
}
- public async Task SetPendingWorkflow(long entityId)
+ public async Task SetPendingWorkflow(long entityId,InstitutionContractSigningType signingType)
{
var op = new OperationResult();
var institutionContract = await _institutionContractRepository.GetIncludeWorkshopDetailsAsync(entityId);
@@ -1551,6 +1551,30 @@ public class InstitutionContractApplication : IInstitutionContractApplication
return op.Failed("وضعیت قرارداد مالی برای این عملیات مناسب نمی باشد");
}
+ var initialCreatedWorkshops = institutionContract.WorkshopGroup.InitialWorkshops
+ .Where(x => x.WorkshopCreated && x.WorkshopId is > 0).ToList();
+
+ var currentWorkshops = institutionContract.WorkshopGroup.CurrentWorkshops.ToList();
+ foreach (var createdWorkshop in initialCreatedWorkshops)
+ {
+ if (currentWorkshops.Any(x => x.WorkshopId == createdWorkshop.WorkshopId))
+ {
+ continue;
+ }
+
+ var currentWorkshop = new InstitutionContractWorkshopCurrent(createdWorkshop.WorkshopName,
+ createdWorkshop.Services.RollCall, createdWorkshop.Services.RollCallInPerson,
+ createdWorkshop.Services.CustomizeCheckout, createdWorkshop.Services.Contract,
+ createdWorkshop.Services.ContractInPerson, createdWorkshop.Services.Insurance,
+ createdWorkshop.Services.InsuranceInPerson,createdWorkshop.PersonnelCount, createdWorkshop.Price,
+ createdWorkshop.InstitutionContractWorkshopGroupId,createdWorkshop.WorkshopGroup,
+ createdWorkshop.WorkshopId!.Value, createdWorkshop.id);
+ institutionContract.WorkshopGroup.AddCurrentWorkshop(currentWorkshop);
+
+
+
+ }
+
if (institutionContract.WorkshopGroup.InitialWorkshops.All(x => x.WorkshopCreated && x.WorkshopId is > 0))
{
institutionContract.Verified();
@@ -1559,7 +1583,9 @@ public class InstitutionContractApplication : IInstitutionContractApplication
{
institutionContract.SetPendingWorkflow();
}
-
+
+ institutionContract.SetSigningType(signingType);
+
await _institutionContractRepository.SaveChangesAsync();
return op.Succcedded();
}
@@ -1584,6 +1610,28 @@ public class InstitutionContractApplication : IInstitutionContractApplication
}
+ public async Task VerifyInstitutionContractManually(long institutionContractId)
+ {
+ var op = new OperationResult();
+
+ var institutionContract =await _institutionContractRepository
+ .GetIncludeWorkshopDetailsAsync(institutionContractId);
+
+ if (institutionContract == null)
+ return op.Failed("قرارداد مالی یافت نشد");
+
+ if (institutionContract.VerificationStatus == InstitutionContractVerificationStatus.Verified)
+ return op.Failed("قرارداد مالی قبلا تایید شده است");
+
+ var transaction = await _institutionContractRepository.BeginTransactionAsync();
+ await SetPendingWorkflow(institutionContractId,InstitutionContractSigningType.Physical);
+
+
+ await transaction.CommitAsync();
+ await _institutionContractRepository.SaveChangesAsync();
+ return op.Succcedded();
+ }
+
private async Task> CreateLegalContractingPartyEntity(
CreateInstitutionContractLegalPartyRequest request, long representativeId, string address, string city,
string state)
diff --git a/CompanyManagment.Application/InstitutionPlanApplication.cs b/CompanyManagment.Application/InstitutionPlanApplication.cs
index 6137c992..53e2f1f7 100644
--- a/CompanyManagment.Application/InstitutionPlanApplication.cs
+++ b/CompanyManagment.Application/InstitutionPlanApplication.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Threading.Tasks;
using _0_Framework.Application;
using Company.Domain.InstitutionPlanAgg;
using CompanyManagment.App.Contracts.InstitutionPlan;
@@ -84,4 +85,68 @@ public class InstitutionPlanApplication : IInstitutionPlanApplication
{
return _planPercentageRepository.GetInstitutionPlanForWorkshop(command);
}
+
+
+ #region ForApi
+
+ public async Task GetCreateModalData()
+ {
+ return await _planPercentageRepository.GetCreateModalData();
+ }
+
+
+ public async Task CreateInstitutionPlanPercentage(CreateServiceAmountDto command)
+ {
+ var op = new OperationResult();
+ if (string.IsNullOrWhiteSpace(command.ContractAndCheckoutInPersonPercentStr) || command.ContractAndCheckoutInPersonPercentStr == "0" ||
+ string.IsNullOrWhiteSpace(command.ContractAndCheckoutPercentStr) || (command.ContractAndCheckoutPercentStr == "0" ||
+ string.IsNullOrWhiteSpace(command.CustomizeCheckoutPercentStr) || command.CustomizeCheckoutPercentStr == "0" ||
+ string.IsNullOrWhiteSpace(command.InsuranceInPersonPercentStr) || command.InsuranceInPersonPercentStr == "0" ||
+ string.IsNullOrWhiteSpace(command.InsurancePercentStr) || command.InsurancePercentStr == "0" ||
+ string.IsNullOrWhiteSpace(command.RollCallPercentStr) || command.RollCallPercentStr == "0"))
+ return op.Failed("هیچ یک از فیلدها نمیتوانند صفر باشند");
+
+ int contractAndCheckoutInPersonPercent = 0;
+ int contractAndCheckoutPercent = 0;
+ int customizeCheckoutPercent = 0;
+ int insuranceInPersonPercent = 0;
+ int insurancePercent = 0;
+ int rollCallPercent = 0;
+
+ try
+ {
+ contractAndCheckoutInPersonPercent = Convert.ToInt32(command.ContractAndCheckoutInPersonPercentStr);
+ contractAndCheckoutPercent = Convert.ToInt32(command.ContractAndCheckoutPercentStr);
+ customizeCheckoutPercent = Convert.ToInt32(command.CustomizeCheckoutPercentStr);
+ insuranceInPersonPercent = Convert.ToInt32(command.InsuranceInPersonPercentStr);
+ insurancePercent = Convert.ToInt32(command.InsurancePercentStr);
+ rollCallPercent = Convert.ToInt32(command.RollCallPercentStr);
+ }
+ catch (Exception e)
+ {
+ return op.Failed("لطفا عدد معتبر وارد کنید");
+
+ }
+
+ var firstPlan =await _planPercentageRepository.GetCreateModalData();
+ if (firstPlan != null)
+ {
+ var planPercentage = _planPercentageRepository.Get(firstPlan.Id);
+ planPercentage.Edit(contractAndCheckoutPercent, insurancePercent, rollCallPercent, customizeCheckoutPercent, contractAndCheckoutInPersonPercent, insuranceInPersonPercent);
+ _planPercentageRepository.SaveChanges();
+ }
+ else
+ {
+ var create = new PlanPercentage(contractAndCheckoutPercent, insurancePercent, rollCallPercent,
+ customizeCheckoutPercent, contractAndCheckoutInPersonPercent, insuranceInPersonPercent);
+ await _planPercentageRepository.CreateAsync(create);
+ await _planPercentageRepository.SaveChangesAsync();
+ }
+
+
+
+ return op.Succcedded();
+ }
+
+ #endregion
}
\ No newline at end of file
diff --git a/CompanyManagment.Application/InsuranceListApplication.cs b/CompanyManagment.Application/InsuranceListApplication.cs
index 2cac4299..5a3c5fb0 100644
--- a/CompanyManagment.Application/InsuranceListApplication.cs
+++ b/CompanyManagment.Application/InsuranceListApplication.cs
@@ -2371,6 +2371,11 @@ public class InsuranceListApplication : IInsuranceListApplication
return _insuranceListRepositpry.GetTabCounts(searchModel);
}
+ public async Task> GetInsuranceClientList(InsuranceClientSearchModel searchModel)
+ {
+ return await _insuranceListRepositpry.GetInsuranceClientList(searchModel);
+ }
+
public async Task> GetNotCreatedWorkshop(InsuranceListSearchModel searchModel)
{
return await _insuranceListRepositpry.GetNotCreatedWorkshop(searchModel);
diff --git a/CompanyManagment.Application/RollCallApplication.cs b/CompanyManagment.Application/RollCallApplication.cs
index 3b7357c4..d3641a20 100644
--- a/CompanyManagment.Application/RollCallApplication.cs
+++ b/CompanyManagment.Application/RollCallApplication.cs
@@ -384,6 +384,7 @@ public class RollCallApplication : IRollCallApplication
var workshopSettings = _customizeWorkshopSettingsRepository.GetBy(command.WorkshopId);
+
var employeeSettings =
_customizeWorkshopEmployeeSettingsRepository.GetByEmployeeIdAndWorkshopIdIncludeGroupSettings(
command.WorkshopId, command.EmployeeId)?.WorkshopShiftStatus;
diff --git a/CompanyManagment.Application/RollCallEmployeeApplication.cs b/CompanyManagment.Application/RollCallEmployeeApplication.cs
index 9f4630cd..134807e2 100644
--- a/CompanyManagment.Application/RollCallEmployeeApplication.cs
+++ b/CompanyManagment.Application/RollCallEmployeeApplication.cs
@@ -11,6 +11,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Transactions;
+using _0_Framework.Application.FaceEmbedding;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
namespace CompanyManagment.Application;
@@ -23,7 +24,9 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication
private readonly ILeftWorkRepository _leftWorkRepository;
private readonly IRollCallEmployeeStatusRepository _rollCallEmployeeStatusRepository;
private readonly IWebHostEnvironment _webHostEnvironment;
- public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ILeftWorkRepository leftWorkRepository, IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, IWebHostEnvironment webHostEnvironment)
+ private readonly IFaceEmbeddingService _faceEmbeddingService;
+
+ public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ILeftWorkRepository leftWorkRepository, IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, IWebHostEnvironment webHostEnvironment, IFaceEmbeddingService faceEmbeddingService)
{
_rollCallEmployeeRepository = rollCallEmployeeRepository;
_employeeRepository = employeeRepository;
@@ -31,6 +34,7 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication
_leftWorkRepository = leftWorkRepository;
_rollCallEmployeeStatusRepository = rollCallEmployeeStatusRepository;
_webHostEnvironment = webHostEnvironment;
+ _faceEmbeddingService = faceEmbeddingService;
}
public OperationResult Create(CreateRollCallEmployee command)
@@ -213,9 +217,18 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication
if (entity.IsActiveString != "true")
return result.Failed("امکان تغییر نام برای کارمند غیر فعال وجود ندارد");
-
+ var transaction = _rollCallEmployeeRepository.BeginTransactionAsync().GetAwaiter().GetResult();
+
entity.ChangeName(fName, lName);
_rollCallEmployeeRepository.SaveChanges();
+
+ var embeddingRes =_faceEmbeddingService
+ .UpdateEmbeddingFullNameAsync(entity.EmployeeId, entity.WorkshopId, fullName)
+ .GetAwaiter().GetResult();
+ if (!embeddingRes.IsSuccedded)
+ return result.Failed("خطا در به روز رسانی نام در سیستم تشخیص چهره: " + embeddingRes.Message);
+
+ transaction.Commit();
return result.Succcedded();
}
#endregion
diff --git a/CompanyManagment.EFCore/Mapping/InstitutionContractMapping.cs b/CompanyManagment.EFCore/Mapping/InstitutionContractMapping.cs
index e6152167..49772553 100644
--- a/CompanyManagment.EFCore/Mapping/InstitutionContractMapping.cs
+++ b/CompanyManagment.EFCore/Mapping/InstitutionContractMapping.cs
@@ -34,6 +34,10 @@ public class InstitutionContractMapping : IEntityTypeConfiguration x.VerifierPhoneNumber).HasMaxLength(20);
builder.Property(x => x.VerificationStatus).HasConversion().HasMaxLength(122);
+
+ builder.Property(x=>x.SigningType).HasConversion()
+ .HasMaxLength(25)
+ .IsRequired(false);
builder.HasMany(x => x.Installments)
.WithOne(x => x.InstitutionContract)
@@ -45,5 +49,10 @@ public class InstitutionContractMapping : IEntityTypeConfiguration x.Amendments).WithOne(x => x.InstitutionContract)
.HasForeignKey(x => x.InstitutionContractId);
+
+
+ builder.Ignore(x => x.ContractAmountWithTax);
+ builder.Ignore(x => x.ContractAmountTax);
+ builder.Ignore(x => x.ContractAmountTax);
}
}
\ No newline at end of file
diff --git a/CompanyManagment.EFCore/Migrations/20251220143403_addsigningTypeforinstitutioncontract.Designer.cs b/CompanyManagment.EFCore/Migrations/20251220143403_addsigningTypeforinstitutioncontract.Designer.cs
new file mode 100644
index 00000000..d6b59cfc
--- /dev/null
+++ b/CompanyManagment.EFCore/Migrations/20251220143403_addsigningTypeforinstitutioncontract.Designer.cs
@@ -0,0 +1,11521 @@
+//
+using System;
+using System.Collections.Generic;
+using CompanyManagment.EFCore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace CompanyManagment.EFCore.Migrations
+{
+ [DbContext(typeof(CompanyContext))]
+ [Migration("20251220143403_addsigningTypeforinstitutioncontract")]
+ partial class addsigningTypeforinstitutioncontract
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "10.0.1")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("Company.Domain.AdminMonthlyOverviewAgg.AdminMonthlyOverview", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Month")
+ .HasColumnType("int");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasMaxLength(155)
+ .HasColumnType("nvarchar(155)");
+
+ b.Property("WorkshopId")
+ .HasColumnType("bigint");
+
+ b.Property("Year")
+ .HasColumnType("int");
+
+ b.HasKey("id");
+
+ b.ToTable("AdminMonthlyOverviews");
+ });
+
+ modelBuilder.Entity("Company.Domain.AndroidApkVersionAgg.AndroidApkVersion", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("ApkType")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("nvarchar(20)");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("IsActive")
+ .IsRequired()
+ .HasMaxLength(5)
+ .HasColumnType("nvarchar(5)");
+
+ b.Property("IsForce")
+ .HasColumnType("bit");
+
+ b.Property("Path")
+ .HasMaxLength(255)
+ .HasColumnType("nvarchar(255)");
+
+ b.Property("Title")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("VersionCode")
+ .HasMaxLength(20)
+ .HasColumnType("nvarchar(20)");
+
+ b.Property("VersionName")
+ .HasMaxLength(35)
+ .HasColumnType("nvarchar(35)");
+
+ b.HasKey("id");
+
+ b.ToTable("AndroidApkVersions", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.AuthorizedBankDetailsAgg.AuthorizedBankDetails", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("AccountNumber")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BankName")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("CardNumber")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("IBan")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("id");
+
+ b.ToTable("AuthorizedBankDetails", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.AuthorizedPersonAgg.AuthorizedPerson", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("BirthDate")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("DeathStatus")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("FatherName")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("Gender")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsVerified")
+ .HasColumnType("bit");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("NationalCode")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("ShenasnameSeri")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("ShenasnameSerial")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("ShenasnamehNumber")
+ .HasMaxLength(20)
+ .HasColumnType("nvarchar(20)");
+
+ b.Property("VerificationDate")
+ .HasColumnType("datetime2");
+
+ b.HasKey("id");
+
+ b.HasIndex("NationalCode")
+ .IsUnique();
+
+ b.ToTable("AuthorizedPersons", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.BankAgg.Bank", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("BankLogoMediaId")
+ .HasColumnType("bigint");
+
+ b.Property("BankName")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("id");
+
+ b.ToTable("Banks", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.BillAgg.EntityBill", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("Appointed")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Contact")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsActiveString")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProcessingStage")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SubjectBill")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.HasKey("id");
+
+ b.ToTable("TextManager_Bill", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.Board.Board", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("BoardChairman")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("BoardType_Id")
+ .HasColumnType("int");
+
+ b.Property("Branch")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("DisputeResolutionPetitionDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ExpertReport")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("File_Id")
+ .HasColumnType("bigint");
+
+ b.HasKey("id");
+
+ b.HasIndex("BoardType_Id");
+
+ b.HasIndex("File_Id");
+
+ b.ToTable("Boards", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.BoardType.BoardType", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("Title")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("BoardTypes", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.CameraBugReportAgg.CameraBugReport", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AccountId")
+ .HasColumnType("bigint");
+
+ b.Property("AppVersion")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("BatteryLevel")
+ .HasColumnType("int");
+
+ b.Property("BuildNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DeviceId")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DeviceModel")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Flavor")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("InstallTime")
+ .HasColumnType("datetime2");
+
+ b.Property("IsCharging")
+ .HasColumnType("bit");
+
+ b.Property("LastUpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("Manufacturer")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MemoryInMB")
+ .HasColumnType("int");
+
+ b.Property("NetworkType")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OsVersion")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PackageName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Platform")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Priority")
+ .HasColumnType("int");
+
+ b.Property("ScreenResolution")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("StackTrace")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.Property("StorageInMB")
+ .HasColumnType("int");
+
+ b.Property("Title")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Type")
+ .HasColumnType("int");
+
+ b.Property("UpdateDate")
+ .HasColumnType("datetime2");
+
+ b.Property("UserEmail")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("CameraBugReports");
+ });
+
+ modelBuilder.Entity("Company.Domain.CameraBugReportAgg.CameraBugReportLog", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("CameraBugReportId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Message")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Timestamp")
+ .HasColumnType("datetime2");
+
+ b.HasKey("id");
+
+ b.HasIndex("CameraBugReportId");
+
+ b.ToTable("CameraBugReportLogs");
+ });
+
+ modelBuilder.Entity("Company.Domain.CameraBugReportAgg.CameraBugReportScreenshot", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("Base64Data")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CameraBugReportId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("FileName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UploadDate")
+ .HasColumnType("datetime2");
+
+ b.HasKey("id");
+
+ b.HasIndex("CameraBugReportId");
+
+ b.ToTable("CameraBugReportScreenshots");
+ });
+
+ modelBuilder.Entity("Company.Domain.ChapterAgg.EntityChapter", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("Chapter")
+ .IsRequired()
+ .HasMaxLength(60)
+ .HasColumnType("nvarchar(60)");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("IsActiveString")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Subtitle_Id")
+ .HasColumnType("bigint");
+
+ b.HasKey("id");
+
+ b.HasIndex("Subtitle_Id");
+
+ b.ToTable("TextManager_Chapter", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.CheckoutAgg.Checkout", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("AbsenceDeduction")
+ .HasColumnType("float");
+
+ b.Property("AbsencePeriod")
+ .HasColumnType("float");
+
+ b.Property("AbsenceValue")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("ArchiveCode")
+ .HasMaxLength(15)
+ .HasColumnType("nvarchar(15)");
+
+ b.Property("AverageHoursPerDay")
+ .HasColumnType("float");
+
+ b.Property("BaseYearsPay")
+ .HasColumnType("float");
+
+ b.Property("BonusesPay")
+ .HasColumnType("float");
+
+ b.Property("ConsumableItems")
+ .HasColumnType("float");
+
+ b.Property("ContractEnd")
+ .HasColumnType("datetime2");
+
+ b.Property("ContractId")
+ .HasColumnType("bigint");
+
+ b.Property("ContractNo")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ContractStart")
+ .HasColumnType("datetime2");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("CreditLeaves")
+ .HasColumnType("float");
+
+ b.Property("DateOfBirth")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("EmployeeFullName")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("EmployeeId")
+ .HasColumnType("bigint");
+
+ b.Property("EmployeeMandatoryHours")
+ .IsRequired()
+ .HasMaxLength(30)
+ .HasColumnType("nvarchar(30)");
+
+ b.Property("FamilyAllowance")
+ .HasColumnType("float");
+
+ b.Property("FathersName")
+ .HasMaxLength(20)
+ .HasColumnType("nvarchar(20)");
+
+ b.Property("FridayPay")
+ .HasColumnType("float");
+
+ b.Property("FridayWorkValue")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("HasAmountConflict")
+ .HasColumnType("bit");
+
+ b.Property("HasInsuranceShareTheSameAsList")
+ .HasColumnType("bit");
+
+ b.Property("HasRollCall")
+ .HasColumnType("bit");
+
+ b.Property("HousingAllowance")
+ .HasColumnType("float");
+
+ b.Property("InstallmentDeduction")
+ .HasColumnType("float");
+
+ b.Property("InsuranceDeduction")
+ .HasColumnType("float");
+
+ b.Property("IsActiveString")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("IsUpdateNeeded")
+ .HasColumnType("bit");
+
+ b.Property("LeaveCheckout")
+ .HasColumnType("bit");
+
+ b.Property("LeavePay")
+ .HasColumnType("float");
+
+ b.Property("MarriedAllowance")
+ .HasColumnType("float");
+
+ b.Property("MissionPay")
+ .HasColumnType("float");
+
+ b.Property("Month")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("MonthlySalary")
+ .HasColumnType("float");
+
+ b.Property("NationalCode")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("NightworkPay")
+ .HasColumnType("float");
+
+ b.Property("OverNightWorkValue")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("OverTimeWorkValue")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("OvertimePay")
+ .HasColumnType("float");
+
+ b.Property("PersonnelCode")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("RewardPay")
+ .HasColumnType("float");
+
+ b.Property("RotatingShiftValue")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("SalaryAidDeduction")
+ .HasColumnType("float");
+
+ b.Property("ShiftPay")
+ .HasColumnType("float");
+
+ b.Property("Signature")
+ .HasMaxLength(20)
+ .HasColumnType("nvarchar(20)");
+
+ b.Property("SumOfWorkingDays")
+ .HasMaxLength(6)
+ .HasColumnType("nvarchar(6)");
+
+ b.Property("TaxDeducation")
+ .HasColumnType("float");
+
+ b.Property("TotalClaims")
+ .HasMaxLength(25)
+ .HasColumnType("nvarchar(25)");
+
+ b.Property("TotalDayOfBunosesCompute")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("TotalDayOfLeaveCompute")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("TotalDayOfYearsCompute")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("TotalDeductions")
+ .HasMaxLength(25)
+ .HasColumnType("nvarchar(25)");
+
+ b.Property("TotalPayment")
+ .HasColumnType("float");
+
+ b.Property("WorkingHoursId")
+ .HasColumnType("bigint");
+
+ b.Property("WorkshopId")
+ .HasColumnType("bigint");
+
+ b.Property("WorkshopName")
+ .HasMaxLength(70)
+ .HasColumnType("nvarchar(70)");
+
+ b.Property("Year")
+ .HasMaxLength(4)
+ .HasColumnType("nvarchar(4)");
+
+ b.Property("YearsPay")
+ .HasColumnType("float");
+
+ b.HasKey("id");
+
+ b.HasIndex("WorkshopId");
+
+ b.ToTable("Checkouts", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.CheckoutAgg.CheckoutWarningMessage", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("CheckoutId")
+ .HasColumnType("bigint");
+
+ b.Property("TypeOfCheckoutWarning")
+ .IsRequired()
+ .HasMaxLength(30)
+ .HasColumnType("nvarchar(30)");
+
+ b.Property("WarningMessage")
+ .HasMaxLength(150)
+ .HasColumnType("nvarchar(150)");
+
+ b.HasKey("id");
+
+ b.HasIndex("CheckoutId");
+
+ b.ToTable("CheckoutWarningMessage", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.ClassifiedSalaryAgg.ClassifiedSalary", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("EndDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Group1")
+ .HasColumnType("float");
+
+ b.Property("Group10")
+ .HasColumnType("float");
+
+ b.Property("Group11")
+ .HasColumnType("float");
+
+ b.Property("Group12")
+ .HasColumnType("float");
+
+ b.Property("Group13")
+ .HasColumnType("float");
+
+ b.Property("Group14")
+ .HasColumnType("float");
+
+ b.Property("Group15")
+ .HasColumnType("float");
+
+ b.Property("Group16")
+ .HasColumnType("float");
+
+ b.Property("Group17")
+ .HasColumnType("float");
+
+ b.Property("Group18")
+ .HasColumnType("float");
+
+ b.Property