Skip to content

Commit

Permalink
Rename the service using the table name
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed-Ghanam committed Oct 7, 2024
1 parent 6903998 commit 2d755a4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static void AddRegisterService(this IServiceCollection services, IConfigu

services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());

services.AddScoped<IRegisterService, RegisterService>();
services.AddScoped<IPersonService, PersonService>();
services.AddScoped<IPersonRepository, PersonRepository>();

services.AddSingleton<INationalIdentityNumberChecker, NationalIdentityNumberChecker>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Altinn.Profile.Integrations.Services;
/// <summary>
/// Defines a service for handling operations related to user contact information.
/// </summary>
public interface IRegisterService
public interface IPersonService
{
/// <summary>
/// Asynchronously retrieves the contact information for a user based on their national identity number.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ namespace Altinn.Profile.Integrations.Services;
/// <summary>
/// Service for handling operations related to user registration and contact points.
/// </summary>
public class RegisterService : IRegisterService
public class PersonService : IPersonService
{
private readonly IMapper _mapper;
private readonly IPersonRepository _registerRepository;
private readonly INationalIdentityNumberChecker _nationalIdentityNumberChecker;

/// <summary>
/// Initializes a new instance of the <see cref="RegisterService"/> class.
/// Initializes a new instance of the <see cref="PersonService"/> class.
/// </summary>
/// <param name="mapper">The mapper used for object mapping.</param>
/// <param name="registerRepository">The repository used for accessing register data.</param>
/// <param name="nationalIdentityNumberChecker">The service used for checking the validity of national identity numbers.</param>
/// <exception cref="ArgumentNullException">Thrown if <paramref name="mapper"/>, <paramref name="registerRepository"/>, or <paramref name="nationalIdentityNumberChecker"/> is <c>null</c>.</exception>
public RegisterService(IMapper mapper, IPersonRepository registerRepository, INationalIdentityNumberChecker nationalIdentityNumberChecker)
public PersonService(IMapper mapper, IPersonRepository registerRepository, INationalIdentityNumberChecker nationalIdentityNumberChecker)
{
_mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
_registerRepository = registerRepository ?? throw new ArgumentNullException(nameof(registerRepository));
Expand Down
4 changes: 2 additions & 2 deletions src/Altinn.Profile/UseCases/UserContactDetailsRetriever.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ namespace Altinn.Profile.UseCases;
/// </summary>
public class UserContactDetailsRetriever : IUserContactDetailsRetriever
{
private readonly IRegisterService _registerService;
private readonly IPersonService _registerService;

/// <summary>
/// Initializes a new instance of the <see cref="UserContactDetailsRetriever"/> class.
/// </summary>
/// <param name="registerService">The register service for retrieving user contact details.</param>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="registerService"/> is null.</exception>
public UserContactDetailsRetriever(IRegisterService registerService)
public UserContactDetailsRetriever(IPersonService registerService)
{
_registerService = registerService ?? throw new ArgumentNullException(nameof(registerService));
}
Expand Down

0 comments on commit 2d755a4

Please sign in to comment.