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

chore(j-s): SMS and Email Config #15514

Merged
merged 9 commits into from
Aug 9, 2024
Merged

chore(j-s): SMS and Email Config #15514

merged 9 commits into from
Aug 9, 2024

Conversation

gudjong
Copy link
Member

@gudjong gudjong commented Jul 12, 2024

SMS and Email Config

Færa backend config

What

  • Moves config for the SMS and email services to a dedicated config file.
  • Updates the SMS and email services accordingly.
  • Updates all uses of the SMS and email services.

Why

  • Migrating to the official config injection approach.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

Summary by CodeRabbit

  • Refactor

    • Streamlined configuration handling for EmailModule and SmsModule across multiple services and modules.
    • Replaced environment-specific options with centralized module configurations (emailModuleConfig and smsModuleConfig).
    • Simplified import statements and module registrations.
  • Documentation

    • Updated README.md for nova-sms to reflect new setup instructions.
  • New Features

    • Introduced configuration modules for email and SMS settings to enhance clarity and manageability.
  • Deprecation

    • Removed several modules and services from exports to streamline functionalities and improve maintainability.

Copy link
Contributor

coderabbitai bot commented Jul 12, 2024

Walkthrough

This update standardizes the configuration for email and SMS services across multiple applications and modules by centralizing imports for emailModuleConfig and smsModuleConfig. It removes various environment-based configurations, streamlining the management of service options, enhancing consistency, and reducing redundancy across the codebase.

Changes

File/Directory Path Change Summary
apps/api/src/app/app.module.ts Removed imports for Official Journal of Iceland module; added emailModuleConfig.
apps/application-system/api/.../app.module.ts Added smsModuleConfig and emailModuleConfig imports.
apps/application-system/api/.../environment.interface.ts Removed smsOptions property from Environment interface.
apps/application-system/api/.../environment.ts Removed emailOptions and smsOptions from configurations.
apps/financial-aid/.../app.module.ts Added ConfigModule and emailModuleConfig imports; restructured configurations.
apps/financial-aid/.../application.module.ts Replaced EmailModule.register(environment.emailOptions) with EmailModule.
apps/financial-aid/.../staff.module.ts Simplified EmailModule import setup.
apps/financial-aid/.../environment.ts Removed useTestAccount and options from emailOptions.
apps/judicial-system/.../app.module.ts Added emailModuleConfig and smsModuleConfig.
apps/judicial-system/.../court.module.ts Replaced EmailModule.register(environment.emailOptions) with EmailModule.
apps/judicial-system/.../notification.module.ts Simplified EmailModule and SmsModule imports.
apps/services/auth/.../app.module.ts Added smsModuleConfig import.
apps/services/auth/.../notifications.module.ts Simplified SmsModule import.
apps/services/user-notification/.../app.module.ts Added emailModuleConfig import.
apps/services/user-notification/.../notifications.module.ts Simplified EmailModule import.
libs/api/domains/communications/.../communications.module.ts Removed emailOptions from EmailModule.register.
libs/api/domains/communications/.../communications.service.spec.ts Modified imports; included emailModuleConfig in ConfigModule.forRoot.
libs/api/domains/communications/.../environment.ts Refactored emailOptions.
libs/application/template-api-modules/.../shared.module.ts Removed specific configurations for EmailModule and SmsModule.
libs/application/template-api-modules/.../children-residence-change-v2/.../children-residence-change.module.ts Simplified SmsModule import.
libs/application/template-api-modules/.../children-residence-change/.../children-residence-change.module.ts Simplified SmsModule import.
libs/application/template-api-modules/.../criminal-record-submission/.../criminal-record-submission.spec.ts Removed EmailService, EMAIL_OPTIONS, related imports.
libs/application/template-api-modules/.../driving-license-submission/.../driving-license-submission.spec.ts Changed import from EMAIL_OPTIONS to emailModuleConfig.
libs/application/template-api-modules/.../example-payment-actions/.../examplePaymentActions.spec.ts Renamed EMAIL_OPTIONS to emailModuleConfig; added ConfigModule import.
libs/application/template-api-modules/.../mortgage-certificate-submission/.../mortgage-certificate-submission.spec.ts Updated import to emailModuleConfig.
libs/application/template-api-modules/.../parental-leave/.../parental-leave.module.ts Simplified SmsModule import.
libs/application/template-api-modules/.../types/index.ts Removed emailOptions and smsOptions from BaseTemplateAPIModuleConfig interface.
libs/email-service/src/index.ts Restructured exports for clarity.
libs/email-service/src/lib/email.config.ts Introduced emailModuleConfig configuration module.
libs/email-service/src/lib/email.module.ts Refactored EmailModule with @Module decorator.
libs/email-service/src/lib/email.service.ts Streamlined configuration handling in EmailService.
libs/email-service/src/lib/test/.../createTestingEmailModule.ts Modified imports and restructured imports section.
libs/email-service/src/lib/test/email.service.spec.ts Reorganized import paths.
libs/nova-sms/.eslintrc.json Added a rule for import grouping.
libs/nova-sms/README.md Simplified setup; recommended direct imports.
libs/nova-sms/src/index.ts Restructured exports; added new configuration export.
libs/nova-sms/src/lib/sms.config.ts Introduced smsModuleConfig configuration module.
libs/nova-sms/src/lib/sms.module.ts Refactored SmsModule with @Module decorator.
libs/application/template-api-modules/src/lib/modules/templates/index.ts Removed several modules and services from exports for refactoring.

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jul 12, 2024

Codecov Report

Attention: Patch coverage is 80.95238% with 8 lines in your changes missing coverage. Please review.

Project coverage is 36.97%. Comparing base (4d58d7c) to head (165cdfb).

Files Patch % Lines
apps/financial-aid/backend/src/app/app.module.ts 0.00% 3 Missing ⚠️
apps/api/src/app/app.module.ts 0.00% 2 Missing ⚠️
libs/email-service/src/lib/email.service.ts 75.00% 2 Missing ⚠️
...ns/communications/src/lib/communications.module.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15514      +/-   ##
==========================================
- Coverage   36.97%   36.97%   -0.01%     
==========================================
  Files        6567     6567              
  Lines      134327   134305      -22     
  Branches    38430    38407      -23     
==========================================
- Hits        49668    49653      -15     
+ Misses      84659    84652       -7     
Flag Coverage Δ
api 3.43% <0.00%> (-0.02%) ⬇️
api-domains-communications 40.54% <56.25%> (-0.03%) ⬇️
application-system-api 41.80% <78.57%> (-0.01%) ⬇️
application-template-api-modules 23.87% <69.23%> (+0.03%) ⬆️
email-service 60.24% <50.00%> (-1.19%) ⬇️
financial-aid-backend 56.34% <44.44%> (+<0.01%) ⬆️
judicial-system-formatters 80.43% <ø> (ø)
judicial-system-web 28.11% <ø> (ø)
nova-sms 61.71% <45.45%> (-2.29%) ⬇️
services-auth-ids-api 54.59% <100.00%> (-0.03%) ⬇️
services-endorsements-api 54.83% <62.50%> (+0.07%) ⬆️
services-user-notification 48.00% <62.50%> (-0.03%) ⬇️
services-user-profile 62.28% <78.57%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
apps/application-system/api/src/app/app.module.ts 100.00% <100.00%> (ø)
...ication-system/api/src/environments/environment.ts 88.88% <ø> (-2.03%) ⬇️
.../src/app/modules/application/application.module.ts 0.00% <ø> (ø)
...-aid/backend/src/app/modules/staff/staff.module.ts 0.00% <ø> (ø)
...ancial-aid/backend/src/environments/environment.ts 66.66% <ø> (-4.77%) ⬇️
apps/judicial-system/backend/src/app/app.module.ts 0.00% <ø> (ø)
...stem/backend/src/app/modules/court/court.module.ts 0.00% <ø> (ø)
...rc/app/modules/notification/notification.module.ts 0.00% <ø> (ø)
apps/services/auth/ids-api/src/app/app.module.ts 100.00% <100.00%> (ø)
...-api/src/app/notifications/notifications.module.ts 100.00% <ø> (ø)
... and 31 more

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d58d7c...165cdfb. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Jul 12, 2024

Datadog Report

