update propertynames
This commit is contained in:
@@ -855,20 +855,19 @@ func (x *OrderCompletedRequest) GetPayload() *OrderCreated {
|
||||
return nil
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Cart state snapshot (unchanged from v1 except envelope removal context)
|
||||
// -----------------------------------------------------------------------------
|
||||
// Excerpt: updated messages for camelCase JSON output
|
||||
type CartState struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CartId string `protobuf:"bytes,1,opt,name=cart_id,json=cartId,proto3" json:"cart_id,omitempty"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // was cart_id
|
||||
Items []*CartItemState `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"`
|
||||
TotalPrice int64 `protobuf:"varint,3,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"`
|
||||
TotalTax int64 `protobuf:"varint,4,opt,name=total_tax,json=totalTax,proto3" json:"total_tax,omitempty"`
|
||||
TotalDiscount int64 `protobuf:"varint,5,opt,name=total_discount,json=totalDiscount,proto3" json:"total_discount,omitempty"`
|
||||
TotalPrice int64 `protobuf:"varint,3,opt,name=totalPrice,proto3" json:"totalPrice,omitempty"` // was total_price
|
||||
TotalTax int64 `protobuf:"varint,4,opt,name=totalTax,proto3" json:"totalTax,omitempty"` // was total_tax
|
||||
TotalDiscount int64 `protobuf:"varint,5,opt,name=totalDiscount,proto3" json:"totalDiscount,omitempty"` // was total_discount
|
||||
Deliveries []*DeliveryState `protobuf:"bytes,6,rep,name=deliveries,proto3" json:"deliveries,omitempty"`
|
||||
PaymentInProgress bool `protobuf:"varint,7,opt,name=payment_in_progress,json=paymentInProgress,proto3" json:"payment_in_progress,omitempty"`
|
||||
OrderReference string `protobuf:"bytes,8,opt,name=order_reference,json=orderReference,proto3" json:"order_reference,omitempty"`
|
||||
PaymentStatus string `protobuf:"bytes,9,opt,name=payment_status,json=paymentStatus,proto3" json:"payment_status,omitempty"`
|
||||
PaymentInProgress bool `protobuf:"varint,7,opt,name=paymentInProgress,proto3" json:"paymentInProgress,omitempty"` // was payment_in_progress
|
||||
OrderReference string `protobuf:"bytes,8,opt,name=orderReference,proto3" json:"orderReference,omitempty"` // was order_reference
|
||||
PaymentStatus string `protobuf:"bytes,9,opt,name=paymentStatus,proto3" json:"paymentStatus,omitempty"` // was payment_status
|
||||
Processing bool `protobuf:"varint,10,opt,name=processing,proto3" json:"processing,omitempty"` // NEW (mirrors legacy CartGrain.processing)
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -903,9 +902,9 @@ func (*CartState) Descriptor() ([]byte, []int) {
|
||||
return file_cart_actor_proto_rawDescGZIP(), []int{13}
|
||||
}
|
||||
|
||||
func (x *CartState) GetCartId() string {
|
||||
func (x *CartState) GetId() string {
|
||||
if x != nil {
|
||||
return x.CartId
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@@ -966,19 +965,26 @@ func (x *CartState) GetPaymentStatus() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CartState) GetProcessing() bool {
|
||||
if x != nil {
|
||||
return x.Processing
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type CartItemState struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
SourceItemId int64 `protobuf:"varint,2,opt,name=source_item_id,json=sourceItemId,proto3" json:"source_item_id,omitempty"`
|
||||
ItemId int64 `protobuf:"varint,2,opt,name=itemId,proto3" json:"itemId,omitempty"` // was source_item_id
|
||||
Sku string `protobuf:"bytes,3,opt,name=sku,proto3" json:"sku,omitempty"`
|
||||
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
|
||||
UnitPrice int64 `protobuf:"varint,5,opt,name=unit_price,json=unitPrice,proto3" json:"unit_price,omitempty"`
|
||||
Quantity int32 `protobuf:"varint,6,opt,name=quantity,proto3" json:"quantity,omitempty"`
|
||||
TotalPrice int64 `protobuf:"varint,7,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"`
|
||||
TotalTax int64 `protobuf:"varint,8,opt,name=total_tax,json=totalTax,proto3" json:"total_tax,omitempty"`
|
||||
OrgPrice int64 `protobuf:"varint,9,opt,name=org_price,json=orgPrice,proto3" json:"org_price,omitempty"`
|
||||
TaxRate int32 `protobuf:"varint,10,opt,name=tax_rate,json=taxRate,proto3" json:"tax_rate,omitempty"`
|
||||
TotalDiscount int64 `protobuf:"varint,11,opt,name=total_discount,json=totalDiscount,proto3" json:"total_discount,omitempty"`
|
||||
Price int64 `protobuf:"varint,5,opt,name=price,proto3" json:"price,omitempty"` // was unit_price
|
||||
Qty int32 `protobuf:"varint,6,opt,name=qty,proto3" json:"qty,omitempty"` // was quantity
|
||||
TotalPrice int64 `protobuf:"varint,7,opt,name=totalPrice,proto3" json:"totalPrice,omitempty"` // was total_price
|
||||
TotalTax int64 `protobuf:"varint,8,opt,name=totalTax,proto3" json:"totalTax,omitempty"` // was total_tax
|
||||
OrgPrice int64 `protobuf:"varint,9,opt,name=orgPrice,proto3" json:"orgPrice,omitempty"` // was org_price
|
||||
TaxRate int32 `protobuf:"varint,10,opt,name=taxRate,proto3" json:"taxRate,omitempty"` // was tax_rate
|
||||
TotalDiscount int64 `protobuf:"varint,11,opt,name=totalDiscount,proto3" json:"totalDiscount,omitempty"`
|
||||
Brand string `protobuf:"bytes,12,opt,name=brand,proto3" json:"brand,omitempty"`
|
||||
Category string `protobuf:"bytes,13,opt,name=category,proto3" json:"category,omitempty"`
|
||||
Category2 string `protobuf:"bytes,14,opt,name=category2,proto3" json:"category2,omitempty"`
|
||||
@@ -986,12 +992,12 @@ type CartItemState struct {
|
||||
Category4 string `protobuf:"bytes,16,opt,name=category4,proto3" json:"category4,omitempty"`
|
||||
Category5 string `protobuf:"bytes,17,opt,name=category5,proto3" json:"category5,omitempty"`
|
||||
Image string `protobuf:"bytes,18,opt,name=image,proto3" json:"image,omitempty"`
|
||||
ArticleType string `protobuf:"bytes,19,opt,name=article_type,json=articleType,proto3" json:"article_type,omitempty"`
|
||||
SellerId string `protobuf:"bytes,20,opt,name=seller_id,json=sellerId,proto3" json:"seller_id,omitempty"`
|
||||
SellerName string `protobuf:"bytes,21,opt,name=seller_name,json=sellerName,proto3" json:"seller_name,omitempty"`
|
||||
Type string `protobuf:"bytes,19,opt,name=type,proto3" json:"type,omitempty"` // was article_type
|
||||
SellerId string `protobuf:"bytes,20,opt,name=sellerId,proto3" json:"sellerId,omitempty"` // was seller_id
|
||||
SellerName string `protobuf:"bytes,21,opt,name=sellerName,proto3" json:"sellerName,omitempty"` // was seller_name
|
||||
Disclaimer string `protobuf:"bytes,22,opt,name=disclaimer,proto3" json:"disclaimer,omitempty"`
|
||||
Outlet string `protobuf:"bytes,23,opt,name=outlet,proto3" json:"outlet,omitempty"`
|
||||
StoreId string `protobuf:"bytes,24,opt,name=store_id,json=storeId,proto3" json:"store_id,omitempty"`
|
||||
StoreId string `protobuf:"bytes,24,opt,name=storeId,proto3" json:"storeId,omitempty"` // was store_id
|
||||
Stock int32 `protobuf:"varint,25,opt,name=stock,proto3" json:"stock,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -1034,9 +1040,9 @@ func (x *CartItemState) GetId() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CartItemState) GetSourceItemId() int64 {
|
||||
func (x *CartItemState) GetItemId() int64 {
|
||||
if x != nil {
|
||||
return x.SourceItemId
|
||||
return x.ItemId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@@ -1055,16 +1061,16 @@ func (x *CartItemState) GetName() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CartItemState) GetUnitPrice() int64 {
|
||||
func (x *CartItemState) GetPrice() int64 {
|
||||
if x != nil {
|
||||
return x.UnitPrice
|
||||
return x.Price
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CartItemState) GetQuantity() int32 {
|
||||
func (x *CartItemState) GetQty() int32 {
|
||||
if x != nil {
|
||||
return x.Quantity
|
||||
return x.Qty
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@@ -1153,9 +1159,9 @@ func (x *CartItemState) GetImage() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CartItemState) GetArticleType() string {
|
||||
func (x *CartItemState) GetType() string {
|
||||
if x != nil {
|
||||
return x.ArticleType
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@@ -1207,8 +1213,8 @@ type DeliveryState struct {
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"`
|
||||
Price int64 `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"`
|
||||
ItemIds []int64 `protobuf:"varint,4,rep,packed,name=item_ids,json=itemIds,proto3" json:"item_ids,omitempty"`
|
||||
PickupPoint *PickupPoint `protobuf:"bytes,5,opt,name=pickup_point,json=pickupPoint,proto3" json:"pickup_point,omitempty"` // Defined in messages.proto
|
||||
Items []int64 `protobuf:"varint,4,rep,packed,name=items,proto3" json:"items,omitempty"` // was item_ids
|
||||
PickupPoint *PickupPoint `protobuf:"bytes,5,opt,name=pickupPoint,proto3" json:"pickupPoint,omitempty"` // was pickup_point
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -1264,9 +1270,9 @@ func (x *DeliveryState) GetPrice() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DeliveryState) GetItemIds() []int64 {
|
||||
func (x *DeliveryState) GetItems() []int64 {
|
||||
if x != nil {
|
||||
return x.ItemIds
|
||||
return x.Items
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -1348,58 +1354,64 @@ const file_cart_actor_proto_rawDesc = "" +
|
||||
"\acart_id\x18\x01 \x01(\tR\x06cartId\x12)\n" +
|
||||
"\x10client_timestamp\x18\x02 \x01(\x03R\x0fclientTimestamp\x120\n" +
|
||||
"\apayload\x18\n" +
|
||||
" \x01(\v2\x16.messages.OrderCreatedR\apayload\"\xf1\x02\n" +
|
||||
"\tCartState\x12\x17\n" +
|
||||
"\acart_id\x18\x01 \x01(\tR\x06cartId\x12-\n" +
|
||||
"\x05items\x18\x02 \x03(\v2\x17.messages.CartItemStateR\x05items\x12\x1f\n" +
|
||||
"\vtotal_price\x18\x03 \x01(\x03R\n" +
|
||||
"totalPrice\x12\x1b\n" +
|
||||
"\ttotal_tax\x18\x04 \x01(\x03R\btotalTax\x12%\n" +
|
||||
"\x0etotal_discount\x18\x05 \x01(\x03R\rtotalDiscount\x127\n" +
|
||||
" \x01(\v2\x16.messages.OrderCreatedR\apayload\"\x81\x03\n" +
|
||||
"\tCartState\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12-\n" +
|
||||
"\x05items\x18\x02 \x03(\v2\x17.messages.CartItemStateR\x05items\x12\x1e\n" +
|
||||
"\n" +
|
||||
"totalPrice\x18\x03 \x01(\x03R\n" +
|
||||
"totalPrice\x12\x1a\n" +
|
||||
"\btotalTax\x18\x04 \x01(\x03R\btotalTax\x12$\n" +
|
||||
"\rtotalDiscount\x18\x05 \x01(\x03R\rtotalDiscount\x127\n" +
|
||||
"\n" +
|
||||
"deliveries\x18\x06 \x03(\v2\x17.messages.DeliveryStateR\n" +
|
||||
"deliveries\x12.\n" +
|
||||
"\x13payment_in_progress\x18\a \x01(\bR\x11paymentInProgress\x12'\n" +
|
||||
"\x0forder_reference\x18\b \x01(\tR\x0eorderReference\x12%\n" +
|
||||
"\x0epayment_status\x18\t \x01(\tR\rpaymentStatus\"\xcd\x05\n" +
|
||||
"\rCartItemState\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12$\n" +
|
||||
"\x0esource_item_id\x18\x02 \x01(\x03R\fsourceItemId\x12\x10\n" +
|
||||
"\x03sku\x18\x03 \x01(\tR\x03sku\x12\x12\n" +
|
||||
"\x04name\x18\x04 \x01(\tR\x04name\x12\x1d\n" +
|
||||
"deliveries\x12,\n" +
|
||||
"\x11paymentInProgress\x18\a \x01(\bR\x11paymentInProgress\x12&\n" +
|
||||
"\x0eorderReference\x18\b \x01(\tR\x0eorderReference\x12$\n" +
|
||||
"\rpaymentStatus\x18\t \x01(\tR\rpaymentStatus\x12\x1e\n" +
|
||||
"\n" +
|
||||
"unit_price\x18\x05 \x01(\x03R\tunitPrice\x12\x1a\n" +
|
||||
"\bquantity\x18\x06 \x01(\x05R\bquantity\x12\x1f\n" +
|
||||
"\vtotal_price\x18\a \x01(\x03R\n" +
|
||||
"totalPrice\x12\x1b\n" +
|
||||
"\ttotal_tax\x18\b \x01(\x03R\btotalTax\x12\x1b\n" +
|
||||
"\torg_price\x18\t \x01(\x03R\borgPrice\x12\x19\n" +
|
||||
"\btax_rate\x18\n" +
|
||||
" \x01(\x05R\ataxRate\x12%\n" +
|
||||
"\x0etotal_discount\x18\v \x01(\x03R\rtotalDiscount\x12\x14\n" +
|
||||
"processing\x18\n" +
|
||||
" \x01(\bR\n" +
|
||||
"processing\"\x95\x05\n" +
|
||||
"\rCartItemState\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x16\n" +
|
||||
"\x06itemId\x18\x02 \x01(\x03R\x06itemId\x12\x10\n" +
|
||||
"\x03sku\x18\x03 \x01(\tR\x03sku\x12\x12\n" +
|
||||
"\x04name\x18\x04 \x01(\tR\x04name\x12\x14\n" +
|
||||
"\x05price\x18\x05 \x01(\x03R\x05price\x12\x10\n" +
|
||||
"\x03qty\x18\x06 \x01(\x05R\x03qty\x12\x1e\n" +
|
||||
"\n" +
|
||||
"totalPrice\x18\a \x01(\x03R\n" +
|
||||
"totalPrice\x12\x1a\n" +
|
||||
"\btotalTax\x18\b \x01(\x03R\btotalTax\x12\x1a\n" +
|
||||
"\borgPrice\x18\t \x01(\x03R\borgPrice\x12\x18\n" +
|
||||
"\ataxRate\x18\n" +
|
||||
" \x01(\x05R\ataxRate\x12$\n" +
|
||||
"\rtotalDiscount\x18\v \x01(\x03R\rtotalDiscount\x12\x14\n" +
|
||||
"\x05brand\x18\f \x01(\tR\x05brand\x12\x1a\n" +
|
||||
"\bcategory\x18\r \x01(\tR\bcategory\x12\x1c\n" +
|
||||
"\tcategory2\x18\x0e \x01(\tR\tcategory2\x12\x1c\n" +
|
||||
"\tcategory3\x18\x0f \x01(\tR\tcategory3\x12\x1c\n" +
|
||||
"\tcategory4\x18\x10 \x01(\tR\tcategory4\x12\x1c\n" +
|
||||
"\tcategory5\x18\x11 \x01(\tR\tcategory5\x12\x14\n" +
|
||||
"\x05image\x18\x12 \x01(\tR\x05image\x12!\n" +
|
||||
"\farticle_type\x18\x13 \x01(\tR\varticleType\x12\x1b\n" +
|
||||
"\tseller_id\x18\x14 \x01(\tR\bsellerId\x12\x1f\n" +
|
||||
"\vseller_name\x18\x15 \x01(\tR\n" +
|
||||
"\x05image\x18\x12 \x01(\tR\x05image\x12\x12\n" +
|
||||
"\x04type\x18\x13 \x01(\tR\x04type\x12\x1a\n" +
|
||||
"\bsellerId\x18\x14 \x01(\tR\bsellerId\x12\x1e\n" +
|
||||
"\n" +
|
||||
"sellerName\x18\x15 \x01(\tR\n" +
|
||||
"sellerName\x12\x1e\n" +
|
||||
"\n" +
|
||||
"disclaimer\x18\x16 \x01(\tR\n" +
|
||||
"disclaimer\x12\x16\n" +
|
||||
"\x06outlet\x18\x17 \x01(\tR\x06outlet\x12\x19\n" +
|
||||
"\bstore_id\x18\x18 \x01(\tR\astoreId\x12\x14\n" +
|
||||
"\x05stock\x18\x19 \x01(\x05R\x05stock\"\xa6\x01\n" +
|
||||
"\x06outlet\x18\x17 \x01(\tR\x06outlet\x12\x18\n" +
|
||||
"\astoreId\x18\x18 \x01(\tR\astoreId\x12\x14\n" +
|
||||
"\x05stock\x18\x19 \x01(\x05R\x05stock\"\xa0\x01\n" +
|
||||
"\rDeliveryState\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" +
|
||||
"\bprovider\x18\x02 \x01(\tR\bprovider\x12\x14\n" +
|
||||
"\x05price\x18\x03 \x01(\x03R\x05price\x12\x19\n" +
|
||||
"\bitem_ids\x18\x04 \x03(\x03R\aitemIds\x128\n" +
|
||||
"\fpickup_point\x18\x05 \x01(\v2\x15.messages.PickupPointR\vpickupPoint2\xed\x05\n" +
|
||||
"\x05price\x18\x03 \x01(\x03R\x05price\x12\x14\n" +
|
||||
"\x05items\x18\x04 \x03(\x03R\x05items\x127\n" +
|
||||
"\vpickupPoint\x18\x05 \x01(\v2\x15.messages.PickupPointR\vpickupPoint2\xed\x05\n" +
|
||||
"\tCartActor\x12F\n" +
|
||||
"\n" +
|
||||
"AddRequest\x12\x1b.messages.AddRequestRequest\x1a\x1b.messages.CartMutationReply\x12@\n" +
|
||||
@@ -1471,7 +1483,7 @@ var file_cart_actor_proto_depIdxs = []int32{
|
||||
25, // 11: messages.OrderCompletedRequest.payload:type_name -> messages.OrderCreated
|
||||
14, // 12: messages.CartState.items:type_name -> messages.CartItemState
|
||||
15, // 13: messages.CartState.deliveries:type_name -> messages.DeliveryState
|
||||
26, // 14: messages.DeliveryState.pickup_point:type_name -> messages.PickupPoint
|
||||
26, // 14: messages.DeliveryState.pickupPoint:type_name -> messages.PickupPoint
|
||||
3, // 15: messages.CartActor.AddRequest:input_type -> messages.AddRequestRequest
|
||||
4, // 16: messages.CartActor.AddItem:input_type -> messages.AddItemRequest
|
||||
5, // 17: messages.CartActor.RemoveItem:input_type -> messages.RemoveItemRequest
|
||||
|
||||
Reference in New Issue
Block a user