@chevre/domain 21.2.0-alpha.153 → 21.2.0-alpha.154
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.
|
@@ -12,175 +12,346 @@ async function main() {
|
|
|
12
12
|
|
|
13
13
|
const eventRepo = new chevre.repository.Event(mongoose.connection);
|
|
14
14
|
|
|
15
|
-
const result = await eventRepo.createManyIfNotExist<chevre.factory.eventType.ScreeningEvent>([
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
en: 'PetPetPetPet',
|
|
21
|
-
ja: 'ペット'
|
|
22
|
-
},
|
|
23
|
-
doorTime: moment('2023-06-27T00:00:00.000Z')
|
|
24
|
-
.toDate(),
|
|
25
|
-
endDate: moment('2023-06-27T01:00:00.000Z')
|
|
26
|
-
.toDate(),
|
|
27
|
-
eventStatus: chevre.factory.eventStatusType.EventCancelled,
|
|
28
|
-
location: {
|
|
29
|
-
typeOf: chevre.factory.placeType.ScreeningRoom,
|
|
30
|
-
branchCode: '30',
|
|
15
|
+
const result = await eventRepo.createManyIfNotExist<chevre.factory.eventType.ScreeningEvent>([
|
|
16
|
+
{
|
|
17
|
+
attributes: {
|
|
18
|
+
typeOf: chevre.factory.eventType.ScreeningEvent,
|
|
19
|
+
project: { id: PROJECT_ID, typeOf: chevre.factory.organizationType.Project },
|
|
31
20
|
name: {
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
en: 'PetPetPetPet',
|
|
22
|
+
ja: 'ペット'
|
|
34
23
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
24
|
+
doorTime: moment('2023-06-27T00:00:00.000Z')
|
|
25
|
+
.toDate(),
|
|
26
|
+
endDate: moment('2023-06-27T01:00:00.000Z')
|
|
27
|
+
.toDate(),
|
|
28
|
+
eventStatus: chevre.factory.eventStatusType.EventCancelled,
|
|
29
|
+
location: {
|
|
30
|
+
typeOf: chevre.factory.placeType.ScreeningRoom,
|
|
31
|
+
branchCode: '30',
|
|
32
|
+
name: {
|
|
33
|
+
ja: 'シネマ3',
|
|
34
|
+
en: 'CINEMA3'
|
|
35
|
+
},
|
|
36
|
+
address: {
|
|
37
|
+
ja: '7階',
|
|
38
|
+
en: '7F'
|
|
49
39
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
id: '
|
|
40
|
+
},
|
|
41
|
+
startDate: moment('2023-06-27T00:00:00.000Z')
|
|
42
|
+
.toDate(),
|
|
43
|
+
superEvent: {
|
|
44
|
+
typeOf: chevre.factory.eventType.ScreeningEventSeries,
|
|
45
|
+
id: '7k9ayl8hc',
|
|
46
|
+
videoFormat: [
|
|
47
|
+
{
|
|
48
|
+
typeOf: '2D',
|
|
49
|
+
name: '2D'
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
soundFormat: [],
|
|
53
|
+
workPerformed: {
|
|
54
|
+
typeOf: chevre.factory.creativeWorkType.Movie,
|
|
55
|
+
identifier: '1622100',
|
|
56
|
+
id: '5bfb841d5a78d7948369980a',
|
|
57
|
+
name: {
|
|
58
|
+
en: 'Pet',
|
|
59
|
+
ja: 'ペット'
|
|
60
|
+
},
|
|
61
|
+
duration: 'PT2H3M'
|
|
62
|
+
},
|
|
63
|
+
location: {
|
|
64
|
+
typeOf: chevre.factory.placeType.MovieTheater,
|
|
65
|
+
id: '5bfb841d5a78d7948369979a',
|
|
66
|
+
branchCode: '118',
|
|
67
|
+
name: {
|
|
68
|
+
ja: 'シネモーション赤坂 ',
|
|
69
|
+
en: 'CineMotion Akasaka'
|
|
70
|
+
},
|
|
71
|
+
kanaName: 'シネモーションアカサカ'
|
|
72
|
+
},
|
|
73
|
+
kanaName: 'ペットカナタイトル',
|
|
56
74
|
name: {
|
|
57
|
-
en: '
|
|
75
|
+
en: 'PetPetPetPet',
|
|
58
76
|
ja: 'ペット'
|
|
59
77
|
},
|
|
60
|
-
|
|
78
|
+
additionalProperty: [
|
|
79
|
+
{
|
|
80
|
+
name: 'sortNumber',
|
|
81
|
+
value: '99'
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
startDate: moment('2020-03-31T15:00:00.000Z')
|
|
85
|
+
.toDate(),
|
|
86
|
+
endDate: moment('2034-12-01T15:00:00.000Z')
|
|
87
|
+
.toDate(),
|
|
88
|
+
description: {
|
|
89
|
+
en: 'english description',
|
|
90
|
+
ja: 'ムビチケ検証用のイベントです。'
|
|
91
|
+
},
|
|
92
|
+
headline: {
|
|
93
|
+
en: 'headlineheadlineheadlineheadlineheadlineheadlineheadline',
|
|
94
|
+
ja: 'サブタイトルkanaName'
|
|
95
|
+
},
|
|
96
|
+
subtitleLanguage: {
|
|
97
|
+
typeOf: 'Language',
|
|
98
|
+
name: 'Japanese'
|
|
99
|
+
}
|
|
61
100
|
},
|
|
62
|
-
|
|
63
|
-
typeOf: chevre.factory.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
101
|
+
offers: {
|
|
102
|
+
typeOf: chevre.factory.offerType.Offer,
|
|
103
|
+
priceCurrency: chevre.factory.priceCurrency.JPY,
|
|
104
|
+
availabilityEnds: moment('2023-06-26T14:20:00.000Z')
|
|
105
|
+
.toDate(),
|
|
106
|
+
availabilityStarts: moment('2023-06-23T15:00:00.000Z')
|
|
107
|
+
.toDate(),
|
|
108
|
+
eligibleQuantity: {
|
|
109
|
+
typeOf: 'QuantitativeValue',
|
|
110
|
+
unitCode: chevre.factory.unitCode.C62,
|
|
111
|
+
maxValue: 6,
|
|
112
|
+
value: 1
|
|
69
113
|
},
|
|
70
|
-
|
|
114
|
+
itemOffered: {
|
|
115
|
+
id: '6308580bdef565000a9aa1fd',
|
|
116
|
+
name: {
|
|
117
|
+
ja: '通常興行カタログ'
|
|
118
|
+
},
|
|
119
|
+
serviceOutput: {
|
|
120
|
+
typeOf: chevre.factory.reservationType.EventReservation,
|
|
121
|
+
reservedTicket: {
|
|
122
|
+
typeOf: 'Ticket',
|
|
123
|
+
ticketedSeat: {
|
|
124
|
+
typeOf: chevre.factory.placeType.Seat
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
typeOf: chevre.factory.product.ProductType.EventService,
|
|
129
|
+
availableChannel: {
|
|
130
|
+
typeOf: 'ServiceChannel',
|
|
131
|
+
serviceLocation: {
|
|
132
|
+
typeOf: chevre.factory.placeType.ScreeningRoom,
|
|
133
|
+
branchCode: '30',
|
|
134
|
+
name: {
|
|
135
|
+
ja: 'シネマ3',
|
|
136
|
+
en: 'CINEMA3'
|
|
137
|
+
},
|
|
138
|
+
containedInPlace: {
|
|
139
|
+
typeOf: chevre.factory.placeType.MovieTheater,
|
|
140
|
+
id: '5bfb841d5a78d7948369979a',
|
|
141
|
+
branchCode: '118',
|
|
142
|
+
name: {
|
|
143
|
+
ja: 'シネモーション赤坂 ',
|
|
144
|
+
en: 'CineMotion Akasaka'
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
serviceType: {
|
|
150
|
+
codeValue: '0001',
|
|
151
|
+
id: '5e3361d01dc1ef1a20dd8737',
|
|
152
|
+
inCodeSet: {
|
|
153
|
+
typeOf: 'CategoryCodeSet',
|
|
154
|
+
identifier: chevre.factory.categoryCode.CategorySetIdentifier.ServiceType
|
|
155
|
+
},
|
|
156
|
+
typeOf: 'CategoryCode'
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
validFrom: moment('2023-06-23T15:00:00.000Z')
|
|
160
|
+
.toDate(),
|
|
161
|
+
validThrough: moment('2023-06-26T14:20:00.000Z')
|
|
162
|
+
.toDate(),
|
|
163
|
+
seller: {
|
|
164
|
+
typeOf: chevre.factory.organizationType.Corporation,
|
|
165
|
+
id: '59d20831e53ebc2b4e774466',
|
|
166
|
+
name: {
|
|
167
|
+
ja: 'シネモーション赤坂',
|
|
168
|
+
en: 'CineMotion Akasaka'
|
|
169
|
+
},
|
|
170
|
+
makesOffer: [
|
|
171
|
+
]
|
|
172
|
+
}
|
|
71
173
|
},
|
|
72
|
-
|
|
174
|
+
maximumAttendeeCapacity: 90,
|
|
175
|
+
remainingAttendeeCapacity: 90,
|
|
176
|
+
additionalProperty: [{
|
|
177
|
+
name: 'eventIdentifier',
|
|
178
|
+
value: `bySample2023062701`
|
|
179
|
+
}]
|
|
180
|
+
},
|
|
181
|
+
filter: {
|
|
182
|
+
name: 'eventIdentifier'
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
attributes: {
|
|
187
|
+
typeOf: chevre.factory.eventType.ScreeningEvent,
|
|
188
|
+
project: { id: PROJECT_ID, typeOf: chevre.factory.organizationType.Project },
|
|
73
189
|
name: {
|
|
74
190
|
en: 'PetPetPetPet',
|
|
75
191
|
ja: 'ペット'
|
|
76
192
|
},
|
|
77
|
-
|
|
78
|
-
{
|
|
79
|
-
name: 'sortNumber',
|
|
80
|
-
value: '99'
|
|
81
|
-
}
|
|
82
|
-
],
|
|
83
|
-
startDate: moment('2020-03-31T15:00:00.000Z')
|
|
193
|
+
doorTime: moment('2023-06-27T01:00:00.000Z')
|
|
84
194
|
.toDate(),
|
|
85
|
-
endDate: moment('
|
|
195
|
+
endDate: moment('2023-06-27T02:00:00.000Z')
|
|
86
196
|
.toDate(),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
197
|
+
eventStatus: chevre.factory.eventStatusType.EventCancelled,
|
|
198
|
+
location: {
|
|
199
|
+
typeOf: chevre.factory.placeType.ScreeningRoom,
|
|
200
|
+
branchCode: '30',
|
|
201
|
+
name: {
|
|
202
|
+
ja: 'シネマ3',
|
|
203
|
+
en: 'CINEMA3'
|
|
204
|
+
},
|
|
205
|
+
address: {
|
|
206
|
+
ja: '7階',
|
|
207
|
+
en: '7F'
|
|
208
|
+
}
|
|
94
209
|
},
|
|
95
|
-
|
|
96
|
-
typeOf: 'Language',
|
|
97
|
-
name: 'Japanese'
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
offers: {
|
|
101
|
-
typeOf: chevre.factory.offerType.Offer,
|
|
102
|
-
priceCurrency: chevre.factory.priceCurrency.JPY,
|
|
103
|
-
availabilityEnds: moment('2023-06-26T14:20:00.000Z')
|
|
210
|
+
startDate: moment('2023-06-27T01:00:00.000Z')
|
|
104
211
|
.toDate(),
|
|
105
|
-
|
|
106
|
-
.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
212
|
+
superEvent: {
|
|
213
|
+
typeOf: chevre.factory.eventType.ScreeningEventSeries,
|
|
214
|
+
id: '7k9ayl8hc',
|
|
215
|
+
videoFormat: [
|
|
216
|
+
{
|
|
217
|
+
typeOf: '2D',
|
|
218
|
+
name: '2D'
|
|
219
|
+
}
|
|
220
|
+
],
|
|
221
|
+
soundFormat: [],
|
|
222
|
+
workPerformed: {
|
|
223
|
+
typeOf: chevre.factory.creativeWorkType.Movie,
|
|
224
|
+
identifier: '1622100',
|
|
225
|
+
id: '5bfb841d5a78d7948369980a',
|
|
226
|
+
name: {
|
|
227
|
+
en: 'Pet',
|
|
228
|
+
ja: 'ペット'
|
|
229
|
+
},
|
|
230
|
+
duration: 'PT2H3M'
|
|
231
|
+
},
|
|
232
|
+
location: {
|
|
233
|
+
typeOf: chevre.factory.placeType.MovieTheater,
|
|
234
|
+
id: '5bfb841d5a78d7948369979a',
|
|
235
|
+
branchCode: '118',
|
|
236
|
+
name: {
|
|
237
|
+
ja: 'シネモーション赤坂 ',
|
|
238
|
+
en: 'CineMotion Akasaka'
|
|
239
|
+
},
|
|
240
|
+
kanaName: 'シネモーションアカサカ'
|
|
241
|
+
},
|
|
242
|
+
kanaName: 'ペットカナタイトル',
|
|
115
243
|
name: {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
typeOf: chevre.factory.placeType.Seat
|
|
124
|
-
}
|
|
244
|
+
en: 'PetPetPetPet',
|
|
245
|
+
ja: 'ペット'
|
|
246
|
+
},
|
|
247
|
+
additionalProperty: [
|
|
248
|
+
{
|
|
249
|
+
name: 'sortNumber',
|
|
250
|
+
value: '99'
|
|
125
251
|
}
|
|
252
|
+
],
|
|
253
|
+
startDate: moment('2020-03-31T15:00:00.000Z')
|
|
254
|
+
.toDate(),
|
|
255
|
+
endDate: moment('2034-12-01T15:00:00.000Z')
|
|
256
|
+
.toDate(),
|
|
257
|
+
description: {
|
|
258
|
+
en: 'english description',
|
|
259
|
+
ja: 'ムビチケ検証用のイベントです。'
|
|
126
260
|
},
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
261
|
+
headline: {
|
|
262
|
+
en: 'headlineheadlineheadlineheadlineheadlineheadlineheadline',
|
|
263
|
+
ja: 'サブタイトルkanaName'
|
|
264
|
+
},
|
|
265
|
+
subtitleLanguage: {
|
|
266
|
+
typeOf: 'Language',
|
|
267
|
+
name: 'Japanese'
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
offers: {
|
|
271
|
+
typeOf: chevre.factory.offerType.Offer,
|
|
272
|
+
priceCurrency: chevre.factory.priceCurrency.JPY,
|
|
273
|
+
availabilityEnds: moment('2023-06-26T14:20:00.000Z')
|
|
274
|
+
.toDate(),
|
|
275
|
+
availabilityStarts: moment('2023-06-23T15:00:00.000Z')
|
|
276
|
+
.toDate(),
|
|
277
|
+
eligibleQuantity: {
|
|
278
|
+
typeOf: 'QuantitativeValue',
|
|
279
|
+
unitCode: chevre.factory.unitCode.C62,
|
|
280
|
+
maxValue: 6,
|
|
281
|
+
value: 1
|
|
282
|
+
},
|
|
283
|
+
itemOffered: {
|
|
284
|
+
id: '6308580bdef565000a9aa1fd',
|
|
285
|
+
name: {
|
|
286
|
+
ja: '通常興行カタログ'
|
|
287
|
+
},
|
|
288
|
+
serviceOutput: {
|
|
289
|
+
typeOf: chevre.factory.reservationType.EventReservation,
|
|
290
|
+
reservedTicket: {
|
|
291
|
+
typeOf: 'Ticket',
|
|
292
|
+
ticketedSeat: {
|
|
293
|
+
typeOf: chevre.factory.placeType.Seat
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
typeOf: chevre.factory.product.ProductType.EventService,
|
|
298
|
+
availableChannel: {
|
|
299
|
+
typeOf: 'ServiceChannel',
|
|
300
|
+
serviceLocation: {
|
|
301
|
+
typeOf: chevre.factory.placeType.ScreeningRoom,
|
|
302
|
+
branchCode: '30',
|
|
141
303
|
name: {
|
|
142
|
-
ja: '
|
|
143
|
-
en: '
|
|
304
|
+
ja: 'シネマ3',
|
|
305
|
+
en: 'CINEMA3'
|
|
306
|
+
},
|
|
307
|
+
containedInPlace: {
|
|
308
|
+
typeOf: chevre.factory.placeType.MovieTheater,
|
|
309
|
+
id: '5bfb841d5a78d7948369979a',
|
|
310
|
+
branchCode: '118',
|
|
311
|
+
name: {
|
|
312
|
+
ja: 'シネモーション赤坂 ',
|
|
313
|
+
en: 'CineMotion Akasaka'
|
|
314
|
+
}
|
|
144
315
|
}
|
|
145
316
|
}
|
|
317
|
+
},
|
|
318
|
+
serviceType: {
|
|
319
|
+
codeValue: '0001',
|
|
320
|
+
id: '5e3361d01dc1ef1a20dd8737',
|
|
321
|
+
inCodeSet: {
|
|
322
|
+
typeOf: 'CategoryCodeSet',
|
|
323
|
+
identifier: chevre.factory.categoryCode.CategorySetIdentifier.ServiceType
|
|
324
|
+
},
|
|
325
|
+
typeOf: 'CategoryCode'
|
|
146
326
|
}
|
|
147
327
|
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
328
|
+
validFrom: moment('2023-06-23T15:00:00.000Z')
|
|
329
|
+
.toDate(),
|
|
330
|
+
validThrough: moment('2023-06-26T14:20:00.000Z')
|
|
331
|
+
.toDate(),
|
|
332
|
+
seller: {
|
|
333
|
+
typeOf: chevre.factory.organizationType.Corporation,
|
|
334
|
+
id: '59d20831e53ebc2b4e774466',
|
|
335
|
+
name: {
|
|
336
|
+
ja: 'シネモーション赤坂',
|
|
337
|
+
en: 'CineMotion Akasaka'
|
|
154
338
|
},
|
|
155
|
-
|
|
339
|
+
makesOffer: [
|
|
340
|
+
]
|
|
156
341
|
}
|
|
157
342
|
},
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
id: '59d20831e53ebc2b4e774466',
|
|
165
|
-
name: {
|
|
166
|
-
ja: 'シネモーション赤坂',
|
|
167
|
-
en: 'CineMotion Akasaka'
|
|
168
|
-
},
|
|
169
|
-
makesOffer: [
|
|
170
|
-
]
|
|
171
|
-
}
|
|
343
|
+
maximumAttendeeCapacity: 90,
|
|
344
|
+
remainingAttendeeCapacity: 90,
|
|
345
|
+
additionalProperty: [{
|
|
346
|
+
name: 'eventIdentifier',
|
|
347
|
+
value: `bySample2023062702`
|
|
348
|
+
}]
|
|
172
349
|
},
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
name: 'eventIdentifier',
|
|
177
|
-
value: `bySample2023062701`
|
|
178
|
-
}]
|
|
179
|
-
},
|
|
180
|
-
filter: {
|
|
181
|
-
name: 'eventIdentifier'
|
|
350
|
+
filter: {
|
|
351
|
+
name: 'eventIdentifier'
|
|
352
|
+
}
|
|
182
353
|
}
|
|
183
|
-
|
|
354
|
+
]);
|
|
184
355
|
console.log('result:', result);
|
|
185
356
|
|
|
186
357
|
}
|
|
@@ -97,14 +97,20 @@ export declare class MongoRepository {
|
|
|
97
97
|
expectsNoContent: boolean;
|
|
98
98
|
}): Promise<factory.event.IEvent<T>[] | void>;
|
|
99
99
|
/**
|
|
100
|
-
*
|
|
100
|
+
* 特定の追加特性をキーにして、存在しなければ作成する(複数対応)
|
|
101
|
+
* 存在すれば、eventStatusのみ更新する
|
|
101
102
|
*/
|
|
102
103
|
createManyIfNotExist<T extends factory.eventType>(params: {
|
|
103
104
|
attributes: factory.event.IAttributes<T>;
|
|
104
105
|
filter: {
|
|
105
106
|
name: string;
|
|
106
107
|
};
|
|
107
|
-
}[]): Promise<
|
|
108
|
+
}[]): Promise<{
|
|
109
|
+
bulkWriteResult: BulkWriteOpResultObject;
|
|
110
|
+
modifiedEvents: {
|
|
111
|
+
id: string;
|
|
112
|
+
}[];
|
|
113
|
+
} | void>;
|
|
108
114
|
/**
|
|
109
115
|
* コンテンツ+バージョンをキーにして、なければ作成する(複数対応)
|
|
110
116
|
*/
|
package/lib/chevre/repo/event.js
CHANGED
|
@@ -471,11 +471,13 @@ class MongoRepository {
|
|
|
471
471
|
});
|
|
472
472
|
}
|
|
473
473
|
/**
|
|
474
|
-
*
|
|
474
|
+
* 特定の追加特性をキーにして、存在しなければ作成する(複数対応)
|
|
475
|
+
* 存在すれば、eventStatusのみ更新する
|
|
475
476
|
*/
|
|
476
477
|
createManyIfNotExist(params) {
|
|
477
478
|
return __awaiter(this, void 0, void 0, function* () {
|
|
478
479
|
const bulkWriteOps = [];
|
|
480
|
+
const additionalProperties = [];
|
|
479
481
|
if (Array.isArray(params)) {
|
|
480
482
|
params.forEach((creatingEventParams) => {
|
|
481
483
|
var _a, _b;
|
|
@@ -486,11 +488,12 @@ class MongoRepository {
|
|
|
486
488
|
if (typeof additionalPropertyValue !== 'string') {
|
|
487
489
|
throw new factory.errors.NotFound('additionalProperty.value');
|
|
488
490
|
}
|
|
491
|
+
additionalProperties.push({ name: creatingEventParams.filter.name, value: additionalPropertyValue });
|
|
489
492
|
const _c = creatingEventParams.attributes, { eventStatus } = _c, setOnInsertFields = __rest(_c, ["eventStatus"]);
|
|
490
493
|
bulkWriteOps.push({
|
|
491
494
|
updateOne: {
|
|
492
495
|
filter: {
|
|
493
|
-
typeOf: creatingEventParams.attributes.typeOf,
|
|
496
|
+
typeOf: { $eq: creatingEventParams.attributes.typeOf },
|
|
494
497
|
// 追加特性をキーにした冪等イベント作成時のfilterにproject.idを追加(2023-04-06~)
|
|
495
498
|
'project.id': { $eq: creatingEventParams.attributes.project.id },
|
|
496
499
|
// 追加特性をキーに更新
|
|
@@ -510,7 +513,21 @@ class MongoRepository {
|
|
|
510
513
|
});
|
|
511
514
|
}
|
|
512
515
|
if (bulkWriteOps.length > 0) {
|
|
513
|
-
|
|
516
|
+
const bulkWriteResult = yield this.eventModel.bulkWrite(bulkWriteOps, { ordered: false });
|
|
517
|
+
// modifiedの場合upsertedIdsに含まれないので、idを検索する
|
|
518
|
+
const modifiedEvents = yield this.eventModel.find({
|
|
519
|
+
typeOf: { $eq: params[0].attributes.typeOf },
|
|
520
|
+
// 追加特性をキーにした冪等イベント作成時のfilterにproject.idを追加(2023-04-06~)
|
|
521
|
+
'project.id': { $eq: params[0].attributes.project.id },
|
|
522
|
+
// 追加特性をキーに更新
|
|
523
|
+
additionalProperty: {
|
|
524
|
+
$exists: true,
|
|
525
|
+
$in: additionalProperties
|
|
526
|
+
}
|
|
527
|
+
})
|
|
528
|
+
.select(['_id'])
|
|
529
|
+
.exec();
|
|
530
|
+
return { bulkWriteResult, modifiedEvents };
|
|
514
531
|
}
|
|
515
532
|
});
|
|
516
533
|
}
|
package/package.json
CHANGED