package com.pci.transactions.server;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.isomorphic.datasource.DSRequest;
import com.isomorphic.datasource.DSResponse;

public class ExternalTransactions
{
	public static DSResponse executeFetchTransSchedule(DSRequest req, HttpServletRequest request)
	{
		DSResponse ret = new DSResponse();

		List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
		Map<String, Object> rec = null;

		for (int i = 0; i < 10; i++)
		{
			rec = new HashMap<String, Object>();
			data.add(rec);

			rec.put("record_id", String.valueOf(i));
			rec.put("assetOwner", "assetOwner");
			rec.put("scheduleName", "scheduleName");
			rec.put("source", "source");
			rec.put("sink", "sink");
			rec.put("type", "type");
			rec.put("hour1", "1");
			rec.put("hour2", "2");
			rec.put("hour2s", "2s");
			rec.put("hour3", "3");
			rec.put("hour4", "4");
			rec.put("hour5", "5");
			rec.put("hour6", "6");
			rec.put("hour7", "7");
			rec.put("hour8", "8");
			rec.put("hour9", "9");
			rec.put("hour10", "10");
			rec.put("hour11", "11");
			rec.put("hour12", "12");
			rec.put("hour13", "13");
			rec.put("hour14", "14");
			rec.put("hour15", "15");
			rec.put("hour16", "16");
			rec.put("hour17", "17");
			rec.put("hour18", "18");
			rec.put("hour19", "19");
			rec.put("hour20", "20");
			rec.put("hour21", "21");
			rec.put("hour22", "22");
			rec.put("hour23", "23");
			rec.put("hour24", "24");
		}

		ret.setData(data);
		ret.setStatus(DSResponse.STATUS_SUCCESS);
		ret.setSuccess();

		return ret;
	}
}
