23 lines
654 B
Go
23 lines
654 B
Go
package verification
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"git.sendico.io/tech/sxchnge/bff/pkg/db/repository"
|
|
"git.sendico.io/tech/sxchnge/bff/pkg/db/repository/builder"
|
|
"git.sendico.io/tech/sxchnge/bff/pkg/model"
|
|
)
|
|
|
|
func normalizeContextRef(purpose model.VerificationPurpose, contextRef string) (string, error) {
|
|
_ = purpose
|
|
return strings.TrimSpace(contextRef), nil
|
|
}
|
|
|
|
func appendContextRefFilter(filters []builder.Query, purpose model.VerificationPurpose, contextRef string) []builder.Query {
|
|
_ = purpose
|
|
if strings.TrimSpace(contextRef) != "" {
|
|
filters = append(filters, repository.Filter("contextRef", strings.TrimSpace(contextRef)))
|
|
}
|
|
return filters
|
|
}
|