# Product

With product it's the same process as category, we should copy and paste the **CreateDTO** and **Service**, it may be from the user again for example. However, we should make some changes:

* In the CreateDTO:
  * <mark style="color:blue;">`description`</mark> should receive <mark style="color:blue;">`@IsOptional()`</mark>
  * <mark style="color:blue;">`price`</mark> is a **positive number** with **two decimal places**, therefore we should use <mark style="color:blue;">`@IsNumber()`</mark> with the option <mark style="color:blue;">`maxDecimalPlaces`</mark>, and also <mark style="color:blue;">`@IsPositive()`</mark>
  * A product is created with **at least one** category, so we must use <mark style="color:blue;">`@ArrayNotEmpty()`</mark>, also categories should not repeat so we can use <mark style="color:blue;">`@ArrayUnique()`</mark>
* In the Service:
  * In <mark style="color:blue;">`findOne()`</mark>, also fetch its <mark style="color:blue;">`categories`</mark>

{% hint style="info" %}
You can create a decorator for validating the <mark style="color:blue;">`price`</mark> if you want, for example <mark style="color:blue;">`@IsCurrency()`</mark>.
{% endhint %}

However, you may have noticed that something was still not discussed. How do we validate the categories? How should they be shaped? In the next section, we'll learn two approaches for validating incoming data that represent entities.
