> For the complete documentation index, see [llms.txt](https://kinesis-school-of-programming.gitbook.io/nestjs-unleashed/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinesis-school-of-programming.gitbook.io/nestjs-unleashed/parallel-module-prisma/remaining-domain/models/category.md).

# Category

We'll now create the <mark style="color:blue;">`Category`</mark> model, following the same protocol.

```prisma
model Category {
  id Int @id @default(autoincrement())

  name String @unique

  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}
```

Then generate and run the migration, as the relations cannot be set yet.

```sh
yarn migrate:create create-category
yarn migrate:run
```

Create the categories resource

```sh
nest g res domain/categories
```

And perform the steps to finish its assembly

* Exclude the <mark style="color:purple;">entities</mark> folder
* In the **controller**, use the <mark style="color:blue;">`IdDto`</mark> wherever <mark style="color:blue;">`id`</mark> is being used
* Remove the **number conversion operator** (<mark style="color:blue;">`+`</mark>) below each occurrence
* Use <mark style="color:blue;">`PaginationDto`</mark> in the <mark style="color:blue;">`findAll()`</mark> method (and also in the **service**)
  * Default page size - 30

<mark style="color:green;">**Commit**</mark> - Creating category model
