@@ -74,6 +74,7 @@ type PhoneUpsertParams struct {
7474 MessagesPerMinute * uint
7575 MaxSendAttempts * uint
7676 MessageExpirationDuration * time.Duration
77+ IsDualSIM bool
7778 Source string
7879 UserID entities.UserID
7980}
@@ -106,9 +107,10 @@ func (service *PhoneService) Upsert(ctx context.Context, params PhoneUpsertParam
106107 UserID : phone .UserID ,
107108 Timestamp : phone .UpdatedAt ,
108109 Owner : phone .PhoneNumber ,
110+ IsDualSIM : phone .IsDualSIM ,
109111 })
110112 if err != nil {
111- msg := fmt . Sprintf ( "cannot create event when phone is updated" )
113+ msg := "cannot create event when phone is updated"
112114 return nil , service .tracer .WrapErrorSpan (span , stacktrace .Propagate (err , msg ))
113115 }
114116
@@ -145,9 +147,10 @@ func (service *PhoneService) Delete(ctx context.Context, source string, userID e
145147 UserID : phone .UserID ,
146148 Timestamp : phone .UpdatedAt ,
147149 Owner : phone .PhoneNumber ,
150+ IsDualSIM : phone .IsDualSIM ,
148151 })
149152 if err != nil {
150- msg := fmt . Sprintf ( "cannot create event when phone is deleted" )
153+ msg := "cannot create event when phone is deleted"
151154 return service .tracer .WrapErrorSpan (span , stacktrace .Propagate (err , msg ))
152155 }
153156
@@ -172,6 +175,7 @@ func (service *PhoneService) createPhone(ctx context.Context, params PhoneUpsert
172175 MessagesPerMinute : 29 ,
173176 MessageExpirationSeconds : 15 * 60 , // 30 minutes
174177 MaxSendAttempts : 2 ,
178+ IsDualSIM : params .IsDualSIM ,
175179 PhoneNumber : phonenumbers .Format (& params .PhoneNumber , phonenumbers .E164 ),
176180 CreatedAt : time .Now ().UTC (),
177181 UpdatedAt : time .Now ().UTC (),
@@ -208,5 +212,8 @@ func (service *PhoneService) update(phone *entities.Phone, params PhoneUpsertPar
208212 if params .MessageExpirationDuration != nil {
209213 phone .MessageExpirationSeconds = uint (params .MessageExpirationDuration .Seconds ())
210214 }
215+
216+ phone .IsDualSIM = params .IsDualSIM
217+
211218 return phone
212219}
0 commit comments