From 87470cb47fcad93ea53b2d563f18f5f69686f6c6 Mon Sep 17 00:00:00 2001 From: Anthony Akentiev Date: Thu, 5 Mar 2026 17:57:47 +0400 Subject: [PATCH 1/2] GetStatusResponse: add appliedPromocodes --- .../paymentserviceproto/paymentservice.pb.go | 4 +- .../paymentserviceproto/paymentservice2.pb.go | 33 ++++++++----- .../paymentservice2_vtproto.pb.go | 47 +++++++++++++++++++ .../paymentservice_tiers.pb.go | 4 +- .../protos/paymentservice2.proto | 1 + 5 files changed, 73 insertions(+), 16 deletions(-) diff --git a/paymentservice/paymentserviceproto/paymentservice.pb.go b/paymentservice/paymentserviceproto/paymentservice.pb.go index ddc3eea15..e49d48641 100644 --- a/paymentservice/paymentserviceproto/paymentservice.pb.go +++ b/paymentservice/paymentserviceproto/paymentservice.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 -// protoc v3.21.12 +// protoc-gen-go v1.36.9 +// protoc v6.33.0 // source: paymentservice/paymentserviceproto/protos/paymentservice.proto package paymentserviceproto diff --git a/paymentservice/paymentserviceproto/paymentservice2.pb.go b/paymentservice/paymentserviceproto/paymentservice2.pb.go index b7a1d0897..267f66684 100644 --- a/paymentservice/paymentserviceproto/paymentservice2.pb.go +++ b/paymentservice/paymentserviceproto/paymentservice2.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 -// protoc v3.21.12 +// protoc-gen-go v1.36.9 +// protoc v6.33.0 // source: paymentservice/paymentserviceproto/protos/paymentservice2.proto package paymentserviceproto @@ -1168,13 +1168,14 @@ func (*MembershipV2_GetStatusRequest) Descriptor() ([]byte, []int) { } type MembershipV2_GetStatusResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Products []*MembershipV2_PurchasedProduct `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` - NextInvoice *MembershipV2_Invoice `protobuf:"bytes,2,opt,name=nextInvoice,proto3" json:"nextInvoice,omitempty"` - TeamOwnerID string `protobuf:"bytes,3,opt,name=teamOwnerID,proto3" json:"teamOwnerID,omitempty"` - PaymentProvider MembershipV2_PaymentProvider `protobuf:"varint,4,opt,name=paymentProvider,proto3,enum=MembershipV2_PaymentProvider" json:"paymentProvider,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Products []*MembershipV2_PurchasedProduct `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` + NextInvoice *MembershipV2_Invoice `protobuf:"bytes,2,opt,name=nextInvoice,proto3" json:"nextInvoice,omitempty"` + TeamOwnerID string `protobuf:"bytes,3,opt,name=teamOwnerID,proto3" json:"teamOwnerID,omitempty"` + PaymentProvider MembershipV2_PaymentProvider `protobuf:"varint,4,opt,name=paymentProvider,proto3,enum=MembershipV2_PaymentProvider" json:"paymentProvider,omitempty"` + AppliedPromocodes []string `protobuf:"bytes,5,rep,name=appliedPromocodes,proto3" json:"appliedPromocodes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *MembershipV2_GetStatusResponse) Reset() { @@ -1235,6 +1236,13 @@ func (x *MembershipV2_GetStatusResponse) GetPaymentProvider() MembershipV2_Payme return MembershipV2_None } +func (x *MembershipV2_GetStatusResponse) GetAppliedPromocodes() []string { + if x != nil { + return x.AppliedPromocodes + } + return nil +} + type MembershipV2_StoreCartGetRequest struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields @@ -1963,7 +1971,7 @@ var File_paymentservice_paymentserviceproto_protos_paymentservice2_proto protore const file_paymentservice_paymentserviceproto_protos_paymentservice2_proto_rawDesc = "" + "\n" + - "?paymentservice/paymentserviceproto/protos/paymentservice2.proto\"\x99\x1c\n" + + "?paymentservice/paymentserviceproto/protos/paymentservice2.proto\"\xc7\x1c\n" + "\fMembershipV2\x1aF\n" + "\x06Amount\x12\x1a\n" + "\bcurrency\x18\x01 \x01(\tR\bcurrency\x12 \n" + @@ -2029,12 +2037,13 @@ const file_paymentservice_paymentserviceproto_protos_paymentservice2_proto_rawDe "\x12GetProductsRequest\x1aH\n" + "\x13GetProductsResponse\x121\n" + "\bproducts\x18\x01 \x03(\v2\x15.MembershipV2.ProductR\bproducts\x1a\x12\n" + - "\x10GetStatusRequest\x1a\xf3\x01\n" + + "\x10GetStatusRequest\x1a\xa1\x02\n" + "\x11GetStatusResponse\x12:\n" + "\bproducts\x18\x01 \x03(\v2\x1e.MembershipV2.PurchasedProductR\bproducts\x127\n" + "\vnextInvoice\x18\x02 \x01(\v2\x15.MembershipV2.InvoiceR\vnextInvoice\x12 \n" + "\vteamOwnerID\x18\x03 \x01(\tR\vteamOwnerID\x12G\n" + - "\x0fpaymentProvider\x18\x04 \x01(\x0e2\x1d.MembershipV2.PaymentProviderR\x0fpaymentProvider\x1a\x15\n" + + "\x0fpaymentProvider\x18\x04 \x01(\x0e2\x1d.MembershipV2.PaymentProviderR\x0fpaymentProvider\x12,\n" + + "\x11appliedPromocodes\x18\x05 \x03(\tR\x11appliedPromocodes\x1a\x15\n" + "\x13StoreCartGetRequest\x1a>\n" + "\x14StoreCartGetResponse\x12&\n" + "\x04cart\x18\x01 \x01(\v2\x12.MembershipV2.CartR\x04cart\x1a>\n" + diff --git a/paymentservice/paymentserviceproto/paymentservice2_vtproto.pb.go b/paymentservice/paymentserviceproto/paymentservice2_vtproto.pb.go index 38d9d93d7..e691f24a9 100644 --- a/paymentservice/paymentserviceproto/paymentservice2_vtproto.pb.go +++ b/paymentservice/paymentserviceproto/paymentservice2_vtproto.pb.go @@ -766,6 +766,15 @@ func (m *MembershipV2_GetStatusResponse) MarshalToSizedBufferVT(dAtA []byte) (in i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.AppliedPromocodes) > 0 { + for iNdEx := len(m.AppliedPromocodes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AppliedPromocodes[iNdEx]) + copy(dAtA[i:], m.AppliedPromocodes[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AppliedPromocodes[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } if m.PaymentProvider != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PaymentProvider)) i-- @@ -1786,6 +1795,12 @@ func (m *MembershipV2_GetStatusResponse) SizeVT() (n int) { if m.PaymentProvider != 0 { n += 1 + protohelpers.SizeOfVarint(uint64(m.PaymentProvider)) } + if len(m.AppliedPromocodes) > 0 { + for _, s := range m.AppliedPromocodes { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } n += len(m.unknownFields) return n } @@ -3862,6 +3877,38 @@ func (m *MembershipV2_GetStatusResponse) UnmarshalVT(dAtA []byte) error { break } } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppliedPromocodes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppliedPromocodes = append(m.AppliedPromocodes, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) diff --git a/paymentservice/paymentserviceproto/paymentservice_tiers.pb.go b/paymentservice/paymentserviceproto/paymentservice_tiers.pb.go index 085bdce77..f6a82617c 100644 --- a/paymentservice/paymentserviceproto/paymentservice_tiers.pb.go +++ b/paymentservice/paymentserviceproto/paymentservice_tiers.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 -// protoc v3.21.12 +// protoc-gen-go v1.36.9 +// protoc v6.33.0 // source: paymentservice/paymentserviceproto/protos/paymentservice_tiers.proto package paymentserviceproto diff --git a/paymentservice/paymentserviceproto/protos/paymentservice2.proto b/paymentservice/paymentserviceproto/protos/paymentservice2.proto index d0642ab4c..9d0b1251b 100644 --- a/paymentservice/paymentserviceproto/protos/paymentservice2.proto +++ b/paymentservice/paymentserviceproto/protos/paymentservice2.proto @@ -151,6 +151,7 @@ message MembershipV2 { MembershipV2.Invoice nextInvoice = 2; string teamOwnerID = 3; MembershipV2.PaymentProvider paymentProvider = 4; + repeated string appliedPromocodes = 5; } message StoreCartGetRequest { From 09493d42efd3352db01b0253e95b4575f44ed236 Mon Sep 17 00:00:00 2001 From: Anthony Akentiev Date: Thu, 12 Mar 2026 10:14:48 +0000 Subject: [PATCH 2/2] StoreCartUpdateRequest: add promocodes field --- .../paymentserviceproto/paymentservice2.pb.go | 38 ++++++-- .../paymentservice2_vtproto.pb.go | 94 +++++++++++++++++++ .../protos/paymentservice2.proto | 2 + 3 files changed, 125 insertions(+), 9 deletions(-) diff --git a/paymentservice/paymentserviceproto/paymentservice2.pb.go b/paymentservice/paymentserviceproto/paymentservice2.pb.go index 267f66684..cfbf503a4 100644 --- a/paymentservice/paymentserviceproto/paymentservice2.pb.go +++ b/paymentservice/paymentserviceproto/paymentservice2.pb.go @@ -987,10 +987,11 @@ type MembershipV2_Cart struct { Total *MembershipV2_Amount `protobuf:"bytes,2,opt,name=total,proto3" json:"total,omitempty"` // in case you are paying in the middle of the period (for existing customers) // the next invoice amount will also be generated - TotalNextInvoice *MembershipV2_Amount `protobuf:"bytes,3,opt,name=totalNextInvoice,proto3" json:"totalNextInvoice,omitempty"` - NextInvoiceDate uint64 `protobuf:"varint,4,opt,name=nextInvoiceDate,proto3" json:"nextInvoiceDate,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + TotalNextInvoice *MembershipV2_Amount `protobuf:"bytes,3,opt,name=totalNextInvoice,proto3" json:"totalNextInvoice,omitempty"` + NextInvoiceDate uint64 `protobuf:"varint,4,opt,name=nextInvoiceDate,proto3" json:"nextInvoiceDate,omitempty"` + AppliedPromocodes []string `protobuf:"bytes,5,rep,name=appliedPromocodes,proto3" json:"appliedPromocodes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *MembershipV2_Cart) Reset() { @@ -1051,6 +1052,13 @@ func (x *MembershipV2_Cart) GetNextInvoiceDate() uint64 { return 0 } +func (x *MembershipV2_Cart) GetAppliedPromocodes() []string { + if x != nil { + return x.AppliedPromocodes + } + return nil +} + type MembershipV2_GetProductsRequest struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields @@ -1456,6 +1464,7 @@ type MembershipV2_StoreCartUpdateRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Products []*MembershipV2_CartProduct `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` OwnerEthAddress string `protobuf:"bytes,2,opt,name=ownerEthAddress,proto3" json:"ownerEthAddress,omitempty"` + Promocodes []string `protobuf:"bytes,3,rep,name=promocodes,proto3" json:"promocodes,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1504,6 +1513,13 @@ func (x *MembershipV2_StoreCartUpdateRequest) GetOwnerEthAddress() string { return "" } +func (x *MembershipV2_StoreCartUpdateRequest) GetPromocodes() []string { + if x != nil { + return x.Promocodes + } + return nil +} + type MembershipV2_StoreCartUpdateResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Cart *MembershipV2_Cart `protobuf:"bytes,1,opt,name=cart,proto3" json:"cart,omitempty"` @@ -1971,7 +1987,7 @@ var File_paymentservice_paymentserviceproto_protos_paymentservice2_proto protore const file_paymentservice_paymentserviceproto_protos_paymentservice2_proto_rawDesc = "" + "\n" + - "?paymentservice/paymentserviceproto/protos/paymentservice2.proto\"\xc7\x1c\n" + + "?paymentservice/paymentserviceproto/protos/paymentservice2.proto\"\x96\x1d\n" + "\fMembershipV2\x1aF\n" + "\x06Amount\x12\x1a\n" + "\bcurrency\x18\x01 \x01(\tR\bcurrency\x12 \n" + @@ -2028,12 +2044,13 @@ const file_paymentservice_paymentserviceproto_protos_paymentservice2_proto_rawDe "\x06Status\x12\n" + "\n" + "\x06Unpaid\x10\x00\x12\b\n" + - "\x04Paid\x10\x01\x1a\xd5\x01\n" + + "\x04Paid\x10\x01\x1a\x83\x02\n" + "\x04Cart\x125\n" + "\bproducts\x18\x01 \x03(\v2\x19.MembershipV2.CartProductR\bproducts\x12*\n" + "\x05total\x18\x02 \x01(\v2\x14.MembershipV2.AmountR\x05total\x12@\n" + "\x10totalNextInvoice\x18\x03 \x01(\v2\x14.MembershipV2.AmountR\x10totalNextInvoice\x12(\n" + - "\x0fnextInvoiceDate\x18\x04 \x01(\x04R\x0fnextInvoiceDate\x1a\x14\n" + + "\x0fnextInvoiceDate\x18\x04 \x01(\x04R\x0fnextInvoiceDate\x12,\n" + + "\x11appliedPromocodes\x18\x05 \x03(\tR\x11appliedPromocodes\x1a\x14\n" + "\x12GetProductsRequest\x1aH\n" + "\x13GetProductsResponse\x121\n" + "\bproducts\x18\x01 \x03(\v2\x15.MembershipV2.ProductR\bproducts\x1a\x12\n" + @@ -2053,10 +2070,13 @@ const file_paymentservice_paymentserviceproto_protos_paymentservice2_proto_rawDe "\x19StoreCartCheckoutResponse\x12\x1e\n" + "\n" + "paymentUrl\x18\x01 \x01(\tR\n" + - "paymentUrl\x1ay\n" + + "paymentUrl\x1a\x99\x01\n" + "\x16StoreCartUpdateRequest\x125\n" + "\bproducts\x18\x01 \x03(\v2\x19.MembershipV2.CartProductR\bproducts\x12(\n" + - "\x0fownerEthAddress\x18\x02 \x01(\tR\x0fownerEthAddress\x1aA\n" + + "\x0fownerEthAddress\x18\x02 \x01(\tR\x0fownerEthAddress\x12\x1e\n" + + "\n" + + "promocodes\x18\x03 \x03(\tR\n" + + "promocodes\x1aA\n" + "\x17StoreCartUpdateResponse\x12&\n" + "\x04cart\x18\x01 \x01(\v2\x12.MembershipV2.CartR\x04cart\x1a\x17\n" + "\x15StoreCartClearRequest\x1a\x10\n" + diff --git a/paymentservice/paymentserviceproto/paymentservice2_vtproto.pb.go b/paymentservice/paymentserviceproto/paymentservice2_vtproto.pb.go index e691f24a9..e9500d5c1 100644 --- a/paymentservice/paymentserviceproto/paymentservice2_vtproto.pb.go +++ b/paymentservice/paymentserviceproto/paymentservice2_vtproto.pb.go @@ -585,6 +585,15 @@ func (m *MembershipV2_Cart) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.AppliedPromocodes) > 0 { + for iNdEx := len(m.AppliedPromocodes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AppliedPromocodes[iNdEx]) + copy(dAtA[i:], m.AppliedPromocodes[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AppliedPromocodes[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } if m.NextInvoiceDate != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NextInvoiceDate)) i-- @@ -1031,6 +1040,15 @@ func (m *MembershipV2_StoreCartUpdateRequest) MarshalToSizedBufferVT(dAtA []byte i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Promocodes) > 0 { + for iNdEx := len(m.Promocodes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Promocodes[iNdEx]) + copy(dAtA[i:], m.Promocodes[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Promocodes[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } if len(m.OwnerEthAddress) > 0 { i -= len(m.OwnerEthAddress) copy(dAtA[i:], m.OwnerEthAddress) @@ -1732,6 +1750,12 @@ func (m *MembershipV2_Cart) SizeVT() (n int) { if m.NextInvoiceDate != 0 { n += 1 + protohelpers.SizeOfVarint(uint64(m.NextInvoiceDate)) } + if len(m.AppliedPromocodes) > 0 { + for _, s := range m.AppliedPromocodes { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } n += len(m.unknownFields) return n } @@ -1883,6 +1907,12 @@ func (m *MembershipV2_StoreCartUpdateRequest) SizeVT() (n int) { if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if len(m.Promocodes) > 0 { + for _, s := range m.Promocodes { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } n += len(m.unknownFields) return n } @@ -3518,6 +3548,38 @@ func (m *MembershipV2_Cart) UnmarshalVT(dAtA []byte) error { break } } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppliedPromocodes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppliedPromocodes = append(m.AppliedPromocodes, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -4381,6 +4443,38 @@ func (m *MembershipV2_StoreCartUpdateRequest) UnmarshalVT(dAtA []byte) error { } m.OwnerEthAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Promocodes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Promocodes = append(m.Promocodes, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) diff --git a/paymentservice/paymentserviceproto/protos/paymentservice2.proto b/paymentservice/paymentserviceproto/protos/paymentservice2.proto index 9d0b1251b..a8f4c8b19 100644 --- a/paymentservice/paymentserviceproto/protos/paymentservice2.proto +++ b/paymentservice/paymentserviceproto/protos/paymentservice2.proto @@ -132,6 +132,7 @@ message MembershipV2 { // the next invoice amount will also be generated Amount totalNextInvoice = 3; uint64 nextInvoiceDate = 4; + repeated string appliedPromocodes = 5; } message GetProductsRequest { @@ -182,6 +183,7 @@ message MembershipV2 { message StoreCartUpdateRequest { repeated CartProduct products = 1; string ownerEthAddress = 2; + repeated string promocodes = 3; } message StoreCartUpdateResponse {