chore: initial commit

This commit is contained in:
2024-04-16 22:27:52 +01:00
commit 531b5dabe2
194 changed files with 27071 additions and 0 deletions

View File

@@ -0,0 +1,753 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/order/v1/service.proto
package order_v1
import (
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
_ "google.golang.org/genproto/googleapis/api/annotations"
_ "google.golang.org/genproto/googleapis/api/visibility"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb"
reflect "reflect"
sync "sync"
)
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)
)
type ViewOrderRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
OrderId string `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
}
func (x *ViewOrderRequest) Reset() {
*x = ViewOrderRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewOrderRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewOrderRequest) ProtoMessage() {}
func (x *ViewOrderRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewOrderRequest.ProtoReflect.Descriptor instead.
func (*ViewOrderRequest) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{0}
}
func (x *ViewOrderRequest) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
type ViewOrderResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"`
}
func (x *ViewOrderResponse) Reset() {
*x = ViewOrderResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewOrderResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewOrderResponse) ProtoMessage() {}
func (x *ViewOrderResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewOrderResponse.ProtoReflect.Descriptor instead.
func (*ViewOrderResponse) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{1}
}
func (x *ViewOrderResponse) GetOrder() *Order {
if x != nil {
return x.Order
}
return nil
}
type ViewOrdersRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
}
func (x *ViewOrdersRequest) Reset() {
*x = ViewOrdersRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewOrdersRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewOrdersRequest) ProtoMessage() {}
func (x *ViewOrdersRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewOrdersRequest.ProtoReflect.Descriptor instead.
func (*ViewOrdersRequest) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{2}
}
func (x *ViewOrdersRequest) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
type ViewOrdersResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Orders []*Order `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"`
}
func (x *ViewOrdersResponse) Reset() {
*x = ViewOrdersResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewOrdersResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewOrdersResponse) ProtoMessage() {}
func (x *ViewOrdersResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewOrdersResponse.ProtoReflect.Descriptor instead.
func (*ViewOrdersResponse) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{3}
}
func (x *ViewOrdersResponse) GetOrders() []*Order {
if x != nil {
return x.Orders
}
return nil
}
type GetOrderItemsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *GetOrderItemsRequest) Reset() {
*x = GetOrderItemsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetOrderItemsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetOrderItemsRequest) ProtoMessage() {}
func (x *GetOrderItemsRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetOrderItemsRequest.ProtoReflect.Descriptor instead.
func (*GetOrderItemsRequest) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{4}
}
func (x *GetOrderItemsRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
type GetOrderItemsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Items map[string]int32 `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
}
func (x *GetOrderItemsResponse) Reset() {
*x = GetOrderItemsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetOrderItemsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetOrderItemsResponse) ProtoMessage() {}
func (x *GetOrderItemsResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetOrderItemsResponse.ProtoReflect.Descriptor instead.
func (*GetOrderItemsResponse) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{5}
}
func (x *GetOrderItemsResponse) GetItems() map[string]int32 {
if x != nil {
return x.Items
}
return nil
}
type PlaceOrderRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Cart map[string]int32 `protobuf:"bytes,1,rep,name=cart,proto3" json:"cart,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
}
func (x *PlaceOrderRequest) Reset() {
*x = PlaceOrderRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PlaceOrderRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PlaceOrderRequest) ProtoMessage() {}
func (x *PlaceOrderRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PlaceOrderRequest.ProtoReflect.Descriptor instead.
func (*PlaceOrderRequest) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{6}
}
func (x *PlaceOrderRequest) GetCart() map[string]int32 {
if x != nil {
return x.Cart
}
return nil
}
func (x *PlaceOrderRequest) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
type PlaceOrderResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"`
}
func (x *PlaceOrderResponse) Reset() {
*x = PlaceOrderResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PlaceOrderResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PlaceOrderResponse) ProtoMessage() {}
func (x *PlaceOrderResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PlaceOrderResponse.ProtoReflect.Descriptor instead.
func (*PlaceOrderResponse) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{7}
}
func (x *PlaceOrderResponse) GetOrder() *Order {
if x != nil {
return x.Order
}
return nil
}
var File_stocklet_order_v1_service_proto protoreflect.FileDescriptor
var file_stocklet_order_v1_service_proto_rawDesc = []byte{
0x0a, 0x1f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x11, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e,
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x73, 0x69,
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d,
0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x73, 0x74,
0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31,
0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f,
0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76,
0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65,
0x74, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x36, 0x0a, 0x10, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72,
0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x08, 0x6f, 0x72,
0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48,
0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0x43,
0x0a, 0x11, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72,
0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72,
0x64, 0x65, 0x72, 0x22, 0x3d, 0x0a, 0x11, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74,
0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba,
0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72,
0x49, 0x64, 0x22, 0x46, 0x0a, 0x12, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64,
0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x22, 0x2f, 0x0a, 0x14, 0x47, 0x65,
0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07,
0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0xaa, 0x01, 0x0a, 0x15,
0x47, 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e,
0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65,
0x72, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x49,
0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0c, 0xba, 0x48, 0x09, 0x9a, 0x01,
0x06, 0x2a, 0x04, 0x1a, 0x02, 0x20, 0x00, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x38,
0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xbf, 0x01, 0x0a, 0x11, 0x50, 0x6c, 0x61,
0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50,
0x0a, 0x04, 0x63, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x73,
0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31,
0x2e, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0c, 0xba, 0x48,
0x09, 0x9a, 0x01, 0x06, 0x2a, 0x04, 0x1a, 0x02, 0x20, 0x00, 0x52, 0x04, 0x63, 0x61, 0x72, 0x74,
0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49,
0x64, 0x1a, 0x37, 0x0a, 0x09, 0x43, 0x61, 0x72, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x44, 0x0a, 0x12, 0x50, 0x6c,
0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x2e, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x18, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x32, 0xcd, 0x07, 0x0a, 0x0c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x12, 0x79, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f,
0x12, 0x26, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66,
0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x6f,
0x72, 0x64, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x09,
0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x23, 0x2e, 0x73, 0x74, 0x6f, 0x63,
0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69,
0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24,
0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e,
0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76,
0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x7b,
0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x71, 0x0a, 0x0a, 0x56, 0x69, 0x65,
0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x24, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c,
0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77,
0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76,
0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x76,
0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x78, 0x0a, 0x0a,
0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x24, 0x2e, 0x73, 0x74, 0x6f,
0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50,
0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x25, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a,
0x04, 0x63, 0x61, 0x72, 0x74, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x2f, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x12, 0x75, 0x0a, 0x1d, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73,
0x73, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x51, 0x75, 0x6f,
0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c,
0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f,
0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x45, 0x76,
0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4,
0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x73, 0x0a,
0x1c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73,
0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x2e,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e,
0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x22, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e,
0x41, 0x4c, 0x12, 0x77, 0x0a, 0x1e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x53, 0x68, 0x69,
0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45,
0x76, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e,
0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65,
0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e,
0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02,
0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x73, 0x0a, 0x1c, 0x50,
0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f,
0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x73, 0x74,
0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31,
0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65,
0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10,
0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c,
0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68,
0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f,
0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x6f,
0x72, 0x64, 0x65, 0x72, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_order_v1_service_proto_rawDescOnce sync.Once
file_stocklet_order_v1_service_proto_rawDescData = file_stocklet_order_v1_service_proto_rawDesc
)
func file_stocklet_order_v1_service_proto_rawDescGZIP() []byte {
file_stocklet_order_v1_service_proto_rawDescOnce.Do(func() {
file_stocklet_order_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_order_v1_service_proto_rawDescData)
})
return file_stocklet_order_v1_service_proto_rawDescData
}
var file_stocklet_order_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_stocklet_order_v1_service_proto_goTypes = []interface{}{
(*ViewOrderRequest)(nil), // 0: stocklet.order.v1.ViewOrderRequest
(*ViewOrderResponse)(nil), // 1: stocklet.order.v1.ViewOrderResponse
(*ViewOrdersRequest)(nil), // 2: stocklet.order.v1.ViewOrdersRequest
(*ViewOrdersResponse)(nil), // 3: stocklet.order.v1.ViewOrdersResponse
(*GetOrderItemsRequest)(nil), // 4: stocklet.order.v1.GetOrderItemsRequest
(*GetOrderItemsResponse)(nil), // 5: stocklet.order.v1.GetOrderItemsResponse
(*PlaceOrderRequest)(nil), // 6: stocklet.order.v1.PlaceOrderRequest
(*PlaceOrderResponse)(nil), // 7: stocklet.order.v1.PlaceOrderResponse
nil, // 8: stocklet.order.v1.GetOrderItemsResponse.ItemsEntry
nil, // 9: stocklet.order.v1.PlaceOrderRequest.CartEntry
(*Order)(nil), // 10: stocklet.order.v1.Order
(*v1.ServiceInfoRequest)(nil), // 11: stocklet.common.v1.ServiceInfoRequest
(*v11.ProductPriceQuoteEvent)(nil), // 12: stocklet.events.v1.ProductPriceQuoteEvent
(*v11.StockReservationEvent)(nil), // 13: stocklet.events.v1.StockReservationEvent
(*v11.ShipmentAllocationEvent)(nil), // 14: stocklet.events.v1.ShipmentAllocationEvent
(*v11.PaymentProcessedEvent)(nil), // 15: stocklet.events.v1.PaymentProcessedEvent
(*v1.ServiceInfoResponse)(nil), // 16: stocklet.common.v1.ServiceInfoResponse
(*emptypb.Empty)(nil), // 17: google.protobuf.Empty
}
var file_stocklet_order_v1_service_proto_depIdxs = []int32{
10, // 0: stocklet.order.v1.ViewOrderResponse.order:type_name -> stocklet.order.v1.Order
10, // 1: stocklet.order.v1.ViewOrdersResponse.orders:type_name -> stocklet.order.v1.Order
8, // 2: stocklet.order.v1.GetOrderItemsResponse.items:type_name -> stocklet.order.v1.GetOrderItemsResponse.ItemsEntry
9, // 3: stocklet.order.v1.PlaceOrderRequest.cart:type_name -> stocklet.order.v1.PlaceOrderRequest.CartEntry
10, // 4: stocklet.order.v1.PlaceOrderResponse.order:type_name -> stocklet.order.v1.Order
11, // 5: stocklet.order.v1.OrderService.ServiceInfo:input_type -> stocklet.common.v1.ServiceInfoRequest
0, // 6: stocklet.order.v1.OrderService.ViewOrder:input_type -> stocklet.order.v1.ViewOrderRequest
2, // 7: stocklet.order.v1.OrderService.ViewOrders:input_type -> stocklet.order.v1.ViewOrdersRequest
6, // 8: stocklet.order.v1.OrderService.PlaceOrder:input_type -> stocklet.order.v1.PlaceOrderRequest
12, // 9: stocklet.order.v1.OrderService.ProcessProductPriceQuoteEvent:input_type -> stocklet.events.v1.ProductPriceQuoteEvent
13, // 10: stocklet.order.v1.OrderService.ProcessStockReservationEvent:input_type -> stocklet.events.v1.StockReservationEvent
14, // 11: stocklet.order.v1.OrderService.ProcessShipmentAllocationEvent:input_type -> stocklet.events.v1.ShipmentAllocationEvent
15, // 12: stocklet.order.v1.OrderService.ProcessPaymentProcessedEvent:input_type -> stocklet.events.v1.PaymentProcessedEvent
16, // 13: stocklet.order.v1.OrderService.ServiceInfo:output_type -> stocklet.common.v1.ServiceInfoResponse
1, // 14: stocklet.order.v1.OrderService.ViewOrder:output_type -> stocklet.order.v1.ViewOrderResponse
3, // 15: stocklet.order.v1.OrderService.ViewOrders:output_type -> stocklet.order.v1.ViewOrdersResponse
7, // 16: stocklet.order.v1.OrderService.PlaceOrder:output_type -> stocklet.order.v1.PlaceOrderResponse
17, // 17: stocklet.order.v1.OrderService.ProcessProductPriceQuoteEvent:output_type -> google.protobuf.Empty
17, // 18: stocklet.order.v1.OrderService.ProcessStockReservationEvent:output_type -> google.protobuf.Empty
17, // 19: stocklet.order.v1.OrderService.ProcessShipmentAllocationEvent:output_type -> google.protobuf.Empty
17, // 20: stocklet.order.v1.OrderService.ProcessPaymentProcessedEvent:output_type -> google.protobuf.Empty
13, // [13:21] is the sub-list for method output_type
5, // [5:13] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
}
func init() { file_stocklet_order_v1_service_proto_init() }
func file_stocklet_order_v1_service_proto_init() {
if File_stocklet_order_v1_service_proto != nil {
return
}
file_stocklet_order_v1_types_proto_init()
if !protoimpl.UnsafeEnabled {
file_stocklet_order_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewOrderRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_order_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewOrderResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_order_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewOrdersRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_order_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewOrdersResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_order_v1_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetOrderItemsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_order_v1_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetOrderItemsResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_order_v1_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PlaceOrderRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_order_v1_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PlaceOrderResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_order_v1_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 10,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_stocklet_order_v1_service_proto_goTypes,
DependencyIndexes: file_stocklet_order_v1_service_proto_depIdxs,
MessageInfos: file_stocklet_order_v1_service_proto_msgTypes,
}.Build()
File_stocklet_order_v1_service_proto = out.File
file_stocklet_order_v1_service_proto_rawDesc = nil
file_stocklet_order_v1_service_proto_goTypes = nil
file_stocklet_order_v1_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,449 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: stocklet/order/v1/service.proto
/*
Package order_v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package order_v1
import (
"context"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
func request_OrderService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client OrderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_OrderService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server OrderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := server.ServiceInfo(ctx, &protoReq)
return msg, metadata, err
}
func request_OrderService_ViewOrder_0(ctx context.Context, marshaler runtime.Marshaler, client OrderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewOrderRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["order_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "order_id")
}
protoReq.OrderId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "order_id", err)
}
msg, err := client.ViewOrder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_OrderService_ViewOrder_0(ctx context.Context, marshaler runtime.Marshaler, server OrderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewOrderRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["order_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "order_id")
}
protoReq.OrderId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "order_id", err)
}
msg, err := server.ViewOrder(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_OrderService_ViewOrders_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_OrderService_ViewOrders_0(ctx context.Context, marshaler runtime.Marshaler, client OrderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewOrdersRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrderService_ViewOrders_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ViewOrders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_OrderService_ViewOrders_0(ctx context.Context, marshaler runtime.Marshaler, server OrderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewOrdersRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrderService_ViewOrders_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ViewOrders(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_OrderService_PlaceOrder_0 = &utilities.DoubleArray{Encoding: map[string]int{"cart": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}}
)
func request_OrderService_PlaceOrder_0(ctx context.Context, marshaler runtime.Marshaler, client OrderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq PlaceOrderRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Cart); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrderService_PlaceOrder_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.PlaceOrder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_OrderService_PlaceOrder_0(ctx context.Context, marshaler runtime.Marshaler, server OrderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq PlaceOrderRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Cart); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrderService_PlaceOrder_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.PlaceOrder(ctx, &protoReq)
return msg, metadata, err
}
// RegisterOrderServiceHandlerServer registers the http handlers for service OrderService to "mux".
// UnaryRPC :call OrderServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterOrderServiceHandlerFromEndpoint instead.
func RegisterOrderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrderServiceServer) error {
mux.Handle("GET", pattern_OrderService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/order/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_OrderService_ServiceInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_OrderService_ViewOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrder", runtime.WithHTTPPathPattern("/v1/order/orders/{order_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_OrderService_ViewOrder_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_ViewOrder_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_OrderService_ViewOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrders", runtime.WithHTTPPathPattern("/v1/order/list"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_OrderService_ViewOrders_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_ViewOrders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_OrderService_PlaceOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/PlaceOrder", runtime.WithHTTPPathPattern("/v1/order/place"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_OrderService_PlaceOrder_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_PlaceOrder_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterOrderServiceHandlerFromEndpoint is same as RegisterOrderServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterOrderServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.DialContext(ctx, endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterOrderServiceHandler(ctx, mux, conn)
}
// RegisterOrderServiceHandler registers the http handlers for service OrderService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterOrderServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterOrderServiceHandlerClient(ctx, mux, NewOrderServiceClient(conn))
}
// RegisterOrderServiceHandlerClient registers the http handlers for service OrderService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OrderServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OrderServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "OrderServiceClient" to call the correct interceptors.
func RegisterOrderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrderServiceClient) error {
mux.Handle("GET", pattern_OrderService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/order/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_OrderService_ServiceInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_OrderService_ViewOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrder", runtime.WithHTTPPathPattern("/v1/order/orders/{order_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_OrderService_ViewOrder_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_ViewOrder_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_OrderService_ViewOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrders", runtime.WithHTTPPathPattern("/v1/order/list"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_OrderService_ViewOrders_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_ViewOrders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_OrderService_PlaceOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/PlaceOrder", runtime.WithHTTPPathPattern("/v1/order/place"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_OrderService_PlaceOrder_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_PlaceOrder_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_OrderService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "order", "service"}, ""))
pattern_OrderService_ViewOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "order", "orders", "order_id"}, ""))
pattern_OrderService_ViewOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "order", "list"}, ""))
pattern_OrderService_PlaceOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "order", "place"}, ""))
)
var (
forward_OrderService_ServiceInfo_0 = runtime.ForwardResponseMessage
forward_OrderService_ViewOrder_0 = runtime.ForwardResponseMessage
forward_OrderService_ViewOrders_0 = runtime.ForwardResponseMessage
forward_OrderService_PlaceOrder_0 = runtime.ForwardResponseMessage
)

View File

@@ -0,0 +1,436 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: stocklet/order/v1/service.proto
package order_v1
import (
context "context"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
OrderService_ServiceInfo_FullMethodName = "/stocklet.order.v1.OrderService/ServiceInfo"
OrderService_ViewOrder_FullMethodName = "/stocklet.order.v1.OrderService/ViewOrder"
OrderService_ViewOrders_FullMethodName = "/stocklet.order.v1.OrderService/ViewOrders"
OrderService_PlaceOrder_FullMethodName = "/stocklet.order.v1.OrderService/PlaceOrder"
OrderService_ProcessProductPriceQuoteEvent_FullMethodName = "/stocklet.order.v1.OrderService/ProcessProductPriceQuoteEvent"
OrderService_ProcessStockReservationEvent_FullMethodName = "/stocklet.order.v1.OrderService/ProcessStockReservationEvent"
OrderService_ProcessShipmentAllocationEvent_FullMethodName = "/stocklet.order.v1.OrderService/ProcessShipmentAllocationEvent"
OrderService_ProcessPaymentProcessedEvent_FullMethodName = "/stocklet.order.v1.OrderService/ProcessPaymentProcessedEvent"
)
// OrderServiceClient is the client API for OrderService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type OrderServiceClient interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error)
ViewOrder(ctx context.Context, in *ViewOrderRequest, opts ...grpc.CallOption) (*ViewOrderResponse, error)
// Get a list of a customer's orders.
// If accessed through the gateway - shows the current user's orders.
ViewOrders(ctx context.Context, in *ViewOrdersRequest, opts ...grpc.CallOption) (*ViewOrdersResponse, error)
PlaceOrder(ctx context.Context, in *PlaceOrderRequest, opts ...grpc.CallOption) (*PlaceOrderResponse, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessProductPriceQuoteEvent(ctx context.Context, in *v11.ProductPriceQuoteEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessStockReservationEvent(ctx context.Context, in *v11.StockReservationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessShipmentAllocationEvent(ctx context.Context, in *v11.ShipmentAllocationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessPaymentProcessedEvent(ctx context.Context, in *v11.PaymentProcessedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type orderServiceClient struct {
cc grpc.ClientConnInterface
}
func NewOrderServiceClient(cc grpc.ClientConnInterface) OrderServiceClient {
return &orderServiceClient{cc}
}
func (c *orderServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) {
out := new(v1.ServiceInfoResponse)
err := c.cc.Invoke(ctx, OrderService_ServiceInfo_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orderServiceClient) ViewOrder(ctx context.Context, in *ViewOrderRequest, opts ...grpc.CallOption) (*ViewOrderResponse, error) {
out := new(ViewOrderResponse)
err := c.cc.Invoke(ctx, OrderService_ViewOrder_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orderServiceClient) ViewOrders(ctx context.Context, in *ViewOrdersRequest, opts ...grpc.CallOption) (*ViewOrdersResponse, error) {
out := new(ViewOrdersResponse)
err := c.cc.Invoke(ctx, OrderService_ViewOrders_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orderServiceClient) PlaceOrder(ctx context.Context, in *PlaceOrderRequest, opts ...grpc.CallOption) (*PlaceOrderResponse, error) {
out := new(PlaceOrderResponse)
err := c.cc.Invoke(ctx, OrderService_PlaceOrder_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orderServiceClient) ProcessProductPriceQuoteEvent(ctx context.Context, in *v11.ProductPriceQuoteEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, OrderService_ProcessProductPriceQuoteEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orderServiceClient) ProcessStockReservationEvent(ctx context.Context, in *v11.StockReservationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, OrderService_ProcessStockReservationEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orderServiceClient) ProcessShipmentAllocationEvent(ctx context.Context, in *v11.ShipmentAllocationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, OrderService_ProcessShipmentAllocationEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orderServiceClient) ProcessPaymentProcessedEvent(ctx context.Context, in *v11.PaymentProcessedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, OrderService_ProcessPaymentProcessedEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// OrderServiceServer is the server API for OrderService service.
// All implementations must embed UnimplementedOrderServiceServer
// for forward compatibility
type OrderServiceServer interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
ViewOrder(context.Context, *ViewOrderRequest) (*ViewOrderResponse, error)
// Get a list of a customer's orders.
// If accessed through the gateway - shows the current user's orders.
ViewOrders(context.Context, *ViewOrdersRequest) (*ViewOrdersResponse, error)
PlaceOrder(context.Context, *PlaceOrderRequest) (*PlaceOrderResponse, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessProductPriceQuoteEvent(context.Context, *v11.ProductPriceQuoteEvent) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessStockReservationEvent(context.Context, *v11.StockReservationEvent) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessPaymentProcessedEvent(context.Context, *v11.PaymentProcessedEvent) (*emptypb.Empty, error)
mustEmbedUnimplementedOrderServiceServer()
}
// UnimplementedOrderServiceServer must be embedded to have forward compatible implementations.
type UnimplementedOrderServiceServer struct {
}
func (UnimplementedOrderServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented")
}
func (UnimplementedOrderServiceServer) ViewOrder(context.Context, *ViewOrderRequest) (*ViewOrderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ViewOrder not implemented")
}
func (UnimplementedOrderServiceServer) ViewOrders(context.Context, *ViewOrdersRequest) (*ViewOrdersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ViewOrders not implemented")
}
func (UnimplementedOrderServiceServer) PlaceOrder(context.Context, *PlaceOrderRequest) (*PlaceOrderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PlaceOrder not implemented")
}
func (UnimplementedOrderServiceServer) ProcessProductPriceQuoteEvent(context.Context, *v11.ProductPriceQuoteEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessProductPriceQuoteEvent not implemented")
}
func (UnimplementedOrderServiceServer) ProcessStockReservationEvent(context.Context, *v11.StockReservationEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessStockReservationEvent not implemented")
}
func (UnimplementedOrderServiceServer) ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessShipmentAllocationEvent not implemented")
}
func (UnimplementedOrderServiceServer) ProcessPaymentProcessedEvent(context.Context, *v11.PaymentProcessedEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessPaymentProcessedEvent not implemented")
}
func (UnimplementedOrderServiceServer) mustEmbedUnimplementedOrderServiceServer() {}
// UnsafeOrderServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to OrderServiceServer will
// result in compilation errors.
type UnsafeOrderServiceServer interface {
mustEmbedUnimplementedOrderServiceServer()
}
func RegisterOrderServiceServer(s grpc.ServiceRegistrar, srv OrderServiceServer) {
s.RegisterService(&OrderService_ServiceDesc, srv)
}
func _OrderService_ServiceInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.ServiceInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).ServiceInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_ServiceInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).ServiceInfo(ctx, req.(*v1.ServiceInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _OrderService_ViewOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ViewOrderRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).ViewOrder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_ViewOrder_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).ViewOrder(ctx, req.(*ViewOrderRequest))
}
return interceptor(ctx, in, info, handler)
}
func _OrderService_ViewOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ViewOrdersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).ViewOrders(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_ViewOrders_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).ViewOrders(ctx, req.(*ViewOrdersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _OrderService_PlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PlaceOrderRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).PlaceOrder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_PlaceOrder_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).PlaceOrder(ctx, req.(*PlaceOrderRequest))
}
return interceptor(ctx, in, info, handler)
}
func _OrderService_ProcessProductPriceQuoteEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.ProductPriceQuoteEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).ProcessProductPriceQuoteEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_ProcessProductPriceQuoteEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).ProcessProductPriceQuoteEvent(ctx, req.(*v11.ProductPriceQuoteEvent))
}
return interceptor(ctx, in, info, handler)
}
func _OrderService_ProcessStockReservationEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.StockReservationEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).ProcessStockReservationEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_ProcessStockReservationEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).ProcessStockReservationEvent(ctx, req.(*v11.StockReservationEvent))
}
return interceptor(ctx, in, info, handler)
}
func _OrderService_ProcessShipmentAllocationEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.ShipmentAllocationEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).ProcessShipmentAllocationEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_ProcessShipmentAllocationEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).ProcessShipmentAllocationEvent(ctx, req.(*v11.ShipmentAllocationEvent))
}
return interceptor(ctx, in, info, handler)
}
func _OrderService_ProcessPaymentProcessedEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.PaymentProcessedEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).ProcessPaymentProcessedEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_ProcessPaymentProcessedEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).ProcessPaymentProcessedEvent(ctx, req.(*v11.PaymentProcessedEvent))
}
return interceptor(ctx, in, info, handler)
}
// OrderService_ServiceDesc is the grpc.ServiceDesc for OrderService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var OrderService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "stocklet.order.v1.OrderService",
HandlerType: (*OrderServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ServiceInfo",
Handler: _OrderService_ServiceInfo_Handler,
},
{
MethodName: "ViewOrder",
Handler: _OrderService_ViewOrder_Handler,
},
{
MethodName: "ViewOrders",
Handler: _OrderService_ViewOrders_Handler,
},
{
MethodName: "PlaceOrder",
Handler: _OrderService_PlaceOrder_Handler,
},
{
MethodName: "ProcessProductPriceQuoteEvent",
Handler: _OrderService_ProcessProductPriceQuoteEvent_Handler,
},
{
MethodName: "ProcessStockReservationEvent",
Handler: _OrderService_ProcessStockReservationEvent_Handler,
},
{
MethodName: "ProcessShipmentAllocationEvent",
Handler: _OrderService_ProcessShipmentAllocationEvent_Handler,
},
{
MethodName: "ProcessPaymentProcessedEvent",
Handler: _OrderService_ProcessPaymentProcessedEvent_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "stocklet/order/v1/service.proto",
}

View File

@@ -0,0 +1,327 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/order/v1/types.proto
package order_v1
import (
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
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)
)
type OrderStatus int32
const (
OrderStatus_ORDER_STATUS_UNSPECIFIED OrderStatus = 0
OrderStatus_ORDER_STATUS_PROCESSING OrderStatus = 1 // awaiting price quotes for products
OrderStatus_ORDER_STATUS_PENDING OrderStatus = 2 // awaiting stock allocation, shipping allotment and payment
OrderStatus_ORDER_STATUS_REJECTED OrderStatus = 3
OrderStatus_ORDER_STATUS_APPROVED OrderStatus = 4
OrderStatus_ORDER_STATUS_COMPLETED OrderStatus = 5
)
// Enum value maps for OrderStatus.
var (
OrderStatus_name = map[int32]string{
0: "ORDER_STATUS_UNSPECIFIED",
1: "ORDER_STATUS_PROCESSING",
2: "ORDER_STATUS_PENDING",
3: "ORDER_STATUS_REJECTED",
4: "ORDER_STATUS_APPROVED",
5: "ORDER_STATUS_COMPLETED",
}
OrderStatus_value = map[string]int32{
"ORDER_STATUS_UNSPECIFIED": 0,
"ORDER_STATUS_PROCESSING": 1,
"ORDER_STATUS_PENDING": 2,
"ORDER_STATUS_REJECTED": 3,
"ORDER_STATUS_APPROVED": 4,
"ORDER_STATUS_COMPLETED": 5,
}
)
func (x OrderStatus) Enum() *OrderStatus {
p := new(OrderStatus)
*p = x
return p
}
func (x OrderStatus) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (OrderStatus) Descriptor() protoreflect.EnumDescriptor {
return file_stocklet_order_v1_types_proto_enumTypes[0].Descriptor()
}
func (OrderStatus) Type() protoreflect.EnumType {
return &file_stocklet_order_v1_types_proto_enumTypes[0]
}
func (x OrderStatus) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use OrderStatus.Descriptor instead.
func (OrderStatus) EnumDescriptor() ([]byte, []int) {
return file_stocklet_order_v1_types_proto_rawDescGZIP(), []int{0}
}
type Order struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Status OrderStatus `protobuf:"varint,2,opt,name=status,proto3,enum=stocklet.order.v1.OrderStatus" json:"status,omitempty"`
// 'items' consists of a mapping of Product ID to Quantity.
Items map[string]int32 `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
CustomerId string `protobuf:"bytes,4,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
TransactionId *string `protobuf:"bytes,5,opt,name=transaction_id,json=transactionId,proto3,oneof" json:"transaction_id,omitempty"`
ShippingId *string `protobuf:"bytes,6,opt,name=shipping_id,json=shippingId,proto3,oneof" json:"shipping_id,omitempty"`
CreatedAt int64 `protobuf:"varint,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
UpdatedAt *int64 `protobuf:"varint,8,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"`
}
func (x *Order) Reset() {
*x = Order{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_types_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Order) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Order) ProtoMessage() {}
func (x *Order) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_types_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Order.ProtoReflect.Descriptor instead.
func (*Order) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_types_proto_rawDescGZIP(), []int{0}
}
func (x *Order) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *Order) GetStatus() OrderStatus {
if x != nil {
return x.Status
}
return OrderStatus_ORDER_STATUS_UNSPECIFIED
}
func (x *Order) GetItems() map[string]int32 {
if x != nil {
return x.Items
}
return nil
}
func (x *Order) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
func (x *Order) GetTransactionId() string {
if x != nil && x.TransactionId != nil {
return *x.TransactionId
}
return ""
}
func (x *Order) GetShippingId() string {
if x != nil && x.ShippingId != nil {
return *x.ShippingId
}
return ""
}
func (x *Order) GetCreatedAt() int64 {
if x != nil {
return x.CreatedAt
}
return 0
}
func (x *Order) GetUpdatedAt() int64 {
if x != nil && x.UpdatedAt != nil {
return *x.UpdatedAt
}
return 0
}
var File_stocklet_order_v1_types_proto protoreflect.FileDescriptor
var file_stocklet_order_v1_types_proto_rawDesc = []byte{
0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x11, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e,
0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
0xeb, 0x03, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02,
0x69, 0x64, 0x12, 0x43, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72,
0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74,
0x75, 0x73, 0x42, 0x0b, 0xba, 0x48, 0x08, 0x82, 0x01, 0x05, 0x10, 0x01, 0x22, 0x01, 0x00, 0x52,
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x47, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73,
0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65,
0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72,
0x2e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0c, 0xba, 0x48, 0x09,
0x9a, 0x01, 0x06, 0x2a, 0x04, 0x1a, 0x02, 0x20, 0x00, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73,
0x12, 0x28, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a,
0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x0e, 0x74, 0x72,
0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01,
0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x0d, 0x74,
0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12,
0x2d, 0x0a, 0x0b, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x06,
0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x48, 0x01, 0x52,
0x0a, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1d,
0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01,
0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x22, 0x0a,
0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28,
0x03, 0x48, 0x02, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x88, 0x01,
0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f,
0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, 0x0e,
0x0a, 0x0c, 0x5f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x42, 0x0d,
0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x2a, 0xb4, 0x01,
0x0a, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a,
0x18, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e,
0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x4f,
0x52, 0x44, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x43,
0x45, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x52, 0x44, 0x45,
0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47,
0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54,
0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x19, 0x0a,
0x15, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x50,
0x50, 0x52, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x52, 0x44, 0x45,
0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54,
0x45, 0x44, 0x10, 0x05, 0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67,
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f,
0x76, 0x31, 0x3b, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_stocklet_order_v1_types_proto_rawDescOnce sync.Once
file_stocklet_order_v1_types_proto_rawDescData = file_stocklet_order_v1_types_proto_rawDesc
)
func file_stocklet_order_v1_types_proto_rawDescGZIP() []byte {
file_stocklet_order_v1_types_proto_rawDescOnce.Do(func() {
file_stocklet_order_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_order_v1_types_proto_rawDescData)
})
return file_stocklet_order_v1_types_proto_rawDescData
}
var file_stocklet_order_v1_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_stocklet_order_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_stocklet_order_v1_types_proto_goTypes = []interface{}{
(OrderStatus)(0), // 0: stocklet.order.v1.OrderStatus
(*Order)(nil), // 1: stocklet.order.v1.Order
nil, // 2: stocklet.order.v1.Order.ItemsEntry
}
var file_stocklet_order_v1_types_proto_depIdxs = []int32{
0, // 0: stocklet.order.v1.Order.status:type_name -> stocklet.order.v1.OrderStatus
2, // 1: stocklet.order.v1.Order.items:type_name -> stocklet.order.v1.Order.ItemsEntry
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_stocklet_order_v1_types_proto_init() }
func file_stocklet_order_v1_types_proto_init() {
if File_stocklet_order_v1_types_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stocklet_order_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Order); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_stocklet_order_v1_types_proto_msgTypes[0].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_order_v1_types_proto_rawDesc,
NumEnums: 1,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_order_v1_types_proto_goTypes,
DependencyIndexes: file_stocklet_order_v1_types_proto_depIdxs,
EnumInfos: file_stocklet_order_v1_types_proto_enumTypes,
MessageInfos: file_stocklet_order_v1_types_proto_msgTypes,
}.Build()
File_stocklet_order_v1_types_proto = out.File
file_stocklet_order_v1_types_proto_rawDesc = nil
file_stocklet_order_v1_types_proto_goTypes = nil
file_stocklet_order_v1_types_proto_depIdxs = nil
}