initial commit

This commit is contained in:
m.zare
2026-04-10 18:25:21 +03:30
commit 77ca6c34a3
263 changed files with 34470 additions and 0 deletions

View File

@@ -0,0 +1,253 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.11.2
// source: barcode-mapping-v1.proto
package barcodemappingpb_v1
import (
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 GetProductVariationsIDsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
VendorId int32 `protobuf:"varint,1,opt,name=vendor_id,proto3" json:"vendor_id,omitempty"`
Barcodes []string `protobuf:"bytes,2,rep,name=barcodes,proto3" json:"barcodes,omitempty"`
}
func (x *GetProductVariationsIDsRequest) Reset() {
*x = GetProductVariationsIDsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_barcode_mapping_v1_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetProductVariationsIDsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetProductVariationsIDsRequest) ProtoMessage() {}
func (x *GetProductVariationsIDsRequest) ProtoReflect() protoreflect.Message {
mi := &file_barcode_mapping_v1_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 GetProductVariationsIDsRequest.ProtoReflect.Descriptor instead.
func (*GetProductVariationsIDsRequest) Descriptor() ([]byte, []int) {
return file_barcode_mapping_v1_proto_rawDescGZIP(), []int{0}
}
func (x *GetProductVariationsIDsRequest) GetVendorId() int32 {
if x != nil {
return x.VendorId
}
return 0
}
func (x *GetProductVariationsIDsRequest) GetBarcodes() []string {
if x != nil {
return x.Barcodes
}
return nil
}
type GetProductVariationsIDsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ProductVariations map[int32]string `protobuf:"bytes,1,rep,name=product_variations,proto3" json:"product_variations,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *GetProductVariationsIDsResponse) Reset() {
*x = GetProductVariationsIDsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_barcode_mapping_v1_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetProductVariationsIDsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetProductVariationsIDsResponse) ProtoMessage() {}
func (x *GetProductVariationsIDsResponse) ProtoReflect() protoreflect.Message {
mi := &file_barcode_mapping_v1_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 GetProductVariationsIDsResponse.ProtoReflect.Descriptor instead.
func (*GetProductVariationsIDsResponse) Descriptor() ([]byte, []int) {
return file_barcode_mapping_v1_proto_rawDescGZIP(), []int{1}
}
func (x *GetProductVariationsIDsResponse) GetProductVariations() map[int32]string {
if x != nil {
return x.ProductVariations
}
return nil
}
var File_barcode_mapping_v1_proto protoreflect.FileDescriptor
var file_barcode_mapping_v1_proto_rawDesc = []byte{
0x0a, 0x18, 0x62, 0x61, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e,
0x67, 0x2d, 0x76, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x62, 0x61, 0x72, 0x63,
0x6f, 0x64, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x5f, 0x76, 0x31, 0x22,
0x5a, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x56, 0x61, 0x72,
0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x44, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x12,
0x1a, 0x0a, 0x08, 0x62, 0x61, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
0x09, 0x52, 0x08, 0x62, 0x61, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x1f,
0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x56, 0x61, 0x72, 0x69, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x49, 0x44, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x7b, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x61, 0x72, 0x69, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x62, 0x61,
0x72, 0x63, 0x6f, 0x64, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x5f, 0x76,
0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x56, 0x61, 0x72, 0x69,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x44, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x56, 0x61, 0x72, 0x69, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63,
0x74, 0x5f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x44, 0x0a, 0x16,
0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x56, 0x61, 0x72, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
0x38, 0x01, 0x32, 0x8b, 0x02, 0x0a, 0x15, 0x42, 0x61, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x4d, 0x61,
0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, 0x0a, 0x0b,
0x47, 0x65, 0x74, 0x42, 0x79, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x12, 0x33, 0x2e, 0x62, 0x61,
0x72, 0x63, 0x6f, 0x64, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x5f, 0x76,
0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x56, 0x61, 0x72, 0x69,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x44, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x34, 0x2e, 0x62, 0x61, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e,
0x67, 0x70, 0x62, 0x5f, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63,
0x74, 0x56, 0x61, 0x72, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x44, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x78, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x42, 0x79, 0x56,
0x65, 0x6e, 0x64, 0x6f, 0x72, 0x12, 0x33, 0x2e, 0x62, 0x61, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x6d,
0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x5f, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50,
0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x56, 0x61, 0x72, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x49, 0x44, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x62, 0x61, 0x72,
0x63, 0x6f, 0x64, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x5f, 0x76, 0x31,
0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x56, 0x61, 0x72, 0x69, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x44, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x42, 0x22, 0x5a, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x62,
0x2f, 0x62, 0x61, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x70,
0x62, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_barcode_mapping_v1_proto_rawDescOnce sync.Once
file_barcode_mapping_v1_proto_rawDescData = file_barcode_mapping_v1_proto_rawDesc
)
func file_barcode_mapping_v1_proto_rawDescGZIP() []byte {
file_barcode_mapping_v1_proto_rawDescOnce.Do(func() {
file_barcode_mapping_v1_proto_rawDescData = protoimpl.X.CompressGZIP(file_barcode_mapping_v1_proto_rawDescData)
})
return file_barcode_mapping_v1_proto_rawDescData
}
var file_barcode_mapping_v1_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_barcode_mapping_v1_proto_goTypes = []interface{}{
(*GetProductVariationsIDsRequest)(nil), // 0: barcodemappingpb_v1.GetProductVariationsIDsRequest
(*GetProductVariationsIDsResponse)(nil), // 1: barcodemappingpb_v1.GetProductVariationsIDsResponse
nil, // 2: barcodemappingpb_v1.GetProductVariationsIDsResponse.ProductVariationsEntry
}
var file_barcode_mapping_v1_proto_depIdxs = []int32{
2, // 0: barcodemappingpb_v1.GetProductVariationsIDsResponse.product_variations:type_name -> barcodemappingpb_v1.GetProductVariationsIDsResponse.ProductVariationsEntry
0, // 1: barcodemappingpb_v1.BarcodeMappingService.GetByMaster:input_type -> barcodemappingpb_v1.GetProductVariationsIDsRequest
0, // 2: barcodemappingpb_v1.BarcodeMappingService.GetByVendor:input_type -> barcodemappingpb_v1.GetProductVariationsIDsRequest
1, // 3: barcodemappingpb_v1.BarcodeMappingService.GetByMaster:output_type -> barcodemappingpb_v1.GetProductVariationsIDsResponse
1, // 4: barcodemappingpb_v1.BarcodeMappingService.GetByVendor:output_type -> barcodemappingpb_v1.GetProductVariationsIDsResponse
3, // [3:5] is the sub-list for method output_type
1, // [1:3] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_barcode_mapping_v1_proto_init() }
func file_barcode_mapping_v1_proto_init() {
if File_barcode_mapping_v1_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_barcode_mapping_v1_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetProductVariationsIDsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_barcode_mapping_v1_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetProductVariationsIDsResponse); 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_barcode_mapping_v1_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_barcode_mapping_v1_proto_goTypes,
DependencyIndexes: file_barcode_mapping_v1_proto_depIdxs,
MessageInfos: file_barcode_mapping_v1_proto_msgTypes,
}.Build()
File_barcode_mapping_v1_proto = out.File
file_barcode_mapping_v1_proto_rawDesc = nil
file_barcode_mapping_v1_proto_goTypes = nil
file_barcode_mapping_v1_proto_depIdxs = nil
}

View File

@@ -0,0 +1,19 @@
syntax = "proto3";
package barcodemappingpb_v1;
option go_package = "/api/grpc/pb/barcodemappingpb_v1";
service BarcodeMappingService{
rpc GetByMaster(GetProductVariationsIDsRequest) returns (GetProductVariationsIDsResponse);
rpc GetByVendor(GetProductVariationsIDsRequest) returns (GetProductVariationsIDsResponse);
}
message GetProductVariationsIDsRequest {
int32 vendor_id = 1 [json_name = "vendor_id"];
repeated string barcodes = 2;
}
message GetProductVariationsIDsResponse {
map<int32, string> product_variations = 1 [json_name = "product_variations"];
}

View File

@@ -0,0 +1,141 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.11.2
// source: barcode-mapping-v1.proto
package barcodemappingpb_v1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// 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
// BarcodeMappingServiceClient is the client API for BarcodeMappingService 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 BarcodeMappingServiceClient interface {
GetByMaster(ctx context.Context, in *GetProductVariationsIDsRequest, opts ...grpc.CallOption) (*GetProductVariationsIDsResponse, error)
GetByVendor(ctx context.Context, in *GetProductVariationsIDsRequest, opts ...grpc.CallOption) (*GetProductVariationsIDsResponse, error)
}
type barcodeMappingServiceClient struct {
cc grpc.ClientConnInterface
}
func NewBarcodeMappingServiceClient(cc grpc.ClientConnInterface) BarcodeMappingServiceClient {
return &barcodeMappingServiceClient{cc}
}
func (c *barcodeMappingServiceClient) GetByMaster(ctx context.Context, in *GetProductVariationsIDsRequest, opts ...grpc.CallOption) (*GetProductVariationsIDsResponse, error) {
out := new(GetProductVariationsIDsResponse)
err := c.cc.Invoke(ctx, "/barcodemappingpb_v1.BarcodeMappingService/GetByMaster", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *barcodeMappingServiceClient) GetByVendor(ctx context.Context, in *GetProductVariationsIDsRequest, opts ...grpc.CallOption) (*GetProductVariationsIDsResponse, error) {
out := new(GetProductVariationsIDsResponse)
err := c.cc.Invoke(ctx, "/barcodemappingpb_v1.BarcodeMappingService/GetByVendor", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// BarcodeMappingServiceServer is the server API for BarcodeMappingService service.
// All implementations must embed UnimplementedBarcodeMappingServiceServer
// for forward compatibility
type BarcodeMappingServiceServer interface {
GetByMaster(context.Context, *GetProductVariationsIDsRequest) (*GetProductVariationsIDsResponse, error)
GetByVendor(context.Context, *GetProductVariationsIDsRequest) (*GetProductVariationsIDsResponse, error)
mustEmbedUnimplementedBarcodeMappingServiceServer()
}
// UnimplementedBarcodeMappingServiceServer must be embedded to have forward compatible implementations.
type UnimplementedBarcodeMappingServiceServer struct {
}
func (UnimplementedBarcodeMappingServiceServer) GetByMaster(context.Context, *GetProductVariationsIDsRequest) (*GetProductVariationsIDsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetByMaster not implemented")
}
func (UnimplementedBarcodeMappingServiceServer) GetByVendor(context.Context, *GetProductVariationsIDsRequest) (*GetProductVariationsIDsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetByVendor not implemented")
}
func (UnimplementedBarcodeMappingServiceServer) mustEmbedUnimplementedBarcodeMappingServiceServer() {}
// UnsafeBarcodeMappingServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BarcodeMappingServiceServer will
// result in compilation errors.
type UnsafeBarcodeMappingServiceServer interface {
mustEmbedUnimplementedBarcodeMappingServiceServer()
}
func RegisterBarcodeMappingServiceServer(s grpc.ServiceRegistrar, srv BarcodeMappingServiceServer) {
s.RegisterService(&BarcodeMappingService_ServiceDesc, srv)
}
func _BarcodeMappingService_GetByMaster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetProductVariationsIDsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BarcodeMappingServiceServer).GetByMaster(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/barcodemappingpb_v1.BarcodeMappingService/GetByMaster",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BarcodeMappingServiceServer).GetByMaster(ctx, req.(*GetProductVariationsIDsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BarcodeMappingService_GetByVendor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetProductVariationsIDsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BarcodeMappingServiceServer).GetByVendor(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/barcodemappingpb_v1.BarcodeMappingService/GetByVendor",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BarcodeMappingServiceServer).GetByVendor(ctx, req.(*GetProductVariationsIDsRequest))
}
return interceptor(ctx, in, info, handler)
}
// BarcodeMappingService_ServiceDesc is the grpc.ServiceDesc for BarcodeMappingService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BarcodeMappingService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "barcodemappingpb_v1.BarcodeMappingService",
HandlerType: (*BarcodeMappingServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetByMaster",
Handler: _BarcodeMappingService_GetByMaster_Handler,
},
{
MethodName: "GetByVendor",
Handler: _BarcodeMappingService_GetByVendor_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "barcode-mapping-v1.proto",
}