@@ -9,6 +9,10 @@ import { Authentication } from '../frameworks/shared/decorators/authentication.d
9
9
import { Authorization } from '../frameworks/shared/decorators/authorization.decorator' ;
10
10
import { Context } from '../frameworks/shared/decorators/context.decorator' ;
11
11
import { UseList } from '../frameworks/shared/decorators/uselist.decorator' ;
12
+ import {
13
+ FilterPaginationAuditQueryValidator ,
14
+ ListAuditSerializer ,
15
+ } from '../domain/entities/audit.entity' ;
12
16
13
17
/**
14
18
* ## Factory Messaging Controller Generator
@@ -35,14 +39,14 @@ export function MessagingControllerFactory<
35
39
name : string ,
36
40
messageType : string ,
37
41
rolePrefix : string ,
38
- filterPagination : Type ,
39
- filterCursor : Type ,
40
- getSerializer : Type ,
41
42
listSerializer : Type ,
43
+ listPaginationQuery : Type ,
44
+ listCursorQuery : Type ,
45
+ upsertSerializer : Type ,
42
46
createSerializer : Type ,
47
+ getSerializer : Type ,
43
48
updateSerializer : Type ,
44
49
deleteSerializer : Type ,
45
- upsertSerializer : Type ,
46
50
) {
47
51
class BaseMessagingController {
48
52
public _usecase : BaseUseCase ;
@@ -61,8 +65,8 @@ export function MessagingControllerFactory<
61
65
}
62
66
63
67
@MessagePattern ( SubjectFactory . buildSubject ( messageType , 'getAudits' ) )
64
- @UseList ( filterPagination )
65
- @ExtendedSerializer ( listSerializer )
68
+ @UseList ( FilterPaginationAuditQueryValidator )
69
+ @ExtendedSerializer ( ListAuditSerializer )
66
70
@Authentication ( true )
67
71
@Authorization ( `audit:read@auth` )
68
72
async getAudits ( @Context ( ) ctx : IContext ) {
@@ -81,7 +85,7 @@ export function MessagingControllerFactory<
81
85
}
82
86
83
87
@MessagePattern ( SubjectFactory . buildSubject ( messageType , 'listPagination' ) )
84
- @UseList ( filterPagination )
88
+ @UseList ( listPaginationQuery )
85
89
@ExtendedSerializer ( listSerializer )
86
90
@Authentication ( true )
87
91
@Authorization ( `${ rolePrefix } :read@auth` )
@@ -92,7 +96,7 @@ export function MessagingControllerFactory<
92
96
}
93
97
94
98
@MessagePattern ( SubjectFactory . buildSubject ( messageType , 'listCursor' ) )
95
- @UseList ( filterCursor )
99
+ @UseList ( listCursorQuery )
96
100
@ExtendedSerializer ( listSerializer )
97
101
@Authentication ( true )
98
102
@Authorization ( `${ rolePrefix } :read@auth` )
0 commit comments