Skip to content

Commit

Permalink
Merge pull request #63 from nikhilnarayanan623/feature/brand
Browse files Browse the repository at this point in the history
feature brand full CURD operations added
  • Loading branch information
nikhilnarayanan623 authored Oct 10, 2023
2 parents 3193fb5 + 8c36ef4 commit 785395e
Show file tree
Hide file tree
Showing 20 changed files with 1,115 additions and 14 deletions.
256 changes: 256 additions & 0 deletions cmd/api/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,242 @@ const docTemplate = `{
}
}
},
"/admin/brands": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "API for admin to find all brands",
"tags": [
"Admin Brand"
],
"summary": "Find All Brand",
"operationId": "FindAllBrands",
"parameters": [
{
"type": "integer",
"description": "Page number",
"name": "page_number",
"in": "query"
},
{
"type": "integer",
"description": "Count",
"name": "count",
"in": "query"
}
],
"responses": {
"200": {
"description": "successfully found all brands",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"204": {
"description": "there is no brands to show",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"500": {
"description": "failed to find brand",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "API for admin to save new brand",
"tags": [
"Admin Brand"
],
"summary": "Save Brand",
"operationId": "SaveBrand",
"parameters": [
{
"description": "Input Field",
"name": "inputs",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/request.Brand"
}
}
],
"responses": {
"200": {
"description": "successfully brand created",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"400": {
"description": "invalid input",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"409": {
"description": "brand name already exist",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"500": {
"description": "failed to create brand",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
}
},
"/admin/brands/{brand_id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "API for admin to find one brand",
"tags": [
"Admin Brand"
],
"summary": "Find One Brand",
"operationId": "FindOneBrand",
"parameters": [
{
"type": "integer",
"description": "Brand ID",
"name": "brand_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "successfully brand found",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"400": {
"description": "invalid input",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"500": {
"description": "failed to find brand",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "API for admin to update brand",
"tags": [
"Admin Brand"
],
"summary": "Save Brand",
"operationId": "UpdateBrand",
"parameters": [
{
"type": "integer",
"description": "Brand ID",
"name": "brand_id",
"in": "path",
"required": true
},
{
"description": "Input Field",
"name": "inputs",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/request.Brand"
}
}
],
"responses": {
"200": {
"description": "successfully brand updated",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"400": {
"description": "invalid input",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"500": {
"description": "failed to update brand",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "API for admin to delete brand",
"tags": [
"Admin Brand"
],
"summary": "Save Brand",
"operationId": "DeleteBrand",
"parameters": [
{
"type": "integer",
"description": "Brand ID",
"name": "brand_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "successfully brand deleted",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"400": {
"description": "invalid input",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"500": {
"description": "failed to delete brand",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
}
},
"/admin/categories": {
"get": {
"security": [
Expand Down Expand Up @@ -1942,6 +2178,13 @@ const docTemplate = `{
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "Brand Id",
"name": "brand_id",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "Product Price",
Expand Down Expand Up @@ -3675,6 +3918,19 @@ const docTemplate = `{
}
}
},
"request.Brand": {
"type": "object",
"required": [
"category_name"
],
"properties": {
"category_name": {
"type": "string",
"maxLength": 25,
"minLength": 3
}
}
},
"request.Category": {
"type": "object",
"required": [
Expand Down
Loading

0 comments on commit 785395e

Please sign in to comment.