@chevre/domain 21.25.0-alpha.15 → 21.25.0-alpha.17
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/example/src/chevre/migrateScreeningEventSeriesOffers.ts +87 -0
- package/lib/chevre/emailMessageBuilder.d.ts +0 -1
- package/lib/chevre/service/offer/event/authorize.d.ts +1 -0
- package/lib/chevre/service/offer/event/authorize.js +3 -2
- package/lib/chevre/service/offer/event/factory.d.ts +1 -0
- package/lib/chevre/service/offer/event/factory.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +1 -0
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +5 -3
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.d.ts +1 -0
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +1 -0
- package/lib/chevre/service/offer/eventServiceByCOA/factory.js +2 -1
- package/lib/chevre/service/task/returnPayTransaction.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +22 -7
- package/package.json +2 -2
- package/example/src/chevre/migrateMovieAvailabilityStarts.ts +0 -83
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as moment from 'moment';
|
|
3
|
+
import * as mongoose from 'mongoose';
|
|
4
|
+
|
|
5
|
+
import { chevre } from '../../../lib/index';
|
|
6
|
+
|
|
7
|
+
// const project = { id: String(process.env.PROJECT_ID) };
|
|
8
|
+
const EXCLUDED_PROJECT_ID = process.env.EXCLUDED_PROJECT_ID;
|
|
9
|
+
|
|
10
|
+
// tslint:disable-next-line:max-func-body-length
|
|
11
|
+
async function main() {
|
|
12
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
13
|
+
|
|
14
|
+
const eventRepo = await chevre.repository.Event.createInstance(mongoose.connection);
|
|
15
|
+
|
|
16
|
+
const cursor = eventRepo.getCursor(
|
|
17
|
+
{
|
|
18
|
+
typeOf: { $eq: chevre.factory.eventType.ScreeningEventSeries },
|
|
19
|
+
// typeOf: { $eq: chevre.factory.eventType.ScreeningEvent },
|
|
20
|
+
'project.id': { $ne: EXCLUDED_PROJECT_ID }
|
|
21
|
+
// 'offers.availabilityEnds': { $exists: true }
|
|
22
|
+
},
|
|
23
|
+
{}
|
|
24
|
+
);
|
|
25
|
+
console.log('events found');
|
|
26
|
+
|
|
27
|
+
let i = 0;
|
|
28
|
+
let updateCount = 0;
|
|
29
|
+
const projectIds: string[] = [];
|
|
30
|
+
let createdAtLatest: Date | undefined;
|
|
31
|
+
let updatedAtLatest: Date | undefined;
|
|
32
|
+
await cursor.eachAsync(async (doc) => {
|
|
33
|
+
i += 1;
|
|
34
|
+
const event: chevre.factory.event.screeningEventSeries.IEvent = doc.toObject();
|
|
35
|
+
|
|
36
|
+
const unacceptedPaymentMethod = event.offers?.unacceptedPaymentMethod;
|
|
37
|
+
const alreadyMigrated =
|
|
38
|
+
(!Array.isArray(unacceptedPaymentMethod))
|
|
39
|
+
|| (Array.isArray(unacceptedPaymentMethod) && unacceptedPaymentMethod.length === 0)
|
|
40
|
+
|| (Array.isArray(unacceptedPaymentMethod) && unacceptedPaymentMethod.length === 1 && unacceptedPaymentMethod[0] === 'MovieTicket');
|
|
41
|
+
|
|
42
|
+
if (alreadyMigrated) {
|
|
43
|
+
console.log(
|
|
44
|
+
'already migrated.', event.project.id, event.id, event.startDate, i);
|
|
45
|
+
} else {
|
|
46
|
+
projectIds.push(event.project.id);
|
|
47
|
+
if (createdAtLatest instanceof Date) {
|
|
48
|
+
if (moment(createdAtLatest)
|
|
49
|
+
.isBefore(moment((<any>event).createdAt))) {
|
|
50
|
+
createdAtLatest = (<any>event).createdAt;
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
createdAtLatest = (<any>event).createdAt;
|
|
54
|
+
}
|
|
55
|
+
if (updatedAtLatest instanceof Date) {
|
|
56
|
+
if (moment(updatedAtLatest)
|
|
57
|
+
.isBefore(moment((<any>event).updatedAt))) {
|
|
58
|
+
updatedAtLatest = (<any>event).updatedAt;
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
updatedAtLatest = (<any>event).updatedAt;
|
|
62
|
+
}
|
|
63
|
+
console.log(
|
|
64
|
+
'updating event...', event.project.id, event.id, event.startDate, unacceptedPaymentMethod,
|
|
65
|
+
(<any>event).createdAt,
|
|
66
|
+
(<any>event).updatedAt,
|
|
67
|
+
i
|
|
68
|
+
);
|
|
69
|
+
// await creativeWorkRepo.saveMovie(<any>{
|
|
70
|
+
// id: String(movie.id),
|
|
71
|
+
// 'offers.availabilityStarts': availabilityStarts
|
|
72
|
+
// });
|
|
73
|
+
updateCount += 1;
|
|
74
|
+
console.log('updated.', event.project.id, event.id, event.startDate, i);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
console.log(i, 'events checked');
|
|
79
|
+
console.log(updateCount, 'events updated');
|
|
80
|
+
console.log('projectIds:', [...new Set(projectIds)]);
|
|
81
|
+
console.log('createdAtLatest:', createdAtLatest);
|
|
82
|
+
console.log('updatedAtLatest:', updatedAtLatest);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
main()
|
|
86
|
+
.then()
|
|
87
|
+
.catch(console.error);
|
|
@@ -20,6 +20,5 @@ export declare function createReturnOrderMessage(params: {
|
|
|
20
20
|
*/
|
|
21
21
|
export declare function createRefundMessage(params: {
|
|
22
22
|
order: factory.order.IOrder;
|
|
23
|
-
paymentMethods: factory.order.IReferencedInvoice[];
|
|
24
23
|
email?: factory.creativeWork.message.email.ICustomization;
|
|
25
24
|
}): Promise<factory.creativeWork.message.email.ICreativeWork>;
|
|
@@ -41,7 +41,8 @@ function authorize(params) {
|
|
|
41
41
|
event: event,
|
|
42
42
|
transaction: transaction,
|
|
43
43
|
pendingTransaction: { typeOf: factory.assetTransactionType.Reserve, transactionNumber },
|
|
44
|
-
broker: params.object.broker
|
|
44
|
+
broker: params.object.broker,
|
|
45
|
+
useResultAcceptedOffers: params.options.useResultAcceptedOffers
|
|
45
46
|
});
|
|
46
47
|
const action = yield repos.action.start(actionAttributes);
|
|
47
48
|
try {
|
|
@@ -103,7 +104,7 @@ function authorize(params) {
|
|
|
103
104
|
const result = Object.assign({ priceCurrency: acceptedOffers[0].priceCurrency, amount: [], requestBody: {}, responseBody: {} }, (!noOfferSpecified) // オファー指定の場合のみ金額計算(2023-11-27~)
|
|
104
105
|
? {
|
|
105
106
|
price: (0, factory_1.acceptedOffers2amount)({ acceptedOffers: acceptedOffers4result }),
|
|
106
|
-
acceptedOffers: acceptedOffers4result
|
|
107
|
+
acceptedOffers: (params.options.useResultAcceptedOffers === true) ? acceptedOffers4result : []
|
|
107
108
|
}
|
|
108
109
|
: undefined);
|
|
109
110
|
return yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: result });
|
|
@@ -19,6 +19,7 @@ export declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
|
19
19
|
pendingTransaction: factory.action.authorize.offer.eventService.IChevrePendingTransaction;
|
|
20
20
|
transaction: factory.transaction.ITransaction<factory.transactionType.PlaceOrder>;
|
|
21
21
|
broker?: factory.reservation.IBroker<factory.reservationType.EventReservation>;
|
|
22
|
+
useResultAcceptedOffers: boolean;
|
|
22
23
|
}): factory.action.authorize.offer.eventService.IAttributes<factory.service.webAPI.Identifier.Chevre>;
|
|
23
24
|
export declare function acceptedOffers2amount(params: {
|
|
24
25
|
acceptedOffers: IResultAcceptedOffer[];
|
|
@@ -91,7 +91,7 @@ function createAuthorizeSeatReservationActionAttributes(params) {
|
|
|
91
91
|
return {
|
|
92
92
|
project: transaction.project,
|
|
93
93
|
typeOf: factory.actionType.AuthorizeAction,
|
|
94
|
-
object: Object.assign({ typeOf: factory.action.authorize.offer.eventService.ObjectType.SeatReservation, event: authorizeObjectEvent, acceptedOffer: acceptedOffers, pendingTransaction: params.pendingTransaction }, (params.broker !== undefined) ? { broker: params.broker } : undefined),
|
|
94
|
+
object: Object.assign(Object.assign({ typeOf: factory.action.authorize.offer.eventService.ObjectType.SeatReservation, event: authorizeObjectEvent, acceptedOffer: acceptedOffers, pendingTransaction: params.pendingTransaction }, (params.broker !== undefined) ? { broker: params.broker } : undefined), { useResultAcceptedOffers: params.useResultAcceptedOffers }),
|
|
95
95
|
agent: {
|
|
96
96
|
id: transaction.seller.id,
|
|
97
97
|
typeOf: transaction.seller.typeOf,
|
|
@@ -79,7 +79,8 @@ function authorize(params) {
|
|
|
79
79
|
acceptedOffers: [],
|
|
80
80
|
event: { id: params.object.event.id, typeOf: factory.eventType.ScreeningEvent },
|
|
81
81
|
transaction,
|
|
82
|
-
pendingTransaction
|
|
82
|
+
pendingTransaction,
|
|
83
|
+
useResultAcceptedOffers: params.options.useResultAcceptedOffers
|
|
83
84
|
});
|
|
84
85
|
const failedAction = yield repos.action.start(failedActionAttributes);
|
|
85
86
|
yield repos.action.giveUp({ typeOf: failedAction.typeOf, id: failedAction.id, error });
|
|
@@ -91,7 +92,8 @@ function authorize(params) {
|
|
|
91
92
|
acceptedOffers,
|
|
92
93
|
event: screeningEvent,
|
|
93
94
|
transaction,
|
|
94
|
-
pendingTransaction
|
|
95
|
+
pendingTransaction,
|
|
96
|
+
useResultAcceptedOffers: params.options.useResultAcceptedOffers
|
|
95
97
|
});
|
|
96
98
|
const action = yield repos.action.start(actionAttributes);
|
|
97
99
|
try {
|
|
@@ -112,7 +114,7 @@ function authorize(params) {
|
|
|
112
114
|
amount: eligibleMonetaryAmount,
|
|
113
115
|
requestBody: params.result.requestBody,
|
|
114
116
|
responseBody: params.result.responseBody,
|
|
115
|
-
acceptedOffers: acceptedOffers4result
|
|
117
|
+
acceptedOffers: (params.options.useResultAcceptedOffers === true) ? acceptedOffers4result : []
|
|
116
118
|
};
|
|
117
119
|
// add orderInTransaction(2024-01-15~)
|
|
118
120
|
if (params.options.useCreateOrderOnOfferAccepted) {
|
|
@@ -91,7 +91,7 @@ function changeOffers(params) {
|
|
|
91
91
|
.toDate(),
|
|
92
92
|
totalPrice: price
|
|
93
93
|
});
|
|
94
|
-
const actionResult = Object.assign(Object.assign({}, authorizeAction.result), { price: price, amount: eligibleMonetaryAmount, acceptedOffers: acceptedOffers4result });
|
|
94
|
+
const actionResult = Object.assign(Object.assign({}, authorizeAction.result), { price: price, amount: eligibleMonetaryAmount, acceptedOffers: (params.options.useResultAcceptedOffers === true) ? acceptedOffers4result : [] });
|
|
95
95
|
// ActiveActionStatus->CompletedActionStatusで再実装(2024-01-15~)
|
|
96
96
|
yield repos.action.reStart({ id: authorizeAction.id });
|
|
97
97
|
try {
|
|
@@ -7,6 +7,7 @@ export declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
|
7
7
|
event: Pick<IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>, 'id' | 'typeOf'>;
|
|
8
8
|
transaction: factory.transaction.ITransaction<factory.transactionType.PlaceOrder>;
|
|
9
9
|
pendingTransaction: factory.action.authorize.offer.eventService.ICOAPendingTransaction;
|
|
10
|
+
useResultAcceptedOffers: boolean;
|
|
10
11
|
}): factory.action.authorize.offer.eventService.IAttributes<WebAPIIdentifier.COA>;
|
|
11
12
|
/**
|
|
12
13
|
* 供給情報から承認アクションの価格を導き出す
|
|
@@ -23,7 +23,8 @@ function createAuthorizeSeatReservationActionAttributes(params) {
|
|
|
23
23
|
typeOf: factory.action.authorize.offer.eventService.ObjectType.SeatReservation,
|
|
24
24
|
acceptedOffer: params.acceptedOffers,
|
|
25
25
|
event: authorizeObjectEvent,
|
|
26
|
-
pendingTransaction: params.pendingTransaction
|
|
26
|
+
pendingTransaction: params.pendingTransaction,
|
|
27
|
+
useResultAcceptedOffers: params.useResultAcceptedOffers
|
|
27
28
|
};
|
|
28
29
|
return {
|
|
29
30
|
project: transaction.project,
|
|
@@ -182,7 +182,6 @@ function createStartRefundTransactionParams(params) {
|
|
|
182
182
|
paymentMethod: {
|
|
183
183
|
additionalProperty: params.object.additionalProperty,
|
|
184
184
|
name: params.object.name,
|
|
185
|
-
// typeOf: params.object.typeOf,
|
|
186
185
|
typeOf: paymentMethodType,
|
|
187
186
|
paymentMethodId: params.object.paymentMethodId
|
|
188
187
|
},
|
|
@@ -8,6 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
23
|
exports.createReturnPaymentMethodActions = void 0;
|
|
13
24
|
const emailMessageBuilder = require("../../../../emailMessageBuilder");
|
|
@@ -36,7 +47,7 @@ function createReturnPaymentMethodPotentialActions(params) {
|
|
|
36
47
|
if (emailCustomization !== undefined && emailCustomization !== null) {
|
|
37
48
|
const emailMessage = yield emailMessageBuilder.createRefundMessage({
|
|
38
49
|
order,
|
|
39
|
-
paymentMethods: [params.paymentMethod],
|
|
50
|
+
// paymentMethods: [params.paymentMethod],
|
|
40
51
|
email: emailCustomization
|
|
41
52
|
});
|
|
42
53
|
const sendActionPurpose = {
|
|
@@ -103,16 +114,18 @@ function createReturnPaymentMethodActions(params) {
|
|
|
103
114
|
.filter((paymentMethod) => {
|
|
104
115
|
return paymentMethod.issuedThrough.typeOf !== factory.service.paymentService.PaymentServiceType.MovieTicket;
|
|
105
116
|
})
|
|
106
|
-
.map((
|
|
117
|
+
.map((referencedInvoice) => __awaiter(this, void 0, void 0, function* () {
|
|
107
118
|
const potentialActionsOnRefund = yield createReturnPaymentMethodPotentialActions({
|
|
108
|
-
paymentMethod:
|
|
119
|
+
paymentMethod: { paymentMethodId: referencedInvoice.paymentMethodId },
|
|
109
120
|
order: params.order,
|
|
110
121
|
returnOrderActionParams: params.returnOrderActionParams
|
|
111
122
|
});
|
|
123
|
+
const { paymentStatus } = referencedInvoice, referencedInvoiceAsObject = __rest(referencedInvoice, ["paymentStatus"]);
|
|
124
|
+
const object = Object.assign(Object.assign({}, referencedInvoiceAsObject), { typeOf: 'Invoice' });
|
|
112
125
|
return {
|
|
113
126
|
project: order.project,
|
|
114
127
|
typeOf: factory.actionType.ReturnAction,
|
|
115
|
-
object
|
|
128
|
+
object,
|
|
116
129
|
agent: order.project,
|
|
117
130
|
recipient: {
|
|
118
131
|
typeOf: order.customer.typeOf,
|
|
@@ -171,16 +184,18 @@ function createReturnPaymentMethodIssuedThroughMovieTicketActions(params) {
|
|
|
171
184
|
}
|
|
172
185
|
return returnPaymentMethod;
|
|
173
186
|
})
|
|
174
|
-
.map((
|
|
187
|
+
.map((referencedInvoice) => __awaiter(this, void 0, void 0, function* () {
|
|
175
188
|
const potentialActionsOnRefund = yield createReturnPaymentMethodPotentialActions({
|
|
176
|
-
paymentMethod:
|
|
189
|
+
paymentMethod: { paymentMethodId: referencedInvoice.paymentMethodId },
|
|
177
190
|
order: params.order,
|
|
178
191
|
returnOrderActionParams: params.returnOrderActionParams
|
|
179
192
|
});
|
|
193
|
+
const { paymentStatus } = referencedInvoice, referencedInvoiceAsObject = __rest(referencedInvoice, ["paymentStatus"]);
|
|
194
|
+
const object = Object.assign(Object.assign({}, referencedInvoiceAsObject), { typeOf: 'Invoice' });
|
|
180
195
|
return {
|
|
181
196
|
project: order.project,
|
|
182
197
|
typeOf: factory.actionType.ReturnAction,
|
|
183
|
-
object
|
|
198
|
+
object,
|
|
184
199
|
agent: order.project,
|
|
185
200
|
recipient: {
|
|
186
201
|
typeOf: order.customer.typeOf,
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/credential-providers": "3.433.0",
|
|
13
|
-
"@chevre/factory": "4.360.0-alpha.
|
|
13
|
+
"@chevre/factory": "4.360.0-alpha.6",
|
|
14
14
|
"@cinerino/sdk": "5.13.0-alpha.3",
|
|
15
15
|
"@motionpicture/coa-service": "9.4.0",
|
|
16
16
|
"@motionpicture/gmo-service": "5.3.0",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"postversion": "git push origin --tags",
|
|
111
111
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
112
112
|
},
|
|
113
|
-
"version": "21.25.0-alpha.
|
|
113
|
+
"version": "21.25.0-alpha.17"
|
|
114
114
|
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
import * as moment from 'moment-timezone';
|
|
3
|
-
import * as mongoose from 'mongoose';
|
|
4
|
-
|
|
5
|
-
import { chevre } from '../../../lib/index';
|
|
6
|
-
|
|
7
|
-
// const project = { id: String(process.env.PROJECT_ID) };
|
|
8
|
-
// const EXCLUDED_PROJECT_ID = process.env.EXCLUDED_PROJECT_ID;
|
|
9
|
-
|
|
10
|
-
// tslint:disable-next-line:max-func-body-length
|
|
11
|
-
async function main() {
|
|
12
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
13
|
-
|
|
14
|
-
const creativeWorkRepo = await chevre.repository.CreativeWork.createInstance(mongoose.connection);
|
|
15
|
-
|
|
16
|
-
const cursor = creativeWorkRepo.getCursor(
|
|
17
|
-
{
|
|
18
|
-
// 'offers.availabilityEnds': { $exists: true }
|
|
19
|
-
},
|
|
20
|
-
{}
|
|
21
|
-
);
|
|
22
|
-
console.log('creativeWorks found');
|
|
23
|
-
|
|
24
|
-
let i = 0;
|
|
25
|
-
let updateCount = 0;
|
|
26
|
-
// let datePublishedUndefinedCount = 0;
|
|
27
|
-
// let datePublishedIsAfterNowCount = 0;
|
|
28
|
-
await cursor.eachAsync(async (doc) => {
|
|
29
|
-
i += 1;
|
|
30
|
-
const movie: chevre.factory.creativeWork.movie.ICreativeWork = doc.toObject();
|
|
31
|
-
|
|
32
|
-
const availabilityEnds = movie.offers.availabilityEnds;
|
|
33
|
-
let availabilityStarts = movie.offers.availabilityStarts;
|
|
34
|
-
const createdAt: Date = (<any>movie).createdAt;
|
|
35
|
-
if (!(createdAt instanceof Date)) {
|
|
36
|
-
throw new Error('createdAt not Date');
|
|
37
|
-
}
|
|
38
|
-
const alreadyMigrated = availabilityStarts instanceof Date
|
|
39
|
-
&& moment(availabilityStarts)
|
|
40
|
-
.isSame(moment(createdAt)
|
|
41
|
-
.tz('Asia/Tokyo')
|
|
42
|
-
.startOf('day')
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
if (alreadyMigrated) {
|
|
46
|
-
console.log(
|
|
47
|
-
'already exist...', movie.project.id, movie.id, movie.identifier, availabilityStarts, availabilityEnds, createdAt, i);
|
|
48
|
-
|
|
49
|
-
// if (moment(movie.datePublished)
|
|
50
|
-
// .isAfter(moment())) {
|
|
51
|
-
// datePublishedIsAfterNowCount += 1;
|
|
52
|
-
// }
|
|
53
|
-
} else {
|
|
54
|
-
// if (movie.datePublished === undefined) {
|
|
55
|
-
// console.error('movie.datePublished undefined', movie.project.id, movie.id, movie.identifier, i);
|
|
56
|
-
// // throw new Error('movie.datePublished undefined');
|
|
57
|
-
// datePublishedUndefinedCount += 1;
|
|
58
|
-
// }
|
|
59
|
-
|
|
60
|
-
availabilityStarts = moment(createdAt)
|
|
61
|
-
.tz('Asia/Tokyo')
|
|
62
|
-
.startOf('day')
|
|
63
|
-
.toDate();
|
|
64
|
-
console.log('updating movie...', movie.project.id, movie.id, movie.identifier, availabilityStarts, availabilityEnds, i);
|
|
65
|
-
await creativeWorkRepo.saveMovie(<any>{
|
|
66
|
-
id: String(movie.id),
|
|
67
|
-
'offers.availabilityStarts': availabilityStarts
|
|
68
|
-
});
|
|
69
|
-
updateCount += 1;
|
|
70
|
-
console.log('updated.', movie.project.id, movie.id, movie.identifier, availabilityStarts, availabilityEnds, i);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
console.log(i, 'creativeWorks checked');
|
|
75
|
-
console.log(updateCount, 'creativeWorks updated');
|
|
76
|
-
// console.log(datePublishedUndefinedCount, 'datePublishedUndefinedCount');
|
|
77
|
-
// console.log(datePublishedIsAfterNowCount, 'datePublishedIsAfterNowCount');
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
main()
|
|
82
|
-
.then()
|
|
83
|
-
.catch(console.error);
|