<commit_before>package org.openlmis.web.controller;

import lombok.NoArgsConstructor;
import org.openlmis.report.model.dto.Product;
import org.openlmis.report.model.dto.ProductCategory;
import org.openlmis.report.model.dto.RequisitionGroup;
import org.openlmis.report.service.ReportLookupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

import static org.springframework.web.bind.annotation.RequestMethod.GET;

/**

 */
@Controller
@NoArgsConstructor
@RequestMapping(value = "/reports")
public class ReportLookupController extends BaseController {

    public static final String USER_ID = "USER_ID";

    private ReportLookupService productReportService;

    @Autowired
    public ReportLookupController(ReportLookupService productReportService) {
        this.productReportService = productReportService;
    }


    @RequestMapping(value="/products", method = GET, headers = ACCEPT_JSON)
    public List<Product> getProducts(){
          return this.productReportService.getAllProducts();
    }

    @RequestMapping(value="/rgroups", method = GET, headers = ACCEPT_JSON)
    public List<RequisitionGroup> getRequisitionGroups(){
        return this.productReportService.getAllRequisitionGroups();
    }

    @RequestMapping(value="/productCategories", method = GET, headers = ACCEPT_JSON)
    public List<ProductCategory> getProductCategories(){
        return this.productReportService.getAllProductCategories();
    }


}<commit_msg>add a requisition group service that will return requisition groups based on program and schedule id.<commit_after>package org.openlmis.web.controller;

import lombok.NoArgsConstructor;
import org.openlmis.report.model.dto.Product;
import org.openlmis.report.model.dto.ProductCategory;
import org.openlmis.report.model.dto.RequisitionGroup;
import org.openlmis.report.service.ReportLookupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

import static org.springframework.web.bind.annotation.RequestMethod.GET;

/**

 */
@Controller
@NoArgsConstructor
@RequestMapping(value = "/reports")
public class ReportLookupController extends BaseController {

    public static final String USER_ID = "USER_ID";

    private ReportLookupService reportLookupService;

    @Autowired
    public ReportLookupController(ReportLookupService productReportService) {
        this.reportLookupService = productReportService;
    }


    @RequestMapping(value="/products", method = GET, headers = ACCEPT_JSON)
    public List<Product> getProducts(){
          return this.reportLookupService.getAllProducts();
    }

    @RequestMapping(value="/rgroups", method = GET, headers = ACCEPT_JSON)
    public List<RequisitionGroup> getRequisitionGroups(){
        return this.reportLookupService.getAllRequisitionGroups();
    }

    @RequestMapping(value="/reporting_groups_by_program_schedule", method = GET, headers = ACCEPT_JSON)
    public List<RequisitionGroup> getRequisitionGroupsByProgramSchedule(
            @RequestParam(value = "program", required = true, defaultValue = "1") int program,
            @RequestParam(value = "schedule", required = true, defaultValue = "10") int schedule
    ){
        return this.reportLookupService.getRequisitionGroupsByProgramAndSchedule(program,schedule);
    }


    @RequestMapping(value="/productCategories", method = GET, headers = ACCEPT_JSON)
    public List<ProductCategory> getProductCategories(){
        return this.reportLookupService.getAllProductCategories();
    }


}
{'fraction_non_alphanumeric': 0.09430512016718913, 'fraction_numerical': 0.0007836990595611285, 'mean_word_length': 5.1264, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '1923564', 'n_tokens_mistral': 1035, 'n_tokens_neox': 1001, 'n_words': 197}