From affed3ce562054e76230e78bb0f733f97f393cf1 Mon Sep 17 00:00:00 2001 From: Matthieu Haineault Date: Tue, 22 Jul 2025 08:11:08 -0400 Subject: [PATCH] fix(module): small fixes to module customers --- src/modules/customers/controllers/customers.controller.ts | 6 +++--- .../dtos/{create-customer.ts => create-customer.dto.ts} | 2 +- .../dtos/{update-customer.ts => update-customer.dto.ts} | 2 +- src/modules/customers/services/customers.service.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) rename src/modules/customers/dtos/{create-customer.ts => create-customer.dto.ts} (96%) rename src/modules/customers/dtos/{update-customer.ts => update-customer.dto.ts} (67%) diff --git a/src/modules/customers/controllers/customers.controller.ts b/src/modules/customers/controllers/customers.controller.ts index 7b32e9b..7ac87dd 100644 --- a/src/modules/customers/controllers/customers.controller.ts +++ b/src/modules/customers/controllers/customers.controller.ts @@ -1,8 +1,8 @@ import { Body, Controller, Delete, Get, Param, ParseIntPipe, Patch, Post } from '@nestjs/common'; import { CustomersService } from '../services/customers.service'; -import { Customers, Employees } from '@prisma/client'; -import { CreateCustomerDto } from '../dtos/create-customer'; -import { UpdateCustomerDto } from '../dtos/update-customer'; +import { Customers } from '@prisma/client'; +import { CreateCustomerDto } from '../dtos/create-customer.dto'; +import { UpdateCustomerDto } from '../dtos/update-customer.dto'; import { RolesAllowed } from "src/common/decorators/roles.decorators"; import { Roles as RoleEnum } from '.prisma/client'; diff --git a/src/modules/customers/dtos/create-customer.ts b/src/modules/customers/dtos/create-customer.dto.ts similarity index 96% rename from src/modules/customers/dtos/create-customer.ts rename to src/modules/customers/dtos/create-customer.dto.ts index 4ae03fe..f2d3fa9 100644 --- a/src/modules/customers/dtos/create-customer.ts +++ b/src/modules/customers/dtos/create-customer.dto.ts @@ -20,7 +20,7 @@ export class CreateCustomerDto { @IsEmail() @IsOptional() - email?: string; + email: string; @Type(() => Number) @IsInt() diff --git a/src/modules/customers/dtos/update-customer.ts b/src/modules/customers/dtos/update-customer.dto.ts similarity index 67% rename from src/modules/customers/dtos/update-customer.ts rename to src/modules/customers/dtos/update-customer.dto.ts index 0499fe2..fc1ba39 100644 --- a/src/modules/customers/dtos/update-customer.ts +++ b/src/modules/customers/dtos/update-customer.dto.ts @@ -1,4 +1,4 @@ import { PartialType } from "@nestjs/swagger"; -import { CreateCustomerDto } from "./create-customer"; +import { CreateCustomerDto } from "./create-customer.dto"; export class UpdateCustomerDto extends PartialType(CreateCustomerDto) {} \ No newline at end of file diff --git a/src/modules/customers/services/customers.service.ts b/src/modules/customers/services/customers.service.ts index f67f4bd..4f11bce 100644 --- a/src/modules/customers/services/customers.service.ts +++ b/src/modules/customers/services/customers.service.ts @@ -1,8 +1,8 @@ import { Injectable, NotFoundException } from '@nestjs/common'; import { PrismaService } from 'src/prisma/prisma.service'; -import { CreateCustomerDto } from '../dtos/create-customer'; +import { CreateCustomerDto } from '../dtos/create-customer.dto'; import { Customers, Users } from '@prisma/client'; -import { UpdateCustomerDto } from '../dtos/update-customer'; +import { UpdateCustomerDto } from '../dtos/update-customer.dto'; @Injectable() export class CustomersService {