package com.jasamedika.medifirst2000.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jasamedika.medifirst2000.dao.PgStatActivityDao;
import com.jasamedika.medifirst2000.entities.PgStatActivity;
import com.jasamedika.medifirst2000.service.PgStatActivityService;

/**
 * @author salmanoe
 * @since Jan 12, 2022
 */
@Service("pgStatActivityService")
public class PgStatActivityServiceImpl implements PgStatActivityService {

	@Autowired
	private PgStatActivityDao pgStatActivityDao;

	@Override
	public List<PgStatActivity> findByStateAndInterval() {
		List<PgStatActivity> result = pgStatActivityDao.findByStateAndInterval();

		return result;
	}

	@Override
	public Boolean callCancelBackend(Integer pid) {
		pgStatActivityDao.callPgCancelBackend(pid);

		return true;
	}

	@Override
	public Boolean callTerminateBackend(Integer pid) {
		pgStatActivityDao.callPgTerminateBackend(pid);

		return true;
	}

}
