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..6cb88864 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,6 @@ public interface IAccountApplication
void CameraLogin(CameraLoginRequest request);
- ///
- /// دریافت کاربر پروگرام منیجر با اکانت آی دی
- ///
- ///
- ///
- Task GetPmUserByAccountId(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..2b111195 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;
@@ -1015,8 +999,5 @@ public class AccountApplication : IAccountApplication
_authHelper.CameraSignIn(authViewModel);
}
- public async Task GetPmUserByAccountId(long accountId)
- {
- return await _pmUserRepository.GetPmUserByAccountId(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/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs b/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs
index e4597d4f..88899470 100644
--- a/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs
+++ b/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs
@@ -121,7 +121,7 @@ public class IndexModel : PageModel
//);
- var result = _accountApplication.GetPmUserByAccountId(account.Id).GetAwaiter().GetResult();
+ var result = _accountApplication.getu(account.Id).GetAwaiter().GetResult();
// مثل قبل:
diff --git a/ServiceHost/Program.cs b/ServiceHost/Program.cs
index 4378ec2c..42b1b3bd 100644
--- a/ServiceHost/Program.cs
+++ b/ServiceHost/Program.cs
@@ -48,7 +48,7 @@ builder.Services.AddHttpContextAccessor();
builder.Services.AddHttpClient("holidayApi", c => c.BaseAddress = new System.Uri("https://api.github.com"));
var connectionString = builder.Configuration.GetConnectionString("MesbahDb");
var connectionStringTestDb = builder.Configuration.GetConnectionString("TestDb");
-var connectionStringProgramManager = builder.Configuration.GetConnectionString("ProgramManagerDb");
+
builder.Services.AddProgramManagerApplication();
@@ -69,7 +69,7 @@ builder.Services.AddSingleton(mongoDatabase);
builder.Services.AddSingleton, CustomJsonResultExecutor>();
PersonalBootstrapper.Configure(builder.Services, connectionString);
TestDbBootStrapper.Configure(builder.Services, connectionStringTestDb);
-PmDbBootstrapper.Configure(builder.Services, connectionStringProgramManager);
+
AccountManagementBootstrapper.Configure(builder.Services, connectionString);
WorkFlowBootstrapper.Configure(builder.Services, connectionString);
QueryBootstrapper.Configure(builder.Services);