<?php

	use vlw\MySQL\Order;
	use Reflect\{Response, Path, Call};
	use Reflect\Rules\{Ruleset, Rules, Type};

	use VLW\API\Endpoints;
	use VLW\Database\Database;
	use VLW\Database\Tables\Coffee\StatsTable;

	require_once Path::root("src/API/Endpoints.php");
	require_once Path::root("src/Database/Database.php");
	require_once Path::root("src/Database/Tables/Coffee/Stats.php");

	class GET_CoffeeStats extends Database {
		protected readonly Ruleset $ruleset;

		public function __construct() {
			$this->ruleset = new Ruleset(strict: true);
			$this->ruleset->validate_or_exit();

			parent::__construct();
		}

		public function main(): Response {
			return $this->list(StatsTable::NAME, StatsTable::values());
		}
	}