From aab18dfcec46e625e4bcc59b1999aec63c844168 Mon Sep 17 00:00:00 2001 From: Pavel Date: Sun, 26 May 2024 16:45:22 +0300 Subject: [PATCH] add client for verify status in pkg --- pkg/customer_clients/rpc.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/customer_clients/rpc.go b/pkg/customer_clients/rpc.go index 1279631..24bdc72 100644 --- a/pkg/customer_clients/rpc.go +++ b/pkg/customer_clients/rpc.go @@ -25,7 +25,7 @@ func NewCustomersClient(deps CustomersClientDeps) *CustomersClient { } } -func (receiver *CustomersClient) SetVerifyAccount(ctx context.Context, req *customer.SetVerificationReq) (*customer.Account, error) { +func (receiver *CustomersClient) SetVerifyAccount(ctx context.Context, userId string, accountStatus string) (*customer.Account, error) { connection, err := grpc.Dial(receiver.customerServiceHost, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { receiver.logger.Error("failed to connect on of ", zap.Error(err), zap.String("customer host", receiver.customerServiceHost)) @@ -39,7 +39,10 @@ func (receiver *CustomersClient) SetVerifyAccount(ctx context.Context, req *cust client := customer.NewCustomerServiceClient(connection) - account, err := client.SetAccountVerificationStatus(ctx, req) + account, err := client.SetAccountVerificationStatus(ctx, &customer.SetVerificationReq{ + UserID: userId, + Status: customer.AccountStatus(customer.AccountStatus_value[accountStatus]), + }) if err != nil { receiver.logger.Error("failed Set Account Verification Status on of ", zap.Error(err)) return nil, err