<commit_before>(function () {
    'use strict';

    angular
        .module('promort.worklist.services')
        .factory('WorkListService', WorkListService)
        .factory('ReviewStepsService', ReviewStepsService);

    WorkListService.$inject = ['$http'];

    function WorkListService($http) {
        var WorkListService = {
            get: get,
            startReview: startReview,
            closeReview: closeReview
        };

        return WorkListService;

        function get() {
            return $http.get('/api/worklist/');
        }

        function _reviewAction(case_id, review_type, action) {
            return $http.put(
                '/api/reviews/' + case_id + '/' + review_type.toLowerCase() + '/',
                {action: action}
            );
        }

        function startReview(case_id, review_type) {
            return _reviewAction(case_id, review_type, 'START');
        }

        function closeReview(case_id, review_type) {
            return _reviewAction(case_id, review_type, 'FINISH');
        }
    }

    ReviewStepsService.$inject = ['$http'];

    function ReviewStepsService($http) {
        var ReviewStepsService = {
            get: get,
            startReviewStep: startReviewStep,
            closeReviewStep: closeReviewStep
        };

        return ReviewStepsService;

        function get(case_id) {
            return $http.get('/api/worklist/' + case_id + '/');
        }

        function _reviewStepAction(case_id, review_type, slide_id, action) {
            return $http.put(
                '/api/reviews/' + case_id + '/' + review_type.toLowerCase() + '/' + slide_id + '/',
                {action: action}
            );
        }

        function startReviewStep(case_id, review_type, slide_id) {
            return _reviewStepAction(case_id, review_type, slide_id, 'START');
        }

        function closeReviewStep(case_id, review_type, slide_id) {
            return _reviewStepAction(case_id, review_type, slide_id, 'FINISH');
        }
    }
})();<commit_msg>notes can be added when closing a review<commit_after>(function () {
    'use strict';

    angular
        .module('promort.worklist.services')
        .factory('WorkListService', WorkListService)
        .factory('ReviewStepsService', ReviewStepsService);

    WorkListService.$inject = ['$http'];

    function WorkListService($http) {
        var WorkListService = {
            get: get,
            startReview: startReview,
            closeReview: closeReview
        };

        return WorkListService;

        function get() {
            return $http.get('/api/worklist/');
        }

        function _reviewAction(case_id, review_type, action) {
            return $http.put(
                '/api/reviews/' + case_id + '/' + review_type.toLowerCase() + '/',
                {action: action}
            );
        }

        function startReview(case_id, review_type) {
            return _reviewAction(case_id, review_type, 'START');
        }

        function closeReview(case_id, review_type) {
            return _reviewAction(case_id, review_type, 'FINISH');
        }
    }

    ReviewStepsService.$inject = ['$http'];

    function ReviewStepsService($http) {
        var ReviewStepsService = {
            get: get,
            startReviewStep: startReviewStep,
            closeReviewStep: closeReviewStep
        };

        return ReviewStepsService;

        function get(case_id) {
            return $http.get('/api/worklist/' + case_id + '/');
        }

        function _reviewStepAction(case_id, review_type, slide_id, action, notes) {
            var params = {action: action};
            if (typeof notes !== 'undefined') {
                params.notes = notes;
            }
            return $http.put(
                '/api/reviews/' + case_id + '/' + review_type.toLowerCase() + '/' + slide_id + '/',
                params
            );
        }

        function startReviewStep(case_id, review_type, slide_id) {
            return _reviewStepAction(case_id, review_type, slide_id, 'START');
        }

        function closeReviewStep(case_id, review_type, slide_id, notes) {
            return _reviewStepAction(case_id, review_type, slide_id, 'FINISH', notes);
        }
    }
})();
{'fraction_non_alphanumeric': 0.11609437047418827, 'fraction_numerical': 0.0, 'mean_word_length': 1.953103448275862, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2640894', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1173, 'n_words': 223}