src/Http/Swagger/OrderSwagger.php
<?php
namespace EscolaLms\Cart\Http\Swagger;
use EscolaLms\Cart\Http\Requests\OrderSearchRequest;
use EscolaLms\Cart\Http\Requests\OrderViewRequest;
use Illuminate\Http\JsonResponse;
interface OrderSwagger
{
/**
* @OA\Get(
* path="/api/orders",
* description="Search orders",
* tags={"Orders"},
* security={
* {"passport": {}},
* },
* @OA\Parameter(
* name="order_by",
* required=false,
* in="query",
* @OA\Schema(
* type="string",
* enum={"created_at","updated_at","user_id"}
* ),
* ),
* @OA\Parameter(
* name="order",
* required=false,
* in="query",
* @OA\Schema(
* type="string",
* enum={"ASC", "DESC"}
* ),
* ),
* @OA\Parameter(
* name="page",
* description="Pagination Page Number",
* required=false,
* in="query",
* @OA\Schema(
* type="integer",
* default=1,
* ),
* ),
* @OA\Parameter(
* name="per_page",
* description="Pagination Per Page",
* required=false,
* in="query",
* @OA\Schema(
* type="integer",
* default=15,
* ),
* ),
* @OA\Parameter(
* name="product_id",
* description="Product ID",
* required=false,
* in="query",
* @OA\Schema(
* type="integer",
* ),
* ),
* @OA\Parameter(
* name="productable_id",
* description="Productable ID (for example Course Id)",
* required=false,
* in="query",
* @OA\Schema(
* type="integer",
* ),
* ),
* @OA\Parameter(
* name="productable_type",
* description="Productable type (class) - required if productable_id is sent",
* required=false,
* in="query",
* @OA\Schema(
* type="string",
* ),
* ),
* @OA\Parameter(
* name="status",
* description="Status (0 = PROCESSING, 1 = PAID, 2 = CANCELLED)",
* required=false,
* in="query",
* @OA\Schema(
* type="integer",
* ),
* ),
* @OA\Response(
* response=200,
* description="successful operation",
* @OA\MediaType(
* mediaType="application/json",
* ),
* @OA\Schema(
* type="object",
* @OA\Property(
* property="success",
* type="boolean"
* ),
* @OA\Property(
* property="data",
* type="array",
* @OA\Items(ref="#/components/schemas/Order")
* ),
* @OA\Property(
* property="message",
* type="string"
* )
* )
* ),
* @OA\Response(
* response=422,
* description="Bad request",
* @OA\MediaType(
* mediaType="application/json"
* )
* )
* )
*/
public function index(OrderSearchRequest $request): JsonResponse;
/**
* @OA\Get(
* path="/api/orders/{id}",
* summary="Display the specified Order",
* tags={"Orders"},
* description="Get Order",
* security={
* {"passport": {}},
* },
* @OA\Parameter(
* name="id",
* description="id of Order",
* @OA\Schema(
* type="integer",
* ),
* required=true,
* in="path"
* ),
* @OA\Response(
* response=200,
* description="successful operation",
* @OA\MediaType(
* mediaType="application/json"
* ),
* @OA\Schema(
* type="object",
* @OA\Property(
* property="success",
* type="boolean"
* ),
* @OA\Property(
* property="data",
* ref="#/components/schemas/Order"
* ),
* @OA\Property(
* property="message",
* type="string"
* )
* )
* )
* )
*/
public function read(OrderViewRequest $request): JsonResponse;
}