import "reflect-metadata";
import { Controller, Get, Post, Patch, Route, Path, Body } from "@tsoa/runtime";
import itemBundleService from "~/services/item/bundle";

@Route("itemBundle")
export class ItemBundleController extends Controller {
	/**
	 * Retrieves a blank item bundle template
	 */
	@Get("/blank")
	public async getBlank(): Promise<any> {
		return await itemBundleService.getBlank();
	}

	/**
	 * Retrieves a specific item bundle
	 */
	@Get("/:id")
	public async get(@Path() id: string | number): Promise<any> {
		return await itemBundleService.get(id);
	}

	/**
	 * Creates a new item bundle
	 */
	@Post()
	public async create(): Promise<any> {
		return await itemBundleService.create();
	}

	/**
	 * Partially updates an item bundle
	 */
	@Patch("/:id")
	public async patch(@Path() id: string | number, @Body() body: any): Promise<any> {
		return await itemBundleService.patch(id, body);
	}
}
