VATIdValidator
public struct VATIdValidator
Undocumented
-
Possible validation errors.
incorrectLength- The VAT identifier should have 10 digits.checkSumNotMatch- Checksum should be equal 10th digit of the VAT Identifier.
Declaration
Swift
public enum ValidationError : Error -
Common constructor.
Declaration
Swift
public init(_ vatId: [Int])Parameters
vatIdThe VAT identifier as array of integers.
-
Common constructor.
Declaration
Swift
public init<T>(_ vatId: T) where T : BinaryIntegerParameters
vatIdThe VAT identifier as any integer.
-
Common constructor. Converts double to integer.
Declaration
Swift
public init(_ vatId: Double)Parameters
vatIdThe VAT identifier as double.
-
Common constructor.
Declaration
Swift
public init(_ vatId: StringLiteralType)Parameters
vatIdThe VAT identifier as string.
-
Validates VAT identifer.
Throws
ValidationError.incorrectLengthThe VAT Identifier should have 10 digits.ValidationError.checkSumNotMatchChecksum should be equal 10th digit of the VAT Identifier.
Declaration
Swift
public func validate() throws
VATIdValidator Structure Reference