'use strict';

angular.module('users.factory', [
]).factory('UserFactory', [
    'Common',
    function(Common) {

        function User(data) {
            var self = this;
            // merge data
            if (data) angular.extend(self, data);

            self.CreatedOn = new Date(self.CreatedOn);

            self.FullName = function() {
                return self.FirstName + " " + self.LastName;
            };
        }

        var create = function(data) {
            return new User(data);
        };

        return {
            create: create
        };
    }
]);