@chevre/domain 21.25.0-alpha.7 → 21.25.0-alpha.9

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.
@@ -20,7 +20,7 @@ async function main() {
20
20
  runsAt: {
21
21
  $gte: moment()
22
22
  // tslint:disable-next-line:no-magic-numbers
23
- .add(236, 'days')
23
+ .add(277, 'days')
24
24
  .toDate(),
25
25
  $lte: moment()
26
26
  // tslint:disable-next-line:no-magic-numbers
@@ -232,7 +232,7 @@ function saveScreeningEventSeries(params) {
232
232
  const availablePaymentMethodTypes = yield repos.categoryCode.search({
233
233
  project: { id: { $eq: params.project.id } },
234
234
  inCodeSet: { identifier: { $eq: factory.categoryCode.CategorySetIdentifier.PaymentMethodType } }
235
- }, [], []);
235
+ }, ['additionalProperty', 'codeValue'], []);
236
236
  const screeningEventSerieses = filmsFromCOA.map((filmFromCOA) => {
237
237
  return createScreeningEventSeriesFromCOA({
238
238
  project: project,
@@ -570,19 +570,7 @@ function createScreeningEventSeriesFromCOA(params) {
570
570
  titleBranchNum: params.filmFromCOA.titleBranchNum
571
571
  });
572
572
  const { additionalProperty, coaInfo } = createScreeningEventSeriesAdditionalPropertyFromCOA(params);
573
- let unacceptedPaymentMethod;
574
- // flgMvtkUseはムビチケ、MGチケットの両方に適用される
575
- if (coaInfo.flgMvtkUse === '1') {
576
- // no op
577
- }
578
- else {
579
- if (!Array.isArray(unacceptedPaymentMethod)) {
580
- unacceptedPaymentMethod = [];
581
- }
582
- // flgMvtkUseで決済方法区分から動的に
583
- const unavailablePaymentMethodTypes = params.availablePaymentMethodTypes.filter((categoryCode) => { var _a, _b; return ((_b = (_a = categoryCode.additionalProperty) === null || _a === void 0 ? void 0 : _a.find((property) => property.name === 'flgMvtkUse')) === null || _b === void 0 ? void 0 : _b.value) === '1'; });
584
- unacceptedPaymentMethod.push(...unavailablePaymentMethodTypes.map((c) => c.codeValue));
585
- }
573
+ const { unacceptedPaymentMethod } = createScreeningEventSeriesUnacceptedPaymentMethodFromCOA(params);
586
574
  const workPerformed = Object.assign({ id: `${params.movieTheater.branchCode}-${params.filmFromCOA.titleCode}`, identifier: params.filmFromCOA.titleCode, name: {
587
575
  ja: params.filmFromCOA.titleNameOrig
588
576
  }, duration: moment.duration(params.filmFromCOA.showTime, 'm')
@@ -623,15 +611,7 @@ function createScreeningEventSeriesFromCOA(params) {
623
611
  };
624
612
  }
625
613
  function createScreeningEventSeriesAdditionalPropertyFromCOA(params) {
626
- const coaInfo = {
627
- titleBranchNum: params.filmFromCOA.titleBranchNum,
628
- kbnEirin: params.eirinKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnEirin)[0],
629
- kbnEizou: params.eizouKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnEizou)[0],
630
- kbnJoueihousiki: params.joueihousikiKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnJoueihousiki)[0],
631
- kbnJimakufukikae: params.jimakufukikaeKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnJimakufukikae)[0],
632
- flgMvtkUse: params.filmFromCOA.flgMvtkUse,
633
- dateMvtkBegin: params.filmFromCOA.dateMvtkBegin
634
- };
614
+ const coaInfo = Object.assign(Object.assign({ titleBranchNum: params.filmFromCOA.titleBranchNum, kbnEirin: params.eirinKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnEirin)[0], kbnEizou: params.eizouKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnEizou)[0], kbnJoueihousiki: params.joueihousikiKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnJoueihousiki)[0], kbnJimakufukikae: params.jimakufukikaeKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnJimakufukikae)[0], flgMvtkUse: params.filmFromCOA.flgMvtkUse, dateMvtkBegin: params.filmFromCOA.dateMvtkBegin }, (typeof params.filmFromCOA.flgMgtkUse === 'string') ? { flgMgtkUse: params.filmFromCOA.flgMgtkUse } : undefined), (typeof params.filmFromCOA.dateMgtkBegin === 'string') ? { dateMgtkBegin: params.filmFromCOA.dateMgtkBegin } : undefined);
635
615
  return {
636
616
  coaInfo,
637
617
  additionalProperty: [
@@ -640,6 +620,34 @@ function createScreeningEventSeriesAdditionalPropertyFromCOA(params) {
640
620
  ]
641
621
  };
642
622
  }
