define([ 'ngResource' ], function() {
	angular.module('PurcServices', [ 'ngResource' 
	]).factory('PurcOrder', function($resource) {
		return $resource('sale/orders/:id', {});
	}).factory('PurcOrderItem', function($resource) {
		return $resource('sale/orders/items', {}, {
			replyByBatch: {
				url: 'sale/orders/items/reply',
				method: 'POST'
			}, reply: {
				url: 'sale/orders/items/:orderItemId/reply',
				method: 'POST',
				params: {
					orderItemId: 'orderItemId'
				}
			}, getReply: {
				url: 'sale/orders/items/:orderItemId/reply',
				method: 'GET',
				isArray: true,
				params: {
					orderItemId: 'orderItemId'
				}
			}
		});
	}).factory('PurcChange', function($resource) {
		return $resource('sale/changes/:id', {}, {
			reply: {
				url: 'sale/changes/:changeId/reply',
				method: 'POST',
				params: {
					changeId: 'changeId'
				}
			}
		});
	}).factory('PurcInquiry', function($resource) {
		return $resource('sale/inquiry/:id', {}, {
			reply: {
				url: 'sale/inquiry/items/:itemId/reply',
				method: 'POST',
				params: {
					itemId: 'itemId'
				}
			}, getItem: {
				url: 'sale/inquiry/items/:itemId',
				method: 'GET',
				params: {
					itemId: 'itemId'
				}
			}, saveItem: {
				url: 'sale/inquiry/items/:itemId/save',
				method: 'POST',
				params: {
					itemId: 'itemId'
				}
			}
		});
	});
});