@@ -33,20 +33,20 @@ func NewGormPhoneRepository(
3333 }
3434}
3535
36- // LoadByID loads a phone by MessageID
36+ // LoadByID loads a phone by ID
3737func (repository * gormPhoneRepository ) LoadByID (ctx context.Context , phoneID uuid.UUID ) (* entities.Phone , error ) {
3838 ctx , span := repository .tracer .Start (ctx )
3939 defer span .End ()
4040
4141 phone := new (entities.Phone )
4242 err := repository .db .WithContext (ctx ).First (phone , phoneID ).Error
4343 if errors .Is (err , gorm .ErrRecordNotFound ) {
44- msg := fmt .Sprintf ("phone with MessageID [%s] does not exist" , phoneID )
44+ msg := fmt .Sprintf ("phone with ID [%s] does not exist" , phoneID )
4545 return nil , repository .tracer .WrapErrorSpan (span , stacktrace .PropagateWithCode (err , ErrCodeNotFound , msg ))
4646 }
4747
4848 if err != nil {
49- msg := fmt .Sprintf ("cannot load phone with MessageID [%s]" , phoneID )
49+ msg := fmt .Sprintf ("cannot load phone with ID [%s]" , phoneID )
5050 return nil , repository .tracer .WrapErrorSpan (span , stacktrace .Propagate (err , msg ))
5151 }
5252
@@ -63,7 +63,7 @@ func (repository *gormPhoneRepository) Delete(ctx context.Context, userID entiti
6363 Where ("id = ?" , phoneID ).
6464 Delete (& entities.Phone {}).Error
6565 if err != nil {
66- msg := fmt .Sprintf ("cannot delete phone with MessageID [%s] and userID [%s]" , phoneID , userID )
66+ msg := fmt .Sprintf ("cannot delete phone with ID [%s] and userID [%s]" , phoneID , userID )
6767 return repository .tracer .WrapErrorSpan (span , stacktrace .Propagate (err , msg ))
6868 }
6969
@@ -76,7 +76,7 @@ func (repository *gormPhoneRepository) Save(ctx context.Context, phone *entities
7676 defer span .End ()
7777
7878 if err := repository .db .WithContext (ctx ).Save (phone ).Error ; err != nil {
79- msg := fmt .Sprintf ("cannot save phone with MessageID [%s]" , phone .ID )
79+ msg := fmt .Sprintf ("cannot save phone with ID [%s]" , phone .ID )
8080 return repository .tracer .WrapErrorSpan (span , stacktrace .Propagate (err , msg ))
8181 }
8282
0 commit comments