Improve Ident validation, extract Ident from Contact

#569
This commit is contained in:
Artur Beljajev 2017-08-18 13:24:56 +03:00
parent c5e1516d89
commit feb8d83a26
17 changed files with 809 additions and 195 deletions

View file

@ -20,15 +20,6 @@ en:
email:
blank: "Required parameter missing - email"
invalid: "Email is invalid"
ident:
blank: "Required parameter missing - ident"
invalid_EE_identity_format: "Ident not in valid Estonian identity format."
invalid_EE_identity_format_update: "Ident not in valid Estonian identity format. Please create new contact"
invalid_birthday_format: "Ident not in valid birthday format, should be YYYY-MM-DD"
invalid_country_code: "Ident country code is not valid, should be in ISO_3166-1 alpha 2 format"
ident_type:
ident_type_invalid: 'Ident type is invalid'
epp_ident_type_invalid: 'Object status prohibits operation: ident_type of contact %{code} is invalid'
domains:
exist: 'Object association prohibits operation'
statuses:

11
config/locales/idents.yml Normal file
View file

@ -0,0 +1,11 @@
en:
activemodel:
errors:
models:
contact/ident:
attributes:
base:
mismatch: Ident type "%{type}" is invalid for %{country}
code:
invalid_national_id: does not conform to national identification number format of %{country}
invalid_reg_no: does not conform to registration number format of %{country}