feat: enhance tariff processing with error handling and category filtering

This commit is contained in:
2025-08-19 15:22:42 +03:00
parent e2b4b22095
commit b4e55197be
2 changed files with 77 additions and 20 deletions

View File

@@ -6,6 +6,7 @@ import (
"fmt"
"hash/fnv"
"math"
"strconv"
"github.com/golang-jwt/jwt/v5"
)
@@ -123,3 +124,10 @@ func HashArray[T Hashable](arr []T) (string, error) {
return fmt.Sprintf("%x", h.Sum64()), nil
}
func IsDigit(v string) (bool, *int64) {
if val, err := strconv.ParseInt(v, 10, 64); err == nil {
return true, &val
}
return false, nil
}