more features

This commit is contained in:
matst80
2024-11-14 20:02:34 +01:00
parent 3f6f78c839
commit 1c6c9b1894
5 changed files with 390 additions and 68 deletions

View File

@@ -35,23 +35,27 @@ const (
) )
type CartItem struct { type CartItem struct {
Id int `json:"id"` Id int `json:"id"`
ParentId int `json:"parentId,omitempty"` ParentId int `json:"parentId,omitempty"`
Sku string `json:"sku"` Sku string `json:"sku"`
Name string `json:"name"` Name string `json:"name"`
Price int64 `json:"price"` Price int64 `json:"price"`
OrgPrice int64 `json:"orgPrice"` OrgPrice int64 `json:"orgPrice"`
Stock StockStatus `json:"stock"` Stock StockStatus `json:"stock"`
Quantity int `json:"qty"` Quantity int `json:"qty"`
Tax int `json:"tax"` Tax int `json:"tax"`
Disclaimer string `json:"disclaimer,omitempty"` Disclaimer string `json:"disclaimer,omitempty"`
Image string `json:"image,omitempty"` ArticleType string `json:"type,omitempty"`
Image string `json:"image,omitempty"`
Outlet string `json:"outlet,omitempty"`
} }
type CartDelivery struct { type CartDelivery struct {
Provider string `json:"provider"` Id int `json:"id"`
Price int64 `json:"price"` Provider string `json:"provider"`
Items []int `json:"items"` Price int64 `json:"price"`
Items []int `json:"items"`
PickupPoint *messages.PickupPoint `json:"pickupPoint,omitempty"`
} }
type CartGrain struct { type CartGrain struct {
@@ -59,10 +63,10 @@ type CartGrain struct {
lastItemId int lastItemId int
lastDeliveryId int lastDeliveryId int
storageMessages []Message storageMessages []Message
Id CartId `json:"id"` Id CartId `json:"id"`
Items []*CartItem `json:"items"` Items []*CartItem `json:"items"`
TotalPrice int64 `json:"totalPrice"` TotalPrice int64 `json:"totalPrice"`
Deliveries []CartDelivery `json:"deliveries,omitempty"` Deliveries []*CartDelivery `json:"deliveries,omitempty"`
} }
type Grain interface { type Grain interface {
@@ -108,9 +112,9 @@ func getItemData(sku string, qty int) (*messages.AddItem, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
orgPrice, _ := getInt(item.Fields[6]) orgPrice, _ := getInt(item.Fields[5])
price, priceErr := getInt(item.Fields[5]) price, priceErr := getInt(item.Fields[4])
if priceErr != nil { if priceErr != nil {
return nil, fmt.Errorf("invalid price") return nil, fmt.Errorf("invalid price")
@@ -122,17 +126,25 @@ func getItemData(sku string, qty int) (*messages.AddItem, error) {
} else if item.StockLevel == "5+" { } else if item.StockLevel == "5+" {
stock = LowStock stock = LowStock
} }
articleType, _ := item.Fields[1].(string)
outletGrade, ok := item.Fields[20].(string)
var outlet *string
if ok {
outlet = &outletGrade
}
return &messages.AddItem{ return &messages.AddItem{
Quantity: int32(qty), Quantity: int32(qty),
Price: int64(price), Price: int64(price),
OrgPrice: int64(orgPrice), OrgPrice: int64(orgPrice),
Sku: sku, Sku: sku,
Name: item.Title, Name: item.Title,
Image: item.Img, Image: item.Img,
Stock: int32(stock), Stock: int32(stock),
Tax: 2500, Tax: 2500,
Disclaimer: item.Disclaimer, ArticleType: articleType,
Disclaimer: item.Disclaimer,
Outlet: outlet,
}, nil }, nil
} }
@@ -321,13 +333,48 @@ func (c *CartGrain) HandleMessage(message *Message, isReplay bool) (*FrameWithPa
} }
} }
} }
c.Deliveries = append(c.Deliveries, CartDelivery{ c.Deliveries = append(c.Deliveries, &CartDelivery{
Id: c.lastDeliveryId,
Provider: msg.Provider, Provider: msg.Provider,
Price: 49, Price: 49,
Items: items, Items: items,
}) })
} }
case RemoveDeliveryType: case RemoveDeliveryType:
msg, ok := message.Content.(*messages.RemoveDelivery)
if !ok {
err = fmt.Errorf("expected RemoveDelivery")
} else {
deliveries := make([]*CartDelivery, 0, len(c.Deliveries))
for _, delivery := range c.Deliveries {
if delivery.Id == int(msg.Id) {
c.TotalPrice -= delivery.Price
} else {
deliveries = append(deliveries, delivery)
}
}
c.Deliveries = deliveries
}
case SetPickupPointType:
msg, ok := message.Content.(*messages.SetPickupPoint)
if !ok {
err = fmt.Errorf("expected SetPickupPoint")
} else {
for _, delivery := range c.Deliveries {
if delivery.Id == int(msg.DeliveryId) {
delivery.PickupPoint = &messages.PickupPoint{
Id: msg.Id,
Address: msg.Address,
City: msg.City,
Zip: msg.Zip,
Country: msg.Country,
Name: msg.Name,
}
break
}
}
}
default: default:
err = fmt.Errorf("unknown message type %d", message.Type) err = fmt.Errorf("unknown message type %d", message.Type)
} }

