Commit cb51e1b6 authored by hasan khaddour's avatar hasan khaddour

Add identity Domain

parent 2fddc523
using PSManagement.SharedKernel.Aggregate;
using PSManagement.SharedKernel.Entities;
using System;
namespace PSManagement.Domain.Identity.Aggregate
{
public class User : IAggregateRoot
{
public string Email { get; set; }
public string LastName { get; set; }
public string FirstName { get; set; }
public string HashedPassword { get; set; }
}
}
\ No newline at end of file
using FluentResults;
using PSManagement.SharedKernel.DomainErrors;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSManagement.Domain.Identity.DomainErrors
{
public class AlreadyExistError : IDomainError
{
public List<IError> Reasons => new(new[] { new Error("The User Email Already Exist.") });
public string Message => "The Email Is Already Exist.";
public Dictionary<string, object> Metadata => new();
}
}
using FluentResults;
using PSManagement.SharedKernel.DomainErrors;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSManagement.Domain.Identity.DomainErrors
{
public class InvalidLoginDataError : IDomainError
{
public List<IError> Reasons => new(new[] { new Error("The User Email Or Password Wrong.") });
public string Message => "Invalid Login Attempt.";
public Dictionary<string, object> Metadata => new();
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSManagement.Domain.Identity.DomainEvents
{
public class UserCreatedEvent
{
}
}
using PSManagement.Domain.Identity.Aggregate;
using PSManagement.SharedKernel.Interfaces;
using PSManagement.SharedKernel.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSManagement.Domain.Identity.Repositories
{
public interface IUsersRepository : IRepository<User>
{
public Task<User> GetByEmail(string email, ISpecification<User> specification = null);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment