Updated contact doc

This commit is contained in:
Priit Tark 2015-01-22 16:09:57 +02:00
parent 51978ef38a
commit 76108f83bf
3 changed files with 50 additions and 21 deletions

View file

@ -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' }

View file

@ -2,25 +2,54 @@
### Contact create
Field name Min-max Field description
----------------------- ------- -----------------
<create> 1
<contact:create> 1 Attribute: xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"
<contact:voice> 1 Phone
<contact:email> 1 E-mail
<contact:Ident> 1 Contact identificator.
Attribute: type="ico / op / passport / birthday"
<contact:postalInfo> 1 Contact information
<contact:name> 1 Full name
<contact:addr> 1 Address
<contact:street> 0-1 Street name
<contact:city> 1 City name
<contact:cc>` 1 Country code
<extension> 0-1
<eis:extdata> 0-1 Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
<eis:legalDocument> 1 Base64 encoded document. Attribute: type="pdf"
<clTRID> 0-1 Client transaction id
Field name Min-max Field description
----------------------- ------- -----------------
<create> 1
<contact:create> 1 Attribute: xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"
<contact:postalInfo> 1 Postal information container
<contact:name> 1 Full name of the contact
<contact:org> 0-1 Name of organization
<contact:addr> 1 Address container
<contact:street> 0-n Street name
<contact:city> 1 City name
<contact:sp> 0-1 State or province
<contact:pc> 0-1 Postal code
<contact:cc>` 1 Country code, 2 letters uppercase
<contact:voice> 1 Phone number in format \+ddd.d+
<contact:email> 1 E-mail
<contact:Ident> 1 Contact identificator.
<extension> 0-1
<eis:extdata> 0-1 Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
<eis:legalDocument> 1 Base64 encoded document. Attribute: type="pdf"
<clTRID> 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
----------------------- ------- -----------------
<update> 1
<contact:update> 1 Attribute: xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"
<contact:id> 1 contact id, required
<contact:chg> 1 Change container
<contact:postalInfo> 1 Postal information container
<contact:name> 0-1 Full name of the contact
<contact:org> 0-1 Name of organization
<contact:addr> 0-1 Address container
<contact:street> 0-n Street name
<contact:city> 0-1 City name
<contact:sp> 0-1 State or province
<contact:pc> 0-1 Postal code
<contact:cc> 0-1 Country code
<contact:voice> 0-1 Phone number in format \+ddd.d+
<contact:email> 0-1 E-mail
<contact:Ident> 1 Contact identificator.
<contact:authInfo> 0-1 Required if registrar is not the owner of the contact.
<contact:pw> 1 Contact password. Attribute: roid="String"
[EXAMPLE REQUEST AND RESPONSE](/doc/epp-examples.md#epp-contact-with-valid-user-update-command-is-succesful)

View file

@ -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)