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,6 +1,6 @@
|
|||
using Autofac;
|
||||
using Insight.Database;
|
||||
using PlanTempus.Components.Users.Exceptions;
|
||||
using PlanTempus.Components.Accounts.Exceptions;
|
||||
using PlanTempus.Core.Database;
|
||||
using PlanTempus.Core.Database.ConnectionFactory;
|
||||
using Shouldly;
|
||||
|
|
@ -63,12 +63,12 @@ public class PostgresTests : TestFixture
|
|||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task TestForUniqueUserEmail()
|
||||
public async Task TestForUniqueAccountEmail()
|
||||
{
|
||||
using var db = _databaseOperations.CreateScope(nameof(TestForUniqueUserEmail));
|
||||
using var db = _databaseOperations.CreateScope(nameof(TestForUniqueAccountEmail));
|
||||
try
|
||||
{
|
||||
var sql = @"INSERT INTO system.users(email, password_hash, security_stamp, email_confirmed, access_failed_count, lockout_enabled, is_active)
|
||||
var sql = @"INSERT INTO system.accounts(email, password_hash, security_stamp, email_confirmed, access_failed_count, lockout_enabled, is_active)
|
||||
VALUES(@Email, @PasswordHash, @SecurityStamp, @EmailConfirmed, @AccessFailedCount, @LockoutEnabled, @IsActive)
|
||||
RETURNING id, created_at, email, is_active";
|
||||
|
||||
|
|
@ -83,18 +83,18 @@ public class PostgresTests : TestFixture
|
|||
IsActive = true
|
||||
};
|
||||
|
||||
var user = await db.Connection.QuerySqlAsync<dynamic>(sql, parameters);
|
||||
var account = await db.Connection.QuerySqlAsync<dynamic>(sql, parameters);
|
||||
|
||||
//EmailAlreadyRegistreredException
|
||||
//try insert, to test exception
|
||||
var ex = await Should.ThrowAsync<Npgsql.PostgresException>(async () =>
|
||||
await db.Connection.QuerySqlAsync<dynamic>(sql, parameters));
|
||||
ex.ConstraintName.ShouldBe("users_email_key");
|
||||
}
|
||||
ex.ConstraintName.ShouldBe("accounts_email_key");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
db.Error(ex);
|
||||
|
||||
{
|
||||
db.Error(ex);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue