@chevre/domain 23.1.0-alpha.6 → 23.1.0-alpha.7
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.
|
@@ -17,7 +17,7 @@ const factory = require("../../../../../factory");
|
|
|
17
17
|
function requestedProgramMembershipUsed2permit(params) {
|
|
18
18
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
19
19
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
var _a, _b
|
|
20
|
+
var _a, _b;
|
|
21
21
|
let programMembershipUsedAsPermit;
|
|
22
22
|
const { programMembershipUsed, placeOrder } = params;
|
|
23
23
|
// discontinue token as fromLocation(ticketTokenへ移行するべき)(2024-12-18~)
|
|
@@ -51,28 +51,34 @@ function requestedProgramMembershipUsed2permit(params) {
|
|
|
51
51
|
const permitOwnershipInfo = object;
|
|
52
52
|
const ownedGoodType = (_a = permitOwnershipInfo.typeOfGood) === null || _a === void 0 ? void 0 : _a.typeOf;
|
|
53
53
|
if (ownedGoodType === factory.permit.PermitType.Permit) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
54
|
+
// discontinue(2025-11-14~)
|
|
55
|
+
throw new factory.errors.Argument('programMembershipUsed', `ownershipInfo.typeOfGood.typeOf: ${ownedGoodType} discontinued`);
|
|
56
|
+
// const issuedThroughTypeOf = permitOwnershipInfo.typeOfGood.issuedThrough?.typeOf;
|
|
57
|
+
// if (issuedThroughTypeOf === factory.service.paymentService.PaymentServiceType.FaceToFace) {
|
|
58
|
+
// programMembershipUsedAsPermit = {
|
|
59
|
+
// identifier: permitOwnershipInfo.typeOfGood.identifier,
|
|
60
|
+
// issuedThrough: { typeOf: issuedThroughTypeOf },
|
|
61
|
+
// typeOf: factory.permit.PermitType.Permit
|
|
62
|
+
// };
|
|
63
|
+
// } else if (issuedThroughTypeOf === factory.product.ProductType.MembershipService
|
|
64
|
+
// || issuedThroughTypeOf === factory.service.paymentService.PaymentServiceType.CreditCard) {
|
|
65
|
+
// if (typeof permitOwnershipInfo.typeOfGood.issuedThrough?.id !== 'string') {
|
|
66
|
+
// throw new factory.errors.Argument(
|
|
67
|
+
// 'programMembershipUsed',
|
|
68
|
+
// 'ownershipInfo.typeOfGood.issuedThrough.id undefined'
|
|
69
|
+
// );
|
|
70
|
+
// }
|
|
71
|
+
// programMembershipUsedAsPermit = {
|
|
72
|
+
// identifier: permitOwnershipInfo.typeOfGood.identifier,
|
|
73
|
+
// issuedThrough: { id: permitOwnershipInfo.typeOfGood.issuedThrough.id, typeOf: issuedThroughTypeOf },
|
|
74
|
+
// typeOf: factory.permit.PermitType.Permit
|
|
75
|
+
// };
|
|
76
|
+
// } else {
|
|
77
|
+
// throw new factory.errors.Argument(
|
|
78
|
+
// 'programMembershipUsed',
|
|
79
|
+
// `invalid issuedThrough.typeOf: ${issuedThroughTypeOf}`
|
|
80
|
+
// );
|
|
81
|
+
// }
|
|
76
82
|
}
|
|
77
83
|
else if (ownedGoodType === factory.service.paymentService.PaymentServiceType.FaceToFace) {
|
|
78
84
|
const paymentMethodId = permitOwnershipInfo.typeOfGood.serviceOutput.paymentMethodId;
|
|
@@ -87,7 +93,7 @@ function requestedProgramMembershipUsed2permit(params) {
|
|
|
87
93
|
}
|
|
88
94
|
else if (ownedGoodType === factory.service.paymentService.PaymentServiceType.CreditCard) {
|
|
89
95
|
// CreditCard決済の場合、決済方法所有権を受け入れる(2025-11-11~)
|
|
90
|
-
const paymentServiceId = (
|
|
96
|
+
const paymentServiceId = (_b = permitOwnershipInfo.typeOfGood) === null || _b === void 0 ? void 0 : _b.id;
|
|
91
97
|
const paymentMethodId = permitOwnershipInfo.typeOfGood.serviceOutput.paymentMethodId;
|
|
92
98
|
if (typeof paymentServiceId !== 'string' || paymentServiceId === '') {
|
|
93
99
|
throw new factory.errors.Argument('programMembershipUsed', 'paymentServiceId required');
|
|
@@ -102,7 +108,7 @@ function requestedProgramMembershipUsed2permit(params) {
|
|
|
102
108
|
};
|
|
103
109
|
}
|
|
104
110
|
else {
|
|
105
|
-
throw new factory.errors.Argument('programMembershipUsed',
|
|
111
|
+
throw new factory.errors.Argument('programMembershipUsed', `ownershipInfo.typeOfGood.typeOf: ${ownedGoodType} invalid`);
|
|
106
112
|
}
|
|
107
113
|
}
|
|
108
114
|
}
|
|
@@ -15,7 +15,7 @@ const factory = require("../../../factory");
|
|
|
15
15
|
function verifyTicketTokenAsNeeded(params) {
|
|
16
16
|
// tslint:disable-next-line:cyclomatic-complexity
|
|
17
17
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
var _a
|
|
18
|
+
var _a;
|
|
19
19
|
const { paymentServiceType, object, project } = params;
|
|
20
20
|
const { issuedThrough, ticketToken } = object;
|
|
21
21
|
let permitOrInvoice;
|
|
@@ -48,25 +48,25 @@ function verifyTicketTokenAsNeeded(params) {
|
|
|
48
48
|
if (authorizedObject.typeOf === 'OwnershipInfo') {
|
|
49
49
|
const { typeOfGood } = authorizedObject;
|
|
50
50
|
if (typeOfGood.typeOf === factory.permit.PermitType.Permit || typeOfGood.typeOf === 'Invoice') {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
|
|
69
|
-
}
|
|
51
|
+
// discontinue(2025-11-14~)
|
|
52
|
+
throw new factory.errors.Argument('ticketToken', `typeOfGood.typeOf ${typeOfGood.typeOf} discontinued`);
|
|
53
|
+
// if (typeOfGood.issuedThrough?.typeOf !== paymentServiceType) {
|
|
54
|
+
// throw new factory.errors.Argument('ticketToken', 'paymentServiceType not matched');
|
|
55
|
+
// }
|
|
56
|
+
// // FaceToFace以外の場合、発行サービスIDを検証
|
|
57
|
+
// if (typeOfGood.issuedThrough.typeOf !== factory.service.paymentService.PaymentServiceType.FaceToFace) {
|
|
58
|
+
// if (typeOfGood.issuedThrough.id !== issuedThrough.id) {
|
|
59
|
+
// throw new factory.errors.Argument('ticketToken', 'issuedThrough.id not matched');
|
|
60
|
+
// }
|
|
61
|
+
// }
|
|
62
|
+
// if (typeOfGood.typeOf === factory.permit.PermitType.Permit) {
|
|
63
|
+
// permitOrInvoice = { identifier: typeOfGood.identifier, typeOf: factory.permit.PermitType.Permit };
|
|
64
|
+
// } else if (typeOfGood.typeOf === 'Invoice') {
|
|
65
|
+
// // support paymentServiceType.MovieTicket(2024-11-23~)
|
|
66
|
+
// permitOrInvoice = { paymentMethodId: typeOfGood.paymentMethodId, typeOf: 'Invoice' };
|
|
67
|
+
// } else {
|
|
68
|
+
// throw new factory.errors.Argument('ticketToken', 'must be Permit or Invoice');
|
|
69
|
+
// }
|
|
70
70
|
}
|
|
71
71
|
else if (typeOfGood.typeOf === factory.service.paymentService.PaymentServiceType.CreditCard
|
|
72
72
|
|| typeOfGood.typeOf === factory.service.paymentService.PaymentServiceType.MovieTicket
|
package/package.json
CHANGED