@chevre/domain 20.1.0-alpha.31 → 20.1.0-alpha.32
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// tslint:disable:no-console
|
|
2
|
-
|
|
2
|
+
import * as moment from 'moment';
|
|
3
3
|
import * as mongoose from 'mongoose';
|
|
4
4
|
|
|
5
5
|
import { chevre } from '../../../lib/index';
|
|
@@ -18,13 +18,12 @@ async function main() {
|
|
|
18
18
|
{
|
|
19
19
|
// 'project.id': { $eq: project.id },
|
|
20
20
|
'project.id': { $ne: EXCLUDED_PROJECT_ID },
|
|
21
|
-
typeOf: { $eq: chevre.factory.eventType.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// }
|
|
21
|
+
typeOf: { $eq: chevre.factory.eventType.ScreeningEvent },
|
|
22
|
+
startDate: {
|
|
23
|
+
$gte: moment()
|
|
24
|
+
.add(-1, 'month')
|
|
25
|
+
.toDate()
|
|
26
|
+
}
|
|
28
27
|
// _id: { $eq: 'al6aff83w' }
|
|
29
28
|
},
|
|
30
29
|
{
|
|
@@ -40,11 +39,11 @@ async function main() {
|
|
|
40
39
|
let updateCount = 0;
|
|
41
40
|
await cursor.eachAsync(async (doc) => {
|
|
42
41
|
i += 1;
|
|
43
|
-
const event: chevre.factory.event.
|
|
42
|
+
const event: chevre.factory.event.screeningEvent.IEvent = doc.toObject();
|
|
44
43
|
|
|
45
44
|
const additionalPropertyNamesOnEvent = event.additionalProperty?.map((p) => p.name);
|
|
46
45
|
if (Array.isArray(additionalPropertyNamesOnEvent) && additionalPropertyNamesOnEvent.length > 0) {
|
|
47
|
-
console.log(additionalPropertyNamesOnEvent.length, 'additionalPropertyNamesOnEvent found', event.project.id);
|
|
46
|
+
console.log(additionalPropertyNamesOnEvent.length, 'additionalPropertyNamesOnEvent found', event.startDate, event.project.id);
|
|
48
47
|
additionalPropertyNames.push(...additionalPropertyNamesOnEvent);
|
|
49
48
|
projectIds.push(event.project.id);
|
|
50
49
|
additionalPropertyNamesOnEvent.forEach((name) => {
|
|
@@ -62,10 +61,11 @@ async function main() {
|
|
|
62
61
|
project: { id: { $eq: event.project.id } },
|
|
63
62
|
limit: 1,
|
|
64
63
|
page: 1,
|
|
65
|
-
name: { $regex: `^${additionalPropertyNameOnEvent}$` }
|
|
64
|
+
name: { $regex: `^${additionalPropertyNameOnEvent}$` },
|
|
65
|
+
inCodeSet: { identifier: { $eq: event.typeOf } }
|
|
66
66
|
});
|
|
67
67
|
if (existings.length > 0) {
|
|
68
|
-
console.log('already existed', additionalPropertyNameOnEvent, event.id, event.project.id);
|
|
68
|
+
console.log('already existed', additionalPropertyNameOnEvent, event.id, event.startDate, event.project.id);
|
|
69
69
|
} else {
|
|
70
70
|
updateCount += 1;
|
|
71
71
|
await additionalPropertyRepo.save({
|
|
@@ -80,7 +80,7 @@ async function main() {
|
|
|
80
80
|
name: { ja: additionalPropertyNameOnEvent }
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
console.log('created', additionalPropertyNameOnEvent, event.id, event.project.id);
|
|
83
|
+
console.log('created', additionalPropertyNameOnEvent, event.id, event.startDate, event.project.id);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -408,41 +408,22 @@ function createPotentialActions(params) {
|
|
|
408
408
|
const reserveActionAttributes = pendingReservations.map((reservation) => {
|
|
409
409
|
var _a, _b;
|
|
410
410
|
const eventReservation = Object.assign(Object.assign({}, reservation), { reservationFor });
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
if (confirmingReservation.underName !== undefined) {
|
|
428
|
-
eventReservation.underName = confirmingReservation.underName;
|
|
429
|
-
eventReservation.reservedTicket.underName = confirmingReservation.underName;
|
|
430
|
-
}
|
|
431
|
-
if (confirmingReservation.reservedTicket !== undefined) {
|
|
432
|
-
// ticketToken指定を廃止(2022-05-23~)
|
|
433
|
-
// if (typeof confirmingReservation.reservedTicket.ticketToken === 'string') {
|
|
434
|
-
// eventReservation.reservedTicket.ticketToken = confirmingReservation.reservedTicket.ticketToken;
|
|
435
|
-
// }
|
|
436
|
-
if (confirmingReservation.reservedTicket.issuedBy !== undefined) {
|
|
437
|
-
eventReservation.reservedTicket.issuedBy = confirmingReservation.reservedTicket.issuedBy;
|
|
438
|
-
}
|
|
439
|
-
// reservedTicket.underName指定を廃止(2022-05-23~)
|
|
440
|
-
// if (confirmingReservation.reservedTicket.underName !== undefined) {
|
|
441
|
-
// eventReservation.reservedTicket.underName = confirmingReservation.reservedTicket.underName;
|
|
442
|
-
// }
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
}
|
|
411
|
+
// 不要なので廃止(2022-12-14~)
|
|
412
|
+
// if (params.object !== undefined) {
|
|
413
|
+
// // 予約属性の指定があれば上書き
|
|
414
|
+
// const confirmingReservation = params.object.reservations.find((r) => r.id === eventReservation.id);
|
|
415
|
+
// if (confirmingReservation !== undefined) {
|
|
416
|
+
// if (confirmingReservation.underName !== undefined) {
|
|
417
|
+
// eventReservation.underName = confirmingReservation.underName;
|
|
418
|
+
// eventReservation.reservedTicket.underName = confirmingReservation.underName;
|
|
419
|
+
// }
|
|
420
|
+
// if (confirmingReservation.reservedTicket !== undefined) {
|
|
421
|
+
// if (confirmingReservation.reservedTicket.issuedBy !== undefined) {
|
|
422
|
+
// eventReservation.reservedTicket.issuedBy = confirmingReservation.reservedTicket.issuedBy;
|
|
423
|
+
// }
|
|
424
|
+
// }
|
|
425
|
+
// }
|
|
426
|
+
// }
|
|
446
427
|
// purpose:Orderの指定があれば、underName,issuedByを調整(2022-05-23~)
|
|
447
428
|
if (typeof ((_a = params.order) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') {
|
|
448
429
|
const ordre2reservationUnderNameResult = ordre2reservationUnderName({ order: params.order });
|
|
@@ -450,7 +431,6 @@ function createPotentialActions(params) {
|
|
|
450
431
|
eventReservation.reservedTicket.underName = ordre2reservationUnderNameResult.underName;
|
|
451
432
|
eventReservation.reservedTicket.issuedBy = ordre2reservationUnderNameResult.issuedBy;
|
|
452
433
|
}
|
|
453
|
-
// const informReservationActions: factory.action.reserve.IInformReservation[] = [];
|
|
454
434
|
const acceptedOffer4reservation = (_b = transaction.object.acceptedOffer) === null || _b === void 0 ? void 0 : _b.find((o) => { var _a, _b; return ((_b = (_a = o.itemOffered) === null || _a === void 0 ? void 0 : _a.serviceOutput) === null || _b === void 0 ? void 0 : _b.id) === reservation.id; });
|
|
455
435
|
const moneyTransfer = createMoneyTransferActions({
|
|
456
436
|
acceptedOffer: acceptedOffer4reservation,
|
|
@@ -466,7 +446,6 @@ function createPotentialActions(params) {
|
|
|
466
446
|
agent: transaction.project,
|
|
467
447
|
potentialActions: {
|
|
468
448
|
moneyTransfer: moneyTransfer
|
|
469
|
-
// informReservation: informReservationActions
|
|
470
449
|
},
|
|
471
450
|
purpose: {
|
|
472
451
|
typeOf: transaction.typeOf,
|
|
@@ -72,7 +72,7 @@ function confirmReserveTransaction(params) {
|
|
|
72
72
|
object = object;
|
|
73
73
|
yield ReserveTransactionService.confirm({
|
|
74
74
|
transactionNumber: object.transactionNumber,
|
|
75
|
-
object: object.object,
|
|
75
|
+
// object: object.object,
|
|
76
76
|
potentialActions: object.potentialActions
|
|
77
77
|
})(repos);
|
|
78
78
|
}
|
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.280.0-alpha.
|
|
13
|
-
"@cinerino/sdk": "3.135.0-alpha.
|
|
12
|
+
"@chevre/factory": "4.280.0-alpha.4",
|
|
13
|
+
"@cinerino/sdk": "3.135.0-alpha.1",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.0",
|
|
16
16
|
"@sendgrid/mail": "6.4.0",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"postversion": "git push origin --tags",
|
|
121
121
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
122
122
|
},
|
|
123
|
-
"version": "20.1.0-alpha.
|
|
123
|
+
"version": "20.1.0-alpha.32"
|
|
124
124
|
}
|