@volontariapp/domain-post 3.7.0-snap-7f96a1f → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +247 -1
  2. package/dist/constants/index.d.ts +2 -0
  3. package/dist/constants/index.d.ts.map +1 -0
  4. package/dist/constants/index.js +2 -0
  5. package/dist/constants/index.js.map +1 -0
  6. package/dist/constants/post.constants.d.ts +2 -0
  7. package/dist/constants/post.constants.d.ts.map +1 -0
  8. package/dist/constants/post.constants.js +2 -0
  9. package/dist/constants/post.constants.js.map +1 -0
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +1 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/models/post.model.d.ts +0 -1
  15. package/dist/models/post.model.d.ts.map +1 -1
  16. package/dist/models/post.model.js +0 -6
  17. package/dist/models/post.model.js.map +1 -1
  18. package/dist/repositories/interfaces/comment.repository.d.ts +3 -2
  19. package/dist/repositories/interfaces/comment.repository.d.ts.map +1 -1
  20. package/dist/repositories/interfaces/post.repository.d.ts +1 -2
  21. package/dist/repositories/interfaces/post.repository.d.ts.map +1 -1
  22. package/dist/repositories/postgres-comment.repository.d.ts +3 -2
  23. package/dist/repositories/postgres-comment.repository.d.ts.map +1 -1
  24. package/dist/repositories/postgres-comment.repository.js +58 -11
  25. package/dist/repositories/postgres-comment.repository.js.map +1 -1
  26. package/dist/repositories/postgres-post.repository.d.ts +1 -2
  27. package/dist/repositories/postgres-post.repository.d.ts.map +1 -1
  28. package/dist/repositories/postgres-post.repository.js +18 -12
  29. package/dist/repositories/postgres-post.repository.js.map +1 -1
  30. package/dist/services/comment.service.d.ts +1 -0
  31. package/dist/services/comment.service.d.ts.map +1 -1
  32. package/dist/services/comment.service.js +17 -2
  33. package/dist/services/comment.service.js.map +1 -1
  34. package/dist/services/post.service.d.ts +2 -4
  35. package/dist/services/post.service.d.ts.map +1 -1
  36. package/dist/services/post.service.js +9 -19
  37. package/dist/services/post.service.js.map +1 -1
  38. package/dist/test/__test-utils__/mocks/post.repository.mock.d.ts.map +1 -1
  39. package/dist/test/__test-utils__/mocks/post.repository.mock.js +2 -0
  40. package/dist/test/__test-utils__/mocks/post.repository.mock.js.map +1 -1
  41. package/dist/test/integration/comment.repository.int.spec.js +55 -0
  42. package/dist/test/integration/comment.repository.int.spec.js.map +1 -1
  43. package/dist/test/integration/post.repository.int.spec.js +3 -1
  44. package/dist/test/integration/post.repository.int.spec.js.map +1 -1
  45. package/dist/test/unit/comment.service.unit.spec.js +18 -0
  46. package/dist/test/unit/comment.service.unit.spec.js.map +1 -1
  47. package/dist/test/unit/post.service.unit.spec.js +14 -0
  48. package/dist/test/unit/post.service.unit.spec.js.map +1 -1
  49. package/package.json +8 -8
  50. package/dist/test/migrations/domain/1780932284667-AddEventIdToPost.d.ts +0 -7
  51. package/dist/test/migrations/domain/1780932284667-AddEventIdToPost.d.ts.map +0 -1
  52. package/dist/test/migrations/domain/1780932284667-AddEventIdToPost.js +0 -12
  53. package/dist/test/migrations/domain/1780932284667-AddEventIdToPost.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -4,7 +4,253 @@
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - Added eventId column to postModel, and added methods to remove posts from an eventId
7
+ - Domain purge and completion contract updates for two-step user account deletion:
8
+ - shared: export DELETED_USER_ID sentinel (UUID v4) and USER_DELETION_SUCCESS completion stream in UserStream.
9
+ - messaging: reference USER_DELETION_SUCCESS and USER_DELETION_SUCCESSFULL in SAGA_GATHER_COMPLETION_MAPPING.USER_DELETION.
10
+ - domain-social: add idempotent purgeUser to ISocialUserRepository, Neo4jSocialUserRepository, and SocialUserService.
11
+ - domain-post: add purgePostsByAuthor to IPostRepository/PostgresPostRepository/PostService, anonymizeCommentsByAuthor to ICommentRepository/PostgresCommentRepository/CommentService, and export DELETED_COMMENT_PLACEHOLDER.
12
+ - domain-event: add deleteAllByOrganizerWithEventDeleted to IEventRepository/PostgresEventRepository and deleteAllByOrganizer to EventService with event.deleted outbox re-emission.
13
+ - domain-storage: add markFilesForDeletionByOwner to IFileRepository and PostgresFileRepository.
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies []:
18
+ - @volontariapp/messaging@2.23.1
19
+ - @volontariapp/database@3.4.31
20
+ - @volontariapp/outbox@0.9.68
21
+
22
+ ## 3.6.38
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies []:
27
+ - @volontariapp/messaging@2.23.0
28
+ - @volontariapp/database@3.4.30
29
+ - @volontariapp/outbox@0.9.67
30
+
31
+ ## 3.6.37
32
+
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies []:
36
+ - @volontariapp/messaging@2.22.0
37
+ - @volontariapp/database@3.4.29
38
+ - @volontariapp/outbox@0.9.66
39
+
40
+ ## 3.6.36
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies []:
45
+ - @volontariapp/messaging@2.21.0
46
+ - @volontariapp/database@3.4.28
47
+ - @volontariapp/outbox@0.9.65
48
+
49
+ ## 3.6.35
50
+
51
+ ### Patch Changes
52
+
53
+ - Updated dependencies []:
54
+ - @volontariapp/messaging@2.20.1
55
+ - @volontariapp/database@3.4.27
56
+ - @volontariapp/outbox@0.9.64
57
+
58
+ ## 3.6.34
59
+
60
+ ### Patch Changes
61
+
62
+ - Updated dependencies []:
63
+ - @volontariapp/messaging@2.20.0
64
+ - @volontariapp/database@3.4.26
65
+ - @volontariapp/outbox@0.9.63
66
+
67
+ ## 3.6.33
68
+
69
+ ### Patch Changes
70
+
71
+ - Updated dependencies []:
72
+ - @volontariapp/logger@0.3.0
73
+ - @volontariapp/contracts@4.3.14
74
+ - @volontariapp/database@3.4.25
75
+ - @volontariapp/errors@0.6.3
76
+ - @volontariapp/errors-nest@0.13.3
77
+ - @volontariapp/outbox@0.9.62
78
+ - @volontariapp/messaging@2.19.1
79
+
80
+ ## 3.6.32
81
+
82
+ ### Patch Changes
83
+
84
+ - Emitter adapted to the enriched `post.created` payload of `@volontariapp/messaging` 2.19.0: it now carries `userId` (the author) and `fileIds`. `fileIds` is always `[]` for now, because `PostEntity` does not carry media yet: it is relayed by the domain-post ticket 1.15 (provided id, `post_media`, idempotent creation). Until then no image can be attached asynchronously from `post.created`, so the gateway must not relay `fileIds` before 1.15 is released.
85
+
86
+ - Updated dependencies []:
87
+ - @volontariapp/messaging@2.19.0
88
+ - @volontariapp/database@3.4.24
89
+ - @volontariapp/outbox@0.9.61
90
+
91
+ ## 3.6.31
92
+
93
+ ### Patch Changes
94
+
95
+ - Updated dependencies []:
96
+ - @volontariapp/messaging@2.18.0
97
+ - @volontariapp/database@3.4.23
98
+ - @volontariapp/outbox@0.9.60
99
+
100
+ ## 3.6.30
101
+
102
+ ### Patch Changes
103
+
104
+ - Updated dependencies []:
105
+ - @volontariapp/contracts@4.3.13
106
+ - @volontariapp/messaging@2.17.6
107
+ - @volontariapp/database@3.4.22
108
+ - @volontariapp/outbox@0.9.59
109
+
110
+ ## 3.6.29
111
+
112
+ ### Patch Changes
113
+
114
+ - Updated dependencies []:
115
+ - @volontariapp/contracts@4.3.12
116
+ - @volontariapp/messaging@2.17.5
117
+ - @volontariapp/database@3.4.21
118
+ - @volontariapp/outbox@0.9.58
119
+
120
+ ## 3.6.28
121
+
122
+ ### Patch Changes
123
+
124
+ - Updated dependencies []:
125
+ - @volontariapp/contracts@4.3.11
126
+ - @volontariapp/messaging@2.17.4
127
+ - @volontariapp/database@3.4.20
128
+ - @volontariapp/outbox@0.9.57
129
+
130
+ ## 3.6.27
131
+
132
+ ### Patch Changes
133
+
134
+ - Updated dependencies []:
135
+ - @volontariapp/contracts@4.3.10
136
+ - @volontariapp/messaging@2.17.3
137
+ - @volontariapp/database@3.4.19
138
+ - @volontariapp/outbox@0.9.56
139
+
140
+ ## 3.6.26
141
+
142
+ ### Patch Changes
143
+
144
+ - Updated dependencies []:
145
+ - @volontariapp/contracts@4.3.9
146
+ - @volontariapp/messaging@2.17.2
147
+ - @volontariapp/database@3.4.18
148
+ - @volontariapp/outbox@0.9.55
149
+
150
+ ## 3.6.25
151
+
152
+ ### Patch Changes
153
+
154
+ - Updated dependencies []:
155
+ - @volontariapp/contracts@4.3.8
156
+ - @volontariapp/messaging@2.17.1
157
+ - @volontariapp/database@3.4.17
158
+ - @volontariapp/outbox@0.9.54
159
+
160
+ ## 3.6.24
161
+
162
+ ### Patch Changes
163
+
164
+ - Updated dependencies []:
165
+ - @volontariapp/messaging@2.17.0
166
+ - @volontariapp/database@3.4.16
167
+ - @volontariapp/outbox@0.9.53
168
+
169
+ ## 3.6.23
170
+
171
+ ### Patch Changes
172
+
173
+ - Updated dependencies []:
174
+ - @volontariapp/contracts@4.3.7
175
+ - @volontariapp/messaging@2.16.0
176
+ - @volontariapp/database@3.4.15
177
+ - @volontariapp/outbox@0.9.52
178
+
179
+ ## 3.6.22
180
+
181
+ ### Patch Changes
182
+
183
+ - Updated dependencies []:
184
+ - @volontariapp/database@3.4.14
185
+ - @volontariapp/messaging@2.15.1
186
+ - @volontariapp/outbox@0.9.51
187
+
188
+ ## 3.6.21
189
+
190
+ ### Patch Changes
191
+
192
+ - Updated dependencies []:
193
+ - @volontariapp/messaging@2.15.0
194
+ - @volontariapp/database@3.4.13
195
+ - @volontariapp/outbox@0.9.50
196
+
197
+ ## 3.6.20
198
+
199
+ ### Patch Changes
200
+
201
+ - Updated dependencies []:
202
+ - @volontariapp/messaging@2.14.0
203
+ - @volontariapp/database@3.4.12
204
+ - @volontariapp/outbox@0.9.49
205
+
206
+ ## 3.6.19
207
+
208
+ ### Patch Changes
209
+
210
+ - Updated dependencies []:
211
+ - @volontariapp/contracts@4.3.6
212
+ - @volontariapp/messaging@2.13.2
213
+ - @volontariapp/database@3.4.11
214
+ - @volontariapp/outbox@0.9.48
215
+
216
+ ## 3.6.18
217
+
218
+ ### Patch Changes
219
+
220
+ - Updated dependencies []:
221
+ - @volontariapp/contracts@4.3.5
222
+ - @volontariapp/messaging@2.13.1
223
+ - @volontariapp/database@3.4.10
224
+ - @volontariapp/outbox@0.9.47
225
+
226
+ ## 3.6.17
227
+
228
+ ### Patch Changes
229
+
230
+ - Updated dependencies []:
231
+ - @volontariapp/messaging@2.13.0
232
+ - @volontariapp/database@3.4.9
233
+ - @volontariapp/outbox@0.9.46
234
+
235
+ ## 3.6.16
236
+
237
+ ### Patch Changes
238
+
239
+ - delete comment, creation comment event
240
+
241
+ - Updated dependencies []:
242
+ - @volontariapp/database@3.4.8
243
+ - @volontariapp/messaging@2.12.1
244
+ - @volontariapp/outbox@0.9.45
245
+
246
+ ## 3.6.15
247
+
248
+ ### Patch Changes
249
+
250
+ - Updated dependencies []:
251
+ - @volontariapp/messaging@2.11.0
252
+ - @volontariapp/database@3.4.7
253
+ - @volontariapp/outbox@0.9.44
8
254
 
