@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.
Files changed (94) hide show
  1. package/lib/chevre/emailMessageBuilder.d.ts +10 -4
  2. package/lib/chevre/emailMessageBuilder.js +48 -73
  3. package/lib/chevre/repo/acceptedOffer.d.ts +1 -5
  4. package/lib/chevre/repo/acceptedOffer.js +5 -5
  5. package/lib/chevre/repo/acceptedOfferInReserve.d.ts +1 -5
  6. package/lib/chevre/repo/acceptedOfferInReserve.js +4 -4
  7. package/lib/chevre/repo/emailMessage.d.ts +18 -9
  8. package/lib/chevre/repo/emailMessage.js +26 -36
  9. package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +1 -3
  10. package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.js +2 -3
  11. package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +9 -1
  12. package/lib/chevre/repo/mongoose/schemas/emailMessages.js +5 -20
  13. package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
  14. package/lib/chevre/repo/mongoose/schemas/order.js +11 -110
  15. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +0 -6
  16. package/lib/chevre/repo/order.d.ts +9 -6
  17. package/lib/chevre/repo/order.js +45 -26
  18. package/lib/chevre/repo/orderInTransaction.d.ts +50 -32
  19. package/lib/chevre/repo/orderInTransaction.js +109 -73
  20. package/lib/chevre/repo/orderNumber.d.ts +4 -0
  21. package/lib/chevre/repo/orderNumber.js +32 -60
  22. package/lib/chevre/repo/passport.d.ts +5 -2
  23. package/lib/chevre/repo/transaction/placeOrder.js +12 -10
  24. package/lib/chevre/repo/transaction.d.ts +6 -2
  25. package/lib/chevre/repo/transaction.js +6 -2
  26. package/lib/chevre/service/assetTransaction/reserve/start.d.ts +0 -2
  27. package/lib/chevre/service/offer/any.d.ts +3 -8
  28. package/lib/chevre/service/offer/any.js +7 -6
  29. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +0 -2
  30. package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
  31. package/lib/chevre/service/offer/event/authorize.js +5 -6
  32. package/lib/chevre/service/offer/event/voidTransaction.js +29 -17
  33. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +16 -12
  34. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.d.ts +0 -6
  35. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +10 -12
  36. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
  37. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +7 -7
  38. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +21 -17
  39. package/lib/chevre/service/order/deleteOrder.js +1 -1
  40. package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.d.ts +4 -1
  41. package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +1 -26
  42. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +3 -2
  43. package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
  44. package/lib/chevre/service/order/placeOrder/factory.js +10 -8
  45. package/lib/chevre/service/order/placeOrder/voidAcceptedOfferIfNecessary.d.ts +1 -3
  46. package/lib/chevre/service/order/placeOrder/voidAcceptedOfferIfNecessary.js +3 -15
  47. package/lib/chevre/service/order/placeOrder.js +6 -6
  48. package/lib/chevre/service/order.d.ts +1 -2
  49. package/lib/chevre/service/order.js +1 -5
  50. package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.d.ts +2 -4
  51. package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +4 -6
  52. package/lib/chevre/service/payment/any/authorize.d.ts +2 -0
  53. package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +0 -4
  54. package/lib/chevre/service/payment/any/publishPaymentUrl.js +5 -8
  55. package/lib/chevre/service/reserve/findByCode.js +1 -1
  56. package/lib/chevre/service/reserve/searchByOrder.js +1 -1
  57. package/lib/chevre/service/task/acceptCOAOffer.js +8 -10
  58. package/lib/chevre/service/task/authorizePayment.js +2 -6
  59. package/lib/chevre/service/task/confirmReserveTransaction.js +1 -1
  60. package/lib/chevre/service/task/payment/payByTask.js +1 -1
  61. package/lib/chevre/service/task/publishPaymentUrl.js +6 -9
  62. package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.d.ts +7 -2
  63. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +3 -3
  64. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +8 -23
  65. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +3 -3
  66. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +1 -6
  67. package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +2 -7
  68. package/lib/chevre/service/transaction/placeOrder/confirm.js +38 -35
  69. package/lib/chevre/service/transaction/placeOrder/issueOrderNumberIfNotExist.d.ts +2 -0
  70. package/lib/chevre/service/transaction/placeOrder/issueOrderNumberIfNotExist.js +1 -0
  71. package/lib/chevre/service/transaction/placeOrder/start/factory.d.ts +19 -4
  72. package/lib/chevre/service/transaction/placeOrder/start/factory.js +23 -12
  73. package/lib/chevre/service/transaction/placeOrder/start.d.ts +7 -4
  74. package/lib/chevre/service/transaction/placeOrder/start.js +23 -2
  75. package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -4
  76. package/lib/chevre/service/transaction/placeOrder/updateAgent.js +20 -22
  77. package/lib/chevre/service/transaction/placeOrder.d.ts +1 -2
  78. package/lib/chevre/service/transaction/placeOrder.js +1 -3
  79. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +2 -37
  80. package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.d.ts +2 -2
  81. package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.js +3 -18
  82. package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +0 -1
  83. package/lib/chevre/service/transaction/returnOrder/potentialActions.js +0 -4
  84. package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
  85. package/lib/chevre/service/transaction/returnOrder.d.ts +0 -2
  86. package/lib/chevre/service/transaction/returnOrder.js +13 -12
  87. package/lib/chevre/service/validation/validateOrder.js +1 -1
  88. package/lib/chevre/service.d.ts +0 -2
  89. package/lib/chevre/service.js +0 -2
  90. package/package.json +2 -2
  91. package/lib/chevre/factory/order.d.ts +0 -2
  92. package/lib/chevre/factory/order.js +0 -5
  93. package/lib/chevre/service/order/placeOrderWithoutTransaction.d.ts +0 -22
  94. 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
- }