-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
APIS-4691-Regex - Try strong type for value of regex validation rule (#…
…70) * APIS-4691-Regex - Try strong type for value of regex validation rule * APIS-4691 - Add ftp exclusion to url validation * APIS-4691 - Refined type use for field names
- Loading branch information
1 parent
658231a
commit 3d82d4f
Showing
27 changed files
with
276 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright 2020 HM Revenue & Customs | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package uk.gov.hmrc.apisubscriptionfields.model | ||
|
||
import eu.timepit.refined._ | ||
import eu.timepit.refined.api.Refined | ||
import eu.timepit.refined.string._ | ||
import eu.timepit.refined.boolean._ | ||
import eu.timepit.refined.api.RefType.applyRef | ||
|
||
object Types { | ||
type RegexExpr = String Refined Regex | ||
type NonFtpUrl = Url And Not[StartsWith[W.`"ftp"`.T]] | ||
|
||
type FieldNameRegex = MatchesRegex[W.`"^[a-zA-Z]+$"`.T] | ||
type FieldName = Refined[String,FieldNameRegex] | ||
object FieldName { | ||
def unsafeApply(s: String): FieldName = Refined.unsafeApply(s) | ||
} | ||
|
||
type FieldValue = String | ||
|
||
type Fields = Map[FieldName, String] | ||
|
||
type ErrorMessage = String | ||
|
||
type FieldError = (FieldName, ErrorMessage) | ||
|
||
type FieldErrorMap = Map[FieldName, ErrorMessage] | ||
object FieldErrorMap { | ||
val empty = Map.empty[FieldName, ErrorMessage] | ||
} | ||
|
||
type IsInsert = Boolean | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
app/uk/gov/hmrc/apisubscriptionfields/repository/SubscriptionFields.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.