Class CompanyExcelController

java.lang.Object
es.kukenan.smartfi.microservice.backoffice.controller.CompanyExcelController

@Controller public class CompanyExcelController extends Object
Rest service for handle temporal excel onboarding service.
  • Field Details

    • companyExcelService

      @Autowired private CompanyExcelService companyExcelService
      Company Excel service.
    • jwtService

      @Autowired private es.kukenan.smartfi.common.service.jwt.JwtServiceImpl jwtService
      JWT service for create a bearer to call products.
    • API_ADMIN_AUTHORITIES

      public static final String API_ADMIN_AUTHORITIES
      Authority (role) required in order to be able to invoke change application status.
      See Also:
  • Constructor Details

    • CompanyExcelController

      public CompanyExcelController()
  • Method Details

    • loadEmployeesFromExcel

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\'))") @PostMapping(path="/api/v1/excel") public void loadEmployeesFromExcel(@RequestParam(name="companyId",required=false) Integer companyId, @RequestPart("file") org.springframework.web.multipart.MultipartFile file, es.kukenan.smartfi.common.security.WalletAuthentication authentication, javax.servlet.http.HttpServletResponse response) throws IOException
      Load an excel file with employee data from a company.
      Parameters:
      companyId - company identifier.
      file - Excel file.
      authentication - user credentials.
      response - response.
      Throws:
      IOException - failed to write response.
    • getExcelEmployeesTemplate

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\'))") @GetMapping(path="/api/v1/excel/template") public void getExcelEmployeesTemplate(javax.servlet.http.HttpServletResponse response) throws IOException
      Download excel template file.
      Parameters:
      response - response.
      Throws:
      IOException - failed to write response.