260326:1347 Fixing Refactor ADR-019 Naming convention uuid #01
CI / CD Pipeline / build (push) Failing after 17m29s
CI / CD Pipeline / deploy (push) Has been skipped

This commit is contained in:
admin
2026-03-26 13:47:07 +07:00
parent 978d66e49e
commit 1aff83214f
34 changed files with 217 additions and 222 deletions
@@ -100,18 +100,20 @@ export class ContractService {
return contract;
}
async findOneByUuid(uuid: string) {
async findOneByPublicId(publicId: string) {
const contract = await this.contractRepo.findOne({
where: { uuid },
where: { publicId },
relations: ['project'],
});
if (!contract)
throw new NotFoundException(`Contract UUID ${uuid} not found`);
throw new NotFoundException(
`Contract with publicId ${publicId} not found`
);
return contract;
}
async update(uuid: string, dto: UpdateContractDto) {
const contract = await this.findOneByUuid(uuid);
async update(publicId: string, dto: UpdateContractDto) {
const contract = await this.findOneByPublicId(publicId);
if (dto.projectId) {
dto.projectId = await this.uuidResolver.resolveProjectId(dto.projectId);
}
@@ -119,8 +121,8 @@ export class ContractService {
return this.contractRepo.save(contract);
}
async remove(uuid: string) {
const contract = await this.findOneByUuid(uuid);
async remove(publicId: string) {
const contract = await this.findOneByPublicId(publicId);
return this.contractRepo.remove(contract);
}
}