add client for verify status in pkg

This commit is contained in:
Pavel 2024-05-26 16:45:22 +03:00
parent ca16a618c3
commit aab18dfcec

@ -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 <SetVerifyAccount> of <CustomerClient>", 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 <SetVerifyAccount> of <CustomerClient>", zap.Error(err))
return nil, err