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-doc.md b/doc/epp-doc.md
index a986ec85c..26fc7581b 100644
--- a/doc/epp-doc.md
+++ b/doc/epp-doc.md
@@ -1,8 +1,3 @@
# EPP integration specification for Estonian Internet Foundation
-## Introduction
-Introduction text here
-[[Session related functions](epp/session.md)]
-[[Contact related functions](epp/contact.md)]
-[[Domain related functions](epp/domain.md)]
-[[Keyrelay related functions](epp/keyrelay.md)]
+Document moved to [new_location](/doc/epp/)
diff --git a/doc/epp/README.md b/doc/epp/README.md
index 4c842ff64..1c2df2870 100644
--- a/doc/epp/README.md
+++ b/doc/epp/README.md
@@ -2,7 +2,10 @@
## Introduction
Introduction text here
-[[Session related functions](session.md)]
-[[Contact related functions](contact.md)]
-[[Domain related functions](domain.md)]
-[[Keyrelay related functions](keyrelay.md)]
+[Session related functions](session.md)
+[Contact related functions](contact.md)
+[Domain related functions](domain.md)
+[Keyrelay related functions](keyrelay.md)
+
+Please study official The Extensible Provisioning Protocol (EPP):
+http://en.wikipedia.org/wiki/Extensible_Provisioning_Protocol
diff --git a/doc/epp/contact.md b/doc/epp/contact.md
index bd2e1df3f..b84d62c6a 100644
--- a/doc/epp/contact.md
+++ b/doc/epp/contact.md
@@ -1,26 +1,103 @@
## Contact related functions
+Please study official Cantact Mapping protocol:
+http://tools.ietf.org/html/rfc5733
+
+More info at http://en.wikipedia.org/wiki/Extensible_Provisioning_Protocol
+
+Contact Mapping protocol short version:
+
### 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)
+
+### Contact delete
+
+ Field name Min-max Field description
+ ----------------------- ------- -----------------
+ 1
+ 1 Attribute: xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"
+ 1 Contact id
+ 0-1 Client transaction id
+
+[EXAMPLE REQUEST AND RESPONSE](/doc/epp-examples.md#epp-contact-with-valid-user-delete-command-deletes-contact)
+
+
+### Contact check
+
+ Field name Min-max Field description
+ ----------------------- ------- -----------------
+ 1
+ 1 Attribute: xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"
+ 1-n Contact id
+ 0-1 Client transaction id
+
+[EXAMPLE REQUEST AND RESPONSE](/doc/epp-examples.md#epp-contact-with-valid-user-check-command-returns-info-about-contact-availability)
+
+
+### Contact info
+
+ Field name Min-max Field description
+ ----------------------- ------- -----------------
+ 1
+ 1 Attribute: xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"
+ 1-n Contact id
+ 0-1 Client transaction id
+
+[EXAMPLE REQUEST AND RESPONSE](/doc/epp-examples.md#epp-contact-with-valid-user-info-command-discloses-items-to-owner)
+
+
+### Domain renew
+
+Renewal semantics do not apply to contact objects, so there is no
+mapping defined for the EPP command.
diff --git a/doc/epp/domain.md b/doc/epp/domain.md
index 29ee2787e..c788ec142 100644
--- a/doc/epp/domain.md
+++ b/doc/epp/domain.md
@@ -1,5 +1,13 @@
## Domain related functions
+Please study official Domain Name Mapping protocol:
+http://tools.ietf.org/html/rfc5731
+
+More info at http://en.wikipedia.org/wiki/Extensible_Provisioning_Protocol
+
+Domain name mapping protocol short version:
+
+
### Domain create
Field name Min-max Field description
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)