@chevre/domain 21.2.0-alpha.88 → 21.2.0-alpha.89

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.
@@ -10,8 +10,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MongoRepository = void 0;
13
+ const createDebug = require("debug");
13
14
  const reservation_1 = require("./mongoose/schemas/reservation");
14
15
  const factory = require("../factory");
16
+ const debug = createDebug('chevre-domain:repo');
15
17
  /**
16
18
  * 予約リポジトリ
17
19
  */
@@ -925,10 +927,12 @@ class MongoRepository {
925
927
  }
926
928
  confirmByIdIfNotExist(params) {
927
929
  return __awaiter(this, void 0, void 0, function* () {
928
- yield this.reservationModel.findByIdAndUpdate({ _id: { $eq: params.reservation.id } }, {
930
+ const confirmedReservation = yield this.reservationModel.findOneAndUpdate({ _id: { $eq: params.reservation.id } }, {
929
931
  $setOnInsert: Object.assign(Object.assign(Object.assign({}, params.reservation), { _id: params.reservation.id, reservationFor: params.reservationFor, reservationStatus: factory.reservationStatusType.ReservationConfirmed, modifiedTime: new Date() }), (params.underName !== undefined) ? { underName: params.underName } : undefined)
930
- })
932
+ }, { new: true })
933
+ .select({ _id: 1 })
931
934
  .exec();
935
+ debug('confirmByIdIfNotExist processed.confirmedReservation:', confirmedReservation);
932
936
  });
933
937
  }
934
938
  /**
@@ -326,6 +326,13 @@ function authorize(params) {
326
326
  }
327
327
  // 即時に決済取引を中止するか?(2023-02-03~)
328
328
  if (params.useCancelPayTransactionOnFailed) {
329
+ // tslint:disable-next-line:no-suspicious-comment
330
+ // TODO abortエラーの場合は状態不明なので即時中止しない
331
+ // {
332
+ // "type": "aborted",
333
+ // "message": "The user aborted a request.",
334
+ // "name": "AbortError"
335
+ // }
329
336
  yield processVoidPayTransaction({
330
337
  project: action.project,
331
338
  agent: { id: action.project.id },
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.88"
120
+ "version": "21.2.0-alpha.89"
121
121
  }