Skip to content

Commit

Permalink
add shopify model
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Dec 9, 2024
1 parent 2071e37 commit be3e5ed
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Docs/V1/Shopify/Controllers/Controller.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Apps\Shopify\Docs\V1\Shopify\Controllers;
namespace NexaMerchant\Shopify\Docs\V1\Shopify\Controllers;

/**
* @OA\Info(
Expand Down
80 changes: 80 additions & 0 deletions src/Docs/V1/Shopify/Controllers/Products/ProductsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php
namespace NexaMerchant\Shopify\Docs\V1\Shopify\Controllers\Products;

class ProductsController {
/**
* @OA\Get(
* path="/products",
* operationId="getProductsList",
* tags={"Shopify"},
* summary="Get list of products",
* description="Returns list of products",
* @OA\Response(
* response=200,
* description="Successful operation",
* @OA\JsonContent(ref="#/components/schemas/Products")
* ),
* @OA\Response(
* response=400,
* description="Bad Request"
* )
* )
*/
public function getProductsList() {
}

/**
* @OA\Get(
* path="/products/{id}",
* operationId="getProductById",
* tags={"Shopify"},
* summary="Get product information",
* description="Returns product data",
* @OA\Parameter(
* name="id",
* description="Product id",
* required=true,
* in="path",
* @OA\Schema(
* type="integer"
* )
* ),
* @OA\Response(
* response=200,
* description="Successful operation",
* @OA\JsonContent(ref="#/components/schemas/Product")
* ),
* @OA\Response(
* response=400,
* description="Bad Request"
* )
* )
*/
public function getProductById() {
}

/**
* @OA\Post(
* path="/products",
* operationId="createProduct",
* tags={"Shopify"},
* summary="Create new product",
* description="Create new product",
* @OA\RequestBody(
* required=true,
* @OA\JsonContent(ref="#/components/schemas/Product")
* ),
* @OA\Response(
* response=201,
* description="Successful operation",
* @OA\JsonContent(ref="#/components/schemas/Product")
* ),
* @OA\Response(
* response=400,
* description="Bad Request"
* )
* )
*/
public function createProduct() {
}
}
67 changes: 67 additions & 0 deletions src/Docs/V1/Shopify/Models/Products/Product.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php
namespace NexaMerchant\Shopify\Docs\V1\Shopify\Models\Products;

/**
* @OA\Schema(
* title="Product",
* description="Product model",
* )
*/
class Product
{
/**
* @OA\Property(
* title="ID",
* description="ID",
* format="int64",
* example=1
* )
*
* @var int
*/
private $id;

/**
* @OA\Property(
* title="Name",
* description="Product name",
* example="Product 1"
* )
*
* @var string
*/
private $name;

/**
* @OA\Property(
* title="Description",
* description="Product description",
* example="Product 1 description"
* )
*
* @var string
*/
private $description;

/**
* @OA\Property(
* title="Price",
* description="Product price",
* example=100.00
* )
*
* @var float
*/
private $price;

/**
* @OA\Property(
* title="Image",
* description="Product image",
* example="product1.jpg"
* )
*
* @var string
*/
private $image;
}

0 comments on commit be3e5ed

Please sign in to comment.