21 lines
445 B
Go
21 lines
445 B
Go
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
|
|
}
|