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(user-profile): Remove migration worker and make user profile strict #14791

Merged
merged 3 commits into from
Jun 10, 2024

Conversation

saevarma
Copy link
Member

@saevarma saevarma commented May 14, 2024

Corresponding Helm cleanup PR
https://github.com/island-is/helm/pull/785

What

  • Removing all migration worker related code
  • Make user profile service TS strict

Why

  • Migration was a one time job which is done.
  • TS strict helps detect issues during build time.

Screenshots / Gifs

N/A

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

  • New Features

    • Updated email and SMS verification logic to allow optional fields and improve flexibility.
    • Enhanced user profile service to handle default values more effectively.
  • Bug Fixes

    • Fixed inconsistencies in user profile data handling, ensuring reliable data updates and error handling.
  • Refactor

    • Simplified configuration and removed deprecated worker-related settings.
    • Streamlined code by consolidating configuration settings and removing unnecessary variables.
  • Chores

    • Removed outdated migration tables and worker configurations from the database and project settings.
    • Updated environment configurations to remove unused variables and settings.
  • Documentation

    • Added comments and documentation for new features and refactored code to improve clarity.

@saevarma saevarma requested review from a team as code owners May 14, 2024 12:00
Copy link
Contributor

coderabbitai bot commented May 14, 2024

Walkthrough

The recent updates to the user-profile service focus on simplifying configurations, removing deprecated worker-related functionalities, and enhancing the flexibility of data models and DTOs. These changes include dropping unused environment variables, refactoring service setup, updating model attribute types, and modifying DTO properties to allow optional and nullable values. Additionally, a database migration script has been introduced to drop an obsolete table.

Changes

