@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
|
@@ -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 { EventOfferRepo } from '../../../repo/eventOffer';
|
|
4
4
|
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
@@ -12,7 +12,7 @@ export declare function deleteResourcesBySeller(params: {
|
|
|
12
12
|
};
|
|
13
13
|
ids: string[];
|
|
14
14
|
}): (repos: {
|
|
15
|
-
|
|
15
|
+
updateAction: UpdateActionRepo;
|
|
16
16
|
event: EventRepo;
|
|
17
17
|
eventOffer: EventOfferRepo;
|
|
18
18
|
eventSeries: EventSeriesRepo;
|
|
@@ -14,8 +14,8 @@ function deleteResourcesBySeller(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 deleteMemberResult = await repos.member.deleteManyByMemberOfId({
|
|
@@ -65,14 +65,14 @@ function deleteResourcesBySeller(params) {
|
|
|
65
65
|
}
|
|
66
66
|
catch (error) {
|
|
67
67
|
try {
|
|
68
|
-
await repos.
|
|
68
|
+
await repos.updateAction.giveUpUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
|
|
69
69
|
}
|
|
70
70
|
catch (_) {
|
|
71
71
|
// no op
|
|
72
72
|
}
|
|
73
73
|
throw error;
|
|
74
74
|
}
|
|
75
|
-
await repos.
|
|
75
|
+
await repos.updateAction.completeUpdateAction({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.call = call;
|
|
4
4
|
const factory_1 = require("../../factory");
|
|
5
|
-
const
|
|
5
|
+
const updateAction_1 = require("../../repo/updateAction");
|
|
6
6
|
const aggregateOffer_1 = require("../../repo/aggregateOffer");
|
|
7
7
|
const categoryCode_1 = require("../../repo/categoryCode");
|
|
8
8
|
const event_1 = require("../../repo/event");
|
|
@@ -27,7 +27,6 @@ const deleteResourcesByProduct_1 = require("./onResourceDeleted/deleteResourcesB
|
|
|
27
27
|
const deleteResourcesByRoom_1 = require("./onResourceDeleted/deleteResourcesByRoom");
|
|
28
28
|
const deleteResourcesBySeller_1 = require("./onResourceDeleted/deleteResourcesBySeller");
|
|
29
29
|
const onHasPOSUpdated_1 = require("./onResourceUpdated/onHasPOSUpdated");
|
|
30
|
-
// import { syncCategoryCode } from './onResourceUpdated/syncCategoryCode';
|
|
31
30
|
const syncOfferCatalog_1 = require("./onResourceUpdated/syncOfferCatalog");
|
|
32
31
|
/**
|
|
33
32
|
* タスク実行関数
|
|
@@ -35,7 +34,7 @@ const syncOfferCatalog_1 = require("./onResourceUpdated/syncOfferCatalog");
|
|
|
35
34
|
function call(params) {
|
|
36
35
|
return async ({ connection }) => {
|
|
37
36
|
await onResourceDeleted(params.data)({
|
|
38
|
-
|
|
37
|
+
updateAction: new updateAction_1.UpdateActionRepo(connection),
|
|
39
38
|
aggregateOffer: new aggregateOffer_1.AggregateOfferRepo(connection),
|
|
40
39
|
categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
|
|
41
40
|
event: new event_1.EventRepo(connection),
|
|
@@ -59,11 +59,10 @@ function call(params) {
|
|
|
59
59
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
60
60
|
auth: coaAuthClient
|
|
61
61
|
}, { timeout: (await settings.getByKey('coa')).timeoutMaster });
|
|
62
|
-
const {
|
|
62
|
+
const { object } = params.data;
|
|
63
63
|
if (object.typeOf === factory_1.factory.eventType.ScreeningEventSeries) {
|
|
64
64
|
await syncEventSeries({
|
|
65
65
|
project: { id: params.project.id },
|
|
66
|
-
agent,
|
|
67
66
|
object,
|
|
68
67
|
sameAs: { id: params.id }
|
|
69
68
|
})({
|
|
@@ -78,7 +77,6 @@ function call(params) {
|
|
|
78
77
|
else if (object.typeOf === factory_1.factory.eventType.ScreeningEvent) {
|
|
79
78
|
await syncEvents({
|
|
80
79
|
project: { id: params.project.id },
|
|
81
|
-
agent,
|
|
82
80
|
object,
|
|
83
81
|
sameAs: { id: params.id }
|
|
84
82
|
})({
|
|
@@ -96,7 +94,7 @@ function call(params) {
|
|
|
96
94
|
catch (error) {
|
|
97
95
|
let throwsError = true;
|
|
98
96
|
// アクションが存在すればタスクを実行済扱いにする
|
|
99
|
-
const action = (await updateActionRepo.
|
|
97
|
+
const action = (await updateActionRepo.findUpdateActionsBySameAs({
|
|
100
98
|
sameAs: { id: { $eq: params.id } },
|
|
101
99
|
typeOf: { $eq: factory_1.factory.actionType.ReplaceAction }
|
|
102
100
|
})).shift();
|
|
@@ -115,17 +113,22 @@ function call(params) {
|
|
|
115
113
|
function syncEventSeries(params) {
|
|
116
114
|
return async (repos) => {
|
|
117
115
|
const { locationBranchCode, titleBranchNum, titleCode } = params.object;
|
|
116
|
+
const instrument = {
|
|
117
|
+
theaterCode: params.object.locationBranchCode,
|
|
118
|
+
typeOf: 'WebAPI',
|
|
119
|
+
identifier: factory_1.factory.service.webAPI.Identifier.COA
|
|
120
|
+
};
|
|
118
121
|
const actionAttributes = {
|
|
119
122
|
project: { typeOf: factory_1.factory.organizationType.Project, id: params.project.id },
|
|
120
123
|
typeOf: factory_1.factory.actionType.ReplaceAction,
|
|
121
|
-
agent: params.
|
|
124
|
+
agent: { typeOf: factory_1.factory.organizationType.Project, id: params.project.id },
|
|
122
125
|
// eslint-disable-next-line no-warning-comments
|
|
123
126
|
// TODO define object
|
|
124
127
|
object: {
|
|
125
128
|
...params.object,
|
|
126
129
|
typeOf: factory_1.factory.eventType.ScreeningEventSeries
|
|
127
130
|
}, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
128
|
-
|
|
131
|
+
instrument,
|
|
129
132
|
targetCollection: { typeOf: factory_1.factory.eventType.ScreeningEventSeries },
|
|
130
133
|
sameAs: { id: params.sameAs.id, typeOf: 'Task' }
|
|
131
134
|
};
|
|
@@ -184,17 +187,22 @@ function syncEventSeries(params) {
|
|
|
184
187
|
function syncEvents(params) {
|
|
185
188
|
return async (repos) => {
|
|
186
189
|
const { locationBranchCode, titleBranchNum, titleCode, roomCode, startDate } = params.object;
|
|
190
|
+
const instrument = {
|
|
191
|
+
theaterCode: params.object.locationBranchCode,
|
|
192
|
+
typeOf: 'WebAPI',
|
|
193
|
+
identifier: factory_1.factory.service.webAPI.Identifier.COA
|
|
194
|
+
};
|
|
187
195
|
const actionAttributes = {
|
|
188
196
|
project: { typeOf: factory_1.factory.organizationType.Project, id: params.project.id },
|
|
189
197
|
typeOf: factory_1.factory.actionType.ReplaceAction,
|
|
190
|
-
agent: params.
|
|
198
|
+
agent: { typeOf: factory_1.factory.organizationType.Project, id: params.project.id },
|
|
191
199
|
// eslint-disable-next-line no-warning-comments
|
|
192
200
|
// TODO define object
|
|
193
201
|
object: {
|
|
194
202
|
...params.object,
|
|
195
203
|
typeOf: factory_1.factory.eventType.ScreeningEvent
|
|
196
204
|
}, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
197
|
-
|
|
205
|
+
instrument,
|
|
198
206
|
targetCollection: { typeOf: factory_1.factory.eventType.ScreeningEvent },
|
|
199
207
|
sameAs: { id: params.sameAs.id, typeOf: 'Task' }
|
|
200
208
|
};
|
|
@@ -2,6 +2,7 @@ import { factory } from '../../factory';
|
|
|
2
2
|
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
3
3
|
import type { AccountingReportRepo } from '../../repo/accountingReport';
|
|
4
4
|
import type { ActionRepo } from '../../repo/action';
|
|
5
|
+
import type { UpdateActionRepo } from '../../repo/updateAction';
|
|
5
6
|
import type { AdminTransactionRepo } from '../../repo/adminTransaction';
|
|
6
7
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
7
8
|
import type { NoteRepo } from '../../repo/note';
|
|
@@ -13,6 +14,7 @@ interface IDeleteTransactionRepos {
|
|
|
13
14
|
acceptedOffer: AcceptedOfferRepo;
|
|
14
15
|
accountingReport: AccountingReportRepo;
|
|
15
16
|
action: ActionRepo;
|
|
17
|
+
updateAction: UpdateActionRepo;
|
|
16
18
|
adminTransaction: AdminTransactionRepo;
|
|
17
19
|
assetTransaction: AssetTransactionRepo;
|
|
18
20
|
note: NoteRepo;
|
|
@@ -71,7 +71,7 @@ function deleteTransactionById(params) {
|
|
|
71
71
|
let deletedReservationNumbers = [];
|
|
72
72
|
let deleteActionResult;
|
|
73
73
|
let deleteOrderResult;
|
|
74
|
-
const action = await repos.
|
|
74
|
+
const action = await repos.updateAction.startUpdateAction(actionAttributes);
|
|
75
75
|
try {
|
|
76
76
|
const transactionTypeOf = transaction.typeOf;
|
|
77
77
|
switch (transactionTypeOf) {
|
|
@@ -146,7 +146,7 @@ function deleteTransactionById(params) {
|
|
|
146
146
|
}
|
|
147
147
|
catch (error) {
|
|
148
148
|
try {
|
|
149
|
-
await repos.
|
|
149
|
+
await repos.updateAction.giveUpUpdateAction({ typeOf: action.typeOf, id: action.id, error });
|
|
150
150
|
}
|
|
151
151
|
catch (__) {
|
|
152
152
|
// 失敗したら仕方ない
|
|
@@ -166,6 +166,6 @@ function deleteTransactionById(params) {
|
|
|
166
166
|
deleteOrderResult // 2026-07-10~
|
|
167
167
|
// ...(deleteMessagessResult !== undefined) ? { deleteMessagessResult } : undefined
|
|
168
168
|
};
|
|
169
|
-
await repos.
|
|
169
|
+
await repos.updateAction.completeUpdateAction({ typeOf: action.typeOf, id: action.id, result: actionResult });
|
|
170
170
|
};
|
|
171
171
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.1090.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.1090.0",
|
|
14
|
-
"@chevre/factory": "10.3.0-alpha.
|
|
14
|
+
"@chevre/factory": "10.3.0-alpha.5",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
16
|
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"postversion": "git push origin --tags",
|
|
89
89
|
"prepublishOnly": "npm run clean && npm run build"
|
|
90
90
|
},
|
|
91
|
-
"version": "26.0.0-alpha.
|
|
91
|
+
"version": "26.0.0-alpha.29"
|
|
92
92
|
}
|