Moved and renamed Db/Entity services for better organization.

This commit is contained in:
2026-08-30 20:20:03 +02:00
parent 4f22cd4541
commit b08aaf2d7b
13 changed files with 27 additions and 24 deletions
@@ -1,9 +1,10 @@
@using Somnia.GuestLog.Models.DTOs;
@using Somnia.GuestLog.Services
@using Somnia.GuestLog.Services.Entity
@inject ILogger<AddressQueryDialog> logger;
@inject IUserMessageService userMessage
@inject IGuestDocumentService guestDocumentService;
@inject IGuestDocumentEntityService guestDocumentService;
<MudDialog Style="max-height: 90%;">
@@ -7,8 +7,8 @@
@inject IUserMessageService userMessage
@inject IDialogService DialogService
@inject NavigationManager Navigation
@inject IGuestDocumentService guestDocService
@inject IStayEntryService stayService
@inject IGuestDocumentEntityService guestDocService
@inject IStayEntryEntityService stayService
<PageTitle>Somnia - Guest Docs - Details</PageTitle>
@@ -3,7 +3,7 @@
@using Somnia.GuestLog.Models.DTOs;
@using Somnia.GuestLog.Services;
@inject IGuestDocumentService GuestDocService
@inject IGuestDocumentEntityService GuestDocService
@inject NavigationManager Navigation
@inject IUserMessageService userMessage
@inject IDialogService DialogService
@@ -7,7 +7,7 @@
@inject IUserMessageService userMessage
@inject IDialogService DialogService
@inject NavigationManager Navigation
@inject IGuestDocumentService guestDocService
@inject IGuestDocumentEntityService guestDocService
@inject IDataListService dataListService;
@inject FluentValidation.IValidator<GuestDocIdDTO> docIdValidator;
@@ -6,8 +6,8 @@
@inject IUserMessageService userMessage
@inject IDialogService DialogService
@inject NavigationManager Navigation
@inject IGuestDocumentService guestDocService
@inject IStayEntryService stayService
@inject IGuestDocumentEntityService guestDocService
@inject IStayEntryEntityService stayService
<PageTitle>Somnia - Guest Docs - Details</PageTitle>
@@ -3,7 +3,7 @@
@using Somnia.GuestLog.Models.DTOs;
@using Somnia.GuestLog.Services;
@inject IStayEntryService StayEntryService
@inject IStayEntryEntityService StayEntryService
@inject NavigationManager Navigation
@inject IUserMessageService userMessage
@inject IDialogService DialogService
@@ -7,7 +7,7 @@
@inject IUserMessageService userMessage
@inject IDialogService DialogService
@inject NavigationManager Navigation
@inject IStayEntryService stayService
@inject IStayEntryEntityService stayService
@inject IDataListService dataListService;
<PageTitle>Somnia - Stay Entries - New</PageTitle>
@@ -1 +1,2 @@
@using Somnia.GuestLog.Components.Controls
@using Somnia.GuestLog.Services.Entity;
+3 -2
View File
@@ -9,6 +9,7 @@ using Somnia.GuestLog.Models.Configuration;
using Somnia.GuestLog.Models.DTOs;
using Somnia.GuestLog.Services;
using Somnia.GuestLog.Services.AddressQuery;
using Somnia.GuestLog.Services.Entity;
using Somnia.GuestLog.Utils;
using Somnia.GuestLog.Validators;
@@ -55,8 +56,8 @@ builder.Services.AddSingleton<IValidator<GuestDocIdDTO>, GuestDocIdDTOValidator>
builder.Services.AddSingleton<IValidator<StayEntryDTO>, StayEntryDTOValidator>();
// Add Services
builder.Services.AddSingleton<IGuestDocumentService, GuestDocumentService>();
builder.Services.AddSingleton<IStayEntryService, StayEntryService>();
builder.Services.AddSingleton<IGuestDocumentEntityService, GuestDocumentEntityService>();
builder.Services.AddSingleton<IStayEntryEntityService, StayEntryEntityService>();
builder.Services.AddSingleton<IDataListService, StaticDataListService>();
builder.Services.AddScoped<IUserMessageService, UserMessageService>();
@@ -7,13 +7,13 @@ using Somnia.GuestLog.Models.DTOs;
using Somnia.GuestLog.Models.Entities;
using Somnia.GuestLog.Utils;
namespace Somnia.GuestLog.Services;
namespace Somnia.GuestLog.Services.Entity;
public class GuestDocumentService(
ILogger<GuestDocumentService> logger,
public class GuestDocumentEntityService(
ILogger<GuestDocumentEntityService> logger,
IDbContextFactory<GuestLogContext> contextFactory,
IValidator<GuestDocumentDTO> dtoValidator
) : IGuestDocumentService
) : IGuestDocumentEntityService
{
public async Task<Result> CreateDocumentAsync(GuestDocumentDTO dto)
{
@@ -1,8 +1,8 @@
using Somnia.GuestLog.Models.DTOs;
namespace Somnia.GuestLog.Services;
namespace Somnia.GuestLog.Services.Entity;
public interface IGuestDocumentService
public interface IGuestDocumentEntityService
{
public Task<Result> CreateDocumentAsync(GuestDocumentDTO dto);
public Task<Result> UpdateDocumentAsync(GuestDocumentDTO dto);
@@ -1,9 +1,9 @@
using Somnia.GuestLog.Models.DTOs;
using Somnia.GuestLog.Models.QueryConfigs;
namespace Somnia.GuestLog.Services;
namespace Somnia.GuestLog.Services.Entity;
public interface IStayEntryService
public interface IStayEntryEntityService
{
public Task<Result> CreateEntryAsync(StayEntryDTO dto);
public Task<Result> UpdateEntryAsync(StayEntryDTO updatedDto);
@@ -8,13 +8,13 @@ using Somnia.GuestLog.Models.Entities;
using Somnia.GuestLog.Models.QueryConfigs;
using Somnia.GuestLog.Utils;
namespace Somnia.GuestLog.Services;
namespace Somnia.GuestLog.Services.Entity;
public class StayEntryService(
ILogger<StayEntryService> logger,
public class StayEntryEntityService(
ILogger<StayEntryEntityService> logger,
IDbContextFactory<GuestLogContext> contextFactory,
IValidator<StayEntryDTO> dtoValidator
) : IStayEntryService
) : IStayEntryEntityService
{
public async Task<Result> CreateEntryAsync(StayEntryDTO dto)
{