<?php

namespace App\Services;

use App\Services\Service;
use App\Services\ServiceResponse\ServiceResponse;
use App\DAO\LojaCompraItemDAO;

class LojaCompraItemsService extends Service {

	public function registerItensCompra(int $idcompra, int $idusuario, array $produtos): ServiceResponse {

		$dao = new LojaCompraItemDAO();
		$service_response = new ServiceResponse();
		$daoResponse = $dao->registerItensCompra( $idcompra, $idusuario,$produtos );
		$service_response = $this->setServiceResponse( $daoResponse );
		
		return $service_response;

	}
	
	public function excluirItemsByCompraId(int $idcompra): ServiceResponse {
		$dao = new LojaCompraItemDAO();
		$service_response = new ServiceResponse();
		$daoResponse = $dao->excluirItemsByCompraId($idcompra);
		$service_response = $this->setServiceResponse( $daoResponse );
		
		return $service_response;
	}

}

