Files
go-cart-actor/proto/cart_actor.pb.go
2025-10-10 09:34:40 +00:00

1107 lines
33 KiB
Go

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc v3.21.12
// source: cart_actor.proto
package messages
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// MutationEnvelope carries exactly one mutation plus metadata.
// client_timestamp:
// - Optional Unix timestamp provided by the client.
// - If zero the server MAY overwrite with its local time.
type MutationEnvelope struct {
state protoimpl.MessageState `protogen:"open.v1"`
CartId string `protobuf:"bytes,1,opt,name=cart_id,json=cartId,proto3" json:"cart_id,omitempty"`
ClientTimestamp int64 `protobuf:"varint,2,opt,name=client_timestamp,json=clientTimestamp,proto3" json:"client_timestamp,omitempty"`
// Types that are valid to be assigned to Mutation:
//
// *MutationEnvelope_AddRequest
// *MutationEnvelope_AddItem
// *MutationEnvelope_RemoveItem
// *MutationEnvelope_RemoveDelivery
// *MutationEnvelope_ChangeQuantity
// *MutationEnvelope_SetDelivery
// *MutationEnvelope_SetPickupPoint
// *MutationEnvelope_CreateCheckoutOrder
// *MutationEnvelope_SetCartItems
// *MutationEnvelope_OrderCompleted
Mutation isMutationEnvelope_Mutation `protobuf_oneof:"mutation"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *MutationEnvelope) Reset() {
*x = MutationEnvelope{}
mi := &file_cart_actor_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *MutationEnvelope) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MutationEnvelope) ProtoMessage() {}
func (x *MutationEnvelope) ProtoReflect() protoreflect.Message {
mi := &file_cart_actor_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MutationEnvelope.ProtoReflect.Descriptor instead.
func (*MutationEnvelope) Descriptor() ([]byte, []int) {
return file_cart_actor_proto_rawDescGZIP(), []int{0}
}
func (x *MutationEnvelope) GetCartId() string {
if x != nil {
return x.CartId
}
return ""
}
func (x *MutationEnvelope) GetClientTimestamp() int64 {
if x != nil {
return x.ClientTimestamp
}
return 0
}
func (x *MutationEnvelope) GetMutation() isMutationEnvelope_Mutation {
if x != nil {
return x.Mutation
}
return nil
}
func (x *MutationEnvelope) GetAddRequest() *AddRequest {
if x != nil {
if x, ok := x.Mutation.(*MutationEnvelope_AddRequest); ok {
return x.AddRequest
}
}
return nil
}
func (x *MutationEnvelope) GetAddItem() *AddItem {
if x != nil {
if x, ok := x.Mutation.(*MutationEnvelope_AddItem); ok {
return x.AddItem
}
}
return nil
}
func (x *MutationEnvelope) GetRemoveItem() *RemoveItem {
if x != nil {
if x, ok := x.Mutation.(*MutationEnvelope_RemoveItem); ok {
return x.RemoveItem
}
}
return nil
}
func (x *MutationEnvelope) GetRemoveDelivery() *RemoveDelivery {
if x != nil {
if x, ok := x.Mutation.(*MutationEnvelope_RemoveDelivery); ok {
return x.RemoveDelivery
}
}
return nil
}
func (x *MutationEnvelope) GetChangeQuantity() *ChangeQuantity {
if x != nil {
if x, ok := x.Mutation.(*MutationEnvelope_ChangeQuantity); ok {
return x.ChangeQuantity
}
}
return nil
}
func (x *MutationEnvelope) GetSetDelivery() *SetDelivery {
if x != nil {
if x, ok := x.Mutation.(*MutationEnvelope_SetDelivery); ok {
return x.SetDelivery
}
}
return nil
}
func (x *MutationEnvelope) GetSetPickupPoint() *SetPickupPoint {
if x != nil {
if x, ok := x.Mutation.(*MutationEnvelope_SetPickupPoint); ok {
return x.SetPickupPoint
}
}
return nil
}
func (x *MutationEnvelope) GetCreateCheckoutOrder() *CreateCheckoutOrder {
if x != nil {
if x, ok := x.Mutation.(*MutationEnvelope_CreateCheckoutOrder); ok {
return x.CreateCheckoutOrder
}
}
return nil
}
func (x *MutationEnvelope) GetSetCartItems() *SetCartRequest {
if x != nil {
if x, ok := x.Mutation.(*MutationEnvelope_SetCartItems); ok {
return x.SetCartItems
}
}
return nil
}
func (x *MutationEnvelope) GetOrderCompleted() *OrderCreated {
if x != nil {
if x, ok := x.Mutation.(*MutationEnvelope_OrderCompleted); ok {
return x.OrderCompleted
}
}
return nil
}
type isMutationEnvelope_Mutation interface {
isMutationEnvelope_Mutation()
}
type MutationEnvelope_AddRequest struct {
AddRequest *AddRequest `protobuf:"bytes,10,opt,name=add_request,json=addRequest,proto3,oneof"`
}
type MutationEnvelope_AddItem struct {
AddItem *AddItem `protobuf:"bytes,11,opt,name=add_item,json=addItem,proto3,oneof"`
}
type MutationEnvelope_RemoveItem struct {
RemoveItem *RemoveItem `protobuf:"bytes,12,opt,name=remove_item,json=removeItem,proto3,oneof"`
}
type MutationEnvelope_RemoveDelivery struct {
RemoveDelivery *RemoveDelivery `protobuf:"bytes,13,opt,name=remove_delivery,json=removeDelivery,proto3,oneof"`
}
type MutationEnvelope_ChangeQuantity struct {
ChangeQuantity *ChangeQuantity `protobuf:"bytes,14,opt,name=change_quantity,json=changeQuantity,proto3,oneof"`
}
type MutationEnvelope_SetDelivery struct {
SetDelivery *SetDelivery `protobuf:"bytes,15,opt,name=set_delivery,json=setDelivery,proto3,oneof"`
}
type MutationEnvelope_SetPickupPoint struct {
SetPickupPoint *SetPickupPoint `protobuf:"bytes,16,opt,name=set_pickup_point,json=setPickupPoint,proto3,oneof"`
}
type MutationEnvelope_CreateCheckoutOrder struct {
CreateCheckoutOrder *CreateCheckoutOrder `protobuf:"bytes,17,opt,name=create_checkout_order,json=createCheckoutOrder,proto3,oneof"`
}
type MutationEnvelope_SetCartItems struct {
SetCartItems *SetCartRequest `protobuf:"bytes,18,opt,name=set_cart_items,json=setCartItems,proto3,oneof"`
}
type MutationEnvelope_OrderCompleted struct {
OrderCompleted *OrderCreated `protobuf:"bytes,19,opt,name=order_completed,json=orderCompleted,proto3,oneof"`
}
func (*MutationEnvelope_AddRequest) isMutationEnvelope_Mutation() {}
func (*MutationEnvelope_AddItem) isMutationEnvelope_Mutation() {}
func (*MutationEnvelope_RemoveItem) isMutationEnvelope_Mutation() {}
func (*MutationEnvelope_RemoveDelivery) isMutationEnvelope_Mutation() {}
func (*MutationEnvelope_ChangeQuantity) isMutationEnvelope_Mutation() {}
func (*MutationEnvelope_SetDelivery) isMutationEnvelope_Mutation() {}
func (*MutationEnvelope_SetPickupPoint) isMutationEnvelope_Mutation() {}
func (*MutationEnvelope_CreateCheckoutOrder) isMutationEnvelope_Mutation() {}
func (*MutationEnvelope_SetCartItems) isMutationEnvelope_Mutation() {}
func (*MutationEnvelope_OrderCompleted) isMutationEnvelope_Mutation() {}
// MutationReply returns a legacy-style status code plus a JSON payload
// holding either the updated cart state (on success) or an error string.
type MutationReply struct {
state protoimpl.MessageState `protogen:"open.v1"`
StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
// Exactly one of state or error will be set.
//
// Types that are valid to be assigned to Result:
//
// *MutationReply_State
// *MutationReply_Error
Result isMutationReply_Result `protobuf_oneof:"result"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *MutationReply) Reset() {
*x = MutationReply{}
mi := &file_cart_actor_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *MutationReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MutationReply) ProtoMessage() {}
func (x *MutationReply) ProtoReflect() protoreflect.Message {
mi := &file_cart_actor_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MutationReply.ProtoReflect.Descriptor instead.
func (*MutationReply) Descriptor() ([]byte, []int) {
return file_cart_actor_proto_rawDescGZIP(), []int{1}
}
func (x *MutationReply) GetStatusCode() int32 {
if x != nil {
return x.StatusCode
}
return 0
}
func (x *MutationReply) GetResult() isMutationReply_Result {
if x != nil {
return x.Result
}
return nil
}
func (x *MutationReply) GetState() *CartState {
if x != nil {
if x, ok := x.Result.(*MutationReply_State); ok {
return x.State
}
}
return nil
}
func (x *MutationReply) GetError() string {
if x != nil {
if x, ok := x.Result.(*MutationReply_Error); ok {
return x.Error
}
}
return ""
}
type isMutationReply_Result interface {
isMutationReply_Result()
}
type MutationReply_State struct {
State *CartState `protobuf:"bytes,2,opt,name=state,proto3,oneof"`
}
type MutationReply_Error struct {
Error string `protobuf:"bytes,3,opt,name=error,proto3,oneof"`
}
func (*MutationReply_State) isMutationReply_Result() {}
func (*MutationReply_Error) isMutationReply_Result() {}
// StateRequest fetches current cart state without mutating.
type StateRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
CartId string `protobuf:"bytes,1,opt,name=cart_id,json=cartId,proto3" json:"cart_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *StateRequest) Reset() {
*x = StateRequest{}
mi := &file_cart_actor_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *StateRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StateRequest) ProtoMessage() {}
func (x *StateRequest) ProtoReflect() protoreflect.Message {
mi := &file_cart_actor_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StateRequest.ProtoReflect.Descriptor instead.
func (*StateRequest) Descriptor() ([]byte, []int) {
return file_cart_actor_proto_rawDescGZIP(), []int{2}
}
func (x *StateRequest) GetCartId() string {
if x != nil {
return x.CartId
}
return ""
}
// -----------------------------------------------------------------------------
// CartState represents the full cart snapshot returned by state/mutation replies.
// Replaces the previous raw JSON payload.
// -----------------------------------------------------------------------------
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"`
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"`
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"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CartState) Reset() {
*x = CartState{}
mi := &file_cart_actor_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CartState) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CartState) ProtoMessage() {}
func (x *CartState) ProtoReflect() protoreflect.Message {
mi := &file_cart_actor_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CartState.ProtoReflect.Descriptor instead.
func (*CartState) Descriptor() ([]byte, []int) {
return file_cart_actor_proto_rawDescGZIP(), []int{3}
}
func (x *CartState) GetCartId() string {
if x != nil {
return x.CartId
}
return ""
}
func (x *CartState) GetItems() []*CartItemState {
if x != nil {
return x.Items
}
return nil
}
func (x *CartState) GetTotalPrice() int64 {
if x != nil {
return x.TotalPrice
}
return 0
}
func (x *CartState) GetTotalTax() int64 {
if x != nil {
return x.TotalTax
}
return 0
}
func (x *CartState) GetTotalDiscount() int64 {
if x != nil {
return x.TotalDiscount
}
return 0
}
func (x *CartState) GetDeliveries() []*DeliveryState {
if x != nil {
return x.Deliveries
}
return nil
}
func (x *CartState) GetPaymentInProgress() bool {
if x != nil {
return x.PaymentInProgress
}
return false
}
func (x *CartState) GetOrderReference() string {
if x != nil {
return x.OrderReference
}
return ""
}
func (x *CartState) GetPaymentStatus() string {
if x != nil {
return x.PaymentStatus
}
return ""
}
// Lightweight representation of an item in the cart
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"`
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"`
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"`
Category3 string `protobuf:"bytes,15,opt,name=category3,proto3" json:"category3,omitempty"`
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"`
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"`
Stock int32 `protobuf:"varint,25,opt,name=stock,proto3" json:"stock,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CartItemState) Reset() {
*x = CartItemState{}
mi := &file_cart_actor_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CartItemState) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CartItemState) ProtoMessage() {}
func (x *CartItemState) ProtoReflect() protoreflect.Message {
mi := &file_cart_actor_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CartItemState.ProtoReflect.Descriptor instead.
func (*CartItemState) Descriptor() ([]byte, []int) {
return file_cart_actor_proto_rawDescGZIP(), []int{4}
}
func (x *CartItemState) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *CartItemState) GetSourceItemId() int64 {
if x != nil {
return x.SourceItemId
}
return 0
}
func (x *CartItemState) GetSku() string {
if x != nil {
return x.Sku
}
return ""
}
func (x *CartItemState) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *CartItemState) GetUnitPrice() int64 {
if x != nil {
return x.UnitPrice
}
return 0
}
func (x *CartItemState) GetQuantity() int32 {
if x != nil {
return x.Quantity
}
return 0
}
func (x *CartItemState) GetTotalPrice() int64 {
if x != nil {
return x.TotalPrice
}
return 0
}
func (x *CartItemState) GetTotalTax() int64 {
if x != nil {
return x.TotalTax
}
return 0
}
func (x *CartItemState) GetOrgPrice() int64 {
if x != nil {
return x.OrgPrice
}
return 0
}
func (x *CartItemState) GetTaxRate() int32 {
if x != nil {
return x.TaxRate
}
return 0
}
func (x *CartItemState) GetTotalDiscount() int64 {
if x != nil {
return x.TotalDiscount
}
return 0
}
func (x *CartItemState) GetBrand() string {
if x != nil {
return x.Brand
}
return ""
}
func (x *CartItemState) GetCategory() string {
if x != nil {
return x.Category
}
return ""
}
func (x *CartItemState) GetCategory2() string {
if x != nil {
return x.Category2
}
return ""
}
func (x *CartItemState) GetCategory3() string {
if x != nil {
return x.Category3
}
return ""
}
func (x *CartItemState) GetCategory4() string {
if x != nil {
return x.Category4
}
return ""
}
func (x *CartItemState) GetCategory5() string {
if x != nil {
return x.Category5
}
return ""
}
func (x *CartItemState) GetImage() string {
if x != nil {
return x.Image
}
return ""
}
func (x *CartItemState) GetArticleType() string {
if x != nil {
return x.ArticleType
}
return ""
}
func (x *CartItemState) GetSellerId() string {
if x != nil {
return x.SellerId
}
return ""
}
func (x *CartItemState) GetSellerName() string {
if x != nil {
return x.SellerName
}
return ""
}
func (x *CartItemState) GetDisclaimer() string {
if x != nil {
return x.Disclaimer
}
return ""
}
func (x *CartItemState) GetOutlet() string {
if x != nil {
return x.Outlet
}
return ""
}
func (x *CartItemState) GetStoreId() string {
if x != nil {
return x.StoreId
}
return ""
}
func (x *CartItemState) GetStock() int32 {
if x != nil {
return x.Stock
}
return 0
}
// Delivery / shipping entry
type DeliveryState struct {
state protoimpl.MessageState `protogen:"open.v1"`
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"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeliveryState) Reset() {
*x = DeliveryState{}
mi := &file_cart_actor_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeliveryState) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeliveryState) ProtoMessage() {}
func (x *DeliveryState) ProtoReflect() protoreflect.Message {
mi := &file_cart_actor_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeliveryState.ProtoReflect.Descriptor instead.
func (*DeliveryState) Descriptor() ([]byte, []int) {
return file_cart_actor_proto_rawDescGZIP(), []int{5}
}
func (x *DeliveryState) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *DeliveryState) GetProvider() string {
if x != nil {
return x.Provider
}
return ""
}
func (x *DeliveryState) GetPrice() int64 {
if x != nil {
return x.Price
}
return 0
}
func (x *DeliveryState) GetItemIds() []int64 {
if x != nil {
return x.ItemIds
}
return nil
}
func (x *DeliveryState) GetPickupPoint() *PickupPoint {
if x != nil {
return x.PickupPoint
}
return nil
}
// StateReply mirrors MutationReply for consistency.
type StateReply struct {
state protoimpl.MessageState `protogen:"open.v1"`
StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
// Types that are valid to be assigned to Result:
//
// *StateReply_State
// *StateReply_Error
Result isStateReply_Result `protobuf_oneof:"result"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *StateReply) Reset() {
*x = StateReply{}
mi := &file_cart_actor_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *StateReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StateReply) ProtoMessage() {}
func (x *StateReply) ProtoReflect() protoreflect.Message {
mi := &file_cart_actor_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StateReply.ProtoReflect.Descriptor instead.
func (*StateReply) Descriptor() ([]byte, []int) {
return file_cart_actor_proto_rawDescGZIP(), []int{6}
}
func (x *StateReply) GetStatusCode() int32 {
if x != nil {
return x.StatusCode
}
return 0
}
func (x *StateReply) GetResult() isStateReply_Result {
if x != nil {
return x.Result
}
return nil
}
func (x *StateReply) GetState() *CartState {
if x != nil {
if x, ok := x.Result.(*StateReply_State); ok {
return x.State
}
}
return nil
}
func (x *StateReply) GetError() string {
if x != nil {
if x, ok := x.Result.(*StateReply_Error); ok {
return x.Error
}
}
return ""
}
type isStateReply_Result interface {
isStateReply_Result()
}
type StateReply_State struct {
State *CartState `protobuf:"bytes,2,opt,name=state,proto3,oneof"`
}
type StateReply_Error struct {
Error string `protobuf:"bytes,3,opt,name=error,proto3,oneof"`
}
func (*StateReply_State) isStateReply_Result() {}
func (*StateReply_Error) isStateReply_Result() {}
var File_cart_actor_proto protoreflect.FileDescriptor
const file_cart_actor_proto_rawDesc = "" +
"\n" +
"\x10cart_actor.proto\x12\bmessages\x1a\x0emessages.proto\"\xea\x05\n" +
"\x10MutationEnvelope\x12\x17\n" +
"\acart_id\x18\x01 \x01(\tR\x06cartId\x12)\n" +
"\x10client_timestamp\x18\x02 \x01(\x03R\x0fclientTimestamp\x127\n" +
"\vadd_request\x18\n" +
" \x01(\v2\x14.messages.AddRequestH\x00R\n" +
"addRequest\x12.\n" +
"\badd_item\x18\v \x01(\v2\x11.messages.AddItemH\x00R\aaddItem\x127\n" +
"\vremove_item\x18\f \x01(\v2\x14.messages.RemoveItemH\x00R\n" +
"removeItem\x12C\n" +
"\x0fremove_delivery\x18\r \x01(\v2\x18.messages.RemoveDeliveryH\x00R\x0eremoveDelivery\x12C\n" +
"\x0fchange_quantity\x18\x0e \x01(\v2\x18.messages.ChangeQuantityH\x00R\x0echangeQuantity\x12:\n" +
"\fset_delivery\x18\x0f \x01(\v2\x15.messages.SetDeliveryH\x00R\vsetDelivery\x12D\n" +
"\x10set_pickup_point\x18\x10 \x01(\v2\x18.messages.SetPickupPointH\x00R\x0esetPickupPoint\x12S\n" +
"\x15create_checkout_order\x18\x11 \x01(\v2\x1d.messages.CreateCheckoutOrderH\x00R\x13createCheckoutOrder\x12@\n" +
"\x0eset_cart_items\x18\x12 \x01(\v2\x18.messages.SetCartRequestH\x00R\fsetCartItems\x12A\n" +
"\x0forder_completed\x18\x13 \x01(\v2\x16.messages.OrderCreatedH\x00R\x0eorderCompletedB\n" +
"\n" +
"\bmutation\"\x7f\n" +
"\rMutationReply\x12\x1f\n" +
"\vstatus_code\x18\x01 \x01(\x05R\n" +
"statusCode\x12+\n" +
"\x05state\x18\x02 \x01(\v2\x13.messages.CartStateH\x00R\x05state\x12\x16\n" +
"\x05error\x18\x03 \x01(\tH\x00R\x05errorB\b\n" +
"\x06result\"'\n" +
"\fStateRequest\x12\x17\n" +
"\acart_id\x18\x01 \x01(\tR\x06cartId\"\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" +
"\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" +
"\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" +
"\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" +
"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" +
"\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\vpickupPoint\"|\n" +
"\n" +
"StateReply\x12\x1f\n" +
"\vstatus_code\x18\x01 \x01(\x05R\n" +
"statusCode\x12+\n" +
"\x05state\x18\x02 \x01(\v2\x13.messages.CartStateH\x00R\x05state\x12\x16\n" +
"\x05error\x18\x03 \x01(\tH\x00R\x05errorB\b\n" +
"\x06result2\x84\x01\n" +
"\tCartActor\x12=\n" +
"\x06Mutate\x12\x1a.messages.MutationEnvelope\x1a\x17.messages.MutationReply\x128\n" +
"\bGetState\x12\x16.messages.StateRequest\x1a\x14.messages.StateReplyB.Z,git.tornberg.me/go-cart-actor/proto;messagesb\x06proto3"
var (
file_cart_actor_proto_rawDescOnce sync.Once
file_cart_actor_proto_rawDescData []byte
)
func file_cart_actor_proto_rawDescGZIP() []byte {
file_cart_actor_proto_rawDescOnce.Do(func() {
file_cart_actor_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cart_actor_proto_rawDesc), len(file_cart_actor_proto_rawDesc)))
})
return file_cart_actor_proto_rawDescData
}
var file_cart_actor_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_cart_actor_proto_goTypes = []any{
(*MutationEnvelope)(nil), // 0: messages.MutationEnvelope
(*MutationReply)(nil), // 1: messages.MutationReply
(*StateRequest)(nil), // 2: messages.StateRequest
(*CartState)(nil), // 3: messages.CartState
(*CartItemState)(nil), // 4: messages.CartItemState
(*DeliveryState)(nil), // 5: messages.DeliveryState
(*StateReply)(nil), // 6: messages.StateReply
(*AddRequest)(nil), // 7: messages.AddRequest
(*AddItem)(nil), // 8: messages.AddItem
(*RemoveItem)(nil), // 9: messages.RemoveItem
(*RemoveDelivery)(nil), // 10: messages.RemoveDelivery
(*ChangeQuantity)(nil), // 11: messages.ChangeQuantity
(*SetDelivery)(nil), // 12: messages.SetDelivery
(*SetPickupPoint)(nil), // 13: messages.SetPickupPoint
(*CreateCheckoutOrder)(nil), // 14: messages.CreateCheckoutOrder
(*SetCartRequest)(nil), // 15: messages.SetCartRequest
(*OrderCreated)(nil), // 16: messages.OrderCreated
(*PickupPoint)(nil), // 17: messages.PickupPoint
}
var file_cart_actor_proto_depIdxs = []int32{
7, // 0: messages.MutationEnvelope.add_request:type_name -> messages.AddRequest
8, // 1: messages.MutationEnvelope.add_item:type_name -> messages.AddItem
9, // 2: messages.MutationEnvelope.remove_item:type_name -> messages.RemoveItem
10, // 3: messages.MutationEnvelope.remove_delivery:type_name -> messages.RemoveDelivery
11, // 4: messages.MutationEnvelope.change_quantity:type_name -> messages.ChangeQuantity
12, // 5: messages.MutationEnvelope.set_delivery:type_name -> messages.SetDelivery
13, // 6: messages.MutationEnvelope.set_pickup_point:type_name -> messages.SetPickupPoint
14, // 7: messages.MutationEnvelope.create_checkout_order:type_name -> messages.CreateCheckoutOrder
15, // 8: messages.MutationEnvelope.set_cart_items:type_name -> messages.SetCartRequest
16, // 9: messages.MutationEnvelope.order_completed:type_name -> messages.OrderCreated
3, // 10: messages.MutationReply.state:type_name -> messages.CartState
4, // 11: messages.CartState.items:type_name -> messages.CartItemState
5, // 12: messages.CartState.deliveries:type_name -> messages.DeliveryState
17, // 13: messages.DeliveryState.pickup_point:type_name -> messages.PickupPoint
3, // 14: messages.StateReply.state:type_name -> messages.CartState
0, // 15: messages.CartActor.Mutate:input_type -> messages.MutationEnvelope
2, // 16: messages.CartActor.GetState:input_type -> messages.StateRequest
1, // 17: messages.CartActor.Mutate:output_type -> messages.MutationReply
6, // 18: messages.CartActor.GetState:output_type -> messages.StateReply
17, // [17:19] is the sub-list for method output_type
15, // [15:17] is the sub-list for method input_type
15, // [15:15] is the sub-list for extension type_name
15, // [15:15] is the sub-list for extension extendee
0, // [0:15] is the sub-list for field type_name
}
func init() { file_cart_actor_proto_init() }
func file_cart_actor_proto_init() {
if File_cart_actor_proto != nil {
return
}
file_messages_proto_init()
file_cart_actor_proto_msgTypes[0].OneofWrappers = []any{
(*MutationEnvelope_AddRequest)(nil),
(*MutationEnvelope_AddItem)(nil),
(*MutationEnvelope_RemoveItem)(nil),
(*MutationEnvelope_RemoveDelivery)(nil),
(*MutationEnvelope_ChangeQuantity)(nil),
(*MutationEnvelope_SetDelivery)(nil),
(*MutationEnvelope_SetPickupPoint)(nil),
(*MutationEnvelope_CreateCheckoutOrder)(nil),
(*MutationEnvelope_SetCartItems)(nil),
(*MutationEnvelope_OrderCompleted)(nil),
}
file_cart_actor_proto_msgTypes[1].OneofWrappers = []any{
(*MutationReply_State)(nil),
(*MutationReply_Error)(nil),
}
file_cart_actor_proto_msgTypes[6].OneofWrappers = []any{
(*StateReply_State)(nil),
(*StateReply_Error)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_cart_actor_proto_rawDesc), len(file_cart_actor_proto_rawDesc)),
NumEnums: 0,
NumMessages: 7,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_cart_actor_proto_goTypes,
DependencyIndexes: file_cart_actor_proto_depIdxs,
MessageInfos: file_cart_actor_proto_msgTypes,
}.Build()
File_cart_actor_proto = out.File
file_cart_actor_proto_goTypes = nil
file_cart_actor_proto_depIdxs = nil
}