{
  "swagger": "2.0",
  "info": {
    "version": "1.0.0",
    "title": "Stock Management API",
    "description": "Stock Management System",
    "termsOfService": "http://www.clarusway.com/#",
    "contact": {
      "name": "Clarusway",
      "email": "qadir@clarusway.com"
    },
    "license": {
      "name": "ISC Licence"
    }
  },
  "host": "stock-api-js.fullstack.clarusway.com",
  "basePath": "/",
  "schemes": [
    "https"
  ],
  "securityDefinitions": {
    "Token": {
      "in": "header",
      "type": "apiKey",
      "name": "Authorization",
      "description": "Token Authentication * Example: <b>Token ...tokenKey...</b>"
    },
    "Bearer": {
      "in": "header",
      "type": "apiKey",
      "name": "Authorization",
      "description": "JWT Authentication * Example: <b>Bearer ...accessToken...</b>"
    }
  },
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/auth/login": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Login",
        "description": "Login with username (or email) and password for get Token and JWT.",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "example": "test"
                },
                "password": {
                  "type": "string",
                  "example": "1234"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/auth/refresh": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "JWT: Refresh",
        "description": "Refresh access-token by refresh-token.",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "bearer": {
                  "type": "object",
                  "properties": {
                    "refresh": {
                      "type": "string",
                      "example": "___refreshToken___"
                    }
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/auth/logout": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Token: Logout",
        "description": "Delete token-key.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/users/": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "List Users",
        "description": "  You can use <u>filter[] & search[] & sort[] & page & limit</u> queries with endpoint.  <ul> Examples:   <li>URL/?<b>filter[field1]=value1&filter[field2]=value2</b></li>   <li>URL/?<b>search[field1]=value1&search[field2]=value2</b></li>   <li>URL/?<b>sort[field1]=asc&sort[field2]=desc</b></li>   <li>URL/?<b>limit=10&page=1</b></li>  </ul>  ",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Create User",
        "description": "",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "example": "test"
                },
                "password": {
                  "type": "string",
                  "example": "1234"
                },
                "email": {
                  "type": "string",
                  "example": "test@site.com"
                },
                "firstName": {
                  "type": "string",
                  "example": "test"
                },
                "lastName": {
                  "type": "string",
                  "example": "test"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/users/{id}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get Single User",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update User",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "example": "test"
                },
                "password": {
                  "type": "string",
                  "example": "1234"
                },
                "email": {
                  "type": "string",
                  "example": "test@site.com"
                },
                "firstName": {
                  "type": "string",
                  "example": "test"
                },
                "lastName": {
                  "type": "string",
                  "example": "test"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Delete User",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Users"
        ],
        "summary": "Update User",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "example": "test"
                },
                "password": {
                  "type": "string",
                  "example": "1234"
                },
                "email": {
                  "type": "string",
                  "example": "test@site.com"
                },
                "firstName": {
                  "type": "string",
                  "example": "test"
                },
                "lastName": {
                  "type": "string",
                  "example": "test"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/categories/": {
      "get": {
        "tags": [
          "Categories"
        ],
        "summary": "List Categories",
        "description": "  You can use <u>filter[] & search[] & sort[] & page & limit</u> queries with endpoint.  <ul> Examples:   <li>URL/?<b>filter[field1]=value1&filter[field2]=value2</b></li>   <li>URL/?<b>search[field1]=value1&search[field2]=value2</b></li>   <li>URL/?<b>sort[field1]=asc&sort[field2]=desc</b></li>   <li>URL/?<b>limit=10&page=1</b></li>  </ul>  ",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Categories"
        ],
        "summary": "Create Category",
        "description": "",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Category 1"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/categories/{id}": {
      "get": {
        "tags": [
          "Categories"
        ],
        "summary": "Get Single Category",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Categories"
        ],
        "summary": "Update Category",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Category 1"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "delete": {
        "tags": [
          "Categories"
        ],
        "summary": "Delete Category",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Categories"
        ],
        "summary": "Update Category",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Category 1"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/brands/": {
      "get": {
        "tags": [
          "Brands"
        ],
        "summary": "List Brands",
        "description": "  You can use <u>filter[] & search[] & sort[] & page & limit</u> queries with endpoint.  <ul> Examples:   <li>URL/?<b>filter[field1]=value1&filter[field2]=value2</b></li>   <li>URL/?<b>search[field1]=value1&search[field2]=value2</b></li>   <li>URL/?<b>sort[field1]=asc&sort[field2]=desc</b></li>   <li>URL/?<b>limit=10&page=1</b></li>  </ul>  ",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Brands"
        ],
        "summary": "Create Brand",
        "description": "",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Brand 1"
                },
                "image": {
                  "type": "string",
                  "example": "http://imageURL"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/brands/{id}": {
      "get": {
        "tags": [
          "Brands"
        ],
        "summary": "Get Single Brand",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Brands"
        ],
        "summary": "Update Brand",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Brand 1"
                },
                "image": {
                  "type": "string",
                  "example": "http://imageURL"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "delete": {
        "tags": [
          "Brands"
        ],
        "summary": "Delete Brand",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Brands"
        ],
        "summary": "Update Brand",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Brand 1"
                },
                "image": {
                  "type": "string",
                  "example": "http://imageURL"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/firms/": {
      "get": {
        "tags": [
          "Firms"
        ],
        "summary": "List Firms",
        "description": "  You can use <u>filter[] & search[] & sort[] & page & limit</u> queries with endpoint.  <ul> Examples:   <li>URL/?<b>filter[field1]=value1&filter[field2]=value2</b></li>   <li>URL/?<b>search[field1]=value1&search[field2]=value2</b></li>   <li>URL/?<b>sort[field1]=asc&sort[field2]=desc</b></li>   <li>URL/?<b>limit=10&page=1</b></li>  </ul>  ",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Firms"
        ],
        "summary": "Create Firm",
        "description": "",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Firm 1"
                },
                "phone": {
                  "type": "string",
                  "example": "999 88 77"
                },
                "address": {
                  "type": "string",
                  "example": "Address"
                },
                "image": {
                  "type": "string",
                  "example": "http://imageURL"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/firms/{id}": {
      "get": {
        "tags": [
          "Firms"
        ],
        "summary": "Get Single Firm",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Firms"
        ],
        "summary": "Update Firm",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Firm 1"
                },
                "phone": {
                  "type": "string",
                  "example": "999 88 77"
                },
                "address": {
                  "type": "string",
                  "example": "Address"
                },
                "image": {
                  "type": "string",
                  "example": "http://imageURL"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "delete": {
        "tags": [
          "Firms"
        ],
        "summary": "Delete Firm",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Firms"
        ],
        "summary": "Update Firm",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Firm 1"
                },
                "phone": {
                  "type": "string",
                  "example": "999 88 77"
                },
                "address": {
                  "type": "string",
                  "example": "Address"
                },
                "image": {
                  "type": "string",
                  "example": "http://imageURL"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/products/": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List Products",
        "description": "  You can use <u>filter[] & search[] & sort[] & page & limit</u> queries with endpoint.  <ul> Examples:   <li>URL/?<b>filter[field1]=value1&filter[field2]=value2</b></li>   <li>URL/?<b>search[field1]=value1&search[field2]=value2</b></li>   <li>URL/?<b>sort[field1]=asc&sort[field2]=desc</b></li>   <li>URL/?<b>limit=10&page=1</b></li>  </ul>  ",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Create Product",
        "description": "",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "categoryId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f203"
                },
                "brandId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f107"
                },
                "name": {
                  "type": "string",
                  "example": "Product 1"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/products/{id}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get Single Product",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Update Product",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "categoryId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f203"
                },
                "brandId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f107"
                },
                "name": {
                  "type": "string",
                  "example": "Product 1"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "delete": {
        "tags": [
          "Products"
        ],
        "summary": "Delete Product",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Products"
        ],
        "summary": "Update Product",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "categoryId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f203"
                },
                "brandId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f107"
                },
                "name": {
                  "type": "string",
                  "example": "Product 1"
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/purchases/": {
      "get": {
        "tags": [
          "Purchases"
        ],
        "summary": "List Purchases",
        "description": "  You can use <u>filter[] & search[] & sort[] & page & limit</u> queries with endpoint.  <ul> Examples:   <li>URL/?<b>filter[field1]=value1&filter[field2]=value2</b></li>   <li>URL/?<b>search[field1]=value1&search[field2]=value2</b></li>   <li>URL/?<b>sort[field1]=asc&sort[field2]=desc</b></li>   <li>URL/?<b>limit=10&page=1</b></li>  </ul>  ",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Purchases"
        ],
        "summary": "Create Purchase",
        "description": "",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "firmId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f304"
                },
                "brandId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f107"
                },
                "productId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f422"
                },
                "quantity": {
                  "type": "number",
                  "example": 1
                },
                "price": {
                  "type": "number",
                  "example": 9.99
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/purchases/{id}": {
      "get": {
        "tags": [
          "Purchases"
        ],
        "summary": "Get Single Purchase",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Purchases"
        ],
        "summary": "Update Purchase",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "firmId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f304"
                },
                "brandId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f107"
                },
                "productId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f422"
                },
                "quantity": {
                  "type": "number",
                  "example": 1
                },
                "price": {
                  "type": "number",
                  "example": 9.99
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "delete": {
        "tags": [
          "Purchases"
        ],
        "summary": "Delete Purchase",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Purchases"
        ],
        "summary": "Update Purchase",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "firmId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f304"
                },
                "brandId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f107"
                },
                "productId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f422"
                },
                "quantity": {
                  "type": "number",
                  "example": 1
                },
                "price": {
                  "type": "number",
                  "example": 9.99
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/sales/": {
      "get": {
        "tags": [
          "Sales"
        ],
        "summary": "List Sales",
        "description": "  You can use <u>filter[] & search[] & sort[] & page & limit</u> queries with endpoint.  <ul> Examples:   <li>URL/?<b>filter[field1]=value1&filter[field2]=value2</b></li>   <li>URL/?<b>search[field1]=value1&search[field2]=value2</b></li>   <li>URL/?<b>sort[field1]=asc&sort[field2]=desc</b></li>   <li>URL/?<b>limit=10&page=1</b></li>  </ul>  ",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Sales"
        ],
        "summary": "Create Sale",
        "description": "",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "brandId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f107"
                },
                "productId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f422"
                },
                "quantity": {
                  "type": "number",
                  "example": 1
                },
                "price": {
                  "type": "number",
                  "example": 9.99
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/sales/{id}": {
      "get": {
        "tags": [
          "Sales"
        ],
        "summary": "Get Single Sale",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Sales"
        ],
        "summary": "Update Sale",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "brandId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f107"
                },
                "productId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f422"
                },
                "quantity": {
                  "type": "number",
                  "example": 1
                },
                "price": {
                  "type": "number",
                  "example": 9.99
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      },
      "delete": {
        "tags": [
          "Sales"
        ],
        "summary": "Delete Sale",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found"
          }
        }
      },
      "patch": {
        "tags": [
          "Sales"
        ],
        "summary": "Update Sale",
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "brandId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f107"
                },
                "productId": {
                  "type": "string",
                  "example": "65343222b67e9681f937f422"
                },
                "quantity": {
                  "type": "number",
                  "example": 1
                },
                "price": {
                  "type": "number",
                  "example": 9.99
                }
              }
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    }
  },
  "definitions": {
    "User": {
      "type": "object",
      "properties": {
        "username": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "required": {
              "type": "boolean",
              "example": true
            },
            "unique": {
              "type": "boolean",
              "example": true
            },
            "index": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "password": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "email": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "required": {
              "type": "boolean",
              "example": true
            },
            "unique": {
              "type": "boolean",
              "example": true
            },
            "index": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "firstName": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "lastName": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "isActive": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "default": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "isStaff": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "default": {
              "type": "boolean",
              "example": false
            }
          }
        },
        "isAdmin": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "default": {
              "type": "boolean",
              "example": false
            }
          }
        }
      }
    },
    "Brand": {
      "type": "object",
      "properties": {
        "name": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "required": {
              "type": "boolean",
              "example": true
            },
            "unique": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "image": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "default": {
              "type": "string",
              "example": ""
            }
          }
        }
      }
    },
    "Category": {
      "type": "object",
      "properties": {
        "name": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "required": {
              "type": "boolean",
              "example": true
            },
            "unique": {
              "type": "boolean",
              "example": true
            }
          }
        }
      }
    },
    "Firm": {
      "type": "object",
      "properties": {
        "name": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "required": {
              "type": "boolean",
              "example": true
            },
            "unique": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "phone": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "address": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "image": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "default": {
              "type": "string",
              "example": ""
            }
          }
        }
      }
    },
    "Product": {
      "type": "object",
      "properties": {
        "categoryId": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "ref": {
              "type": "string",
              "example": "Category"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "brandId": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "ref": {
              "type": "string",
              "example": "Brand"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "name": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "trim": {
              "type": "boolean",
              "example": true
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "quantity": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "default": {
              "type": "number",
              "example": 0
            }
          }
        }
      }
    },
    "Purchase": {
      "type": "object",
      "properties": {
        "userId": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "ref": {
              "type": "string",
              "example": "User"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "firmId": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "ref": {
              "type": "string",
              "example": "Firm"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "brandId": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "ref": {
              "type": "string",
              "example": "Brand"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "productId": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "ref": {
              "type": "string",
              "example": "Product"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "quantity": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "default": {
              "type": "number",
              "example": 0
            }
          }
        },
        "price": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "default": {
              "type": "number",
              "example": 0
            }
          }
        },
        "amount": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "default": {
              "type": "function"
            },
            "transform": {
              "type": "function"
            }
          }
        }
      }
    },
    "Sale": {
      "type": "object",
      "properties": {
        "userId": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "ref": {
              "type": "string",
              "example": "User"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "brandId": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "ref": {
              "type": "string",
              "example": "Brand"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "productId": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "ref": {
              "type": "string",
              "example": "Product"
            },
            "required": {
              "type": "boolean",
              "example": true
            }
          }
        },
        "quantity": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "default": {
              "type": "number",
              "example": 0
            }
          }
        },
        "price": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "default": {
              "type": "number",
              "example": 0
            }
          }
        },
        "amount": {
          "type": "object",
          "properties": {
            "type": {
              "type": "function"
            },
            "default": {
              "type": "function"
            },
            "transform": {
              "type": "function"
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "Token": []
    },
    {
      "Bearer": []
    }
  ]
}