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.controller.base.LocaleController;
import com.jasamedika.medifirst2000.service.RekapPemenangService;

@RestController
@RequestMapping("/rekap-pemenang")
public class RekapPemenangController extends LocaleController {
	
	@Autowired
	private RekapPemenangService rekapPemenangService;
	
	private static final Logger LOGGER = LoggerFactory.getLogger(RekapPemenangController.class);

	@RequestMapping(value = "/get-rekap-pemenang", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public Map<String, Object> getKartuPengendaliHeaderByNoRec(@RequestParam(value = "noRec", required = true) String noRec) {
		Map<String, Object> rekapPemanganList = rekapPemenangService.rekapPemenang(noRec);
		return rekapPemanganList;
	}

	

	@RequestMapping(value = "/detail-rekap-pemenang", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public Map<String, Object> detailRekapPemenang(@RequestParam(value = "noRecKartuPengendaliId", required = true) String noRecKartuPengendaliId,@RequestParam(value = "supplierId", required = true) Integer supplierId) {
		Map<String, Object> rekapPemangan = rekapPemenangService.detailRekapPemenang(supplierId, noRecKartuPengendaliId);
		return rekapPemangan;
	}


}
