@chevre/domain 23.1.0-alpha.17 → 23.1.0-alpha.18
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.
|
@@ -79,8 +79,9 @@ export declare class EventRepo {
|
|
|
79
79
|
* 特定の追加特性をキーにして、存在しなければ作成する(複数対応)
|
|
80
80
|
* 施設コンテンツとルームは1つに限定
|
|
81
81
|
* 存在すれば、特定の属性のみ更新する
|
|
82
|
+
* @deprecated migrate to upsertManyScreeningEventByIdentifier
|
|
82
83
|
*/
|
|
83
|
-
|
|
84
|
+
upsertManyByAdditionalPropertyDeprecated(params: {
|
|
84
85
|
events: factory.event.screeningEvent.IAttributes[];
|
|
85
86
|
additionalPropertyFilter: {
|
|
86
87
|
name: string;
|
package/lib/chevre/repo/event.js
CHANGED
|
@@ -295,9 +295,10 @@ class EventRepo {
|
|
|
295
295
|
* 特定の追加特性をキーにして、存在しなければ作成する(複数対応)
|
|
296
296
|
* 施設コンテンツとルームは1つに限定
|
|
297
297
|
* 存在すれば、特定の属性のみ更新する
|
|
298
|
+
* @deprecated migrate to upsertManyScreeningEventByIdentifier
|
|
298
299
|
*/
|
|
299
300
|
// tslint:disable-next-line:max-func-body-length
|
|
300
|
-
|
|
301
|
+
upsertManyByAdditionalPropertyDeprecated(params, options) {
|
|
301
302
|
return __awaiter(this, void 0, void 0, function* () {
|
|
302
303
|
const { update } = options;
|
|
303
304
|
const bulkWriteOps = [];
|
package/package.json
CHANGED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
import * as mongoose from 'mongoose';
|
|
3
|
-
import { chevre } from '../../../lib/index';
|
|
4
|
-
|
|
5
|
-
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
6
|
-
|
|
7
|
-
// tslint:disable-next-line:max-func-body-length
|
|
8
|
-
async function main() {
|
|
9
|
-
const now = new Date();
|
|
10
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
11
|
-
|
|
12
|
-
const eventRepo = await chevre.repository.Event.createInstance(mongoose.connection);
|
|
13
|
-
const result = await eventRepo.upsertManyByAdditionalProperty(
|
|
14
|
-
{
|
|
15
|
-
events: [
|
|
16
|
-
{
|
|
17
|
-
additionalProperty: [
|
|
18
|
-
{
|
|
19
|
-
name: 'sampleCreateId',
|
|
20
|
-
value: 'akeuu512i-202410171410-01'
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
project: {
|
|
24
|
-
id: PROJECT_ID,
|
|
25
|
-
typeOf: chevre.factory.organizationType.Project
|
|
26
|
-
},
|
|
27
|
-
typeOf: chevre.factory.eventType.ScreeningEvent,
|
|
28
|
-
doorTime: new Date('2024-10-17T05:30:00.000Z'),
|
|
29
|
-
endDate: new Date('2024-10-17T05:45:00.000Z'),
|
|
30
|
-
eventStatus: chevre.factory.eventStatusType.EventScheduled,
|
|
31
|
-
// eventStatus: chevre.factory.eventStatusType.EventCancelled,
|
|
32
|
-
location: {
|
|
33
|
-
typeOf: chevre.factory.placeType.ScreeningRoom,
|
|
34
|
-
branchCode: '10',
|
|
35
|
-
name: {
|
|
36
|
-
ja: 'シネマ1',
|
|
37
|
-
en: 'CINEMA1'
|
|
38
|
-
},
|
|
39
|
-
address: {
|
|
40
|
-
ja: '7階',
|
|
41
|
-
en: '7F'
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
name: {
|
|
45
|
-
en: 'Ocean\'s Eight',
|
|
46
|
-
ja: 'オーシャンズ8'
|
|
47
|
-
},
|
|
48
|
-
offers: {
|
|
49
|
-
typeOf: chevre.factory.offerType.Offer,
|
|
50
|
-
// availabilityEnds: new Date('2024-09-15T11:45:00.000Z'),
|
|
51
|
-
// availabilityStarts: new Date('2024-09-01T15:00:00.000Z'),
|
|
52
|
-
eligibleQuantity: {
|
|
53
|
-
typeOf: 'QuantitativeValue',
|
|
54
|
-
unitCode: chevre.factory.unitCode.C62,
|
|
55
|
-
maxValue: 10
|
|
56
|
-
},
|
|
57
|
-
itemOffered: {
|
|
58
|
-
id: '6603a61f0c914b6c7fd18f99',
|
|
59
|
-
name: {
|
|
60
|
-
ja: 'アップロードテスト用(ムビチケあり)'
|
|
61
|
-
},
|
|
62
|
-
serviceOutput: {
|
|
63
|
-
typeOf: chevre.factory.reservationType.EventReservation,
|
|
64
|
-
reservedTicket: {
|
|
65
|
-
typeOf: 'Ticket',
|
|
66
|
-
ticketedSeat: {
|
|
67
|
-
typeOf: chevre.factory.placeType.Seat
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
typeOf: chevre.factory.product.ProductType.EventService,
|
|
72
|
-
availableChannel: {
|
|
73
|
-
typeOf: 'ServiceChannel',
|
|
74
|
-
serviceLocation: {
|
|
75
|
-
typeOf: chevre.factory.placeType.ScreeningRoom,
|
|
76
|
-
branchCode: '10',
|
|
77
|
-
name: {
|
|
78
|
-
ja: 'シネマ1',
|
|
79
|
-
en: 'CINEMA1'
|
|
80
|
-
},
|
|
81
|
-
containedInPlace: {
|
|
82
|
-
typeOf: chevre.factory.placeType.MovieTheater,
|
|
83
|
-
id: '5bfb841d5a78d7948369979a',
|
|
84
|
-
branchCode: '118',
|
|
85
|
-
name: {
|
|
86
|
-
ja: 'シネモーション赤坂 ',
|
|
87
|
-
en: 'CineMotion Akasaka'
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
serviceType: {
|
|
93
|
-
codeValue: '0001',
|
|
94
|
-
id: '64caf203c73a205ccefe80c5',
|
|
95
|
-
inCodeSet: {
|
|
96
|
-
typeOf: 'CategoryCodeSet',
|
|
97
|
-
identifier: chevre.factory.categoryCode.CategorySetIdentifier.ServiceType
|
|
98
|
-
},
|
|
99
|
-
typeOf: 'CategoryCode'
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
// validFrom: new Date('2024-09-01T15:00:00.000Z'),
|
|
103
|
-
// validThrough: new Date('2024-09-15T11:45:00.000Z'),
|
|
104
|
-
seller: {
|
|
105
|
-
typeOf: chevre.factory.organizationType.Corporation,
|
|
106
|
-
id: '59d20831e53ebc2b4e774466',
|
|
107
|
-
name: {
|
|
108
|
-
ja: 'シネモーション赤坂',
|
|
109
|
-
en: 'CineMotion Akasaka'
|
|
110
|
-
},
|
|
111
|
-
makesOffer: [
|
|
112
|
-
{
|
|
113
|
-
typeOf: chevre.factory.offerType.Offer,
|
|
114
|
-
availableAtOrFrom: { id: '51qbjcfr72h62m06vtv5kkhgje' },
|
|
115
|
-
availabilityEnds: now,
|
|
116
|
-
availabilityStarts: now,
|
|
117
|
-
validFrom: now,
|
|
118
|
-
validThrough: now
|
|
119
|
-
}
|
|
120
|
-
]
|
|
121
|
-
},
|
|
122
|
-
unacceptedPaymentMethod: [
|
|
123
|
-
'MovieTicket'
|
|
124
|
-
]
|
|
125
|
-
},
|
|
126
|
-
organizer: {
|
|
127
|
-
id: '59d20831e53ebc2b4e774466'
|
|
128
|
-
},
|
|
129
|
-
startDate: new Date('2024-10-17T05:30:00.000Z'),
|
|
130
|
-
superEvent: {
|
|
131
|
-
typeOf: chevre.factory.eventType.ScreeningEventSeries,
|
|
132
|
-
id: 'akeuu512i',
|
|
133
|
-
videoFormat: [
|
|
134
|
-
{
|
|
135
|
-
typeOf: '2D',
|
|
136
|
-
name: '2D'
|
|
137
|
-
}
|
|
138
|
-
],
|
|
139
|
-
soundFormat: [],
|
|
140
|
-
workPerformed: {
|
|
141
|
-
typeOf: chevre.factory.creativeWorkType.Movie,
|
|
142
|
-
identifier: '00002',
|
|
143
|
-
id: '5bfb841d5a78d79483699803',
|
|
144
|
-
name: {
|
|
145
|
-
en: 'Ocean\'s Eight',
|
|
146
|
-
ja: 'オーシャンズ8'
|
|
147
|
-
},
|
|
148
|
-
duration: 'PT1H50M'
|
|
149
|
-
},
|
|
150
|
-
location: {
|
|
151
|
-
typeOf: chevre.factory.placeType.MovieTheater,
|
|
152
|
-
id: '5bfb841d5a78d7948369979a',
|
|
153
|
-
branchCode: '118',
|
|
154
|
-
name: {
|
|
155
|
-
ja: 'シネモーション赤坂 ',
|
|
156
|
-
en: 'CineMotion Akasaka'
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
kanaName: '',
|
|
160
|
-
name: {
|
|
161
|
-
en: 'Ocean\'s Eight',
|
|
162
|
-
ja: 'オーシャンズ8'
|
|
163
|
-
},
|
|
164
|
-
additionalProperty: [],
|
|
165
|
-
startDate: new Date('2020-08-31T15:00:00.000Z'),
|
|
166
|
-
endDate: new Date('2030-01-01T15:00:00.000Z'),
|
|
167
|
-
description: {
|
|
168
|
-
en: '2018 United States crime movie.',
|
|
169
|
-
ja: '2018年のアメリカ合衆国の犯罪映画。'
|
|
170
|
-
},
|
|
171
|
-
headline: {
|
|
172
|
-
ja: '2018/12/14'
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
],
|
|
177
|
-
additionalPropertyFilter: { name: 'sampleCreateId' },
|
|
178
|
-
eventSeries: {
|
|
179
|
-
id: 'akeuu512i'
|
|
180
|
-
},
|
|
181
|
-
screeningRoom: {
|
|
182
|
-
branchCode: '10'
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
{ update: false }
|
|
186
|
-
);
|
|
187
|
-
// tslint:disable-next-line:no-null-keyword
|
|
188
|
-
console.dir(result, { depth: null });
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
main()
|
|
192
|
-
.then(console.log)
|
|
193
|
-
.catch(console.error);
|