@chevre/domain 22.6.0-alpha.34 → 22.6.0-alpha.35

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.
@@ -13,7 +13,7 @@ exports.verifyTicketTokenAsNeeded = void 0;
13
13
  const factory = require("../../../factory");
14
14
  function verifyTicketTokenAsNeeded(params) {
15
15
  return (repos) => __awaiter(this, void 0, void 0, function* () {
16
- var _a, _b, _c;
16
+ var _a, _b;
17
17
  const { paymentServiceType, object, project } = params;
18
18
  const { issuedThrough, ticketToken } = object;
19
19
  let permitOrInvoice;
@@ -45,29 +45,25 @@ function verifyTicketTokenAsNeeded(params) {
45
45
  }
46
46
  if (authorizedObject.typeOf === 'OwnershipInfo') {
47
47
  const { typeOfGood } = authorizedObject;
48
- if (typeOfGood.typeOf !== factory.permit.PermitType.Permit) {
49
- throw new factory.errors.Argument('ticketToken', 'must be Permit');
50
- }
51
48
  if (((_b = typeOfGood.issuedThrough) === null || _b === void 0 ? void 0 : _b.typeOf) !== paymentServiceType) {
52
49
  throw new factory.errors.Argument('ticketToken', 'paymentServiceType not matched');
53
50
  }
54
- // CreditCardの場合、発行サービスIDを検証
51
+ // FaceToFace以外の場合、発行サービスIDを検証
55
52
  if (typeOfGood.issuedThrough.typeOf !== factory.service.paymentService.PaymentServiceType.FaceToFace) {
56
53
  if (typeOfGood.issuedThrough.id !== issuedThrough.id) {
57
54
  throw new factory.errors.Argument('ticketToken', 'issuedThrough.id not matched');
58
55
  }
59
56
  }
60
- permitOrInvoice = { identifier: typeOfGood.identifier, typeOf: factory.permit.PermitType.Permit };
61
- }
62
- else if (authorizedObject.typeOf === 'Invoice') {
63
- // support paymentServiceType.MovieTicket(2024-11-23~)
64
- if (((_c = authorizedObject.issuedThrough) === null || _c === void 0 ? void 0 : _c.typeOf) !== paymentServiceType) {
65
- throw new factory.errors.Argument('ticketToken', 'paymentServiceType not matched');
57
+ if (typeOfGood.typeOf === factory.permit.PermitType.Permit) {
58
+ permitOrInvoice = { identifier: typeOfGood.identifier, typeOf: factory.permit.PermitType.Permit };
59
+ }
60
+ else if (typeOfGood.typeOf === 'Invoice') {
61
+ // support paymentServiceType.MovieTicket(2024-11-23~)
62
+ permitOrInvoice = { paymentMethodId: typeOfGood.paymentMethodId, typeOf: 'Invoice' };
66
63
  }
67
- if (authorizedObject.issuedThrough.id !== issuedThrough.id) {
68
- throw new factory.errors.Argument('ticketToken', 'issuedThrough.id not matched');
64
+ else {
65
+ throw new factory.errors.Argument('ticketToken', 'must be Permit or Invoice');
69
66
  }
70
- permitOrInvoice = { paymentMethodId: authorizedObject.paymentMethodId, typeOf: 'Invoice' };
71
67
  }
72
68
  else {
73
69
  throw new factory.errors.Argument('ticketToken', 'must be OwnershipInfo');
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@aws-sdk/client-cognito-identity-provider": "3.600.0",
13
13
  "@aws-sdk/credential-providers": "3.600.0",
14
- "@chevre/factory": "4.389.0-alpha.21",
14
+ "@chevre/factory": "4.389.0-alpha.22",
15
15
  "@cinerino/sdk": "10.16.0-alpha.9",
16
16
  "@motionpicture/coa-service": "9.6.0-alpha.0",
17
17
  "@motionpicture/gmo-service": "5.3.0",
@@ -108,5 +108,5 @@
108
108
  "postversion": "git push origin --tags",
109
109
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
110
110
  },
111
- "version": "22.6.0-alpha.34"
111
+ "version": "22.6.0-alpha.35"
112
112
  }