package com.jasamedika.medifirst2000.controller;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.jasamedika.medifirst2000.service.ReportLogistikService;

@RestController
@RequestMapping("/report-logistik")
public class ReportLogistikController  {
	
	@Autowired
	private ReportLogistikService reportLogistikService;
	
	private static final Logger LOGGER = LoggerFactory.getLogger(ReportLogistikController.class);

	@RequestMapping(value = "/report-penerimaan-barang/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public Map<String, Object> reportPenerimaanBarang(
			@RequestParam(value = "noRec", required = true) String noRec) {
		Map<String, Object> result = reportLogistikService.reportPenerimaanBarang(noRec);

		return result;
	}
	
	

	@RequestMapping(value = "/report-mutasiBarang-barang/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public Map<String, Object> reportMutasiBarang(
			@RequestParam(value = "noRec", required = true) String noRec) {
		Map<String, Object> result = reportLogistikService.reportMutasiBarang(noRec);
		return result;
	}
	
	@RequestMapping(value = "/cetak-qr-code/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public Map<String, Object> cetakQrCode(@RequestParam(value = "noRec", required = true) String noRec,
			@RequestParam(value = "isPersediaan", required = true) Boolean isPersediaan) {
		Map<String, Object> result = reportLogistikService.cetakQrCode(noRec,isPersediaan);

		return result;
	}
	
}
