Added MCp support
This commit is contained in:
@@ -4,6 +4,7 @@ using PostFundManagement.Domain.Errors;
|
||||
using PostFundManagement.Domain.Extensions;
|
||||
using PostFundManagement.Domain.Models;
|
||||
using PostFundManagement.Infrastructure.Database;
|
||||
using Result = FluentResults.Result;
|
||||
|
||||
namespace PostFundManagement.Application.Services.Shared;
|
||||
|
||||
@@ -22,6 +23,7 @@ public sealed class AuditService(IDbContextFactory<ApplicationDbContext> context
|
||||
if (!tenantContextService.IsAdmin)
|
||||
{
|
||||
var currentTenantId = tenantContextService.TenantId > 0 ? tenantContextService.TenantId : 1L;
|
||||
|
||||
query = query.Where(o => o.TenantId == currentTenantId);
|
||||
}
|
||||
|
||||
@@ -34,15 +36,7 @@ public sealed class AuditService(IDbContextFactory<ApplicationDbContext> context
|
||||
return Result.Ok(logs.Select(p => p.Map()).ToArray());
|
||||
}));
|
||||
|
||||
public async Task<Result> LogActionAsync(
|
||||
string entityId,
|
||||
string entityName,
|
||||
string action,
|
||||
string[] changes,
|
||||
Guid performedBy,
|
||||
string? error = null,
|
||||
long? tenantId = null,
|
||||
CancellationToken cancellationToken = default) =>
|
||||
public async Task<Result> LogActionAsync(string entityId, string entityName, string action, string[] changes, Guid performedBy, string? error = null, long? tenantId = null, CancellationToken cancellationToken = default) =>
|
||||
await Result.Try((Func<Task<Result>>)(async () =>
|
||||
{
|
||||
await using var context = await contextFactory.CreateDbContextAsync(cancellationToken);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using PostFundManagement.Domain.Errors;
|
||||
using Result = FluentResults.Result;
|
||||
|
||||
namespace PostFundManagement.Application.Services.Shared;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ using PostFundManagement.Domain;
|
||||
using PostFundManagement.Domain.Configuration.Email;
|
||||
using PostFundManagement.Domain.Extensions;
|
||||
using PostFundManagement.Domain.Models.Email;
|
||||
using Result = FluentResults.Result;
|
||||
|
||||
namespace PostFundManagement.Application.Services.Shared;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using PostFundManagement.Domain.Abstractions;
|
||||
using PostFundManagement.Domain.Errors;
|
||||
using PostFundManagement.Application.Extensions;
|
||||
using Result = FluentResults.Result;
|
||||
|
||||
namespace PostFundManagement.Application.Services.Shared;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using PostFundManagement.Application.Abstractions.Services;
|
||||
using Result = FluentResults.Result;
|
||||
|
||||
namespace PostFundManagement.Application.Services.Shared;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using PostFundManagement.Domain;
|
||||
using PostFundManagement.Domain.Errors;
|
||||
using PostFundManagement.Infrastructure.Database;
|
||||
using Result = FluentResults.Result;
|
||||
|
||||
namespace PostFundManagement.Application.Services.Shared;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ using PostFundManagement.Domain.Configuration.Security;
|
||||
using PostFundManagement.Domain.Errors;
|
||||
using PostFundManagement.Domain.Models.Security;
|
||||
using PostFundManagement.Infrastructure.Security;
|
||||
using Result = FluentResults.Result;
|
||||
|
||||
namespace PostFundManagement.Application.Services.Shared;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user