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
@@ -61,8 +61,8 @@ export class TransmittalController {
@Get(':uuid')
@ApiOperation({ summary: 'Get Transmittal details' })
@ApiParam({
name: 'uuid',
description: 'Transmittal UUID (from correspondences.uuid)',
name: 'publicId',
description: 'Transmittal publicId (from correspondences.publicId)',
})
@RequirePermission('document.view')
findOne(@Param('uuid', ParseUuidPipe) uuid: string) {
@@ -159,16 +159,18 @@ export class TransmittalService {
}
/**
* ADR-019: Find Transmittal by parent Correspondence UUID (public identifier).
* Resolves correspondence.uuid → internal correspondenceId (INT)
* ADR-019: Find Transmittal by parent Correspondence publicId (public identifier).
* Resolves correspondence.publicId → internal correspondenceId (INT)
*/
async findOneByUuid(uuid: string): Promise<Transmittal> {
async findOneByUuid(publicId: string): Promise<Transmittal> {
const correspondence = await this.dataSource.manager.findOne(
Correspondence,
{ where: { uuid }, select: ['id'] }
{ where: { publicId }, select: ['id'] }
);
if (!correspondence) {
throw new NotFoundException(`Transmittal with UUID ${uuid} not found`);
throw new NotFoundException(
`Transmittal with publicId ${publicId} not found`
);
}
return this.findOne(correspondence.id);
}
@@ -218,10 +220,10 @@ export class TransmittalService {
.take(limit)
.getManyAndCount();
// ADR-019: Map correspondence.uuid to top level for frontend convenience
// ADR-019: Map correspondence.publicId to top level for frontend convenience
const mappedItems = items.map((t) => ({
...t,
uuid: t.correspondence?.uuid,
publicId: t.correspondence?.publicId,
}));
return {