website refactor
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { IEntity } from '@core/shared/domain';
|
||||
import type { Entity } from '@core/shared/domain';
|
||||
import { UserId } from '../value-objects/UserId';
|
||||
import { Email } from '../value-objects/Email';
|
||||
import { UserRole } from '../value-objects/UserRole';
|
||||
@@ -17,7 +17,7 @@ export interface AdminUserProps {
|
||||
primaryDriverId: string | undefined;
|
||||
}
|
||||
|
||||
export class AdminUser implements IEntity<UserId> {
|
||||
export class AdminUser implements Entity<UserId> {
|
||||
readonly id: UserId;
|
||||
private _email: Email;
|
||||
private _roles: UserRole[];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { IDomainError, CommonDomainErrorKind } from '@core/shared/errors';
|
||||
import type { DomainError, CommonDomainErrorKind } from '@core/shared/errors';
|
||||
|
||||
export abstract class AdminDomainError extends Error implements IDomainError<CommonDomainErrorKind> {
|
||||
export abstract class AdminDomainError extends Error implements DomainError<CommonDomainErrorKind> {
|
||||
readonly type = 'domain' as const;
|
||||
readonly context = 'admin-domain';
|
||||
abstract readonly kind: CommonDomainErrorKind;
|
||||
@@ -13,7 +13,7 @@ export abstract class AdminDomainError extends Error implements IDomainError<Com
|
||||
|
||||
export class AdminDomainValidationError
|
||||
extends AdminDomainError
|
||||
implements IDomainError<'validation'>
|
||||
implements DomainError<'validation'>
|
||||
{
|
||||
readonly kind = 'validation' as const;
|
||||
|
||||
@@ -24,7 +24,7 @@ export class AdminDomainValidationError
|
||||
|
||||
export class AdminDomainInvariantError
|
||||
extends AdminDomainError
|
||||
implements IDomainError<'invariant'>
|
||||
implements DomainError<'invariant'>
|
||||
{
|
||||
readonly kind = 'invariant' as const;
|
||||
|
||||
@@ -35,7 +35,7 @@ export class AdminDomainInvariantError
|
||||
|
||||
export class AuthorizationError
|
||||
extends AdminDomainError
|
||||
implements IDomainError<'authorization'>
|
||||
implements DomainError<'authorization'>
|
||||
{
|
||||
readonly kind = 'authorization' as const;
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ export interface StoredAdminUser {
|
||||
* Repository interface for AdminUser entity
|
||||
* Follows clean architecture - this is an output port from application layer
|
||||
*/
|
||||
export interface IAdminUserRepository {
|
||||
export interface AdminUserRepository {
|
||||
/**
|
||||
* Find user by ID
|
||||
*/
|
||||
@@ -1,11 +1,11 @@
|
||||
import { IValueObject } from '@core/shared/domain';
|
||||
import { ValueObject } from '@core/shared/domain';
|
||||
import { AdminDomainValidationError } from '../errors/AdminDomainError';
|
||||
|
||||
export interface EmailProps {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export class Email implements IValueObject<EmailProps> {
|
||||
export class Email implements ValueObject<EmailProps> {
|
||||
readonly value: string;
|
||||
|
||||
private constructor(value: string) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { IValueObject } from '@core/shared/domain';
|
||||
import { ValueObject } from '@core/shared/domain';
|
||||
import { AdminDomainValidationError } from '../errors/AdminDomainError';
|
||||
|
||||
export interface UserIdProps {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export class UserId implements IValueObject<UserIdProps> {
|
||||
export class UserId implements ValueObject<UserIdProps> {
|
||||
readonly value: string;
|
||||
|
||||
private constructor(value: string) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IValueObject } from '@core/shared/domain';
|
||||
import { ValueObject } from '@core/shared/domain';
|
||||
import { AdminDomainValidationError } from '../errors/AdminDomainError';
|
||||
|
||||
export type UserRoleValue = string;
|
||||
@@ -7,7 +7,7 @@ export interface UserRoleProps {
|
||||
value: UserRoleValue;
|
||||
}
|
||||
|
||||
export class UserRole implements IValueObject<UserRoleProps> {
|
||||
export class UserRole implements ValueObject<UserRoleProps> {
|
||||
readonly value: UserRoleValue;
|
||||
|
||||
private constructor(value: UserRoleValue) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IValueObject } from '@core/shared/domain';
|
||||
import { ValueObject } from '@core/shared/domain';
|
||||
import { AdminDomainValidationError } from '../errors/AdminDomainError';
|
||||
|
||||
export type UserStatusValue = string;
|
||||
@@ -7,7 +7,7 @@ export interface UserStatusProps {
|
||||
value: UserStatusValue;
|
||||
}
|
||||
|
||||
export class UserStatus implements IValueObject<UserStatusProps> {
|
||||
export class UserStatus implements ValueObject<UserStatusProps> {
|
||||
readonly value: UserStatusValue;
|
||||
|
||||
private constructor(value: UserStatusValue) {
|
||||
|
||||
Reference in New Issue
Block a user