@chevre/domain 25.0.0-alpha.2 → 25.0.0-alpha.20
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/lib/chevre/emailMessageBuilder.d.ts +10 -4
- package/lib/chevre/emailMessageBuilder.js +48 -73
- package/lib/chevre/repo/acceptedOffer.d.ts +1 -5
- package/lib/chevre/repo/acceptedOffer.js +5 -5
- package/lib/chevre/repo/acceptedOfferInReserve.d.ts +1 -5
- package/lib/chevre/repo/acceptedOfferInReserve.js +4 -4
- package/lib/chevre/repo/emailMessage.d.ts +18 -9
- package/lib/chevre/repo/emailMessage.js +26 -36
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +1 -3
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.js +2 -3
- package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +9 -1
- package/lib/chevre/repo/mongoose/schemas/emailMessages.js +5 -20
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/order.js +11 -110
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +0 -6
- package/lib/chevre/repo/order.d.ts +9 -6
- package/lib/chevre/repo/order.js +45 -26
- package/lib/chevre/repo/orderInTransaction.d.ts +50 -32
- package/lib/chevre/repo/orderInTransaction.js +109 -73
- package/lib/chevre/repo/orderNumber.d.ts +4 -0
- package/lib/chevre/repo/orderNumber.js +32 -60
- package/lib/chevre/repo/passport.d.ts +5 -2
- package/lib/chevre/repo/transaction/placeOrder.js +12 -10
- package/lib/chevre/repo/transaction.d.ts +6 -2
- package/lib/chevre/repo/transaction.js +6 -2
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +0 -2
- package/lib/chevre/service/offer/any.d.ts +3 -8
- package/lib/chevre/service/offer/any.js +7 -6
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +0 -2
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
- package/lib/chevre/service/offer/event/authorize.js +5 -6
- package/lib/chevre/service/offer/event/voidTransaction.js +29 -17
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +16 -12
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.d.ts +0 -6
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +10 -12
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +7 -7
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +21 -17
- package/lib/chevre/service/order/deleteOrder.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.d.ts +4 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +1 -26
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +3 -2
- package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory.js +10 -8
- package/lib/chevre/service/order/placeOrder/voidAcceptedOfferIfNecessary.d.ts +1 -3
- package/lib/chevre/service/order/placeOrder/voidAcceptedOfferIfNecessary.js +3 -15
- package/lib/chevre/service/order/placeOrder.js +6 -6
- package/lib/chevre/service/order.d.ts +1 -2
- package/lib/chevre/service/order.js +1 -5
- package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.d.ts +2 -4
- package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +4 -6
- package/lib/chevre/service/payment/any/authorize.d.ts +2 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +0 -4
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +5 -8
- package/lib/chevre/service/reserve/findByCode.js +1 -1
- package/lib/chevre/service/reserve/searchByOrder.js +1 -1
- package/lib/chevre/service/task/acceptCOAOffer.js +8 -10
- package/lib/chevre/service/task/authorizePayment.js +2 -6
- package/lib/chevre/service/task/confirmReserveTransaction.js +1 -1
- package/lib/chevre/service/task/payment/payByTask.js +1 -1
- package/lib/chevre/service/task/publishPaymentUrl.js +6 -9
- package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.d.ts +7 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +3 -3
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +8 -23
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +3 -3
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +1 -6
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +2 -7
- package/lib/chevre/service/transaction/placeOrder/confirm.js +38 -35
- package/lib/chevre/service/transaction/placeOrder/issueOrderNumberIfNotExist.d.ts +2 -0
- package/lib/chevre/service/transaction/placeOrder/issueOrderNumberIfNotExist.js +1 -0
- package/lib/chevre/service/transaction/placeOrder/start/factory.d.ts +19 -4
- package/lib/chevre/service/transaction/placeOrder/start/factory.js +23 -12
- package/lib/chevre/service/transaction/placeOrder/start.d.ts +7 -4
- package/lib/chevre/service/transaction/placeOrder/start.js +23 -2
- package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -4
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +20 -22
- package/lib/chevre/service/transaction/placeOrder.d.ts +1 -2
- package/lib/chevre/service/transaction/placeOrder.js +1 -3
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +2 -37
- package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.d.ts +2 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.js +3 -18
- package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +0 -4
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
- package/lib/chevre/service/transaction/returnOrder.d.ts +0 -2
- package/lib/chevre/service/transaction/returnOrder.js +13 -12
- package/lib/chevre/service/validation/validateOrder.js +1 -1
- package/lib/chevre/service.d.ts +0 -2
- package/lib/chevre/service.js +0 -2
- package/package.json +2 -2
- package/lib/chevre/factory/order.d.ts +0 -2
- package/lib/chevre/factory/order.js +0 -5
- package/lib/chevre/service/order/placeOrderWithoutTransaction.d.ts +0 -22
- package/lib/chevre/service/order/placeOrderWithoutTransaction.js +0 -51
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.placeOrderWithoutTransaction = placeOrderWithoutTransaction;
|
|
4
|
-
const factory_1 = require("../../factory");
|
|
5
|
-
/**
|
|
6
|
-
* 注文取引なしに注文を作成する
|
|
7
|
-
*/
|
|
8
|
-
function placeOrderWithoutTransaction(params) {
|
|
9
|
-
return async (repos) => {
|
|
10
|
-
const order = params.object;
|
|
11
|
-
const simpleOrder = {
|
|
12
|
-
typeOf: order.typeOf,
|
|
13
|
-
// seller: {
|
|
14
|
-
// id: order.seller.id,
|
|
15
|
-
// typeOf: order.seller.typeOf,
|
|
16
|
-
// name: order.seller.name
|
|
17
|
-
// }, // 廃止(2024-03-06~)
|
|
18
|
-
// customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id }, // 廃止(2024-03-06~)
|
|
19
|
-
orderNumber: order.orderNumber,
|
|
20
|
-
// price: order.price,
|
|
21
|
-
// priceCurrency: order.priceCurrency,
|
|
22
|
-
orderDate: order.orderDate
|
|
23
|
-
};
|
|
24
|
-
const orderActionAttributes = {
|
|
25
|
-
agent: (typeof params.agent?.typeOf === 'string') ? params.agent : order.project,
|
|
26
|
-
object: simpleOrder,
|
|
27
|
-
// potentialActions: {}, // discontinue(2024-06-28~)
|
|
28
|
-
project: order.project,
|
|
29
|
-
// purpose: { typeOf: placeOrderTransaction.typeOf, id: placeOrderTransaction.id },
|
|
30
|
-
typeOf: factory_1.factory.actionType.OrderAction
|
|
31
|
-
};
|
|
32
|
-
const action = await repos.action.start(orderActionAttributes);
|
|
33
|
-
try {
|
|
34
|
-
await repos.order.createIfNotExist({
|
|
35
|
-
...order,
|
|
36
|
-
// discounts: [], // 廃止(2024-04-16~)
|
|
37
|
-
acceptedOffers: []
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
try {
|
|
42
|
-
await repos.action.giveUp({ typeOf: orderActionAttributes.typeOf, id: action.id, error });
|
|
43
|
-
}
|
|
44
|
-
catch (__) {
|
|
45
|
-
// 失敗したら仕方ない
|
|
46
|
-
}
|
|
47
|
-
throw error;
|
|
48
|
-
}
|
|
49
|
-
await repos.action.completeWithVoid({ typeOf: orderActionAttributes.typeOf, id: action.id, result: {} });
|
|
50
|
-
};
|
|
51
|
-
}
|