'use strict';

(function () {

  // import Objects
  var ContactRepository = exports.contactRepository,
  ContactConverter = exports.contactConverter,
  ContactReverser = exports.contactReverser;

  // code
  exports.contactService = {

    convert: function (ddd) {
      var promise = ContactRepository.getAll();
      promise.then(function (data) {
        data.ddd = ddd;
        ContactConverter.convert(data);
      });
    },

    revert: function () {
      var promise = ContactRepository.getAll();
      promise.then(function (data) {
        ContactReverser.revert(data);
      });
    }
  };
}());
