Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ntruchsess committed Oct 7, 2024
1 parent b716c66 commit 49a2b0b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/********************************************************************************
* Copyright (c) 2022 BMW Group AG
* Copyright (c) 2022 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

using Microsoft.EntityFrameworkCore;
using Org.Eclipse.TractusX.Portal.Backend.Framework.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models.Configuration;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
Expand Down Expand Up @@ -71,16 +70,16 @@ public void RemoveTechnicalUserProfilesForOffer(Guid offerId)

/// <inheritdoc />
public Task<(bool IsUserOfProvidingCompany, IEnumerable<TechnicalUserProfileInformationTransferData> Information)> GetTechnicalUserProfileInformation(Guid offerId, Guid usersCompanyId, OfferTypeId offerTypeId, IEnumerable<Guid> externalUserRoles) =>
_context.Offers
.Where(x => x.Id == offerId && x.OfferTypeId == offerTypeId)
.Select(x => new ValueTuple<bool, IEnumerable<TechnicalUserProfileInformationTransferData>>(
x.ProviderCompanyId == usersCompanyId,
x.TechnicalUserProfiles.Select(tup => new TechnicalUserProfileInformationTransferData(
tup.Id,
tup.TechnicalUserProfileAssignedUserRoles
.Select(ur => new UserRoleInformationTransferData(
ur.UserRole!.Id,
ur.UserRole.UserRoleText,
externalUserRoles.Contains(ur.UserRoleId)))))))
.SingleOrDefaultAsync();
_context.Offers
.Where(x => x.Id == offerId && x.OfferTypeId == offerTypeId)
.Select(x => new ValueTuple<bool, IEnumerable<TechnicalUserProfileInformationTransferData>>(
x.ProviderCompanyId == usersCompanyId,
x.TechnicalUserProfiles.Select(tup => new TechnicalUserProfileInformationTransferData(
tup.Id,
tup.TechnicalUserProfileAssignedUserRoles
.Select(ur => new UserRoleInformationTransferData(
ur.UserRole!.Id,
ur.UserRole.UserRoleText,
externalUserRoles.Contains(ur.UserRoleId)))))))
.SingleOrDefaultAsync();
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
********************************************************************************/

using Microsoft.EntityFrameworkCore;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models.Configuration;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Tests.Setup;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities;
Expand Down

0 comments on commit 49a2b0b

Please sign in to comment.