@chevre/domain 25.0.0-alpha.0 → 25.0.0-alpha.10

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 (59) 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 +10 -109
  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 +13 -15
  19. package/lib/chevre/repo/orderInTransaction.js +10 -3
  20. package/lib/chevre/repo/orderNumber.d.ts +4 -0
  21. package/lib/chevre/repo/orderNumber.js +32 -60
  22. package/lib/chevre/repo/transaction.d.ts +5 -1
  23. package/lib/chevre/repo/transaction.js +4 -0
  24. package/lib/chevre/service/offer/any.d.ts +3 -6
  25. package/lib/chevre/service/offer/any.js +3 -1
  26. package/lib/chevre/service/offer/event/authorize/factory.js +1 -1
  27. package/lib/chevre/service/offer/event/authorize.js +3 -1
  28. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +1 -1
  29. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +1 -0
  30. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -0
  31. package/lib/chevre/service/order/deleteOrder.js +1 -1
  32. package/lib/chevre/service/order/placeOrder/factory.js +4 -2
  33. package/lib/chevre/service/order.d.ts +1 -2
  34. package/lib/chevre/service/order.js +1 -5
  35. package/lib/chevre/service/reserve/findByCode.js +1 -1
  36. package/lib/chevre/service/reserve/searchByOrder.js +1 -1
  37. package/lib/chevre/service/task/confirmReserveTransaction.js +1 -1
  38. package/lib/chevre/service/task/payment/payByTask.js +1 -1
  39. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +0 -1
  40. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +8 -23
  41. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +0 -1
  42. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +1 -6
  43. package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +1 -3
  44. package/lib/chevre/service/transaction/placeOrder/confirm.js +17 -14
  45. package/lib/chevre/service/transaction/placeOrder/start/factory.d.ts +0 -1
  46. package/lib/chevre/service/transaction/placeOrder/start/factory.js +3 -5
  47. package/lib/chevre/service/transaction/placeOrder/updateAgent.js +1 -0
  48. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +2 -37
  49. package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.d.ts +2 -2
  50. package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.js +3 -18
  51. package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +0 -1
  52. package/lib/chevre/service/transaction/returnOrder/potentialActions.js +0 -4
  53. package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
  54. package/lib/chevre/service/transaction/returnOrder.d.ts +0 -2
  55. package/lib/chevre/service/transaction/returnOrder.js +13 -12
  56. package/lib/chevre/service/validation/validateOrder.js +1 -1
  57. package/package.json +2 -2
  58. package/lib/chevre/service/order/placeOrderWithoutTransaction.d.ts +0 -22
  59. package/lib/chevre/service/order/placeOrderWithoutTransaction.js +0 -51
@@ -1,22 +0,0 @@
1
- import type { AccountingReportRepo } from '../../repo/accountingReport';
2
- import type { ActionRepo } from '../../repo/action';
3
- import type { OrderRepo } from '../../repo/order';
4
- import type { TaskRepo } from '../../repo/task';
5
- import { factory } from '../../factory';
6
- import { IExternalOrder } from './onOrderStatusChanged';
7
- /**
8
- * 注文取引なしに注文を作成する
9
- */
10
- declare function placeOrderWithoutTransaction(params: {
11
- agent?: factory.action.trade.order.IAgent;
12
- project: {
13
- id: string;
14
- };
15
- object: IExternalOrder;
16
- }): (repos: {
17
- accountingReport: AccountingReportRepo;
18
- action: ActionRepo;
19
- order: OrderRepo;
20
- task: TaskRepo;
21
- }) => Promise<void>;
22
- export { placeOrderWithoutTransaction };
@@ -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
- }