Create Organisation Fix

This commit is contained in:
2026-10-20 12:47:06 +02:00
parent 28a821ae91
commit d7a168c9fa
17 changed files with 527 additions and 155 deletions
@@ -208,9 +208,9 @@ public sealed class GovernanceService(IDbContextFactory<ApplicationDbContext> co
linkedUser!.IdNumber = request.IdNumber.Clean();
}
var userUpdated = await context.SaveChangesAsync(cancellationToken) > 0;
await context.SaveChangesAsync(cancellationToken);
return Result.OkIf(changedTotal > 0 && updateResult.IsSuccess && userUpdated, UpdateError.Create("Failed to update organisation"));
return Result.OkIf(changedTotal > 0 && updateResult.IsSuccess, UpdateError.Create("Failed to update organisation"));
}));
public async Task<Result> CreatePortfolioAsync(CreatePortfolioRequest request, Guid userId, CancellationToken cancellationToken = default) =>
@@ -1,4 +1,4 @@
using PostFundManagement.Domain;
using PostFundManagement.Domain;
namespace PostFundManagement.Application.Services.Governance;
@@ -37,7 +37,7 @@ public sealed record UpdateOrganisationRequest([Required] long OrganisationId,
[Required][MaxLength(LabelLength)] string Name,
[Required][MaxLength(LabelLength)] string RegistrationNo,
[Required][EmailAddress][MaxLength(LabelLength)] string Email,
[Required][MaxLength(LabelLength)] string IdNumber,
[MaxLength(LabelLength)] string? IdNumber,
[Required] Guid OrganisationUser,
[Required] OrganisationType Type,
[Required] ActivityStatus Status);
@@ -45,7 +45,7 @@ public sealed record UpdateOrganisationRequest([Required] long OrganisationId,
public sealed record CreateOrganisationRequest([Required][MaxLength(LabelLength)] string Name,
[Required][MaxLength(LabelLength)] string RegistrationNo,
[Required][EmailAddress][MaxLength(LabelLength)] string Email,
[Required][MaxLength(LabelLength)] string IdNumber,
[MaxLength(LabelLength)] string? IdNumber,
[Required] Guid OrganisationUser,
[Required] OrganisationType Type = OrganisationType.PrivateLimitedCompany);