@chevre/domain 28.0.0-alpha.0 → 28.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 (80) hide show
  1. package/lib/chevre/eventEmitter/transaction.d.ts +2 -2
  2. package/lib/chevre/eventEmitter/transaction.js +1 -1
  3. package/lib/chevre/repo/adminEvent.d.ts +0 -6
  4. package/lib/chevre/repo/adminEvent.js +3 -9
  5. package/lib/chevre/repo/adminEventSeries.d.ts +89 -0
  6. package/lib/chevre/repo/adminEventSeries.js +174 -0
  7. package/lib/chevre/repo/adminTransaction.d.ts +35 -39
  8. package/lib/chevre/repo/adminTransaction.js +0 -98
  9. package/lib/chevre/repo/aggregateEvent.js +0 -1
  10. package/lib/chevre/repo/aggregateTransaction.d.ts +0 -1
  11. package/lib/chevre/repo/aggregateTransaction.js +0 -1
  12. package/lib/chevre/repo/event.d.ts +2 -2
  13. package/lib/chevre/repo/event.js +71 -110
  14. package/lib/chevre/repo/eventSeries.d.ts +3 -82
  15. package/lib/chevre/repo/eventSeries.js +3 -201
  16. package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +2 -3
  17. package/lib/chevre/repo/mongoose/schemas/transaction.js +81 -70
  18. package/lib/chevre/repo/order.js +3 -1
  19. package/lib/chevre/repo/orderInTransaction.js +0 -6
  20. package/lib/chevre/repo/place/{hasPOS.d.ts → pos.d.ts} +3 -7
  21. package/lib/chevre/repo/place/{hasPOS.js → pos.js} +14 -13
  22. package/lib/chevre/repo/place/screeningRoom.d.ts +22 -1
  23. package/lib/chevre/repo/place/screeningRoom.js +28 -17
  24. package/lib/chevre/repo/transaction/placeOrder.d.ts +6 -12
  25. package/lib/chevre/repo/transaction/placeOrder.js +53 -146
  26. package/lib/chevre/repo/transaction/returnOrderInProgress.d.ts +7 -6
  27. package/lib/chevre/repo/transaction/returnOrderInProgress.js +8 -12
  28. package/lib/chevre/repo/transaction.d.ts +1 -1
  29. package/lib/chevre/repo/transaction.js +0 -1
  30. package/lib/chevre/repository.d.ts +10 -5
  31. package/lib/chevre/repository.js +19 -8
  32. package/lib/chevre/service/aggregation/event/aggregateOffers.js +1 -2
  33. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +0 -1
  34. package/lib/chevre/service/aggregation/system.js +1 -3
  35. package/lib/chevre/service/assetTransaction/pay/start/preStart/validateAcceptedPaymentMethodIfNeeded.js +1 -2
  36. package/lib/chevre/service/event/saveScreeningEventSeries.d.ts +2 -2
  37. package/lib/chevre/service/event/saveScreeningEventSeries.js +1 -1
  38. package/lib/chevre/service/event/saveScreeningEvents.d.ts +2 -0
  39. package/lib/chevre/service/event.d.ts +2 -0
  40. package/lib/chevre/service/event.js +0 -1
  41. package/lib/chevre/service/offer/event/authorize/factory.d.ts +2 -2
  42. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
  43. package/lib/chevre/service/offer/event/authorize.js +1 -4
  44. package/lib/chevre/service/offer/event/issueEventOfferTicket.js +1 -1
  45. package/lib/chevre/service/offer/event/voidTransaction.js +2 -5
  46. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -4
  47. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +2 -9
  48. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
  49. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +1 -4
  50. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -4
  51. package/lib/chevre/service/offer/onEventChanged.js +2 -4
  52. package/lib/chevre/service/offer.js +1 -2
  53. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +1 -1
  54. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
  55. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +1 -1
  56. package/lib/chevre/service/payment/any/authorize.js +1 -1
  57. package/lib/chevre/service/payment/any/factory.d.ts +2 -2
  58. package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +1 -4
  59. package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
  60. package/lib/chevre/service/payment/any/publishPaymentUrl.js +1 -1
  61. package/lib/chevre/service/task/confirmReturnOrder.js +4 -1
  62. package/lib/chevre/service/task/importEventsFromCOA.js +2 -0
  63. package/lib/chevre/service/task/onResourceDeleted.js +2 -2
  64. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.d.ts +2 -2
  65. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +3 -4
  66. package/lib/chevre/service/task/onResourceUpdated.js +2 -2
  67. package/lib/chevre/service/task/syncResourcesFromCOA.js +3 -1
  68. package/lib/chevre/service/transaction/deleteTransaction.js +1 -1
  69. package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -2
  70. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +2 -2
  71. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -4
  72. package/lib/chevre/service/transaction/placeOrder/start.js +1 -1
  73. package/lib/chevre/service/transaction/placeOrder/updateAgent.js +1 -4
  74. package/lib/chevre/service/transaction/returnOrder/potentialActions.js +1 -3
  75. package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +13 -1
  76. package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -2
  77. package/lib/chevre/service/transaction/returnOrder.d.ts +15 -4
  78. package/lib/chevre/service/transaction/returnOrder.js +5 -15
  79. package/lib/chevre/service/transaction.d.ts +1 -1
  80. package/package.json +2 -2
