Compare commits
4 Commits
ride_valid
...
check-zip-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
924ddaded1 | ||
|
|
d6301ebbf3 | ||
|
|
78d6a45ebb | ||
|
|
22a79cf658 |
@@ -1,15 +1,15 @@
|
|||||||
package usersroute
|
package usersroute
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
b64 "encoding/base64"
|
b64 "encoding/base64"
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"net/http"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
"net/http"
|
|
||||||
"encoding/json"
|
|
||||||
"bytes"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"bitbucket.org/nemt/nemt-portal-api/application/applicationservice"
|
"bitbucket.org/nemt/nemt-portal-api/application/applicationservice"
|
||||||
"bitbucket.org/nemt/nemt-portal-api/application/third/eligibility/bcbsi"
|
"bitbucket.org/nemt/nemt-portal-api/application/third/eligibility/bcbsi"
|
||||||
@@ -19,8 +19,8 @@ import (
|
|||||||
"bitbucket.org/nemt/nemt-portal-api/infra/cache"
|
"bitbucket.org/nemt/nemt-portal-api/infra/cache"
|
||||||
"bitbucket.org/nemt/nemt-portal-api/infra/config"
|
"bitbucket.org/nemt/nemt-portal-api/infra/config"
|
||||||
"bitbucket.org/nemt/nemt-portal-api/server/authorization"
|
"bitbucket.org/nemt/nemt-portal-api/server/authorization"
|
||||||
"bitbucket.org/nemt/nemt-portal-api/server/validation"
|
|
||||||
"bitbucket.org/nemt/nemt-portal-api/server/router/routeutils"
|
"bitbucket.org/nemt/nemt-portal-api/server/router/routeutils"
|
||||||
|
"bitbucket.org/nemt/nemt-portal-api/server/validation"
|
||||||
"github.com/labstack/echo"
|
"github.com/labstack/echo"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
"googlemaps.github.io/maps"
|
"googlemaps.github.io/maps"
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
package validation
|
package validation
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"regexp"
|
|
||||||
"strconv"
|
|
||||||
"time"
|
"time"
|
||||||
|
"fmt"
|
||||||
|
"strconv"
|
||||||
|
"regexp"
|
||||||
|
|
||||||
"bitbucket.org/nemt/nemt-portal-api/application/viewmodel"
|
"bitbucket.org/nemt/nemt-portal-api/application/viewmodel"
|
||||||
"bitbucket.org/nemt/nemt-portal-api/infra/errors"
|
"bitbucket.org/nemt/nemt-portal-api/infra/errors"
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -36,7 +38,7 @@ func isMixedIDValid(id string) bool {
|
|||||||
hasLowerCase := false
|
hasLowerCase := false
|
||||||
hasNumber := false
|
hasNumber := false
|
||||||
|
|
||||||
for _, character := range id {
|
for _, character := range (id) {
|
||||||
hasUpperCase = hasUpperCase || ((character >= 65) && (character <= 90))
|
hasUpperCase = hasUpperCase || ((character >= 65) && (character <= 90))
|
||||||
hasLowerCase = hasLowerCase || ((character >= 97) && (character <= 122))
|
hasLowerCase = hasLowerCase || ((character >= 97) && (character <= 122))
|
||||||
hasNumber = hasNumber || ((character >= 48) && (character <= 57))
|
hasNumber = hasNumber || ((character >= 48) && (character <= 57))
|
||||||
@@ -208,5 +210,6 @@ func ValidateRide(requestRide *viewmodel.RideRequest, user *viewmodel.User) []er
|
|||||||
result = append (result, errors.ValidationError{Field : "trip_type.key", Message : "Step #4 - Choose a Trip Type"})
|
result = append (result, errors.ValidationError{Field : "trip_type.key", Message : "Step #4 - Choose a Trip Type"})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user