IBFEC-38 – Backend - Save infos on Singup user

Questions:

  •  Possibles questions about this feature

Technical Refinement

Description

  • SignUp

    • Create a feature flag:

      enable-required-acceptance-agreement-info
    • intl-user-service:

    • intl-packages:

    • Inside intl-packages/packages/users/, We will need to run the command to create intl-user-service dependencies:

    • We will need to add the requiredAcceptanceAgreementInfo attribute on interface IUserSignup

      • path: intl-packages/packages/users/src/schemata.ts

    • Also, we will add the requiredAcceptanceDocumentInfo of the destructuring from iUserSignup:

      • path: intl-packages/packages/users/src/services/user-service/user-service-client.ts

    • And we will include the requiredAcceptanceDocumentInfo as the parameter iSignupRequest to call signUpUser from intl-user-service

  • intl-whitelabel-graphql:

    • First, we need to update the intl-packages version, running the command:

    • Many packages will be updated, we can to discard all, except of change version "@rbilabs/users" locally intl-whitelabel-graphql/package.json

    • We will need to add a new attribute: requiredAcceptanceAgreementInfo: Boolean on input SignUpUserInput

      • path: intl-whitelabel-graphql/src/functions/graphql/schemas/users.gql

      • After that, we will need to run the command to create graphql dependencies:

        • On file: intl-whitelabel-graphql/src/functions/graphql/generated/graphql.ts, probably, will be many changes, but we can to discard all, except of change locally in the interface ISignUpUserInput

        • We will need to add too, the same attribute on interface IUserSignup

          • path: intl-whitelabel-graphql/src/functions/graphql/providers/users.ts

        • On method signUpUser, we will add the requiredAcceptanceAgreementInfo of the destructuring from input:

          • path: intl-whitelabel-graphql/src/functions/graphql/providers/users.ts

        • After that, we will need to attribute requiredAcceptanceAgreementInfo on the call method this.userClientSignUp

  • Sanity

    • rbi-whitelabel-cms:

      • We will add a new field:

        • path: rbi-whitelabel-cms/schemas/appData/documents/staticPage.tsx

  • intl-whitelabel-app:

    • We will need to run the command to create rbi-graphql dependencies:

      • On file: intl-whitelabel-app/workspaces/frontend/src/generated/rbi-graphql.tsx will be many changes, but we can to discard all, except of change locally in the interface ISignUpUserInput:

  • Get Sanity _updatedAt

  • Now, we will create a new constant:

    • path: intl-whitelabel-app/workspaces/frontend/src/remote/queries/static-page.ts

    • We will change the parameters of the hook

      • path: intl-whitelabel-app/workspaces/frontend/src/state/static-page-manager/hooks/use-static-page-routes.ts

        • before

        • after

      • And will change the call from GetStaticPageRoutesQuery to _queryStaticPage

        • before

        • after

  • We will need to get the _updatedAt from sanity, for it, we will create a function:

    • path: intl-whitelabel-app/workspaces/frontend/src/state/auth/hooks/use-account-authentication.ts

    • And import the hooks:

    • And add the useEffect:

    • In the same file, we will need to call signUpMutation, on method signUp, sending the new attribute requiredAcceptanceAgreementInfo

Screenshots

TODO - images or links to images about this feature

POC

TODO - POC used to concept proof

Impact Analysis

All signup flow

Unit Test

Update the unit tests:

  • intl-whitelabel-app/workspaces/frontend/src/state/auth/hooks/use-account-authentication.test.ts

MOCKS

  • To mock:

    • path: intl-user-service/src/users/user-signup.service.ts

    • On constructor class SignupInitializer, we will add private readonly preSignupService: PreSignupService

    • And will replace all method signUpUser to:

    • In the same file on class UserSignupService, we will change the constructor

    • On file intl-user-service/src/users/users.module.ts, we will add the service on @Module in the end file

    • After, we will call the signUp mutation from https://studio.apollographql.com/sandbox/explorer, just start the intl-user-service and call signUp

Useful Links

Workflows: https://lucid.app/lucidchart/56ec4afb-d8ea-42a2-a2dd-3cc38bfd87e7/edit?viewport_loc=-11%2C-75%2C2219%2C1004%2C0_0&invitationId=inv_57ecb6ad-cde2-4c13-be58-853204ed3007

Existent behavior: https://rbictg.atlassian.net/wiki/spaces/IN/pages/4044391349