<?php

namespace Planaday\Entities\Course;

use ArrayAccess;
use Countable;
use Planaday\Api\ApiException\InvalidResponseException;
use Planaday\Entities\Course\DTO\Course;
use Planaday\Entities\Course\DTO\CourseMaterial;
use Planaday\Entities\Course\DTO\CourseTemplate;
use Planaday\Entities\Course\Exception\CourseNotFoundException;
use Traversable;

interface CourseApi {

	/**
	 * @param int $courseId
	 *
	 * @return Course
	 * @throws CourseNotFoundException
	 * @throws InvalidResponseException
	 */
	public function getCourse(int $courseId): Course;

	/**
	 * @param int $courseId
	 * @param int $offset
	 * @param int $limit
	 *
	 * @return ArrayAccess<int|string, CourseMaterial>&Traversable<int|string, CourseMaterial>&Countable
	 * @throws CourseNotFoundException
	 * @throws InvalidResponseException
	 */
	public function getMaterialsCourse(int $courseId, int $offset = 0, int $limit = 100):ArrayAccess&Traversable&Countable;

	/**
	 * @param int $startDate
	 * @param int $endDate
	 * @param int $offset
	 * @param int $limit
	 *
	 * @return ArrayAccess<int|string, Course>&Traversable<int|string, Course>&Countable
	 * @throws InvalidResponseException
	 */
	public function getCoursesTimeSlot(int $startDate, int $endDate, int $offset = 0, int $limit = 100):ArrayAccess&Traversable&Countable;

	/**
	 * @return ArrayAccess<int|string, CourseTemplate>&Traversable<int|string, CourseTemplate>&Countable
	 * @throws InvalidResponseException
	 */
	public function getCourseTemplateList():ArrayAccess&Traversable&Countable;
}