CodeWithJay

Build an Orders API in NestJS: Nested Prisma Writes and Server-Side Totals E-10

24 min603 views

Build an Orders API in NestJS: Nested Prisma Writes and Server-Side Totals E-10

About this video

A store is not a store until someone can buy something. This episode builds orders, and it puts the money math where it belongs: on the server.

We migrate the Order and OrderItem models, build CreateOrderDto with nested validation, and write an OrdersService that computes totals server-side inside a single Prisma nested write, so an order and its items are created atomically. Ownership-checked reads round it out, all behind auth-guarded routes.

Subscribe to Code with Jay and keep going.

Keep learning NestJS

Every free video, mini course and project-based course on NestJS in one place, in the order that makes sense.

All videos