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
@@ -95,7 +95,7 @@ export class CirculationService {
}
async findAll(searchDto: SearchCirculationDto, user: User) {
const { status, correspondenceUuid, page = 1, limit = 20 } = searchDto;
const { status, correspondencePublicId, page = 1, limit = 20 } = searchDto;
const query = this.circulationRepo
.createQueryBuilder('c')
.leftJoinAndSelect('c.creator', 'creator')
@@ -103,9 +103,9 @@ export class CirculationService {
.leftJoinAndSelect('routings.assignee', 'assignee')
.leftJoinAndSelect('c.correspondence', 'correspondence');
if (correspondenceUuid) {
query.where('correspondence.uuid = :corrUuid', {
corrUuid: correspondenceUuid,
if (correspondencePublicId) {
query.where('correspondence.publicId = :corrPublicId', {
corrPublicId: correspondencePublicId,
});
} else {
query.where('c.organizationId = :orgId', {
@@ -136,14 +136,14 @@ export class CirculationService {
return circulation;
}
async findOneByUuid(uuid: string) {
async findOneByUuid(publicId: string) {
const circulation = await this.circulationRepo.findOne({
where: { uuid },
where: { publicId },
relations: ['routings', 'routings.assignee', 'correspondence', 'creator'],
order: { routings: { stepNumber: 'ASC' } },
});
if (!circulation)
throw new NotFoundException(`Circulation UUID ${uuid} not found`);
throw new NotFoundException(`Circulation publicId ${publicId} not found`);
return circulation;
}
@@ -8,7 +8,7 @@ export class SearchCirculationDto {
@IsOptional()
@IsUUID('all')
correspondenceUuid?: string; // กรองตาม correspondence UUID (ADR-019)
correspondencePublicId?: string; // กรองตาม correspondence publicId (ADR-019)
@IsOptional()
@IsString()