diff --git a/AccountManagement.Domain/PmDomains/PmPermissionAgg/Permission.cs b/AccountManagement.Domain/PmDomains/PmPermissionAgg/Permission.cs
new file mode 100644
index 00000000..7be4d5d0
--- /dev/null
+++ b/AccountManagement.Domain/PmDomains/PmPermissionAgg/Permission.cs
@@ -0,0 +1,20 @@
+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 Permission
+{
+ public long Id { get; private set; }
+ public int Code { get; private set; }
+ public Role Role { get; private set; }
+
+ public Permission(int code)
+ {
+ Code = code;
+ }
+}
\ No newline at end of file
diff --git a/AccountManagement.Domain/PmDomains/PmRoleAgg/Role.cs b/AccountManagement.Domain/PmDomains/PmRoleAgg/Role.cs
new file mode 100644
index 00000000..698d271b
--- /dev/null
+++ b/AccountManagement.Domain/PmDomains/PmRoleAgg/Role.cs
@@ -0,0 +1,46 @@
+using System.Collections.Generic;
+using _0_Framework.Domain;
+using AccountManagement.Domain.PmDomains.PmPermissionAgg;
+
+namespace AccountManagement.Domain.PmDomains.PmRoleAgg;
+
+public class Role : EntityBase
+{
+ ///
+ /// نام نقش
+ ///
+ public string RoleName { get; private set; }
+
+
+ ///
+ /// لیست پرمیشن کد ها
+ ///
+ public List Permissions { get; private set; }
+
+ ///
+ /// ای دی نقش در گزارشگیر
+ ///
+ public long? GozareshgirRoleId { get; private set; }
+
+
+ protected Role()
+ {
+ }
+
+ public Role(string roleName,long? gozareshgirRolId, List permissions)
+ {
+ RoleName = roleName;
+ Permissions = permissions;
+ GozareshgirRoleId = gozareshgirRolId;
+
+ }
+
+
+ public void Edit(string roleName, List permissions)
+ {
+ RoleName = roleName;
+ Permissions = permissions;
+ }
+
+
+}
\ No newline at end of file
diff --git a/AccountManagement.Domain/PmDomains/PmRoleUserAgg/RoleUser.cs b/AccountManagement.Domain/PmDomains/PmRoleUserAgg/RoleUser.cs
new file mode 100644
index 00000000..335ee877
--- /dev/null
+++ b/AccountManagement.Domain/PmDomains/PmRoleUserAgg/RoleUser.cs
@@ -0,0 +1,19 @@
+using AccountManagement.Domain.PmDomains.PmUserAgg;
+
+namespace AccountManagement.Domain.PmDomains.PmRoleUserAgg;
+
+public class RoleUser
+{
+ public RoleUser(long roleId)
+ {
+ RoleId = roleId;
+ }
+
+ public long Id { get; private set; }
+ public long RoleId { get; private set; }
+
+
+ public User User { get; set; }
+
+
+}
\ No newline at end of file
diff --git a/AccountManagement.Domain/PmDomains/PmUserAgg/User.cs b/AccountManagement.Domain/PmDomains/PmUserAgg/User.cs
new file mode 100644
index 00000000..876d2bb4
--- /dev/null
+++ b/AccountManagement.Domain/PmDomains/PmUserAgg/User.cs
@@ -0,0 +1,127 @@
+using System;
+using System.Collections.Generic;
+using _0_Framework.Domain;
+using AccountManagement.Domain.PmDomains.PmRoleUserAgg;
+
+
+namespace AccountManagement.Domain.PmDomains.PmUserAgg;
+
+///
+/// کاربر
+///
+public class User : EntityBase
+{
+ ///
+ /// ایجاد
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public User(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 User()
+ {
+
+ }
+ ///
+ /// نام و نام خانوادگی
+ ///
+ 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/CompanyManagment.EFCore/Mapping/PmMappings/RoleMapping.cs b/CompanyManagment.EFCore/Mapping/PmMappings/RoleMapping.cs
new file mode 100644
index 00000000..8d6292d6
--- /dev/null
+++ b/CompanyManagment.EFCore/Mapping/PmMappings/RoleMapping.cs
@@ -0,0 +1,23 @@
+using AccountManagement.Domain.PmDomains.PmRoleAgg;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+
+namespace CompanyManagment.EFCore.Mapping.PmMappings;
+
+public class RoleMapping : IEntityTypeConfiguration
+{
+ public void Configure(EntityTypeBuilder builder)
+ {
+ builder.ToTable("Roles");
+ builder.HasKey(x => x.id);
+
+ builder.Property(x => x.RoleName).HasMaxLength(100).IsRequired();
+
+ builder.OwnsMany(x => x.Permissions, navigationBuilder =>
+ {
+ navigationBuilder.HasKey(x => x.Id);
+ navigationBuilder.ToTable("RolePermissions");
+ navigationBuilder.WithOwner(x => x.Role);
+ });
+ }
+}
\ No newline at end of file
diff --git a/CompanyManagment.EFCore/Mapping/PmMappings/UserMapping.cs b/CompanyManagment.EFCore/Mapping/PmMappings/UserMapping.cs
new file mode 100644
index 00000000..39ca99ac
--- /dev/null
+++ b/CompanyManagment.EFCore/Mapping/PmMappings/UserMapping.cs
@@ -0,0 +1,34 @@
+using GozareshgirProgramManager.Domain.UserAgg.Entities;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+
+namespace GozareshgirProgramManager.Infrastructure.Persistence.Mappings;
+
+public class UserMapping :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);
+ });
+
+ builder.HasMany(x=>x.RefreshTokens)
+ .WithOne(x=>x.User)
+ .HasForeignKey(x=>x.UserId)
+ .OnDelete(DeleteBehavior.Cascade);
+
+ }
+}
\ No newline at end of file
diff --git a/CompanyManagment.EFCore/PmDbContext.cs b/CompanyManagment.EFCore/PmDbContext.cs
new file mode 100644
index 00000000..e2890873
--- /dev/null
+++ b/CompanyManagment.EFCore/PmDbContext.cs
@@ -0,0 +1,30 @@
+
+using Microsoft.EntityFrameworkCore;
+using System;
+using AccountManagement.Domain.PmDomains.PmRoleAgg;
+using AccountManagement.Domain.PmDomains.PmUserAgg;
+
+namespace CompanyManagment.EFCore;
+
+public class PmDbContext : DbContext
+{
+ public PmDbContext(DbContextOptions options) : base(options)
+ {
+
+ }
+ public DbSet Users { get; set; } = null!;
+ public DbSet Roles { get; set; } = null!;
+
+
+ public PmDbContext()
+ {
+
+ }
+
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ modelBuilder.ApplyConfigurationsFromAssembly(typeof(PmDbContext).Assembly);
+ base.OnModelCreating(modelBuilder);
+ }
+}
\ No newline at end of file
diff --git a/PersonalContractingParty.Config/PmDbBootstrapper.cs b/PersonalContractingParty.Config/PmDbBootstrapper.cs
new file mode 100644
index 00000000..8d0b130d
--- /dev/null
+++ b/PersonalContractingParty.Config/PmDbBootstrapper.cs
@@ -0,0 +1,18 @@
+using Company.Domain.InsuranceJobItemAgg;
+using Company.Domain.InsurancJobAgg;
+using CompanyManagment.App.Contracts.InsuranceJob;
+using CompanyManagment.Application;
+using CompanyManagment.EFCore;
+using CompanyManagment.EFCore.Repository;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace PersonalContractingParty.Config;
+
+public class PmDbBootstrapper
+{
+ public static void Configure(IServiceCollection services, string connectionString)
+ {
+
+ services.AddDbContext(x => x.UseSqlServer(connectionString));
+ }
+}
\ No newline at end of file
diff --git a/ServiceHost/Program.cs b/ServiceHost/Program.cs
index 6cacd00d..ac6074e2 100644
--- a/ServiceHost/Program.cs
+++ b/ServiceHost/Program.cs
@@ -53,6 +53,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");
#region MongoDb
@@ -68,6 +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);
diff --git a/ServiceHost/appsettings.Development.json b/ServiceHost/appsettings.Development.json
index b979657f..786c04ab 100644
--- a/ServiceHost/appsettings.Development.json
+++ b/ServiceHost/appsettings.Development.json
@@ -16,15 +16,17 @@
//local
"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",
-
+
//server
//"MesbahDb": "Data Source=185.208.175.186;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;",
//dad-mehr
//"MesbahDb": "Data Source=.;Initial Catalog=teamWork;Integrated Security=True;TrustServerCertificate=true;",
- "TestDb": "Data Source=.;Initial Catalog=TestDb;Integrated Security=True;TrustServerCertificate=true;"
+ "TestDb": "Data Source=.;Initial Catalog=TestDb;Integrated Security=True;TrustServerCertificate=true;",
+
+ "ProgramManagerDb": "Server=.;Database=program_manager_db;Integrated Security=True;TrustServerCertificate=True;"
//mahan Docker
//"MesbahDb": "Data Source=localhost,5069;Initial Catalog=mesbah_db;User ID=sa;Password=YourPassword123;TrustServerCertificate=True;"
},