@chevre/domain 22.13.0-alpha.2 → 22.13.0-alpha.4
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.
|
@@ -56,6 +56,7 @@ type IKeyOfProjection4minimizedEvent<T extends AvailableEventType> = T extends f
|
|
|
56
56
|
type IUnset<T extends AvailableEventType> = {
|
|
57
57
|
[key in keyof factory.event.IEvent<T>]?: 1;
|
|
58
58
|
};
|
|
59
|
+
export type ICreatingEvent4ttts = Pick<factory.event.IAttributes<factory.eventType.ScreeningEvent>, 'additionalProperty' | 'doorTime' | 'endDate' | 'eventStatus' | 'location' | 'name' | 'offers' | 'organizer' | 'project' | 'startDate' | 'superEvent' | 'typeOf'>;
|
|
59
60
|
/**
|
|
60
61
|
* イベントリポジトリ
|
|
61
62
|
*/
|
|
@@ -128,15 +129,21 @@ export declare class EventRepo {
|
|
|
128
129
|
}): Promise<{
|
|
129
130
|
id: string;
|
|
130
131
|
}>;
|
|
131
|
-
|
|
132
|
+
/**
|
|
133
|
+
* sskts専用
|
|
134
|
+
*/
|
|
135
|
+
saveManyEvents(params: {
|
|
132
136
|
id: string;
|
|
133
|
-
attributes: factory.event.IAttributes<
|
|
134
|
-
$unset?: IUnset<
|
|
137
|
+
attributes: factory.event.IAttributes<factory.eventType.ScreeningEvent>;
|
|
138
|
+
$unset?: IUnset<factory.eventType.ScreeningEvent>;
|
|
135
139
|
upsert: boolean;
|
|
136
140
|
}[]): Promise<void>;
|
|
137
|
-
|
|
141
|
+
/**
|
|
142
|
+
* tttsイベントを識別子によって冪等作成する
|
|
143
|
+
*/
|
|
144
|
+
saveEventByIdentifier4ttts(params: {
|
|
138
145
|
oldEventId: string;
|
|
139
|
-
attributes:
|
|
146
|
+
attributes: ICreatingEvent4ttts;
|
|
140
147
|
}): Promise<{
|
|
141
148
|
id: string;
|
|
142
149
|
}>;
|
package/lib/chevre/repo/event.js
CHANGED
|
@@ -553,6 +553,9 @@ class EventRepo {
|
|
|
553
553
|
return { id: savedEventId }; // optimize(2024-07-31~)
|
|
554
554
|
});
|
|
555
555
|
}
|
|
556
|
+
/**
|
|
557
|
+
* sskts専用
|
|
558
|
+
*/
|
|
556
559
|
saveManyEvents(params) {
|
|
557
560
|
return __awaiter(this, void 0, void 0, function* () {
|
|
558
561
|
const bulkWriteOps = [];
|
|
@@ -586,10 +589,14 @@ class EventRepo {
|
|
|
586
589
|
}
|
|
587
590
|
});
|
|
588
591
|
}
|
|
589
|
-
|
|
592
|
+
/**
|
|
593
|
+
* tttsイベントを識別子によって冪等作成する
|
|
594
|
+
*/
|
|
595
|
+
saveEventByIdentifier4ttts(params) {
|
|
590
596
|
return __awaiter(this, void 0, void 0, function* () {
|
|
591
|
-
|
|
592
|
-
const _a = params.attributes, {
|
|
597
|
+
const { oldEventId } = params;
|
|
598
|
+
const _a = params.attributes, { project, typeOf } = _a, updateFields = __rest(_a, ["project", "typeOf"]);
|
|
599
|
+
const identifier = oldEventId;
|
|
593
600
|
const uniqid = yield Promise.resolve().then(() => require('uniqid'));
|
|
594
601
|
const id = uniqid();
|
|
595
602
|
const doc = yield this.eventModel.findOneAndUpdate({
|
|
@@ -598,13 +605,18 @@ class EventRepo {
|
|
|
598
605
|
// 追加特性をキーに更新
|
|
599
606
|
additionalProperty: {
|
|
600
607
|
$exists: true,
|
|
601
|
-
$all: [{ name: 'oldEventId', value:
|
|
608
|
+
$all: [{ name: 'oldEventId', value: oldEventId }]
|
|
602
609
|
}
|
|
603
610
|
},
|
|
604
611
|
// upsertの場合、createがありうるので属性を除外しない
|
|
605
612
|
{
|
|
606
|
-
$setOnInsert:
|
|
607
|
-
|
|
613
|
+
$setOnInsert: {
|
|
614
|
+
_id: id,
|
|
615
|
+
typeOf,
|
|
616
|
+
project,
|
|
617
|
+
identifier // イベントコードを必ず追加(2025-09-03~)
|
|
618
|
+
// ...(typeof identifier === 'string' && identifier !== '') ? { identifier } : undefined
|
|
619
|
+
},
|
|
608
620
|
$set: updateFields
|
|
609
621
|
}, { upsert: true, new: true, projection: { _id: 1 } })
|
|
610
622
|
.lean()
|
|
@@ -5,7 +5,7 @@ import type * as COA from '@motionpicture/coa-service';
|
|
|
5
5
|
import type { ActionRepo } from '../repo/action';
|
|
6
6
|
import type { CategoryCodeRepo } from '../repo/categoryCode';
|
|
7
7
|
import type { CreativeWorkRepo } from '../repo/creativeWork';
|
|
8
|
-
import type { EventRepo } from '../repo/event';
|
|
8
|
+
import type { EventRepo, ICreatingEvent4ttts } from '../repo/event';
|
|
9
9
|
import type { EventSeriesRepo } from '../repo/eventSeries';
|
|
10
10
|
import type { MovieTheaterRepo } from '../repo/place/movieTheater';
|
|
11
11
|
import type { ScreeningRoomRepo } from '../repo/place/screeningRoom';
|
|
@@ -71,7 +71,7 @@ export declare function updateEvent4ttts(params: {
|
|
|
71
71
|
/**
|
|
72
72
|
* イベント属性
|
|
73
73
|
*/
|
|
74
|
-
attributes:
|
|
74
|
+
attributes: ICreatingEvent4ttts;
|
|
75
75
|
project: {
|
|
76
76
|
id: string;
|
|
77
77
|
};
|
|
@@ -87,4 +87,4 @@ export declare function updateEvent4ttts(params: {
|
|
|
87
87
|
setting: SettingRepo;
|
|
88
88
|
task: TaskRepo;
|
|
89
89
|
}) => Promise<void>;
|
|
90
|
-
export {};
|
|
90
|
+
export { ICreatingEvent4ttts };
|
|
@@ -874,7 +874,7 @@ function updateEvent4ttts(params) {
|
|
|
874
874
|
const action = yield repos.action.start(actionAttributes);
|
|
875
875
|
let savedEvent;
|
|
876
876
|
try {
|
|
877
|
-
savedEvent = yield repos.event.
|
|
877
|
+
savedEvent = yield repos.event.saveEventByIdentifier4ttts({
|
|
878
878
|
oldEventId: params.oldEventId,
|
|
879
879
|
attributes: params.attributes
|
|
880
880
|
});
|
|
@@ -118,7 +118,7 @@ schedule, createDate) {
|
|
|
118
118
|
// return Array.isArray(m.member.hasRole) && m.member.hasRole.some((r) => AVAILABLE_ROLE_NAMES.includes(r.roleName));
|
|
119
119
|
// });
|
|
120
120
|
for (const performanceInfo of targetInfo) {
|
|
121
|
-
const
|
|
121
|
+
const oldEventId = [
|
|
122
122
|
// tslint:disable-next-line:no-magic-numbers
|
|
123
123
|
performanceInfo.day.slice(-6),
|
|
124
124
|
workPerformedIdentifier,
|
|
@@ -215,22 +215,22 @@ schedule, createDate) {
|
|
|
215
215
|
// 旧フォーマットIDを追加特性に追加(2022-09-08~)
|
|
216
216
|
additionalProperty: [
|
|
217
217
|
{ name: 'tourNumber', value: String(performanceInfo.tour_number) },
|
|
218
|
-
{ name: 'oldEventId', value:
|
|
218
|
+
{ name: 'oldEventId', value: oldEventId }
|
|
219
219
|
],
|
|
220
220
|
// organizer追加(2023-07-12~)
|
|
221
221
|
organizer: { id: seller.id }
|
|
222
222
|
};
|
|
223
223
|
// domain.serviceで実装(2022-09-10~)
|
|
224
|
-
debug('updating event...',
|
|
224
|
+
debug('updating event...', oldEventId, eventAttributes.startDate);
|
|
225
225
|
yield (0, event_1.updateEvent4ttts)({
|
|
226
|
-
oldEventId
|
|
226
|
+
oldEventId,
|
|
227
227
|
attributes: eventAttributes,
|
|
228
228
|
project: { id: eventAttributes.project.id },
|
|
229
229
|
agent: eventAttributes.project
|
|
230
230
|
})(repos
|
|
231
231
|
// settings
|
|
232
232
|
);
|
|
233
|
-
debug('event update(updateEvent4ttts)',
|
|
233
|
+
debug('event update(updateEvent4ttts)', oldEventId, eventAttributes.startDate);
|
|
234
234
|
}
|
|
235
235
|
debug(targetInfo.length, 'events updated');
|
|
236
236
|
});
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "4.398.0-alpha.
|
|
14
|
+
"@chevre/factory": "4.398.0-alpha.3",
|
|
15
15
|
"@cinerino/sdk": "12.2.0",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.4.0-alpha.1",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"postversion": "git push origin --tags",
|
|
116
116
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
117
117
|
},
|
|
118
|
-
"version": "22.13.0-alpha.
|
|
118
|
+
"version": "22.13.0-alpha.4"
|
|
119
119
|
}
|