@chevre/domain 21.2.0-alpha.35 → 21.2.0-alpha.37

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.
@@ -351,10 +351,17 @@ class MongoRepository {
351
351
  */
352
352
  startAndConfirm(params) {
353
353
  return __awaiter(this, void 0, void 0, function* () {
354
- return this.transactionModel.create(Object.assign(Object.assign({}, params), { _id: params.id, typeOf: params.typeOf, startDate: new Date(), status: factory.transactionStatusType.Confirmed, tasksExportAction: {
354
+ const startDate = new Date();
355
+ const confirmedTransaction = yield this.transactionModel.create(Object.assign(Object.assign({}, params), { _id: params.id, typeOf: params.typeOf, startDate, status: factory.transactionStatusType.Confirmed, tasksExportAction: {
355
356
  actionStatus: factory.actionStatusType.PotentialActionStatus
356
- }, tasksExportationStatus: factory.transactionTasksExportationStatus.Unexported, endDate: new Date(), result: params.result, potentialActions: params.potentialActions }))
357
+ }, tasksExportationStatus: factory.transactionTasksExportationStatus.Unexported, endDate: startDate, result: params.result, potentialActions: params.potentialActions }))
357
358
  .then((doc) => doc.toObject());
359
+ assetTransaction_2.assetTransactionEventEmitter.emitAssetTransactionStatusChanged({
360
+ id: params.id,
361
+ typeOf: params.typeOf,
362
+ status: factory.transactionStatusType.Confirmed
363
+ });
364
+ return confirmedTransaction;
358
365
  });
359
366
  }
360
367
  /**
@@ -27,7 +27,7 @@ export declare class MongoRepository {
27
27
  readonly taskModel: typeof Model;
28
28
  constructor(connection: Connection);
29
29
  static CREATE_MONGO_CONDITIONS(params: factory.task.ISearchConditions): any[];
30
- saveMany(taskAttributes: factory.task.IAttributes<factory.taskName>[], options?: IOptionOnCreate): Promise<{
30
+ saveMany(taskAttributes: factory.task.IAttributes<factory.taskName>[], options: IOptionOnCreate): Promise<{
31
31
  id: string;
32
32
  }[]>;
33
33
  createInformTaskIfNotExist(params: factory.task.IAttributes<factory.taskName.TriggerWebhook>, options: IOptionOnCreate): Promise<void>;
@@ -92,7 +92,7 @@ function onReservationCanceled(canceledReservations, useInformReservation) {
92
92
  }
93
93
  // タスク保管
94
94
  if (taskAttributes.length > 0) {
95
- yield repos.task.saveMany(taskAttributes);
95
+ yield repos.task.saveMany(taskAttributes, { emitImmediately: true });
96
96
  }
97
97
  // 冗長な作成を避ける
98
98
  yield (0, offer_1.createAggregateScreeningEventIfNotExist)({
@@ -107,7 +107,7 @@ function onReservationCheckedIn(params) {
107
107
  });
108
108
  }
109
109
  if (tasks.length > 0) {
110
- yield repos.task.saveMany(tasks);
110
+ yield repos.task.saveMany(tasks, { emitImmediately: true });
111
111
  }
112
112
  // 冗長な作成を避ける
113
113
  const reservationForIds = (_a = params.object.reservationFor) === null || _a === void 0 ? void 0 : _a.ids;
@@ -97,7 +97,7 @@ function onReservationUsed(action, attendedReservation) {
97
97
  }
98
98
  }
99
99
  if (tasks.length > 0) {
100
- yield repos.task.saveMany(tasks);
100
+ yield repos.task.saveMany(tasks, { emitImmediately: true });
101
101
  }
102
102
  // 冗長な作成を避ける
103
103
  yield (0, offer_1.createAggregateScreeningEventIfNotExist)({
package/package.json CHANGED
@@ -117,5 +117,5 @@
117
117
  "postversion": "git push origin --tags",
118
118
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
119
119
  },
120
- "version": "21.2.0-alpha.35"
120
+ "version": "21.2.0-alpha.37"
121
121
  }