package com.jasamedika.medifirst2000.controller;

import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
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.entities.AsalProduk;
import com.jasamedika.medifirst2000.entities.GolonganAsuransi;
import com.jasamedika.medifirst2000.entities.HubunganKeluarga;
import com.jasamedika.medifirst2000.entities.JenisTarif;
import com.jasamedika.medifirst2000.entities.Kelas;
import com.jasamedika.medifirst2000.entities.KelompokPasien;
import com.jasamedika.medifirst2000.entities.KomponenHarga;
import com.jasamedika.medifirst2000.entities.Paket;
import com.jasamedika.medifirst2000.entities.Produk;
import com.jasamedika.medifirst2000.entities.Rekanan;
import com.jasamedika.medifirst2000.entities.Ruangan;
import com.jasamedika.medifirst2000.service.PelayananHargaStokDiskonService;
import com.jasamedika.medifirst2000.service.PelayananPiutangRekananService;
import com.jasamedika.medifirst2000.util.DateUtil;
import com.jasamedika.medifirst2000.util.rest.RestUtil;
import com.jasamedika.medifirst2000.vo.AssetVO;

@RestController
@RequestMapping("/pelayanan-piutang-rekanan")
public class PelayananPiutangRekananController extends LocaleController<AssetVO> {
	@Autowired
	private PelayananPiutangRekananService pelayananPiutangRekananService;
	
	private static final Logger LOGGER = LoggerFactory.getLogger(PelayananPiutangRekananController.class);
	
	@RequestMapping(value = "/get", method = RequestMethod.GET)
	public ResponseEntity<Map<String,Object>> getDataPiutangRekanan(
			@RequestParam(value = "noRegistrasi", required = false) String noRegistrasi,
			@RequestParam(value = "produkId", required = false) Integer produkId,
			@RequestParam(value = "orderStok", required = false) Double orderStok,
			@RequestParam(value = "cito", required = false) Integer cito) {
		Map<String,Object> result = new HashMap<String,Object>();
		Produk produk=new Produk();
		produk.setId(produkId);
		result=pelayananPiutangRekananService.getHargaPiutangRekananProfile(noRegistrasi,
				produk, orderStok,cito);
		return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
	}

}