623
+ function createScreeningEventSeriesUnacceptedPaymentMethodFromCOA(params) {
624
+ let unacceptedPaymentMethod;
625
+ // flgMvtkUseはムビチケ、MGチケットの両方に適用される(<-flgMgtkUseが追加されるまで)(~2024-03-05)
626
+ if (params.filmFromCOA.flgMvtkUse === '1') {
627
+ // no op
628
+ }
629
+ else {
630
+ if (!Array.isArray(unacceptedPaymentMethod)) {
631
+ unacceptedPaymentMethod = [];
632
+ }
633
+ // flgMvtkUseで決済方法区分から動的に
634
+ unacceptedPaymentMethod.push(...params.availablePaymentMethodTypes.filter(({ additionalProperty }) => { var _a; return ((_a = additionalProperty === null || additionalProperty === void 0 ? void 0 : additionalProperty.find(({ name }) => name === 'flgMvtkUse')) === null || _a === void 0 ? void 0 : _a.value) === '1'; })
635
+ .map(({ codeValue }) => codeValue));
636
+ }
637
+ if (params.filmFromCOA.flgMgtkUse === '0') {
638
+ if (!Array.isArray(unacceptedPaymentMethod)) {
639
+ unacceptedPaymentMethod = [];
640
+ }
641
+ // flgMgtkUseで決済方法区分から動的に
642
+ unacceptedPaymentMethod.push(...params.availablePaymentMethodTypes.filter(({ additionalProperty }) => { var _a; return ((_a = additionalProperty === null || additionalProperty === void 0 ? void 0 : additionalProperty.find(({ name }) => name === 'flgMgtkUse')) === null || _a === void 0 ? void 0 : _a.value) === '1'; })
643
+ .map(({ codeValue }) => codeValue));
644
+ }
645
+ if (Array.isArray(unacceptedPaymentMethod)) {
646
+ // 重複排除
647
+ unacceptedPaymentMethod = [...new Set(unacceptedPaymentMethod)];
648
+ }
649
+ return { unacceptedPaymentMethod };
650
+ }
643
651
  /**
644
652
  * COA情報からイベントIDを作成する
645
653
  */
@@ -74,7 +74,7 @@ function validateProfile(transaction) {
74
74
  && typeof profile.familyName === 'string' && profile.familyName.length > 0
75
75
  && typeof profile.givenName === 'string' && profile.givenName.length > 0
76
76
  && typeof profile.telephone === 'string' && profile.telephone.length > 0;
77
- if (profileSatisfied) {
77
+ if (!profileSatisfied) {
78
78
  throw new factory.errors.Argument('Transaction', 'Customer Profile Required');
79
79
  }
80
80
  }
package/package.json CHANGED
@@ -10,9 +10,9 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "@aws-sdk/credential-providers": "3.433.0",
13
- "@chevre/factory": "4.359.0",
13
+ "@chevre/factory": "4.360.0-alpha.0",
14
14
  "@cinerino/sdk": "5.12.0",
15
- "@motionpicture/coa-service": "9.3.0",
15
+ "@motionpicture/coa-service": "9.4.0-alpha.0",
16
16
  "@motionpicture/gmo-service": "5.3.0",
17
17
  "@sendgrid/mail": "6.4.0",
18
18
  "@surfrock/sdk": "1.2.0",
@@ -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.25.0-alpha.7"
113
+ "version": "21.25.0-alpha.9"
114
114
  }