Skip to content

Commit 153d690

Browse files
committed
fix: messaging factory
1 parent 855019f commit 153d690

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/infrastructure/factory-messaging.controller.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import { Authentication } from '../frameworks/shared/decorators/authentication.d
99
import { Authorization } from '../frameworks/shared/decorators/authorization.decorator';
1010
import { Context } from '../frameworks/shared/decorators/context.decorator';
1111
import { UseList } from '../frameworks/shared/decorators/uselist.decorator';
12+
import {
13+
FilterPaginationAuditQueryValidator,
14+
ListAuditSerializer,
15+
} from '../domain/entities/audit.entity';
1216

1317
/**
1418
* ## Factory Messaging Controller Generator
@@ -35,14 +39,14 @@ export function MessagingControllerFactory<
3539
name: string,
3640
messageType: string,
3741
rolePrefix: string,
38-
filterPagination: Type,
39-
filterCursor: Type,
40-
getSerializer: Type,
4142
listSerializer: Type,
43+
listPaginationQuery: Type,
44+
listCursorQuery: Type,
45+
upsertSerializer: Type,
4246
createSerializer: Type,
47+
getSerializer: Type,
4348
updateSerializer: Type,
4449
deleteSerializer: Type,
45-
upsertSerializer: Type,
4650
) {
4751
class BaseMessagingController {
4852
public _usecase: BaseUseCase;
@@ -61,8 +65,8 @@ export function MessagingControllerFactory<
6165
}
6266

6367
@MessagePattern(SubjectFactory.buildSubject(messageType, 'getAudits'))
64-
@UseList(filterPagination)
65-
@ExtendedSerializer(listSerializer)
68+
@UseList(FilterPaginationAuditQueryValidator)
69+
@ExtendedSerializer(ListAuditSerializer)
6670
@Authentication(true)
6771
@Authorization(`audit:read@auth`)
6872
async getAudits(@Context() ctx: IContext) {
@@ -81,7 +85,7 @@ export function MessagingControllerFactory<
8185
}
8286

8387
@MessagePattern(SubjectFactory.buildSubject(messageType, 'listPagination'))
84-
@UseList(filterPagination)
88+
@UseList(listPaginationQuery)
8589
@ExtendedSerializer(listSerializer)
8690
@Authentication(true)
8791
@Authorization(`${rolePrefix}:read@auth`)
@@ -92,7 +96,7 @@ export function MessagingControllerFactory<
9296
}
9397

9498
@MessagePattern(SubjectFactory.buildSubject(messageType, 'listCursor'))
95-
@UseList(filterCursor)
99+
@UseList(listCursorQuery)
96100
@ExtendedSerializer(listSerializer)
97101
@Authentication(true)
98102
@Authorization(`${rolePrefix}:read@auth`)

0 commit comments

Comments
 (0)