Invalid QR Code

This commit is contained in:
aditya.siregar
2024-08-14 00:10:53 +07:00
parent 7cc4f1d152
commit 961387ab56
3 changed files with 16 additions and 0 deletions
+4
View File
@@ -125,6 +125,10 @@ func (s *OrderService) CreateOrder(ctx mycontext.Context, req *entity.OrderReque
func (s *OrderService) CheckInInquiry(ctx mycontext.Context, qrCode string, partnerID *int64) (*entity.CheckinResponse, error) {
order, err := s.repo.FindByQRCode(ctx, qrCode)
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, errors2.NewErrorMessage(errors2.ErrorInvalidRequest, "Not Valid QR Code")
}
logger.ContextLogger(ctx).Error("error when getting order by QR code", zap.Error(err))
return nil, err
}