simpler rules
This commit is contained in:
@@ -926,86 +926,18 @@ func (x *InitializeCheckout) GetPaymentInProgress() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
type VoucherRule struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
|
||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
|
||||
Condition string `protobuf:"bytes,4,opt,name=condition,proto3" json:"condition,omitempty"`
|
||||
Action string `protobuf:"bytes,5,opt,name=action,proto3" json:"action,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *VoucherRule) Reset() {
|
||||
*x = VoucherRule{}
|
||||
mi := &file_messages_proto_msgTypes[12]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *VoucherRule) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*VoucherRule) ProtoMessage() {}
|
||||
|
||||
func (x *VoucherRule) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_messages_proto_msgTypes[12]
|
||||
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 VoucherRule.ProtoReflect.Descriptor instead.
|
||||
func (*VoucherRule) Descriptor() ([]byte, []int) {
|
||||
return file_messages_proto_rawDescGZIP(), []int{12}
|
||||
}
|
||||
|
||||
func (x *VoucherRule) GetType() string {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *VoucherRule) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *VoucherRule) GetCondition() string {
|
||||
if x != nil {
|
||||
return x.Condition
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *VoucherRule) GetAction() string {
|
||||
if x != nil {
|
||||
return x.Action
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type AddVoucher struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
|
||||
Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
VoucherRules []*VoucherRule `protobuf:"bytes,3,rep,name=voucherRules,proto3" json:"voucherRules,omitempty"`
|
||||
VoucherRules []string `protobuf:"bytes,3,rep,name=voucherRules,proto3" json:"voucherRules,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AddVoucher) Reset() {
|
||||
*x = AddVoucher{}
|
||||
mi := &file_messages_proto_msgTypes[13]
|
||||
mi := &file_messages_proto_msgTypes[12]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -1017,7 +949,7 @@ func (x *AddVoucher) String() string {
|
||||
func (*AddVoucher) ProtoMessage() {}
|
||||
|
||||
func (x *AddVoucher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_messages_proto_msgTypes[13]
|
||||
mi := &file_messages_proto_msgTypes[12]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -1030,7 +962,7 @@ func (x *AddVoucher) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use AddVoucher.ProtoReflect.Descriptor instead.
|
||||
func (*AddVoucher) Descriptor() ([]byte, []int) {
|
||||
return file_messages_proto_rawDescGZIP(), []int{13}
|
||||
return file_messages_proto_rawDescGZIP(), []int{12}
|
||||
}
|
||||
|
||||
func (x *AddVoucher) GetCode() string {
|
||||
@@ -1047,7 +979,7 @@ func (x *AddVoucher) GetValue() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AddVoucher) GetVoucherRules() []*VoucherRule {
|
||||
func (x *AddVoucher) GetVoucherRules() []string {
|
||||
if x != nil {
|
||||
return x.VoucherRules
|
||||
}
|
||||
@@ -1063,7 +995,7 @@ type RemoveVoucher struct {
|
||||
|
||||
func (x *RemoveVoucher) Reset() {
|
||||
*x = RemoveVoucher{}
|
||||
mi := &file_messages_proto_msgTypes[14]
|
||||
mi := &file_messages_proto_msgTypes[13]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -1075,7 +1007,7 @@ func (x *RemoveVoucher) String() string {
|
||||
func (*RemoveVoucher) ProtoMessage() {}
|
||||
|
||||
func (x *RemoveVoucher) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_messages_proto_msgTypes[14]
|
||||
mi := &file_messages_proto_msgTypes[13]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -1088,7 +1020,7 @@ func (x *RemoveVoucher) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use RemoveVoucher.ProtoReflect.Descriptor instead.
|
||||
func (*RemoveVoucher) Descriptor() ([]byte, []int) {
|
||||
return file_messages_proto_rawDescGZIP(), []int{14}
|
||||
return file_messages_proto_rawDescGZIP(), []int{13}
|
||||
}
|
||||
|
||||
func (x *RemoveVoucher) GetId() uint32 {
|
||||
@@ -1110,7 +1042,7 @@ type UpsertSubscriptionDetails struct {
|
||||
|
||||
func (x *UpsertSubscriptionDetails) Reset() {
|
||||
*x = UpsertSubscriptionDetails{}
|
||||
mi := &file_messages_proto_msgTypes[15]
|
||||
mi := &file_messages_proto_msgTypes[14]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -1122,7 +1054,7 @@ func (x *UpsertSubscriptionDetails) String() string {
|
||||
func (*UpsertSubscriptionDetails) ProtoMessage() {}
|
||||
|
||||
func (x *UpsertSubscriptionDetails) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_messages_proto_msgTypes[15]
|
||||
mi := &file_messages_proto_msgTypes[14]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -1135,7 +1067,7 @@ func (x *UpsertSubscriptionDetails) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use UpsertSubscriptionDetails.ProtoReflect.Descriptor instead.
|
||||
func (*UpsertSubscriptionDetails) Descriptor() ([]byte, []int) {
|
||||
return file_messages_proto_rawDescGZIP(), []int{15}
|
||||
return file_messages_proto_rawDescGZIP(), []int{14}
|
||||
}
|
||||
|
||||
func (x *UpsertSubscriptionDetails) GetId() string {
|
||||
@@ -1177,7 +1109,7 @@ type PreConditionFailed struct {
|
||||
|
||||
func (x *PreConditionFailed) Reset() {
|
||||
*x = PreConditionFailed{}
|
||||
mi := &file_messages_proto_msgTypes[16]
|
||||
mi := &file_messages_proto_msgTypes[15]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -1189,7 +1121,7 @@ func (x *PreConditionFailed) String() string {
|
||||
func (*PreConditionFailed) ProtoMessage() {}
|
||||
|
||||
func (x *PreConditionFailed) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_messages_proto_msgTypes[16]
|
||||
mi := &file_messages_proto_msgTypes[15]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -1202,7 +1134,7 @@ func (x *PreConditionFailed) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PreConditionFailed.ProtoReflect.Descriptor instead.
|
||||
func (*PreConditionFailed) Descriptor() ([]byte, []int) {
|
||||
return file_messages_proto_rawDescGZIP(), []int{16}
|
||||
return file_messages_proto_rawDescGZIP(), []int{15}
|
||||
}
|
||||
|
||||
func (x *PreConditionFailed) GetOperation() string {
|
||||
@@ -1335,17 +1267,12 @@ const file_messages_proto_rawDesc = "" +
|
||||
"\x12InitializeCheckout\x12\x18\n" +
|
||||
"\aorderId\x18\x01 \x01(\tR\aorderId\x12\x16\n" +
|
||||
"\x06status\x18\x02 \x01(\tR\x06status\x12,\n" +
|
||||
"\x11paymentInProgress\x18\x03 \x01(\bR\x11paymentInProgress\"y\n" +
|
||||
"\vVoucherRule\x12\x12\n" +
|
||||
"\x04type\x18\x02 \x01(\tR\x04type\x12 \n" +
|
||||
"\vdescription\x18\x03 \x01(\tR\vdescription\x12\x1c\n" +
|
||||
"\tcondition\x18\x04 \x01(\tR\tcondition\x12\x16\n" +
|
||||
"\x06action\x18\x05 \x01(\tR\x06action\"q\n" +
|
||||
"\x11paymentInProgress\x18\x03 \x01(\bR\x11paymentInProgress\"Z\n" +
|
||||
"\n" +
|
||||
"AddVoucher\x12\x12\n" +
|
||||
"\x04code\x18\x01 \x01(\tR\x04code\x12\x14\n" +
|
||||
"\x05value\x18\x02 \x01(\x03R\x05value\x129\n" +
|
||||
"\fvoucherRules\x18\x03 \x03(\v2\x15.messages.VoucherRuleR\fvoucherRules\"\x1f\n" +
|
||||
"\x05value\x18\x02 \x01(\x03R\x05value\x12\"\n" +
|
||||
"\fvoucherRules\x18\x03 \x03(\tR\fvoucherRules\"\x1f\n" +
|
||||
"\rRemoveVoucher\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\rR\x02id\"\xa7\x01\n" +
|
||||
"\x19UpsertSubscriptionDetails\x12\x13\n" +
|
||||
@@ -1371,7 +1298,7 @@ func file_messages_proto_rawDescGZIP() []byte {
|
||||
return file_messages_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
|
||||
var file_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 16)
|
||||
var file_messages_proto_goTypes = []any{
|
||||
(*ClearCartRequest)(nil), // 0: messages.ClearCartRequest
|
||||
(*AddItem)(nil), // 1: messages.AddItem
|
||||
@@ -1385,23 +1312,21 @@ var file_messages_proto_goTypes = []any{
|
||||
(*OrderCreated)(nil), // 9: messages.OrderCreated
|
||||
(*Noop)(nil), // 10: messages.Noop
|
||||
(*InitializeCheckout)(nil), // 11: messages.InitializeCheckout
|
||||
(*VoucherRule)(nil), // 12: messages.VoucherRule
|
||||
(*AddVoucher)(nil), // 13: messages.AddVoucher
|
||||
(*RemoveVoucher)(nil), // 14: messages.RemoveVoucher
|
||||
(*UpsertSubscriptionDetails)(nil), // 15: messages.UpsertSubscriptionDetails
|
||||
(*PreConditionFailed)(nil), // 16: messages.PreConditionFailed
|
||||
(*anypb.Any)(nil), // 17: google.protobuf.Any
|
||||
(*AddVoucher)(nil), // 12: messages.AddVoucher
|
||||
(*RemoveVoucher)(nil), // 13: messages.RemoveVoucher
|
||||
(*UpsertSubscriptionDetails)(nil), // 14: messages.UpsertSubscriptionDetails
|
||||
(*PreConditionFailed)(nil), // 15: messages.PreConditionFailed
|
||||
(*anypb.Any)(nil), // 16: google.protobuf.Any
|
||||
}
|
||||
var file_messages_proto_depIdxs = []int32{
|
||||
6, // 0: messages.SetDelivery.pickupPoint:type_name -> messages.PickupPoint
|
||||
12, // 1: messages.AddVoucher.voucherRules:type_name -> messages.VoucherRule
|
||||
17, // 2: messages.UpsertSubscriptionDetails.data:type_name -> google.protobuf.Any
|
||||
17, // 3: messages.PreConditionFailed.input:type_name -> google.protobuf.Any
|
||||
4, // [4:4] is the sub-list for method output_type
|
||||
4, // [4:4] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
16, // 1: messages.UpsertSubscriptionDetails.data:type_name -> google.protobuf.Any
|
||||
16, // 2: messages.PreConditionFailed.input:type_name -> google.protobuf.Any
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_messages_proto_init() }
|
||||
@@ -1413,14 +1338,14 @@ func file_messages_proto_init() {
|
||||
file_messages_proto_msgTypes[4].OneofWrappers = []any{}
|
||||
file_messages_proto_msgTypes[5].OneofWrappers = []any{}
|
||||
file_messages_proto_msgTypes[6].OneofWrappers = []any{}
|
||||
file_messages_proto_msgTypes[15].OneofWrappers = []any{}
|
||||
file_messages_proto_msgTypes[14].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_messages_proto_rawDesc), len(file_messages_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 17,
|
||||
NumMessages: 16,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user