Files
go-cart-actor/proto/profile.proto
T
mats 1c97a4bdb0
Build and Publish / BuildAndDeployAmd64 (push) Failing after 4s
Build and Publish / BuildAndDeployArm64 (push) Failing after 5s
wishlist and dashboard
2026-07-01 13:04:55 +02:00

98 lines
2.7 KiB
Protocol Buffer

syntax = "proto3";
package profile_messages;
option go_package = "git.k6n.net/mats/go-cart-actor/proto/profile;profile_messages";
// Profile mutations — each message is an immutable event in a user's profile
// event log (actor.DiskStorage). The current ProfileGrain is a projection
// rebuilt by replaying them in order.
// Address represents a stored address in the user's profile.
message Address {
uint32 id = 1;
string label = 2; // e.g. "Home", "Work"
string fullName = 3;
string addressLine1 = 4;
optional string addressLine2 = 5;
string city = 6;
string state = 7;
string zip = 8;
string country = 9;
optional string phone = 10;
bool isDefaultShipping = 11;
bool isDefaultBilling = 12;
}
// SetProfile sets the user's core profile information.
message SetProfile {
optional string name = 1;
optional string email = 2;
optional string phone = 3;
optional string language = 4;
optional string currency = 5;
optional string avatarUrl = 6;
optional bool orderEmails = 7;
optional bool marketingEmails = 8;
}
// AddAddress adds a new address to the user's address book.
message AddAddress {
Address address = 1;
}
// UpdateAddress updates an existing address (matched by id).
message UpdateAddress {
uint32 id = 1;
optional string label = 2;
optional string fullName = 3;
optional string addressLine1 = 4;
optional string addressLine2 = 5;
optional string city = 6;
optional string state = 7;
optional string zip = 8;
optional string country = 9;
optional string phone = 10;
optional bool isDefaultShipping = 11;
optional bool isDefaultBilling = 12;
}
// RemoveAddress removes an address from the address book.
message RemoveAddress {
uint32 id = 1;
}
// LinkCart links a cart grain to this user profile.
message LinkCart {
uint64 cartId = 1;
string label = 2; // optional label, e.g. "current cart"
}
// LinkCheckout links a checkout grain to this user profile.
message LinkCheckout {
uint64 checkoutId = 1;
uint64 cartId = 2; // the cart this checkout belongs to
}
// LinkOrder links an order to this user profile.
message LinkOrder {
string orderReference = 1; // order reference / id
uint64 cartId = 2; // originating cart
string status = 3; // order status snapshot
}
// AnonymizeProfile wipes all PII from the customer profile.
message AnonymizeProfile {}
message Mutation {
oneof type {
SetProfile set_profile = 1;
AddAddress add_address = 2;
UpdateAddress update_address = 3;
RemoveAddress remove_address = 4;
LinkCart link_cart = 5;
LinkCheckout link_checkout = 6;
LinkOrder link_order = 7;
AnonymizeProfile anonymize_profile = 8;
}
}