From e97d0fa5efbadff56c5c39bc760dc9047e96a36f Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 26 Mar 2026 14:55:55 +0700 Subject: [PATCH] 260326:1455 Fixing Refactor ADR-019 Naming convention uuid #02 --- backend/src/modules/contract/contract.service.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/backend/src/modules/contract/contract.service.ts b/backend/src/modules/contract/contract.service.ts index 97ead7b..4d01044 100644 --- a/backend/src/modules/contract/contract.service.ts +++ b/backend/src/modules/contract/contract.service.ts @@ -100,20 +100,18 @@ export class ContractService { return contract; } - async findOneByPublicId(publicId: string) { + async findOneByUuid(uuid: string) { const contract = await this.contractRepo.findOne({ - where: { publicId }, + where: { publicId: uuid }, relations: ['project'], }); if (!contract) - throw new NotFoundException( - `Contract with publicId ${publicId} not found` - ); + throw new NotFoundException(`Contract with UUID ${uuid} not found`); return contract; } async update(publicId: string, dto: UpdateContractDto) { - const contract = await this.findOneByPublicId(publicId); + const contract = await this.findOneByUuid(publicId); if (dto.projectId) { dto.projectId = await this.uuidResolver.resolveProjectId(dto.projectId); } @@ -122,7 +120,7 @@ export class ContractService { } async remove(publicId: string) { - const contract = await this.findOneByPublicId(publicId); + const contract = await this.findOneByUuid(publicId); return this.contractRepo.remove(contract); } }