9
255
  ## 3.6.14
10
256
 
@@ -0,0 +1,2 @@
1
+ export * from './post.constants.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './post.constants.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const DELETED_COMMENT_PLACEHOLDER = "Commentaire supprim\u00E9";
2
+ //# sourceMappingURL=post.constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post.constants.d.ts","sourceRoot":"","sources":["../../src/constants/post.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,8BAAyB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const DELETED_COMMENT_PLACEHOLDER = 'Commentaire supprimé';
2
+ //# sourceMappingURL=post.constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post.constants.js","sourceRoot":"","sources":["../../src/constants/post.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG,sBAAsB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,4 +2,5 @@ export * from './entities/index.js';
2
2
  export * from './models/index.js';
3
3
  export * from './services/index.js';
4
4
  export * from './repositories/index.js';
5
+ export * from './constants/index.js';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -3,5 +3,6 @@ export * from './entities/index.js';
3
3
  export * from './models/index.js';
4
4
  export * from './services/index.js';
5
5
  export * from './repositories/index.js';
6
+ export * from './constants/index.js';
6
7
  registerPostMappings();
7
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AAExC,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AAErC,oBAAoB,EAAE,CAAC"}
@@ -2,7 +2,6 @@ import { SagaStatus } from '@volontariapp/shared';
2
2
  export declare class PostModel {
3
3
  id: string;
4
4
  authorId: string;
5
- eventId?: string;
6
5
  title: string;
7
6
  content: string;
8
7
  createdAt: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"post.model.d.ts","sourceRoot":"","sources":["../../src/models/post.model.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,qBACa,SAAS;IAEpB,EAAE,EAAG,MAAM,CAAC;IAGZ,QAAQ,EAAG,MAAM,CAAC;IAIlB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,KAAK,EAAG,MAAM,CAAC;IAGf,OAAO,EAAG,MAAM,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;IAQjB,WAAW,EAAG,UAAU,CAAC;CAC1B"}
1
+ {"version":3,"file":"post.model.d.ts","sourceRoot":"","sources":["../../src/models/post.model.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,qBACa,SAAS;IAEpB,EAAE,EAAG,MAAM,CAAC;IAGZ,QAAQ,EAAG,MAAM,CAAC;IAGlB,KAAK,EAAG,MAAM,CAAC;IAGf,OAAO,EAAG,MAAM,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,IAAI,CAAC;IAQjB,WAAW,EAAG,UAAU,CAAC;CAC1B"}
@@ -12,7 +12,6 @@ import { SagaStatus } from '@volontariapp/shared';
12
12
  let PostModel = class PostModel {
13
13
  id;
14
14
  authorId;
15
- eventId;
16
15
  title;
17
16
  content;
18
17
  createdAt;
@@ -27,11 +26,6 @@ __decorate([
27
26
  Column({ type: 'uuid' }),
28
27
  __metadata("design:type", String)
29
28
  ], PostModel.prototype, "authorId", void 0);
30
- __decorate([
31
- Index(),
32
- Column({ type: 'uuid', nullable: true }),
33
- __metadata("design:type", String)
34
- ], PostModel.prototype, "eventId", void 0);
35
29
  __decorate([
36
30
  Column({ type: 'varchar', length: 255, unique: true }),
37
31
  __metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":"post.model.js","sourceRoot":"","sources":["../../src/models/post.model.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,MAAM,EACN,sBAAsB,EACtB,MAAM,EACN,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,GACN,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAG3C,IAAM,SAAS,GAAf,MAAM,SAAS;IAEpB,EAAE,CAAU;IAGZ,QAAQ,CAAU;IAIlB,OAAO,CAAU;IAGjB,KAAK,CAAU;IAGf,OAAO,CAAU;IAGjB,SAAS,CAAQ;IAGjB,SAAS,CAAQ;IAQjB,WAAW,CAAc;CAC1B,CAAA;AA5BC;IADC,sBAAsB,CAAC,MAAM,CAAC;;qCACnB;AAGZ;IADC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACP;AAIlB;IAFC,KAAK,EAAE;IACP,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACxB;AAGjB;IADC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;wCACxC;AAGf;IADC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;0CACxB;AAGjB;IADC,gBAAgB,EAA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5B,CAAC;IACD,KAAK,EAAE;;8CACiB;AAzBd,SAAS;IADrB,MAAM,CAAC,OAAO,CAAC;GACH,SAAS,CA0BrB"}
@@ -3,10 +3,11 @@ import type { CommentEntity } from '../../entities/index.js';
3
3
  export interface ICommentRepository {
4
4
  findById(id: string): Promise<CommentEntity | null>;
5
5
  create(data: Partial<CommentEntity>): Promise<CommentEntity>;
6
+ createWithCommentCreated(data: Partial<CommentEntity>): Promise<CommentEntity>;
6
7
  update(id: string, data: Partial<CommentEntity>): Promise<CommentEntity | null>;
7
8
  delete(id: string): Promise<boolean>;
8
- deleteByPostId(postId: string): Promise<number>;
9
- deleteByPostIds(postIds: string[]): Promise<number>;
9
+ deleteWithCommentDeleted(id: string): Promise<boolean>;
10
10
  listPaginatedByPostId(postId: string, page: number, limit: number): Promise<PaginatedResult<CommentEntity>>;
11
+ anonymizeCommentsByAuthor(authorId: string): Promise<number>;
11
12
  }
12
13
  //# sourceMappingURL=comment.repository.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"comment.repository.d.ts","sourceRoot":"","sources":["../../../src/repositories/interfaces/comment.repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IACpD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7D,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAChF,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrC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AQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9D"}
@@ -10,9 +10,8 @@ export interface IPostRepository {
10
10
  delete(id: string): Promise<boolean>;
11
11
  deleteWithPostDeleted(id: string): Promise<boolean>;
12
12
  deleteByAuthorId(authorId: string): Promise<number>;
13
- findByEventId(eventId: string): Promise<PostEntity[]>;
14
- deleteByEventId(eventId: string): Promise<number>;
15
13
  search(searchTerm: string): Promise<PostEntity[]>;
16
14
  listPaginated(page: number, limit: number, authorId?: string): Promise<PaginatedResult<PostEntity>>;
15
+ purgePostsByAuthor(authorId: string): Promise<number>;
17
16
  }
18
17
  //# sourceMappingURL=post.repository.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"post.repository.d.ts","sourceRoot":"","sources":["../../../src/repositories/interfaces/post.repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAClD,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IACrD,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACxD,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACtE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;I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AG,OAAO,CAAC,UAAU,CAAC,CAAC;IACtE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAC1E,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrC,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACpD,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAClD,aAAa,CACX,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC;IACxC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACvD"}
@@ -5,8 +5,9 @@ import { CommentEntity } from '../entities/index.js';
5
5
  import { ICommentRepository } from './interfaces/index.js';
6
6
  export declare class PostgresCommentRepository extends BaseRepository<CommentModel, CommentEntity> implements ICommentRepository {
7
7
  constructor(repository: Repository<CommentModel>);
8
- deleteByPostId(postId: string): Promise<number>;
9
- deleteByPostIds(postIds: string[]): Promise<number>;
10
8
  listPaginatedByPostId(postId: string, page: number, limit: number): Promise<PaginatedResult<CommentEntity>>;
9
+ createWithCommentCreated(data: Partial<CommentEntity>): Promise<CommentEntity>;
10
+ deleteWithCommentDeleted(id: string): Promise<boolean>;
11
+ anonymizeCommentsByAuthor(authorId: string): Promise<number>;
11
12
  }
12
13
  //# sourceMappingURL=postgres-comment.repository.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-comment.repository.d.ts","sourceRoot":"","sources":["../../src/repositories/postgres-comment.repository.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAM,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,qBACa,yBACX,SAAQ,cAAc,CAAC,YAAY,EAAE,aAAa,CAClD,YAAW,kBAAkB;gBAI3B,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC;IAKhC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK/C,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAMnD,qBAAqB,CACzB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;CAS3C"}
1
+ {"version":3,"file":"postgres-comment.repository.d.ts","sourceRoot":"","sources":["../../src/repositories/postgres-comment.repository.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EACL,cAAc,EACd,eAAe,EAGhB,MAAM,wBAAwB,CAAC;AAShC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,qBACa,yBACX,SAAQ,cAAc,CAAC,YAAY,EAAE,aAAa,CAClD,YAAW,kBAAkB;gBAI3B,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC;IAKhC,qBAAqB,CACzB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;IAUpC,wBAAwB,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAgC9E,wBAAwB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAgCtD,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAUnE"}
@@ -12,29 +12,76 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  };
13
13
  import { Injectable } from '@nestjs/common';
14
14
  import { InjectRepository } from '@nestjs/typeorm';
15
- import { BaseRepository, In } from '@volontariapp/database';
15
+ import { BaseRepository, EventQueueEntity, EventQueueModel, } from '@volontariapp/database';
16
+ import { EventQueueRepository } from '@volontariapp/outbox';
17
+ import { Streams, DELETED_USER_ID } from '@volontariapp/shared';
18
+ import { PostEventMessagingType, } from '@volontariapp/messaging';
19
+ import { DELETED_COMMENT_PLACEHOLDER } from '../constants/index.js';
16
20
  import { CommentModel } from '../models/index.js';
17
21
  import { CommentEntity } from '../entities/index.js';
18
22
  let PostgresCommentRepository = class PostgresCommentRepository extends BaseRepository {
19
23
  constructor(repository) {
20
24
  super(repository, CommentEntity, CommentModel);
21
25
  }
22
- async deleteByPostId(postId) {
23
- const result = await super.deleteWhere({ postId });
24
- return result.affected ?? 0;
25
- }
26
- async deleteByPostIds(postIds) {
27
- if (postIds.length === 0)
28
- return 0;
29
- const result = await this.repository.delete({ postId: In(postIds) });
30
- return result.affected ?? 0;
31
- }
32
26
  async listPaginatedByPostId(postId, page, limit) {
33
27
  return super.paginate({ page, limit }, {
34
28
  where: { postId },
35
29
  order: { createdAt: 'DESC' },
36
30
  });
37
31
  }
32
+ async createWithCommentCreated(data) {
33
+ return this.executeInTransaction(async (queryRunner) => {
34
+ const modelData = this.toModel(data);
35
+ const commentModel = queryRunner.manager.create(this.modelClass, modelData);
36
+ const savedCommentModel = await queryRunner.manager.save(this.modelClass, commentModel);
37
+ const savedCommentEntity = this.toEntity(savedCommentModel);
38
+ const payload = {
39
+ commentId: savedCommentEntity.id,
40
+ postId: savedCommentEntity.postId,
41
+ authorId: savedCommentEntity.authorId,
42
+ };
43
+ const eventQueueEntity = EventQueueEntity.createEvent({
44
+ type: PostEventMessagingType.COMMENT_CREATED,
45
+ emitter: 'ms-post',
46
+ emitterId: savedCommentEntity.authorId,
47
+ payload,
48
+ targetServices: [Streams.COMMENT_CREATED],
49
+ });
50
+ const eventQueueRepo = new EventQueueRepository(queryRunner.manager.getRepository(EventQueueModel));
51
+ await eventQueueRepo.create(eventQueueEntity);
52
+ return savedCommentEntity;
53
+ });
54
+ }
55
+ async deleteWithCommentDeleted(id) {
56
+ return this.executeInTransaction(async (queryRunner) => {
57
+ const model = await queryRunner.manager.findOne(this.modelClass, { where: { id } });
58
+ const entity = model ? this.toEntity(model) : null;
59
+ if (!entity)
60
+ return false;
61
+ await queryRunner.manager.delete(this.modelClass, id);
62
+ const payload = {
63
+ commentId: entity.id,
64
+ postId: entity.postId,
65
+ };
66
+ const eventQueueEntity = EventQueueEntity.createEvent({
67
+ type: PostEventMessagingType.COMMENT_DELETED,
68
+ emitter: 'ms-post',
69
+ emitterId: entity.authorId,
70
+ payload,
71
+ targetServices: [Streams.COMMENT_DELETED],
72
+ });
73
+ const eventQueueRepo = new EventQueueRepository(queryRunner.manager.getRepository(EventQueueModel));
74
+ await eventQueueRepo.create(eventQueueEntity);
75
+ return true;
76
+ });
77
+ }
78
+ async anonymizeCommentsByAuthor(authorId) {
79
+ const result = await super.updateWhere({ authorId }, {
80
+ authorId: DELETED_USER_ID,
81
+ content: DELETED_COMMENT_PLACEHOLDER,
82
+ });
83
+ return result.affected ?? 0;
84
+ }
38
85
  };
39
86
  PostgresCommentRepository = __decorate([
40
87
  Injectable(),
@@ -1 +1 @@
1
- {"version":3,"file":"postgres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nCY,yBAAyB;IADrC,UAAU,EAAE;IAMR,WAAA,gBAAgB,CAAC,YAAY,CAAC,CAAA;;GALtB,yBAAyB,CAmCrC"}
1
+ {"version":3,"file":"postgres-comment.repository.js","sourceRoot":"","sources":["../../src/repositories/postgres-comment.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EACL,cAAc,EAEd,gBAAgB,EAChB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EACL,sBAAsB,GAGvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI9C,IAAM,yBAAyB,GAA/B,MAAM,yBACX,SAAQ,cAA2C;IAGnD,YAEE,UAAoC;QAEpC,KAAK,CAAC,UAAU,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,qBAAqB,CACzB,MAAc,EACd,IAAY,EACZ,KAAa;QAEb,OAAO,KAAK,CAAC,QAAQ,CACnB,EAAE,IAAI,EAAE,KAAK,EAAE,EACf;YACE,KAAK,EAAE,EAAE,MAAM,EAAE;YACjB,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE;SAC7B,CACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,wBAAwB,CAAC,IAA4B;QACzD,OAAO,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;YACrD,MAAM,SAAS,GAAG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m: string): Promise<PostEntity[]>;
12
12
  listPaginated(page: number, limit: number, authorId?: string): Promise<PaginatedResult<PostEntity>>;
13
13
  deleteByAuthorId(authorId: string): Promise<number>;
14
- findByEventId(eventId: string, relations?: string[]): Promise<PostEntity[]>;
15
- deleteByEventId(eventId: string): Promise<number>;
16
14
  createWithPostCreated(data: Partial<PostEntity>): Promise<PostEntity>;
17
15
  deleteWithPostDeleted(id: string): Promise<boolean>;
16
+ purgePostsByAuthor(authorId: string): Promise<number>;
18
17
  }
19
18
  //# sourceMappingURL=postgres-post.repository.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-post.repository.d.ts","sourceRoot":"","sources":["../../src/repositories/postgres-post.repository.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EACL,cAAc,EAEd,eAAe,EAGhB,MAAM,wBAAwB,CAAC;AAQhC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,qBACa,sBACX,SAAQ,cAAc,CAAC,SAAS,EAAE,UAAU,CAC5C,YAAW,eAAe;gBAIxB,UAAU,EAAE,UAAU,CAAC,SAAS,CAAC;IAK7B,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAO1E,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAOjF,OAAO,CAAC,SAAS,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAOxD,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAIjD,aAAa,CAC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IAOjF,OAAO,CAAC,SAAS,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAOxD,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAIjD,aAAa,CACjB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;IAKjC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKnD,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IAmCrE,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA6BnD,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAc5D"}
@@ -12,11 +12,11 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  };
13
13
  import { Injectable } from '@nestjs/common';
14
14
  import { InjectRepository } from '@nestjs/typeorm';
15
- import { BaseRepository, ILike, EventQueueEntity, EventQueueModel, } from '@volontariapp/database';
15
+ import { BaseRepository, ILike, In, EventQueueEntity, EventQueueModel, } from '@volontariapp/database';
16
16
  import { EventQueueRepository } from '@volontariapp/outbox';
17
17
  import { Streams } from '@volontariapp/shared';
18
18
  import { PostEventMessagingType, } from '@volontariapp/messaging';
19
- import { PostModel } from '../models/index.js';
19
+ import { PostModel, CommentModel } from '../models/index.js';
20
20
  import { PostEntity } from '../entities/index.js';
21
21
  let PostgresPostRepository = class PostgresPostRepository extends BaseRepository {
22
22
  constructor(repository) {
@@ -51,16 +51,6 @@ let PostgresPostRepository = class PostgresPostRepository extends BaseRepository
51
51
  const result = await super.deleteWhere({ authorId });
52
52
  return result.affected ?? 0;
53
53
  }
54
- async findByEventId(eventId, relations = []) {
55
- return super.find({
56
- where: { eventId },
57
- relations,
58
- });
59
- }
60
- async deleteByEventId(eventId) {
61
- const result = await super.deleteWhere({ eventId });
62
- return result.affected ?? 0;
63
- }
64
54
  async createWithPostCreated(data) {
65
55
  return this.executeInTransaction(async (queryRunner) => {
66
56
  const modelData = this.toModel(data);
@@ -69,6 +59,8 @@ let PostgresPostRepository = class PostgresPostRepository extends BaseRepository
69
59
  const savedPostEntity = this.toEntity(savedPostModel);
70
60
  const payload = {
71
61
  postId: savedPostEntity.id,
62
+ userId: savedPostEntity.authorId,
63
+ fileIds: [],
72
64
  };
73
65
  if (data.eventId) {
74
66
  payload.eventId = data.eventId;
@@ -107,6 +99,20 @@ let PostgresPostRepository = class PostgresPostRepository extends BaseRepository
107
99
  return true;
108
100
  });
109
101
  }
102
+ async purgePostsByAuthor(authorId) {
103
+ return this.executeInTransaction(async (queryRunner) => {
104
+ const posts = await queryRunner.manager.find(this.modelClass, {
105
+ where: { authorId },
106
+ select: ['id'],
107
+ });
108
+ const postIds = posts.map((p) => p.id);
109
+ if (postIds.length > 0) {
110
+ await queryRunner.manager.delete(CommentModel, { postId: In(postIds) });
111
+ await queryRunner.manager.delete(this.modelClass, { authorId });
112
+ }
113
+ return postIds.length;
114
+ });
115
+ }
110
116
  };
111
117
  PostgresPostRepository = __decorate([
112
118
  Injectable(),
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-post.repository.js","sourceRoot":"","sources":["../../src/repositories/postgres-post.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EACL,cAAc,EACd,KAAK,EAEL,gBAAgB,EAChB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC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,IAAI,EAAE,sBAAsB,CAAC,YAAY;gBACzC,OAAO,EAAE,SAAS;gBAClB,SAAS,EAAE,MAAM,CAAC,QAAQ;gBAC1B,OAAO;gBACP,cAAc,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;aACvC,CAAC,CAAC;YAEH,MAAM,cAAc,GAAG,IAAI,oBAAoB,CAC7C,WAAW,CAAC,OAAO,CAAC,aAAa,CAAkB,eAAe,CAAC,CACpE,CAAC;YACF,MAAM,cAAc,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAE9C,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA1HY,sBAAsB;IADlC,UAAU,EAAE;IAMR,WAAA,gBAAgB,CAAC,SAAS,CAAC,CAAA;;GALnB,sBAAsB,CA0HlC"}
1
+ {"version":3,"file":"postgres-post.repository.js","sourceRoot":"","sources":["../../src/repositories/postgres-post.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EACL,cAAc,EACd,KAAK,EACL,EAAE,EAEF,gBAAgB,EAChB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EACL,sBAAsB,GAGvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAI3C,IAAM,sBAAsB,GAA5B,MAAM,sBACX,SAAQ,cAAqC;IAG7C,YAEE,UAAiC;QAEjC,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IAC3C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AAU,EAAE;gBAC5D,KAAK,EAAE,EAAE,QAAQ,EAAE;gBACnB,MAAM,EAAE,CAAC,IAAI,CAAC;aACf,CAAC,CAAC;YACH,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACvC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACvB,MAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;gBACxE,MAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;YAClE,CAAC;YACD,OAAO,OAAO,CAAC,MAAM,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAhIY,sBAAsB;IADlC,UAAU,EAAE;IAMR,WAAA,gBAAgB,CAAC,SAAS,CAAC,CAAA;;GALnB,sBAAsB,CAgIlC"}
@@ -12,5 +12,6 @@ export declare class CommentService {
12
12
  create(data: Partial<CommentEntity>): Promise<CommentEntity>;
13
13
  updateSaga(id: string, status: SagaStatus): Promise<CommentEntity>;
14
14
  delete(id: string, actorId?: string, actorRole?: UserRoles): Promise<boolean>;
15
+ anonymizeCommentsByAuthor(authorId: string): Promise<number>;
15
16
  }
16
17
  //# sourceMappingURL=comment.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"comment.service.d.ts","sourceRoot":"","sources":["../../src/services/comment.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,UAAU,EAA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