From 76108f83bf59bd754a003874df169b51dc262da6 Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Thu, 22 Jan 2015 16:09:57 +0200 Subject: [PATCH] Updated contact doc --- app/models/contact.rb | 4 +-- doc/epp/contact.md | 65 +++++++++++++++++++++++++++++----------- spec/epp/contact_spec.rb | 2 +- 3 files changed, 50 insertions(+), 21 deletions(-) diff --git a/app/models/contact.rb b/app/models/contact.rb index 06a819616..328186518 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -1,6 +1,5 @@ class Contact < ActiveRecord::Base # TODO: Foreign contact will get email with activation link/username/temp password - # TODO: Phone number validation, in first phase very minimam in order to support current registries include EppErrors @@ -20,7 +19,8 @@ class Contact < ActiveRecord::Base validates :name, :phone, :email, :ident, :address, :registrar, :ident_type, presence: true - validates :phone, format: /\+[0-9]{1,3}\.[0-9]{1,14}?/ # /\+\d{3}\.\d+/ + # Phone nr validation is very minimam in order to support legacy requirements + validates :phone, format: /\+[0-9]{1,3}\.[0-9]{1,14}?/ validates :email, format: /@/ validates :ident, format: /\d{4}-\d{2}-\d{2}/, if: proc { |c| c.ident_type == 'birthday' } diff --git a/doc/epp/contact.md b/doc/epp/contact.md index bd2e1df3f..a1959310a 100644 --- a/doc/epp/contact.md +++ b/doc/epp/contact.md @@ -2,25 +2,54 @@ ### Contact create - Field name Min-max Field description - ----------------------- ------- ----------------- - 1 - 1 Attribute: xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" - 1 Phone - 1 E-mail - 1 Contact identificator. - Attribute: type="ico / op / passport / birthday" - 1 Contact information - 1 Full name - 1 Address - 0-1 Street name - 1 City name - ` 1 Country code - 0-1 - 0-1 Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0" - 1 Base64 encoded document. Attribute: type="pdf" - 0-1 Client transaction id + Field name Min-max Field description + ----------------------- ------- ----------------- + 1 + 1 Attribute: xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" + 1 Postal information container + 1 Full name of the contact + 0-1 Name of organization + 1 Address container + 0-n Street name + 1 City name + 0-1 State or province + 0-1 Postal code + ` 1 Country code, 2 letters uppercase + 1 Phone number in format \+ddd.d+ + 1 E-mail + 1 Contact identificator. + + 0-1 + 0-1 Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0" + 1 Base64 encoded document. Attribute: type="pdf" + 0-1 Client transaction id NB! Extension is not implemented yet! [EXAMPLE REQUEST AND RESPONSE](/doc/epp-examples.md#epp-contact-with-valid-user-create-command-successfully-creates-a-contact) + +### Contact update + + Field name Min-max Field description + ----------------------- ------- ----------------- + 1 + 1 Attribute: xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" + 1 contact id, required + 1 Change container + 1 Postal information container + 0-1 Full name of the contact + 0-1 Name of organization + 0-1 Address container + 0-n Street name + 0-1 City name + 0-1 State or province + 0-1 Postal code + 0-1 Country code + 0-1 Phone number in format \+ddd.d+ + 0-1 E-mail + 1 Contact identificator. + 0-1 Required if registrar is not the owner of the contact. + 1 Contact password. Attribute: roid="String" + + +[EXAMPLE REQUEST AND RESPONSE](/doc/epp-examples.md#epp-contact-with-valid-user-update-command-is-succesful) diff --git a/spec/epp/contact_spec.rb b/spec/epp/contact_spec.rb index 84cdad784..a190f4e41 100644 --- a/spec/epp/contact_spec.rb +++ b/spec/epp/contact_spec.rb @@ -18,7 +18,7 @@ describe 'EPP Contact', epp: true do let(:epp_xml) { EppXml::Contact.new(cl_trid: 'ABC-12345') } context 'with valid user' do - before(:each) do + before do Fabricate(:epp_user) Fabricate(:epp_user, username: 'zone', registrar: zone) Fabricate(:epp_user, username: 'elkdata', registrar: elkdata)