-
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
fix(criminal record): Fix email to Syslumenn #17341
base: main
Are you sure you want to change the base?
Conversation
…lDate which does not exist
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
warning [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options. WalkthroughThe pull request involves modifications to three files related to criminal record submission. Changes include removing Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command 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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
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: 0
🔭 Outside diff range comments (1)
libs/application/template-api-modules/src/lib/modules/templates/criminal-record-submission/emailGenerators/syslumennNotifyError.ts (1)
Line range hint
1-35
: Add TypeScript type definitions for better type safety.The file lacks proper TypeScript type definitions which could lead to runtime errors.
Consider adding the following type definitions:
interface ApplicationData { applicant: string; id: string; // Add other relevant fields } interface EmailOptions { email: { sender: string; address: string; }; } interface EmailGeneratorProps { application: ApplicationData; options: EmailOptions; }Then update the function signature:
-export const generateSyslumennNotifyErrorEmail: EmailTemplateGenerator = ( - props, +export const generateSyslumennNotifyErrorEmail: EmailTemplateGenerator = ( + props: EmailGeneratorProps,
🧹 Nitpick comments (1)
libs/application/template-api-modules/src/lib/modules/templates/criminal-record-submission/emailGenerators/syslumennNotifyError.ts (1)
15-16
: Consider enhancing the error message with more details.While the change from
nationalRegistryData
toapplication.applicant
is correct, the error message could be more informative for better troubleshooting.Consider including additional context such as:
- Villa hefur komið upp í samskiptum milli island.is og sýslumanna, vegna kaupa á sakavottorði fyrir ${application.applicant}. + Villa hefur komið upp í samskiptum milli island.is og sýslumanna, vegna kaupa á sakavottorði fyrir ${application.applicant}. Umsóknarnúmer: ${application.id}, Tími: ${new Date().toISOString()}.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
libs/application/template-api-modules/src/lib/modules/templates/criminal-record-submission/criminal-record-submission.service.ts
(1 hunks)libs/application/template-api-modules/src/lib/modules/templates/criminal-record-submission/emailGenerators/syslumennNotifyError.ts
(1 hunks)libs/application/templates/criminal-record/src/lib/messages.ts
(0 hunks)
💤 Files with no reviewable changes (1)
- libs/application/templates/criminal-record/src/lib/messages.ts
🧰 Additional context used
📓 Path-based instructions (2)
libs/application/template-api-modules/src/lib/modules/templates/criminal-record-submission/emailGenerators/syslumennNotifyError.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/criminal-record-submission/criminal-record-submission.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."
🔇 Additional comments (3)
libs/application/template-api-modules/src/lib/modules/templates/criminal-record-submission/criminal-record-submission.service.ts (3)
5-5
: LGTM! Removal of unused import.
The removal of the Person
import is correct as the code uses a custom person object structure instead of the imported type.
Line range hint 65-71
: Verify email template changes.
Since the PR objectives mention fixing an email issue with "nationalRegistry" reference, let's ensure the email generator has been properly updated.
✅ Verification successful
Let me analyze the email generator implementation further to verify the changes.
Email template implementation is correct and doesn't contain any references to "nationalRegistry"
The email generators for both criminal record and mortgage certificate modules have been reviewed. Neither implementation contains any references to "nationalRegistry". The criminal record email uses application.applicant
while the mortgage certificate email uses identityData.nationalId
from the identity data source. Both implementations are consistent and properly structured.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify email template changes
# Search for the email generator implementation
rg -A 10 'generateSyslumennNotifyErrorEmail'
# Check for any remaining references to nationalRegistry
rg 'nationalRegistry' --type ts
Length of output: 66298
Script:
#!/bin/bash
# Check the implementation of syslumennNotifyError email generator in both criminal record and mortgage certificate modules
cat libs/application/template-api-modules/src/lib/modules/templates/criminal-record-submission/emailGenerators/syslumennNotifyError.ts
cat libs/application/template-api-modules/src/lib/modules/templates/mortgage-certificate-submission/emailGenerators/syslumennNotifyError.ts
Length of output: 2175
Line range hint 52-58
: Verify the person object structure matches Syslumenn's API requirements.
The person object is correctly using application.applicant
instead of national registry data, which aligns with the PR's goal. However, let's verify that all required fields are present and correctly typed.
✅ Verification successful
Person object structure matches Syslumenn's API requirements
The person object in the criminal record submission service contains all the required fields according to the Syslumenn API's Person interface:
email
(optional): ✓ presentsigned
(required): ✓ present and correctly set tofalse
type
(required): ✓ present and correctly set toPersonType.CriminalRecordApplicant
The structure aligns with the API requirements, and the PersonType enum confirms that CriminalRecordApplicant
is a valid type.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the person object structure against Syslumenn's API types
# Search for PersonType usage and its interface definition
ast-grep --pattern 'interface $_ {
$$$
type: PersonType
$$$
}'
# Search for actual API calls to verify the structure
rg -A 5 'uploadData\('
Length of output: 10715
Script:
#!/bin/bash
# Let's find the Person interface definition and PersonType enum
ast-grep --pattern 'interface Person {
$$$
}'
ast-grep --pattern 'enum PersonType {
$$$
}'
# Let's also check the criminal record submission service for any specific person object construction
rg -A 10 'const person = {' libs/application/template-api-modules/src/lib/modules/templates/criminal-record-submission/criminal-record-submission.service.ts
Length of output: 3042
Datadog ReportAll test runs ✅ 10 Total Test Services: 0 Failed, 10 Passed Test ServicesThis report shows up to 10 services
|
What
Fix email to Syslumenn, is referencing to nationalRegistry in externalDate which does not exist
Checklist:
Summary by CodeRabbit
Bug Fixes
New Features
Chores