cart and checkout
This commit is contained in:
@@ -16,6 +16,7 @@ func NewProfileMutationRegistry() actor.MutationRegistry {
|
||||
actor.NewMutation(HandleLinkCart),
|
||||
actor.NewMutation(HandleLinkCheckout),
|
||||
actor.NewMutation(HandleLinkOrder),
|
||||
actor.NewMutation(HandleAnonymizeProfile),
|
||||
)
|
||||
return reg
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package profile
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
messages "git.k6n.net/mats/go-cart-actor/proto/profile"
|
||||
)
|
||||
|
||||
// HandleAnonymizeProfile wipes all PII from the customer profile.
|
||||
func HandleAnonymizeProfile(p *ProfileGrain, m *messages.AnonymizeProfile) error {
|
||||
if m == nil {
|
||||
return fmt.Errorf("AnonymizeProfile: nil payload")
|
||||
}
|
||||
p.Name = ""
|
||||
p.Email = ""
|
||||
p.Phone = ""
|
||||
p.AvatarUrl = ""
|
||||
p.Addresses = nil // Clear all addresses containing PII
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user