@@ -16,16 +16,11 @@ Object.defineProperty(exports, "preStart", { enumerable: true, get: function ()
16
16
  */
17
17
  function start(params) {
18
18
  return async (repos) => {
19
- const { transactionObject, expiresInSeconds, seller } = await (0, preStart_1.preStart)(params)(repos);
19
+ const { transactionObject, expiresInSeconds, seller: _seller } = await (0, preStart_1.preStart)(params)(repos);
20
20
  const returnOrderAttributes = {
21
21
  project: params.project,
22
22
  typeOf: factory_1.factory.transactionType.ReturnOrder,
23
23
  agent: params.agent,
24
- seller: {
25
- id: String(seller.id),
26
- typeOf: seller.typeOf,
27
- name: seller.name
28
- },
29
24
  object: transactionObject,
30
25
  expiresInSeconds
31
26
  };
@@ -63,7 +58,7 @@ function saveMessagesIfNeeded(params) {
63
58
  */
64
59
  function confirm(params) {
65
60
  return async (repos) => {
66
- const transaction = await repos.returnOrderInProgress.findReturnOrderById({ typeOf: factory_1.factory.transactionType.ReturnOrder, id: params.id });
61
+ const transaction = await repos.returnOrderInProgress.findReturnOrderById({ id: params.id });
67
62
  if (typeof params.agent?.id === 'string' && transaction.agent.id !== params.agent.id) {
68
63
  throw new factory_1.factory.errors.Forbidden('Transaction not yours');
69
64
  }
@@ -95,16 +90,13 @@ function confirm(params) {
95
90
  if (typeof setting?.defaultSenderEmail !== 'string') {
96
91
  throw new factory_1.factory.errors.NotFound('setting.defaultSenderEmail');
97
92
  }
98
- const result = {};
99
93
  const { emailMessages, potentialActions } = await (0, potentialActions_1.createPotentialActions)({
100
94
  dateReturned: params.object.order.dateReturned,
101
95
  orders: returningOrders,
102
96
  transaction: transaction,
103
97
  ...(params.potentialActions !== undefined) ? { potentialActions: params.potentialActions } : undefined,
104
98
  // ...(emailMessageOnOrderReturned !== undefined) ? { emailMessageOnOrderReturned } : undefined
105
- },
106
- // settings
107
- setting);
99
+ }, setting);
108
100
  // save messages(2024-06-27~)
109
101
  await saveMessagesIfNeeded({
110
102
  project: { id: transaction.project.id },
@@ -128,12 +120,10 @@ function confirm(params) {
128
120
  agent: transaction.agent,
129
121
  startDate: transaction.startDate,
130
122
  object: transaction.object,
131
- project: transaction.project,
132
- potentialActions,
133
- endDate
123
+ potentialActions
134
124
  }
135
125
  };
136
126
  await repos.task.runTaskByIdentifier(confirmReturnOrderTask);
137
- return result;
127
+ // return result;
138
128
  };
139
129
  }
@@ -44,4 +44,4 @@ export declare function exportOneTransactionTasksIfExists(params: {
44
44
  endDate?: factory.sortType;
45
45
  startDate?: factory.sortType;
46
46
  };
47
- }): IExportTasksOperation<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'typeOf'> | undefined>;
47
+ }): IExportTasksOperation<Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'typeOf'> | undefined>;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@aws-sdk/client-cognito-identity-provider": "3.1090.0",
13
13
  "@aws-sdk/credential-providers": "3.1090.0",
14
- "@chevre/factory": "10.5.0-alpha.7",
14
+ "@chevre/factory": "11.0.0-alpha.3",
15
15
  "@motionpicture/coa-service": "10.0.0",
16
16
  "@motionpicture/gmo-service": "6.1.0-alpha.0",
17
17
  "@sendgrid/client": "8.1.4",
@@ -88,5 +88,5 @@
88
88
  "postversion": "git push origin --tags",
89
89
  "prepublishOnly": "npm run clean && npm run build"
90
90
  },
91
- "version": "28.0.0-alpha.0"
91
+ "version": "28.0.0-alpha.10"
92
92
  }