diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php index e0a507efef..bfa356ef9f 100644 --- a/app/Http/Controllers/ProductController.php +++ b/app/Http/Controllers/ProductController.php @@ -48,6 +48,41 @@ class ProductController extends BaseController } /** + * + * + * @OA\Get( + * path="/api/v1/products", + * operationId="getProducts", + * tags={"products"}, + * summary="Gets a list of products", + * description="Lists products, search and filters allow fine grained lists to be generated. + + Query parameters can be added to performed more fine grained filtering of the products, these are handled by the ProductFilters class which defines the methods available", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Response( + * response=200, + * description="A list of products", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/Product"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function index(ProductFilters $filters) { @@ -63,6 +98,40 @@ class ProductController extends BaseController * Show the form for creating a new resource. * * @return \Illuminate\Http\Response + * + * + * + * @OA\Get( + * path="/api/v1/products/create", + * operationId="getProductsCreate", + * tags={"products"}, + * summary="Gets a new blank Product object", + * description="Returns a blank object with default values", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Response( + * response=200, + * description="A blank Product object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/Product"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function create(CreateProductRequest $request) { @@ -76,6 +145,40 @@ class ProductController extends BaseController * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response + * + * + * + * @OA\Post( + * path="/api/v1/products", + * operationId="storeProduct", + * tags={"products"}, + * summary="Adds a Product", + * description="Adds an Product to the system", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Response( + * response=200, + * description="Returns the saved Product object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/Product"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function store(StoreProductRequest $request) { @@ -89,6 +192,50 @@ class ProductController extends BaseController * * @param Product $product * @return \Illuminate\Http\Response + * + * + * @OA\Get( + * path="/api/v1/products/{id}", + * operationId="showProduct", + * tags={"products"}, + * summary="Shows an Product", + * description="Displays an Product by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The Product Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns the Product object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/Product"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function show(ShowProductRequest $request, Product $product) { @@ -100,6 +247,49 @@ class ProductController extends BaseController * * @param Product $product * @return \Illuminate\Http\Response + * + * @OA\Get( + * path="/api/v1/products/{id}/edit", + * operationId="editProduct", + * tags={"products"}, + * summary="Shows an Product for editting", + * description="Displays an Product by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The Product Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns the Product object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/Product"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function edit(EditProductRequest $request, Product $product) { @@ -112,7 +302,51 @@ class ProductController extends BaseController * @param \Illuminate\Http\Request $request * @param Product $product * @return \Illuminate\Http\Response - */ + * + * + * @OA\Put( + * path="/api/v1/products/{id}", + * operationId="updateProduct", + * tags={"products"}, + * summary="Updates an Product", + * description="Handles the updating of an Product by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The Product Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns the Product object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/Product"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * + */ public function update(UpdateProductRequest $request, Product $product) { $product = $this->product_repo->save($request, $product); @@ -125,6 +359,49 @@ class ProductController extends BaseController * * @param Product $product * @return \Illuminate\Http\Response + * + * + * @OA\Delete( + * path="/api/v1/products/{id}", + * operationId="deleteProduct", + * tags={"products"}, + * summary="Deletes a Product", + * description="Handles the deletion of an Product by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The Product Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns a HTTP status", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function destroy(Product $product) { @@ -137,6 +414,54 @@ class ProductController extends BaseController * Perform bulk actions on the list view * * @return Collection + * + * + * @OA\Post( + * path="/api/v1/products/bulk", + * operationId="bulkProducts", + * tags={"products"}, + * summary="Performs bulk actions on an array of products", + * description="", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/index"), + * @OA\RequestBody( + * description="User credentials", + * required=true, + * @OA\MediaType( + * mediaType="application/json", + * @OA\Schema( + * type="array", + * @OA\Items( + * type="integer", + * description="Array of hashed IDs to be bulk 'actioned", + * example="[0,1,2,3]", + * ), + * ) + * ) + * ), + * @OA\Response( + * response=200, + * description="The Product User response", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/ProductUser"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function bulk() { diff --git a/app/Http/Controllers/QuoteController.php b/app/Http/Controllers/QuoteController.php index ef3d085926..b68cb518b5 100644 --- a/app/Http/Controllers/QuoteController.php +++ b/app/Http/Controllers/QuoteController.php @@ -65,7 +65,43 @@ class QuoteController extends BaseController * Display a listing of the resource. * * @return \Illuminate\Http\Response + * + * + * @OA\Get( + * path="/api/v1/quotes", + * operationId="getQuotes", + * tags={"quotes"}, + * summary="Gets a list of quotes", + * description="Lists quotes, search and filters allow fine grained lists to be generated. + + Query parameters can be added to performed more fine grained filtering of the quotes, these are handled by the QuoteFilters class which defines the methods available", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Response( + * response=200, + * description="A list of quotes", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/Quote"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ + public function index(QuoteFilters $filters) { @@ -78,6 +114,40 @@ class QuoteController extends BaseController * Show the form for creating a new resource. * * @return \Illuminate\Http\Response + * + * + * + * @OA\Get( + * path="/api/v1/quotes/create", + * operationId="getQuotesCreate", + * tags={"quotes"}, + * summary="Gets a new blank Quote object", + * description="Returns a blank object with default values", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Response( + * response=200, + * description="A blank Quote object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/Quote"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function create(CreateQuoteRequest $request) { @@ -94,6 +164,40 @@ class QuoteController extends BaseController * @param \App\Http\Requests\Quote\StoreQuoteRequest $request The request * * @return \Illuminate\Http\Response + * + * + * + * @OA\Post( + * path="/api/v1/quotes", + * operationId="storeQuote", + * tags={"quotes"}, + * summary="Adds a Quote", + * description="Adds an Quote to the system", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Response( + * response=200, + * description="Returns the saved Quote object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/Quote"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function store(StoreQuoteRequest $request) { @@ -111,6 +215,50 @@ class QuoteController extends BaseController * @param \App\Models\Quote $quote The quote * * @return \Illuminate\Http\Response + * + * + * @OA\Get( + * path="/api/v1/quotes/{id}", + * operationId="showQuote", + * tags={"quotes"}, + * summary="Shows an Quote", + * description="Displays an Quote by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The Quote Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns the Quote object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/Quote"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function show(ShowQuoteRequest $request, Quote $quote) { @@ -126,7 +274,51 @@ class QuoteController extends BaseController * @param \App\Models\Quote $quote The quote * * @return \Illuminate\Http\Response - */ + * + * + * @OA\Get( + * path="/api/v1/quotes/{id}/edit", + * operationId="editQuote", + * tags={"quotes"}, + * summary="Shows an Quote for editting", + * description="Displays an Quote by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The Quote Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns the Quote object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/Quote"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * + */ public function edit(EditQuoteRequest $request, Quote $quote) { @@ -141,6 +333,50 @@ class QuoteController extends BaseController * @param \App\Models\Quote $quote The quote * * @return \Illuminate\Http\Response + * + * + * @OA\Put( + * path="/api/v1/quotes/{id}", + * operationId="updateQuote", + * tags={"quotes"}, + * summary="Updates an Quote", + * description="Handles the updating of an Quote by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The Quote Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns the Quote object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/Quote"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function update(UpdateQuoteRequest $request, Quote $quote) { @@ -158,6 +394,49 @@ class QuoteController extends BaseController * @param \App\Models\Quote $quote * * @return \Illuminate\Http\Response + * + * + * @OA\Delete( + * path="/api/v1/quotes/{id}", + * operationId="deleteQuote", + * tags={"quotes"}, + * summary="Deletes a Quote", + * description="Handles the deletion of an Quote by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The Quote Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns a HTTP status", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function destroy(DestroyQuoteRequest $request, Quote $quote) { @@ -172,6 +451,54 @@ class QuoteController extends BaseController * Perform bulk actions on the list view * * @return Collection + * + * + * @OA\Post( + * path="/api/v1/quotes/bulk", + * operationId="bulkQuotes", + * tags={"quotes"}, + * summary="Performs bulk actions on an array of quotes", + * description="", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/index"), + * @OA\RequestBody( + * description="User credentials", + * required=true, + * @OA\MediaType( + * mediaType="application/json", + * @OA\Schema( + * type="array", + * @OA\Items( + * type="integer", + * description="Array of hashed IDs to be bulk 'actioned", + * example="[0,1,2,3]", + * ), + * ) + * ) + * ), + * @OA\Response( + * response=200, + * description="The Quote User response", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/QuoteUser"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function bulk() { @@ -194,6 +521,76 @@ class QuoteController extends BaseController } + /** + * Quote Actions + * + * + * + * @OA\Get( + * path="/api/v1/quotes/{id}/{action}", + * operationId="actionQuote", + * tags={"quotes"}, + * summary="Performs a custom action on an Quote", + * description="Performs a custom action on an Quote. + + The current range of actions are as follows + - clone_to_Quote + - clone_to_quote + - history + - delivery_note + - mark_paid + - download + - archive + - delete + - email", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The Quote Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Parameter( + * name="action", + * in="path", + * description="The action string to be performed", + * example="clone_to_quote", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns the Quote object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/Quote"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * + */ public function action(ActionQuoteRequest $request, Quote $quote, $action) { diff --git a/app/Http/Controllers/RecurringInvoiceController.php b/app/Http/Controllers/RecurringInvoiceController.php index ee37cb4b91..4535989169 100644 --- a/app/Http/Controllers/RecurringInvoiceController.php +++ b/app/Http/Controllers/RecurringInvoiceController.php @@ -72,6 +72,41 @@ class RecurringInvoiceController extends BaseController * @param \App\Filters\RecurringInvoiceFilters $filters The filters * * @return \Illuminate\Http\Response + * + * + * @OA\Get( + * path="/api/v1/recurring_invoices", + * operationId="getRecurringInvoices", + * tags={"recurring_invoices"}, + * summary="Gets a list of recurring_invoices", + * description="Lists recurring_invoices, search and filters allow fine grained lists to be generated. + + Query parameters can be added to performed more fine grained filtering of the recurring_invoices, these are handled by the RecurringInvoiceFilters class which defines the methods available", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Response( + * response=200, + * description="A list of recurring_invoices", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/RecurringInvoice"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function index(RecurringInvoiceFilters $filters) { @@ -88,6 +123,40 @@ class RecurringInvoiceController extends BaseController * @param \App\Http\Requests\RecurringInvoice\CreateRecurringInvoiceRequest $request The request * * @return \Illuminate\Http\Response + * + * + * + * @OA\Get( + * path="/api/v1/recurring_invoices/create", + * operationId="getRecurringInvoicesCreate", + * tags={"recurring_invoices"}, + * summary="Gets a new blank RecurringInvoice object", + * description="Returns a blank object with default values", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Response( + * response=200, + * description="A blank RecurringInvoice object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/RecurringInvoice"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function create(CreateRecurringInvoiceRequest $request) { @@ -105,6 +174,40 @@ class RecurringInvoiceController extends BaseController * @param \App\Http\Requests\RecurringInvoice\StoreRecurringInvoiceRequest $request The request * * @return \Illuminate\Http\Response + * + * + * + * @OA\Post( + * path="/api/v1/recurring_invoices", + * operationId="storeRecurringInvoice", + * tags={"recurring_invoices"}, + * summary="Adds a RecurringInvoice", + * description="Adds an RecurringInvoice to the system", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Response( + * response=200, + * description="Returns the saved RecurringInvoice object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/RecurringInvoice"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function store(StoreRecurringInvoiceRequest $request) { @@ -122,7 +225,51 @@ class RecurringInvoiceController extends BaseController * @param \App\Models\RecurringInvoice $recurring_invoice The RecurringInvoice * * @return \Illuminate\Http\Response - */ + * + * + * @OA\Get( + * path="/api/v1/recurring_invoices/{id}", + * operationId="showRecurringInvoice", + * tags={"recurring_invoices"}, + * summary="Shows an RecurringInvoice", + * description="Displays an RecurringInvoice by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The RecurringInvoice Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns the RecurringInvoice object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/RecurringInvoice"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * + */ public function show(ShowRecurringInvoiceRequest $request, RecurringInvoice $recurring_invoice) { @@ -137,6 +284,50 @@ class RecurringInvoiceController extends BaseController * @param \App\Models\RecurringInvoice $recurring_invoice The RecurringInvoice * * @return \Illuminate\Http\Response + * + * + * @OA\Get( + * path="/api/v1/recurring_invoices/{id}/edit", + * operationId="editRecurringInvoice", + * tags={"recurring_invoices"}, + * summary="Shows an RecurringInvoice for editting", + * description="Displays an RecurringInvoice by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The RecurringInvoice Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns the RecurringInvoice object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/RecurringInvoice"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function edit(EditRecurringInvoiceRequest $request, RecurringInvoice $recurring_invoice) { @@ -152,6 +343,50 @@ class RecurringInvoiceController extends BaseController * @param \App\Models\RecurringInvoice $recurring_invoice The RecurringInvoice * * @return \Illuminate\Http\Response + * + * + * @OA\Put( + * path="/api/v1/recurring_invoices/{id}", + * operationId="updateRecurringInvoice", + * tags={"recurring_invoices"}, + * summary="Updates an RecurringInvoice", + * description="Handles the updating of an RecurringInvoice by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The RecurringInvoice Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns the RecurringInvoice object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/RecurringInvoice"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function update(UpdateRecurringInvoiceRequest $request, RecurringInvoice $recurring_invoice) { @@ -169,6 +404,49 @@ class RecurringInvoiceController extends BaseController * @param \App\Models\RecurringInvoice $recurring_invoice * * @return \Illuminate\Http\Response + * + * + * @OA\Delete( + * path="/api/v1/recurring_invoices/{id}", + * operationId="deleteRecurringInvoice", + * tags={"recurring_invoices"}, + * summary="Deletes a RecurringInvoice", + * description="Handles the deletion of an RecurringInvoice by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The RecurringInvoice Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns a HTTP status", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function destroy(DestroyRecurringInvoiceRequest $request, RecurringInvoice $recurring_invoice) { @@ -183,6 +461,54 @@ class RecurringInvoiceController extends BaseController * Perform bulk actions on the list view * * @return Collection + * + * + * @OA\Post( + * path="/api/v1/recurring_invoices/bulk", + * operationId="bulkRecurringInvoices", + * tags={"recurring_invoices"}, + * summary="Performs bulk actions on an array of recurring_invoices", + * description="", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/index"), + * @OA\RequestBody( + * description="User credentials", + * required=true, + * @OA\MediaType( + * mediaType="application/json", + * @OA\Schema( + * type="array", + * @OA\Items( + * type="integer", + * description="Array of hashed IDs to be bulk 'actioned", + * example="[0,1,2,3]", + * ), + * ) + * ) + * ), + * @OA\Response( + * response=200, + * description="The RecurringInvoice User response", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/RecurringInvoiceUser"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * */ public function bulk() { @@ -205,6 +531,76 @@ class RecurringInvoiceController extends BaseController } + /** + * Recurring Invoice Actions + * + * + * @OA\Get( + * path="/api/v1/recurring_invoices/{id}/{action}", + * operationId="actionRecurringInvoice", + * tags={"recurring_invoices"}, + * summary="Performs a custom action on an RecurringInvoice", + * description="Performs a custom action on an RecurringInvoice. + + The current range of actions are as follows + - clone_to_RecurringInvoice + - clone_to_quote + - history + - delivery_note + - mark_paid + - download + - archive + - delete + - email", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The RecurringInvoice Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Parameter( + * name="action", + * in="path", + * description="The action string to be performed", + * example="clone_to_quote", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns the RecurringInvoice object", + * @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/RecurringInvoice"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * + */ + public function action(ActionRecurringInvoiceRequest $request, RecurringInvoice $recurring_invoice, $action) {