Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get system register dto fix not visible #939

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

simen-rekkedal
Copy link
Contributor

Description

Related Issue(s)

  • #{issue number}

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

Copy link

sonarcloud bot commented Dec 12, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
42.9% Coverage on New Code (required ≥ 65%)

See analysis details on SonarQube Cloud

@simen-rekkedal simen-rekkedal marked this pull request as ready for review December 12, 2024 10:22
@simen-rekkedal simen-rekkedal marked this pull request as draft December 12, 2024 10:24
@@ -91,6 +96,13 @@ public async Task<ActionResult<RequestSystemResponse>> CreateRequest([FromBody]
SystemId = createRequest.SystemId,
};

SystemUser? existing = await _systemUserRepository.GetSystemUserByExternalRequestId(externalRequestId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we calling the repository directly? we usually route via the service

@@ -91,6 +96,13 @@ public async Task<ActionResult<RequestSystemResponse>> CreateRequest([FromBody]
SystemId = createRequest.SystemId,
};

SystemUser? existing = await _systemUserRepository.GetSystemUserByExternalRequestId(externalRequestId);
if (existing is not null)
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we follow a different error pattern in other controllers if i remember

@@ -68,7 +73,7 @@ public async Task<ActionResult<RegisteredSystemDTO>> GetRegisteredSystemDto(stri
{
RegisteredSystem registeredSystem = await _systemRegisterService.GetRegisteredSystemInfo(systemId, cancellationToken);

if (registeredSystem == null)
if (registeredSystem == null || !registeredSystem.IsVisible)
Copy link
Contributor

@mgunnerud mgunnerud Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will break the bff and frontend? For vendorrequest and change request, in GET, the request only contains the systemId. The bff uses this service (authentication/api/v1/systemregister/{systemId}) to load the system (for displaying orgno, vendorname, systemname).

An alternative solution for this is for backend to include the system object in GET vendorrequest and change request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants