/**
 * Created by fran lopez on 8/12/15.
 */

    /**
     * AngularJS service that will utilize the "$resource" factory
     * method. The service uses the "$resource" factory with two
     * arguments: The base URL for the resource endpoints and a
     * routing parameter assignment using the tv serie's document 
     * title field.
     */

    angular.module('tvSeries').factory('TVSeriesByTitle', ['$resource',
        function ($resource) {
            return $resource('/tvSeries/tvSeriesByTitle/:patternForTVSerieTitle', {
                patternForTVSerieTitle: '@title'
            });
        }
    ]);

    /**
     * AngularJS service that will utilize the "$resource" factory method.
     * The service uses the "$resource" factory with two arguments: The base
     * URL for the resource endpoints and a routing parameter assignment
     * using the tv serie's document year field.
     */

    angular.module('tvSeries').factory('TVSeriesByYear', ['$resource',
        function ($resource) {
            return $resource('/tvSeries/tvSeriesByYear/:tvSerieYear', {
                tvSerieYear: '@year'
            });
        }
    ]);

    /**
     * AngularJS service that will utilize the "$resource" factory method.
     * The service uses the "$resource" factory with two arguments: The base
     * URL for the resource endpoints and a routing parameter assignment
     * using the tv serie's document genre field.
     */

    angular.module('tvSeries').factory('TVSeriesByGenre', ['$resource',
        function ($resource) {
            return $resource('/tvSeries/tvSeriesByGenre/:tvSerieGenre', {
                tvSerieGenre: '@genre'
            });
        }
    ]);

    /**
     * AngularJS service that will utilize the "$resource" factory method.
     * The service uses the "$resource" factory with two arguments: The base
     * URL for the resource endpoints and a routing parameter assignment
     * using the tv serie's document protagonist field.
     */

    angular.module('tvSeries').factory('TVSeriesByProtagonist', ['$resource',
        function ($resource) {
            return $resource('/tvSeries/tvSeriesByProtagonist/:patternForTVSerieProtagonist', {
                patternForTVSerieProtagonist: '@protagonist'
            });
        }
    ]);

    /**
     * AngularJS service that will utilize the "$resource" factory method.
     * The service uses the "$resource" factory with two arguments: The base
     * URL for the resource endpoints and a routing parameter assignment
     * using the tv serie's document director field.
     */

    angular.module('tvSeries').factory('TVSeriesByDirector', ['$resource',
        function ($resource) {
            return $resource('/tvSeries/tvSeriesByDirector/:patternForTVSerieDirector', {
                patternForTvSerieDirector: '@director'
            });
        }
    ]);

    /**
     * AngularJS service that will utilize the "$resource" factory method.
     * The service uses the "$resource" factory with two arguments: The base
     * URL for the resource endpoints and a routing parameter assignment
     * using the tv serie's document rating field.
     */

    angular.module('tvSeries').factory('TVSeriesByRating', ['$resource',
        function ($resource) {
            return $resource('/tvSeries/tvSeriesByRating/:tvSerieRating', {
                tvSerieRating: '@rating'
            });
        }
    ]);

    /**
     * AngularJS service that will utilize the "$resource" factory method.
     * The service uses the "$resource" factory with one argument: The base
     * URL for the resource endpoints.
     */

    angular.module('tvSeries').factory('ListTVSerieYears', ['$resource',
        function ($resource) {
            return $resource('/listOfTVSerieYears', {});
        }
    ]);

    /**
     * AngularJS service that will utilize the "$resource" factory method.
     * The service uses the "$resource" factory with one argument: The base
     * URL for the resource endpoints.
     */

    angular.module('tvSeries').factory('ListTVSerieGenres', ['$resource',
        function ($resource) {
            return $resource('/listOfTVSerieGenres', {});
        }
    ]);

    /**
     * AngularJS service that will utilize the "$resource" factory method.
     * The service uses the "$resource" factory with one argument: The base
     * URL for the resource endpoints.
     */

    angular.module('tvSeries').factory('ListTVSerieRatings', ['$resource',
        function ($resource) {
            return $resource('/listOfTVSerieRatings', {});
        }
    ]);

    /**
     * AngularJS service that will utilize the "$resource" factory method.
     * The service uses the "$resource" factory with two arguments: The base
     * URL for the resource endpoints and a routing parameter assignment
     * using the tv serie's document id field.
     */

    angular.module('tvSeries').factory('TVSerieDetails', ['$resource',
        function ($resource) {
            return $resource('/tvSeries/:TVSerieId', {
                TVSerieId: '@_id'
            });
        }
    ]);