@@ -0,0 +1,2188 @@
+/*%0A *  Copyright (C) 2016 Stichting Akvo (Akvo Foundation)%0A *%0A *  This file is part of Akvo FLOW.%0A *%0A *  Akvo FLOW is free software: you can redistribute it and modify it under the terms of%0A *  the GNU Affero General Public License (AGPL) as published by the Free Software Foundation,%0A *  either version 3 of the License or any later version.%0A *%0A *  Akvo FLOW is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;%0A *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.%0A *  See the GNU Affero General Public License included below for more details.%0A *%0A *  The full license text can also be seen at %3Chttp://www.gnu.org/licenses/agpl.html%3E.%0A */%0A%0Apackage org.waterforpeople.mapping.app.web.rest;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport javax.inject.Inject;%0A%0Aimport org.springframework.stereotype.Controller;%0Aimport org.springframework.web.bind.annotation.RequestBody;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.bind.annotation.ResponseBody;%0Aimport org.waterforpeople.mapping.app.web.dto.ApprovalGroupDTO;%0A%0Aimport com.gallatinsystems.survey.dao.ApprovalGroupDAO;%0Aimport com.gallatinsystems.survey.domain.ApprovalGroup;%0A%0A@Controller%0A@RequestMapping(%22/approval_group%22)%0Apublic class ApprovalGroupRestService %7B%0A%0A    @Inject%0A    private ApprovalGroupDAO approvalGroupDao;%0A%0A    /**%0A     * Create a new ApprovalGroup from posted payload.%0A     *%0A     * @param requestPayload%0A     * @return%0A     */%0A    @RequestMapping(method = RequestMethod.POST, value = %22%22)%0A    @ResponseBody%0A    public Map%3CString, ApprovalGroupDTO%3E createApprovalGroup(%0A            @RequestBody ApprovalGroupDTO approvalGroupPayload) %7B%0A        final Map%3CString, ApprovalGroupDTO%3E response = new HashMap%3CString, ApprovalGroupDTO%3E();%0A        ApprovalGroup group = approvalGroupPayload.getApprovalGroup();%0A%0A        if (group.getName() == null %7C%7C group.getName().trim().isEmpty()) %7B%0A            return null;%0A        %7D%0A%0A        response.put(%22approval_group%22, new ApprovalGroupDTO(approvalGroupDao.save(group)));%0A        return response;%0A    %7D%0A%7D%0A

Add approval group rest controller and create approval group method