@chevre/domain 26.0.0-alpha.28 → 26.0.0-alpha.29
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.
- package/lib/chevre/repo/action.d.ts +3 -19
- package/lib/chevre/repo/action.js +0 -38
- package/lib/chevre/repo/adminAssetTransaction.d.ts +0 -6
- package/lib/chevre/repo/adminAssetTransaction.js +0 -13
- package/lib/chevre/repo/adminTask.d.ts +0 -8
- package/lib/chevre/repo/adminTask.js +0 -16
- package/lib/chevre/repo/aggregation.d.ts +0 -8
- package/lib/chevre/repo/aggregation.js +0 -10
- package/lib/chevre/repo/authorization.d.ts +0 -6
- package/lib/chevre/repo/authorization.js +0 -12
- package/lib/chevre/repo/message.d.ts +0 -7
- package/lib/chevre/repo/message.js +0 -38
- package/lib/chevre/repo/mongoose/schemas/action.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/updateAction.d.ts +2 -5
- package/lib/chevre/repo/mongoose/schemas/updateAction.js +50 -8
- package/lib/chevre/repo/ticket.d.ts +0 -6
- package/lib/chevre/repo/ticket.js +0 -11
- package/lib/chevre/repo/updateAction.d.ts +14 -10
- package/lib/chevre/repo/updateAction.js +15 -271
- package/lib/chevre/service/task/deleteTransaction.js +4 -35
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +2 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +2 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +2 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +2 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +2 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +2 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +2 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted.js +2 -3
- package/lib/chevre/service/task/syncResourcesFromCOA.js +16 -8
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +2 -0
- package/lib/chevre/service/transaction/deleteTransaction.js +3 -3
- package/package.json +2 -2
|
@@ -17,7 +17,6 @@ const AVAILABLE_PROJECT_FIELDS = [
|
|
|
17
17
|
'instrument',
|
|
18
18
|
'targetCollection',
|
|
19
19
|
'sameAs',
|
|
20
|
-
'replacer',
|
|
21
20
|
];
|
|
22
21
|
// 内部で正規化関数を定義(または外部ヘルパーを呼び出す)
|
|
23
22
|
function unknown2actionError(e) {
|
|
@@ -41,283 +40,32 @@ class UpdateActionRepo {
|
|
|
41
40
|
}
|
|
42
41
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
43
42
|
const andConditions = [];
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
andConditions.push({ _id: { $
|
|
47
|
-
}
|
|
48
|
-
const idNin = params.id?.$nin;
|
|
49
|
-
if (Array.isArray(idNin)) {
|
|
50
|
-
andConditions.push({ _id: { $nin: idNin } });
|
|
43
|
+
const idEq = params.id;
|
|
44
|
+
if (typeof idEq === 'string') {
|
|
45
|
+
andConditions.push({ _id: { $eq: idEq } });
|
|
51
46
|
}
|
|
52
47
|
const projectIdEq = params.project?.id?.$eq;
|
|
53
48
|
if (typeof projectIdEq === 'string') {
|
|
54
|
-
andConditions.push({
|
|
55
|
-
'project.id': {
|
|
56
|
-
$eq: projectIdEq
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
const agentTypeOfIn = params.agent?.typeOf?.$in;
|
|
61
|
-
if (Array.isArray(agentTypeOfIn)) {
|
|
62
|
-
andConditions.push({
|
|
63
|
-
'agent.typeOf': {
|
|
64
|
-
$exists: true,
|
|
65
|
-
$in: agentTypeOfIn
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
const agentIdIn = params.agent?.id?.$in;
|
|
70
|
-
if (Array.isArray(agentIdIn)) {
|
|
71
|
-
andConditions.push({
|
|
72
|
-
'agent.id': {
|
|
73
|
-
$exists: true,
|
|
74
|
-
$in: agentIdIn
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
const instrumentTransactionNumberEq = params.instrument?.transactionNumber?.$eq;
|
|
79
|
-
if (typeof instrumentTransactionNumberEq === 'string') {
|
|
80
|
-
andConditions.push({ 'instrument.transactionNumber': { $exists: true, $eq: instrumentTransactionNumberEq } });
|
|
81
|
-
}
|
|
82
|
-
const instrumentTypeOfEq = params.instrument?.typeOf?.$eq;
|
|
83
|
-
if (typeof instrumentTypeOfEq === 'string') {
|
|
84
|
-
andConditions.push({ 'instrument.typeOf': { $exists: true, $eq: instrumentTypeOfEq } });
|
|
85
|
-
}
|
|
86
|
-
const instrumentIdentifierEq = params.instrument?.identifier?.$eq;
|
|
87
|
-
if (typeof instrumentIdentifierEq === 'string') {
|
|
88
|
-
andConditions.push({ 'instrument.identifier': { $exists: true, $eq: instrumentIdentifierEq } });
|
|
89
|
-
}
|
|
90
|
-
const instrumentIdEq = params.instrument?.id?.$eq;
|
|
91
|
-
if (typeof instrumentIdEq === 'string') {
|
|
92
|
-
andConditions.push({ 'instrument.id': { $exists: true, $eq: instrumentIdEq } });
|
|
93
|
-
}
|
|
94
|
-
const instrumentOrderNumberEq = params.instrument?.orderNumber?.$eq;
|
|
95
|
-
if (typeof instrumentOrderNumberEq === 'string') {
|
|
96
|
-
andConditions.push({ 'instrument.orderNumber': { $exists: true, $eq: instrumentOrderNumberEq } });
|
|
97
|
-
}
|
|
98
|
-
const objectMovieTicketsIdentifierEq = params.object?.movieTickets?.identifier?.$eq;
|
|
99
|
-
if (typeof objectMovieTicketsIdentifierEq === 'string') {
|
|
100
|
-
andConditions.push({
|
|
101
|
-
'object.movieTickets.identifier': {
|
|
102
|
-
$exists: true,
|
|
103
|
-
$eq: objectMovieTicketsIdentifierEq
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
const objectMovieTicketsServiceOutputReservationForIdEq = params.object?.movieTickets?.serviceOutput?.reservationFor?.id?.$eq;
|
|
108
|
-
if (typeof objectMovieTicketsServiceOutputReservationForIdEq === 'string') {
|
|
109
|
-
andConditions.push({
|
|
110
|
-
'object.movieTickets.serviceOutput.reservationFor.id': {
|
|
111
|
-
$exists: true,
|
|
112
|
-
$eq: objectMovieTicketsServiceOutputReservationForIdEq
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
const objectPaymentMethodIdEq = params.object?.paymentMethodId?.$eq;
|
|
117
|
-
if (typeof objectPaymentMethodIdEq === 'string') {
|
|
118
|
-
andConditions.push({
|
|
119
|
-
'object.paymentMethodId': {
|
|
120
|
-
$exists: true,
|
|
121
|
-
$eq: objectPaymentMethodIdEq
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
const objectObjectPaymentMethodIdEq = params.object?.object?.paymentMethodId?.$eq;
|
|
126
|
-
if (typeof objectObjectPaymentMethodIdEq === 'string') {
|
|
127
|
-
andConditions.push({
|
|
128
|
-
'object.object.paymentMethodId': {
|
|
129
|
-
$exists: true,
|
|
130
|
-
$eq: objectObjectPaymentMethodIdEq
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
const objectReservationForIdEq = params.object?.reservationFor?.id?.$eq;
|
|
135
|
-
if (typeof objectReservationForIdEq === 'string') {
|
|
136
|
-
andConditions.push({
|
|
137
|
-
'object.reservationFor.id': {
|
|
138
|
-
$exists: true,
|
|
139
|
-
$eq: objectReservationForIdEq
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
const objectReservationNumberEq = params.object?.reservationNumber?.$eq;
|
|
144
|
-
if (typeof objectReservationNumberEq === 'string') {
|
|
145
|
-
andConditions.push({
|
|
146
|
-
'object.reservationNumber': {
|
|
147
|
-
$exists: true,
|
|
148
|
-
$eq: objectReservationNumberEq
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
const objectReservationNumberIn = params.object?.reservationNumber?.$in;
|
|
153
|
-
if (Array.isArray(objectReservationNumberIn)) {
|
|
154
|
-
andConditions.push({
|
|
155
|
-
'object.reservationNumber': {
|
|
156
|
-
$exists: true,
|
|
157
|
-
$in: objectReservationNumberIn
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
const objectPaymentMethodAccountIdEq = params.object?.paymentMethod?.accountId?.$eq;
|
|
162
|
-
if (typeof objectPaymentMethodAccountIdEq === 'string') {
|
|
163
|
-
andConditions.push({
|
|
164
|
-
'object.paymentMethod.accountId': {
|
|
165
|
-
$exists: true,
|
|
166
|
-
$eq: objectPaymentMethodAccountIdEq
|
|
167
|
-
}
|
|
168
|
-
});
|
|
49
|
+
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
169
50
|
}
|
|
170
|
-
const
|
|
171
|
-
if (typeof objectPaymentMethodPaymentMethodIdEq === 'string') {
|
|
172
|
-
andConditions.push({
|
|
173
|
-
'object.paymentMethod.paymentMethodId': {
|
|
174
|
-
$exists: true,
|
|
175
|
-
$eq: objectPaymentMethodPaymentMethodIdEq
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
const objectPaymentMethodPaymentMethodIdIn = params.object?.paymentMethod?.paymentMethodId?.$in;
|
|
180
|
-
if (Array.isArray(objectPaymentMethodPaymentMethodIdIn)) {
|
|
181
|
-
andConditions.push({
|
|
182
|
-
'object.paymentMethod.paymentMethodId': {
|
|
183
|
-
$exists: true,
|
|
184
|
-
$in: objectPaymentMethodPaymentMethodIdIn
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
const objectPaymentMethodTypeOfEq = params.object?.paymentMethod?.typeOf?.$eq;
|
|
189
|
-
if (typeof objectPaymentMethodTypeOfEq === 'string') {
|
|
190
|
-
andConditions.push({
|
|
191
|
-
'object.paymentMethod.typeOf': {
|
|
192
|
-
$exists: true,
|
|
193
|
-
$eq: objectPaymentMethodTypeOfEq
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
const objectTypeOfEq = params.object?.typeOf?.$eq;
|
|
198
|
-
if (typeof objectTypeOfEq === 'string') {
|
|
199
|
-
andConditions.push({
|
|
200
|
-
'object.typeOf': {
|
|
201
|
-
$exists: true,
|
|
202
|
-
$eq: objectTypeOfEq
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
const objectTypeOfIn = params.object?.typeOf?.$in;
|
|
207
|
-
if (Array.isArray(objectTypeOfIn)) {
|
|
208
|
-
andConditions.push({
|
|
209
|
-
'object.typeOf': {
|
|
210
|
-
$exists: true,
|
|
211
|
-
$in: objectTypeOfIn
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
const objectIdEq = params.object?.id?.$eq;
|
|
51
|
+
const objectIdEq = params.object?.id;
|
|
216
52
|
if (typeof objectIdEq === 'string') {
|
|
217
|
-
andConditions.push({
|
|
218
|
-
'object.id': {
|
|
219
|
-
$exists: true,
|
|
220
|
-
$eq: objectIdEq
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
const objectIdIn = params.object?.id?.$in;
|
|
225
|
-
if (Array.isArray(objectIdIn)) {
|
|
226
|
-
andConditions.push({
|
|
227
|
-
'object.id': {
|
|
228
|
-
$exists: true,
|
|
229
|
-
$in: objectIdIn
|
|
230
|
-
}
|
|
231
|
-
});
|
|
53
|
+
andConditions.push({ 'object.id': { $exists: true, $eq: objectIdEq } });
|
|
232
54
|
}
|
|
233
|
-
const
|
|
234
|
-
if (
|
|
235
|
-
andConditions.push({
|
|
236
|
-
'object.orderNumber': {
|
|
237
|
-
$exists: true,
|
|
238
|
-
$in: objectOrderNumberIn
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
const objectTransactionNumberEq = params.object?.transactionNumber?.$eq;
|
|
243
|
-
if (typeof objectTransactionNumberEq === 'string') {
|
|
244
|
-
andConditions.push({ 'object.transactionNumber': { $exists: true, $eq: objectTransactionNumberEq } });
|
|
55
|
+
const resultIdEq = params.result?.id;
|
|
56
|
+
if (typeof resultIdEq === 'string') {
|
|
57
|
+
andConditions.push({ 'result.id': { $exists: true, $eq: resultIdEq } });
|
|
245
58
|
}
|
|
246
59
|
if (typeof params.typeOf === 'string') {
|
|
247
|
-
andConditions.push({
|
|
248
|
-
typeOf: params.typeOf
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
const typeOfEq = params.typeOf?.$eq;
|
|
253
|
-
if (typeof typeOfEq === 'string') {
|
|
254
|
-
andConditions.push({
|
|
255
|
-
typeOf: { $eq: typeOfEq }
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
const actionStatusIn = params.actionStatus?.$in;
|
|
260
|
-
if (Array.isArray(actionStatusIn)) {
|
|
261
|
-
andConditions.push({
|
|
262
|
-
actionStatus: { $in: actionStatusIn }
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
if (Array.isArray(params.actionStatusTypes)) {
|
|
266
|
-
andConditions.push({
|
|
267
|
-
actionStatus: { $in: params.actionStatusTypes }
|
|
268
|
-
});
|
|
60
|
+
andConditions.push({ typeOf: { $eq: params.typeOf } });
|
|
269
61
|
}
|
|
270
62
|
const startDateGte = params.startFrom;
|
|
271
63
|
if (startDateGte instanceof Date) {
|
|
272
|
-
andConditions.push({
|
|
273
|
-
startDate: { $gte: startDateGte }
|
|
274
|
-
});
|
|
64
|
+
andConditions.push({ startDate: { $gte: startDateGte } });
|
|
275
65
|
}
|
|
276
66
|
const startDateLte = params.startThrough;
|
|
277
67
|
if (startDateLte instanceof Date) {
|
|
278
|
-
andConditions.push({
|
|
279
|
-
startDate: { $lte: startDateLte }
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
const resultTypeOfIn = params.result?.typeOf?.$in;
|
|
283
|
-
if (Array.isArray(resultTypeOfIn)) {
|
|
284
|
-
andConditions.push({
|
|
285
|
-
'result.typeOf': {
|
|
286
|
-
$exists: true,
|
|
287
|
-
$in: resultTypeOfIn
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
const resultIdIn = params.result?.id?.$in;
|
|
292
|
-
if (Array.isArray(resultIdIn)) {
|
|
293
|
-
andConditions.push({
|
|
294
|
-
'result.id': {
|
|
295
|
-
$exists: true,
|
|
296
|
-
$in: resultIdIn
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
const resultOrderNumberIn = params.result?.orderNumber?.$in;
|
|
301
|
-
if (Array.isArray(resultOrderNumberIn)) {
|
|
302
|
-
andConditions.push({
|
|
303
|
-
'result.orderNumber': {
|
|
304
|
-
$exists: true,
|
|
305
|
-
$in: resultOrderNumberIn
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
const resultCodeIn = params.result?.code?.$in;
|
|
310
|
-
if (Array.isArray(resultCodeIn)) {
|
|
311
|
-
andConditions.push({
|
|
312
|
-
'result.code': {
|
|
313
|
-
$exists: true,
|
|
314
|
-
$in: resultCodeIn
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
const sameAsIdEq = params.sameAs?.id?.$eq;
|
|
319
|
-
if (typeof sameAsIdEq === 'string') {
|
|
320
|
-
andConditions.push({ 'sameAs.id': { $exists: true, $eq: sameAsIdEq } });
|
|
68
|
+
andConditions.push({ startDate: { $lte: startDateLte } });
|
|
321
69
|
}
|
|
322
70
|
return andConditions;
|
|
323
71
|
}
|
|
@@ -405,20 +153,16 @@ class UpdateActionRepo {
|
|
|
405
153
|
.lean() // 2024-08-26~
|
|
406
154
|
.exec();
|
|
407
155
|
}
|
|
408
|
-
async
|
|
156
|
+
async findUpdateActionsBySameAs(params) {
|
|
409
157
|
const projection = {
|
|
410
158
|
_id: 0,
|
|
411
159
|
id: { $toString: '$_id' },
|
|
412
160
|
actionStatus: 1,
|
|
413
|
-
error: 1
|
|
414
|
-
purpose: 1
|
|
161
|
+
error: 1
|
|
415
162
|
};
|
|
416
163
|
const query = this.updateActionModel.find({
|
|
417
164
|
typeOf: { $eq: params.typeOf.$eq },
|
|
418
|
-
'sameAs.id': { $exists: true, $eq: params.sameAs.id.$eq }
|
|
419
|
-
...(typeof params.purpose?.id.$eq === 'string')
|
|
420
|
-
? { 'purpose.id': { $exists: true, $eq: params.purpose.id.$eq } }
|
|
421
|
-
: undefined
|
|
165
|
+
'sameAs.id': { $exists: true, $eq: params.sameAs.id.$eq }
|
|
422
166
|
}, projection)
|
|
423
167
|
.limit(1);
|
|
424
168
|
return query
|
|
@@ -1,42 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.call = call;
|
|
37
4
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
38
5
|
const accountingReport_1 = require("../../repo/accountingReport");
|
|
39
6
|
const action_1 = require("../../repo/action");
|
|
7
|
+
const updateAction_1 = require("../../repo/updateAction");
|
|
40
8
|
const adminTransaction_1 = require("../../repo/adminTransaction");
|
|
41
9
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
42
10
|
const note_1 = require("../../repo/note");
|
|
@@ -44,17 +12,18 @@ const order_1 = require("../../repo/order");
|
|
|
44
12
|
const reservation_1 = require("../../repo/reservation");
|
|
45
13
|
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
46
14
|
const returnOrder_1 = require("../../repo/transaction/returnOrder");
|
|
47
|
-
const
|
|
15
|
+
const transaction_1 = require("../transaction");
|
|
48
16
|
/**
|
|
49
17
|
* タスク実行関数
|
|
50
18
|
*/
|
|
51
19
|
function call(params) {
|
|
52
20
|
return async ({ connection }) => {
|
|
53
21
|
const { data } = params;
|
|
54
|
-
await
|
|
22
|
+
await (0, transaction_1.deleteTransaction)(data)({
|
|
55
23
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
56
24
|
accountingReport: new accountingReport_1.AccountingReportRepo(connection),
|
|
57
25
|
action: new action_1.ActionRepo(connection),
|
|
26
|
+
updateAction: new updateAction_1.UpdateActionRepo(connection),
|
|
58
27
|
adminTransaction: new adminTransaction_1.AdminTransactionRepo(connection),
|
|
59
28
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
60
29
|
note: new note_1.NoteRepo(connection),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UpdateActionRepo } from '../../../repo/updateAction';
|
|
2
2
|
import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
3
3
|
import type { OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
|
|
4
4
|
export declare function deleteResourcesByAggregateOffer(params: {
|
|
@@ -7,7 +7,7 @@ export declare function deleteResourcesByAggregateOffer(params: {
|
|
|
7
7
|
};
|
|
8
8
|
ids: string[];
|
|
9
9
|
}): (repos: {
|
|
10
|
-
|
|
10
|
+
updateAction: UpdateActionRepo;
|
|
11
11
|
offerCatalog: OfferCatalogRepo;
|
|
12
12
|
offerCatalogItem: OfferCatalogItemRepo;
|
|
13
13
|
}) => Promise<void>;
|
|
@@ -14,8 +14,8 @@ function deleteResourcesByAggregateOffer(params) {
|
|
|
14
14
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
15
15
|
typeOf: factory_1.factory.actionType.DeleteAction
|
|
16
16
|
};
|
|
17
|
-
let deleteResult;
|
|
18
|
-
const action = await repos.
|
|
17
|
+
let deleteResult;
|
|
18
|
+
const action = await repos.updateAction.startUpdateAction(deleteActionAttributes);
|
|
19
19
|
try {
|
|
20
20
|
// カタログからpullItemListElement
|
|
21
21
|
const updateCatalogResult = await repos.offerCatalog.pullItemListElement({
|
|
@@ -31,14 +31,14 @@ function deleteResourcesByAggregateOffer(params) {
|
|
|
31
31
|
}
|
|
32
32
|
catch (error) {
|
|
33
33
|
try {
|
|
34
|
-
await repos.
|
|
34
|
+
await repos.updateAction.giveUpUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
|
|
35
35
|
}
|
|
36
36
|
catch (_) {
|
|
37
37
|
// no op
|
|
38
38
|
}
|
|
39
39
|
throw error;
|
|
40
40
|
}
|
|
41
|
-
await repos.
|
|
41
|
+
await repos.updateAction.completeUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UpdateActionRepo } from '../../../repo/updateAction';
|
|
2
2
|
import type { EventRepo } from '../../../repo/event';
|
|
3
3
|
export declare function deleteResourcesByEventSeries(params: {
|
|
4
4
|
project: {
|
|
@@ -6,6 +6,6 @@ export declare function deleteResourcesByEventSeries(params: {
|
|
|
6
6
|
};
|
|
7
7
|
ids: string[];
|
|
8
8
|
}): (repos: {
|
|
9
|
-
|
|
9
|
+
updateAction: UpdateActionRepo;
|
|
10
10
|
event: EventRepo;
|
|
11
11
|
}) => Promise<void>;
|
|
@@ -14,8 +14,8 @@ function deleteResourcesByEventSeries(params) {
|
|
|
14
14
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
15
15
|
typeOf: factory_1.factory.actionType.DeleteAction
|
|
16
16
|
};
|
|
17
|
-
let deleteResult;
|
|
18
|
-
const action = await repos.
|
|
17
|
+
let deleteResult;
|
|
18
|
+
const action = await repos.updateAction.startUpdateAction(deleteActionAttributes);
|
|
19
19
|
try {
|
|
20
20
|
// イベント削除
|
|
21
21
|
const deleteScreeningEventResult = await repos.event.deleteManyBySuperEventId({
|
|
@@ -28,14 +28,14 @@ function deleteResourcesByEventSeries(params) {
|
|
|
28
28
|
}
|
|
29
29
|
catch (error) {
|
|
30
30
|
try {
|
|
31
|
-
await repos.
|
|
31
|
+
await repos.updateAction.giveUpUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
|
|
32
32
|
}
|
|
33
33
|
catch (_) {
|
|
34
34
|
// no op
|
|
35
35
|
}
|
|
36
36
|
throw error;
|
|
37
37
|
}
|
|
38
|
-
await repos.
|
|
38
|
+
await repos.updateAction.completeUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UpdateActionRepo } from '../../../repo/updateAction';
|
|
2
2
|
import type { EventRepo } from '../../../repo/event';
|
|
3
3
|
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
4
4
|
import type { ScreeningRoomRepo } from '../../../repo/place/screeningRoom';
|
|
@@ -8,7 +8,7 @@ export declare function deleteResourcesByMovieTheater(params: {
|
|
|
8
8
|
};
|
|
9
9
|
ids: string[];
|
|
10
10
|
}): (repos: {
|
|
11
|
-
|
|
11
|
+
updateAction: UpdateActionRepo;
|
|
12
12
|
event: EventRepo;
|
|
13
13
|
eventSeries: EventSeriesRepo;
|
|
14
14
|
screeningRoom: ScreeningRoomRepo;
|
|
@@ -14,8 +14,8 @@ function deleteResourcesByMovieTheater(params) {
|
|
|
14
14
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
15
15
|
typeOf: factory_1.factory.actionType.DeleteAction
|
|
16
16
|
};
|
|
17
|
-
let deleteResult;
|
|
18
|
-
const action = await repos.
|
|
17
|
+
let deleteResult;
|
|
18
|
+
const action = await repos.updateAction.startUpdateAction(deleteActionAttributes);
|
|
19
19
|
try {
|
|
20
20
|
// イベント削除
|
|
21
21
|
const deleteScreeningEventResult = await repos.event.deleteManyBySuperEventLocationId({
|
|
@@ -36,14 +36,14 @@ function deleteResourcesByMovieTheater(params) {
|
|
|
36
36
|
}
|
|
37
37
|
catch (error) {
|
|
38
38
|
try {
|
|
39
|
-
await repos.
|
|
39
|
+
await repos.updateAction.giveUpUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
|
|
40
40
|
}
|
|
41
41
|
catch (_) {
|
|
42
42
|
// no op
|
|
43
43
|
}
|
|
44
44
|
throw error;
|
|
45
45
|
}
|
|
46
|
-
await repos.
|
|
46
|
+
await repos.updateAction.completeUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UpdateActionRepo } from '../../../repo/updateAction';
|
|
2
2
|
import type { AggregateOfferRepo } from '../../../repo/aggregateOffer';
|
|
3
3
|
import type { EventRepo } from '../../../repo/event';
|
|
4
4
|
import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
@@ -9,7 +9,7 @@ export declare function deleteResourcesByOfferCatalog(params: {
|
|
|
9
9
|
};
|
|
10
10
|
ids: string[];
|
|
11
11
|
}): (repos: {
|
|
12
|
-
|
|
12
|
+
updateAction: UpdateActionRepo;
|
|
13
13
|
aggregateOffer: AggregateOfferRepo;
|
|
14
14
|
event: EventRepo;
|
|
15
15
|
offerCatalog: OfferCatalogRepo;
|
|
@@ -14,8 +14,8 @@ function deleteResourcesByOfferCatalog(params) {
|
|
|
14
14
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
15
15
|
typeOf: factory_1.factory.actionType.DeleteAction
|
|
16
16
|
};
|
|
17
|
-
let deleteResult;
|
|
18
|
-
const action = await repos.
|
|
17
|
+
let deleteResult;
|
|
18
|
+
const action = await repos.updateAction.startUpdateAction(deleteActionAttributes);
|
|
19
19
|
try {
|
|
20
20
|
// カタログからプロダクト検索
|
|
21
21
|
const productsWithCatalog = await repos.product.projectFields({
|
|
@@ -53,14 +53,14 @@ function deleteResourcesByOfferCatalog(params) {
|
|
|
53
53
|
}
|
|
54
54
|
catch (error) {
|
|
55
55
|
try {
|
|
56
|
-
await repos.
|
|
56
|
+
await repos.updateAction.giveUpUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
|
|
57
57
|
}
|
|
58
58
|
catch (_) {
|
|
59
59
|
// no op
|
|
60
60
|
}
|
|
61
61
|
throw error;
|
|
62
62
|
}
|
|
63
|
-
await repos.
|
|
63
|
+
await repos.updateAction.completeUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
|
-
import type {
|
|
2
|
+
import type { UpdateActionRepo } from '../../../repo/updateAction';
|
|
3
3
|
import type { AggregateOfferRepo } from '../../../repo/aggregateOffer';
|
|
4
4
|
import type { EventRepo } from '../../../repo/event';
|
|
5
5
|
import type { NoteRepo } from '../../../repo/note';
|
|
@@ -11,7 +11,7 @@ export declare function deleteResourcesByProduct(params: {
|
|
|
11
11
|
ids: string[];
|
|
12
12
|
typeOf: factory.product.ProductType;
|
|
13
13
|
}): (repos: {
|
|
14
|
-
|
|
14
|
+
updateAction: UpdateActionRepo;
|
|
15
15
|
aggregateOffer: AggregateOfferRepo;
|
|
16
16
|
event: EventRepo;
|
|
17
17
|
note: NoteRepo;
|
|
@@ -14,8 +14,8 @@ function deleteResourcesByProduct(params) {
|
|
|
14
14
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
15
15
|
typeOf: factory_1.factory.actionType.DeleteAction
|
|
16
16
|
};
|
|
17
|
-
let deleteResult;
|
|
18
|
-
const action = await repos.
|
|
17
|
+
let deleteResult;
|
|
18
|
+
const action = await repos.updateAction.startUpdateAction(deleteActionAttributes);
|
|
19
19
|
try {
|
|
20
20
|
// 興行を設定されたイベント削除
|
|
21
21
|
const deleteEventResult = await repos.event.deleteManyEventsByItemOfferedId({
|
|
@@ -35,14 +35,14 @@ function deleteResourcesByProduct(params) {
|
|
|
35
35
|
}
|
|
36
36
|
catch (error) {
|
|
37
37
|
try {
|
|
38
|
-
await repos.
|
|
38
|
+
await repos.updateAction.giveUpUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
|
|
39
39
|
}
|
|
40
40
|
catch (_) {
|
|
41
41
|
// no op
|
|
42
42
|
}
|
|
43
43
|
throw error;
|
|
44
44
|
}
|
|
45
|
-
await repos.
|
|
45
|
+
await repos.updateAction.completeUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UpdateActionRepo } from '../../../repo/updateAction';
|
|
2
2
|
import type { EventRepo } from '../../../repo/event';
|
|
3
3
|
export declare function deleteResourcesByRoom(params: {
|
|
4
4
|
project: {
|
|
@@ -15,6 +15,6 @@ export declare function deleteResourcesByRoom(params: {
|
|
|
15
15
|
id: string;
|
|
16
16
|
};
|
|
17
17
|
}): (repos: {
|
|
18
|
-
|
|
18
|
+
updateAction: UpdateActionRepo;
|
|
19
19
|
event: EventRepo;
|
|
20
20
|
}) => Promise<void>;
|
|
@@ -15,8 +15,8 @@ function deleteResourcesByRoom(params) {
|
|
|
15
15
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
16
16
|
typeOf: factory_1.factory.actionType.DeleteAction
|
|
17
17
|
};
|
|
18
|
-
let deleteResult;
|
|
19
|
-
const action = await repos.
|
|
18
|
+
let deleteResult;
|
|
19
|
+
const action = await repos.updateAction.startUpdateAction(deleteActionAttributes);
|
|
20
20
|
try {
|
|
21
21
|
// イベント削除
|
|
22
22
|
const deleteScreeningEventResult = await repos.event.deleteManyEventsByScreeningRoom({
|
|
@@ -30,13 +30,13 @@ function deleteResourcesByRoom(params) {
|
|
|
30
30
|
}
|
|
31
31
|
catch (error) {
|
|
32
32
|
try {
|
|
33
|
-
await repos.
|
|
33
|
+
await repos.updateAction.giveUpUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
|
|
34
34
|
}
|
|
35
35
|
catch (_) {
|
|
36
36
|
// no op
|
|
37
37
|
}
|
|
38
38
|
throw error;
|
|
39
39
|
}
|
|
40
|
-
await repos.
|
|
40
|
+
await repos.updateAction.completeUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
|
|
41
41
|
};
|
|
42
42
|
}
|