@chevre/domain 20.2.0-alpha.8 → 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 +86 -68
- 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 +2 -4
- 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 +25 -27
- package/lib/chevre/service/order/onOrderStatusChanged.js +2 -1
- package/lib/chevre/service/order/placeOrder.js +16 -0
- 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 -32
- 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/CHANGELOG.md +0 -2030
- package/example/.gitignore +0 -1
- package/example/src/chevre/.gitignore +0 -1
- 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
|
@@ -10,9 +10,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.call = void 0;
|
|
13
|
+
const accountingReport_1 = require("../../repo/accountingReport");
|
|
13
14
|
const action_1 = require("../../repo/action");
|
|
14
15
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
16
|
+
const event_1 = require("../../repo/event");
|
|
15
17
|
const order_1 = require("../../repo/order");
|
|
18
|
+
const product_1 = require("../../repo/product");
|
|
19
|
+
const project_1 = require("../../repo/project");
|
|
20
|
+
const seller_1 = require("../../repo/seller");
|
|
21
|
+
const task_1 = require("../../repo/task");
|
|
16
22
|
const PayTransactionService = require("../assetTransaction/pay");
|
|
17
23
|
/**
|
|
18
24
|
* タスク実行関数
|
|
@@ -22,6 +28,12 @@ function call(data) {
|
|
|
22
28
|
const actionRepo = new action_1.MongoRepository(settings.connection);
|
|
23
29
|
const assetTransactionRepo = new assetTransaction_1.MongoRepository(settings.connection);
|
|
24
30
|
const orderRepo = new order_1.MongoRepository(settings.connection);
|
|
31
|
+
const accountingReportRepo = new accountingReport_1.MongoRepository(settings.connection);
|
|
32
|
+
const eventRepo = new event_1.MongoRepository(settings.connection);
|
|
33
|
+
const productRepo = new product_1.MongoRepository(settings.connection);
|
|
34
|
+
const projectRepo = new project_1.MongoRepository(settings.connection);
|
|
35
|
+
const sellerRepo = new seller_1.MongoRepository(settings.connection);
|
|
36
|
+
const taskRepo = new task_1.MongoRepository(settings.connection);
|
|
25
37
|
// アクション開始
|
|
26
38
|
const action = yield actionRepo.start(data);
|
|
27
39
|
try {
|
|
@@ -38,8 +50,15 @@ function call(data) {
|
|
|
38
50
|
}
|
|
39
51
|
}
|
|
40
52
|
})({
|
|
53
|
+
action: actionRepo,
|
|
54
|
+
accountingReport: accountingReportRepo,
|
|
41
55
|
assetTransaction: assetTransactionRepo,
|
|
42
|
-
|
|
56
|
+
event: eventRepo,
|
|
57
|
+
order: orderRepo,
|
|
58
|
+
product: productRepo,
|
|
59
|
+
project: projectRepo,
|
|
60
|
+
seller: sellerRepo,
|
|
61
|
+
task: taskRepo
|
|
43
62
|
});
|
|
44
63
|
}
|
|
45
64
|
}
|
|
@@ -3,6 +3,8 @@ import * as factory from '../../factory';
|
|
|
3
3
|
import { MongoRepository as ActionRepo } from '../../repo/action';
|
|
4
4
|
import { MongoRepository as AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
5
5
|
import { MongoRepository as OrderRepo } from '../../repo/order';
|
|
6
|
+
import { MongoRepository as ReservationRepo } from '../../repo/reservation';
|
|
7
|
+
import { MongoRepository as TaskRepo } from '../../repo/task';
|
|
6
8
|
/**
|
|
7
9
|
* タスク実行関数
|
|
8
10
|
*/
|
|
@@ -14,4 +16,6 @@ export declare function confirmReserveTransaction(params: factory.action.interac
|
|
|
14
16
|
action: ActionRepo;
|
|
15
17
|
assetTransaction: AssetTransactionRepo;
|
|
16
18
|
order: OrderRepo;
|
|
19
|
+
reservation: ReservationRepo;
|
|
20
|
+
task: TaskRepo;
|
|
17
21
|
}) => Promise<void>;
|
|
@@ -15,6 +15,8 @@ const factory = require("../../factory");
|
|
|
15
15
|
const action_1 = require("../../repo/action");
|
|
16
16
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
17
17
|
const order_1 = require("../../repo/order");
|
|
18
|
+
const reservation_1 = require("../../repo/reservation");
|
|
19
|
+
const task_1 = require("../../repo/task");
|
|
18
20
|
const ReserveTransactionService = require("../assetTransaction/reserve");
|
|
19
21
|
const credentials_1 = require("../../credentials");
|
|
20
22
|
const coaAuthClient = new COA.auth.RefreshToken({
|
|
@@ -29,7 +31,9 @@ function call(data) {
|
|
|
29
31
|
yield confirmReserveTransaction(data)({
|
|
30
32
|
action: new action_1.MongoRepository(settings.connection),
|
|
31
33
|
assetTransaction: new assetTransaction_1.MongoRepository(settings.connection),
|
|
32
|
-
order: new order_1.MongoRepository(settings.connection)
|
|
34
|
+
order: new order_1.MongoRepository(settings.connection),
|
|
35
|
+
reservation: new reservation_1.MongoRepository(settings.connection),
|
|
36
|
+
task: new task_1.MongoRepository(settings.connection)
|
|
33
37
|
});
|
|
34
38
|
});
|
|
35
39
|
}
|
|
@@ -44,9 +48,6 @@ function confirmReserveTransaction(params) {
|
|
|
44
48
|
const action = yield repos.action.start(confirmActionAttributes);
|
|
45
49
|
try {
|
|
46
50
|
let object = confirmActionAttributes.object;
|
|
47
|
-
// if (params.instrument === undefined) {
|
|
48
|
-
// params.instrument = { typeOf: 'WebAPI', identifier: factory.service.webAPI.Identifier.Chevre };
|
|
49
|
-
// }
|
|
50
51
|
switch (params.instrument.identifier) {
|
|
51
52
|
case factory.service.webAPI.Identifier.COA:
|
|
52
53
|
// COA本予約
|
|
@@ -72,7 +73,6 @@ function confirmReserveTransaction(params) {
|
|
|
72
73
|
object = object;
|
|
73
74
|
yield ReserveTransactionService.confirm({
|
|
74
75
|
transactionNumber: object.transactionNumber,
|
|
75
|
-
// object: object.object,
|
|
76
76
|
potentialActions: object.potentialActions
|
|
77
77
|
})(repos);
|
|
78
78
|
}
|
|
@@ -14,6 +14,7 @@ const action_1 = require("../../repo/action");
|
|
|
14
14
|
const categoryCode_1 = require("../../repo/categoryCode");
|
|
15
15
|
const event_1 = require("../../repo/event");
|
|
16
16
|
const place_1 = require("../../repo/place");
|
|
17
|
+
const seller_1 = require("../../repo/seller");
|
|
17
18
|
const EventService = require("../event");
|
|
18
19
|
/**
|
|
19
20
|
* タスク実行関数
|
|
@@ -24,7 +25,8 @@ function call(data) {
|
|
|
24
25
|
action: new action_1.MongoRepository(settings.connection),
|
|
25
26
|
categoryCode: new categoryCode_1.MongoRepository(settings.connection),
|
|
26
27
|
event: new event_1.MongoRepository(settings.connection),
|
|
27
|
-
place: new place_1.MongoRepository(settings.connection)
|
|
28
|
+
place: new place_1.MongoRepository(settings.connection),
|
|
29
|
+
seller: new seller_1.MongoRepository(settings.connection)
|
|
28
30
|
});
|
|
29
31
|
});
|
|
30
32
|
}
|
|
@@ -64,7 +64,11 @@ function returnPayTransaction(params) {
|
|
|
64
64
|
if (typeof paymentServiceType !== 'string' || paymentServiceType.length === 0) {
|
|
65
65
|
throw new factory.errors.ArgumentNull('object.issuedThrough.typeOf');
|
|
66
66
|
}
|
|
67
|
-
const order = yield repos.order.findByOrderNumber({
|
|
67
|
+
const order = yield repos.order.findByOrderNumber({
|
|
68
|
+
orderNumber,
|
|
69
|
+
inclusion: ['seller', 'project', 'dateReturned'],
|
|
70
|
+
exclusion: []
|
|
71
|
+
});
|
|
68
72
|
const action = yield repos.action.start(refundActionAttributes);
|
|
69
73
|
let refundTransaction;
|
|
70
74
|
try {
|
|
@@ -213,8 +217,10 @@ function onRefund(refundActionAttributes) {
|
|
|
213
217
|
});
|
|
214
218
|
}
|
|
215
219
|
// タスク保管
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
220
|
+
// saveManyに変更(2023-02-01~)
|
|
221
|
+
yield repos.task.saveMany(taskAttributes);
|
|
222
|
+
// await Promise.all(taskAttributes.map(async (taskAttribute) => {
|
|
223
|
+
// return repos.task.save(taskAttribute);
|
|
224
|
+
// }));
|
|
219
225
|
});
|
|
220
226
|
}
|
|
@@ -113,16 +113,13 @@ function abort(params) {
|
|
|
113
113
|
exports.abort = abort;
|
|
114
114
|
function notifyAbortedTasks(params) {
|
|
115
115
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
$gte: params.dateAbortedGte
|
|
120
|
-
}
|
|
121
|
-
});
|
|
116
|
+
const abortedTasks = yield repos.task.search(Object.assign({ statuses: [factory.taskStatus.Aborted], dateAborted: { $gte: params.dateAbortedGte } }, (settings_1.ABORTED_TASKS_WITHOUT_REPORT.length > 0)
|
|
117
|
+
? { name: { $nin: settings_1.ABORTED_TASKS_WITHOUT_REPORT } }
|
|
118
|
+
: undefined));
|
|
122
119
|
// 中止を報告しないタスク以外にフィルター
|
|
123
|
-
abortedTasks = abortedTasks.filter((task) => {
|
|
124
|
-
|
|
125
|
-
});
|
|
120
|
+
// abortedTasks = abortedTasks.filter((task) => {
|
|
121
|
+
// return !ABORTED_TASKS_WITHOUT_REPORT.includes(task.name);
|
|
122
|
+
// });
|
|
126
123
|
if (abortedTasks.length > 0) {
|
|
127
124
|
// 開発者へ報告
|
|
128
125
|
const message = (0, factory_1.tasks2lineNotify)({ tasks: abortedTasks });
|
|
@@ -386,6 +386,12 @@ function validateFromLocation(project, fromLocationBeforeStart, issuedThrough) {
|
|
|
386
386
|
agent: { id: project.id, typeOf: factory.organizationType.Project },
|
|
387
387
|
token: fromLocation
|
|
388
388
|
})({ action: repos.action });
|
|
389
|
+
if (paymentCardOwnershipInfo.typeOf !== 'OwnershipInfo') {
|
|
390
|
+
throw new factory.errors.Argument('fromLocation', 'must be OwnershipInfo');
|
|
391
|
+
}
|
|
392
|
+
if (paymentCardOwnershipInfo.typeOfGood.typeOf !== factory.permit.PermitType.Permit) {
|
|
393
|
+
throw new factory.errors.Argument('fromLocation', 'must be Permit');
|
|
394
|
+
}
|
|
389
395
|
fromLocation = {
|
|
390
396
|
typeOf: paymentCardOwnershipInfo.typeOfGood.typeOf,
|
|
391
397
|
identifier: paymentCardOwnershipInfo.typeOfGood.identifier,
|
|
@@ -576,7 +582,9 @@ function exportTasksById(params) {
|
|
|
576
582
|
transaction,
|
|
577
583
|
runsAt: taskRunsAt
|
|
578
584
|
});
|
|
579
|
-
|
|
585
|
+
// saveManyに変更(2023-02-01~)
|
|
586
|
+
yield repos.task.saveMany(taskAttributes);
|
|
587
|
+
// await Promise.all(taskAttributes.map(async (a) => repos.task.save(a)));
|
|
580
588
|
});
|
|
581
589
|
}
|
|
582
590
|
exports.exportTasksById = exportTasksById;
|
|
@@ -144,6 +144,7 @@ function processPlaceOrder(params) {
|
|
|
144
144
|
}
|
|
145
145
|
// 注文番号を先に発行
|
|
146
146
|
const orderNumber = yield TransactionService.placeOrderInProgress.publishOrderNumberIfNotExist({
|
|
147
|
+
project: { id: transaction.project.id },
|
|
147
148
|
id: transaction.id,
|
|
148
149
|
object: { orderDate: now }
|
|
149
150
|
})(repos);
|
|
@@ -193,9 +194,7 @@ function processPlaceOrder(params) {
|
|
|
193
194
|
orderDate: new Date()
|
|
194
195
|
}
|
|
195
196
|
},
|
|
196
|
-
potentialActions: params.potentialActions
|
|
197
|
-
createConfirmPayActions: false,
|
|
198
|
-
createConfirmReserveActions: false
|
|
197
|
+
potentialActions: params.potentialActions
|
|
199
198
|
})(repos);
|
|
200
199
|
});
|
|
201
200
|
}
|
|
@@ -218,7 +217,8 @@ function processAuthorizeProductOffer(params) {
|
|
|
218
217
|
project: { id: params.project.id },
|
|
219
218
|
itemOffered: { id: params.product.id },
|
|
220
219
|
seller: { id: String(seller.id) },
|
|
221
|
-
onlyValid: true
|
|
220
|
+
onlyValid: true,
|
|
221
|
+
sort: false // ソート不要(2023-01-27~)
|
|
222
222
|
})(repos);
|
|
223
223
|
const acceptedProductOffer = offers.find((o) => o.identifier === acceptedOffer.identifier);
|
|
224
224
|
if (acceptedProductOffer === undefined) {
|
|
@@ -317,8 +317,8 @@ function processAuthorizeCreditCard(params) {
|
|
|
317
317
|
issuedThrough: { id: String(creditCardPaymentService.id) }
|
|
318
318
|
},
|
|
319
319
|
purpose: params.purpose,
|
|
320
|
-
paymentServiceType: factory.service.paymentService.PaymentServiceType.CreditCard
|
|
321
|
-
|
|
320
|
+
paymentServiceType: factory.service.paymentService.PaymentServiceType.CreditCard,
|
|
321
|
+
useCancelPayTransactionOnFailed: false
|
|
322
322
|
})(repos);
|
|
323
323
|
});
|
|
324
324
|
}
|
|
@@ -36,9 +36,11 @@ function exportTasksById(params) {
|
|
|
36
36
|
transaction,
|
|
37
37
|
runsAt: taskRunsAt
|
|
38
38
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
// saveManyに変更(2023-02-01~)
|
|
40
|
+
yield repos.task.saveMany(taskAttributes);
|
|
41
|
+
// await Promise.all(taskAttributes.map(async (taskAttribute) => {
|
|
42
|
+
// await repos.task.save(taskAttribute);
|
|
43
|
+
// }));
|
|
42
44
|
});
|
|
43
45
|
}
|
|
44
46
|
exports.exportTasksById = exportTasksById;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
|
-
export declare function createStartParams(params: factory.transaction.placeOrder.IStartParamsWithoutDetail, passport: factory.waiter.passport.IPassport | undefined, seller: factory.seller.ISeller, broker?: factory.order.IBroker): factory.transaction.placeOrder.IStartParams;
|
|
2
|
+
export declare function createStartParams(params: factory.transaction.placeOrder.IStartParamsWithoutDetail, passport: factory.waiter.passport.IPassport | undefined, seller: Pick<factory.seller.ISeller, 'id' | 'name' | 'typeOf' | 'project'>, broker?: factory.order.IBroker): factory.transaction.placeOrder.IStartParams;
|
|
@@ -7,6 +7,4 @@ export declare function createPotentialActions(params: {
|
|
|
7
7
|
potentialActions?: factory.transaction.placeOrder.IPotentialActionsParams;
|
|
8
8
|
transaction: factory.transaction.placeOrder.ITransaction;
|
|
9
9
|
emailMessage?: factory.creativeWork.message.email.ICreativeWork;
|
|
10
|
-
createConfirmPayActions: boolean;
|
|
11
|
-
createConfirmReserveActions: boolean;
|
|
12
10
|
}): Promise<factory.transaction.placeOrder.IPotentialActions>;
|
|
@@ -10,8 +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 confirmPay_1 = require("./potentialActions/confirmPay");
|
|
14
|
-
// import { createConfirmReservationActions } from './potentialActions/confirmReservation';
|
|
15
13
|
const givePointAward_1 = require("./potentialActions/givePointAward");
|
|
16
14
|
const moneyTransfer_1 = require("./potentialActions/moneyTransfer");
|
|
17
15
|
const registerService_1 = require("./potentialActions/registerService");
|
|
@@ -23,13 +21,9 @@ const order_1 = require("../../../factory/order");
|
|
|
23
21
|
*/
|
|
24
22
|
function createPotentialActions(params) {
|
|
25
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
// 予約確定アクション
|
|
27
|
-
// const confirmReservationActions = await createConfirmReservationActions(params);
|
|
28
24
|
const registerServiceActions = yield (0, registerService_1.createRegisterServiceActions)(params);
|
|
29
25
|
// 通貨転送アクション
|
|
30
26
|
const moneyTransferActions = yield (0, moneyTransfer_1.createMoneyTransferActions)(params);
|
|
31
|
-
// 決済確定アクション
|
|
32
|
-
const confirmPayActions = yield (0, confirmPay_1.createConfirmPayActions)(params);
|
|
33
27
|
// ポイントインセンティブに対する承認アクションの分だけ、ポイントインセンティブ付与アクションを作成する
|
|
34
28
|
const givePointAwardActions = yield (0, givePointAward_1.createGivePointAwardActions)(params);
|
|
35
29
|
// 注文配送メール送信設定
|
|
@@ -53,16 +47,13 @@ function createPotentialActions(params) {
|
|
|
53
47
|
typeOf: factory.actionType.SendAction,
|
|
54
48
|
// 取引から注文作成するように変更したのでminimizeする(2022-04-18~)
|
|
55
49
|
object: simpleOrder,
|
|
56
|
-
// agentをプロジェクトに変更(2022-05-18~)
|
|
57
50
|
agent: params.transaction.project,
|
|
58
|
-
// agent: params.transaction.seller,
|
|
59
51
|
recipient: {
|
|
60
52
|
typeOf: params.order.customer.typeOf,
|
|
61
53
|
id: params.order.customer.id,
|
|
62
54
|
name: String(params.order.customer.name)
|
|
63
55
|
},
|
|
64
56
|
potentialActions: {
|
|
65
|
-
// confirmReservation: confirmReservationActions,
|
|
66
57
|
moneyTransfer: moneyTransferActions,
|
|
67
58
|
registerService: registerServiceActions,
|
|
68
59
|
sendEmailMessage: sendEmailMessageActions
|
|
@@ -75,10 +66,10 @@ function createPotentialActions(params) {
|
|
|
75
66
|
// 取引から注文作成するように変更したのでminimizeする(2022-04-18~)
|
|
76
67
|
object: simpleOrder,
|
|
77
68
|
agent: params.transaction.project,
|
|
78
|
-
// agent: params.transaction.agent,
|
|
79
69
|
potentialActions: {
|
|
80
70
|
givePointAward: givePointAwardActions,
|
|
81
|
-
|
|
71
|
+
// 完全廃止(2023-02-03~)
|
|
72
|
+
// pay: confirmPayActions,
|
|
82
73
|
sendOrder: sendOrderActionAttributes
|
|
83
74
|
},
|
|
84
75
|
purpose: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as factory from '../../../../factory';
|
|
2
2
|
export declare function validateSeller(params: {
|
|
3
|
-
seller: factory.seller.ISeller
|
|
3
|
+
seller: Pick<factory.seller.ISeller, 'makesOffer'>;
|
|
4
4
|
clientUser?: factory.clientUser.IClientUser;
|
|
5
5
|
}): {
|
|
6
6
|
makesOfferFromClient: factory.seller.IMakesOffer;
|
|
@@ -60,14 +60,6 @@ export declare type IConfirmParams = factory.transaction.placeOrder.IConfirmPara
|
|
|
60
60
|
result: {
|
|
61
61
|
order: IResultOrderParams;
|
|
62
62
|
};
|
|
63
|
-
/**
|
|
64
|
-
* confirmPayActionをchevreへ完全移行後に廃止
|
|
65
|
-
*/
|
|
66
|
-
createConfirmPayActions: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* confirmReserveActionをchevreへ完全移行後に廃止
|
|
69
|
-
*/
|
|
70
|
-
createConfirmReserveActions: boolean;
|
|
71
63
|
};
|
|
72
64
|
/**
|
|
73
65
|
* 注文取引を確定する
|
|
@@ -92,6 +84,9 @@ export declare function publishConfirmationNumberIfNotExist(params: {
|
|
|
92
84
|
* 未発行であれば、注文番号を発行して取引に保管する
|
|
93
85
|
*/
|
|
94
86
|
export declare function publishOrderNumberIfNotExist(params: {
|
|
87
|
+
project: {
|
|
88
|
+
id: string;
|
|
89
|
+
};
|
|
95
90
|
/**
|
|
96
91
|
* 取引ID
|
|
97
92
|
*/
|