Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Zenuml sequence macro lite
uuid6b1e5f66-1cf0-42a2-b0fc-0b8fb97ceebd
customContentId4808409158
updatedAt2024-06-18T16:36:01Z

Braze

Proposal

Solution 1 - Add isBlocked field in User DynamoDB item

...

Zenuml sequence macro lite
uuidb71e9351-b423-4ec1-ba13-9349ce24c6aa
customContentId4810997767
updatedAt2024-0607-19T0101T13:5624:16Z18Z

Blocked user attempts login

Zenuml sequence macro lite
uuid9e561ae4-39d8-4c19-81ba-99e914394741
customContentId4810997776
updatedAt2024-06-19T02:01:46Z

User is blocked while logged in WL → Add getMe query when user goes to cart page

Zenuml sequence macro lite
uuid5495a0ee-0cbb-4042-8755-8a716fa406f1
customContentId4810965031
updatedAt2024-06-19T02:08:58Z

User is blocked while logged in WL → Validate blocked user on gateway

Zenuml sequence macro lite
uuidee40a82d-c05d-4041-a5ed-e235ab9900cd
customContentId4836786181
updatedAt2024-07-08T04:37:55Z

Task breakdown

Changes in intl-whitelabel-cms

Expand
titleintl-whitelabel-cms
  1. Create email template for blocked user notification

    1. Templates should use the Liquid syntax

  2. Create email template for unblocked user notification

    1. Templates should use the Liquid syntax

Changes in intl-notifications-service

Expand
title

...

intl-users-service
  1. Create

...

  1. send block notification endpoint

    1. POST /api/v1/email/send-block

    2. Create block TemplateType

    3. Receive SendEmailRequestDto as payload

  2. Create send unblock notification endpoint

    1. POST /api/v1/email/send-unblock

    2. Create unblock TemplateType

    3. Receive SendEmailRequestDto as payload

Changes in intl-users-service

Expand
titleintl-userusers-service
  1. Create block user endpoint

    1. Endpoint: POST /api/v1/users/block-user/{cognitoId}

    2. Add isBlocked field to user details base interface

      1. The field should be returned in GET user endpoint

    3. Use UpdateService to set is blocked to true

    4. user notification-service to send email

    5. remove user from braze campaings

  2. Create unblock user endpoint

...

intl-user-service
Expand
title
    1. Endpoint: POST /api/v1/users/unblock-user/{cognitoId}

    2. Use UpdateService to set is blocked to false

    3. user notification-service to send email

    4. return user to braze campaings

  1. Prevent blocked users from signing in

...

title
Expand
intl-user-service
    1. Create UserBlockedError apollo error

(ex:)
    1. Add isBlocked validation in the listed resolvers:

      • createOTP

      • createLoginOTP

      • signInJWT

      • socialLogin

    2. User not found validation for reference

Changes in intl-packages

Expand
titleintl-packates/packages/user
  1. Add isBlocked to userDetails type

  2. Create method to block user

    1. Should use axios to trigger a request to user service

  3. Create method to unblock user

    1. Should use axios to trigger a request to user service

Changes in intl-whitelable-graphql

Expand
titleintl-whitelable-graphql
  1. Add isBlocked to userDetails type

Changes in intl-admin-app

Expand
titleintl-admin-app
  1. Create block status card on customer page

    1. Update users package

    2. Add isBlocked to user details type in graphql

    3. Add isBlocked to customer query in frontend

    4. Create card to display user status

  2. Create mutation to block the user

    1. Use blockUser exposed in the user package (instantiated insider the user provider)

    2. Create auditLog for the customer blocking

      1. Create new audit action block-user

      2. Example of audit log

    3. Create block customer permission

      1. Permission: “RBI.supportActions.customer.block”

      2. Add “RBI.supportActions.customer.*” to rolePermissionMapping in agent role for BK,PLK,TH and FHS

  3. Implement block user in front end

    1. Create confirmation modal

    2. Check if agent has permission to change customer status

      1. TBD: which permission is needed

    3. Trigger block mutation on confirmation

  4. Create mutation to unblock the user

    1. Use unblockUser exposed in the user package (instantiated insider the user provider)

    2. Create auditLog for the customer unblocking

      1. Create new audit action unblock-user

      2. Example of audit log

    3. Check if the agent has permission to unblock

      1. Permission: “RBI.supportActions.customer.block”

  5. Implement unblock user in front end

    1. Create confirmation modal

    2. Check if agent has permission to change customer status

      1. TBD: which permission is needed

    3. Trigger unblock mutation on confirmation

Changes in intl-whitelable-app

Expand
titleintl-whitelable-app
  1. Create blocked account modal

  2. Handle UserBlockedError in signIn

    1. Option 1

      1. Create onError handler for signIn mutations

      2. If UserBlockedError:

        1. sign out user

        2. display blocked account modal

      3. Add onError parameter to the following signIn mutations

        1. signInWithOtp

        2. signInWithJwt

        3. signInSocialLogin

    2. Option 2

      1. Monitor error value of all the mutations listed above with useEffect

      2. If UserBlockedError:

        1. sign out user

        2. display blocked account modal

  3. Validate if user is blocked before proceeding to cart

    1. use getMe query to check user status

    2. if isBlocked

      1. sign out user

      2. display blocked account modal

Solution 2 - Disable user in cognito