All test runs 364aea7 🔗

12 Total Test Services: 0 Failed, 12 Passed
🔻 Test Sessions change in coverage: 3 decreased, 4 increased, 15 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
api 0 0 0 4 0 2.66s 1 decreased (-0.02%) Link
api-domains-communications 0 0 0 5 0 28.56s 1 decreased (-0.02%) Link
application-system-api 0 0 0 111 2 2m 50.09s 1 no change Link
application-template-api-modules 0 0 0 109 0 1m 42.4s 1 no change Link
email-service 0 0 0 2 0 11.3s 1 increased (+0.22%) Link
financial-aid-backend 0 0 0 219 0 51.25s 1 increased (+0.03%) Link
judicial-system-api 0 0 0 54 0 5.58s 1 no change Link
judicial-system-backend 0 0 0 19924 0 18m 12.54s 1 increased (+0.07%) Link
services-auth-ids-api 0 0 0 215 0 1m 0.2s 1 no change Link
services-endorsements-api 0 0 0 42 0 35.09s 1 increased (+0.04%) Link

🔻 Code Coverage Decreases vs Default Branch (3)

  • nova-sms - jest 64.32% (-1.75%) - Details
  • api - jest 4.3% (-0.02%) - Details
  • api-domains-communications - jest 49.92% (-0.02%) - Details

@gudjong gudjong marked this pull request as ready for review July 12, 2024 15:40
@gudjong gudjong requested review from a team as code owners July 12, 2024 15:40
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 740e436 and 8c1b3ef.

