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

refactor: use neverthrow in /:transactionId/otp/verify (part 6) #1455

Merged
merged 15 commits into from
Mar 30, 2021

Conversation

mantariksh
Copy link
Contributor

@mantariksh mantariksh commented Mar 24, 2021

Builds on #1454

Problem

See #1450

Solution

This is the 6th part of the solution, which focuses on the POST /transaction/:transactionId/otp/verify endpoint. It includes the following additional improvements:

  • Deletes the old verification.(controller|service).spec.ts and replaces them with verification.(controller|service).new.spec.ts
  • Adds factory tests
  • Logs form ID in all verification service functions

For reviewers

Note that in verification.service.spec.ts and verification.controller.spec.ts, the only new tests added were for verifyOtp and handleVerifyOtp respectively. The rest of the changes are due to the file renaming.

Tests

See #1450

@mantariksh mantariksh force-pushed the vfn-neverthrow/verify-otp branch from a799093 to dfbe29a Compare March 25, 2021 04:24
@mantariksh mantariksh force-pushed the vfn-neverthrow/verify-otp branch from 0a600b2 to a0c7b2b Compare March 26, 2021 10:39
@mantariksh mantariksh force-pushed the vfn-neverthrow/send-otp branch from 17bda3e to c539a8e Compare March 26, 2021 10:58
@mantariksh mantariksh force-pushed the vfn-neverthrow/verify-otp branch from a0c7b2b to a5f2391 Compare March 26, 2021 11:03
@mantariksh mantariksh force-pushed the vfn-neverthrow/send-otp branch from c539a8e to 333c77a Compare March 29, 2021 03:19
@mantariksh mantariksh force-pushed the vfn-neverthrow/verify-otp branch from a5f2391 to 65534a5 Compare March 29, 2021 03:19
@mantariksh mantariksh force-pushed the vfn-neverthrow/send-otp branch from 333c77a to 3384ec0 Compare March 29, 2021 08:02
@mantariksh mantariksh force-pushed the vfn-neverthrow/verify-otp branch from 65534a5 to c1fe909 Compare March 29, 2021 08:03
@mantariksh mantariksh force-pushed the vfn-neverthrow/send-otp branch 2 times, most recently from 0c41ca8 to 9036277 Compare March 30, 2021 02:18
@mantariksh
Copy link
Contributor Author

mantariksh commented Mar 30, 2021

TODO from previous PRs

  • Use ErrorDto type
  • Use transformMongoError
  • Set default mock value in beforeAll instead of using mockReset
  • Use date-fns
  • Log form ID as well as transaction/field ID

@mantariksh mantariksh force-pushed the vfn-neverthrow/verify-otp branch from c1fe909 to c8f8907 Compare March 30, 2021 05:11
@mantariksh mantariksh changed the base branch from vfn-neverthrow/send-otp to develop March 30, 2021 05:11
Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

lgtm

@mantariksh mantariksh force-pushed the vfn-neverthrow/verify-otp branch from c8f8907 to 55042bf Compare March 30, 2021 08:37
@mantariksh mantariksh merged commit 2926212 into develop Mar 30, 2021
@tshuli tshuli mentioned this pull request Apr 6, 2021
@mantariksh mantariksh deleted the vfn-neverthrow/verify-otp branch April 13, 2021 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants