-
Notifications
You must be signed in to change notification settings - Fork 61
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
feat(citizenship): added busetuskilyrdi and nationality of children #14923
Conversation
WalkthroughThe changes primarily focus on refactoring and optimizing the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Outside diff range and nitpick comments (4)
libs/clients/directorate-of-immigration/src/lib/directorateOfImmigrationClient.service.ts (1)
Line range hint
145-145
: ReplaceparseInt
withNumber.parseInt
for consistency and clarity.- countryId: parseInt(x.countryId), + countryId: Number.parseInt(x.countryId),Apply this change to all instances where
parseInt
is used.Also applies to: 151-151, 160-160, 298-298
libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/citizenship/citizenship.service.ts (2)
Line range hint
224-224
: Use strict equality checks (===
) instead of loose equality (==
).- answers.countriesOfResidence?.hasLivedAbroad == YES + answers.countriesOfResidence?.hasLivedAbroad === YESApply this change to all instances where strict equality should be used.
Also applies to: 233-233, 243-243
Line range hint
323-323
: ReplaceparseInt
withNumber.parseInt
for consistency.- passportTypeId: parseInt(applicantPassport.passportTypeId), + passportTypeId: Number.parseInt(applicantPassport.passportTypeId),Apply this change to all instances where
parseInt
is used.Also applies to: 369-369
libs/clients/directorate-of-immigration/src/clientConfig.json (1)
1942-1944
: The addition ofparentOfChild2SSN
andparentOfChild2Name
inStaticDataChildNewModel
should be carefully documented to ensure clarity on their usage and relevance to the application's functionality.Consider adding detailed comments or documentation regarding the use of these new properties to maintain code clarity and ease future maintenance.
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (14)
- libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/citizenship/citizenship.service.ts (5 hunks)
- libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/citizenship/types/index.ts (2 hunks)
- libs/application/templates/directorate-of-immigration/citizenship/src/dataProviders/index.ts (1 hunks)
- libs/application/templates/directorate-of-immigration/citizenship/src/fields/index.ts (1 hunks)
- libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/InformationSection/FormerIcelanderSubSection.ts (2 hunks)
- libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/InformationSection/MaritalStatusSubSection.ts (1 hunks)
- libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/InformationSection/ParentsSubSection.ts (1 hunks)
- libs/application/templates/directorate-of-immigration/citizenship/src/forms/Prerequisites/index.ts (2 hunks)
- libs/application/templates/directorate-of-immigration/citizenship/src/lib/CitizenshipTemplate.ts (2 hunks)
- libs/application/templates/directorate-of-immigration/citizenship/src/shared/constants.ts (1 hunks)
- libs/application/templates/directorate-of-immigration/citizenship/src/shared/types.ts (1 hunks)
- libs/clients/directorate-of-immigration/src/clientConfig.json (5 hunks)
- libs/clients/directorate-of-immigration/src/lib/directorateOfImmigrationClient.service.ts (1 hunks)
- libs/clients/directorate-of-immigration/src/lib/directorateOfImmigrationClient.types.ts (1 hunks)
Files skipped from review due to trivial changes (4)
- libs/application/templates/directorate-of-immigration/citizenship/src/dataProviders/index.ts
- libs/application/templates/directorate-of-immigration/citizenship/src/fields/index.ts
- libs/application/templates/directorate-of-immigration/citizenship/src/shared/constants.ts
- libs/clients/directorate-of-immigration/src/lib/directorateOfImmigrationClient.types.ts
Additional Context Used
Biome (37)
libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/citizenship/citizenship.service.ts (13)
224-224: Use === instead of ==.
== is only allowed when comparing againstnull
233-233: Use === instead of ==.
== is only allowed when comparing againstnull
243-243: Use === instead of ==.
== is only allowed when comparing againstnull
1-2: All these imports are only used as types.
2-3: All these imports are only used as types.
4-12: Some named imports are only used as types.
13-17: Some named imports are only used as types.
17-25: All these imports are only used as types.
25-26: All these imports are only used as types.
27-28: All these imports are only used as types.
28-29: All these imports are only used as types.
323-323: Use Number.parseInt instead of the equivalent global.
369-369: Use Number.parseInt instead of the equivalent global.
libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/citizenship/types/index.ts (1)
1-6: All these imports are only used as types.
libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/InformationSection/FormerIcelanderSubSection.ts (3)
9-10: Some named imports are only used as types.
10-11: All these imports are only used as types.
11-12: All these imports are only used as types.
libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/InformationSection/MaritalStatusSubSection.ts (3)
8-9: All these imports are only used as types.
11-15: All these imports are only used as types.
15-16: All these imports are only used as types.
libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/InformationSection/ParentsSubSection.ts (1)
8-9: All these imports are only used as types.
libs/application/templates/directorate-of-immigration/citizenship/src/forms/Prerequisites/index.ts (1)
7-8: Some named imports are only used as types.
libs/application/templates/directorate-of-immigration/citizenship/src/lib/CitizenshipTemplate.ts (2)
1-12: Some named imports are only used as types.
18-19: Some named imports are only used as types.
libs/application/templates/directorate-of-immigration/citizenship/src/shared/types.ts (3)
1-6: All these imports are only used as types.
6-7: All these imports are only used as types.
7-8: All these imports are only used as types.
libs/clients/directorate-of-immigration/src/lib/directorateOfImmigrationClient.service.ts (10)
183-183: Change to an optional chain.
192-194: Template literals are preferred over string concatenation.
198-200: Template literals are preferred over string concatenation.
1-1: Some named imports are only used as types.
1-2: All these imports are only used as types.
3-21: Some named imports are only used as types.
145-145: Use Number.parseInt instead of the equivalent global.
151-151: Use Number.parseInt instead of the equivalent global.
160-160: Use Number.parseInt instead of the equivalent global.
298-298: Use Number.parseInt instead of the equivalent global.
Path-based Instructions (10)
libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/citizenship/types/index.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/directorate-of-immigration/citizenship/src/shared/types.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/InformationSection/ParentsSubSection.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/InformationSection/FormerIcelanderSubSection.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/directorate-of-immigration/citizenship/src/forms/Prerequisites/index.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/directorate-of-immigration/citizenship/src/lib/CitizenshipTemplate.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/clients/directorate-of-immigration/src/lib/directorateOfImmigrationClient.service.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/InformationSection/MaritalStatusSubSection.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/citizenship/citizenship.service.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/clients/directorate-of-immigration/src/clientConfig.json (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
Additional comments not posted (11)
libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/citizenship/types/index.ts (1)
12-15
: LGTM! The addition of new optional fields toApplicantInformation
aligns with the PR's objectives to enhance citizenship data handling.libs/application/templates/directorate-of-immigration/citizenship/src/shared/types.ts (1)
15-20
: LGTM! The extension ofApplicantInformation
to include new boolean properties supports enhanced data handling for citizenship applications.libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/InformationSection/ParentsSubSection.ts (1)
17-38
: LGTM! The updated condition logic for displaying the parents subsection is well-implemented and aligns with the new requirements for residence condition checks.libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/InformationSection/FormerIcelanderSubSection.ts (1)
17-49
: LGTM! The updated condition logic for the FormerIcelander subsection is comprehensive and aligns with the enhanced data handling requirements.libs/application/templates/directorate-of-immigration/citizenship/src/forms/Prerequisites/index.ts (1)
Line range hint
1-86
: LGTM! The configuration of the Prerequisites form is correctly set up with appropriate data providers and sections to support the citizenship application process.libs/application/templates/directorate-of-immigration/citizenship/src/lib/CitizenshipTemplate.ts (1)
Line range hint
1-129
: LGTM! The configuration of the Citizenship application template is comprehensive and well-structured, supporting the new features and requirements effectively.libs/clients/directorate-of-immigration/src/lib/directorateOfImmigrationClient.service.ts (1)
313-313
: Ensure thenationality
field is correctly assigned and used.This addition aligns with the PR's objective to handle the nationality of children in citizenship applications.
libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/InformationSection/MaritalStatusSubSection.ts (1)
16-16
: Ensure the importedApplicantInformation
is used appropriately.The usage of
ApplicantInformation
for form conditions enhances the clarity and maintainability of the code by centralizing the type definitions.libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/citizenship/citizenship.service.ts (1)
41-43
: RefactorgetResidenceConditionInfo
andgetApplicantInformation
to improve clarity and maintainability.The refactoring of these methods aligns with the PR's objectives to enhance data retrieval and error handling.
Also applies to: 90-107
libs/clients/directorate-of-immigration/src/clientConfig.json (2)
1473-1481
: The new boolean properties added toApplicantResidenceConditionViewModel
align with the PR's objectives to enhance data handling for citizenship applications. Ensure these properties are utilized correctly in the application logic.
1736-1739
: The addition of new boolean properties inCitizenshipValidity
schema is consistent with the PR's aim to handle new citizenship conditions. Verify that these properties are integrated properly across the application.Verification successful
The new boolean properties
isEESCitizen
,eesNordicCitizen
,eesResidenceCondition
, andspouseIsCitizen
are properly integrated across the application. They are referenced in service files, type definitions, and form components, indicating correct usage and integration.
clientConfig.json
: Properties are defined.citizenship.service.ts
: Properties are used in application logic.types/index.ts
: Properties are included in type definitions.shared/types.ts
: Properties are included in shared type definitions.ParentsSubSection.ts
andMaritalStatusSubSection.ts
: Properties are used in form components.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of new boolean properties in the CitizenshipValidity schema. # Test: Search for the usage of new properties in the application code. Expect: Proper integration and usage. rg --type json --type ts 'isEESCitizen|eesNordicCitizen|eesResidenceCondition|spouseIsCitizen'Length of output: 3650
...igration/citizenship/src/forms/CitizenshipForm/InformationSection/MaritalStatusSubSection.ts
Show resolved
Hide resolved
Datadog ReportAll test runs ✅ 4 Total Test Services: 0 Failed, 4 Passed Test Services
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14923 +/- ##
==========================================
- Coverage 37.09% 37.09% -0.01%
==========================================
Files 6353 6353
Lines 129378 129382 +4
Branches 36940 36939 -1
==========================================
- Hits 47994 47992 -2
- Misses 81384 81390 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
...
Attach a link to issue if relevant
What
Specify what you're trying to achieve
Why
Specify why you need to achieve this
Screenshots / Gifs
Attach Screenshots / Gifs to help reviewers understand the scope of the pull request
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Chores