Update Voucher

This commit is contained in:
aditya.siregar
2025-06-06 14:48:09 +07:00
parent b5d6f7ff5b
commit 54144b2eba
7 changed files with 641 additions and 29 deletions
@@ -29,12 +29,17 @@ func (s *orderSvc) CreateOrderInquiry(ctx mycontext.Context,
return nil, err
}
customerID, err := s.customer.ResolveCustomer(ctx, &entity.CustomerResolutionRequest{
ID: req.CustomerID,
Name: req.CustomerName,
Email: req.CustomerEmail,
PhoneNumber: req.CustomerPhoneNumber,
})
customerID := int64(0)
if req.CustomerID != nil {
customer, err := s.customer.GetCustomer(ctx, *req.CustomerID)
if err != nil {
logger.ContextLogger(ctx).Error("customer is not found", zap.Error(err))
return nil, err
}
customerID = customer.ID
}
if err != nil {
logger.ContextLogger(ctx).Error("failed to resolve customer", zap.Error(err))
return nil, err