feat(broker/tariff): add amount & type

This commit is contained in:
kroyzen 2023-08-02 17:22:50 +03:00
parent 394b4222e4
commit 5d53e04858
22 changed files with 281 additions and 124 deletions

@ -16,7 +16,6 @@ linters:
- bidichk
- bodyclose
- containedctx
- depguard
- dogsled
- dupword
- durationcheck

@ -1,6 +1,6 @@
// Package swagger provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
// Code generated by github.com/deepmap/oapi-codegen version v1.13.0 DO NOT EDIT.
package swagger
import (
@ -79,7 +79,7 @@ type ServerInterfaceWrapper struct {
func (w *ServerInterfaceWrapper) DeleteAccount(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
ctx.Set(BearerScopes, []string{})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.DeleteAccount(ctx)
@ -90,7 +90,7 @@ func (w *ServerInterfaceWrapper) DeleteAccount(ctx echo.Context) error {
func (w *ServerInterfaceWrapper) GetAccount(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
ctx.Set(BearerScopes, []string{})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetAccount(ctx)
@ -101,7 +101,7 @@ func (w *ServerInterfaceWrapper) GetAccount(ctx echo.Context) error {
func (w *ServerInterfaceWrapper) ChangeAccount(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
ctx.Set(BearerScopes, []string{})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.ChangeAccount(ctx)
@ -112,7 +112,7 @@ func (w *ServerInterfaceWrapper) ChangeAccount(ctx echo.Context) error {
func (w *ServerInterfaceWrapper) AddAccount(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
ctx.Set(BearerScopes, []string{})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.AddAccount(ctx)
@ -130,7 +130,7 @@ func (w *ServerInterfaceWrapper) DeleteDirectAccount(ctx echo.Context) error {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter userId: %s", err))
}
ctx.Set(BearerScopes, []string{""})
ctx.Set(BearerScopes, []string{})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.DeleteDirectAccount(ctx, userId)
@ -148,7 +148,7 @@ func (w *ServerInterfaceWrapper) GetDirectAccount(ctx echo.Context) error {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter userId: %s", err))
}
ctx.Set(BearerScopes, []string{""})
ctx.Set(BearerScopes, []string{})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetDirectAccount(ctx, userId)
@ -166,7 +166,7 @@ func (w *ServerInterfaceWrapper) SetAccountVerificationStatus(ctx echo.Context)
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter userId: %s", err))
}
ctx.Set(BearerScopes, []string{""})
ctx.Set(BearerScopes, []string{})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.SetAccountVerificationStatus(ctx, userId)
@ -202,7 +202,7 @@ func (w *ServerInterfaceWrapper) PaginationAccounts(ctx echo.Context) error {
func (w *ServerInterfaceWrapper) RemoveFromCart(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
ctx.Set(BearerScopes, []string{})
// Parameter object where we will unmarshal all parameters from the context
var params RemoveFromCartParams
@ -222,7 +222,7 @@ func (w *ServerInterfaceWrapper) RemoveFromCart(ctx echo.Context) error {
func (w *ServerInterfaceWrapper) Add2cart(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
ctx.Set(BearerScopes, []string{})
// Parameter object where we will unmarshal all parameters from the context
var params Add2cartParams
@ -242,7 +242,7 @@ func (w *ServerInterfaceWrapper) Add2cart(ctx echo.Context) error {
func (w *ServerInterfaceWrapper) PayCart(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
ctx.Set(BearerScopes, []string{})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.PayCart(ctx)
@ -262,7 +262,7 @@ func (w *ServerInterfaceWrapper) GetCurrencies(ctx echo.Context) error {
func (w *ServerInterfaceWrapper) UpdateCurrencies(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
ctx.Set(BearerScopes, []string{})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.UpdateCurrencies(ctx)
@ -273,7 +273,7 @@ func (w *ServerInterfaceWrapper) UpdateCurrencies(ctx echo.Context) error {
func (w *ServerInterfaceWrapper) GetHistory(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
ctx.Set(BearerScopes, []string{})
// Parameter object where we will unmarshal all parameters from the context
var params GetHistoryParams
@ -300,7 +300,7 @@ func (w *ServerInterfaceWrapper) GetHistory(ctx echo.Context) error {
func (w *ServerInterfaceWrapper) ChangeCurrency(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
ctx.Set(BearerScopes, []string{})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.ChangeCurrency(ctx)
@ -311,7 +311,7 @@ func (w *ServerInterfaceWrapper) ChangeCurrency(ctx echo.Context) error {
func (w *ServerInterfaceWrapper) RequestMoney(ctx echo.Context) error {
var err error
ctx.Set(BearerScopes, []string{""})
ctx.Set(BearerScopes, []string{})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.RequestMoney(ctx)

@ -1,6 +1,6 @@
// Package swagger provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
// Code generated by github.com/deepmap/oapi-codegen version v1.13.0 DO NOT EDIT.
package swagger
import (

@ -1,11 +1,15 @@
package models
import "time"
import (
"time"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/broker"
)
type Tariff struct {
ID string `json:"_id"`
Name string `json:"name"`
Price int64 `json:"price"`
Price int64 `json:"price,omitempty"`
IsCustom bool `json:"isCustom"`
Privileges []Privilege `json:"privileges"`
Deleted bool `json:"isDeleted"`
@ -15,12 +19,35 @@ type Tariff struct {
}
type Privilege struct {
ID string `json:"_id"`
Name string `json:"name"`
PrivilegeID string `json:"privilegeId"`
ServiceKey string `json:"serviceKey"`
Description string `json:"description"`
Type string `json:"type"`
Value string `json:"value"`
Price int64 `json:"price"`
ID string `json:"_id"`
Name string `json:"name"`
PrivilegeID string `json:"privilegeId"`
ServiceKey string `json:"serviceKey"`
Description string `json:"description"`
Amount uint64 `json:"amount"`
Type PrivilegeType `json:"type"`
Value string `json:"value"`
Price uint64 `json:"price"`
}
type PrivilegeType string
const (
PrivilegeTypeCount = "count"
PrivilegeTypeDay = "day"
PrivilegeTypeFull = "full"
)
var (
PrivilegeTypeMap = map[broker.PrivilegeType]PrivilegeType{
broker.PrivilegeType_Full: PrivilegeTypeFull,
broker.PrivilegeType_Day: PrivilegeTypeDay,
broker.PrivilegeType_Count: PrivilegeTypeCount,
}
PrivilegeBrokerTypeMap = map[PrivilegeType]broker.PrivilegeType{
PrivilegeTypeFull: broker.PrivilegeType_Full,
PrivilegeTypeDay: broker.PrivilegeType_Day,
PrivilegeTypeCount: broker.PrivilegeType_Count,
}
)

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: broker/models.proto
@ -20,15 +20,65 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type PrivilegeType int32
const (
PrivilegeType_Full PrivilegeType = 0
PrivilegeType_Day PrivilegeType = 1
PrivilegeType_Count PrivilegeType = 2
)
// Enum value maps for PrivilegeType.
var (
PrivilegeType_name = map[int32]string{
0: "Full",
1: "Day",
2: "Count",
}
PrivilegeType_value = map[string]int32{
"Full": 0,
"Day": 1,
"Count": 2,
}
)
func (x PrivilegeType) Enum() *PrivilegeType {
p := new(PrivilegeType)
*p = x
return p
}
func (x PrivilegeType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PrivilegeType) Descriptor() protoreflect.EnumDescriptor {
return file_broker_models_proto_enumTypes[0].Descriptor()
}
func (PrivilegeType) Type() protoreflect.EnumType {
return &file_broker_models_proto_enumTypes[0]
}
func (x PrivilegeType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use PrivilegeType.Descriptor instead.
func (PrivilegeType) EnumDescriptor() ([]byte, []int) {
return file_broker_models_proto_rawDescGZIP(), []int{0}
}
type PrivilegeMessage struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
PrivilegeID string `protobuf:"bytes,1,opt,name=PrivilegeID,proto3" json:"PrivilegeID,omitempty"`
ServiceKey string `protobuf:"bytes,2,opt,name=ServiceKey,proto3" json:"ServiceKey,omitempty"`
Type string `protobuf:"bytes,3,opt,name=Type,proto3" json:"Type,omitempty"`
Value string `protobuf:"bytes,4,opt,name=Value,proto3" json:"Value,omitempty"`
PrivilegeID string `protobuf:"bytes,1,opt,name=PrivilegeID,proto3" json:"PrivilegeID,omitempty"`
ServiceKey string `protobuf:"bytes,2,opt,name=ServiceKey,proto3" json:"ServiceKey,omitempty"`
Type PrivilegeType `protobuf:"varint,3,opt,name=Type,proto3,enum=broker.PrivilegeType" json:"Type,omitempty"`
Value string `protobuf:"bytes,4,opt,name=Value,proto3" json:"Value,omitempty"`
Amount uint64 `protobuf:"varint,5,opt,name=Amount,proto3" json:"Amount,omitempty"`
}
func (x *PrivilegeMessage) Reset() {
@ -77,11 +127,11 @@ func (x *PrivilegeMessage) GetServiceKey() string {
return ""
}
func (x *PrivilegeMessage) GetType() string {
func (x *PrivilegeMessage) GetType() PrivilegeType {
if x != nil {
return x.Type
}
return ""
return PrivilegeType_Full
}
func (x *PrivilegeMessage) GetValue() string {
@ -91,6 +141,13 @@ func (x *PrivilegeMessage) GetValue() string {
return ""
}
func (x *PrivilegeMessage) GetAmount() uint64 {
if x != nil {
return x.Amount
}
return 0
}
type TariffMessage struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -150,23 +207,29 @@ var File_broker_models_proto protoreflect.FileDescriptor
var file_broker_models_proto_rawDesc = []byte{
0x0a, 0x13, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x22, 0x7e, 0x0a,
0x10, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x49, 0x44,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67,
0x65, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65,
0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x61, 0x0a,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x22, 0xad, 0x01,
0x0a, 0x10, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x49,
0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65,
0x67, 0x65, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4b,
0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x4b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x15, 0x2e, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x69, 0x76,
0x69, 0x6c, 0x65, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12,
0x14, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18,
0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x61, 0x0a,
0x0d, 0x54, 0x61, 0x72, 0x69, 0x66, 0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x38,
0x0a, 0x0a, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x69, 0x76,
0x69, 0x6c, 0x65, 0x67, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0a, 0x50, 0x72,
0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72,
0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44,
0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x2a, 0x2d, 0x0a, 0x0d, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x54, 0x79, 0x70,
0x65, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x75, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44,
0x61, 0x79, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0x02, 0x42,
0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
@ -181,18 +244,21 @@ func file_broker_models_proto_rawDescGZIP() []byte {
return file_broker_models_proto_rawDescData
}
var file_broker_models_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_broker_models_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_broker_models_proto_goTypes = []interface{}{
(*PrivilegeMessage)(nil), // 0: broker.PrivilegeMessage
(*TariffMessage)(nil), // 1: broker.TariffMessage
(PrivilegeType)(0), // 0: broker.PrivilegeType
(*PrivilegeMessage)(nil), // 1: broker.PrivilegeMessage
(*TariffMessage)(nil), // 2: broker.TariffMessage
}
var file_broker_models_proto_depIdxs = []int32{
0, // 0: broker.TariffMessage.Privileges:type_name -> broker.PrivilegeMessage
1, // [1:1] is the sub-list for method output_type
1, // [1:1] 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
0, // 0: broker.PrivilegeMessage.Type:type_name -> broker.PrivilegeType
1, // 1: broker.TariffMessage.Privileges:type_name -> broker.PrivilegeMessage
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_broker_models_proto_init() }
@ -231,13 +297,14 @@ func file_broker_models_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_broker_models_proto_rawDesc,
NumEnums: 0,
NumEnums: 1,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_broker_models_proto_goTypes,
DependencyIndexes: file_broker_models_proto_depIdxs,
EnumInfos: file_broker_models_proto_enumTypes,
MessageInfos: file_broker_models_proto_msgTypes,
}.Build()
File_broker_models_proto = out.File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: customer/service.proto

@ -1,4 +1,8 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: customer/service.proto
package customer
@ -15,6 +19,10 @@ import (
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
CustomerService_InsertHistory_FullMethodName = "/customer.CustomerService/InsertHistory"
)
// CustomerServiceClient is the client API for CustomerService 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.
@ -32,7 +40,7 @@ func NewCustomerServiceClient(cc grpc.ClientConnInterface) CustomerServiceClient
func (c *customerServiceClient) InsertHistory(ctx context.Context, in *History, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/customer.CustomerService/InsertHistory", in, out, opts...)
err := c.cc.Invoke(ctx, CustomerService_InsertHistory_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -75,7 +83,7 @@ func _CustomerService_InsertHistory_Handler(srv interface{}, ctx context.Context
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/customer.CustomerService/InsertHistory",
FullMethod: CustomerService_InsertHistory_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CustomerServiceServer).InsertHistory(ctx, req.(*History))

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: discount/audit.model.proto

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: discount/discount.model.proto

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: discount/service.proto

@ -1,4 +1,8 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: discount/service.proto
package discount
@ -15,6 +19,18 @@ import (
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
DiscountService_GetAllDiscounts_FullMethodName = "/discount.DiscountService/GetAllDiscounts"
DiscountService_GetUserDiscounts_FullMethodName = "/discount.DiscountService/GetUserDiscounts"
DiscountService_DetermineDiscounts_FullMethodName = "/discount.DiscountService/DetermineDiscounts"
DiscountService_ApplyDiscounts_FullMethodName = "/discount.DiscountService/ApplyDiscounts"
DiscountService_GetDiscountByID_FullMethodName = "/discount.DiscountService/GetDiscountByID"
DiscountService_CreateDiscount_FullMethodName = "/discount.DiscountService/CreateDiscount"
DiscountService_ReplaceDiscount_FullMethodName = "/discount.DiscountService/ReplaceDiscount"
DiscountService_UpdateDiscount_FullMethodName = "/discount.DiscountService/UpdateDiscount"
DiscountService_DeleteDiscount_FullMethodName = "/discount.DiscountService/DeleteDiscount"
)
// DiscountServiceClient is the client API for DiscountService 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.
@ -40,7 +56,7 @@ func NewDiscountServiceClient(cc grpc.ClientConnInterface) DiscountServiceClient
func (c *discountServiceClient) GetAllDiscounts(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Discounts, error) {
out := new(Discounts)
err := c.cc.Invoke(ctx, "/discount.DiscountService/GetAllDiscounts", in, out, opts...)
err := c.cc.Invoke(ctx, DiscountService_GetAllDiscounts_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -49,7 +65,7 @@ func (c *discountServiceClient) GetAllDiscounts(ctx context.Context, in *emptypb
func (c *discountServiceClient) GetUserDiscounts(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discounts, error) {
out := new(Discounts)
err := c.cc.Invoke(ctx, "/discount.DiscountService/GetUserDiscounts", in, out, opts...)
err := c.cc.Invoke(ctx, DiscountService_GetUserDiscounts_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -58,7 +74,7 @@ func (c *discountServiceClient) GetUserDiscounts(ctx context.Context, in *GetDis
func (c *discountServiceClient) DetermineDiscounts(ctx context.Context, in *ApplyDiscountRequest, opts ...grpc.CallOption) (*Discounts, error) {
out := new(Discounts)
err := c.cc.Invoke(ctx, "/discount.DiscountService/DetermineDiscounts", in, out, opts...)
err := c.cc.Invoke(ctx, DiscountService_DetermineDiscounts_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -67,7 +83,7 @@ func (c *discountServiceClient) DetermineDiscounts(ctx context.Context, in *Appl
func (c *discountServiceClient) ApplyDiscounts(ctx context.Context, in *ApplyDiscountRequest, opts ...grpc.CallOption) (*ApplyDiscountResponse, error) {
out := new(ApplyDiscountResponse)
err := c.cc.Invoke(ctx, "/discount.DiscountService/ApplyDiscounts", in, out, opts...)
err := c.cc.Invoke(ctx, DiscountService_ApplyDiscounts_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -76,7 +92,7 @@ func (c *discountServiceClient) ApplyDiscounts(ctx context.Context, in *ApplyDis
func (c *discountServiceClient) GetDiscountByID(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discount, error) {
out := new(Discount)
err := c.cc.Invoke(ctx, "/discount.DiscountService/GetDiscountByID", in, out, opts...)
err := c.cc.Invoke(ctx, DiscountService_GetDiscountByID_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -85,7 +101,7 @@ func (c *discountServiceClient) GetDiscountByID(ctx context.Context, in *GetDisc
func (c *discountServiceClient) CreateDiscount(ctx context.Context, in *CreateDiscountRequest, opts ...grpc.CallOption) (*Discount, error) {
out := new(Discount)
err := c.cc.Invoke(ctx, "/discount.DiscountService/CreateDiscount", in, out, opts...)
err := c.cc.Invoke(ctx, DiscountService_CreateDiscount_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -94,7 +110,7 @@ func (c *discountServiceClient) CreateDiscount(ctx context.Context, in *CreateDi
func (c *discountServiceClient) ReplaceDiscount(ctx context.Context, in *DiscountOptional, opts ...grpc.CallOption) (*Discount, error) {
out := new(Discount)
err := c.cc.Invoke(ctx, "/discount.DiscountService/ReplaceDiscount", in, out, opts...)
err := c.cc.Invoke(ctx, DiscountService_ReplaceDiscount_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -103,7 +119,7 @@ func (c *discountServiceClient) ReplaceDiscount(ctx context.Context, in *Discoun
func (c *discountServiceClient) UpdateDiscount(ctx context.Context, in *DiscountOptional, opts ...grpc.CallOption) (*Discount, error) {
out := new(Discount)
err := c.cc.Invoke(ctx, "/discount.DiscountService/UpdateDiscount", in, out, opts...)
err := c.cc.Invoke(ctx, DiscountService_UpdateDiscount_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -112,7 +128,7 @@ func (c *discountServiceClient) UpdateDiscount(ctx context.Context, in *Discount
func (c *discountServiceClient) DeleteDiscount(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discount, error) {
out := new(Discount)
err := c.cc.Invoke(ctx, "/discount.DiscountService/DeleteDiscount", in, out, opts...)
err := c.cc.Invoke(ctx, DiscountService_DeleteDiscount_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -187,7 +203,7 @@ func _DiscountService_GetAllDiscounts_Handler(srv interface{}, ctx context.Conte
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/discount.DiscountService/GetAllDiscounts",
FullMethod: DiscountService_GetAllDiscounts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DiscountServiceServer).GetAllDiscounts(ctx, req.(*emptypb.Empty))
@ -205,7 +221,7 @@ func _DiscountService_GetUserDiscounts_Handler(srv interface{}, ctx context.Cont
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/discount.DiscountService/GetUserDiscounts",
FullMethod: DiscountService_GetUserDiscounts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DiscountServiceServer).GetUserDiscounts(ctx, req.(*GetDiscountByIDRequest))
@ -223,7 +239,7 @@ func _DiscountService_DetermineDiscounts_Handler(srv interface{}, ctx context.Co
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/discount.DiscountService/DetermineDiscounts",
FullMethod: DiscountService_DetermineDiscounts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DiscountServiceServer).DetermineDiscounts(ctx, req.(*ApplyDiscountRequest))
@ -241,7 +257,7 @@ func _DiscountService_ApplyDiscounts_Handler(srv interface{}, ctx context.Contex
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/discount.DiscountService/ApplyDiscounts",
FullMethod: DiscountService_ApplyDiscounts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DiscountServiceServer).ApplyDiscounts(ctx, req.(*ApplyDiscountRequest))
@ -259,7 +275,7 @@ func _DiscountService_GetDiscountByID_Handler(srv interface{}, ctx context.Conte
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/discount.DiscountService/GetDiscountByID",
FullMethod: DiscountService_GetDiscountByID_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DiscountServiceServer).GetDiscountByID(ctx, req.(*GetDiscountByIDRequest))
@ -277,7 +293,7 @@ func _DiscountService_CreateDiscount_Handler(srv interface{}, ctx context.Contex
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/discount.DiscountService/CreateDiscount",
FullMethod: DiscountService_CreateDiscount_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DiscountServiceServer).CreateDiscount(ctx, req.(*CreateDiscountRequest))
@ -295,7 +311,7 @@ func _DiscountService_ReplaceDiscount_Handler(srv interface{}, ctx context.Conte
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/discount.DiscountService/ReplaceDiscount",
FullMethod: DiscountService_ReplaceDiscount_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DiscountServiceServer).ReplaceDiscount(ctx, req.(*DiscountOptional))
@ -313,7 +329,7 @@ func _DiscountService_UpdateDiscount_Handler(srv interface{}, ctx context.Contex
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/discount.DiscountService/UpdateDiscount",
FullMethod: DiscountService_UpdateDiscount_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DiscountServiceServer).UpdateDiscount(ctx, req.(*DiscountOptional))
@ -331,7 +347,7 @@ func _DiscountService_DeleteDiscount_Handler(srv interface{}, ctx context.Contex
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/discount.DiscountService/DeleteDiscount",
FullMethod: DiscountService_DeleteDiscount_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DiscountServiceServer).DeleteDiscount(ctx, req.(*GetDiscountByIDRequest))

@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: google/api/annotations.proto

@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: google/api/http.proto

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: callback/service.proto

@ -1,4 +1,8 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: callback/service.proto
package payment_callback
@ -15,6 +19,11 @@ import (
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
PaymentCallbackService_OnSuccess_FullMethodName = "/payment_callback.PaymentCallbackService/OnSuccess"
PaymentCallbackService_OnFailure_FullMethodName = "/payment_callback.PaymentCallbackService/OnFailure"
)
// PaymentCallbackServiceClient is the client API for PaymentCallbackService 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.
@ -33,7 +42,7 @@ func NewPaymentCallbackServiceClient(cc grpc.ClientConnInterface) PaymentCallbac
func (c *paymentCallbackServiceClient) OnSuccess(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/payment_callback.PaymentCallbackService/OnSuccess", in, out, opts...)
err := c.cc.Invoke(ctx, PaymentCallbackService_OnSuccess_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -42,7 +51,7 @@ func (c *paymentCallbackServiceClient) OnSuccess(ctx context.Context, in *Event,
func (c *paymentCallbackServiceClient) OnFailure(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/payment_callback.PaymentCallbackService/OnFailure", in, out, opts...)
err := c.cc.Invoke(ctx, PaymentCallbackService_OnFailure_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -89,7 +98,7 @@ func _PaymentCallbackService_OnSuccess_Handler(srv interface{}, ctx context.Cont
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/payment_callback.PaymentCallbackService/OnSuccess",
FullMethod: PaymentCallbackService_OnSuccess_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PaymentCallbackServiceServer).OnSuccess(ctx, req.(*Event))
@ -107,7 +116,7 @@ func _PaymentCallbackService_OnFailure_Handler(srv interface{}, ctx context.Cont
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/payment_callback.PaymentCallbackService/OnFailure",
FullMethod: PaymentCallbackService_OnFailure_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PaymentCallbackServiceServer).OnFailure(ctx, req.(*Event))

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: treasurer/payment.model.proto

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: treasurer/service.proto

@ -1,4 +1,8 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: treasurer/service.proto
package treasurer
@ -14,6 +18,20 @@ import (
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
TreasurerService_GetPaymentLinkBankCard_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkBankCard"
TreasurerService_GetPaymentLinkYooMoney_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkYooMoney"
TreasurerService_GetPaymentLinkQIWI_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkQIWI"
TreasurerService_GetPaymentLinkSberPay_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkSberPay"
TreasurerService_GetPaymentLinkAlfaClick_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkAlfaClick"
TreasurerService_GetPaymentLinkTinkoff_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkTinkoff"
TreasurerService_GetPaymentLinkSberbankB2B_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkSberbankB2B"
TreasurerService_GetPaymentLinkSBP_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkSBP"
TreasurerService_GetPaymentLinkMobile_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkMobile"
TreasurerService_GetPaymentLinkCash_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkCash"
TreasurerService_GetPaymentLinkInstallments_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkInstallments"
)
// TreasurerServiceClient is the client API for TreasurerService 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.
@ -41,7 +59,7 @@ func NewTreasurerServiceClient(cc grpc.ClientConnInterface) TreasurerServiceClie
func (c *treasurerServiceClient) GetPaymentLinkBankCard(ctx context.Context, in *GetBankCardPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
out := new(GetPaymentLinkResponse)
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkBankCard", in, out, opts...)
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkBankCard_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -50,7 +68,7 @@ func (c *treasurerServiceClient) GetPaymentLinkBankCard(ctx context.Context, in
func (c *treasurerServiceClient) GetPaymentLinkYooMoney(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
out := new(GetPaymentLinkResponse)
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkYooMoney", in, out, opts...)
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkYooMoney_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -59,7 +77,7 @@ func (c *treasurerServiceClient) GetPaymentLinkYooMoney(ctx context.Context, in
func (c *treasurerServiceClient) GetPaymentLinkQIWI(ctx context.Context, in *GetPhonePaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
out := new(GetPaymentLinkResponse)
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkQIWI", in, out, opts...)
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkQIWI_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -68,7 +86,7 @@ func (c *treasurerServiceClient) GetPaymentLinkQIWI(ctx context.Context, in *Get
func (c *treasurerServiceClient) GetPaymentLinkSberPay(ctx context.Context, in *GetPhonePaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
out := new(GetPaymentLinkResponse)
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkSberPay", in, out, opts...)
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkSberPay_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -77,7 +95,7 @@ func (c *treasurerServiceClient) GetPaymentLinkSberPay(ctx context.Context, in *
func (c *treasurerServiceClient) GetPaymentLinkAlfaClick(ctx context.Context, in *GetLoginPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
out := new(GetPaymentLinkResponse)
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkAlfaClick", in, out, opts...)
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkAlfaClick_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -86,7 +104,7 @@ func (c *treasurerServiceClient) GetPaymentLinkAlfaClick(ctx context.Context, in
func (c *treasurerServiceClient) GetPaymentLinkTinkoff(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
out := new(GetPaymentLinkResponse)
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkTinkoff", in, out, opts...)
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkTinkoff_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -95,7 +113,7 @@ func (c *treasurerServiceClient) GetPaymentLinkTinkoff(ctx context.Context, in *
func (c *treasurerServiceClient) GetPaymentLinkSberbankB2B(ctx context.Context, in *GetB2BPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
out := new(GetPaymentLinkResponse)
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkSberbankB2B", in, out, opts...)
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkSberbankB2B_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -104,7 +122,7 @@ func (c *treasurerServiceClient) GetPaymentLinkSberbankB2B(ctx context.Context,
func (c *treasurerServiceClient) GetPaymentLinkSBP(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
out := new(GetPaymentLinkResponse)
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkSBP", in, out, opts...)
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkSBP_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -113,7 +131,7 @@ func (c *treasurerServiceClient) GetPaymentLinkSBP(ctx context.Context, in *GetP
func (c *treasurerServiceClient) GetPaymentLinkMobile(ctx context.Context, in *GetPhonePaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
out := new(GetPaymentLinkResponse)
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkMobile", in, out, opts...)
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkMobile_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -122,7 +140,7 @@ func (c *treasurerServiceClient) GetPaymentLinkMobile(ctx context.Context, in *G
func (c *treasurerServiceClient) GetPaymentLinkCash(ctx context.Context, in *GetPhonePaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
out := new(GetPaymentLinkResponse)
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkCash", in, out, opts...)
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkCash_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -131,7 +149,7 @@ func (c *treasurerServiceClient) GetPaymentLinkCash(ctx context.Context, in *Get
func (c *treasurerServiceClient) GetPaymentLinkInstallments(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
out := new(GetPaymentLinkResponse)
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkInstallments", in, out, opts...)
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkInstallments_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -214,7 +232,7 @@ func _TreasurerService_GetPaymentLinkBankCard_Handler(srv interface{}, ctx conte
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkBankCard",
FullMethod: TreasurerService_GetPaymentLinkBankCard_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TreasurerServiceServer).GetPaymentLinkBankCard(ctx, req.(*GetBankCardPaymentLinkRequest))
@ -232,7 +250,7 @@ func _TreasurerService_GetPaymentLinkYooMoney_Handler(srv interface{}, ctx conte
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkYooMoney",
FullMethod: TreasurerService_GetPaymentLinkYooMoney_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TreasurerServiceServer).GetPaymentLinkYooMoney(ctx, req.(*GetPaymentLinkBody))
@ -250,7 +268,7 @@ func _TreasurerService_GetPaymentLinkQIWI_Handler(srv interface{}, ctx context.C
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkQIWI",
FullMethod: TreasurerService_GetPaymentLinkQIWI_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TreasurerServiceServer).GetPaymentLinkQIWI(ctx, req.(*GetPhonePaymentLinkRequest))
@ -268,7 +286,7 @@ func _TreasurerService_GetPaymentLinkSberPay_Handler(srv interface{}, ctx contex
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkSberPay",
FullMethod: TreasurerService_GetPaymentLinkSberPay_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TreasurerServiceServer).GetPaymentLinkSberPay(ctx, req.(*GetPhonePaymentLinkRequest))
@ -286,7 +304,7 @@ func _TreasurerService_GetPaymentLinkAlfaClick_Handler(srv interface{}, ctx cont
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkAlfaClick",
FullMethod: TreasurerService_GetPaymentLinkAlfaClick_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TreasurerServiceServer).GetPaymentLinkAlfaClick(ctx, req.(*GetLoginPaymentLinkRequest))
@ -304,7 +322,7 @@ func _TreasurerService_GetPaymentLinkTinkoff_Handler(srv interface{}, ctx contex
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkTinkoff",
FullMethod: TreasurerService_GetPaymentLinkTinkoff_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TreasurerServiceServer).GetPaymentLinkTinkoff(ctx, req.(*GetPaymentLinkBody))
@ -322,7 +340,7 @@ func _TreasurerService_GetPaymentLinkSberbankB2B_Handler(srv interface{}, ctx co
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkSberbankB2B",
FullMethod: TreasurerService_GetPaymentLinkSberbankB2B_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TreasurerServiceServer).GetPaymentLinkSberbankB2B(ctx, req.(*GetB2BPaymentLinkRequest))
@ -340,7 +358,7 @@ func _TreasurerService_GetPaymentLinkSBP_Handler(srv interface{}, ctx context.Co
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkSBP",
FullMethod: TreasurerService_GetPaymentLinkSBP_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TreasurerServiceServer).GetPaymentLinkSBP(ctx, req.(*GetPaymentLinkBody))
@ -358,7 +376,7 @@ func _TreasurerService_GetPaymentLinkMobile_Handler(srv interface{}, ctx context
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkMobile",
FullMethod: TreasurerService_GetPaymentLinkMobile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TreasurerServiceServer).GetPaymentLinkMobile(ctx, req.(*GetPhonePaymentLinkRequest))
@ -376,7 +394,7 @@ func _TreasurerService_GetPaymentLinkCash_Handler(srv interface{}, ctx context.C
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkCash",
FullMethod: TreasurerService_GetPaymentLinkCash_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TreasurerServiceServer).GetPaymentLinkCash(ctx, req.(*GetPhonePaymentLinkRequest))
@ -394,7 +412,7 @@ func _TreasurerService_GetPaymentLinkInstallments_Handler(srv interface{}, ctx c
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkInstallments",
FullMethod: TreasurerService_GetPaymentLinkInstallments_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TreasurerServiceServer).GetPaymentLinkInstallments(ctx, req.(*GetPaymentLinkBody))

@ -13,8 +13,9 @@ func PrivilegeProtoToModel(privilege *broker.PrivilegeMessage) *models.Privilege
return &models.Privilege{
PrivilegeID: privilege.GetPrivilegeID(),
ServiceKey: privilege.GetServiceKey(),
Type: privilege.GetType(),
Type: models.PrivilegeTypeMap[privilege.GetType()],
Value: privilege.GetValue(),
Amount: privilege.GetAmount(),
}
}
@ -36,8 +37,9 @@ func PrivilegeModelToProto(privilege *models.Privilege) *broker.PrivilegeMessage
return &broker.PrivilegeMessage{
PrivilegeID: privilege.PrivilegeID,
ServiceKey: privilege.ServiceKey,
Type: privilege.Type,
Type: models.PrivilegeBrokerTypeMap[privilege.Type],
Value: privilege.Value,
Amount: privilege.Amount,
}
}

@ -15,7 +15,8 @@ func TestPrivilegeModelToProto(t *testing.T) {
&broker.PrivilegeMessage{
PrivilegeID: "12",
ServiceKey: "key-1",
Type: "type",
Amount: 10,
Type: broker.PrivilegeType_Count,
Value: "12",
},
transfer.PrivilegeModelToProto(&models.Privilege{
@ -24,9 +25,10 @@ func TestPrivilegeModelToProto(t *testing.T) {
PrivilegeID: "12",
ServiceKey: "key-1",
Description: "description",
Type: "type",
Type: models.PrivilegeTypeCount,
Value: "12",
Price: 20,
Amount: 10,
}),
)
})
@ -43,7 +45,7 @@ func TestPrivilegeArrayModelToProto(t *testing.T) {
{
PrivilegeID: "12",
ServiceKey: "key-1",
Type: "type",
Type: broker.PrivilegeType_Full,
Value: "12",
},
},
@ -54,7 +56,7 @@ func TestPrivilegeArrayModelToProto(t *testing.T) {
PrivilegeID: "12",
ServiceKey: "key-1",
Description: "description",
Type: "type",
Type: models.PrivilegeTypeFull,
Value: "12",
Price: 20,
},
@ -69,14 +71,16 @@ func TestPrivilegeProtoToModel(t *testing.T) {
&models.Privilege{
PrivilegeID: "12",
ServiceKey: "key-1",
Type: "type",
Type: models.PrivilegeTypeDay,
Value: "12",
Amount: 12,
},
transfer.PrivilegeProtoToModel(&broker.PrivilegeMessage{
PrivilegeID: "12",
ServiceKey: "key-1",
Type: "type",
Type: broker.PrivilegeType_Day,
Value: "12",
Amount: 12,
}),
)
})
@ -93,7 +97,7 @@ func TestPrivilegeArrayProtoToModel(t *testing.T) {
{
PrivilegeID: "12",
ServiceKey: "key-1",
Type: "type",
Type: models.PrivilegeTypeCount,
Value: "12",
},
{},
@ -102,7 +106,7 @@ func TestPrivilegeArrayProtoToModel(t *testing.T) {
{
PrivilegeID: "12",
ServiceKey: "key-1",
Type: "type",
Type: broker.PrivilegeType_Count,
Value: "12",
},
nil,

@ -48,7 +48,7 @@ func TestTariffMessageProtoToTariffModel(t *testing.T) {
{
PrivilegeID: "12",
ServiceKey: "key-1",
Type: "type",
Type: models.PrivilegeTypeCount,
Value: "12",
},
},
@ -59,7 +59,7 @@ func TestTariffMessageProtoToTariffModel(t *testing.T) {
{
PrivilegeID: "12",
ServiceKey: "key-1",
Type: "type",
Type: broker.PrivilegeType_Count,
Value: "12",
},
},
@ -81,7 +81,7 @@ func TestTariffModelToProtoMessage(t *testing.T) {
{
PrivilegeID: "12",
ServiceKey: "key-1",
Type: "type",
Type: broker.PrivilegeType_Count,
Value: "12",
},
},
@ -91,7 +91,7 @@ func TestTariffModelToProtoMessage(t *testing.T) {
{
PrivilegeID: "12",
ServiceKey: "key-1",
Type: "type",
Type: models.PrivilegeTypeCount,
Value: "12",
},
},

@ -7,11 +7,18 @@ option go_package = "./broker";
message PrivilegeMessage {
string PrivilegeID = 1;
string ServiceKey = 2;
string Type = 3;
PrivilegeType Type = 3;
string Value = 4;
uint64 Amount = 5;
}
message TariffMessage {
repeated PrivilegeMessage Privileges = 1;
string UserID = 2;
}
enum PrivilegeType {
Full = 0;
Day = 1;
Count = 2;
}