Migrate from User to Account domain concept
Renames core domain entities and services from "User" to "Account" Refactors project-wide namespaces, classes, and database tables to use "Account" terminology Updates related components, services, and database schema to reflect new domain naming Standardizes naming conventions across authentication and organization setup features
This commit is contained in:
parent
e5e7c1c19f
commit
88812177a9
29 changed files with 288 additions and 298 deletions
|
|
@ -1,4 +1,4 @@
|
|||
// PlanTempus.X.Services.cs
|
||||
// PlanTempus.X.Services.cs
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -6,11 +6,10 @@ using System.Threading.Tasks;
|
|||
namespace PlanTempus.X.Services
|
||||
{
|
||||
// Models
|
||||
public class User
|
||||
public class Account
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool EmailConfirmed { get; set; }
|
||||
public string Password { get; set; }
|
||||
public bool IsLocked { get; set; }
|
||||
|
|
@ -24,19 +23,19 @@ namespace PlanTempus.X.Services
|
|||
public string CreatedBy { get; set; }
|
||||
}
|
||||
|
||||
public class UserOrganization
|
||||
public class AccountOrganization
|
||||
{
|
||||
public string UserId { get; set; }
|
||||
public string AccountId { get; set; }
|
||||
public string OrganizationId { get; set; }
|
||||
public string Role { get; set; }
|
||||
}
|
||||
|
||||
// Service interfaces
|
||||
public interface IUserService
|
||||
public interface IAccountService
|
||||
{
|
||||
Task<User> CreateUserAsync(string email, string name);
|
||||
Task<User> GetUserByEmailAsync(string email);
|
||||
User GetUserByEmail(string email);
|
||||
Task<Account> CreateAccountAsync(string email, string password);
|
||||
Task<Account> GetAccountByEmailAsync(string email);
|
||||
Account GetAccountByEmail(string email);
|
||||
Task ConfirmEmailAsync(string confirmationToken);
|
||||
}
|
||||
|
||||
|
|
@ -48,14 +47,14 @@ namespace PlanTempus.X.Services
|
|||
|
||||
public interface IOrganizationService
|
||||
{
|
||||
Task<Organization> SetupOrganizationAsync(string userId, string orgName, string password);
|
||||
Task<Organization> CreateOrganizationAsync(string userId, string orgName);
|
||||
Task<Organization> SetupOrganizationAsync(string accountId, string orgName, string password);
|
||||
Task<Organization> CreateOrganizationAsync(string accountId, string orgName);
|
||||
}
|
||||
|
||||
public interface IUserOrganizationService
|
||||
public interface IAccountOrganizationService
|
||||
{
|
||||
UserOrganization GetUserOrganization(string userId, string organizationId);
|
||||
List<UserOrganization> GetUserOrganizations(string userId);
|
||||
AccountOrganization GetAccountOrganization(string accountId, string organizationId);
|
||||
List<AccountOrganization> GetAccountOrganizations(string accountId);
|
||||
}
|
||||
|
||||
public interface ITenantService
|
||||
|
|
@ -65,26 +64,26 @@ namespace PlanTempus.X.Services
|
|||
|
||||
public interface IAuthService
|
||||
{
|
||||
bool IsUserAuthenticated(string userId);
|
||||
bool IsAccountAuthenticated(string accountId);
|
||||
Task<bool> AttemptLoginAsync(string email, string password);
|
||||
}
|
||||
|
||||
// Service implementations
|
||||
public class UserService : IUserService
|
||||
public class AccountService : IAccountService
|
||||
{
|
||||
public async Task<User> CreateUserAsync(string email, string name)
|
||||
public async Task<Account> CreateAccountAsync(string email, string password)
|
||||
{
|
||||
throw new NotImplementedException("CreateUserAsync not implemented");
|
||||
throw new NotImplementedException("CreateAccountAsync not implemented");
|
||||
}
|
||||
|
||||
public async Task<User> GetUserByEmailAsync(string email)
|
||||
public async Task<Account> GetAccountByEmailAsync(string email)
|
||||
{
|
||||
throw new NotImplementedException("GetUserByEmailAsync not implemented");
|
||||
throw new NotImplementedException("GetAccountByEmailAsync not implemented");
|
||||
}
|
||||
|
||||
public User GetUserByEmail(string email)
|
||||
public Account GetAccountByEmail(string email)
|
||||
{
|
||||
throw new NotImplementedException("GetUserByEmail not implemented");
|
||||
throw new NotImplementedException("GetAccountByEmail not implemented");
|
||||
}
|
||||
|
||||
public async Task ConfirmEmailAsync(string confirmationToken)
|
||||
|
|
@ -108,27 +107,27 @@ namespace PlanTempus.X.Services
|
|||
|
||||
public class OrganizationService : IOrganizationService
|
||||
{
|
||||
public async Task<Organization> SetupOrganizationAsync(string userId, string orgName, string password)
|
||||
public async Task<Organization> SetupOrganizationAsync(string accountId, string orgName, string password)
|
||||
{
|
||||
throw new NotImplementedException("SetupOrganizationAsync not implemented");
|
||||
}
|
||||
|
||||
public async Task<Organization> CreateOrganizationAsync(string userId, string orgName)
|
||||
public async Task<Organization> CreateOrganizationAsync(string accountId, string orgName)
|
||||
{
|
||||
throw new NotImplementedException("CreateOrganizationAsync not implemented");
|
||||
}
|
||||
}
|
||||
|
||||
public class UserOrganizationService : IUserOrganizationService
|
||||
public class AccountOrganizationService : IAccountOrganizationService
|
||||
{
|
||||
public UserOrganization GetUserOrganization(string userId, string organizationId)
|
||||
public AccountOrganization GetAccountOrganization(string accountId, string organizationId)
|
||||
{
|
||||
throw new NotImplementedException("GetUserOrganization not implemented");
|
||||
throw new NotImplementedException("GetAccountOrganization not implemented");
|
||||
}
|
||||
|
||||
public List<UserOrganization> GetUserOrganizations(string userId)
|
||||
public List<AccountOrganization> GetAccountOrganizations(string accountId)
|
||||
{
|
||||
throw new NotImplementedException("GetUserOrganizations not implemented");
|
||||
throw new NotImplementedException("GetAccountOrganizations not implemented");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -142,9 +141,9 @@ namespace PlanTempus.X.Services
|
|||
|
||||
public class AuthService : IAuthService
|
||||
{
|
||||
public bool IsUserAuthenticated(string userId)
|
||||
public bool IsAccountAuthenticated(string accountId)
|
||||
{
|
||||
throw new NotImplementedException("IsUserAuthenticated not implemented");
|
||||
throw new NotImplementedException("IsAccountAuthenticated not implemented");
|
||||
}
|
||||
|
||||
public async Task<bool> AttemptLoginAsync(string email, string password)
|
||||
|
|
@ -152,4 +151,4 @@ namespace PlanTempus.X.Services
|
|||
throw new NotImplementedException("AttemptLoginAsync not implemented");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue