package com.jasamedika.medifirst2000.controller;

import com.jasamedika.medifirst2000.service.KartuStokService;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/kartu-stok")
public class KartuStokController {

	@Autowired
	private KartuStokService kartuStokService;

	@RequestMapping(value = "/get-kartu-stok")
	@ResponseBody
	public List<Map<String, Object>> preAddPenerimaan(@RequestParam(value = "dateStart") String dateStart,
			@RequestParam(value = "dateEnd") String dateEnd, @RequestParam(value = "ruanganId") Integer ruanganId,
			@RequestParam(value = "produkId") Integer produkId) {
		return kartuStokService.getKartuStok(ruanganId, produkId, dateStart, dateEnd);
	}

}
