// 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 . // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/events/v1/warehouse.proto package events_v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type StockReservationEvent_Type int32 const ( StockReservationEvent_TYPE_UNSPECIFIED StockReservationEvent_Type = 0 StockReservationEvent_TYPE_INSUFFICIENT_STOCK StockReservationEvent_Type = 1 StockReservationEvent_TYPE_STOCK_RESERVED StockReservationEvent_Type = 2 StockReservationEvent_TYPE_STOCK_RETURNED StockReservationEvent_Type = 3 StockReservationEvent_TYPE_STOCK_CONSUMED StockReservationEvent_Type = 4 ) // Enum value maps for StockReservationEvent_Type. var ( StockReservationEvent_Type_name = map[int32]string{ 0: "TYPE_UNSPECIFIED", 1: "TYPE_INSUFFICIENT_STOCK", 2: "TYPE_STOCK_RESERVED", 3: "TYPE_STOCK_RETURNED", 4: "TYPE_STOCK_CONSUMED", } StockReservationEvent_Type_value = map[string]int32{ "TYPE_UNSPECIFIED": 0, "TYPE_INSUFFICIENT_STOCK": 1, "TYPE_STOCK_RESERVED": 2, "TYPE_STOCK_RETURNED": 3, "TYPE_STOCK_CONSUMED": 4, } ) func (x StockReservationEvent_Type) Enum() *StockReservationEvent_Type { p := new(StockReservationEvent_Type) *p = x return p } func (x StockReservationEvent_Type) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (StockReservationEvent_Type) Descriptor() protoreflect.EnumDescriptor { return file_stocklet_events_v1_warehouse_proto_enumTypes[0].Descriptor() } func (StockReservationEvent_Type) Type() protoreflect.EnumType { return &file_stocklet_events_v1_warehouse_proto_enumTypes[0] } func (x StockReservationEvent_Type) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use StockReservationEvent_Type.Descriptor instead. func (StockReservationEvent_Type) EnumDescriptor() ([]byte, []int) { return file_stocklet_events_v1_warehouse_proto_rawDescGZIP(), []int{3, 0} } type StockCreatedEvent struct { state protoimpl.MessageState `protogen:"open.v1"` Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *StockCreatedEvent) Reset() { *x = StockCreatedEvent{} mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *StockCreatedEvent) String() string { return protoimpl.X.MessageStringOf(x) } func (*StockCreatedEvent) ProtoMessage() {} func (x *StockCreatedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use StockCreatedEvent.ProtoReflect.Descriptor instead. func (*StockCreatedEvent) Descriptor() ([]byte, []int) { return file_stocklet_events_v1_warehouse_proto_rawDescGZIP(), []int{0} } func (x *StockCreatedEvent) GetRevision() int32 { if x != nil { return x.Revision } return 0 } func (x *StockCreatedEvent) GetProductId() string { if x != nil { return x.ProductId } return "" } func (x *StockCreatedEvent) GetQuantity() int32 { if x != nil { return x.Quantity } return 0 } type StockAddedEvent struct { state protoimpl.MessageState `protogen:"open.v1"` Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` Amount int32 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` // If the stock is returned as a result of a stock reservation outcome, // then the reservation id will be included for reference. ReservationId *string `protobuf:"bytes,4,opt,name=reservation_id,json=reservationId,proto3,oneof" json:"reservation_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *StockAddedEvent) Reset() { *x = StockAddedEvent{} mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *StockAddedEvent) String() string { return protoimpl.X.MessageStringOf(x) } func (*StockAddedEvent) ProtoMessage() {} func (x *StockAddedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use StockAddedEvent.ProtoReflect.Descriptor instead. func (*StockAddedEvent) Descriptor() ([]byte, []int) { return file_stocklet_events_v1_warehouse_proto_rawDescGZIP(), []int{1} } func (x *StockAddedEvent) GetRevision() int32 { if x != nil { return x.Revision } return 0 } func (x *StockAddedEvent) GetProductId() string { if x != nil { return x.ProductId } return "" } func (x *StockAddedEvent) GetAmount() int32 { if x != nil { return x.Amount } return 0 } func (x *StockAddedEvent) GetReservationId() string { if x != nil && x.ReservationId != nil { return *x.ReservationId } return "" } type StockRemovedEvent struct { state protoimpl.MessageState `protogen:"open.v1"` Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` Amount int32 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` // If the stock is removed as a result of a stock reservation being closed, // then the reservation id will be included for reference. ReservationId *string `protobuf:"bytes,4,opt,name=reservation_id,json=reservationId,proto3,oneof" json:"reservation_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *StockRemovedEvent) Reset() { *x = StockRemovedEvent{} mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *StockRemovedEvent) String() string { return protoimpl.X.MessageStringOf(x) } func (*StockRemovedEvent) ProtoMessage() {} func (x *StockRemovedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use StockRemovedEvent.ProtoReflect.Descriptor instead. func (*StockRemovedEvent) Descriptor() ([]byte, []int) { return file_stocklet_events_v1_warehouse_proto_rawDescGZIP(), []int{2} } func (x *StockRemovedEvent) GetRevision() int32 { if x != nil { return x.Revision } return 0 } func (x *StockRemovedEvent) GetProductId() string { if x != nil { return x.ProductId } return "" } func (x *StockRemovedEvent) GetAmount() int32 { if x != nil { return x.Amount } return 0 } func (x *StockRemovedEvent) GetReservationId() string { if x != nil && x.ReservationId != nil { return *x.ReservationId } return "" } type StockReservationEvent struct { state protoimpl.MessageState `protogen:"open.v1"` Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` Type StockReservationEvent_Type `protobuf:"varint,2,opt,name=type,proto3,enum=stocklet.events.v1.StockReservationEvent_Type" json:"type,omitempty"` OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` OrderMetadata *StockReservationEvent_OrderMetadata `protobuf:"bytes,4,opt,name=order_metadata,json=orderMetadata,proto3" json:"order_metadata,omitempty"` ReservationId string `protobuf:"bytes,5,opt,name=reservation_id,json=reservationId,proto3" json:"reservation_id,omitempty"` // provided with type enum value 2+ ReservationStock map[string]int32 `protobuf:"bytes,6,rep,name=reservation_stock,json=reservationStock,proto3" json:"reservation_stock,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` // Product ID: Quantity (provided with type enum value 2+) InsufficientStock []string `protobuf:"bytes,7,rep,name=insufficient_stock,json=insufficientStock,proto3" json:"insufficient_stock,omitempty"` // Product IDs (only provided with TYPE_INSUFFICIENT_STOCK) unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *StockReservationEvent) Reset() { *x = StockReservationEvent{} mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *StockReservationEvent) String() string { return protoimpl.X.MessageStringOf(x) } func (*StockReservationEvent) ProtoMessage() {} func (x *StockReservationEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use StockReservationEvent.ProtoReflect.Descriptor instead. func (*StockReservationEvent) Descriptor() ([]byte, []int) { return file_stocklet_events_v1_warehouse_proto_rawDescGZIP(), []int{3} } func (x *StockReservationEvent) GetRevision() int32 { if x != nil { return x.Revision } return 0 } func (x *StockReservationEvent) GetType() StockReservationEvent_Type { if x != nil { return x.Type } return StockReservationEvent_TYPE_UNSPECIFIED } func (x *StockReservationEvent) GetOrderId() string { if x != nil { return x.OrderId } return "" } func (x *StockReservationEvent) GetOrderMetadata() *StockReservationEvent_OrderMetadata { if x != nil { return x.OrderMetadata } return nil } func (x *StockReservationEvent) GetReservationId() string { if x != nil { return x.ReservationId } return "" } func (x *StockReservationEvent) GetReservationStock() map[string]int32 { if x != nil { return x.ReservationStock } return nil } func (x *StockReservationEvent) GetInsufficientStock() []string { if x != nil { return x.InsufficientStock } return nil } type StockReservationEvent_OrderMetadata struct { state protoimpl.MessageState `protogen:"open.v1"` CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` ItemsPrice float32 `protobuf:"fixed32,2,opt,name=items_price,json=itemsPrice,proto3" json:"items_price,omitempty"` TotalPrice float32 `protobuf:"fixed32,3,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *StockReservationEvent_OrderMetadata) Reset() { *x = StockReservationEvent_OrderMetadata{} mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *StockReservationEvent_OrderMetadata) String() string { return protoimpl.X.MessageStringOf(x) } func (*StockReservationEvent_OrderMetadata) ProtoMessage() {} func (x *StockReservationEvent_OrderMetadata) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use StockReservationEvent_OrderMetadata.ProtoReflect.Descriptor instead. func (*StockReservationEvent_OrderMetadata) Descriptor() ([]byte, []int) { return file_stocklet_events_v1_warehouse_proto_rawDescGZIP(), []int{3, 0} } func (x *StockReservationEvent_OrderMetadata) GetCustomerId() string { if x != nil { return x.CustomerId } return "" } func (x *StockReservationEvent_OrderMetadata) GetItemsPrice() float32 { if x != nil { return x.ItemsPrice } return 0 } func (x *StockReservationEvent_OrderMetadata) GetTotalPrice() float32 { if x != nil { return x.TotalPrice } return 0 } var File_stocklet_events_v1_warehouse_proto protoreflect.FileDescriptor const file_stocklet_events_v1_warehouse_proto_rawDesc = "" + "\n" + "\"stocklet/events/v1/warehouse.proto\x12\x12stocklet.events.v1\"j\n" + "\x11StockCreatedEvent\x12\x1a\n" + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x1d\n" + "\n" + "product_id\x18\x02 \x01(\tR\tproductId\x12\x1a\n" + "\bquantity\x18\x03 \x01(\x05R\bquantity\"\xa3\x01\n" + "\x0fStockAddedEvent\x12\x1a\n" + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x1d\n" + "\n" + "product_id\x18\x02 \x01(\tR\tproductId\x12\x16\n" + "\x06amount\x18\x03 \x01(\x05R\x06amount\x12*\n" + "\x0ereservation_id\x18\x04 \x01(\tH\x00R\rreservationId\x88\x01\x01B\x11\n" + "\x0f_reservation_id\"\xa5\x01\n" + "\x11StockRemovedEvent\x12\x1a\n" + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x1d\n" + "\n" + "product_id\x18\x02 \x01(\tR\tproductId\x12\x16\n" + "\x06amount\x18\x03 \x01(\x05R\x06amount\x12*\n" + "\x0ereservation_id\x18\x04 \x01(\tH\x00R\rreservationId\x88\x01\x01B\x11\n" + "\x0f_reservation_id\"\xf6\x05\n" + "\x15StockReservationEvent\x12\x1a\n" + "\brevision\x18\x01 \x01(\x05R\brevision\x12B\n" + "\x04type\x18\x02 \x01(\x0e2..stocklet.events.v1.StockReservationEvent.TypeR\x04type\x12\x19\n" + "\border_id\x18\x03 \x01(\tR\aorderId\x12^\n" + "\x0eorder_metadata\x18\x04 \x01(\v27.stocklet.events.v1.StockReservationEvent.OrderMetadataR\rorderMetadata\x12%\n" + "\x0ereservation_id\x18\x05 \x01(\tR\rreservationId\x12l\n" + "\x11reservation_stock\x18\x06 \x03(\v2?.stocklet.events.v1.StockReservationEvent.ReservationStockEntryR\x10reservationStock\x12-\n" + "\x12insufficient_stock\x18\a \x03(\tR\x11insufficientStock\x1ar\n" + "\rOrderMetadata\x12\x1f\n" + "\vcustomer_id\x18\x01 \x01(\tR\n" + "customerId\x12\x1f\n" + "\vitems_price\x18\x02 \x01(\x02R\n" + "itemsPrice\x12\x1f\n" + "\vtotal_price\x18\x03 \x01(\x02R\n" + "totalPrice\x1aC\n" + "\x15ReservationStockEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\"\x84\x01\n" + "\x04Type\x12\x14\n" + "\x10TYPE_UNSPECIFIED\x10\x00\x12\x1b\n" + "\x17TYPE_INSUFFICIENT_STOCK\x10\x01\x12\x17\n" + "\x13TYPE_STOCK_RESERVED\x10\x02\x12\x17\n" + "\x13TYPE_STOCK_RETURNED\x10\x03\x12\x17\n" + "\x13TYPE_STOCK_CONSUMED\x10\x04BGZEgithub.com/hexolan/stocklet/internal/pkg/protogen/events/v1;events_v1b\x06proto3" var ( file_stocklet_events_v1_warehouse_proto_rawDescOnce sync.Once file_stocklet_events_v1_warehouse_proto_rawDescData []byte ) func file_stocklet_events_v1_warehouse_proto_rawDescGZIP() []byte { file_stocklet_events_v1_warehouse_proto_rawDescOnce.Do(func() { file_stocklet_events_v1_warehouse_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_warehouse_proto_rawDesc), len(file_stocklet_events_v1_warehouse_proto_rawDesc))) }) return file_stocklet_events_v1_warehouse_proto_rawDescData } var file_stocklet_events_v1_warehouse_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_stocklet_events_v1_warehouse_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_stocklet_events_v1_warehouse_proto_goTypes = []any{ (StockReservationEvent_Type)(0), // 0: stocklet.events.v1.StockReservationEvent.Type (*StockCreatedEvent)(nil), // 1: stocklet.events.v1.StockCreatedEvent (*StockAddedEvent)(nil), // 2: stocklet.events.v1.StockAddedEvent (*StockRemovedEvent)(nil), // 3: stocklet.events.v1.StockRemovedEvent (*StockReservationEvent)(nil), // 4: stocklet.events.v1.StockReservationEvent (*StockReservationEvent_OrderMetadata)(nil), // 5: stocklet.events.v1.StockReservationEvent.OrderMetadata nil, // 6: stocklet.events.v1.StockReservationEvent.ReservationStockEntry } var file_stocklet_events_v1_warehouse_proto_depIdxs = []int32{ 0, // 0: stocklet.events.v1.StockReservationEvent.type:type_name -> stocklet.events.v1.StockReservationEvent.Type 5, // 1: stocklet.events.v1.StockReservationEvent.order_metadata:type_name -> stocklet.events.v1.StockReservationEvent.OrderMetadata 6, // 2: stocklet.events.v1.StockReservationEvent.reservation_stock:type_name -> stocklet.events.v1.StockReservationEvent.ReservationStockEntry 3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name 3, // [3:3] is the sub-list for extension extendee 0, // [0:3] is the sub-list for field type_name } func init() { file_stocklet_events_v1_warehouse_proto_init() } func file_stocklet_events_v1_warehouse_proto_init() { if File_stocklet_events_v1_warehouse_proto != nil { return } file_stocklet_events_v1_warehouse_proto_msgTypes[1].OneofWrappers = []any{} file_stocklet_events_v1_warehouse_proto_msgTypes[2].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_warehouse_proto_rawDesc), len(file_stocklet_events_v1_warehouse_proto_rawDesc)), NumEnums: 1, NumMessages: 6, NumExtensions: 0, NumServices: 0, }, GoTypes: file_stocklet_events_v1_warehouse_proto_goTypes, DependencyIndexes: file_stocklet_events_v1_warehouse_proto_depIdxs, EnumInfos: file_stocklet_events_v1_warehouse_proto_enumTypes, MessageInfos: file_stocklet_events_v1_warehouse_proto_msgTypes, }.Build() File_stocklet_events_v1_warehouse_proto = out.File file_stocklet_events_v1_warehouse_proto_goTypes = nil file_stocklet_events_v1_warehouse_proto_depIdxs = nil }