> For the complete documentation index, see [llms.txt](https://sayyidkhan92.gitbook.io/fashionshopdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sayyidkhan92.gitbook.io/fashionshopdocs/api/api-documentation/dto-used-in-the-application.md).

# DTO used in the Application

This page aims to list all the DTO used in the Application.

## **ProductDTO**

**ProductDTO is what developers will receive when using a GET request on the product API. The data resembles the same structure as the class object which is stored in the backend and database.**

```
{
  "id" : 1,
  "name": "string",
  "description": "string",
  "price": 0
}
```

**ProductDTO Schema Detail:**

| Key           | Datatype | Description                                                                                                              |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------ |
| id            | number   | the ID of the product                                                                                                    |
| name\*        | string   | the title of the product                                                                                                 |
| description\* | string   | the description describing the category of the product which it falls under                                              |
| price\*       | number   | <p>minimum: 0<br>maximum: 9999<br>default: 0</p><p>the price of the product, accepts a number up to 2 decimal points</p> |

## **CreateProductDTO**

**CreateProductDTO is used to insert a new record into the database.**

```
{
  "name": "string",
  "description": "string",
  "price": 0
}
```

**CreateProductDTO Schema Detail:**

| Key           | Datatype | Description                                                                                                              |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------ |
| name\*        | string   | the title of the product                                                                                                 |
| description\* | string   | the description describing the category of the product which it falls under                                              |
| price\*       | number   | <p>minimum: 0<br>maximum: 9999<br>default: 0</p><p>the price of the product, accepts a number up to 2 decimal points</p> |

## **PaginationProductDTO**

**PaginationProductDTO is used when pagination is required for the product records retrieved from the GET Request.**

```
{
  "name": "string",
  "description": "string",
  "price": 0
}
```

**PaginationProductDTO Schema Detail:**

| Key           | Datatype   | Description                                                                           |
| ------------- | ---------- | ------------------------------------------------------------------------------------- |
| currentPage\* | number     | <p>default: 1</p><p>returns the current page</p>                                      |
| itemPerPage\* | number     | <p>minimum: 10<br>maximum: 100<br>default: 50</p><p>returns the itemPerPage limit</p> |
| totalItems\*  | number     | <p>default: 1</p><p>returns the total number of items in the records retrieved</p>    |
| totalPages\*  | number     | <p>default: 1</p><p>returns the total number of pages created</p>                     |
| data\*        | ProductDTO | retrieve a list of ProductDTO for the current page                                    |

All data with an asterisk \* basically means the data is not null and required to be initialised with a value at the point of data creation.&#x20;