Files selected for processing (52)
  • apps/api/src/app/app.module.ts (3 hunks)
  • apps/application-system/api/src/app/app.module.ts (2 hunks)
  • apps/application-system/api/src/environments/environment.interface.ts (2 hunks)
  • apps/application-system/api/src/environments/environment.ts (2 hunks)
  • apps/financial-aid/backend/src/app/app.module.ts (2 hunks)
  • apps/financial-aid/backend/src/app/modules/application/application.module.ts (2 hunks)
  • apps/financial-aid/backend/src/app/modules/staff/staff.module.ts (1 hunks)
  • apps/financial-aid/backend/src/environments/environment.ts (2 hunks)
  • apps/judicial-system/backend/src/app/app.module.ts (2 hunks)
  • apps/judicial-system/backend/src/app/modules/court/court.module.ts (2 hunks)
  • apps/judicial-system/backend/src/app/modules/notification/notification.module.ts (2 hunks)
  • apps/services/auth/ids-api/src/app/app.module.ts (2 hunks)
  • apps/services/auth/ids-api/src/app/notifications/notifications.module.ts (1 hunks)
  • apps/services/auth/ids-api/src/environments/environment.ts (2 hunks)
  • apps/services/endorsements/api/src/app/app.module.ts (2 hunks)
  • apps/services/endorsements/api/src/app/modules/endorsement/endorsement.module.ts (1 hunks)
  • apps/services/endorsements/api/src/app/modules/endorsementList/endorsementList.module.ts (1 hunks)
  • apps/services/endorsements/api/src/environments/environment.ts (2 hunks)
  • apps/services/user-notification/src/app/app.module.ts (2 hunks)
  • apps/services/user-notification/src/app/modules/notifications/notifications.module.ts (1 hunks)
  • apps/services/user-notification/src/environments/environment.ts (1 hunks)
  • apps/services/user-profile/src/app/app.module.ts (2 hunks)
  • apps/services/user-profile/src/app/user-profile/userProfile.module.ts (2 hunks)
  • apps/services/user-profile/src/app/v2/user-profile.module.ts (1 hunks)
  • apps/services/user-profile/src/environments/environment.ts (2 hunks)
  • libs/api/domains/communications/src/lib/communications.module.ts (2 hunks)
  • libs/api/domains/communications/src/lib/communications.service.spec.ts (3 hunks)
  • libs/api/domains/communications/src/lib/environments/environment.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/shared/shared.module.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/children-residence-change-v2/children-residence-change.module.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/children-residence-change/children-residence-change.module.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/criminal-record-submission/criminal-record-submission.spec.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/driving-license-submission/driving-license-submission.spec.ts (2 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/example-payment-actions/examplePaymentActions.spec.ts (2 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/financial-statements-inao/financial-statements-inao.module.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/index.ts (4 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/mortgage-certificate-submission/mortgage-certificate-submission.spec.ts (3 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/parental-leave/parental-leave.module.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/types/index.ts (1 hunks)
  • libs/email-service/README.md (2 hunks)
  • libs/email-service/src/index.ts (1 hunks)
  • libs/email-service/src/lib/email.config.ts (1 hunks)
  • libs/email-service/src/lib/email.module.ts (1 hunks)
  • libs/email-service/src/lib/email.service.ts (4 hunks)
  • libs/email-service/src/lib/test/createTestingEmailModule.ts (1 hunks)
  • libs/email-service/src/lib/test/email.service.spec.ts (3 hunks)
  • libs/judicial-system/auth/src/lib/auth.module.ts (1 hunks)
  • libs/nova-sms/.eslintrc.json (1 hunks)
  • libs/nova-sms/README.md (1 hunks)
  • libs/nova-sms/src/index.ts (1 hunks)
  • libs/nova-sms/src/lib/sms.config.ts (1 hunks)
  • libs/nova-sms/src/lib/sms.module.ts (1 hunks)
Files not processed due to max files limit (2)
  • libs/nova-sms/src/lib/sms.service.spec.ts
  • libs/nova-sms/src/lib/sms.service.ts
Files skipped from review due to trivial changes (22)
  • apps/application-system/api/src/environments/environment.interface.ts
  • apps/financial-aid/backend/src/app/modules/application/application.module.ts
  • apps/financial-aid/backend/src/app/modules/staff/staff.module.ts
  • apps/judicial-system/backend/src/app/modules/court/court.module.ts
  • apps/services/auth/ids-api/src/app/notifications/notifications.module.ts
  • apps/services/auth/ids-api/src/environments/environment.ts
  • apps/services/endorsements/api/src/app/modules/endorsement/endorsement.module.ts
  • apps/services/endorsements/api/src/app/modules/endorsementList/endorsementList.module.ts
  • apps/services/endorsements/api/src/environments/environment.ts
  • apps/services/user-notification/src/app/modules/notifications/notifications.module.ts
  • apps/services/user-profile/src/app/user-profile/userProfile.module.ts
  • apps/services/user-profile/src/app/v2/user-profile.module.ts
  • apps/services/user-profile/src/environments/environment.ts
  • libs/api/domains/communications/src/lib/communications.module.ts
  • libs/application/template-api-modules/src/lib/modules/templates/children-residence-change-v2/children-residence-change.module.ts
  • libs/application/template-api-modules/src/lib/modules/templates/criminal-record-submission/criminal-record-submission.spec.ts
  • libs/application/template-api-modules/src/lib/modules/templates/financial-statements-inao/financial-statements-inao.module.ts
  • libs/application/template-api-modules/src/lib/modules/templates/index.ts
  • libs/application/template-api-modules/src/lib/types/index.ts
  • libs/email-service/src/index.ts
  • libs/email-service/src/lib/email.config.ts
  • libs/judicial-system/auth/src/lib/auth.module.ts
Additional context used
Path-based instructions (29)
libs/nova-sms/src/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/nova-sms/src/lib/sms.module.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/email-service/src/lib/email.module.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/api/domains/communications/src/lib/environments/environment.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/nova-sms/src/lib/sms.config.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/email-service/src/lib/test/createTestingEmailModule.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/nova-sms/README.md (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."
apps/services/user-notification/src/environments/environment.ts (2)

Pattern apps/services/**/*: "Confirm that the code adheres to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
libs/application/template-api-modules/src/lib/modules/templates/children-residence-change/children-residence-change.module.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."
apps/judicial-system/backend/src/app/modules/notification/notification.module.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
libs/application/template-api-modules/src/lib/modules/templates/parental-leave/parental-leave.module.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/shared/shared.module.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."
apps/financial-aid/backend/src/app/app.module.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/services/user-notification/src/app/app.module.ts (2)

Pattern apps/services/**/*: "Confirm that the code adheres to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/services/user-profile/src/app/app.module.ts (2)

Pattern apps/services/**/*: "Confirm that the code adheres to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/services/endorsements/api/src/app/app.module.ts (2)

Pattern apps/services/**/*: "Confirm that the code adheres to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/judicial-system/backend/src/app/app.module.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
libs/application/template-api-modules/src/lib/modules/templates/example-payment-actions/examplePaymentActions.spec.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."
apps/financial-aid/backend/src/environments/environment.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
libs/email-service/src/lib/email.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."
apps/services/auth/ids-api/src/app/app.module.ts (2)

Pattern apps/services/**/*: "Confirm that the code adheres to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
libs/application/template-api-modules/src/lib/modules/templates/driving-license-submission/driving-license-submission.spec.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."
apps/application-system/api/src/environments/environment.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
libs/application/template-api-modules/src/lib/modules/templates/mortgage-certificate-submission/mortgage-certificate-submission.spec.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/email-service/src/lib/test/email.service.spec.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/email-service/README.md (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/api/domains/communications/src/lib/communications.service.spec.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."
apps/application-system/api/src/app/app.module.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/api/src/app/app.module.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
Additional comments not posted (63)
libs/nova-sms/src/index.ts (1)

1-3: Explicit exports improve clarity and maintainability.

Explicitly exporting SmsModule, SmsService, NovaError, and smsModuleConfig from their respective files enhances the clarity of what is being exposed publicly and improves maintainability.

libs/nova-sms/src/lib/sms.module.ts (1)

1-9: Correct module setup for SMS services.

The SmsModule is correctly set up with SmsService as a provider and export, ensuring proper dependency injection and module functionality.

libs/email-service/src/lib/email.module.ts (1)

1-10: Correct module setup for email services.

The EmailModule is correctly set up with EmailService and AdapterService as providers and exports, ensuring proper dependency injection and module functionality.

libs/api/domains/communications/src/lib/environments/environment.ts (1)

Line range hint 1-9: Environment configuration looks correct.

The environment configuration uses environment variables to define options for email and Zendesk, which is a standard and secure approach.

libs/nova-sms/src/lib/sms.config.ts (2)

1-1: Importing defineConfig from @island.is/nest/config

This import is necessary for defining the configuration object for the SMS module.


3-12: Configuration Definition for SMS Module

The configuration object is defined using defineConfig. It includes settings for the URL, username, password, and an option to accept unauthorized connections.

  • The default URL is set to the development URL.
  • The username defaults to 'IslandIs_User_Development'.
  • The password is required but defaults to an empty string.
  • The acceptUnauthorized setting defaults to true.

These settings are appropriate for development but should be reviewed for production environments to ensure security.

libs/email-service/src/lib/test/createTestingEmailModule.ts (3)

4-4: Importing ConfigModule from @island.is/nest/config

This import is necessary for setting up the configuration module in the testing environment.


7-7: Importing emailModuleConfig from ../email.config

This import brings in the email module configuration, which is essential for setting up the testing module.


12-16: Setting Up the Testing Module

The testing module is set up with the configuration module and email module configuration. This ensures that the email service is properly configured for testing.

libs/nova-sms/README.md (2)

17-21: Adding SmsModule to Module Imports

The documentation correctly shows how to add the SmsModule to the module imports in a NestJS application.


25-36: Adding smsModuleConfig to App Module Imports

The documentation correctly demonstrates how to add the smsModuleConfig to the app module imports, ensuring that the configuration is properly loaded.

libs/nova-sms/.eslintrc.json (2)

3-3: Extending Base ESLint Configuration

The file extends the base ESLint configuration, which helps maintain consistency across the project.


4-24: Rules for Import Sorting

The configuration includes rules for sorting imports using simple-import-sort. This helps keep the imports organized and improves readability.

apps/services/user-notification/src/environments/environment.ts (1)

Line range hint 1-36:
Environment settings look good! Ensure documentation for required variables.

The structure and usage of environment variables are appropriate. Ensure that all required environment variables are properly documented.

libs/application/template-api-modules/src/lib/modules/templates/children-residence-change/children-residence-change.module.ts (1)

19-19: Module import looks good!

The addition of SmsModule aligns with the goal of simplifying imports and centralizing configuration.

apps/judicial-system/backend/src/app/modules/notification/notification.module.ts (1)

18-19: Module imports look good!

The addition of EmailModule and SmsModule aligns with the goal of simplifying imports and centralizing configuration.

libs/application/template-api-modules/src/lib/modules/templates/parental-leave/parental-leave.module.ts (1)

22-22: Module import looks good!

The addition of SmsModule aligns with the goal of simplifying imports and centralizing configuration.

libs/application/template-api-modules/src/lib/modules/shared/shared.module.ts (1)

25-26: Ensure configuration consistency for EmailModule and SmsModule

Adding EmailModule and SmsModule without additional configuration parameters suggests that these modules are now using centralized configuration. This change aligns with the goal of moving to a dedicated config file. Ensure that the centralized configuration is correctly set up and that these modules work as expected with it.

apps/financial-aid/backend/src/app/app.module.ts (2)

5-6: Import ConfigModule and emailModuleConfig

The addition of ConfigModule and emailModuleConfig ensures that the email service configuration is centralized and globally available. This change aligns with the goal of centralizing configuration.


47-50: Set up global configuration with emailModuleConfig

The ConfigModule.forRoot setup with isGlobal: true and loading emailModuleConfig ensures that the configuration is available throughout the application. This change aligns with the goal of centralizing configuration.

apps/services/user-notification/src/app/app.module.ts (2)

20-20: Import emailModuleConfig

The addition of emailModuleConfig ensures that the email service configuration is centralized and globally available. This change aligns with the goal of centralizing configuration.


42-42: Load emailModuleConfig in global configuration

The ConfigModule.forRoot setup with isGlobal: true and loading emailModuleConfig ensures that the configuration is available throughout the application. This change aligns with the goal of centralizing configuration.

apps/services/user-profile/src/app/app.module.ts (2)

22-23: Import smsModuleConfig and emailModuleConfig

The addition of smsModuleConfig and emailModuleConfig ensures that the SMS and email service configurations are centralized and globally available. This change aligns with the goal of centralizing configuration.


37-38: Load smsModuleConfig and emailModuleConfig in global configuration

The ConfigModule.forRoot setup with isGlobal: true and loading smsModuleConfig and emailModuleConfig ensures that the configurations are available throughout the application. This change aligns with the goal of centralizing configuration.

apps/services/endorsements/api/src/app/app.module.ts (2)

23-23: Confirm the integration of emailModuleConfig.

The emailModuleConfig is correctly imported. Ensure that it is properly used throughout the application.


37-42: Verify the addition of emailModuleConfig to the ConfigModule load array.

The emailModuleConfig is correctly added to the ConfigModule load array. This ensures that the email configuration is available globally.

apps/judicial-system/backend/src/app/app.module.ts (3)

5-5: Confirm the integration of emailModuleConfig.

The emailModuleConfig is correctly imported. Ensure that it is properly used throughout the application.


8-8: Confirm the integration of smsModuleConfig.

The smsModuleConfig is correctly imported. Ensure that it is properly used throughout the application.


59-60: Verify the addition of emailModuleConfig and smsModuleConfig to the ConfigModule load array.

The emailModuleConfig and smsModuleConfig are correctly added to the ConfigModule load array. This ensures that the email and SMS configurations are available globally.

libs/application/template-api-modules/src/lib/modules/templates/example-payment-actions/examplePaymentActions.spec.ts (2)

15-15: Confirm the integration of emailModuleConfig in the test setup.

The emailModuleConfig is correctly imported. Ensure that it is properly used throughout the test cases.


26-31: Verify the addition of emailModuleConfig to the test module's ConfigModule load array.

The emailModuleConfig is correctly added to the ConfigModule load array in the test setup. This ensures that the email configuration is available during testing.

apps/financial-aid/backend/src/environments/environment.ts (2)

Line range hint 18-23: Verify the email configuration in the production environment.

The emailOptions configuration is correctly defined in the production environment. Ensure that the values are correctly set in the environment variables.


Line range hint 41-46: Verify the email configuration in the development environment.

The emailOptions configuration is correctly defined in the development environment. Ensure that the values are correctly set in the environment variables.

libs/email-service/src/lib/email.service.ts (5)

8-8: Use specific import for ConfigType.

Importing ConfigType from @island.is/nest/config improves clarity and prevents potential conflicts with other types.


12-12: Import emailModuleConfig from the correct path.

Ensure emailModuleConfig is correctly imported to avoid runtime errors.


16-17: Configuration Injection in Constructor.

The injection of emailModuleConfig.KEY and its type definition using ConfigType<typeof emailModuleConfig> is a correct approach for configuration management.


Line range hint 24-60: Correct Configuration Handling in getTransport.

The getTransport method correctly utilizes the new configuration properties (useNodemailerApp, useTestAccount, region). This refactor improves maintainability and clarity.


89-93: Conditional Debug Logging for Email Preview.

The debug logging for email preview within NodemailerApp and TestAccount is correctly implemented and aids in debugging.

apps/services/auth/ids-api/src/app/app.module.ts (2)

23-23: Import smsModuleConfig for SMS Configuration.

The import of smsModuleConfig from @island.is/nova-sms is correctly added to manage SMS configurations.


70-70: Include smsModuleConfig in Configuration Load.

Adding smsModuleConfig to the ConfigModule.forRoot({ load: [...] }) array ensures that the SMS configuration is loaded globally, which is a correct approach.

libs/application/template-api-modules/src/lib/modules/templates/driving-license-submission/driving-license-submission.spec.ts (3)

15-15: Import emailModuleConfig for Email Configuration in Tests.

The import of emailModuleConfig from @island.is/email-service is correctly added to manage email configurations in tests.


19-19: Import ConfigModule for Configuration Management in Tests.

The import of ConfigModule from @island.is/nest/config is correctly added to manage configurations in tests.


27-32: Include emailModuleConfig in Test Configuration.

Adding emailModuleConfig to the ConfigModule.forRoot({ load: [...] }) array within the test setup ensures that the email configuration is loaded globally for the tests, which is a correct approach.

apps/application-system/api/src/environments/environment.ts (2)

17-19: Update Email Configuration for Development Environment.

The email configuration for the development environment is correctly updated to use Devland.is as the sender and [email protected] as the address.


Line range hint 50-52: Update Email Configuration for Production Environment.

The email configuration for the production environment is correctly updated to use environment variables for the sender and address.

libs/application/template-api-modules/src/lib/modules/templates/mortgage-certificate-submission/mortgage-certificate-submission.spec.ts (2)

13-13: Import Change Approved

The addition of emailModuleConfig to the imports is correct and aligns with the PR objectives.


43-46: Configuration Change Approved

The addition of emailModuleConfig to the ConfigModule.forRoot configuration is correct and aligns with the new configuration approach.

libs/email-service/src/lib/test/email.service.spec.ts (3)

3-5: Import Changes Approved

The adjustments to the import paths and the addition of emailModuleConfig are correct and align with the PR objectives.


83-83: Template Path Change Approved

The adjustment to the path for the email template image is correct.


92-92: Template Path Change Approved

The adjustment to the path for the email template image is correct.

libs/email-service/README.md (6)

17-17: Documentation Update Approved

The addition of instructions for using emailModuleConfig is clear, correct, and complete.


21-21: Documentation Update Approved

The addition of instructions for importing EmailModule is clear, correct, and complete.


25-25: Documentation Update Approved

The addition of instructions for adding emailModuleConfig to the App Module imports is clear, correct, and complete.


28-36: Documentation Update Approved

The detailed instructions for adding emailModuleConfig to the App Module imports are clear, correct, and complete.


38-38: Documentation Update Approved

The addition of instructions for the test account configuration is clear, correct, and complete.


40-43: Documentation Update Approved

The instructions for setting the environment variable to use the test account are clear, correct, and complete.

libs/api/domains/communications/src/lib/communications.service.spec.ts (2)

1-5: Import Change Approved

The addition of emailModuleConfig to the imports is correct and aligns with the PR objectives.


Line range hint 58-68:
Configuration Change Approved

The addition of emailModuleConfig to the ConfigModule.forRoot configuration is correct and aligns with the new configuration approach.

apps/application-system/api/src/app/app.module.ts (3)

55-55: Import added for smsModuleConfig.

The addition of the smsModuleConfig import looks correct. Ensure it is used appropriately in the configuration.


56-56: Import added for emailModuleConfig.

The addition of the emailModuleConfig import looks correct. Ensure it is used appropriately in the configuration.


110-111: Configuration added for smsModuleConfig and emailModuleConfig.

The addition of smsModuleConfig and emailModuleConfig to the ConfigModule.forRoot configuration looks correct and follows best practices.

apps/api/src/app/app.module.ts (2)

194-194: Import added for emailModuleConfig.

The addition of the emailModuleConfig import looks correct. Ensure it is used appropriately in the configuration.


418-418: Configuration added for emailModuleConfig.

The addition of emailModuleConfig to the ConfigModule.forRoot configuration looks correct and follows best practices.

Copy link
Member

@baering baering left a comment

Choose a reason for hiding this comment

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

Core files LGTM

@gudjong gudjong requested a review from RunarVestmann July 15, 2024 09:31
Copy link
Member

@kksteini kksteini left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@jonnigs jonnigs left a comment

Choose a reason for hiding this comment

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

LGTM, appart from the file that Kristófer is also changing

Copy link
Member

@RunarVestmann RunarVestmann left a comment

Choose a reason for hiding this comment

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

Stefna files LGTM

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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, codebase verification and nitpick comments (1)
libs/application/template-api-modules/src/lib/modules/templates/index.ts (1)

Verify the impact of removing services from services export.

The removal of GeneralFishingLicenseService, DataProtectionComplaintService, and EstateTemplateService from the services export affects several modules where these services are imported, provided, and exported. Ensure that these modules are updated to handle the absence of these services or replaced with alternatives.

  • libs/application/template-api-modules/src/lib/modules/templates/general-fishing-license/general-fishing-license.module.ts
  • libs/application/template-api-modules/src/lib/modules/templates/estate/estate.module.ts
  • libs/application/template-api-modules/src/lib/modules/templates/data-protection-complaint/data-protection-complaint.module.ts
Analysis chain

Line range hint 213-213:
Verify the impact of removing services.

The removal of GeneralFishingLicenseService, DataProtectionComplaintService, and EstateTemplateService from the services export may affect other parts of the codebase. Ensure that any dependent code is updated accordingly.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing services from the `services` export.

# Test: Search for usages of the removed services. Expect: No usages or updated usages.
rg --type typescript 'GeneralFishingLicenseService|DataProtectionComplaintService|EstateTemplateService'

Length of output: 141


Script:

#!/bin/bash
# Description: Verify the impact of removing services from the `services` export.

# Test: Search for usages of the removed services in TypeScript files. Expect: No usages or updated usages.
rg 'GeneralFishingLicenseService|DataProtectionComplaintService|EstateTemplateService' --glob '*.ts'

Length of output: 2968

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8c1b3ef and 78e049c.

Files selected for processing (1)
  • libs/application/template-api-modules/src/lib/modules/templates/index.ts (4 hunks)
Additional context used
Path-based instructions (1)
libs/application/template-api-modules/src/lib/modules/templates/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."
Additional comments not posted (1)
libs/application/template-api-modules/src/lib/modules/templates/index.ts (1)

Line range hint 161-161:
Verify the impact of removing modules.

The removal of GeneralFishingLicenseModule, DataProtectionComplaintModule, and EstateTemplateModule from the modules export may affect other parts of the codebase. Ensure that any dependent code is updated accordingly.

@gudjong gudjong added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Aug 9, 2024
@kodiakhq kodiakhq bot merged commit 28f6056 into main Aug 9, 2024
53 checks passed
@kodiakhq kodiakhq bot deleted the j-s/sms-email-config branch August 9, 2024 16:10
oskarjs pushed a commit that referenced this pull request Aug 20, 2024
* Moves sms config from environment file

* Updates test

* Moves email config to config file

* Removes deprecsted options form environment file

* Updates tests

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
jonnigs pushed a commit that referenced this pull request Sep 2, 2024
* Moves sms config from environment file

* Updates test

* Moves email config to config file

* Removes deprecsted options form environment file

* Updates tests

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated:automerge (Disabled) Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.