package redisotp import ( "context" richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error" "time" ) func (d DB) SaveCodeWithPhoneNumber(ctx context.Context, phoneNumber string, code string, expireTime time.Duration) error { const op = "redisotp.SaveCodeWithPhoneNumber" err := d.adapter.Client().Set(ctx, phoneNumber, code, expireTime).Err() if err != nil { return richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected) } return nil }