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

Duplicates backend & integration tests #6521

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

RubenGeo
Copy link
Contributor

@RubenGeo RubenGeo commented Feb 14, 2025

AB#33530 AB#33533 AB#33540

This PR adds:

  • duplicates status in paginate endpoint
  • get duplicates endpoint to duplicate information per registration
  • integration tests to test them both

Describe your changes

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have added tests wherever relevant
  • I have made sure that all automated checks pass before requesting a review
    I do not think it's wise to merge this before we have k6 tests

Portalicious preview deployment

This PR does not have any preview deployments yet.

@Copilot Copilot bot review requested due to automatic review settings February 14, 2025 15:21
@RubenGeo RubenGeo added the enhancement New feature or request that affects our end users label Feb 14, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 18 changed files in this pull request and generated 2 comments.

Files not reviewed (13)
  • services/121-service/src/scripts/sql/mock-introduce-duplicates.sql: Language not supported
  • services/121-service/swagger.json: Language not supported
  • services/121-service/src/registration/validators/registrations-input-validator.ts: Evaluated as low risk
  • services/121-service/src/scripts/seed-multiple-nlrc-mock.ts: Evaluated as low risk
  • services/121-service/src/registration/const/filter-operation.const.ts: Evaluated as low risk
  • services/121-service/src/registration/interfaces/get-duplicates-result.interface.ts: Evaluated as low risk
  • services/121-service/src/registration/services/registrations-pagination.service.ts: Evaluated as low risk
  • services/121-service/test/helpers/registration.helper.ts: Evaluated as low risk
  • services/121-service/src/registration/registration-view.entity.ts: Evaluated as low risk
  • services/121-service/src/registration/registrations.service.ts: Evaluated as low risk
  • services/121-service/src/scripts/seed-mock-helpers.ts: Evaluated as low risk
  • services/121-service/src/registration/repositories/registration-scoped.repository.ts: Evaluated as low risk
  • services/121-service/src/registration/registrations.controller.ts: Evaluated as low risk
Comments suppressed due to low confidence (2)

services/121-service/src/registration/dto/duplicate.dto.ts:3

  • Resolve or remove the TODO comment about naming conventions.
// TODO: Discuss should this be name DuplicateReponseDto? (as in the guidelines) And that the api returns DuplicateReponseDto[]?

services/121-service/test/registrations/duplicates/get-duplicates.test.ts:109

  • [nitpick] The test description is unclear. It should be rephrased for better readability.
it(`should not return isDuplicateAccessibleWithinScope is false and no name for a duplicate if the duplicate registration is out of the scope of the user`, async () => {

@ApiProperty({ example: ['phoneNumber'] })
public readonly attributeNames: string[];

@ApiProperty({ example: 'true' })
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this to help the frontend with this frame

@@ -0,0 +1,23 @@
import { ApiProperty } from '@nestjs/swagger';

// TODO: Discuss should this be name DuplicateReponseDto? (as in the guidelines) And that the api returns DuplicateReponseDto[]?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

An array of response seems weird. It's sort of one response which can have an arrays of duplicates

@@ -0,0 +1,222 @@
import { RegistrationStatusEnum } from '@121-service/src/registration/enum/registration-status.enum';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not add any unit tests. The reason for this is 90 % of logic is in the queries. And therefore the scenario's I could think of are all covered in integration tests. Do you see opportunities for unit testing @diderikvw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request that affects our end users
Development

Successfully merging this pull request may close these issues.

1 participant