package com.jasamedika.medifirst2000.controller;

import com.jasamedika.medifirst2000.controller.base.LocaleController;
import com.jasamedika.medifirst2000.service.PenyusunanEPlanningService;
import com.jasamedika.medifirst2000.vo.DetailSpekAnggaranVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
import static org.springframework.web.bind.annotation.RequestMethod.GET;

@RestController
@RequestMapping("/penyusunan-eplanning")
public class PenyusunanEPlanningController extends LocaleController<DetailSpekAnggaranVO> {

	@Autowired
	private PenyusunanEPlanningService service;

	@RequestMapping(value = "/get-penyusunan-eplanning", method = GET, produces = APPLICATION_JSON_VALUE)
	public Map<String, Object> getPenyusunanTRPNBP(
			@RequestParam(value = "page", required = false, defaultValue = "0") Integer page,
			@RequestParam(value = "limit", required = false, defaultValue = "50") Integer limit,
			@RequestParam(value = "sort", required = false, defaultValue = "namaProduk") String sort,
			@RequestParam(value = "dir", required = false, defaultValue = "asc") String dir,
			@RequestParam(value = "isVerifikasi", required = false) String isVerifikasi) {
		return service.getPenyusunanEPlanning(page, limit, sort, dir, isVerifikasi);
	}

}
