@chevre/domain 21.25.0 → 21.26.0-alpha.1
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/migrateAuthorizePaymentActions.ts +75 -0
- package/example/src/chevre/migrateDeleteTransactionTasks.ts +1 -1
- package/example/src/chevre/validateOrder.ts +78 -0
- package/lib/chevre/factory/transaction.d.ts +7 -3
- package/lib/chevre/service/assetTransaction/reserve.js +16 -5
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +4 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +5 -33
- package/lib/chevre/service/payment/any.js +29 -19
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.js +2 -3
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.d.ts +7 -4
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.js +17 -15
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.d.ts +3 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +35 -2
- package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +1 -40
- package/lib/chevre/service/transaction/placeOrderInProgress.js +4 -75
- package/lib/chevre/service/validation/validateOrder.d.ts +13 -0
- package/lib/chevre/service/validation/validateOrder.js +158 -0
- package/lib/chevre/settings.d.ts +1 -1
- package/lib/chevre/settings.js +3 -3
- package/package.json +3 -3
- package/example/src/chevre/migratePayTransactionPaymentMethodId.ts +0 -72
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/givePointAward.d.ts +0 -5
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/givePointAward.js +0 -70
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
// tslint:disable-next-line:max-func-body-length
|
|
10
|
+
async function main() {
|
|
11
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
12
|
+
|
|
13
|
+
const actionRepo = await chevre.repository.Action.createInstance(mongoose.connection);
|
|
14
|
+
|
|
15
|
+
const cursor = actionRepo.getCursor(
|
|
16
|
+
{
|
|
17
|
+
typeOf: { $eq: chevre.factory.actionType.AuthorizeAction },
|
|
18
|
+
'object.typeOf': { $eq: chevre.factory.action.authorize.paymentMethod.any.ResultType.Payment },
|
|
19
|
+
startDate: {
|
|
20
|
+
$gte: moment()
|
|
21
|
+
// tslint:disable-next-line:no-magic-numbers
|
|
22
|
+
.add(-180, 'days')
|
|
23
|
+
.toDate()
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
typeOf: 1,
|
|
28
|
+
project: 1,
|
|
29
|
+
instrument: 1,
|
|
30
|
+
startDate: 1,
|
|
31
|
+
object: 1
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
console.log('actions found');
|
|
35
|
+
|
|
36
|
+
let i = 0;
|
|
37
|
+
let updateCount = 0;
|
|
38
|
+
await cursor.eachAsync(async (doc) => {
|
|
39
|
+
i += 1;
|
|
40
|
+
const authorizeAction: Pick<
|
|
41
|
+
chevre.factory.action.authorize.paymentMethod.any.IAction,
|
|
42
|
+
'project' | 'typeOf' | 'instrument' | 'startDate' | 'object'
|
|
43
|
+
> = doc.toObject();
|
|
44
|
+
|
|
45
|
+
const alreadyMigrated =
|
|
46
|
+
authorizeAction.instrument.identifier === chevre.factory.action.authorize.paymentMethod.any.ServiceIdentifier.Chevre;
|
|
47
|
+
|
|
48
|
+
if (alreadyMigrated) {
|
|
49
|
+
console.log(
|
|
50
|
+
'already exist.',
|
|
51
|
+
authorizeAction.project.id,
|
|
52
|
+
authorizeAction.object.typeOf, authorizeAction.object.paymentMethodId, authorizeAction.startDate, i, updateCount
|
|
53
|
+
);
|
|
54
|
+
} else {
|
|
55
|
+
console.log(
|
|
56
|
+
'updating...',
|
|
57
|
+
authorizeAction.project.id,
|
|
58
|
+
authorizeAction.object.typeOf, authorizeAction.object.paymentMethodId, authorizeAction.startDate, i, updateCount
|
|
59
|
+
);
|
|
60
|
+
updateCount += 1;
|
|
61
|
+
console.log(
|
|
62
|
+
'updated.',
|
|
63
|
+
authorizeAction.project.id,
|
|
64
|
+
authorizeAction.object.typeOf, authorizeAction.object.paymentMethodId, authorizeAction.startDate, i, updateCount
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
console.log(i, 'actions checked');
|
|
70
|
+
console.log(updateCount, 'actions updated');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
main()
|
|
74
|
+
.then()
|
|
75
|
+
.catch(console.error);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as moment from 'moment';
|
|
3
|
+
import * as mongoose from 'mongoose';
|
|
4
|
+
|
|
5
|
+
import { validateOrder } from '../../../lib/chevre/service/validation/validateOrder';
|
|
6
|
+
import { chevre } from '../../../lib/index';
|
|
7
|
+
|
|
8
|
+
// const project = { id: <string>process.env.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 orderRepo = await chevre.repository.Order.createInstance(mongoose.connection);
|
|
15
|
+
const assetTransactionRepo = await chevre.repository.AssetTransaction.createInstance(mongoose.connection);
|
|
16
|
+
const acceptedOfferRepo = await chevre.repository.AcceptedOffer.createInstance(mongoose.connection);
|
|
17
|
+
const cursor = orderRepo.getCursor(
|
|
18
|
+
{
|
|
19
|
+
// orderNumber: { $eq: 'SSK6-4203766-8404594' },
|
|
20
|
+
// 'project.id': { $eq: project.id },
|
|
21
|
+
typeOf: { $eq: chevre.factory.order.OrderType.Order },
|
|
22
|
+
orderDate: {
|
|
23
|
+
$gte: moment()
|
|
24
|
+
// tslint:disable-next-line:no-magic-numbers
|
|
25
|
+
.add(-31, 'days')
|
|
26
|
+
.toDate()
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
project: 1,
|
|
31
|
+
orderDate: 1,
|
|
32
|
+
orderNumber: 1,
|
|
33
|
+
typeOf: 1
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
console.log('orders found');
|
|
37
|
+
|
|
38
|
+
const unexpextedOrders: (Pick<chevre.factory.order.IOrder, 'orderDate' | 'orderNumber' | 'project'> & {
|
|
39
|
+
message: string;
|
|
40
|
+
})[] = [];
|
|
41
|
+
const unexpextedprojectIds: string[] = [];
|
|
42
|
+
|
|
43
|
+
let i = 0;
|
|
44
|
+
await cursor.eachAsync(async (doc) => {
|
|
45
|
+
i += 1;
|
|
46
|
+
const order: Pick<chevre.factory.order.IOrder, 'orderDate' | 'orderNumber' | 'project' | 'typeOf'> = doc.toObject();
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
console.log('validating order...', order.project.id, order.typeOf, order.orderNumber, order.orderDate, i);
|
|
50
|
+
const result = await validateOrder({
|
|
51
|
+
orderNumber: order.orderNumber,
|
|
52
|
+
project: { id: order.project.id }
|
|
53
|
+
})({
|
|
54
|
+
order: orderRepo,
|
|
55
|
+
acceptedOffer: acceptedOfferRepo,
|
|
56
|
+
assetTransaction: assetTransactionRepo
|
|
57
|
+
});
|
|
58
|
+
console.log(result);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error(error);
|
|
61
|
+
unexpextedOrders.push({
|
|
62
|
+
orderDate: order.orderDate,
|
|
63
|
+
orderNumber: order.orderNumber,
|
|
64
|
+
project: order.project,
|
|
65
|
+
message: error.message
|
|
66
|
+
});
|
|
67
|
+
unexpextedprojectIds.push(order.project.id);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
console.log(i, 'orders checked');
|
|
71
|
+
console.log('unexpextedOrders:', unexpextedOrders);
|
|
72
|
+
console.log(unexpextedOrders.length, 'unexpextedOrders');
|
|
73
|
+
console.log('unexpextedprojectIds:', [...new Set(unexpextedprojectIds)]);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
main()
|
|
77
|
+
.then()
|
|
78
|
+
.catch(console.error);
|
|
@@ -28,9 +28,13 @@ export declare namespace placeOrder {
|
|
|
28
28
|
/**
|
|
29
29
|
* オファー制約
|
|
30
30
|
*/
|
|
31
|
-
numItems
|
|
32
|
-
maxValue
|
|
33
|
-
minValue
|
|
31
|
+
numItems: {
|
|
32
|
+
maxValue: number;
|
|
33
|
+
minValue: number;
|
|
34
|
+
/**
|
|
35
|
+
* 最大COA予約数
|
|
36
|
+
*/
|
|
37
|
+
maxNumCOAReservationNumbers: number;
|
|
34
38
|
};
|
|
35
39
|
/**
|
|
36
40
|
* 注文アイテム制約
|
|
@@ -22,6 +22,7 @@ const confirmReservation_1 = require("../reserve/confirmReservation");
|
|
|
22
22
|
const settings_1 = require("../../settings");
|
|
23
23
|
const factory_1 = require("./reserve/factory");
|
|
24
24
|
const validateStartRequest_1 = require("./reserve/validateStartRequest");
|
|
25
|
+
const ONE_MONTH_IN_DAYS = 31;
|
|
25
26
|
/**
|
|
26
27
|
* 取引開始
|
|
27
28
|
*/
|
|
@@ -271,13 +272,23 @@ function validateEvent(params) {
|
|
|
271
272
|
if (params.event.eventStatus === factory.eventStatusType.EventCancelled) {
|
|
272
273
|
throw new factory.errors.Argument('Event', `Event status ${params.event.eventStatus}`);
|
|
273
274
|
}
|
|
274
|
-
//
|
|
275
|
+
// 予約取引開始可能なイベント開始日時範囲を明確に制限(2024-03-11~)
|
|
275
276
|
const reservableThrough = moment(params.now)
|
|
276
|
-
.add(settings_1.
|
|
277
|
-
|
|
278
|
-
.
|
|
279
|
-
|
|
277
|
+
.add(settings_1.MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS, 'days');
|
|
278
|
+
const reservableFrom = moment(params.now)
|
|
279
|
+
.add(-ONE_MONTH_IN_DAYS, 'days');
|
|
280
|
+
if (!moment(params.event.startDate)
|
|
281
|
+
.isBetween(reservableFrom, reservableThrough, 'second', '[]')) {
|
|
282
|
+
throw new factory.errors.Argument('Event', `bookingTime must be between ${settings_1.MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS} days before and ${ONE_MONTH_IN_DAYS} days after the event start date`);
|
|
280
283
|
}
|
|
284
|
+
// イベントが一定期間後であれば予約不可
|
|
285
|
+
// if (moment(params.event.startDate)
|
|
286
|
+
// .isAfter(reservableThrough)) {
|
|
287
|
+
// throw new factory.errors.Argument(
|
|
288
|
+
// 'Event',
|
|
289
|
+
// `Maximum reservation grace period is ${MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS} days`
|
|
290
|
+
// );
|
|
291
|
+
// }
|
|
281
292
|
}
|
|
282
293
|
function createAcceptedOffers4transactionObject(params) {
|
|
283
294
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -81,8 +81,10 @@ function createConfirmPayTransactionTasks(order, simpleOrder) {
|
|
|
81
81
|
agent: order.project,
|
|
82
82
|
purpose: Object.assign(Object.assign({}, simpleOrder), { confirmationNumber: order.confirmationNumber }),
|
|
83
83
|
instrument: {
|
|
84
|
-
typeOf: 'WebAPI',
|
|
85
|
-
|
|
84
|
+
// typeOf: 'WebAPI',
|
|
85
|
+
typeOf: factory.assetTransactionType.Pay,
|
|
86
|
+
identifier: factory.action.authorize.paymentMethod.any.ServiceIdentifier.Chevre,
|
|
87
|
+
transactionNumber: invoice.paymentMethodId
|
|
86
88
|
},
|
|
87
89
|
processOrder: order.orderStatus === factory.orderStatus.OrderPaymentDue,
|
|
88
90
|
useOnOrderStatusChanged: true
|
|
@@ -23,7 +23,7 @@ const factory_1 = require("./onOrderProcessing/factory");
|
|
|
23
23
|
const debug = createDebug('chevre-domain:service:order');
|
|
24
24
|
function onOrderProcessing(params) {
|
|
25
25
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
var _a, _b, _c, _d, _e
|
|
26
|
+
var _a, _b, _c, _d, _e;
|
|
27
27
|
debug('onOrderStatusChanged called.', params.order.orderNumber, params.order.orderStatus, params.order.orderDate);
|
|
28
28
|
let tasks = [];
|
|
29
29
|
const sendOrderPotentialActions = (_e = (_d = (_c = (_b = (_a = params.placeOrderTransaction) === null || _a === void 0 ? void 0 : _a.potentialActions) === null || _b === void 0 ? void 0 : _b.order) === null || _c === void 0 ? void 0 : _c.potentialActions) === null || _d === void 0 ? void 0 : _d.sendOrder) === null || _e === void 0 ? void 0 : _e.potentialActions;
|
|
@@ -64,9 +64,10 @@ function onOrderProcessing(params) {
|
|
|
64
64
|
else if (params.order.itemOfferedTypeOf === factory.permit.PermitType.Permit) {
|
|
65
65
|
yield createConfirmRegisterServiceTasksIfNotExist(params.order, simpleOrder)(repos);
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
// 完全廃止(2024-03-12~)
|
|
68
|
+
// await createGivePointAwardTaskIfNotExist({
|
|
69
|
+
// potentialActions: params.placeOrderTransaction?.potentialActions?.order?.potentialActions
|
|
70
|
+
// })(repos);
|
|
70
71
|
// OrderProcessingにおけるEメール送信に対応(2024-01-17~)
|
|
71
72
|
if (settings_1.USE_SEND_EMAIL_MESSAGE_ON_ORDER_PROCESSING) {
|
|
72
73
|
yield (0, createSendEmailMessageTaskIfNotExist_1.createSendEmailMessageTaskIfNotExist)({ potentialActions: sendOrderPotentialActions })(repos);
|
|
@@ -180,32 +181,3 @@ function createConfirmRegisterServiceTasksIfNotExist(order, simpleOrder) {
|
|
|
180
181
|
})));
|
|
181
182
|
});
|
|
182
183
|
}
|
|
183
|
-
function createGivePointAwardTaskIfNotExist(params) {
|
|
184
|
-
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
185
|
-
var _a;
|
|
186
|
-
const now = new Date();
|
|
187
|
-
const givePointAwardsByTransaction = (_a = params.potentialActions) === null || _a === void 0 ? void 0 : _a.givePointAward;
|
|
188
|
-
if (Array.isArray(givePointAwardsByTransaction)) {
|
|
189
|
-
for (const givePointAwardByTransaction of givePointAwardsByTransaction) {
|
|
190
|
-
let taskIdentifier = `${givePointAwardByTransaction.project.id}:${factory.taskName.GivePointAward}:${Date.now()}`;
|
|
191
|
-
if (typeof givePointAwardByTransaction.object.identifier === 'string'
|
|
192
|
-
&& givePointAwardByTransaction.object.identifier.length > 0) {
|
|
193
|
-
taskIdentifier = `${givePointAwardByTransaction.project.id}:${factory.taskName.GivePointAward}:${givePointAwardByTransaction.object.identifier}`;
|
|
194
|
-
}
|
|
195
|
-
const givePointAwardTask = {
|
|
196
|
-
identifier: taskIdentifier,
|
|
197
|
-
project: givePointAwardByTransaction.project,
|
|
198
|
-
name: factory.taskName.GivePointAward,
|
|
199
|
-
status: factory.taskStatus.Ready,
|
|
200
|
-
runsAt: now,
|
|
201
|
-
remainingNumberOfTries: 10,
|
|
202
|
-
numberOfTried: 0,
|
|
203
|
-
executionResults: [],
|
|
204
|
-
data: givePointAwardByTransaction
|
|
205
|
-
};
|
|
206
|
-
// 冗長なgivePointAwardタスク作成を回避(2023-09-01~)
|
|
207
|
-
yield repos.task.createIfNotExistByIdentifier(givePointAwardTask, { emitImmediately: true });
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
}
|
|
@@ -27,23 +27,27 @@ Object.defineProperty(exports, "person2username", { enumerable: true, get: funct
|
|
|
27
27
|
*/
|
|
28
28
|
function voidPayTransaction(params) {
|
|
29
29
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
// 決済承認アクション確認不要(2024-03-12~)
|
|
30
31
|
// 決済承認アクションを検索
|
|
31
|
-
let authorizeActions =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
// let authorizeActions = <factory.action.authorize.paymentMethod.any.IAction[]>
|
|
33
|
+
// await repos.action.searchByPurpose({
|
|
34
|
+
// typeOf: factory.actionType.AuthorizeAction,
|
|
35
|
+
// purpose: {
|
|
36
|
+
// typeOf: params.purpose.typeOf,
|
|
37
|
+
// id: params.purpose.id
|
|
38
|
+
// }
|
|
39
|
+
// });
|
|
40
|
+
// authorizeActions = authorizeActions.filter(
|
|
41
|
+
// (a) => a.object.typeOf === factory.action.authorize.paymentMethod.any.ResultType.Payment
|
|
42
|
+
// );
|
|
43
|
+
// // Chevreを使用した承認を取り消し
|
|
44
|
+
// const authorizeActionsWithChevre = authorizeActions.filter((a) => {
|
|
45
|
+
// return a.instrument?.identifier === factory.action.authorize.paymentMethod.any.ServiceIdentifier.Chevre;
|
|
46
|
+
// });
|
|
47
|
+
// if (authorizeActionsWithChevre.length > 0) {
|
|
48
|
+
// await processVoidPayTransaction(params)(repos);
|
|
49
|
+
// }
|
|
50
|
+
yield processVoidPayTransaction(params)(repos);
|
|
47
51
|
// 決済URL無効化もここで処理
|
|
48
52
|
yield invalidatePaymentUrl(params)(repos);
|
|
49
53
|
});
|
|
@@ -140,7 +144,11 @@ function processVoidPayTransaction(params) {
|
|
|
140
144
|
},
|
|
141
145
|
object: { typeOf: { $eq: factory.action.authorize.paymentMethod.any.ResultType.Payment } }
|
|
142
146
|
});
|
|
143
|
-
|
|
147
|
+
// filter不要(2024-03-12~)
|
|
148
|
+
// authorizeActions = authorizeActionsOnTransaction.filter(
|
|
149
|
+
// (a) => a.instrument?.identifier === factory.action.authorize.paymentMethod.any.ServiceIdentifier.Chevre
|
|
150
|
+
// );
|
|
151
|
+
authorizeActions = authorizeActionsOnTransaction;
|
|
144
152
|
switch (transaction.status) {
|
|
145
153
|
case factory.transactionStatusType.InProgress:
|
|
146
154
|
throw new factory.errors.NotImplemented(`${transaction.status} not implemented`);
|
|
@@ -321,8 +329,10 @@ function authorize(params) {
|
|
|
321
329
|
id: transaction.agent.id
|
|
322
330
|
},
|
|
323
331
|
instrument: {
|
|
324
|
-
typeOf: 'WebAPI',
|
|
325
|
-
|
|
332
|
+
// typeOf: 'WebAPI',
|
|
333
|
+
typeOf: factory.assetTransactionType.Pay,
|
|
334
|
+
identifier: factory.action.authorize.paymentMethod.any.ServiceIdentifier.Chevre,
|
|
335
|
+
transactionNumber
|
|
326
336
|
},
|
|
327
337
|
recipient: {
|
|
328
338
|
typeOf: transaction.seller.typeOf,
|
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.createPotentialActions = void 0;
|
|
13
|
-
const givePointAward_1 = require("./potentialActions/givePointAward");
|
|
14
13
|
const sendEmailMessage_1 = require("./potentialActions/sendEmailMessage");
|
|
15
14
|
/**
|
|
16
15
|
* 取引のポストアクションを作成する
|
|
@@ -18,7 +17,7 @@ const sendEmailMessage_1 = require("./potentialActions/sendEmailMessage");
|
|
|
18
17
|
function createPotentialActions(params) {
|
|
19
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
19
|
// ポイントインセンティブに対する承認アクションの分だけ、ポイントインセンティブ付与アクションを作成する
|
|
21
|
-
const givePointAwardActions =
|
|
20
|
+
// const givePointAwardActions = await createGivePointAwardActions(params); // 完全廃止(2024-03-12~)
|
|
22
21
|
// 注文配送メール送信設定
|
|
23
22
|
const sendEmailMessageActions = yield (0, sendEmailMessage_1.createSendEmailMessageActions)(params);
|
|
24
23
|
const sendOrderActionAttributes = {
|
|
@@ -32,7 +31,7 @@ function createPotentialActions(params) {
|
|
|
32
31
|
return {
|
|
33
32
|
order: {
|
|
34
33
|
potentialActions: {
|
|
35
|
-
givePointAward: givePointAwardActions,
|
|
34
|
+
// givePointAward: givePointAwardActions, // 完全廃止(2024-03-12~)
|
|
36
35
|
sendOrder: sendOrderActionAttributes // optimize(2024-01-16~)
|
|
37
36
|
}
|
|
38
37
|
}
|
package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import * as factory from '../../../../factory';
|
|
2
|
-
type
|
|
2
|
+
export type IMovieTicket4validate = Pick<factory.paymentMethod.paymentCard.movieTicket.IMovieTicket, 'identifier' | 'serviceOutput' | 'serviceType' | 'typeOf'> & {
|
|
3
|
+
serviceOutput: factory.paymentMethod.paymentCard.movieTicket.IServiceOutput & {
|
|
4
|
+
reservationFor: factory.paymentMethod.paymentCard.movieTicket.IReservationFor & {};
|
|
5
|
+
};
|
|
6
|
+
};
|
|
3
7
|
/**
|
|
4
8
|
* 興行オファー承認に対して決済承認条件が整っているかどうか検証する
|
|
5
9
|
* 決済方法区分ごとに検証
|
|
@@ -12,11 +16,10 @@ paymentMethodType: string, transaction: {
|
|
|
12
16
|
id: string;
|
|
13
17
|
},
|
|
14
18
|
/**
|
|
15
|
-
*
|
|
19
|
+
* 決済承認で受け付けたmovieTickets
|
|
16
20
|
*/
|
|
17
|
-
|
|
21
|
+
authorizedMovieTickets: IMovieTicket4validate[],
|
|
18
22
|
/**
|
|
19
23
|
* 受け入れられた興行オファー
|
|
20
24
|
*/
|
|
21
25
|
eventReservationAcceptedOffers: factory.order.IAcceptedOffer<factory.order.IReservation>[]): void;
|
|
22
|
-
export {};
|
package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.js
CHANGED
|
@@ -17,23 +17,25 @@ function validateMovieTicket(
|
|
|
17
17
|
* 決済方法区分
|
|
18
18
|
*/
|
|
19
19
|
paymentMethodType, transaction,
|
|
20
|
+
// authorizePaymentActions: IAuthorizePaymentAction[],
|
|
20
21
|
/**
|
|
21
|
-
*
|
|
22
|
+
* 決済承認で受け付けたmovieTickets
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
+
authorizedMovieTickets,
|
|
24
25
|
/**
|
|
25
26
|
* 受け入れられた興行オファー
|
|
26
27
|
*/
|
|
27
28
|
eventReservationAcceptedOffers) {
|
|
28
|
-
const authorizeMovieTicketActions = authorizePaymentActions.filter(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
29
|
+
// const authorizeMovieTicketActions = authorizePaymentActions.filter(
|
|
30
|
+
// (a) => {
|
|
31
|
+
// const resultAsInvoice = (Array.isArray(a.result))
|
|
32
|
+
// ? a.result.find(({ typeOf }) => typeOf === factory.action.authorize.paymentMethod.any.ResultType.Payment)
|
|
33
|
+
// : undefined;
|
|
34
|
+
// return resultAsInvoice?.issuedThrough.typeOf === factory.service.paymentService.PaymentServiceType.MovieTicket
|
|
35
|
+
// // 決済方法区分は必ず存在するはず(2023-08-15~)
|
|
36
|
+
// && resultAsInvoice.paymentMethodAsObject?.typeOf === paymentMethodType;
|
|
37
|
+
// }
|
|
38
|
+
// );
|
|
37
39
|
// const seatReservationAuthorizeActions = (<IAuthorizeSeatReservationOffer[]>authorizeActions).filter(
|
|
38
40
|
// (a) => a.object.typeOf === factory.action.authorize.offer.eventService.ObjectType.SeatReservation
|
|
39
41
|
// );
|
|
@@ -44,10 +46,10 @@ eventReservationAcceptedOffers) {
|
|
|
44
46
|
acceptedOffers: eventReservationAcceptedOffers
|
|
45
47
|
});
|
|
46
48
|
debug(requiredMovieTickets.length, 'movie tickets required', 'transaction:', transaction.id);
|
|
47
|
-
const authorizedMovieTickets = [];
|
|
48
|
-
authorizeMovieTicketActions.forEach((a) => {
|
|
49
|
-
|
|
50
|
-
});
|
|
49
|
+
// const authorizedMovieTickets: IMovieTicket4validate[] = [];
|
|
50
|
+
// authorizeMovieTicketActions.forEach((a) => {
|
|
51
|
+
// authorizedMovieTickets.push(...(Array.isArray(a.object.movieTickets)) ? a.object.movieTickets : []);
|
|
52
|
+
// });
|
|
51
53
|
debug(authorizedMovieTickets.length, 'movie tickets authorized', 'transaction:', transaction.id);
|
|
52
54
|
// 合計枚数OK?
|
|
53
55
|
if (requiredMovieTickets.length !== authorizedMovieTickets.length) {
|
|
@@ -9,6 +9,9 @@ export type IAuthorizePaymentAction = factory.action.authorize.paymentMethod.any
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function validateTransaction(transaction: factory.transaction.placeOrder.ITransaction, authorizePaymentActions: IAuthorizePaymentAction[], authorizeEventServiceOfferActions: IAuthorizeEventServiceOffer[], authorizeMoneyTansferActions: IAuthorizeMoneyTransferOffer[], authorizeProductOfferActions: IAuthorizeProductOffer[], eventReservationAcceptedOffers: factory.order.IAcceptedOffer<factory.order.IReservation>[]): void;
|
|
11
11
|
export type IOrderURLGenerator = (order: factory.order.IOrder) => string;
|
|
12
|
+
/**
|
|
13
|
+
* 注文オファー数検証
|
|
14
|
+
*/
|
|
12
15
|
export declare function validateNumItems(params: {
|
|
13
16
|
result: {
|
|
14
17
|
order: PlaceOrderFactory.IResultOrderParams;
|
|
@@ -24,7 +24,22 @@ function validateTransaction(transaction, authorizePaymentActions, authorizeEven
|
|
|
24
24
|
if (Array.isArray(movieTicketPaymentMethodTypes) && movieTicketPaymentMethodTypes.length > 0) {
|
|
25
25
|
movieTicketPaymentMethodTypes.forEach((paymentMethodType) => {
|
|
26
26
|
try {
|
|
27
|
-
|
|
27
|
+
const authorizeMovieTicketActions = authorizePaymentActions.filter((a) => {
|
|
28
|
+
var _a;
|
|
29
|
+
const resultAsInvoice = (Array.isArray(a.result))
|
|
30
|
+
? a.result.find(({ typeOf }) => typeOf === factory.action.authorize.paymentMethod.any.ResultType.Payment)
|
|
31
|
+
: undefined;
|
|
32
|
+
return (resultAsInvoice === null || resultAsInvoice === void 0 ? void 0 : resultAsInvoice.issuedThrough.typeOf) === factory.service.paymentService.PaymentServiceType.MovieTicket
|
|
33
|
+
// 決済方法区分は必ず存在するはず(2023-08-15~)
|
|
34
|
+
&& ((_a = resultAsInvoice.paymentMethodAsObject) === null || _a === void 0 ? void 0 : _a.typeOf) === paymentMethodType;
|
|
35
|
+
});
|
|
36
|
+
const authorizedMovieTickets = [];
|
|
37
|
+
authorizeMovieTicketActions.forEach((a) => {
|
|
38
|
+
authorizedMovieTickets.push(...(Array.isArray(a.object.movieTickets)) ? a.object.movieTickets : []);
|
|
39
|
+
});
|
|
40
|
+
debug(authorizedMovieTickets.length, 'movie tickets authorized', 'transaction:', transaction.id);
|
|
41
|
+
// validateMovieTicket(paymentMethodType, { id: transaction.id }, authorizePaymentActions, eventReservationAcceptedOffers);
|
|
42
|
+
(0, validateMovieTicket_1.validateMovieTicket)(paymentMethodType, { id: transaction.id }, authorizedMovieTickets, eventReservationAcceptedOffers);
|
|
28
43
|
}
|
|
29
44
|
catch (error) {
|
|
30
45
|
// 検証結果をlog(2022-06-04~)
|
|
@@ -184,8 +199,11 @@ function validateMonetaryAmount(authorizePaymentActions, authorizeEventServiceOf
|
|
|
184
199
|
throw new factory.errors.Argument('Transaction', 'Required MonetaryAmount not satisfied');
|
|
185
200
|
}
|
|
186
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* 注文オファー数検証
|
|
204
|
+
*/
|
|
187
205
|
function validateNumItems(params) {
|
|
188
|
-
var _a, _b;
|
|
206
|
+
var _a, _b, _c;
|
|
189
207
|
if (!Array.isArray(params.acceptedOffers)) {
|
|
190
208
|
throw new factory.errors.Argument('order.acceptedOffers', 'must be array');
|
|
191
209
|
}
|
|
@@ -208,6 +226,21 @@ function validateNumItems(params) {
|
|
|
208
226
|
if (itemOfferedTypeOfs.length > 1) {
|
|
209
227
|
throw new factory.errors.Argument('Transaction', `different itemOffered.typeOfs contained. [${itemOfferedTypeOfs.join(',')}]`);
|
|
210
228
|
}
|
|
229
|
+
const maxNumCOAReservationNumbers = (_c = params.result.order.numItems) === null || _c === void 0 ? void 0 : _c.maxNumCOAReservationNumbers;
|
|
230
|
+
if (typeof maxNumCOAReservationNumbers === 'number') {
|
|
231
|
+
// COA予約数検証(2024-03-12~)
|
|
232
|
+
let coaSerialNumbers = [];
|
|
233
|
+
params.acceptedOffers.forEach(({ offeredThrough, serialNumber }) => {
|
|
234
|
+
if ((offeredThrough === null || offeredThrough === void 0 ? void 0 : offeredThrough.identifier) === factory.service.webAPI.Identifier.COA
|
|
235
|
+
&& typeof serialNumber === 'string') {
|
|
236
|
+
coaSerialNumbers.push(serialNumber);
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
coaSerialNumbers = [...new Set(coaSerialNumbers)];
|
|
240
|
+
if (coaSerialNumbers.length > maxNumCOAReservationNumbers) {
|
|
241
|
+
throw new factory.errors.Argument('Transaction', (0, util_1.format)('Number of reservationNumbers must be less than or equal to %s', maxNumCOAReservationNumbers));
|
|
242
|
+
}
|
|
243
|
+
}
|
|
211
244
|
}
|
|
212
245
|
exports.validateNumItems = validateNumItems;
|
|
213
246
|
function validateOrderedItem(params) {
|
|
@@ -1,48 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 進行中注文取引サービス
|
|
3
3
|
*/
|
|
4
|
-
import type { MongoRepository as TransactionRepo } from '../../repo/transaction';
|
|
5
|
-
import * as factory from '../../factory';
|
|
6
4
|
import { POINT_AWARD_IDENTIFIER_NAME } from '../../factory/order';
|
|
7
5
|
import { confirm } from './placeOrderInProgress/confirm';
|
|
8
6
|
import { publishConfirmationNumberIfNotExist } from './placeOrderInProgress/publishConfirmationNumberIfNotExist';
|
|
9
7
|
import { publishOrderNumberIfNotExist } from './placeOrderInProgress/publishOrderNumberIfNotExist';
|
|
10
8
|
import { start } from './placeOrderInProgress/start';
|
|
11
|
-
|
|
12
|
-
* インセンティブ承認
|
|
13
|
-
*/
|
|
14
|
-
declare function authorizeAward(params: {
|
|
15
|
-
transaction: {
|
|
16
|
-
id: string;
|
|
17
|
-
};
|
|
18
|
-
agent: {
|
|
19
|
-
id: string;
|
|
20
|
-
};
|
|
21
|
-
object?: {
|
|
22
|
-
potentialActions?: {
|
|
23
|
-
givePointAwardParams?: factory.transaction.placeOrder.IGivePointAwardParams[];
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
}): (repos: {
|
|
27
|
-
transaction: TransactionRepo;
|
|
28
|
-
}) => Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* インセンティブ承認を取り消す
|
|
31
|
-
*/
|
|
32
|
-
declare function voidAward(params: {
|
|
33
|
-
/**
|
|
34
|
-
* 取引進行者
|
|
35
|
-
*/
|
|
36
|
-
agent: {
|
|
37
|
-
id: string;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* 取引
|
|
41
|
-
*/
|
|
42
|
-
transaction: {
|
|
43
|
-
id: string;
|
|
44
|
-
};
|
|
45
|
-
}): (repos: {
|
|
46
|
-
transaction: TransactionRepo;
|
|
47
|
-
}) => Promise<void>;
|
|
48
|
-
export { authorizeAward, confirm, POINT_AWARD_IDENTIFIER_NAME, publishConfirmationNumberIfNotExist, publishOrderNumberIfNotExist, start, voidAward };
|
|
9
|
+
export { confirm, POINT_AWARD_IDENTIFIER_NAME, publishConfirmationNumberIfNotExist, publishOrderNumberIfNotExist, start };
|
|
@@ -1,16 +1,9 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
|
|
3
|
+
exports.start = exports.publishOrderNumberIfNotExist = exports.publishConfirmationNumberIfNotExist = exports.POINT_AWARD_IDENTIFIER_NAME = exports.confirm = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* 進行中注文取引サービス
|
|
6
|
+
*/
|
|
14
7
|
const order_1 = require("../../factory/order");
|
|
15
8
|
Object.defineProperty(exports, "POINT_AWARD_IDENTIFIER_NAME", { enumerable: true, get: function () { return order_1.POINT_AWARD_IDENTIFIER_NAME; } });
|
|
16
9
|
const confirm_1 = require("./placeOrderInProgress/confirm");
|
|
@@ -21,67 +14,3 @@ const publishOrderNumberIfNotExist_1 = require("./placeOrderInProgress/publishOr
|
|
|
21
14
|
Object.defineProperty(exports, "publishOrderNumberIfNotExist", { enumerable: true, get: function () { return publishOrderNumberIfNotExist_1.publishOrderNumberIfNotExist; } });
|
|
22
15
|
const start_1 = require("./placeOrderInProgress/start");
|
|
23
16
|
Object.defineProperty(exports, "start", { enumerable: true, get: function () { return start_1.start; } });
|
|
24
|
-
/**
|
|
25
|
-
* インセンティブ承認
|
|
26
|
-
*/
|
|
27
|
-
function authorizeAward(params) {
|
|
28
|
-
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
var _a, _b;
|
|
30
|
-
const transaction = yield repos.transaction.findInProgressById({
|
|
31
|
-
typeOf: factory.transactionType.PlaceOrder,
|
|
32
|
-
id: params.transaction.id
|
|
33
|
-
});
|
|
34
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
35
|
-
/* istanbul ignore if: please write tests */
|
|
36
|
-
if (transaction.agent.id !== params.agent.id) {
|
|
37
|
-
throw new factory.errors.Forbidden('Transaction not yours');
|
|
38
|
-
}
|
|
39
|
-
if (transaction.agent.typeOf !== factory.personType.Person) {
|
|
40
|
-
throw new factory.errors.Forbidden('Membership required');
|
|
41
|
-
}
|
|
42
|
-
// いったん特典リセット
|
|
43
|
-
yield voidAward(params)(repos);
|
|
44
|
-
const givePointAwardParams = (_b = (_a = params.object) === null || _a === void 0 ? void 0 : _a.potentialActions) === null || _b === void 0 ? void 0 : _b.givePointAwardParams;
|
|
45
|
-
if (Array.isArray(givePointAwardParams)) {
|
|
46
|
-
const pointAwardIdentifiers = givePointAwardParams.map((g) => { var _a; return String((_a = g.object) === null || _a === void 0 ? void 0 : _a.identifier); });
|
|
47
|
-
// 取引にインセンティブ付与アクションパラメータを保管する
|
|
48
|
-
yield repos.transaction.findByIdAndUpdateInProgress({
|
|
49
|
-
id: transaction.id,
|
|
50
|
-
update: {
|
|
51
|
-
$set: {
|
|
52
|
-
'object.potentialActions.givePointAward': givePointAwardParams
|
|
53
|
-
},
|
|
54
|
-
// order.identifierに入金識別子を保管する
|
|
55
|
-
$push: { 'object.identifier': { name: order_1.POINT_AWARD_IDENTIFIER_NAME, value: JSON.stringify(pointAwardIdentifiers) } }
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
exports.authorizeAward = authorizeAward;
|
|
62
|
-
/**
|
|
63
|
-
* インセンティブ承認を取り消す
|
|
64
|
-
*/
|
|
65
|
-
function voidAward(params) {
|
|
66
|
-
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
const transaction = yield repos.transaction.findInProgressById({
|
|
68
|
-
typeOf: factory.transactionType.PlaceOrder,
|
|
69
|
-
id: params.transaction.id
|
|
70
|
-
});
|
|
71
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
72
|
-
/* istanbul ignore if */
|
|
73
|
-
if (transaction.agent.id !== params.agent.id) {
|
|
74
|
-
throw new factory.errors.Forbidden('Transaction not yours');
|
|
75
|
-
}
|
|
76
|
-
yield repos.transaction.findByIdAndUpdateInProgress({
|
|
77
|
-
id: transaction.id,
|
|
78
|
-
update: {
|
|
79
|
-
$unset: {
|
|
80
|
-
'object.potentialActions.givePointAward': 1
|
|
81
|
-
},
|
|
82
|
-
$pull: { 'object.identifier': { name: order_1.POINT_AWARD_IDENTIFIER_NAME } }
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
exports.voidAward = voidAward;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { MongoRepository as AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
2
|
+
import type { MongoRepository as AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
3
|
+
import type { MongoRepository as OrderRepo } from '../../repo/order';
|
|
4
|
+
export declare function validateOrder(params: {
|
|
5
|
+
orderNumber: string;
|
|
6
|
+
project: {
|
|
7
|
+
id: string;
|
|
8
|
+
};
|
|
9
|
+
}): (repos: {
|
|
10
|
+
acceptedOffer: AcceptedOfferRepo;
|
|
11
|
+
assetTransaction: AssetTransactionRepo;
|
|
12
|
+
order: OrderRepo;
|
|
13
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import * as createDebug from 'debug';
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.validateOrder = void 0;
|
|
14
|
+
const factory = require("../../factory");
|
|
15
|
+
const factory_1 = require("../offer/event/factory");
|
|
16
|
+
const validateMovieTicket_1 = require("../transaction/placeOrderInProgress/validation/validateMovieTicket");
|
|
17
|
+
// const debug = createDebug('chevre-domain:service:validation');
|
|
18
|
+
// tslint:disable-next-line:max-func-body-length
|
|
19
|
+
function validateOrder(params) {
|
|
20
|
+
// tslint:disable-next-line:max-func-body-length
|
|
21
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const order = yield repos.order.findByOrderNumber({
|
|
23
|
+
orderNumber: params.orderNumber,
|
|
24
|
+
project: { id: params.project.id },
|
|
25
|
+
inclusion: [],
|
|
26
|
+
exclusion: []
|
|
27
|
+
});
|
|
28
|
+
const acceptedOffers = yield repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
29
|
+
orderNumber: { $eq: params.orderNumber },
|
|
30
|
+
project: { id: { $eq: params.project.id } }
|
|
31
|
+
});
|
|
32
|
+
let payTransactions = [];
|
|
33
|
+
if (order.paymentMethods.length > 0) {
|
|
34
|
+
payTransactions = yield repos.assetTransaction.search({
|
|
35
|
+
project: { id: { $eq: order.project.id } },
|
|
36
|
+
typeOf: factory.assetTransactionType.Pay,
|
|
37
|
+
transactionNumber: { $in: order.paymentMethods.map(({ paymentMethodId }) => paymentMethodId) }
|
|
38
|
+
}, [], []);
|
|
39
|
+
}
|
|
40
|
+
// 型検証
|
|
41
|
+
if (typeof order.confirmationNumber !== 'string' || order.confirmationNumber.length === 0) {
|
|
42
|
+
throw new Error(`invalid confirmationNumber [${typeof order.confirmationNumber}]`);
|
|
43
|
+
}
|
|
44
|
+
if (!Array.isArray(order.orderedItem)) {
|
|
45
|
+
throw new Error(`invalid orderedItem [${typeof order.orderedItem}]`);
|
|
46
|
+
}
|
|
47
|
+
if (!Array.isArray(order.paymentMethods)) {
|
|
48
|
+
throw new Error(`invalid paymentMethods [${typeof order.paymentMethods}]`);
|
|
49
|
+
}
|
|
50
|
+
if (!(order.orderDate instanceof Date)) {
|
|
51
|
+
throw new Error(`invalid orderDate [${typeof order.orderDate}]`);
|
|
52
|
+
}
|
|
53
|
+
if (typeof order.price !== 'number') {
|
|
54
|
+
throw new Error(`invalid price [${typeof order.price}]`);
|
|
55
|
+
}
|
|
56
|
+
if (typeof order.orderStatus !== 'string') {
|
|
57
|
+
throw new Error(`invalid orderStatus [${typeof order.orderStatus}]`);
|
|
58
|
+
}
|
|
59
|
+
acceptedOffers.forEach(({ itemOffered, priceSpecification, serialNumber }) => {
|
|
60
|
+
const { typeOf } = itemOffered;
|
|
61
|
+
if (typeof typeOf !== 'string') {
|
|
62
|
+
throw new Error(`invalid acceptedOffer.itemOffered.typeOf [${typeof typeOf}]`);
|
|
63
|
+
}
|
|
64
|
+
if (priceSpecification !== undefined) {
|
|
65
|
+
if (!Array.isArray(priceSpecification.priceComponent)) {
|
|
66
|
+
// tslint:disable-next-line:max-line-length
|
|
67
|
+
throw new Error(`invalid acceptedOffer.priceSpecification.priceComponent [${typeof priceSpecification.priceComponent}]`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (typeof serialNumber !== 'string' || serialNumber.length === 0) {
|
|
71
|
+
throw new Error(`invalid acceptedOffer.serialNumber [${typeof serialNumber}]`);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
let reservationForIds = [];
|
|
75
|
+
let itemOfferedTypeOfs = [];
|
|
76
|
+
acceptedOffers.forEach(({ itemOffered }) => {
|
|
77
|
+
itemOfferedTypeOfs.push(itemOffered.typeOf);
|
|
78
|
+
if (itemOffered.typeOf === factory.reservationType.BusReservation
|
|
79
|
+
|| itemOffered.typeOf === factory.reservationType.EventReservation) {
|
|
80
|
+
reservationForIds.push(itemOffered.reservationFor.id);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
reservationForIds = [...new Set(reservationForIds)];
|
|
84
|
+
itemOfferedTypeOfs = [...new Set(itemOfferedTypeOfs)];
|
|
85
|
+
// orderedItem検証
|
|
86
|
+
if (order.orderedItem.length !== reservationForIds.length) {
|
|
87
|
+
throw new Error(`invalid orderedItem.length:${order.orderedItem.length} [expected:${reservationForIds.length}]`);
|
|
88
|
+
}
|
|
89
|
+
// itemOffered.typeOf検証
|
|
90
|
+
if (itemOfferedTypeOfs.length !== 1) {
|
|
91
|
+
throw new Error(`itemOfferedTypeOfs.length must be 1 [${itemOfferedTypeOfs.length}]`);
|
|
92
|
+
}
|
|
93
|
+
// price検証
|
|
94
|
+
let priceExpected = 0;
|
|
95
|
+
const itemOfferedTypeOf = itemOfferedTypeOfs[0];
|
|
96
|
+
switch (itemOfferedTypeOf) {
|
|
97
|
+
case factory.reservationType.BusReservation:
|
|
98
|
+
case factory.reservationType.EventReservation:
|
|
99
|
+
const reservationAcceptedOffers = acceptedOffers;
|
|
100
|
+
const coaTicketInfoExists = reservationAcceptedOffers[0].itemOffered.reservedTicket.coaTicketInfo !== undefined;
|
|
101
|
+
if (coaTicketInfoExists) {
|
|
102
|
+
// 実際の発生金額を算出
|
|
103
|
+
priceExpected = reservationAcceptedOffers.reduce((a, { itemOffered }) => {
|
|
104
|
+
const coaTicketInfo = itemOffered.reservedTicket.coaTicketInfo;
|
|
105
|
+
if (coaTicketInfo === undefined) {
|
|
106
|
+
throw new Error(`itemOffered.reservedTicket.coaTicketInfo not found`);
|
|
107
|
+
}
|
|
108
|
+
if (typeof coaTicketInfo.salesTicketSalePrice !== 'number'
|
|
109
|
+
|| typeof coaTicketInfo.addGlasses !== 'number'
|
|
110
|
+
|| typeof coaTicketInfo.spseatAdd1 !== 'number'
|
|
111
|
+
|| typeof coaTicketInfo.spseatAdd2 !== 'number') {
|
|
112
|
+
throw new Error(`invalid itemOffered.reservedTicket.coaTicketInfo`);
|
|
113
|
+
}
|
|
114
|
+
return a + [
|
|
115
|
+
coaTicketInfo.salesTicketSalePrice,
|
|
116
|
+
coaTicketInfo.addGlasses,
|
|
117
|
+
coaTicketInfo.spseatAdd1,
|
|
118
|
+
coaTicketInfo.spseatAdd2
|
|
119
|
+
].reduce((a2, b2) => a2 + b2, 0);
|
|
120
|
+
}, 0);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
priceExpected = (0, factory_1.acceptedOffers2amount)({
|
|
124
|
+
acceptedOffers: reservationAcceptedOffers
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
break;
|
|
128
|
+
case factory.permit.PermitType.Permit:
|
|
129
|
+
break;
|
|
130
|
+
case factory.actionType.MoneyTransfer:
|
|
131
|
+
break;
|
|
132
|
+
default:
|
|
133
|
+
throw new Error(`invalid itemOfferedTypeOf [${itemOfferedTypeOf}]`);
|
|
134
|
+
}
|
|
135
|
+
if (order.price !== priceExpected) {
|
|
136
|
+
throw new Error(`order.price should be ${priceExpected} [actual: ${order.price}]`);
|
|
137
|
+
}
|
|
138
|
+
// MovieTicket検証
|
|
139
|
+
if (payTransactions.length !== order.paymentMethods.length) {
|
|
140
|
+
throw new Error(`payTransactions.length should be ${order.paymentMethods.length} [actual: ${payTransactions.length}]`);
|
|
141
|
+
}
|
|
142
|
+
order.paymentMethods
|
|
143
|
+
.filter(({ issuedThrough }) => issuedThrough.typeOf === factory.service.paymentService.PaymentServiceType.MovieTicket)
|
|
144
|
+
.forEach(({ paymentMethod }) => {
|
|
145
|
+
if (typeof (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.identifier) !== 'string') {
|
|
146
|
+
throw new Error(`invalid order.paymentMethods.paymentMethod.identifier [${paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.identifier}]`);
|
|
147
|
+
}
|
|
148
|
+
const authorizedMovieTickets = [];
|
|
149
|
+
payTransactions.filter(({ object }) => object.typeOf === factory.service.paymentService.PaymentServiceType.MovieTicket
|
|
150
|
+
&& object.paymentMethod.identifier === paymentMethod.identifier)
|
|
151
|
+
.forEach((a) => {
|
|
152
|
+
authorizedMovieTickets.push(...(Array.isArray(a.object.paymentMethod.movieTickets)) ? a.object.paymentMethod.movieTickets : []);
|
|
153
|
+
});
|
|
154
|
+
(0, validateMovieTicket_1.validateMovieTicket)(paymentMethod.identifier, { id: 'xxxx' }, authorizedMovieTickets, acceptedOffers);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
exports.validateOrder = validateOrder;
|
package/lib/chevre/settings.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as factory from './factory';
|
|
2
2
|
export declare const TRIGGER_WEBHOOK_MAX_RETRY_COUNT: number;
|
|
3
3
|
export declare const TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS: number;
|
|
4
|
+
export declare const MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS: number;
|
|
4
5
|
export declare const ABORTED_TASKS_WITHOUT_REPORT: string[];
|
|
5
6
|
export declare const MAX_NUM_CREDIT_CARD_PAYMENT_METHOD: number;
|
|
6
7
|
/**
|
|
@@ -26,7 +27,6 @@ export type ISettings = factory.project.ISettings & {
|
|
|
26
27
|
onResourceUpdated: {
|
|
27
28
|
informResource?: factory.project.IInformParams[];
|
|
28
29
|
};
|
|
29
|
-
maximumReservationGracePeriodInDays: number;
|
|
30
30
|
userPoolIdOld: string;
|
|
31
31
|
userPoolIdNew: string;
|
|
32
32
|
useAggregateEntranceGateProjects: string[];
|
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.DELIVER_ORDER_LIMIT = exports.MONGO_AUTO_INDEX = exports.MONGO_READ_PREFERENCE = exports.MONGO_MAX_TIME_MS = exports.USE_OWNERSHIP_INFO_BY_WEB_APPLICATION = exports.USE_VALIDATE_PROJECT_MAKES_OFFER = exports.USE_MINIMIZED_PAY_TASK = exports.USE_SEND_EMAIL_MESSAGE_ON_ORDER_PROCESSING = exports.USE_INFORM_ORDER_IN_TRANSIT = exports.USE_FETCH_API = exports.USE_OPTIMIZE_TICKET_OFFER = exports.USE_DELETE_EVENT_BY_ORDER = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = exports.DEFAULT_TASKS_EXPORT_AGENT_NAME = 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.MAX_NUM_CREDIT_CARD_PAYMENT_METHOD = exports.ABORTED_TASKS_WITHOUT_REPORT = exports.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS = exports.TRIGGER_WEBHOOK_MAX_RETRY_COUNT = void 0;
|
|
3
|
+
exports.settings = exports.DELIVER_ORDER_LIMIT = exports.MONGO_AUTO_INDEX = exports.MONGO_READ_PREFERENCE = exports.MONGO_MAX_TIME_MS = exports.USE_OWNERSHIP_INFO_BY_WEB_APPLICATION = exports.USE_VALIDATE_PROJECT_MAKES_OFFER = exports.USE_MINIMIZED_PAY_TASK = exports.USE_SEND_EMAIL_MESSAGE_ON_ORDER_PROCESSING = exports.USE_INFORM_ORDER_IN_TRANSIT = exports.USE_FETCH_API = exports.USE_OPTIMIZE_TICKET_OFFER = exports.USE_DELETE_EVENT_BY_ORDER = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = exports.DEFAULT_TASKS_EXPORT_AGENT_NAME = 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.MAX_NUM_CREDIT_CARD_PAYMENT_METHOD = exports.ABORTED_TASKS_WITHOUT_REPORT = exports.MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS = exports.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS = exports.TRIGGER_WEBHOOK_MAX_RETRY_COUNT = 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(' ')
|
|
@@ -25,7 +25,7 @@ exports.TRIGGER_WEBHOOK_MAX_RETRY_COUNT = (typeof process.env.TRIGGER_WEBHOOK_MA
|
|
|
25
25
|
exports.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS = (typeof process.env.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS === 'string')
|
|
26
26
|
? Number(process.env.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS)
|
|
27
27
|
: 0;
|
|
28
|
-
|
|
28
|
+
exports.MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS = (typeof process.env.MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS === 'string')
|
|
29
29
|
? Number(process.env.MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS)
|
|
30
30
|
// tslint:disable-next-line:no-magic-numbers
|
|
31
31
|
: 93;
|
|
@@ -149,7 +149,7 @@ exports.settings = {
|
|
|
149
149
|
webhook: {
|
|
150
150
|
timeout: triggerWebhookTimeout
|
|
151
151
|
},
|
|
152
|
-
maximumReservationGracePeriodInDays: MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS,
|
|
152
|
+
// maximumReservationGracePeriodInDays: MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS,
|
|
153
153
|
userPoolIdOld: String(process.env.USERPOOL_ID_OLD),
|
|
154
154
|
userPoolIdNew: String(process.env.USERPOOL_ID_NEW),
|
|
155
155
|
// ...(typeof MAX_NUM_CREDIT_CARD_PAYMENT_METHOD === 'number')
|
package/package.json
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/credential-providers": "3.433.0",
|
|
13
|
-
"@chevre/factory": "4.
|
|
14
|
-
"@cinerino/sdk": "5.
|
|
13
|
+
"@chevre/factory": "4.362.0-alpha.1",
|
|
14
|
+
"@cinerino/sdk": "5.14.0-alpha.0",
|
|
15
15
|
"@motionpicture/coa-service": "9.4.0",
|
|
16
16
|
"@motionpicture/gmo-service": "5.3.0",
|
|
17
17
|
"@sendgrid/mail": "6.4.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.
|
|
113
|
+
"version": "21.26.0-alpha.1"
|
|
114
114
|
}
|
|
@@ -1,72 +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
|
-
// tslint:disable-next-line:max-func-body-length
|
|
10
|
-
async function main() {
|
|
11
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
12
|
-
|
|
13
|
-
const assetTransactionRepo = await chevre.repository.AssetTransaction.createInstance(mongoose.connection);
|
|
14
|
-
|
|
15
|
-
const cursor = assetTransactionRepo.getCursor(
|
|
16
|
-
{
|
|
17
|
-
typeOf: { $eq: chevre.factory.assetTransactionType.Pay },
|
|
18
|
-
// 'object.paymentMethodId': { $exists: false },
|
|
19
|
-
// 'project.id': { $eq: project.id },
|
|
20
|
-
startDate: {
|
|
21
|
-
$gte: moment()
|
|
22
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
23
|
-
.add(-12, 'months')
|
|
24
|
-
.toDate()
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
typeOf: 1,
|
|
29
|
-
project: 1,
|
|
30
|
-
object: 1,
|
|
31
|
-
transactionNumber: 1,
|
|
32
|
-
startDate: 1
|
|
33
|
-
}
|
|
34
|
-
);
|
|
35
|
-
console.log('transactions found');
|
|
36
|
-
|
|
37
|
-
let i = 0;
|
|
38
|
-
let updateCount = 0;
|
|
39
|
-
await cursor.eachAsync(async (doc) => {
|
|
40
|
-
i += 1;
|
|
41
|
-
const payTransaction: Pick<
|
|
42
|
-
chevre.factory.assetTransaction.pay.ITransaction,
|
|
43
|
-
'project' | 'object' | 'transactionNumber' | 'startDate' | 'typeOf'
|
|
44
|
-
> = doc.toObject();
|
|
45
|
-
|
|
46
|
-
const alreadyMigrated = typeof payTransaction.object.paymentMethodId === 'string'
|
|
47
|
-
&& payTransaction.object.paymentMethodId === (<any>payTransaction.object.paymentMethod).paymentMethodId;
|
|
48
|
-
|
|
49
|
-
if (alreadyMigrated) {
|
|
50
|
-
console.log(
|
|
51
|
-
'already exist.',
|
|
52
|
-
payTransaction.project.id, payTransaction.typeOf, payTransaction.transactionNumber, payTransaction.startDate, i);
|
|
53
|
-
} else {
|
|
54
|
-
const paymentMethodIdentifier = (<any>payTransaction.object.paymentMethod).typeOf;
|
|
55
|
-
console.log(
|
|
56
|
-
'updating...',
|
|
57
|
-
payTransaction.project.id, payTransaction.typeOf, payTransaction.transactionNumber, payTransaction.startDate, i,
|
|
58
|
-
paymentMethodIdentifier);
|
|
59
|
-
updateCount += 1;
|
|
60
|
-
console.log(
|
|
61
|
-
'updated.',
|
|
62
|
-
payTransaction.project.id, payTransaction.typeOf, payTransaction.transactionNumber, payTransaction.startDate, i);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
console.log(i, 'transactions checked');
|
|
67
|
-
console.log(updateCount, 'transactions updated');
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
main()
|
|
71
|
-
.then()
|
|
72
|
-
.catch(console.error);
|
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/givePointAward.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as factory from '../../../../factory';
|
|
2
|
-
export declare function createGivePointAwardActions(params: {
|
|
3
|
-
order: factory.order.IOrder;
|
|
4
|
-
transaction: factory.transaction.placeOrder.ITransaction;
|
|
5
|
-
}): Promise<factory.action.transfer.give.pointAward.IAttributes[]>;
|
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/givePointAward.js
DELETED
|
@@ -1,70 +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.createGivePointAwardActions = void 0;
|
|
13
|
-
const factory = require("../../../../factory");
|
|
14
|
-
// import { createMaskedCustomer } from '../../../../factory/order';
|
|
15
|
-
function createGivePointAwardActions(params) {
|
|
16
|
-
var _a;
|
|
17
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
const actions = [];
|
|
19
|
-
// インセンティブ付与アクションの指定があればそちらを反映
|
|
20
|
-
const givePointAwardParams = (_a = params.transaction.object.potentialActions) === null || _a === void 0 ? void 0 : _a.givePointAward;
|
|
21
|
-
if (Array.isArray(givePointAwardParams)) {
|
|
22
|
-
const givePointAwardPurpose = {
|
|
23
|
-
typeOf: params.order.typeOf,
|
|
24
|
-
// seller: {
|
|
25
|
-
// id: params.order.seller.id,
|
|
26
|
-
// typeOf: params.order.seller.typeOf,
|
|
27
|
-
// name: params.order.seller.name
|
|
28
|
-
// }, // 廃止(2024-03-06~)
|
|
29
|
-
// mask
|
|
30
|
-
// customer: createMaskedCustomer(params.order, { noProfile: true }), // 廃止(2024-03-06~)
|
|
31
|
-
orderNumber: params.order.orderNumber,
|
|
32
|
-
price: params.order.price,
|
|
33
|
-
priceCurrency: params.order.priceCurrency,
|
|
34
|
-
orderDate: params.order.orderDate
|
|
35
|
-
};
|
|
36
|
-
// メンバーシップごとに、特典を確認してインセンティブ付与
|
|
37
|
-
givePointAwardParams.forEach((givePointAwardParam) => {
|
|
38
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
39
|
-
const amount = (_a = givePointAwardParam.object) === null || _a === void 0 ? void 0 : _a.amount;
|
|
40
|
-
const pointAwardIdentifier = (_b = givePointAwardParam.object) === null || _b === void 0 ? void 0 : _b.identifier;
|
|
41
|
-
const accountNumber = (_d = (_c = givePointAwardParam.object) === null || _c === void 0 ? void 0 : _c.toLocation) === null || _d === void 0 ? void 0 : _d.accountNumber;
|
|
42
|
-
const description = (_e = givePointAwardParam.object) === null || _e === void 0 ? void 0 : _e.description;
|
|
43
|
-
if (typeof amount === 'number' && typeof accountNumber === 'string') {
|
|
44
|
-
actions.push({
|
|
45
|
-
project: params.transaction.project,
|
|
46
|
-
typeOf: factory.actionType.GiveAction,
|
|
47
|
-
// agent: params.transaction.project,
|
|
48
|
-
agent: {
|
|
49
|
-
id: params.order.seller.id,
|
|
50
|
-
typeOf: params.order.seller.typeOf,
|
|
51
|
-
name: params.order.seller.name
|
|
52
|
-
},
|
|
53
|
-
recipient: {
|
|
54
|
-
typeOf: params.order.customer.typeOf,
|
|
55
|
-
id: params.order.customer.id,
|
|
56
|
-
name: String(params.order.customer.name)
|
|
57
|
-
},
|
|
58
|
-
object: Object.assign({ typeOf: factory.action.transfer.give.pointAward.ObjectType.PointAward, amount: amount, toLocation: {
|
|
59
|
-
accountNumber: accountNumber,
|
|
60
|
-
issuedThrough: { id: String((_h = (_g = (_f = givePointAwardParam.object) === null || _f === void 0 ? void 0 : _f.toLocation) === null || _g === void 0 ? void 0 : _g.issuedThrough) === null || _h === void 0 ? void 0 : _h.id) }
|
|
61
|
-
}, description: (typeof description === 'string') ? description : '' }, (typeof pointAwardIdentifier === 'string') ? { identifier: pointAwardIdentifier } : undefined),
|
|
62
|
-
purpose: givePointAwardPurpose
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
return actions;
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
exports.createGivePointAwardActions = createGivePointAwardActions;
|