-
Notifications
You must be signed in to change notification settings - Fork 78
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: migrate SmsFactory to Typescript #387
Conversation
import { sendAdminContactOtp, sendVerificationOtp } from './sms.service' | ||
import { TwilioConfig } from './sms.types' | ||
|
||
interface ISmsFactory { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move these to the types folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use typeof
to get the types leh, I scared circular dependency :X
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment for future developers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for picking up my slack and adding tests!
Problem
This PR migrates SmsFactory to Typescript.
sms.*
related files are also moved toservices/sms
directory for better encapsulation.Related to #144
Note that this PR is purely for migrating sms factory and encapsulating related files under a service directory. There are still work to do regarding the sms module -- adding specific errors, adding neverthrow to the service functions, etc. This should be done in a separate PR.
Solution
Improvements:
SmsFactory
is migrated to Typescriptservices/sms/__tests__
Tests
sms.service
has now been rewritten in jest with Typescript with additional tests forsendAdminContactOtp
sms.factory