-
Notifications
You must be signed in to change notification settings - Fork 5
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
backend/feat/#146 : Adding extra params to send sms #148
base: main
Are you sure you want to change the base?
Conversation
@@ -21,6 +21,8 @@ module Kernel.External.SMS.Interface.Types | |||
where | |||
|
|||
import Data.ByteString.Lazy (fromStrict, toStrict) | |||
-- import qualified Kernel.External.SMS.ExotelSms.Types as ExotelType |
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.
redundant comment
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'll remove
@@ -43,9 +46,20 @@ data SmsServiceConfig = MyValueFirstConfig MyValueFirst.MyValueFirstCfg | Exotel | |||
data SendSMSReq = SendSMSReq | |||
{ smsBody :: Text, | |||
phoneNumber :: Text, | |||
sender :: Text | |||
sender :: Text, | |||
smsType :: Maybe SMSType, |
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.
why can't we make it mandatory?
then we don't need this default with empty string maybe "" toUrlPiece smsType
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.
It is because it is an optional parameter for exotel api so if in case we don't want to pass it then also the exotel api should work
0095297
to
0d21223
Compare
0d21223
to
0c4a244
Compare
data PriorityType = Normal | High | ||
deriving (Generic, FromJSON, ToJSON, Show, Eq) | ||
|
||
instance ToHttpApiData SMSType where |
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.
why not just use toLower?
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.
for PriorityType done the changes
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.
Why can't you do for this too?
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.
why not just use toLower?
toLower is not suitable because we need convert camel to snake also
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.
Then aesonPrefix snakeCase
can be used?
@@ -51,7 +51,9 @@ sendOTP exoCfg SendSMSReq {..} = do | |||
BasicAuthData | |||
(DT.encodeUtf8 apiKey) | |||
(DT.encodeUtf8 apiToken) | |||
res <- Ex.sendOTPApi exoUrl authData sid exoOtpSmsTemplate exoPhoneNumber senderName | |||
exoSmsType = toUrlPiece IT.Transactional |
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.
why to call toUrlPiece
here?
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 have put it inside in exotel
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.
But why to even use this? It should be automatically converted from instance?
0c4a244
to
011e84d
Compare
011e84d
to
87921f6
Compare
data PriorityType = Normal | High | ||
deriving (Generic, FromJSON, ToJSON, Show, Eq) | ||
|
||
instance ToHttpApiData SMSType where |
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.
Why can't you do for this too?
302745c
to
a20c74c
Compare
a20c74c
to
d259657
Compare
d259657
to
3aec0ef
Compare
Type of Change
Description
Adding extra params to send sms
Additional Changes
Motivation and Context
How did you test it?
Checklist
./dev/format-all-files.sh