@chevre/domain 20.2.0-alpha.9 → 20.2.0
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/aggregateEventReservation.ts +37 -0
- package/example/src/chevre/aggregation/aggregateSystem.ts +116 -0
- package/example/src/chevre/attendIfNotAttended.ts +22 -0
- package/example/src/chevre/createManyEventsIfNotExist.ts +209 -0
- package/example/src/chevre/findByOrderNumberAndReservationId.ts +20 -0
- package/example/src/chevre/findScreeningRoomsByBranchCode.ts +27 -0
- package/example/src/chevre/importEventsFromCOA.ts +8 -1
- package/example/src/chevre/migrateEventOffersItemOfferedAvailableChannel.ts +2 -1
- package/example/src/chevre/migrateOwnershipInfos2newUserPool.ts +1 -1
- package/example/src/chevre/migrateProjectSubscription.ts +51 -0
- package/example/src/chevre/ownershipInfosCsv2peopleJson.ts +2 -2
- package/example/src/chevre/processReserve.ts +2 -0
- package/example/src/chevre/searchEventIds.ts +24 -0
- package/example/src/chevre/searchEventTicketOffers.ts +5 -4
- package/example/src/chevre/searchEvents.ts +20 -41
- package/example/src/chevre/searchOffersByCatalog.ts +27 -0
- package/example/src/chevre/updateTransaction.ts +38 -0
- package/lib/chevre/factory/event.d.ts +2 -0
- package/lib/chevre/factory/event.js +2 -0
- package/lib/chevre/repo/action.d.ts +77 -1
- package/lib/chevre/repo/action.js +249 -6
- package/lib/chevre/repo/aggregation.d.ts +38 -0
- package/lib/chevre/repo/aggregation.js +68 -0
- package/lib/chevre/repo/assetTransaction.d.ts +32 -0
- package/lib/chevre/repo/assetTransaction.js +148 -0
- package/lib/chevre/repo/code.d.ts +13 -16
- package/lib/chevre/repo/code.js +33 -19
- package/lib/chevre/repo/creativeWork.js +13 -12
- package/lib/chevre/repo/event.d.ts +64 -17
- package/lib/chevre/repo/event.js +456 -156
- package/lib/chevre/repo/mongoose/model/aggregation.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/aggregation.js +47 -0
- package/lib/chevre/repo/mongoose/model/event.js +4 -3
- package/lib/chevre/repo/mongoose/model/offer.js +2 -1
- package/lib/chevre/repo/mongoose/model/project.js +7 -1
- package/lib/chevre/repo/mongoose/model/telemetry.js +4 -28
- package/lib/chevre/repo/offer.d.ts +10 -0
- package/lib/chevre/repo/offer.js +47 -16
- package/lib/chevre/repo/order.d.ts +6 -0
- package/lib/chevre/repo/order.js +53 -7
- package/lib/chevre/repo/place.d.ts +26 -1
- package/lib/chevre/repo/place.js +216 -12
- package/lib/chevre/repo/product.d.ts +1 -0
- package/lib/chevre/repo/product.js +5 -0
- package/lib/chevre/repo/project.d.ts +7 -1
- package/lib/chevre/repo/project.js +15 -6
- package/lib/chevre/repo/reservation.d.ts +7 -8
- package/lib/chevre/repo/reservation.js +181 -76
- package/lib/chevre/repo/task.d.ts +31 -4
- package/lib/chevre/repo/task.js +146 -33
- package/lib/chevre/repo/transaction.d.ts +57 -5
- package/lib/chevre/repo/transaction.js +228 -34
- package/lib/chevre/repo/trip.js +33 -27
- package/lib/chevre/repository.d.ts +3 -0
- package/lib/chevre/repository.js +5 -1
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +72 -60
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +5 -8
- package/lib/chevre/service/aggregation/system.d.ts +100 -0
- package/lib/chevre/service/aggregation/system.js +409 -0
- package/lib/chevre/service/aggregation.d.ts +2 -0
- package/lib/chevre/service/aggregation.js +3 -1
- package/lib/chevre/service/assetTransaction/pay/movieTicket/validation.js +5 -1
- package/lib/chevre/service/assetTransaction/pay/potentialActions.js +0 -3
- package/lib/chevre/service/assetTransaction/pay.d.ts +19 -4
- package/lib/chevre/service/assetTransaction/pay.js +65 -32
- package/lib/chevre/service/assetTransaction/registerService.js +4 -1
- package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +3 -0
- package/lib/chevre/service/assetTransaction/reserve/factory.js +33 -2
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.d.ts +16 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +84 -0
- package/lib/chevre/service/assetTransaction/reserve.d.ts +38 -6
- package/lib/chevre/service/assetTransaction/reserve.js +120 -94
- package/lib/chevre/service/assetTransaction.d.ts +1 -1
- package/lib/chevre/service/code.d.ts +2 -3
- package/lib/chevre/service/delivery/factory.d.ts +1 -1
- package/lib/chevre/service/delivery/product/factory.js +9 -3
- package/lib/chevre/service/event.d.ts +2 -4
- package/lib/chevre/service/event.js +35 -14
- package/lib/chevre/service/offer/event/authorize.d.ts +4 -7
- package/lib/chevre/service/offer/event/authorize.js +33 -87
- package/lib/chevre/service/offer/event/cancel.js +0 -1
- package/lib/chevre/service/offer/event/factory.d.ts +3 -2
- package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +14 -7
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +95 -53
- package/lib/chevre/service/offer/event/voidTransaction.js +0 -2
- package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +2 -1
- package/lib/chevre/service/offer/eventServiceByCOA.js +10 -2
- package/lib/chevre/service/offer/factory.js +10 -3
- package/lib/chevre/service/offer/product/searchProductOffers.d.ts +1 -0
- package/lib/chevre/service/offer/product/searchProductOffers.js +1 -1
- package/lib/chevre/service/offer/product.d.ts +1 -0
- package/lib/chevre/service/offer/product.js +7 -2
- package/lib/chevre/service/offer.d.ts +13 -2
- package/lib/chevre/service/offer.js +68 -46
- package/lib/chevre/service/order/onOrderStatusChanged/factory.js +23 -26
- package/lib/chevre/service/order/returnOrder.js +6 -4
- package/lib/chevre/service/order/sendOrder.js +4 -2
- package/lib/chevre/service/payment/any.d.ts +9 -0
- package/lib/chevre/service/payment/any.js +16 -1
- package/lib/chevre/service/payment/movieTicket.d.ts +2 -2
- package/lib/chevre/service/payment/movieTicket.js +8 -2
- package/lib/chevre/service/product.js +5 -3
- package/lib/chevre/service/report/telemetry.js +1 -1
- package/lib/chevre/service/reserve/checkInReservation.js +2 -2
- package/lib/chevre/service/reserve/confirmReservation.js +7 -10
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +2 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +2 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +2 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +32 -35
- package/lib/chevre/service/reserve/useReservation.d.ts +0 -3
- package/lib/chevre/service/reserve/useReservation.js +58 -33
- package/lib/chevre/service/task/confirmPayTransaction.js +20 -1
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +4 -0
- package/lib/chevre/service/task/confirmReserveTransaction.js +5 -5
- package/lib/chevre/service/task/importEventsFromCOA.js +3 -1
- package/lib/chevre/service/task/returnPayTransaction.js +10 -4
- package/lib/chevre/service/task.js +6 -9
- package/lib/chevre/service/transaction/moneyTransfer.js +9 -1
- package/lib/chevre/service/transaction/orderProgramMembership/findPaymentCardPermit.d.ts +1 -1
- package/lib/chevre/service/transaction/orderProgramMembership.js +6 -6
- package/lib/chevre/service/transaction/placeOrder.js +5 -3
- package/lib/chevre/service/transaction/placeOrderInProgress/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.d.ts +0 -2
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.js +2 -11
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateSeller.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +3 -8
- package/lib/chevre/service/transaction/placeOrderInProgress.js +92 -107
- package/lib/chevre/service/transaction/returnOrder.js +8 -6
- package/lib/chevre/settings.d.ts +2 -0
- package/lib/chevre/settings.js +20 -12
- package/package.json +3 -3
- package/example/src/chevre/aggregateReservationOnProject.ts +0 -32
- package/example/src/chevre/migratePlaceAdditionalProperties.ts +0 -162
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmPay.d.ts +0 -6
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmPay.js +0 -65
package/lib/chevre/settings.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.settings = exports.DEFAULT_PAYMENT_METHOD_TYPE_FOR_CREDIT_CARD = exports.DEFAULT_SENDER_EMAIL = exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS = exports.TRANSACTION_CONFIRMED_STORAGE_PERIOD_IN_DAYS = exports.ASSET_TRANSACTION_STORAGE_PERIOD_IN_DAYS = exports.ABORTED_TASKS_WITHOUT_REPORT = void 0;
|
|
3
|
+
exports.settings = exports.USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = exports.DEFAULT_PAYMENT_METHOD_TYPE_FOR_CREDIT_CARD = exports.DEFAULT_SENDER_EMAIL = exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS = exports.TRANSACTION_CONFIRMED_STORAGE_PERIOD_IN_DAYS = exports.ASSET_TRANSACTION_STORAGE_PERIOD_IN_DAYS = exports.ABORTED_TASKS_WITHOUT_REPORT = void 0;
|
|
4
4
|
const factory = require("./factory");
|
|
5
5
|
const transactionWebhookUrls = (typeof process.env.INFORM_TRANSACTION_URL === 'string')
|
|
6
6
|
? process.env.INFORM_TRANSACTION_URL.split(',')
|
|
@@ -14,9 +14,9 @@ const informOrderUrls = (typeof process.env.INFORM_ORDER_URL === 'string')
|
|
|
14
14
|
const informReservationUrls = (typeof process.env.INFORM_RESERVATION_URL === 'string')
|
|
15
15
|
? process.env.INFORM_RESERVATION_URL.split(',')
|
|
16
16
|
: [];
|
|
17
|
-
const informUseReservationUrls = (typeof process.env.INFORM_USE_RESERVATION_URL === 'string')
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
// const informUseReservationUrls = (typeof process.env.INFORM_USE_RESERVATION_URL === 'string')
|
|
18
|
+
// ? process.env.INFORM_USE_RESERVATION_URL.split(',')
|
|
19
|
+
// : [];
|
|
20
20
|
// tslint:disable-next-line:no-magic-numbers
|
|
21
21
|
const triggerWebhookTimeout = (process.env.TRIGGER_WEBHOOK_TIMEOUT !== undefined) ? Number(process.env.TRIGGER_WEBHOOK_TIMEOUT) : 15000;
|
|
22
22
|
const MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS = (typeof process.env.MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS === 'string')
|
|
@@ -43,9 +43,14 @@ exports.TRANSACTION_CONFIRMED_STORAGE_PERIOD_IN_DAYS = 365;
|
|
|
43
43
|
/**
|
|
44
44
|
* 取引保管期間(Canceled)
|
|
45
45
|
*/
|
|
46
|
-
exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS =
|
|
46
|
+
exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS = (typeof process.env.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS === 'string')
|
|
47
|
+
? Number(process.env.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS)
|
|
48
|
+
// tslint:disable-next-line:no-magic-numbers
|
|
49
|
+
: 7;
|
|
47
50
|
exports.DEFAULT_SENDER_EMAIL = process.env.DEFAULT_SENDER_EMAIL;
|
|
48
51
|
exports.DEFAULT_PAYMENT_METHOD_TYPE_FOR_CREDIT_CARD = String(process.env.DEFAULT_PAYMENT_METHOD_TYPE_FOR_CREDIT_CARD);
|
|
52
|
+
exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = process.env.USE_ASSET_TRANSACTION_SYNC_PROCESSING === '1';
|
|
53
|
+
exports.USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING = process.env.USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING === '1';
|
|
49
54
|
/**
|
|
50
55
|
* グローバル設定
|
|
51
56
|
*/
|
|
@@ -76,13 +81,16 @@ exports.settings = Object.assign({ transactionWebhookUrls, onOrderStatusChanged:
|
|
|
76
81
|
.map((url) => {
|
|
77
82
|
return { recipient: { url } };
|
|
78
83
|
})
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
},
|
|
85
|
+
// 廃止(2023-01-30~)
|
|
86
|
+
// onReservationUsed: {
|
|
87
|
+
// informAction: informUseReservationUrls
|
|
88
|
+
// .filter((url) => url.length > 0)
|
|
89
|
+
// .map((url) => {
|
|
90
|
+
// return { recipient: { url } };
|
|
91
|
+
// })
|
|
92
|
+
// },
|
|
93
|
+
webhook: {
|
|
86
94
|
timeout: triggerWebhookTimeout
|
|
87
95
|
}, maximumReservationGracePeriodInDays: MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS, userPoolIdOld: String(process.env.USERPOOL_ID_OLD), userPoolIdNew: String(process.env.USERPOOL_ID_NEW) }, (typeof MAX_NUM_CREDIT_CARD_PAYMENT_METHOD === 'number')
|
|
88
96
|
? { maxNumCreditCardPaymentMethod: MAX_NUM_CREDIT_CARD_PAYMENT_METHOD }
|
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.
|
|
13
|
-
"@cinerino/sdk": "3.
|
|
12
|
+
"@chevre/factory": "4.286.0",
|
|
13
|
+
"@cinerino/sdk": "3.138.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.2.0
|
|
123
|
+
"version": "20.2.0"
|
|
124
124
|
}
|
|
@@ -1,32 +0,0 @@
|
|
|
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
|
-
|
|
9
|
-
async function main() {
|
|
10
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
11
|
-
|
|
12
|
-
// const now = new Date();
|
|
13
|
-
await chevre.service.aggregation.project.aggregate({
|
|
14
|
-
project: { id: project.id },
|
|
15
|
-
reservationFor: {
|
|
16
|
-
startFrom: moment('2022-01-01T00:00:00+09:00')
|
|
17
|
-
.toDate(),
|
|
18
|
-
startThrough: moment('2022-01-31T23:59:59+09:00')
|
|
19
|
-
.toDate(),
|
|
20
|
-
}
|
|
21
|
-
})({
|
|
22
|
-
project: new chevre.repository.Project(mongoose.connection),
|
|
23
|
-
reservation: new chevre.repository.Reservation(mongoose.connection),
|
|
24
|
-
task: new chevre.repository.Task(mongoose.connection)
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
main()
|
|
29
|
-
.then(() => {
|
|
30
|
-
console.log('success!');
|
|
31
|
-
})
|
|
32
|
-
.catch(console.error);
|
|
@@ -1,162 +0,0 @@
|
|
|
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 placeRepo = new chevre.repository.Place(mongoose.connection);
|
|
15
|
-
|
|
16
|
-
const cursor = placeRepo.getCursor(
|
|
17
|
-
{
|
|
18
|
-
// 'project.id': { $eq: project.id },
|
|
19
|
-
'project.id': { $ne: EXCLUDED_PROJECT_ID }
|
|
20
|
-
// typeOf: { $eq: chevre.factory.eventType.ScreeningEventSeries },
|
|
21
|
-
// starDate: { $gte: new Date() }
|
|
22
|
-
// _id: { $eq: 'al6aff83w' }
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
// _id: 1,
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
console.log('creativeWorks found');
|
|
29
|
-
|
|
30
|
-
const additionalPropertyNames: string[] = [];
|
|
31
|
-
const additionalPropertyNamesOnSections: string[] = [];
|
|
32
|
-
const additionalPropertyNamesOnSeats: string[] = [];
|
|
33
|
-
const projectIds: string[] = [];
|
|
34
|
-
const unexpextedprojectIds: string[] = [];
|
|
35
|
-
const projectIdsOnSections: string[] = [];
|
|
36
|
-
const unexpextedprojectIdsOnSections: string[] = [];
|
|
37
|
-
const projectIdsOnSeats: string[] = [];
|
|
38
|
-
const unexpextedprojectIdsOnSeats: string[] = [];
|
|
39
|
-
|
|
40
|
-
let i = 0;
|
|
41
|
-
let updateCount = 0;
|
|
42
|
-
// tslint:disable-next-line:max-func-body-length
|
|
43
|
-
await cursor.eachAsync(async (doc) => {
|
|
44
|
-
i += 1;
|
|
45
|
-
const movieTheater: chevre.factory.place.movieTheater.IPlace = doc.toObject();
|
|
46
|
-
|
|
47
|
-
if (Array.isArray(movieTheater.containsPlace)) {
|
|
48
|
-
movieTheater.containsPlace.forEach((screeningRoom) => {
|
|
49
|
-
const additionalPropertyNamesOnResource = screeningRoom.additionalProperty?.map((p) => p.name);
|
|
50
|
-
console.log(
|
|
51
|
-
(Array.isArray(additionalPropertyNamesOnResource)) ? additionalPropertyNamesOnResource.length : 0,
|
|
52
|
-
'additionalPropertyNamesOnResource found',
|
|
53
|
-
movieTheater.project.id,
|
|
54
|
-
movieTheater.id
|
|
55
|
-
);
|
|
56
|
-
if (Array.isArray(additionalPropertyNamesOnResource) && additionalPropertyNamesOnResource.length > 0) {
|
|
57
|
-
console.log(
|
|
58
|
-
additionalPropertyNamesOnResource.length,
|
|
59
|
-
'additionalPropertyNamesOnResource found',
|
|
60
|
-
movieTheater.project.id,
|
|
61
|
-
movieTheater.id
|
|
62
|
-
);
|
|
63
|
-
additionalPropertyNames.push(...additionalPropertyNamesOnResource);
|
|
64
|
-
projectIds.push(movieTheater.project.id);
|
|
65
|
-
additionalPropertyNamesOnResource.forEach((name) => {
|
|
66
|
-
if (!name.match(/^[a-zA-Z]*$/)) {
|
|
67
|
-
// throw new Error(`not matched ${creativeWork.project.id} ${creativeWork.id}`);
|
|
68
|
-
unexpextedprojectIds.push(movieTheater.project.id);
|
|
69
|
-
}
|
|
70
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
71
|
-
if (name.length < 5) {
|
|
72
|
-
// throw new Error(`length matched ${creativeWork.project.id} ${creativeWork.id} ${name}`);
|
|
73
|
-
unexpextedprojectIds.push(movieTheater.project.id);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (Array.isArray(screeningRoom.containsPlace)) {
|
|
79
|
-
screeningRoom.containsPlace.forEach((section) => {
|
|
80
|
-
const additionalPropertyNamesOnSection = section.additionalProperty?.map((p) => p.name);
|
|
81
|
-
console.log(
|
|
82
|
-
(Array.isArray(additionalPropertyNamesOnSection)) ? additionalPropertyNamesOnSection.length : 0,
|
|
83
|
-
'additionalPropertyNamesOnSection found',
|
|
84
|
-
movieTheater.project.id,
|
|
85
|
-
movieTheater.id
|
|
86
|
-
);
|
|
87
|
-
if (Array.isArray(additionalPropertyNamesOnSection) && additionalPropertyNamesOnSection.length > 0) {
|
|
88
|
-
console.log(
|
|
89
|
-
additionalPropertyNamesOnSection.length,
|
|
90
|
-
'additionalPropertyNamesOnSection found',
|
|
91
|
-
movieTheater.project.id,
|
|
92
|
-
movieTheater.id
|
|
93
|
-
);
|
|
94
|
-
additionalPropertyNamesOnSections.push(...additionalPropertyNamesOnSection);
|
|
95
|
-
projectIdsOnSections.push(movieTheater.project.id);
|
|
96
|
-
additionalPropertyNamesOnSection.forEach((name) => {
|
|
97
|
-
if (!name.match(/^[a-zA-Z]*$/)) {
|
|
98
|
-
// throw new Error(`not matched ${creativeWork.project.id} ${creativeWork.id}`);
|
|
99
|
-
unexpextedprojectIdsOnSections.push(movieTheater.project.id);
|
|
100
|
-
}
|
|
101
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
102
|
-
if (name.length < 5) {
|
|
103
|
-
// throw new Error(`length matched ${creativeWork.project.id} ${creativeWork.id} ${name}`);
|
|
104
|
-
unexpextedprojectIdsOnSections.push(movieTheater.project.id);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (Array.isArray(section.containsPlace)) {
|
|
110
|
-
section.containsPlace.forEach((seat) => {
|
|
111
|
-
const additionalPropertyNamesOnSeat = seat.additionalProperty?.map((p) => p.name);
|
|
112
|
-
console.log(
|
|
113
|
-
(Array.isArray(additionalPropertyNamesOnSeat)) ? additionalPropertyNamesOnSeat.length : 0,
|
|
114
|
-
'additionalPropertyNamesOnSeat found',
|
|
115
|
-
movieTheater.project.id,
|
|
116
|
-
movieTheater.id
|
|
117
|
-
);
|
|
118
|
-
if (Array.isArray(additionalPropertyNamesOnSeat) && additionalPropertyNamesOnSeat.length > 0) {
|
|
119
|
-
console.log(
|
|
120
|
-
additionalPropertyNamesOnSeat.length,
|
|
121
|
-
'additionalPropertyNamesOnSeat found',
|
|
122
|
-
movieTheater.project.id,
|
|
123
|
-
movieTheater.id
|
|
124
|
-
);
|
|
125
|
-
additionalPropertyNamesOnSeats.push(...additionalPropertyNamesOnSeat);
|
|
126
|
-
projectIdsOnSeats.push(movieTheater.project.id);
|
|
127
|
-
additionalPropertyNamesOnSeat.forEach((name) => {
|
|
128
|
-
if (!name.match(/^[a-zA-Z]*$/)) {
|
|
129
|
-
// throw new Error(`not matched ${creativeWork.project.id} ${creativeWork.id}`);
|
|
130
|
-
unexpextedprojectIdsOnSeats.push(movieTheater.project.id);
|
|
131
|
-
}
|
|
132
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
133
|
-
if (name.length < 5) {
|
|
134
|
-
// throw new Error(`length matched ${creativeWork.project.id} ${creativeWork.id} ${name}`);
|
|
135
|
-
unexpextedprojectIdsOnSeats.push(movieTheater.project.id);
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
console.log(i, 'places checked');
|
|
148
|
-
console.log(updateCount, 'places updated');
|
|
149
|
-
console.log([...new Set(additionalPropertyNames)], 'screeningRooms');
|
|
150
|
-
console.log([...new Set(projectIds)], 'screeningRooms');
|
|
151
|
-
console.log([...new Set(unexpextedprojectIds)], 'screeningRooms');
|
|
152
|
-
console.log([...new Set(additionalPropertyNamesOnSections)], 'sections');
|
|
153
|
-
console.log([...new Set(projectIdsOnSections)], 'sections');
|
|
154
|
-
console.log([...new Set(unexpextedprojectIdsOnSections)], 'sections');
|
|
155
|
-
console.log([...new Set(additionalPropertyNamesOnSeats)], 'seats');
|
|
156
|
-
console.log([...new Set(projectIdsOnSeats)], 'seats');
|
|
157
|
-
console.log([...new Set(unexpextedprojectIdsOnSeats)], 'seats');
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
main()
|
|
161
|
-
.then()
|
|
162
|
-
.catch(console.error);
|
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmPay.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as factory from '../../../../factory';
|
|
2
|
-
export declare function createConfirmPayActions(params: {
|
|
3
|
-
order: factory.order.IOrder;
|
|
4
|
-
transaction: factory.transaction.placeOrder.ITransaction;
|
|
5
|
-
createConfirmPayActions: boolean;
|
|
6
|
-
}): Promise<factory.action.interact.confirm.pay.IAttributes[]>;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createConfirmPayActions = void 0;
|
|
13
|
-
const factory = require("../../../../factory");
|
|
14
|
-
const order_1 = require("../../../../factory/order");
|
|
15
|
-
function createConfirmPayActions(params) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
if (!params.createConfirmPayActions) {
|
|
18
|
-
return [];
|
|
19
|
-
}
|
|
20
|
-
const authorizePaymentActions = params.transaction.object.authorizeActions
|
|
21
|
-
.filter((a) => a.actionStatus === factory.actionStatusType.CompletedActionStatus
|
|
22
|
-
&& a.object.typeOf === factory.action.authorize.paymentMethod.any.ResultType.Payment
|
|
23
|
-
// ↓もはやFaceToFaceも含めて全てPaymentDue(Chevre決済取引進行中)なので、確認は不要(2022-05-16~)
|
|
24
|
-
// && a.result?.paymentStatus === factory.paymentStatusType.PaymentDue
|
|
25
|
-
);
|
|
26
|
-
return authorizePaymentActions.map((a) => {
|
|
27
|
-
var _a;
|
|
28
|
-
const result = a.result;
|
|
29
|
-
const confirmingPayAssetTransaction = {
|
|
30
|
-
typeOf: factory.assetTransactionType.Pay,
|
|
31
|
-
// paymentMethod: {
|
|
32
|
-
// paymentMethodId: result.paymentMethodId
|
|
33
|
-
// },
|
|
34
|
-
transactionNumber: result.paymentMethodId
|
|
35
|
-
};
|
|
36
|
-
if (typeof ((_a = a.instrument) === null || _a === void 0 ? void 0 : _a.typeOf) !== 'string') {
|
|
37
|
-
throw new factory.errors.Argument('authorizePaymentActions.instrument.typeOf undefined');
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
project: params.transaction.project,
|
|
41
|
-
typeOf: factory.actionType.ConfirmAction,
|
|
42
|
-
object: [confirmingPayAssetTransaction],
|
|
43
|
-
// agent: Projectに統一(2022-05-16~)
|
|
44
|
-
agent: params.transaction.project,
|
|
45
|
-
// agent: params.transaction.agent,
|
|
46
|
-
// recipient: params.transaction.seller,
|
|
47
|
-
purpose: {
|
|
48
|
-
project: params.order.project,
|
|
49
|
-
typeOf: params.order.typeOf,
|
|
50
|
-
seller: params.order.seller,
|
|
51
|
-
// mask
|
|
52
|
-
customer: (0, order_1.createMaskedCustomer)(params.order),
|
|
53
|
-
confirmationNumber: params.order.confirmationNumber,
|
|
54
|
-
orderNumber: params.order.orderNumber,
|
|
55
|
-
price: params.order.price,
|
|
56
|
-
priceCurrency: params.order.priceCurrency,
|
|
57
|
-
orderDate: params.order.orderDate
|
|
58
|
-
},
|
|
59
|
-
instrument: a.instrument
|
|
60
|
-
// ...(typeof a.instrument?.typeOf === 'string') ? { instrument: a.instrument } : undefined
|
|
61
|
-
};
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
exports.createConfirmPayActions = createConfirmPayActions;
|