File Path Change Summary
.../service-portal-api.ts Removed worker configurations, updated environment variables, and refactored service setup.
.../migrations/20240513221742-remove-migration-table.js Added a migration script to drop the user_profile_advania table.
.../project.json Removed worker configuration and adjusted migration command.
.../dto/confirmEmailDto.ts Made the hash property optional.
.../dto/confirmSmsDto.ts Made the code property optional.
.../emailVerification.model.ts Updated class to use InferAttributes and InferCreationAttributes, and made several properties CreationOptional.
.../smsVerification.model.ts Updated class to use InferAttributes and InferCreationAttributes, and made several properties CreationOptional.
.../userDeviceTokens.model.ts Updated class to use InferAttributes and InferCreationAttributes, and made several properties CreationOptional.
.../userProfile.controller.ts Imported Locale and simplified error handling.
.../userProfile.service.ts Removed findById method and adjusted error handling.
.../userToken.controller.ts Changed return type of findOneByNationalId to `Promise<UserProfile
.../utils/format-phone-number.ts Made phoneNumber parameter optional.
.../v2/dto/actor-profile.dto.ts Allowed email and locale fields to be null.
.../v2/dto/islyklar-upsert.dto.ts Added non-null assertion operator to nationalId.
.../v2/dto/post-nudge.dto.ts Added non-null assertion operator to nudgeType.
.../v2/dto/user-profile.dto.ts Made several fields nullable and added non-null assertion operator to nationalId.
.../v2/user-profile.module.ts Consolidated IslykillApiModule configuration using spread operator.
.../v2/user-profile.service.ts Added default values for several fields and used non-null assertion operators.
.../config.ts Removed workerProcessPageSize from schema definition.
.../environment.ts Added default empty strings for various configurations.
.../main.ts Removed conditional logic for job type and streamlined bootstrap function call.
.../tsconfig.json Removed strict, experimentalDecorators, and allowJs settings.
.../values.dev.yaml Removed USER_PROFILE_WORKER_PAGE_SIZE and service-portal-api-worker configuration.
.../values.prod.yaml Removed USER_PROFILE_WORKER_PAGE_SIZE and service-portal-api-worker configuration.
.../values.staging.yaml Removed USER_PROFILE_WORKER_PAGE_SIZE and service-portal-api-worker configuration.
.../uber-charts/islandis.ts Removed servicePortalUserProfileWorker setup.

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 Configration 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
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 ee61ab5 and 74cb917.
Files selected for processing (26)
  • apps/services/user-profile/infra/service-portal-api.ts (3 hunks)
  • apps/services/user-profile/migrations/20240513221742-remove-migration-table.js (1 hunks)
  • apps/services/user-profile/project.json (2 hunks)
  • apps/services/user-profile/src/app/user-profile/dto/confirmEmailDto.ts (1 hunks)
  • apps/services/user-profile/src/app/user-profile/dto/confirmSmsDto.ts (1 hunks)
  • apps/services/user-profile/src/app/user-profile/emailVerification.model.ts (3 hunks)
  • apps/services/user-profile/src/app/user-profile/smsVerification.model.ts (3 hunks)
  • apps/services/user-profile/src/app/user-profile/userDeviceTokens.model.ts (2 hunks)
  • apps/services/user-profile/src/app/user-profile/userProfile.controller.ts (4 hunks)
  • apps/services/user-profile/src/app/user-profile/userProfile.service.ts (2 hunks)
  • apps/services/user-profile/src/app/user-profile/userToken.controller.ts (1 hunks)
  • apps/services/user-profile/src/app/utils/format-phone-number.ts (1 hunks)
  • apps/services/user-profile/src/app/v2/dto/actor-profile.dto.ts (2 hunks)
  • apps/services/user-profile/src/app/v2/dto/islyklar-upsert.dto.ts (1 hunks)
  • apps/services/user-profile/src/app/v2/dto/post-nudge.dto.ts (1 hunks)
  • apps/services/user-profile/src/app/v2/dto/user-profile.dto.ts (1 hunks)
  • apps/services/user-profile/src/app/v2/user-profile.module.ts (1 hunks)
  • apps/services/user-profile/src/app/v2/user-profile.service.ts (9 hunks)
  • apps/services/user-profile/src/config.ts (2 hunks)
  • apps/services/user-profile/src/environments/environment.ts (3 hunks)
  • apps/services/user-profile/src/main.ts (1 hunks)
  • apps/services/user-profile/tsconfig.json (1 hunks)
  • charts/islandis/values.dev.yaml (2 hunks)
  • charts/islandis/values.prod.yaml (2 hunks)
  • charts/islandis/values.staging.yaml (2 hunks)
  • infra/src/uber-charts/islandis.ts (5 hunks)
Files skipped from review due to trivial changes (7)
  • apps/services/user-profile/migrations/20240513221742-remove-migration-table.js
  • apps/services/user-profile/src/app/utils/format-phone-number.ts
  • apps/services/user-profile/src/environments/environment.ts
  • apps/services/user-profile/tsconfig.json
  • charts/islandis/values.dev.yaml
  • charts/islandis/values.prod.yaml
  • charts/islandis/values.staging.yaml
Additional Context Used
Path-based Instructions (18)
apps/services/user-profile/src/app/v2/dto/islyklar-upsert.dto.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/v2/dto/post-nudge.dto.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/user-profile/dto/confirmEmailDto.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/user-profile/dto/confirmSmsDto.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/main.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/config.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/user-profile/userDeviceTokens.model.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/v2/dto/actor-profile.dto.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/v2/dto/user-profile.dto.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/user-profile/emailVerification.model.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/user-profile/smsVerification.model.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/v2/user-profile.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/user-profile/userToken.controller.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/user-profile/userProfile.service.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/infra/service-portal-api.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/project.json (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/user-profile/userProfile.controller.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/v2/user-profile.service.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."
Additional comments not posted (38)
apps/services/user-profile/src/app/v2/dto/islyklar-upsert.dto.ts (1)

2-2: Ensure nationalId is always provided.

The non-null assertion operator (!) indicates that nationalId is always expected to be provided. Ensure that this property is correctly validated and assigned in the codebase to avoid runtime errors.

apps/services/user-profile/src/app/v2/dto/post-nudge.dto.ts (1)

9-9: Ensure nudgeType is always provided.

The non-null assertion operator (!) indicates that nudgeType is always expected to be provided. Ensure that this property is correctly validated and assigned in the codebase to avoid runtime errors.

apps/services/user-profile/src/app/user-profile/dto/confirmEmailDto.ts (1)

7-8: Ensure hash is correctly handled when optional.

The hash property is now optional. Ensure that the code handling this property correctly accounts for the possibility of it being undefined.

apps/services/user-profile/src/app/user-profile/dto/confirmSmsDto.ts (1)

7-8: Ensure code is correctly handled when optional.

The code property is now optional. Ensure that the code handling this property correctly accounts for the possibility of it being undefined.

apps/services/user-profile/src/main.ts (1)

1-13: Ensure openApi and versioning are correctly configured.

The openApi configuration and versioning have been added to the bootstrap configuration. Ensure that these configurations are correctly set up and tested to avoid runtime issues.

apps/services/user-profile/src/config.ts (1)

Line range hint 1-27: Ensure removal of workerProcessPageSize is consistent.

The workerProcessPageSize field has been removed from the schema definition. Ensure that this field is no longer used or referenced in the codebase to avoid runtime errors.

apps/services/user-profile/src/app/user-profile/userDeviceTokens.model.ts (1)

34-40: Ensure CreationOptional properties are correctly handled.

The properties id, created, and modified have been changed to use CreationOptional. Ensure that these properties are correctly handled during model creation and updates to avoid runtime errors.

apps/services/user-profile/src/app/v2/dto/actor-profile.dto.ts (2)

35-35: Ensure email is correctly handled when nullable.

The email property is now nullable. Ensure that the code handling this property correctly accounts for the possibility of it being null.


48-48: Ensure locale is correctly handled when nullable.

The locale property is now nullable. Ensure that the code handling this property correctly accounts for the possibility of it being null.

apps/services/user-profile/src/app/v2/dto/user-profile.dto.ts (4)

16-16: Ensure that the nationalId property is always provided when creating or updating a UserProfileDto instance.


21-21: The email property is now optional and can be null. Ensure that the rest of the codebase handles this property correctly when it is null.


26-26: The mobilePhoneNumber property is now optional and can be null. Ensure that the rest of the codebase handles this property correctly when it is null.


31-31: The locale property is now optional and can be null. Ensure that the rest of the codebase handles this property correctly when it is null.

apps/services/user-profile/src/app/user-profile/emailVerification.model.ts (6)

10-14: The import of CreationOptional and InferAttributes, InferCreationAttributes from sequelize is appropriate for making some properties optional during creation.


25-28: The EmailVerification class now extends Model<InferAttributes<EmailVerification>, InferCreationAttributes<EmailVerification>>, which allows for more flexible attribute definitions.


36-36: The id property is now optional during creation, which is suitable for auto-generated IDs.


40-40: The created property is now optional during creation, which is appropriate for auto-generated timestamps.


44-44: The modified property is now optional during creation, which is appropriate for auto-generated timestamps.


58-58: The confirmed property is now optional during creation, which is suitable for default values.

apps/services/user-profile/src/app/user-profile/smsVerification.model.ts (6)

10-14: The import of CreationOptional and InferAttributes, InferCreationAttributes from sequelize is appropriate for making some properties optional during creation.


25-28: The SmsVerification class now extends Model<InferAttributes<SmsVerification>, InferCreationAttributes<SmsVerification>>, which allows for more flexible attribute definitions.


36-36: The id property is now optional during creation, which is suitable for auto-generated IDs.


40-40: The created property is now optional during creation, which is appropriate for auto-generated timestamps.


44-44: The modified property is now optional during creation, which is appropriate for auto-generated timestamps.


64-64: The confirmed property is now optional during creation, which is suitable for default values.

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

35-35: The use of the spread operator to consolidate the IslykillApiModule configuration is a good practice for cleaner and more maintainable code.

apps/services/user-profile/src/app/user-profile/userToken.controller.ts (1)

49-49: The findOneByNationalId method now returns Promise<UserProfile | null>, which is a more accurate representation of the possible return values. Ensure that the rest of the codebase handles the null case correctly.

apps/services/user-profile/src/app/user-profile/userProfile.service.ts (1)

70-70: The error handling in the addDeviceToken method now throws a BadRequestException with the error details. This is a good practice for providing more informative error messages.

apps/services/user-profile/infra/service-portal-api.ts (1)

Line range hint 1-99: The removal of worker-related configurations and the update of environment variables are appropriate given the completion of the migration job. Ensure that all references to the removed configurations are also cleaned up in the codebase.

apps/services/user-profile/project.json (1)

94-94: The removal of the worker configuration from project.json is appropriate given the completion of the migration job. Ensure that all references to the worker configuration are also cleaned up in the codebase.

infra/src/uber-charts/islandis.ts (1)

13-13: Ensure the servicePortalApiSetup import is necessary and correctly used in the file.

#!/bin/bash
# Description: Verify the usage of `servicePortalApiSetup` in the file.

# Test: Search for the usage of `servicePortalApiSetup`. Expect: At least one usage.
rg --type js 'servicePortalApiSetup' infra/src/uber-charts/islandis.ts
apps/services/user-profile/src/app/user-profile/userProfile.controller.ts (2)

51-51: Ensure the Locale import is necessary and correctly used in the file.

#!/bin/bash
# Description: Verify the usage of `Locale` in the file.

# Test: Search for the usage of `Locale`. Expect: At least one usage.
rg --type ts 'Locale' apps/services/user-profile/src/app/user-profile/userProfile.controller.ts

116-116: Ensure the default locale assignment to Locale.ICELANDIC is intended and correct.

#!/bin/bash
# Description: Verify the default locale assignment in the `getActorLocale` method.

# Test: Check the usage of `Locale.ICELANDIC`. Expect: Correct default assignment.
rg --type ts 'Locale.ICELANDIC' apps/services/user-profile/src/app/user-profile/userProfile.controller.ts
apps/services/user-profile/src/app/v2/user-profile.service.ts (5)

76-77: Ensure the default values for mobilePhoneNumberVerified and emailVerified are intended and correct.

#!/bin/bash
# Description: Verify the default values for `mobilePhoneNumberVerified` and `emailVerified` in the `findAllBySearchTerm` method.

# Test: Check the usage of default values. Expect: Correct default assignment.
rg --type ts 'mobilePhoneNumberVerified' apps/services/user-profile/src/app/v2/user-profile.service.ts
rg --type ts 'emailVerified' apps/services/user-profile/src/app/v2/user-profile.service.ts

161-162: Ensure the non-null assertion operators (!) for email and mobilePhoneNumber are safe and intended.

#!/bin/bash
# Description: Verify the usage of non-null assertion operators in the `patch` method.

# Test: Check the usage of non-null assertion operators. Expect: Safe and intended usage.
rg --type ts 'email!' apps/services/user-profile/src/app/v2/user-profile.service.ts
rg --type ts 'mobilePhoneNumber!' apps/services/user-profile/src/app/v2/user-profile.service.ts

Also applies to: 183-184


220-220: Ensure the conditional assignments for emailStatus and mobileStatus are correct and intended.

#!/bin/bash
# Description: Verify the conditional assignments for `emailStatus` and `mobileStatus` in the `patch` method.

# Test: Check the usage of conditional assignments. Expect: Correct and intended usage.
rg --type ts 'emailStatus' apps/services/user-profile/src/app/v2/user-profile.service.ts
rg --type ts 'mobileStatus' apps/services/user-profile/src/app/v2/user-profile.service.ts

Also applies to: 229-229


503-506: Ensure the handling of optional fields in the hasUnverifiedOrNotDefinedData method is correct and intended.

#!/bin/bash
# Description: Verify the handling of optional fields in the `hasUnverifiedOrNotDefinedData` method.

# Test: Check the usage of optional fields. Expect: Correct and intended handling.
rg --type ts 'hasUnverifiedOrNotDefinedData' apps/services/user-profile/src/app/v2/user-profile.service.ts

555-556: Ensure the handling of optional fields in the filterByClientTypeAndRestrictionDate method is correct and intended.

#!/bin/bash
# Description: Verify the handling of optional fields in the `filterByClientTypeAndRestrictionDate` method.

# Test: Check the usage of optional fields. Expect: Correct and intended handling.
rg --type ts 'filterByClientTypeAndRestrictionDate' apps/services/user-profile/src/app/v2/user-profile.service.ts

Also applies to: 565-580

Copy link
Member

@lodmfjord lodmfjord left a comment

Choose a reason for hiding this comment

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

LGTM

@andes-it
Copy link
Member

This PR's had a 15-day siesta. Lost its spark, did it? It's making an exit in 5 days unless the stale label disappears.

@andes-it andes-it added the stale Issue or pull request is stale label May 30, 2024
@andes-it
Copy link
Member

andes-it commented Jun 4, 2024

This PR closed its doors. Sat around for a day after the stale tag, then reckoned it's not worth the fuss.

@andes-it andes-it closed this Jun 4, 2024
@saevarma saevarma reopened this Jun 9, 2024
@saevarma saevarma force-pushed the user-profile/remove-worker branch from 74cb917 to de5a8d2 Compare June 9, 2024 22:02
@andes-it andes-it removed the stale Issue or pull request is stale label Jun 10, 2024
@saevarma saevarma requested a review from a team as a code owner June 10, 2024 21:37
@saevarma saevarma added the automerge Merge this PR as soon as all checks pass label Jun 10, 2024
Copy link

codecov bot commented Jun 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.01%. Comparing base (f8f6646) to head (04a67a9).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #14791      +/-   ##
==========================================
- Coverage   37.02%   37.01%   -0.02%     
==========================================
  Files        6424     6424              
  Lines      130995   130947      -48     
  Branches    37481    37461      -20     
==========================================
- Hits        48505    48467      -38     
+ Misses      82490    82480      -10     
Flag Coverage Δ
api 3.44% <ø> (ø)

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

Files Coverage Δ
...s-api/src/app/user-profile/user-profile.service.ts 93.52% <ø> (-0.10%) ⬇️
...notificationsWorker/notificationsWorker.service.ts 93.10% <ø> (ø)
...rofile/src/app/user-profile/dto/confirmEmailDto.ts 100.00% <ø> (ø)
...-profile/src/app/user-profile/dto/confirmSmsDto.ts 100.00% <ø> (ø)
...le/src/app/user-profile/emailVerification.model.ts 100.00% <ø> (ø)
...file/src/app/user-profile/smsVerification.model.ts 100.00% <ø> (ø)
...ile/src/app/user-profile/userDeviceTokens.model.ts 100.00% <ø> (ø)
...ile/src/app/user-profile/userProfile.controller.ts 82.19% <ø> (-0.25%) ⬇️
...rofile/src/app/user-profile/userProfile.service.ts 87.09% <ø> (+7.68%) ⬆️
...ofile/src/app/user-profile/userToken.controller.ts 60.86% <ø> (-1.64%) ⬇️
... and 10 more

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 f8f6646...04a67a9. Read the comment docs.

@datadog-island-is
Copy link

Datadog Report

All test runs 6dc6051 🔗

6 Total Test Services: 0 Failed, 6 Passed
🔻 Test Sessions change in coverage: 1 decreased (-0.71%), 2 increased, 8 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
api 0 0 0 4 0 3.5s 1 no change Link
application-system-api 0 0 0 111 2 3m 46.36s 1 no change Link
application-template-api-modules 0 0 0 109 0 1m 53.29s 1 no change Link
services-auth-ids-api 0 0 0 215 0 1m 48.75s 1 increased (+0.04%) Link
services-user-notification 0 0 0 48 0 1m 37.87s 1 increased (+0.04%) Link
services-user-profile 0 0 0 131 0 1m 23.74s 1 decreased (-0.71%) Link

🔻 Code Coverage Decreases vs Default Branch (1)

  • services-user-profile - jest 52.3% (-0.71%) - Details

@kodiakhq kodiakhq bot merged commit d8665eb into main Jun 10, 2024
44 checks passed
@kodiakhq kodiakhq bot deleted the user-profile/remove-worker branch June 10, 2024 21:57
kodiakhq bot added a commit that referenced this pull request Jun 11, 2024
* fix(inheritance-report): EFS touch ups (#15161)

* fix(inheritance-report): EFS touch ups

* done texts

* tweaks

* texts

* removed unused files

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* feat(license-service): less contentful (#15088)

* feat: less contentful

* chore:use reaodnly

* chore: remove unnecessary

* chore: console logs

---------

Co-authored-by: Þorkell Máni Þorkelsson <mani@hugsmidjan.is>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* chore(user-profile): Remove migration worker and make user profile strict (#14791)

* Remove worker and make user profile strict

* Fix dependant type errors.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* feat(j-s): Actor title in indictment confirmation pt2 (#15149)

* Convert px to pts

* Use Pts instead of pxls

* Refactoring

* Revert change

* Tweeks to COA

* Tweeks to COA

* Smaller COA

* Cleanup

* Make title optional

* Don't use Beygla for confirmation

* Move confirmation stamp from pxls to pts

* Remove debug code

* Fix lint

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* feat(driving-instructor-registrations): Add tabs for B and BE license (#14609)

* add tabs for B and BE license

* set no-cache on query

* fetch license category specific book

* only display tabs for teachers with multiple rights

* add feature flag

* remove console logs

* address comments

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* fix: formstepper formatMessage

* chore: simplify slightly

* fix(ojoi): Datepicker default date (#15177)

---------

Co-authored-by: albinagu <47886428+albinagu@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Þorkell Máni Þorkelsson <wowthorkell@gmail.com>
Co-authored-by: Þorkell Máni Þorkelsson <mani@hugsmidjan.is>
Co-authored-by: Sævar Már Atlason <54210288+saevarma@users.noreply.github.com>
Co-authored-by: Ívar Oddsson <ivaroddsson@gmail.com>
Co-authored-by: juni-haukur <158475136+juni-haukur@users.noreply.github.com>
Co-authored-by: Þórður H <thordur@hugsmidjan.is>
sigruntg pushed a commit that referenced this pull request Jun 12, 2024
…rict (#14791)

* Remove worker and make user profile strict

* Fix dependant type errors.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
lodmfjord pushed a commit that referenced this pull request Jun 14, 2024
…rict (#14791)

* Remove worker and make user profile strict

* Fix dependant type errors.

---------

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
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants