@chevre/domain 21.8.0-alpha.21 → 21.8.0-alpha.22

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.
@@ -52,6 +52,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
52
52
  };
53
53
  }, {
54
54
  additionalProperty: any[];
55
+ offers: any[];
55
56
  addOn: any[];
56
57
  availability: string;
57
58
  availableAtOrFrom: any[];
@@ -83,6 +84,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
83
84
  validRateLimit?: any;
84
85
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
85
86
  additionalProperty: any[];
87
+ offers: any[];
86
88
  addOn: any[];
87
89
  availability: string;
88
90
  availableAtOrFrom: any[];
@@ -114,6 +116,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
114
116
  validRateLimit?: any;
115
117
  }>> & Omit<import("mongoose").FlatRecord<{
116
118
  additionalProperty: any[];
119
+ offers: any[];
117
120
  addOn: any[];
118
121
  availability: string;
119
122
  availableAtOrFrom: any[];
@@ -29,6 +29,7 @@ const schema = new mongoose_1.Schema({
29
29
  availableAtOrFrom: [mongoose_1.SchemaTypes.Mixed],
30
30
  hasMerchantReturnPolicy: mongoose_1.SchemaTypes.Mixed,
31
31
  itemOffered: mongoose_1.SchemaTypes.Mixed,
32
+ offers: [mongoose_1.SchemaTypes.Mixed],
32
33
  priceCurrency: String,
33
34
  priceSpecification: mongoose_1.SchemaTypes.Mixed,
34
35
  eligibleCustomerType: mongoose_1.SchemaTypes.Mixed,
@@ -299,6 +299,7 @@ function createReservation(params) {
299
299
  }
300
300
  return reservationItem;
301
301
  }
302
+ // tslint:disable-next-line:max-func-body-length
302
303
  function coaTicket2offer(params) {
303
304
  var _a, _b;
304
305
  // 適用通貨区分
@@ -322,7 +323,6 @@ function coaTicket2offer(params) {
322
323
  }]
323
324
  : undefined;
324
325
  const unitPriceSpec = {
325
- // project: { typeOf: factory.organizationType.Project, id: params.project.id },
326
326
  typeOf: factory.priceSpecificationType.UnitPriceSpecification,
327
327
  price: 0,
328
328
  priceCurrency: factory.priceCurrency.JPY,
@@ -332,15 +332,25 @@ function coaTicket2offer(params) {
332
332
  unitCode: factory.unitCode.C62,
333
333
  value: 1
334
334
  }
335
- // appliesToMovieTicket?: {};
336
335
  };
337
336
  const identifier = (0, util_1.format)('%s-%s-%s', factory.service.webAPI.Identifier.COA, params.theaterCode, params.ticketResult.ticketCode);
338
- return Object.assign(Object.assign(Object.assign({ project: { typeOf: factory.organizationType.Project, id: params.project.id }, typeOf: factory.offerType.Offer, priceCurrency: factory.priceCurrency.JPY, id: '', identifier: identifier, name: {
339
- ja: params.ticketResult.ticketName,
340
- en: (typeof params.ticketResult.ticketNameEng === 'string')
341
- ? params.ticketResult.ticketNameEng
342
- : ''
343
- }, description: {
337
+ const offerName = {
338
+ ja: params.ticketResult.ticketName,
339
+ en: (typeof params.ticketResult.ticketNameEng === 'string')
340
+ ? params.ticketResult.ticketNameEng
341
+ : ''
342
+ };
343
+ const subOfferPriceSpec = {
344
+ price: unitPriceSpec.price,
345
+ typeOf: unitPriceSpec.typeOf
346
+ };
347
+ const subOffers = [{
348
+ typeOf: factory.offerType.Offer,
349
+ identifier: identifier,
350
+ name: offerName,
351
+ priceSpecification: subOfferPriceSpec
352
+ }];
353
+ return Object.assign(Object.assign(Object.assign({ project: { typeOf: factory.organizationType.Project, id: params.project.id }, typeOf: factory.offerType.Offer, priceCurrency: factory.priceCurrency.JPY, id: '', identifier: identifier, name: offerName, description: {
344
354
  ja: '',
345
355
  en: ''
346
356
  }, alternateName: {
@@ -350,7 +360,7 @@ function coaTicket2offer(params) {
350
360
  : ''
351
361
  }, availability: factory.itemAvailability.InStock, itemOffered: {
352
362
  typeOf: factory.product.ProductType.EventService
353
- }, priceSpecification: unitPriceSpec }, (Array.isArray(eligibleMembershipType)) ? { eligibleMembershipType } : undefined), (Array.isArray(eligibleMonetaryAmount)) ? { eligibleMonetaryAmount } : undefined), { additionalProperty: [
363
+ }, offers: subOffers, priceSpecification: unitPriceSpec }, (Array.isArray(eligibleMembershipType)) ? { eligibleMembershipType } : undefined), (Array.isArray(eligibleMonetaryAmount)) ? { eligibleMonetaryAmount } : undefined), { additionalProperty: [
354
364
  { name: 'theaterCode', value: params.theaterCode },
355
365
  ...Object.keys(params.ticketResult)
356
366
  .map((key) => {
@@ -186,9 +186,14 @@ function processVoidPayTransaction(params) {
186
186
  project: { id: { $eq: action.project.id } },
187
187
  typeOf: factory.assetTransactionType.Pay,
188
188
  transactionNumber: { $eq: transactionNumber }
189
- });
190
- if (payTransactions.length > 0) {
191
- yield PayTransactionService.cancel({ transactionNumber })(repos);
189
+ }, ['_id', 'status']);
190
+ const payTransaction = payTransactions.shift();
191
+ if (payTransaction !== undefined) {
192
+ // ステータス検証(Expiredから実行される可能性がある)
193
+ if (payTransaction.status !== factory.transactionStatusType.Canceled
194
+ && payTransaction.status !== factory.transactionStatusType.Expired) {
195
+ yield PayTransactionService.cancel({ transactionNumber })(repos);
196
+ }
192
197
  }
193
198
  }
194
199
  yield repos.action.cancel({ typeOf: action.typeOf, id: action.id });
@@ -149,10 +149,10 @@ function authorizeSeatReservationActions2requiredMovieTickets(params) {
149
149
  appliesToMovieTickets4paymentMethod = appliesToMovieTickets4reservation.filter((a) => {
150
150
  return a.serviceOutput.typeOf === paymentMethodType;
151
151
  });
152
- }
153
- else if (typeof (appliesToMovieTickets4reservation === null || appliesToMovieTickets4reservation === void 0 ? void 0 : appliesToMovieTickets4reservation.identifier) === 'string') {
154
- // Arrayでない場合を廃止(2022-08-01~)
155
- throw new factory.errors.NotImplemented('appliesToMovieTickets.typeOf as string not implemented');
152
+ // Array以外への考慮自体を廃止(2023-09-01~)
153
+ // } else if (typeof appliesToMovieTickets4reservation?.identifier === 'string') {
154
+ // // Arrayでない場合を廃止(2022-08-01~)
155
+ // throw new factory.errors.NotImplemented('appliesToMovieTickets.typeOf as string not implemented');
156
156
  }
157
157
  if (Array.isArray(appliesToMovieTickets4paymentMethod) && appliesToMovieTickets4paymentMethod.length > 0) {
158
158
  appliesToMovieTickets4paymentMethod.forEach((appliesToMovieTicket) => {
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.328.0",
13
- "@cinerino/sdk": "3.165.0",
12
+ "@chevre/factory": "4.329.0-alpha.0",
13
+ "@cinerino/sdk": "3.166.0-alpha.3",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
16
16
  "@sendgrid/mail": "6.4.0",
@@ -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.8.0-alpha.21"
120
+ "version": "21.8.0-alpha.22"
121
121
  }