@chevre/domain 21.37.0-alpha.4 → 21.37.0-alpha.5

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.
@@ -68,10 +68,7 @@ export declare class MongoRepository {
68
68
  addReservations(params: {
69
69
  typeOf: factory.assetTransactionType.Reserve;
70
70
  id: string;
71
- object: Pick<factory.assetTransaction.reserve.IObject, 'acceptedOffer' | 'issuedThrough' | 'reservationFor' | 'subReservation'> & {
72
- issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
73
- reservationFor: factory.assetTransaction.reserve.IReservationFor;
74
- };
71
+ object: Pick<factory.assetTransaction.reserve.IObject, 'acceptedOffer' | 'subReservation'>;
75
72
  }): Promise<void>;
76
73
  /**
77
74
  * 取引を確定する
@@ -360,8 +360,8 @@ class MongoRepository {
360
360
  }, {
361
361
  $set: {
362
362
  'object.acceptedOffer': params.object.acceptedOffer,
363
- 'object.issuedThrough': params.object.issuedThrough,
364
- 'object.reservationFor': params.object.reservationFor,
363
+ // 'object.issuedThrough': params.object.issuedThrough, // start時保管へ移行(2024-07-01~)
364
+ // 'object.reservationFor': params.object.reservationFor, // start時保管へ移行(2024-07-01~)
365
365
  'object.subReservation': params.object.subReservation
366
366
  }
367
367
  }, { new: false, projection: { _id: 1 } })
@@ -3,6 +3,10 @@ import { IMinimizedIndividualEvent } from '../../../factory/event';
3
3
  import { IAcceptedAddOn } from './factory/price';
4
4
  type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
5
5
  export { IAcceptedAddOn };
6
+ type IObject = factory.assetTransaction.reserve.IObject & {
7
+ issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
8
+ reservationFor: factory.assetTransaction.reserve.IReservationFor;
9
+ };
6
10
  export declare function createStartParams(params: factory.assetTransaction.reserve.IStartParamsWithoutDetail & {
7
11
  provider: {
8
12
  /**
@@ -12,7 +16,10 @@ export declare function createStartParams(params: factory.assetTransaction.reser
12
16
  };
13
17
  reservationNumber: string;
14
18
  useHoldStockByTransactionNumber: boolean;
15
- }): factory.assetTransaction.IStartParams<factory.assetTransactionType.Reserve>;
19
+ event: IMinimizedIndividualEvent<factory.eventType.Event | factory.eventType.ScreeningEvent>;
20
+ }): factory.assetTransaction.IStartParams<factory.assetTransactionType.Reserve> & {
21
+ object: IObject;
22
+ };
16
23
  /**
17
24
  * ポイント特典を作成する
18
25
  */
@@ -16,7 +16,12 @@ function createStartParams(params) {
16
16
  id: params.provider.id,
17
17
  typeOf: factory.organizationType.Corporation
18
18
  };
19
- const reservationPackage = Object.assign({ provider, reservationNumber: reservationNumber, reservationStatus: factory.reservationStatusType.ReservationPending,
19
+ // reservationFor,issuedThrough保管をaddReservationsから移行(2024-07-01~)
20
+ const reservationFor = createReservationFor(params.event, true);
21
+ const { issuedThrough } = createIssuedThrough({ reservationFor: params.event });
22
+ const reservationPackage = Object.assign({ issuedThrough,
23
+ provider,
24
+ reservationFor, reservationNumber: reservationNumber, reservationStatus: factory.reservationStatusType.ReservationPending,
20
25
  // trueで固定(2023-07-19~)
21
26
  disablePendingReservations: true, useHoldStockByTransactionNumber: params.useHoldStockByTransactionNumber, typeOf: factory.reservationType.ReservationPackage }, (typeof ((_a = params.object.broker) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? { broker: params.object.broker } : undefined);
22
27
  return {
@@ -57,7 +57,8 @@ function start(params) {
57
57
  now,
58
58
  store: { id: (_c = params.availableAtOrFrom) === null || _c === void 0 ? void 0 : _c.id }
59
59
  });
60
- const startParams = (0, factory_1.createStartParams)(Object.assign(Object.assign({}, params), { provider: { id: event.organizer.id }, reservationNumber }));
60
+ const startParams = (0, factory_1.createStartParams)(Object.assign(Object.assign({}, params), { provider: { id: event.organizer.id }, reservationNumber,
61
+ event }));
61
62
  // 取引作成
62
63
  let transaction;
63
64
  try {
@@ -84,7 +85,8 @@ function start(params) {
84
85
  return {
85
86
  transaction: { id: transaction.id },
86
87
  objectSubReservations,
87
- issuedThrough: addReservationsResult.issuedThrough
88
+ // issuedThrough: addReservationsResult.issuedThrough
89
+ issuedThrough: startParams.object.issuedThrough
88
90
  };
89
91
  });
90
92
  }
@@ -137,17 +139,18 @@ function addReservations(params) {
137
139
  const availableSeatOffers = yield searchAvailableSeatOffers({ acceptedOffers, event })(repos);
138
140
  // 仮予約作成
139
141
  const { acceptedOffers4transactionObject, objectSubReservations } = yield createAcceptedOffers4transactionObject({
140
- acceptedOffers,
141
- ticketOffers,
142
- availableOffers, now,
143
- event, availableSeatOffers,
144
- transaction,
142
+ acceptedOffers, ticketOffers, availableOffers, now,
143
+ event, availableSeatOffers, transaction,
145
144
  availableAtOrFrom: params.availableAtOrFrom,
146
145
  validateAppliesToMovieTicket: params.validateAppliesToMovieTicket
147
146
  })(repos);
148
- // 予約イベント最適化
149
- const reservationFor = (0, factory_1.createReservationFor)(event, true);
150
- const { issuedThrough } = (0, factory_1.createIssuedThrough)({ reservationFor: event });
147
+ // const reservationFor = createReservationFor(event, true);
148
+ // const { issuedThrough } = createIssuedThrough({ reservationFor: event });
149
+ const reservationFor = transaction.object.reservationFor;
150
+ if (reservationFor === undefined) {
151
+ // 必ずstart時に保管されているはず
152
+ throw new factory.errors.Internal('transaction.object.reservationFor undefined unexpectedly');
153
+ }
151
154
  // 取引に予約追加
152
155
  let lockedOfferRateLimitKeys = [];
153
156
  try {
@@ -164,8 +167,8 @@ function addReservations(params) {
164
167
  object: {
165
168
  acceptedOffer: acceptedOffers4transactionObject,
166
169
  // issuedThroughを追加(2023-06-05~)
167
- issuedThrough,
168
- reservationFor,
170
+ // issuedThrough, // start時保管へ移行(2024-07-01~)
171
+ // reservationFor, // start時保管へ移行(2024-07-01~)
169
172
  subReservation: objectSubReservations
170
173
  }
171
174
  });
@@ -198,7 +201,7 @@ function addReservations(params) {
198
201
  })(repos);
199
202
  // ストックホルダー処理(stockHolderで残席数を集計しているので必要)
200
203
  yield onReservationsCreated({ event, transaction: { transactionNumber: transaction.transactionNumber } })(repos);
201
- return { objectSubReservations, issuedThrough };
204
+ return { objectSubReservations };
202
205
  });
203
206
  }
204
207
  /**
package/package.json CHANGED
@@ -110,5 +110,5 @@
110
110
  "postversion": "git push origin --tags",
111
111
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
112
112
  },
113
- "version": "21.37.0-alpha.4"
113
+ "version": "21.37.0-alpha.5"
114
114
  }