@chevre/domain 20.1.0-alpha.2 → 20.1.0-alpha.21
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/deleteEvents.ts +9 -1
- package/example/src/chevre/migrateEventOffersSellerMakesOffer.ts +139 -0
- package/example/src/chevre/migrateEventSeriesAdditionalProperties.ts +96 -0
- package/example/src/chevre/migrateSellerMakesOfferTransactionDuration.ts +71 -0
- package/example/src/chevre/searchEvents.ts +36 -16
- package/lib/chevre/repo/action.js +42 -31
- package/lib/chevre/repo/additionalProperty.d.ts +35 -0
- package/lib/chevre/repo/additionalProperty.js +211 -0
- package/lib/chevre/repo/event.d.ts +9 -4
- package/lib/chevre/repo/event.js +59 -47
- package/lib/chevre/repo/mongoose/model/action.js +9 -1
- package/lib/chevre/repo/mongoose/model/additionalProperty.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/additionalProperty.js +81 -0
- package/lib/chevre/repo/mongoose/model/event.js +53 -0
- package/lib/chevre/repo/mongoose/model/place.js +18 -0
- package/lib/chevre/repo/place.d.ts +1 -0
- package/lib/chevre/repo/place.js +5 -0
- package/lib/chevre/repo/transaction.js +20 -5
- package/lib/chevre/repository.d.ts +6 -0
- package/lib/chevre/repository.js +8 -1
- package/lib/chevre/service/account.d.ts +0 -4
- package/lib/chevre/service/account.js +24 -22
- package/lib/chevre/service/accountTransaction/deposit.d.ts +0 -2
- package/lib/chevre/service/accountTransaction/deposit.js +3 -3
- package/lib/chevre/service/accountTransaction/transfer.d.ts +0 -2
- package/lib/chevre/service/accountTransaction/transfer.js +3 -3
- package/lib/chevre/service/accountTransaction/withdraw.d.ts +0 -2
- package/lib/chevre/service/accountTransaction/withdraw.js +3 -3
- package/lib/chevre/service/assetTransaction/pay/potentialActions.js +11 -20
- package/lib/chevre/service/delivery/factory.js +2 -1
- package/lib/chevre/service/event.js +10 -0
- package/lib/chevre/service/offer/event/authorize.d.ts +4 -0
- package/lib/chevre/service/offer/event/authorize.js +46 -10
- package/lib/chevre/service/offer/factory.js +7 -20
- package/lib/chevre/service/offer.js +6 -6
- package/lib/chevre/service/order/onOrderStatusChanged/factory.js +5 -3
- package/lib/chevre/service/order/onOrderStatusChanged.js +5 -4
- package/lib/chevre/service/order/placeOrder.js +17 -7
- package/lib/chevre/service/order/returnOrder.js +2 -1
- package/lib/chevre/service/order/sendOrder.js +4 -2
- package/lib/chevre/service/transaction/orderProgramMembership.js +6 -8
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +6 -3
- package/lib/chevre/service/transaction/placeOrderInProgress/factory.js +9 -4
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/givePointAward.js +2 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js +2 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.js +2 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/sendEmailMessage.js +4 -3
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.js +4 -2
- package/lib/chevre/service/transaction/placeOrderInProgress/result.js +2 -4
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateSeller.d.ts +3 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateSeller.js +3 -2
- package/lib/chevre/service/transaction/placeOrderInProgress.js +16 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnMoneyTransfer.js +4 -5
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +6 -3
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.js +4 -6
- package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.js +2 -1
- package/lib/chevre/service/transaction/returnOrder.js +10 -1
- package/lib/chevre/service/transaction.js +1 -14
- package/package.json +3 -3
- package/example/src/chevre/accountBlanceTest.ts +0 -24
- package/example/src/chevre/checkOffersAppliesToMovieTicket.ts +0 -56
- package/example/src/chevre/createSeats.ts +0 -59
- package/example/src/chevre/manageOwnedByOfOwnershipInfo.ts +0 -35
- package/example/src/chevre/migrateEventOffersItemOfferedName.ts +0 -82
- package/example/src/chevre/migrateMovieTicketChargePriceSpecs.ts +0 -92
- package/example/src/chevre/migrateSellerMakesOffers.ts +0 -84
- package/example/src/chevre/migrateTTTSOldEventId.ts +0 -68
- package/example/src/chevre/publishConfirmationNumber.ts +0 -30
- package/example/src/chevre/publishServiceOutputIdentifier.ts +0 -28
- package/example/src/chevre/publishTransactionNumber.ts +0 -28
- package/example/src/chevre/renameTransaction.ts +0 -22
- package/lib/chevre/service/task/accountMoneyTransfer.d.ts +0 -3
- package/lib/chevre/service/task/accountMoneyTransfer.js +0 -31
- package/lib/chevre/service/task/cancelAccountMoneyTransfer.d.ts +0 -3
- package/lib/chevre/service/task/cancelAccountMoneyTransfer.js +0 -33
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmReservation.d.ts +0 -11
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmReservation.js +0 -187
|
@@ -14,7 +14,6 @@ exports.start = void 0;
|
|
|
14
14
|
* 転送取引サービス
|
|
15
15
|
*/
|
|
16
16
|
const factory = require("../../factory");
|
|
17
|
-
const factory_1 = require("./factory");
|
|
18
17
|
/**
|
|
19
18
|
* 取引開始
|
|
20
19
|
*/
|
|
@@ -96,9 +95,10 @@ function start(params) {
|
|
|
96
95
|
accountNumber: params.object.toLocation.accountNumber,
|
|
97
96
|
transaction: pendingTransaction
|
|
98
97
|
});
|
|
98
|
+
// 口座取引におけるAccountAction管理を廃止(2022-11-28~)
|
|
99
99
|
// アクション開始
|
|
100
|
-
const moneyTransferActionAttributes =
|
|
101
|
-
|
|
100
|
+
// const moneyTransferActionAttributes = createMoneyTransferActionAttributes({ transaction });
|
|
101
|
+
// await repos.accountAction.startByIdentifier(moneyTransferActionAttributes);
|
|
102
102
|
// 結果返却
|
|
103
103
|
return transaction;
|
|
104
104
|
});
|
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as factory from '../../factory';
|
|
5
5
|
import { MongoRepository as AccountRepo } from '../../repo/account';
|
|
6
|
-
import { MongoRepository as AccountActionRepo } from '../../repo/accountAction';
|
|
7
6
|
import { MongoRepository as AccountTransactionRepo } from '../../repo/accountTransaction';
|
|
8
7
|
export declare type IStartOperation<T> = (repos: {
|
|
9
8
|
account: AccountRepo;
|
|
10
|
-
accountAction: AccountActionRepo;
|
|
11
9
|
accountTransaction: AccountTransactionRepo;
|
|
12
10
|
}) => Promise<T>;
|
|
13
11
|
/**
|
|
@@ -14,7 +14,6 @@ exports.start = void 0;
|
|
|
14
14
|
* 出金取引サービス
|
|
15
15
|
*/
|
|
16
16
|
const factory = require("../../factory");
|
|
17
|
-
const factory_1 = require("./factory");
|
|
18
17
|
/**
|
|
19
18
|
* 取引開始
|
|
20
19
|
*/
|
|
@@ -75,9 +74,10 @@ function start(params) {
|
|
|
75
74
|
transaction: pendingTransaction,
|
|
76
75
|
force: forcibly
|
|
77
76
|
});
|
|
77
|
+
// 口座取引におけるAccountAction管理を廃止(2022-11-28~)
|
|
78
78
|
// アクション開始
|
|
79
|
-
const moneyTransferActionAttributes =
|
|
80
|
-
|
|
79
|
+
// const moneyTransferActionAttributes = createMoneyTransferActionAttributes({ transaction });
|
|
80
|
+
// await repos.accountAction.startByIdentifier(moneyTransferActionAttributes);
|
|
81
81
|
// 結果返却
|
|
82
82
|
return transaction;
|
|
83
83
|
});
|
|
@@ -3,20 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createPotentialActions = void 0;
|
|
4
4
|
const factory = require("../../../factory");
|
|
5
5
|
const order_1 = require("../../../factory/order");
|
|
6
|
-
const USE_NEW_PRICE_SPEC_ON_INFORM_PAY_ACTION = process.env.USE_NEW_PRICE_SPEC_ON_INFORM_PAY_ACTION === '1';
|
|
7
6
|
function createPayActions(params) {
|
|
8
7
|
var _a;
|
|
9
8
|
const payActions = [];
|
|
10
9
|
const payObject = createPayObject(params);
|
|
11
10
|
const informPaymentActions = createInformPaymentActions(params);
|
|
12
11
|
if (payObject !== undefined) {
|
|
12
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(params.order);
|
|
13
13
|
const simpleOrder = {
|
|
14
14
|
// project: params.order.project,
|
|
15
15
|
typeOf: params.order.typeOf,
|
|
16
16
|
seller: params.order.seller,
|
|
17
17
|
// mask
|
|
18
|
-
customer:
|
|
19
|
-
|
|
18
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
19
|
+
// IOrderへ移行(2022-11-17~)
|
|
20
|
+
// confirmationNumber: params.order.confirmationNumber,
|
|
20
21
|
orderNumber: params.order.orderNumber,
|
|
21
22
|
price: params.order.price,
|
|
22
23
|
priceCurrency: params.order.priceCurrency,
|
|
@@ -121,8 +122,7 @@ function createPayObjectServiceOutput(params) {
|
|
|
121
122
|
paymentServiceOutput = movieTickets.map((movieTicket) => {
|
|
122
123
|
var _a;
|
|
123
124
|
const reservation4invoice = movieTicket2reservation4invoice(movieTicket, order, String(paymentMethodType));
|
|
124
|
-
return Object.assign({ identifier: movieTicket.identifier }, (typeof reservation4invoice.
|
|
125
|
-
|| typeof ((_a = reservation4invoice.priceSpecification) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string')
|
|
125
|
+
return Object.assign({ identifier: movieTicket.identifier }, (typeof ((_a = reservation4invoice.priceSpecification) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string')
|
|
126
126
|
? {
|
|
127
127
|
serviceOutput: reservation4invoice
|
|
128
128
|
}
|
|
@@ -137,7 +137,6 @@ function createPayObjectServiceOutput(params) {
|
|
|
137
137
|
}
|
|
138
138
|
function movieTicket2reservation4invoice(movieTicket, order, paymentMethodType) {
|
|
139
139
|
var _a, _b;
|
|
140
|
-
let reservationPrice;
|
|
141
140
|
let priceComponents4invoice = [];
|
|
142
141
|
// Orderから対象予約を取得
|
|
143
142
|
const reservationOffer = (_a = order === null || order === void 0 ? void 0 : order.acceptedOffers) === null || _a === void 0 ? void 0 : _a.find((o) => {
|
|
@@ -172,7 +171,6 @@ function movieTicket2reservation4invoice(movieTicket, order, paymentMethodType)
|
|
|
172
171
|
if (reservationOffer !== undefined) {
|
|
173
172
|
const priceComponent = (_b = reservationOffer.priceSpecification) === null || _b === void 0 ? void 0 : _b.priceComponent;
|
|
174
173
|
if (Array.isArray(priceComponent)) {
|
|
175
|
-
reservationPrice = priceComponent.reduce((a, b) => a + Number(b.price), 0);
|
|
176
174
|
priceComponents4invoice = priceComponent.map((component) => {
|
|
177
175
|
var _a;
|
|
178
176
|
const accounting = (typeof ((_a = component.accounting) === null || _a === void 0 ? void 0 : _a.accountsReceivable) === 'number')
|
|
@@ -192,19 +190,12 @@ function movieTicket2reservation4invoice(movieTicket, order, paymentMethodType)
|
|
|
192
190
|
});
|
|
193
191
|
}
|
|
194
192
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
return {
|
|
205
|
-
price: reservationPrice
|
|
206
|
-
};
|
|
207
|
-
}
|
|
193
|
+
return {
|
|
194
|
+
priceSpecification: {
|
|
195
|
+
typeOf: factory.priceSpecificationType.CompoundPriceSpecification,
|
|
196
|
+
priceComponent: priceComponents4invoice
|
|
197
|
+
}
|
|
198
|
+
};
|
|
208
199
|
}
|
|
209
200
|
function createInformPaymentActions(params) {
|
|
210
201
|
var _a;
|
|
@@ -63,7 +63,8 @@ function createAcquiredFrom(params) {
|
|
|
63
63
|
// 最低限の情報に絞る
|
|
64
64
|
const seller = params.order.seller;
|
|
65
65
|
return {
|
|
66
|
-
|
|
66
|
+
// 最適化(2022-11-15~)
|
|
67
|
+
// project: { typeOf: params.order.project.typeOf, id: params.order.project.id },
|
|
67
68
|
id: seller.id,
|
|
68
69
|
typeOf: seller.typeOf,
|
|
69
70
|
name: (typeof seller.name === 'string')
|
|
@@ -648,6 +648,16 @@ function createMovieTheaterFromCOA(project, theaterFromCOA, screensFromCOA) {
|
|
|
648
648
|
typeOf: 'QuantitativeValue',
|
|
649
649
|
value: 1200,
|
|
650
650
|
unitCode: factory.unitCode.Sec
|
|
651
|
+
},
|
|
652
|
+
availabilityStartsGraceTimeOnPOS: {
|
|
653
|
+
typeOf: 'QuantitativeValue',
|
|
654
|
+
value: -93,
|
|
655
|
+
unitCode: factory.unitCode.Day
|
|
656
|
+
},
|
|
657
|
+
availabilityEndsGraceTimeOnPOS: {
|
|
658
|
+
typeOf: 'QuantitativeValue',
|
|
659
|
+
value: 2678400,
|
|
660
|
+
unitCode: factory.unitCode.Sec
|
|
651
661
|
}
|
|
652
662
|
}
|
|
653
663
|
};
|
|
@@ -49,11 +49,15 @@ export declare function authorize(params: {
|
|
|
49
49
|
transaction: {
|
|
50
50
|
id: string;
|
|
51
51
|
};
|
|
52
|
+
validateEventOfferPeriod?: boolean;
|
|
52
53
|
validateEvent?: boolean;
|
|
53
54
|
/**
|
|
54
55
|
* どの店舗に対して
|
|
55
56
|
*/
|
|
56
57
|
store: {
|
|
58
|
+
/**
|
|
59
|
+
* 販売アプリケーションID
|
|
60
|
+
*/
|
|
57
61
|
id: string;
|
|
58
62
|
};
|
|
59
63
|
}): IAuthorizeOperation<IAuthorizeOfferAction>;
|
|
@@ -23,7 +23,7 @@ function authorize(params) {
|
|
|
23
23
|
// tslint:disable-next-line:max-func-body-length
|
|
24
24
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
25
25
|
const now = new Date();
|
|
26
|
-
const { transaction, event, bookingServiceIdentifire } = yield validateCreateRequest(Object.assign(Object.assign({}, params), { now }))({ event: repos.event, transaction: repos.transaction });
|
|
26
|
+
const { transaction, event, bookingServiceIdentifire } = yield validateCreateRequest(Object.assign(Object.assign({}, params), { now, store: params.store }))({ event: repos.event, transaction: repos.transaction });
|
|
27
27
|
const acceptedOffers = yield validateAcceptedOffers({
|
|
28
28
|
object: params.object,
|
|
29
29
|
event,
|
|
@@ -121,12 +121,11 @@ function validateCreateRequest(params) {
|
|
|
121
121
|
}
|
|
122
122
|
const bookingServiceIdentifire = offeredThrough.identifier;
|
|
123
123
|
if (bookingServiceIdentifire === factory.service.webAPI.Identifier.Chevre) {
|
|
124
|
+
if (params.validateEventOfferPeriod === true) {
|
|
125
|
+
validateEventOfferPeriod({ event, now, availableAt: { id: params.store.id } });
|
|
126
|
+
}
|
|
124
127
|
if (params.validateEvent === true) {
|
|
125
|
-
validateEvent({
|
|
126
|
-
event,
|
|
127
|
-
now,
|
|
128
|
-
object: params.object
|
|
129
|
-
});
|
|
128
|
+
validateEvent({ event, object: params.object });
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
131
|
return { transaction, event, bookingServiceIdentifire };
|
|
@@ -204,12 +203,23 @@ function validateObjectWithoutDetail(params) {
|
|
|
204
203
|
return objectWithoutDetail;
|
|
205
204
|
});
|
|
206
205
|
}
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
/**
|
|
207
|
+
* イベントのオファー有効期間を検証する
|
|
208
|
+
*/
|
|
209
|
+
function validateEventOfferPeriod(params) {
|
|
209
210
|
const acceptedDate = moment(params.now);
|
|
210
211
|
const eventOffers = params.event.offers;
|
|
211
|
-
|
|
212
|
-
const
|
|
212
|
+
// アプリケーションごとの設定を参照する(2022-11-19~)
|
|
213
|
+
const makesOfferOnApplication = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.seller.makesOffer.find((offer) => {
|
|
214
|
+
return Array.isArray(offer.availableAtOrFrom) && offer.availableAtOrFrom[0].id === params.availableAt.id;
|
|
215
|
+
});
|
|
216
|
+
if (makesOfferOnApplication === undefined) {
|
|
217
|
+
throw new factory.errors.Argument('reservationFor.id', `seller makes no available offer at ${params.availableAt.id}`);
|
|
218
|
+
}
|
|
219
|
+
const validFrom = makesOfferOnApplication.validFrom;
|
|
220
|
+
const validThrough = makesOfferOnApplication.validThrough;
|
|
221
|
+
// const validFrom = eventOffers?.validFrom;
|
|
222
|
+
// const validThrough = eventOffers?.validThrough;
|
|
213
223
|
if (validFrom !== undefined && validFrom !== null) {
|
|
214
224
|
if (acceptedDate.isBefore(moment(validFrom))) {
|
|
215
225
|
throw new factory.errors.Argument('reservationFor.id', `Offer of ${params.event.id} is valid from ${validFrom}`);
|
|
@@ -220,6 +230,32 @@ function validateEvent(params) {
|
|
|
220
230
|
throw new factory.errors.Argument('reservationFor.id', `Offer of ${params.event.id} is valid through ${validThrough}`);
|
|
221
231
|
}
|
|
222
232
|
}
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* イベントの上限座席数を検証する
|
|
236
|
+
*/
|
|
237
|
+
function validateEvent(params) {
|
|
238
|
+
var _a, _b;
|
|
239
|
+
// const acceptedDate = moment(params.now);
|
|
240
|
+
const eventOffers = params.event.offers;
|
|
241
|
+
// const validFrom = eventOffers?.validFrom;
|
|
242
|
+
// const validThrough = eventOffers?.validThrough;
|
|
243
|
+
// if (validFrom !== undefined && validFrom !== null) {
|
|
244
|
+
// if (acceptedDate.isBefore(moment(validFrom))) {
|
|
245
|
+
// throw new factory.errors.Argument(
|
|
246
|
+
// 'reservationFor.id',
|
|
247
|
+
// `Offer of ${params.event.id} is valid from ${validFrom}`
|
|
248
|
+
// );
|
|
249
|
+
// }
|
|
250
|
+
// }
|
|
251
|
+
// if (validThrough !== undefined && validThrough !== null) {
|
|
252
|
+
// if (acceptedDate.isAfter(moment(validThrough))) {
|
|
253
|
+
// throw new factory.errors.Argument(
|
|
254
|
+
// 'reservationFor.id',
|
|
255
|
+
// `Offer of ${params.event.id} is valid through ${validThrough}`
|
|
256
|
+
// );
|
|
257
|
+
// }
|
|
258
|
+
// }
|
|
223
259
|
// イベントのmaxValueを検証
|
|
224
260
|
const maxValue = (_a = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.eligibleQuantity) === null || _a === void 0 ? void 0 : _a.maxValue;
|
|
225
261
|
if (typeof maxValue === 'number') {
|
|
@@ -13,7 +13,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.createCompoundPriceSpec4event = void 0;
|
|
15
15
|
const factory = require("../../factory");
|
|
16
|
-
const USE_MULTIPLE_MOVIE_TICKET_CHARGE = process.env.USE_MULTIPLE_MOVIE_TICKET_CHARGE === '1';
|
|
17
16
|
function categoryCodeChargePriceSpec2component(params) {
|
|
18
17
|
var _a;
|
|
19
18
|
return Object.assign({ id: params.id, typeOf: params.typeOf, name: params.name, price: params.price, priceCurrency: params.priceCurrency, valueAddedTaxIncluded: params.valueAddedTaxIncluded, appliesToCategoryCode: params.appliesToCategoryCode }, (typeof ((_a = params.accounting) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? { accounting: params.accounting } : undefined);
|
|
@@ -35,25 +34,13 @@ function createCompoundPriceSpec4event(params) {
|
|
|
35
34
|
if (Array.isArray(unitPriceSpec.appliesToMovieTicket)) {
|
|
36
35
|
unitPriceSpec.appliesToMovieTicket.forEach((appliesToMovieTicket) => {
|
|
37
36
|
// すべての上映方式に該当する加算料金を追加(2022-10-29~)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
mvtkPriceComponents.push(...mvtkSpecs4appliesToMovieTicket.map(mvtkChargePriceSpec2component));
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
const mvtkSpec4appliesToMovieTicket = params.movieTicketTypeChargeSpecs.find((s) => {
|
|
49
|
-
var _a;
|
|
50
|
-
return ((_a = s.appliesToMovieTicket.serviceOutput) === null || _a === void 0 ? void 0 : _a.typeOf) === appliesToMovieTicket.serviceOutput.typeOf
|
|
51
|
-
&& s.appliesToMovieTicket.serviceType === appliesToMovieTicket.serviceType;
|
|
52
|
-
});
|
|
53
|
-
if (mvtkSpec4appliesToMovieTicket !== undefined) {
|
|
54
|
-
mvtkPriceComponents.push(mvtkChargePriceSpec2component(mvtkSpec4appliesToMovieTicket));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
37
|
+
const mvtkSpecs4appliesToMovieTicket = params.movieTicketTypeChargeSpecs.filter((s) => {
|
|
38
|
+
var _a;
|
|
39
|
+
return ((_a = s.appliesToMovieTicket.serviceOutput) === null || _a === void 0 ? void 0 : _a.typeOf) === appliesToMovieTicket.serviceOutput.typeOf
|
|
40
|
+
&& s.appliesToMovieTicket.serviceType === appliesToMovieTicket.serviceType
|
|
41
|
+
&& params.videoFormatTypes.includes(s.appliesToVideoFormat);
|
|
42
|
+
});
|
|
43
|
+
mvtkPriceComponents.push(...mvtkSpecs4appliesToMovieTicket.map(mvtkChargePriceSpec2component));
|
|
57
44
|
});
|
|
58
45
|
}
|
|
59
46
|
else {
|
|
@@ -40,12 +40,11 @@ function addOffers2Seat(params) {
|
|
|
40
40
|
&& categoryCode.inCodeSet.identifier === factory.categoryCode.CategorySetIdentifier.SeatingType;
|
|
41
41
|
});
|
|
42
42
|
}));
|
|
43
|
+
// 最適化(2022-11-15~)
|
|
43
44
|
const priceSpecification = {
|
|
44
|
-
// 不要な属性を除外(2022-11-02~)
|
|
45
|
-
// project: params.project,
|
|
46
45
|
typeOf: factory.priceSpecificationType.CompoundPriceSpecification,
|
|
47
|
-
priceCurrency: factory.priceCurrency.JPY,
|
|
48
|
-
valueAddedTaxIncluded: true,
|
|
46
|
+
// priceCurrency: factory.priceCurrency.JPY,
|
|
47
|
+
// valueAddedTaxIncluded: true,
|
|
49
48
|
priceComponent: priceComponent
|
|
50
49
|
};
|
|
51
50
|
let availability = (unavailableOffer !== undefined)
|
|
@@ -55,9 +54,10 @@ function addOffers2Seat(params) {
|
|
|
55
54
|
availability = params.availability;
|
|
56
55
|
}
|
|
57
56
|
return Object.assign(Object.assign({}, params.seat), { offers: [{
|
|
58
|
-
|
|
57
|
+
// 最適化(2022-11-15~)
|
|
58
|
+
// project: params.project,
|
|
59
59
|
typeOf: factory.offerType.Offer,
|
|
60
|
-
priceCurrency: factory.priceCurrency.JPY,
|
|
60
|
+
// priceCurrency: factory.priceCurrency.JPY,
|
|
61
61
|
availability: availability,
|
|
62
62
|
priceSpecification: priceSpecification
|
|
63
63
|
}] });
|
|
@@ -33,7 +33,7 @@ function getOrderWithToken(params) {
|
|
|
33
33
|
? {
|
|
34
34
|
id: params.order.customer.id,
|
|
35
35
|
name: '****',
|
|
36
|
-
project: params.order.customer.project,
|
|
36
|
+
// project: params.order.customer.project,
|
|
37
37
|
typeOf: params.order.customer.typeOf
|
|
38
38
|
}
|
|
39
39
|
: {
|
|
@@ -42,7 +42,8 @@ function getOrderWithToken(params) {
|
|
|
42
42
|
};
|
|
43
43
|
const seller4orderToken = {
|
|
44
44
|
id: params.order.seller.id,
|
|
45
|
-
|
|
45
|
+
// 最適化(2022-11-15~)
|
|
46
|
+
// project: params.order.seller.project,
|
|
46
47
|
typeOf: params.order.seller.typeOf
|
|
47
48
|
};
|
|
48
49
|
const order4token = {
|
|
@@ -50,7 +51,8 @@ function getOrderWithToken(params) {
|
|
|
50
51
|
typeOf: params.order.typeOf,
|
|
51
52
|
seller: seller4orderToken,
|
|
52
53
|
customer: customer4orderToken,
|
|
53
|
-
|
|
54
|
+
// IOrderへ移行(2022-11-17~)
|
|
55
|
+
// confirmationNumber: params.order.confirmationNumber,
|
|
54
56
|
orderNumber: params.order.orderNumber,
|
|
55
57
|
price: params.order.price,
|
|
56
58
|
priceCurrency: params.order.priceCurrency,
|
|
@@ -24,12 +24,13 @@ const TOKEN_EXPIRES_IN = 604800;
|
|
|
24
24
|
function onOrderStatusChanged(params) {
|
|
25
25
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
26
26
|
let tasks = [];
|
|
27
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(params.order);
|
|
27
28
|
const simpleOrder = {
|
|
28
|
-
// project: params.order.project,
|
|
29
29
|
typeOf: params.order.typeOf,
|
|
30
30
|
seller: params.order.seller,
|
|
31
|
-
customer:
|
|
32
|
-
|
|
31
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
32
|
+
// IOrderへ移行(2022-11-17~)
|
|
33
|
+
// confirmationNumber: params.order.confirmationNumber,
|
|
33
34
|
orderNumber: params.order.orderNumber,
|
|
34
35
|
price: params.order.price,
|
|
35
36
|
priceCurrency: params.order.priceCurrency,
|
|
@@ -118,7 +119,7 @@ function createConfirmPayTransactionTasks(order, simpleOrder) {
|
|
|
118
119
|
typeOf: factory.actionType.ConfirmAction,
|
|
119
120
|
object: [{ typeOf: factory.assetTransactionType.Pay, transactionNumber: paymentMethod.paymentMethodId }],
|
|
120
121
|
agent: order.project,
|
|
121
|
-
purpose: simpleOrder,
|
|
122
|
+
purpose: Object.assign(Object.assign({}, simpleOrder), { confirmationNumber: order.confirmationNumber }),
|
|
122
123
|
instrument: {
|
|
123
124
|
typeOf: 'WebAPI',
|
|
124
125
|
identifier: factory.action.authorize.paymentMethod.any.ServiceIdentifier.Chevre
|
|
@@ -89,12 +89,14 @@ function placeOrderWithoutTransaction(params) {
|
|
|
89
89
|
// orderNumber: params.object.orderNumber
|
|
90
90
|
// })({ transaction: repos.transaction });
|
|
91
91
|
// アクションを作成する(2022-04-11~)
|
|
92
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(order);
|
|
92
93
|
const simpleOrder = {
|
|
93
94
|
// project: order.project,
|
|
94
95
|
typeOf: order.typeOf,
|
|
95
96
|
seller: order.seller,
|
|
96
|
-
customer:
|
|
97
|
-
|
|
97
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
98
|
+
// IOrderへ移行(2022-11-17~)
|
|
99
|
+
// confirmationNumber: order.confirmationNumber,
|
|
98
100
|
orderNumber: order.orderNumber,
|
|
99
101
|
price: order.price,
|
|
100
102
|
priceCurrency: order.priceCurrency,
|
|
@@ -131,7 +133,10 @@ function placeOrderWithoutTransaction(params) {
|
|
|
131
133
|
task: repos.task
|
|
132
134
|
});
|
|
133
135
|
// 潜在アクション
|
|
134
|
-
yield onPlaceOrder(
|
|
136
|
+
yield onPlaceOrder({
|
|
137
|
+
object: order,
|
|
138
|
+
potentialActions: params.potentialActions
|
|
139
|
+
})(repos);
|
|
135
140
|
});
|
|
136
141
|
}
|
|
137
142
|
exports.placeOrderWithoutTransaction = placeOrderWithoutTransaction;
|
|
@@ -148,12 +153,14 @@ function placeOrder(params) {
|
|
|
148
153
|
orderNumber: params.object.orderNumber
|
|
149
154
|
})({ transaction: repos.transaction });
|
|
150
155
|
// アクションを作成する(2022-04-11~)
|
|
156
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(order);
|
|
151
157
|
const simpleOrder = {
|
|
152
158
|
// project: order.project,
|
|
153
159
|
typeOf: order.typeOf,
|
|
154
160
|
seller: order.seller,
|
|
155
|
-
customer:
|
|
156
|
-
|
|
161
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
162
|
+
// IOrderへ移行(2022-11-17~)
|
|
163
|
+
// confirmationNumber: order.confirmationNumber,
|
|
157
164
|
orderNumber: order.orderNumber,
|
|
158
165
|
price: order.price,
|
|
159
166
|
priceCurrency: order.priceCurrency,
|
|
@@ -190,7 +197,10 @@ function placeOrder(params) {
|
|
|
190
197
|
task: repos.task
|
|
191
198
|
});
|
|
192
199
|
// 潜在アクション
|
|
193
|
-
yield onPlaceOrder(
|
|
200
|
+
yield onPlaceOrder({
|
|
201
|
+
object: order,
|
|
202
|
+
potentialActions: params.potentialActions
|
|
203
|
+
})(repos);
|
|
194
204
|
});
|
|
195
205
|
}
|
|
196
206
|
exports.placeOrder = placeOrder;
|
|
@@ -218,7 +228,7 @@ function onPlaceOrder(params) {
|
|
|
218
228
|
numberOfTried: 0,
|
|
219
229
|
executionResults: [],
|
|
220
230
|
// data: potentialActions.sendOrder
|
|
221
|
-
data: Object.assign({ project: potentialActions.sendOrder.project, object: potentialActions.sendOrder.object }, (potentialActions.sendOrder.potentialActions !== undefined)
|
|
231
|
+
data: Object.assign({ project: potentialActions.sendOrder.project, object: Object.assign(Object.assign({}, potentialActions.sendOrder.object), { confirmationNumber: params.object.confirmationNumber }) }, (potentialActions.sendOrder.potentialActions !== undefined)
|
|
222
232
|
? { potentialActions: potentialActions.sendOrder.potentialActions }
|
|
223
233
|
: undefined)
|
|
224
234
|
};
|
|
@@ -44,7 +44,8 @@ function returnOrder(params) {
|
|
|
44
44
|
typeOf: order.typeOf,
|
|
45
45
|
seller: order.seller,
|
|
46
46
|
customer: (0, order_1.createMaskedCustomer)(order),
|
|
47
|
-
|
|
47
|
+
// IOrderへ移行(2022-11-17~)
|
|
48
|
+
// confirmationNumber: order.confirmationNumber,
|
|
48
49
|
orderNumber: order.orderNumber,
|
|
49
50
|
price: order.price,
|
|
50
51
|
priceCurrency: order.priceCurrency,
|
|
@@ -42,12 +42,14 @@ function sendOrder(params) {
|
|
|
42
42
|
}
|
|
43
43
|
// SendOrderアクションを作成する
|
|
44
44
|
// minimizeする(2022-04-18~)
|
|
45
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(order);
|
|
45
46
|
const simpleOrder = {
|
|
46
47
|
// project: order.project,
|
|
47
48
|
typeOf: order.typeOf,
|
|
48
49
|
seller: order.seller,
|
|
49
|
-
customer:
|
|
50
|
-
|
|
50
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
51
|
+
// IOrderへ移行(2022-11-17~)
|
|
52
|
+
// confirmationNumber: order.confirmationNumber,
|
|
51
53
|
orderNumber: order.orderNumber,
|
|
52
54
|
price: order.price,
|
|
53
55
|
priceCurrency: order.priceCurrency,
|
|
@@ -15,7 +15,6 @@ exports.orderProgramMembership = exports.ISS_PREFIX = void 0;
|
|
|
15
15
|
*/
|
|
16
16
|
const GMO = require("@motionpicture/gmo-service");
|
|
17
17
|
const createDebug = require("debug");
|
|
18
|
-
const moment = require("moment-timezone");
|
|
19
18
|
const accountTransactionIdentifier_1 = require("../../factory/accountTransactionIdentifier");
|
|
20
19
|
const OfferService = require("../offer");
|
|
21
20
|
const AnyPaymentService = require("../payment/any");
|
|
@@ -120,16 +119,15 @@ function createStartPlaceOrderInProgressParams(params) {
|
|
|
120
119
|
id: customer.id,
|
|
121
120
|
identifier: customer.identifier,
|
|
122
121
|
memberOf: customer.memberOf
|
|
123
|
-
// ↓不要なので廃止(2022-05-26~)
|
|
124
|
-
// paramsにadditionalPropertyの指定があれば反映する
|
|
125
|
-
// ...(Array.isArray(params.agent.additionalProperty)) ? { additionalProperty: params.agent.additionalProperty } : []
|
|
126
122
|
};
|
|
127
123
|
return {
|
|
128
124
|
project: { typeOf: factory.organizationType.Project, id: params.project.id },
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
125
|
+
// expiresInSeconds指定に変更(2022-11-29~)
|
|
126
|
+
// expires: moment()
|
|
127
|
+
// // tslint:disable-next-line:no-magic-numbers
|
|
128
|
+
// .add(5, 'minutes')
|
|
129
|
+
// .toDate(),
|
|
130
|
+
expiresInSeconds: 300,
|
|
133
131
|
agent,
|
|
134
132
|
seller: { id: params.seller.id },
|
|
135
133
|
object: {
|
|
@@ -9,6 +9,7 @@ const settings_1 = require("../../../../settings");
|
|
|
9
9
|
*/
|
|
10
10
|
// tslint:disable-next-line:max-func-body-length
|
|
11
11
|
function createTasks(params) {
|
|
12
|
+
var _a;
|
|
12
13
|
const taskAttributes = [];
|
|
13
14
|
const transaction = params.transaction;
|
|
14
15
|
const taskRunsAt = params.runsAt;
|
|
@@ -24,7 +25,6 @@ function createTasks(params) {
|
|
|
24
25
|
executionResults: [],
|
|
25
26
|
data: {
|
|
26
27
|
agent: transaction.project,
|
|
27
|
-
// agent: transaction.seller,
|
|
28
28
|
object: transaction,
|
|
29
29
|
project: transaction.project,
|
|
30
30
|
purpose: { typeOf: transaction.typeOf, id: transaction.id },
|
|
@@ -72,6 +72,10 @@ function createTasks(params) {
|
|
|
72
72
|
if (potentialActions === undefined) {
|
|
73
73
|
throw new factory.errors.NotFound('Transaction PotentialActions');
|
|
74
74
|
}
|
|
75
|
+
const orderFromTransaction = (_a = transaction.result) === null || _a === void 0 ? void 0 : _a.order;
|
|
76
|
+
if (orderFromTransaction === undefined) {
|
|
77
|
+
throw new factory.errors.NotFound('Transaction Result');
|
|
78
|
+
}
|
|
75
79
|
const orderActionAttributes = potentialActions.order;
|
|
76
80
|
const placeOrderTaskAttributes = {
|
|
77
81
|
project: transaction.project,
|
|
@@ -81,9 +85,8 @@ function createTasks(params) {
|
|
|
81
85
|
remainingNumberOfTries: 10,
|
|
82
86
|
numberOfTried: 0,
|
|
83
87
|
executionResults: [],
|
|
84
|
-
// data: orderActionAttributes
|
|
85
88
|
data: Object.assign({ project: orderActionAttributes.project, object: {
|
|
86
|
-
confirmationNumber:
|
|
89
|
+
confirmationNumber: orderFromTransaction.confirmationNumber,
|
|
87
90
|
orderNumber: orderActionAttributes.object.orderNumber
|
|
88
91
|
} }, (orderActionAttributes.potentialActions !== undefined)
|
|
89
92
|
? { potentialActions: orderActionAttributes.potentialActions }
|
|
@@ -10,7 +10,9 @@ function createStartParams(params, passport, seller, broker) {
|
|
|
10
10
|
if (typeof seller.id !== 'string') {
|
|
11
11
|
throw new factory.errors.NotFound('seller.id');
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
if (typeof params.expiresInSeconds !== 'number') {
|
|
14
|
+
throw new factory.errors.ArgumentNull('expiresInSeconds');
|
|
15
|
+
}
|
|
14
16
|
return {
|
|
15
17
|
project: { typeOf: seller.project.typeOf, id: seller.project.id },
|
|
16
18
|
typeOf: factory.transactionType.PlaceOrder,
|
|
@@ -19,11 +21,14 @@ function createStartParams(params, passport, seller, broker) {
|
|
|
19
21
|
id: seller.id,
|
|
20
22
|
name: seller.name,
|
|
21
23
|
typeOf: seller.typeOf
|
|
22
|
-
// ↓最適化(2022-05-24~)
|
|
23
|
-
// ...{ project: seller.project }
|
|
24
24
|
},
|
|
25
25
|
object: transactionObject,
|
|
26
|
-
expires: params.expires
|
|
26
|
+
// expires: params.expires,
|
|
27
|
+
expiresInSeconds: params.expiresInSeconds
|
|
28
|
+
// 販売者にexpires設定があれば適用
|
|
29
|
+
// ...(typeof makesOfferFromClient?.eligibleTransactionDuration?.maxValue === 'number')
|
|
30
|
+
// ? { expiresInSeconds: makesOfferFromClient.eligibleTransactionDuration.maxValue }
|
|
31
|
+
// : undefined
|
|
27
32
|
};
|
|
28
33
|
}
|
|
29
34
|
exports.createStartParams = createStartParams;
|
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/givePointAward.js
CHANGED
|
@@ -48,7 +48,8 @@ function createGivePointAwardActions(params) {
|
|
|
48
48
|
seller: params.order.seller,
|
|
49
49
|
// mask
|
|
50
50
|
customer: (0, order_1.createMaskedCustomer)(params.order),
|
|
51
|
-
|
|
51
|
+
// IOrderへ移行(2022-11-17~)
|
|
52
|
+
// confirmationNumber: params.order.confirmationNumber,
|
|
52
53
|
orderNumber: params.order.orderNumber,
|
|
53
54
|
price: params.order.price,
|
|
54
55
|
priceCurrency: params.order.priceCurrency,
|
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js
CHANGED
|
@@ -66,7 +66,8 @@ function createMoneyTransferActions(params) {
|
|
|
66
66
|
seller: params.order.seller,
|
|
67
67
|
// mask
|
|
68
68
|
customer: (0, order_1.createMaskedCustomer)(params.order),
|
|
69
|
-
|
|
69
|
+
// IOrderへ移行(2022-11-17~)
|
|
70
|
+
// confirmationNumber: params.order.confirmationNumber,
|
|
70
71
|
orderNumber: params.order.orderNumber,
|
|
71
72
|
price: params.order.price,
|
|
72
73
|
priceCurrency: params.order.priceCurrency,
|
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.js
CHANGED
|
@@ -51,7 +51,8 @@ function createRegisterServiceActions(params) {
|
|
|
51
51
|
seller: params.order.seller,
|
|
52
52
|
// mask
|
|
53
53
|
customer: (0, order_1.createMaskedCustomer)(params.order),
|
|
54
|
-
|
|
54
|
+
// IOrderへ移行(2022-11-17~)
|
|
55
|
+
// confirmationNumber: params.order.confirmationNumber,
|
|
55
56
|
orderNumber: params.order.orderNumber,
|
|
56
57
|
price: params.order.price,
|
|
57
58
|
priceCurrency: params.order.priceCurrency,
|
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/sendEmailMessage.js
CHANGED
|
@@ -19,13 +19,14 @@ function createSendEmailMessageActions(params) {
|
|
|
19
19
|
// 注文配送メール送信設定
|
|
20
20
|
const sendEmailMessageActions = [];
|
|
21
21
|
const project = params.transaction.project;
|
|
22
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(params.order);
|
|
22
23
|
const sendActionPurpose = {
|
|
23
|
-
// project: params.order.project,
|
|
24
24
|
typeOf: params.order.typeOf,
|
|
25
25
|
seller: params.order.seller,
|
|
26
26
|
// mask
|
|
27
|
-
customer:
|
|
28
|
-
|
|
27
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
28
|
+
// IOrderへ移行(2022-11-17~)
|
|
29
|
+
// confirmationNumber: params.order.confirmationNumber,
|
|
29
30
|
orderNumber: params.order.orderNumber,
|
|
30
31
|
price: params.order.price,
|
|
31
32
|
priceCurrency: params.order.priceCurrency,
|