View File

@@ -37,7 +37,7 @@ func spawn(id CartId) (*CartGrain, error) {
ret := &CartGrain{ ret := &CartGrain{
lastItemId: 0, lastItemId: 0,
lastDeliveryId: 0, lastDeliveryId: 0,
Deliveries: []CartDelivery{}, Deliveries: []*CartDelivery{},
Id: id, Id: id,
Items: []*CartItem{}, Items: []*CartItem{},
storageMessages: []Message{}, storageMessages: []Message{},

View File

@@ -8,4 +8,5 @@ const (
RemoveDeliveryType = 5 RemoveDeliveryType = 5
ChangeQuantityType = 6 ChangeQuantityType = 6
SetDeliveryType = 7 SetDeliveryType = 7
SetPickupPointType = 8
) )

View File

@@ -78,15 +78,17 @@ type AddItem struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Quantity int32 `protobuf:"varint,2,opt,name=Quantity,proto3" json:"Quantity,omitempty"` Quantity int32 `protobuf:"varint,2,opt,name=Quantity,proto3" json:"Quantity,omitempty"`
Price int64 `protobuf:"varint,3,opt,name=Price,proto3" json:"Price,omitempty"` Price int64 `protobuf:"varint,3,opt,name=Price,proto3" json:"Price,omitempty"`
OrgPrice int64 `protobuf:"varint,9,opt,name=OrgPrice,proto3" json:"OrgPrice,omitempty"` OrgPrice int64 `protobuf:"varint,9,opt,name=OrgPrice,proto3" json:"OrgPrice,omitempty"`
Sku string `protobuf:"bytes,4,opt,name=Sku,proto3" json:"Sku,omitempty"` Sku string `protobuf:"bytes,4,opt,name=Sku,proto3" json:"Sku,omitempty"`
Name string `protobuf:"bytes,5,opt,name=Name,proto3" json:"Name,omitempty"` Name string `protobuf:"bytes,5,opt,name=Name,proto3" json:"Name,omitempty"`
Image string `protobuf:"bytes,6,opt,name=Image,proto3" json:"Image,omitempty"` Image string `protobuf:"bytes,6,opt,name=Image,proto3" json:"Image,omitempty"`
Stock int32 `protobuf:"varint,7,opt,name=Stock,proto3" json:"Stock,omitempty"` Stock int32 `protobuf:"varint,7,opt,name=Stock,proto3" json:"Stock,omitempty"`
Tax int32 `protobuf:"varint,8,opt,name=Tax,proto3" json:"Tax,omitempty"` Tax int32 `protobuf:"varint,8,opt,name=Tax,proto3" json:"Tax,omitempty"`
Disclaimer string `protobuf:"bytes,10,opt,name=Disclaimer,proto3" json:"Disclaimer,omitempty"` Disclaimer string `protobuf:"bytes,10,opt,name=Disclaimer,proto3" json:"Disclaimer,omitempty"`
ArticleType string `protobuf:"bytes,11,opt,name=ArticleType,proto3" json:"ArticleType,omitempty"`
Outlet *string `protobuf:"bytes,12,opt,name=Outlet,proto3,oneof" json:"Outlet,omitempty"`
} }
func (x *AddItem) Reset() { func (x *AddItem) Reset() {
@@ -182,6 +184,20 @@ func (x *AddItem) GetDisclaimer() string {
return "" return ""
} }
func (x *AddItem) GetArticleType() string {
if x != nil {
return x.ArticleType
}
return ""
}
func (x *AddItem) GetOutlet() string {
if x != nil && x.Outlet != nil {
return *x.Outlet
}
return ""
}
type RemoveItem struct { type RemoveItem struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@@ -285,8 +301,9 @@ type SetDelivery struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Provider string `protobuf:"bytes,1,opt,name=Provider,proto3" json:"Provider,omitempty"` Provider string `protobuf:"bytes,1,opt,name=Provider,proto3" json:"Provider,omitempty"`
Items []int64 `protobuf:"varint,2,rep,packed,name=Items,proto3" json:"Items,omitempty"` Items []int64 `protobuf:"varint,2,rep,packed,name=Items,proto3" json:"Items,omitempty"`
PickupPoint *PickupPoint `protobuf:"bytes,3,opt,name=PickupPoint,proto3,oneof" json:"PickupPoint,omitempty"`
} }
func (x *SetDelivery) Reset() { func (x *SetDelivery) Reset() {
@@ -333,6 +350,191 @@ func (x *SetDelivery) GetItems() []int64 {
return nil return nil
} }
func (x *SetDelivery) GetPickupPoint() *PickupPoint {
if x != nil {
return x.PickupPoint
}
return nil
}
type SetPickupPoint struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
DeliveryId int64 `protobuf:"varint,1,opt,name=DeliveryId,proto3" json:"DeliveryId,omitempty"`
Id string `protobuf:"bytes,2,opt,name=Id,proto3" json:"Id,omitempty"`
Name *string `protobuf:"bytes,3,opt,name=Name,proto3,oneof" json:"Name,omitempty"`
Address *string `protobuf:"bytes,4,opt,name=Address,proto3,oneof" json:"Address,omitempty"`
City *string `protobuf:"bytes,5,opt,name=City,proto3,oneof" json:"City,omitempty"`
Zip *string `protobuf:"bytes,6,opt,name=Zip,proto3,oneof" json:"Zip,omitempty"`
Country *string `protobuf:"bytes,7,opt,name=Country,proto3,oneof" json:"Country,omitempty"`
}
func (x *SetPickupPoint) Reset() {
*x = SetPickupPoint{}
mi := &file_messages_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SetPickupPoint) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SetPickupPoint) ProtoMessage() {}
func (x *SetPickupPoint) ProtoReflect() protoreflect.Message {
mi := &file_messages_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 SetPickupPoint.ProtoReflect.Descriptor instead.
func (*SetPickupPoint) Descriptor() ([]byte, []int) {
return file_messages_proto_rawDescGZIP(), []int{5}
}
func (x *SetPickupPoint) GetDeliveryId() int64 {
if x != nil {
return x.DeliveryId
}
return 0
}
func (x *SetPickupPoint) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *SetPickupPoint) GetName() string {
if x != nil && x.Name != nil {
return *x.Name
}
return ""
}
func (x *SetPickupPoint) GetAddress() string {
if x != nil && x.Address != nil {
return *x.Address
}
return ""
}
func (x *SetPickupPoint) GetCity() string {
if x != nil && x.City != nil {
return *x.City
}
return ""
}
func (x *SetPickupPoint) GetZip() string {
if x != nil && x.Zip != nil {
return *x.Zip
}
return ""
}
func (x *SetPickupPoint) GetCountry() string {
if x != nil && x.Country != nil {
return *x.Country
}
return ""
}
type PickupPoint struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id,omitempty"`
Name *string `protobuf:"bytes,2,opt,name=Name,proto3,oneof" json:"Name,omitempty"`
Address *string `protobuf:"bytes,3,opt,name=Address,proto3,oneof" json:"Address,omitempty"`
City *string `protobuf:"bytes,4,opt,name=City,proto3,oneof" json:"City,omitempty"`
Zip *string `protobuf:"bytes,5,opt,name=Zip,proto3,oneof" json:"Zip,omitempty"`
Country *string `protobuf:"bytes,6,opt,name=Country,proto3,oneof" json:"Country,omitempty"`
}
func (x *PickupPoint) Reset() {
*x = PickupPoint{}
mi := &file_messages_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PickupPoint) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PickupPoint) ProtoMessage() {}
func (x *PickupPoint) ProtoReflect() protoreflect.Message {
mi := &file_messages_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 PickupPoint.ProtoReflect.Descriptor instead.
func (*PickupPoint) Descriptor() ([]byte, []int) {
return file_messages_proto_rawDescGZIP(), []int{6}
}
func (x *PickupPoint) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *PickupPoint) GetName() string {
if x != nil && x.Name != nil {
return *x.Name
}
return ""
}
func (x *PickupPoint) GetAddress() string {
if x != nil && x.Address != nil {
return *x.Address
}
return ""
}
func (x *PickupPoint) GetCity() string {
if x != nil && x.City != nil {
return *x.City
}
return ""
}
func (x *PickupPoint) GetZip() string {
if x != nil && x.Zip != nil {
return *x.Zip
}
return ""
}
func (x *PickupPoint) GetCountry() string {
if x != nil && x.Country != nil {
return *x.Country
}
return ""
}
type RemoveDelivery struct { type RemoveDelivery struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@@ -343,7 +545,7 @@ type RemoveDelivery struct {
func (x *RemoveDelivery) Reset() { func (x *RemoveDelivery) Reset() {
*x = RemoveDelivery{} *x = RemoveDelivery{}
mi := &file_messages_proto_msgTypes[5] mi := &file_messages_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -355,7 +557,7 @@ func (x *RemoveDelivery) String() string {
func (*RemoveDelivery) ProtoMessage() {} func (*RemoveDelivery) ProtoMessage() {}
func (x *RemoveDelivery) ProtoReflect() protoreflect.Message { func (x *RemoveDelivery) ProtoReflect() protoreflect.Message {
mi := &file_messages_proto_msgTypes[5] mi := &file_messages_proto_msgTypes[7]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -368,7 +570,7 @@ func (x *RemoveDelivery) ProtoReflect() protoreflect.Message {
// Deprecated: Use RemoveDelivery.ProtoReflect.Descriptor instead. // Deprecated: Use RemoveDelivery.ProtoReflect.Descriptor instead.
func (*RemoveDelivery) Descriptor() ([]byte, []int) { func (*RemoveDelivery) Descriptor() ([]byte, []int) {
return file_messages_proto_rawDescGZIP(), []int{5} return file_messages_proto_rawDescGZIP(), []int{7}
} }
func (x *RemoveDelivery) GetId() int64 { func (x *RemoveDelivery) GetId() int64 {
@@ -386,7 +588,7 @@ var file_messages_proto_rawDesc = []byte{
0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x51, 0x75, 0x61, 0x6e,
0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x51, 0x75, 0x61, 0x6e,
0x74, 0x69, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x6b, 0x75, 0x18, 0x02, 0x20, 0x01, 0x28, 0x74, 0x69, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x6b, 0x75, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x53, 0x6b, 0x75, 0x22, 0xdb, 0x01, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x49, 0x74, 0x09, 0x52, 0x03, 0x53, 0x6b, 0x75, 0x22, 0xa5, 0x02, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x49, 0x74,
0x65, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x65, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x14,
0x0a, 0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x50, 0x0a, 0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x50,
@@ -400,20 +602,59 @@ var file_messages_proto_rawDesc = []byte{
0x63, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x54, 0x61, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x63, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x54, 0x61, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52,
0x03, 0x54, 0x61, 0x78, 0x12, 0x1e, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x03, 0x54, 0x61, 0x78, 0x12, 0x1e, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d,
0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x6c, 0x61,
0x69, 0x6d, 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x0a, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x41, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65, 0x54,
0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x41, 0x72, 0x74, 0x69, 0x63,
0x49, 0x64, 0x22, 0x3c, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x61, 0x6e, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x4f, 0x75, 0x74, 0x6c, 0x65, 0x74,
0x74, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x4f, 0x75, 0x74, 0x6c, 0x65, 0x74,
0x52, 0x02, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x4f, 0x75, 0x74, 0x6c, 0x65, 0x74, 0x22, 0x1c,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x0a, 0x0a, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02,
0x22, 0x3f, 0x0a, 0x0b, 0x53, 0x65, 0x74, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x12, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x64, 0x22, 0x3c, 0x0a, 0x0e,
0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x0e,
0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x64, 0x12, 0x1a,
0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x0a, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x73, 0x22, 0x20, 0x0a, 0x0e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x52, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x22, 0x8d, 0x01, 0x0a, 0x0b, 0x53,
0x65, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x65, 0x74, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72,
0x02, 0x49, 0x64, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x3b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72,
0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18,
0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x3c, 0x0a, 0x0b,
0x50, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x50, 0x69, 0x63,
0x6b, 0x75, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x50, 0x69, 0x63, 0x6b,
0x75, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x50,
0x69, 0x63, 0x6b, 0x75, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0xf9, 0x01, 0x0a, 0x0e, 0x53,
0x65, 0x74, 0x50, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1e, 0x0a,
0x0a, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x03, 0x52, 0x0a, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x49, 0x64, 0x12, 0x0e, 0x0a,
0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x64, 0x12, 0x17, 0x0a,
0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x4e,
0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73,
0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65,
0x73, 0x73, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20,
0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x12, 0x15,
0x0a, 0x03, 0x5a, 0x69, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x03, 0x5a,
0x69, 0x70, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79,
0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72,
0x79, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0a, 0x0a,
0x08, 0x5f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x43, 0x69,
0x74, 0x79, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x5a, 0x69, 0x70, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x43,
0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x22, 0xd6, 0x01, 0x0a, 0x0b, 0x50, 0x69, 0x63, 0x6b, 0x75,
0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x02, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12,
0x1d, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x48, 0x01, 0x52, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, 0x12, 0x17,
0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x04,
0x43, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x5a, 0x69, 0x70, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x03, 0x5a, 0x69, 0x70, 0x88, 0x01, 0x01, 0x12, 0x1d,
0x0a, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48,
0x04, 0x52, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a,
0x05, 0x5f, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x41, 0x64, 0x64, 0x72, 0x65,
0x73, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x43, 0x69, 0x74, 0x79, 0x42, 0x06, 0x0a, 0x04, 0x5f,
0x5a, 0x69, 0x70, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x22,
0x20, 0x0a, 0x0e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72,
0x79, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49,
0x64, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x3b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@@ -428,21 +669,24 @@ func file_messages_proto_rawDescGZIP() []byte {
return file_messages_proto_rawDescData return file_messages_proto_rawDescData
} }
var file_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_messages_proto_goTypes = []any{ var file_messages_proto_goTypes = []any{
(*AddRequest)(nil), // 0: messages.AddRequest (*AddRequest)(nil), // 0: messages.AddRequest
(*AddItem)(nil), // 1: messages.AddItem (*AddItem)(nil), // 1: messages.AddItem
(*RemoveItem)(nil), // 2: messages.RemoveItem (*RemoveItem)(nil), // 2: messages.RemoveItem
(*ChangeQuantity)(nil), // 3: messages.ChangeQuantity (*ChangeQuantity)(nil), // 3: messages.ChangeQuantity
(*SetDelivery)(nil), // 4: messages.SetDelivery (*SetDelivery)(nil), // 4: messages.SetDelivery
(*RemoveDelivery)(nil), // 5: messages.RemoveDelivery (*SetPickupPoint)(nil), // 5: messages.SetPickupPoint
(*PickupPoint)(nil), // 6: messages.PickupPoint
(*RemoveDelivery)(nil), // 7: messages.RemoveDelivery
} }
var file_messages_proto_depIdxs = []int32{ var file_messages_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type 6, // 0: messages.SetDelivery.PickupPoint:type_name -> messages.PickupPoint
0, // [0:0] is the sub-list for method input_type 1, // [1:1] is the sub-list for method output_type
0, // [0:0] is the sub-list for extension type_name 1, // [1:1] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension extendee 1, // [1:1] is the sub-list for extension type_name
0, // [0:0] is the sub-list for field type_name 1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
} }
func init() { file_messages_proto_init() } func init() { file_messages_proto_init() }
@@ -450,13 +694,17 @@ func file_messages_proto_init() {
if File_messages_proto != nil { if File_messages_proto != nil {
return return
} }
file_messages_proto_msgTypes[1].OneofWrappers = []any{}
file_messages_proto_msgTypes[4].OneofWrappers = []any{}
file_messages_proto_msgTypes[5].OneofWrappers = []any{}
file_messages_proto_msgTypes[6].OneofWrappers = []any{}
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_messages_proto_rawDesc, RawDescriptor: file_messages_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 6, NumMessages: 8,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@@ -17,6 +17,8 @@ message AddItem {
int32 Stock = 7; int32 Stock = 7;
int32 Tax = 8; int32 Tax = 8;
string Disclaimer = 10; string Disclaimer = 10;
string ArticleType = 11;
optional string Outlet = 12;
} }
message RemoveItem { message RemoveItem {
@@ -31,6 +33,30 @@ message ChangeQuantity {
message SetDelivery { message SetDelivery {
string Provider = 1; string Provider = 1;
repeated int64 Items = 2; repeated int64 Items = 2;
optional PickupPoint PickupPoint = 3;
string Country = 4;
string Zip = 5;
optional string Address = 6;
optional string City = 7;
}
message SetPickupPoint {
int64 DeliveryId = 1;
string Id = 2;
optional string Name = 3;
optional string Address = 4;
optional string City = 5;
optional string Zip = 6;
optional string Country = 7;
}
message PickupPoint {
string Id = 1;
optional string Name = 2;
optional string Address = 3;
optional string City = 4;
optional string Zip = 5;
optional string Country = 6;
} }
message RemoveDelivery { message RemoveDelivery {