260326:1455 Fixing Refactor ADR-019 Naming convention uuid #02
CI / CD Pipeline / build (push) Failing after 16m2s
CI / CD Pipeline / deploy (push) Has been skipped

This commit is contained in:
admin
2026-03-26 14:55:55 +07:00
parent 1aff83214f
commit e97d0fa5ef
@@ -100,20 +100,18 @@ export class ContractService {
return contract; return contract;
} }
async findOneByPublicId(publicId: string) { async findOneByUuid(uuid: string) {
const contract = await this.contractRepo.findOne({ const contract = await this.contractRepo.findOne({
where: { publicId }, where: { publicId: uuid },
relations: ['project'], relations: ['project'],
}); });
if (!contract) if (!contract)
throw new NotFoundException( throw new NotFoundException(`Contract with UUID ${uuid} not found`);
`Contract with publicId ${publicId} not found`
);
return contract; return contract;
} }
async update(publicId: string, dto: UpdateContractDto) { async update(publicId: string, dto: UpdateContractDto) {
const contract = await this.findOneByPublicId(publicId); const contract = await this.findOneByUuid(publicId);
if (dto.projectId) { if (dto.projectId) {
dto.projectId = await this.uuidResolver.resolveProjectId(dto.projectId); dto.projectId = await this.uuidResolver.resolveProjectId(dto.projectId);
} }
@@ -122,7 +120,7 @@ export class ContractService {
} }
async remove(publicId: string) { async remove(publicId: string) {
const contract = await this.findOneByPublicId(publicId); const contract = await this.findOneByUuid(publicId);
return this.contractRepo.remove(contract); return this.contractRepo.remove(contract);
} }
} }