@chevre/domain 23.1.0-alpha.5 → 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.
- package/example/src/chevre/assetTransaction/processReserve.ts +1 -0
- package/example/src/chevre/authorizeEventServiceOffer.ts +1 -0
- package/lib/chevre/repo/eventOffer.js +9 -5
- package/lib/chevre/repo/member.d.ts +7 -1
- package/lib/chevre/repo/member.js +1 -0
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +2 -0
- package/lib/chevre/service/assetTransaction/reserve/start.js +1 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/fixExtendedEventOffer.d.ts +22 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/fixExtendedEventOffer.js +62 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.d.ts +2 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +2 -18
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +31 -25
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +2 -0
- package/lib/chevre/service/offer/event/authorize.d.ts +2 -0
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +20 -20
- package/package.json +1 -1
|
@@ -102,6 +102,7 @@ async function main() {
|
|
|
102
102
|
eventOffer: await chevre.repository.EventOffer.createInstance(mongoose.connection),
|
|
103
103
|
eventSeries: await chevre.repository.EventSeries.createInstance(mongoose.connection),
|
|
104
104
|
issuer: await chevre.repository.Issuer.createInstance(mongoose.connection),
|
|
105
|
+
member: await chevre.repository.Member.createInstance(mongoose.connection),
|
|
105
106
|
memberProgram: await chevre.repository.MemberProgram.createInstance(mongoose.connection),
|
|
106
107
|
offer: await chevre.repository.Offer.createInstance(mongoose.connection),
|
|
107
108
|
offerCatalog: await chevre.repository.OfferCatalog.createInstance(mongoose.connection),
|
|
@@ -57,6 +57,7 @@ async function main() {
|
|
|
57
57
|
eventOffer: await chevre.repository.EventOffer.createInstance(mongoose.connection),
|
|
58
58
|
eventSeries: await chevre.repository.EventSeries.createInstance(mongoose.connection),
|
|
59
59
|
issuer: await chevre.repository.Issuer.createInstance(mongoose.connection),
|
|
60
|
+
member: await chevre.repository.Member.createInstance(mongoose.connection),
|
|
60
61
|
memberProgram: await chevre.repository.MemberProgram.createInstance(mongoose.connection),
|
|
61
62
|
stockHolder: await chevre.repository.StockHolder.createInstance({ connection: mongoose.connection }),
|
|
62
63
|
offer: await chevre.repository.Offer.createInstance(mongoose.connection),
|
|
@@ -32,7 +32,7 @@ class EventOfferRepo {
|
|
|
32
32
|
this.eventOfferModel = connection.model(eventOffer_1.modelName, (0, eventOffer_1.createSchema)());
|
|
33
33
|
}
|
|
34
34
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
35
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
36
36
|
const andConditions = [];
|
|
37
37
|
const idEq = (_a = params.id) === null || _a === void 0 ? void 0 : _a.$eq;
|
|
38
38
|
if (typeof idEq === 'string') {
|
|
@@ -58,19 +58,23 @@ class EventOfferRepo {
|
|
|
58
58
|
if (Array.isArray(itemOfferedIdIn)) {
|
|
59
59
|
andConditions.push({ 'itemOffered.id': { $in: itemOfferedIdIn } });
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const availableAtOrFromIdentifierEq = (_l = (_k = params.availableAtOrFrom) === null || _k === void 0 ? void 0 : _k.identifier) === null || _l === void 0 ? void 0 : _l.$eq;
|
|
62
|
+
if (typeof availableAtOrFromIdentifierEq === 'string') {
|
|
63
|
+
andConditions.push({ 'availableAtOrFrom.identifier': { $eq: availableAtOrFromIdentifierEq } });
|
|
64
|
+
}
|
|
65
|
+
const offeredByIdEq = (_o = (_m = params.offeredBy) === null || _m === void 0 ? void 0 : _m.id) === null || _o === void 0 ? void 0 : _o.$eq;
|
|
62
66
|
if (typeof offeredByIdEq === 'string') {
|
|
63
67
|
andConditions.push({ 'offeredBy.id': { $exists: true, $eq: offeredByIdEq } });
|
|
64
68
|
}
|
|
65
|
-
const sellerByIdEq = (
|
|
69
|
+
const sellerByIdEq = (_q = (_p = params.seller) === null || _p === void 0 ? void 0 : _p.id) === null || _q === void 0 ? void 0 : _q.$eq;
|
|
66
70
|
if (typeof sellerByIdEq === 'string') {
|
|
67
71
|
andConditions.push({ 'seller.id': { $eq: sellerByIdEq } });
|
|
68
72
|
}
|
|
69
|
-
const validFromLte = (
|
|
73
|
+
const validFromLte = (_r = params.validFrom) === null || _r === void 0 ? void 0 : _r.$lte;
|
|
70
74
|
if (validFromLte instanceof Date) {
|
|
71
75
|
andConditions.push({ validFrom: { $lte: validFromLte } });
|
|
72
76
|
}
|
|
73
|
-
const validThroughGte = (
|
|
77
|
+
const validThroughGte = (_s = params.validThrough) === null || _s === void 0 ? void 0 : _s.$gte;
|
|
74
78
|
if (validThroughGte instanceof Date) {
|
|
75
79
|
andConditions.push({ validThrough: { $gte: validThroughGte } });
|
|
76
80
|
}
|
|
@@ -2,7 +2,13 @@ import type { Connection, FilterQuery } from 'mongoose';
|
|
|
2
2
|
import * as factory from '../factory';
|
|
3
3
|
import { IGlobalMember } from './mongoose/schemas/member/global';
|
|
4
4
|
type IKeyOfProjection = keyof factory.iam.IMember;
|
|
5
|
-
export type ICustomerMember = Pick<factory.iam.IMemberOfRole, 'hasRole' | 'id' | 'name' | 'memberOf'
|
|
5
|
+
export type ICustomerMember = Pick<factory.iam.IMemberOfRole, 'hasRole' | 'id' | 'name' | 'memberOf'> & {
|
|
6
|
+
/**
|
|
7
|
+
* アプリケーションコード
|
|
8
|
+
* 2025-11-13~
|
|
9
|
+
*/
|
|
10
|
+
identifier?: string;
|
|
11
|
+
};
|
|
6
12
|
/**
|
|
7
13
|
* IAMメンバーリポジトリ
|
|
8
14
|
*/
|
|
@@ -6,6 +6,7 @@ import type { EventRepo } from '../../../repo/event';
|
|
|
6
6
|
import type { EventOfferRepo } from '../../../repo/eventOffer';
|
|
7
7
|
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
8
8
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
9
|
+
import type { MemberRepo } from '../../../repo/member';
|
|
9
10
|
import type { MemberProgramRepo } from '../../../repo/memberProgram';
|
|
10
11
|
import type { OfferRepo } from '../../../repo/offer/unitPriceInCatalog';
|
|
11
12
|
import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
@@ -27,6 +28,7 @@ interface IStartOperationRepos {
|
|
|
27
28
|
eventOffer: EventOfferRepo;
|
|
28
29
|
eventSeries: EventSeriesRepo;
|
|
29
30
|
issuer: IssuerRepo;
|
|
31
|
+
member: MemberRepo;
|
|
30
32
|
memberProgram: MemberProgramRepo;
|
|
31
33
|
offer: OfferRepo;
|
|
32
34
|
offerCatalog: OfferCatalogRepo;
|
package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/fixExtendedEventOffer.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as factory from '../../../../factory';
|
|
2
|
+
import { IMinimizedIndividualEvent } from '../../../../factory/event';
|
|
3
|
+
import type { EventOfferRepo } from '../../../../repo/eventOffer';
|
|
4
|
+
import type { MemberRepo } from '../../../../repo/member';
|
|
5
|
+
/**
|
|
6
|
+
* リクエストから拡張イベントオファーを決定する
|
|
7
|
+
*/
|
|
8
|
+
declare function fixExtendedEventOffer(params: {
|
|
9
|
+
event: Pick<IMinimizedIndividualEvent, 'offers' | 'id' | 'project' | 'identifier'>;
|
|
10
|
+
now: Date;
|
|
11
|
+
availableAt: {
|
|
12
|
+
/**
|
|
13
|
+
* 販売アプリケーションID
|
|
14
|
+
*/
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
object: factory.assetTransaction.reserve.IObjectWithoutDetail;
|
|
18
|
+
}): (repos: {
|
|
19
|
+
eventOffer: EventOfferRepo;
|
|
20
|
+
member: MemberRepo;
|
|
21
|
+
}) => Promise<Pick<factory.eventOffer.IEventOffer, "identifier" | "itemOffered" | "typeOf" | "offeredBy" | "validFrom" | "validThrough">>;
|
|
22
|
+
export { fixExtendedEventOffer };
|
package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/fixExtendedEventOffer.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.fixExtendedEventOffer = fixExtendedEventOffer;
|
|
13
|
+
const moment = require("moment");
|
|
14
|
+
const factory = require("../../../../factory");
|
|
15
|
+
/**
|
|
16
|
+
* リクエストから拡張イベントオファーを決定する
|
|
17
|
+
*/
|
|
18
|
+
function fixExtendedEventOffer(params) {
|
|
19
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
const { event, availableAt } = params;
|
|
22
|
+
const acceptedDate = moment(params.now);
|
|
23
|
+
// リクエストによるオファーコード指定が必須
|
|
24
|
+
const eventOfferIdentifierMustBe = (_b = (_a = params.object.reservationFor) === null || _a === void 0 ? void 0 : _a.offers) === null || _b === void 0 ? void 0 : _b.identifier;
|
|
25
|
+
if (typeof eventOfferIdentifierMustBe !== 'string' || eventOfferIdentifierMustBe === '') {
|
|
26
|
+
throw new factory.errors.ArgumentNull('reservationFor.offers.identifier');
|
|
27
|
+
}
|
|
28
|
+
// アプリケーションIDからアプリケーションコードを参照
|
|
29
|
+
const existingCustomerMember = (yield repos.member.searchCustomerMembers({
|
|
30
|
+
project: { id: event.project.id },
|
|
31
|
+
limit: 1,
|
|
32
|
+
page: 1,
|
|
33
|
+
member: {
|
|
34
|
+
id: { $eq: availableAt.id }
|
|
35
|
+
}
|
|
36
|
+
})).shift();
|
|
37
|
+
if (existingCustomerMember === undefined) {
|
|
38
|
+
throw new factory.errors.NotFound(`Member: ${availableAt.id}`);
|
|
39
|
+
}
|
|
40
|
+
// tslint:disable-next-line:no-console
|
|
41
|
+
console.log('existingCustomerMember found:', JSON.stringify(existingCustomerMember));
|
|
42
|
+
const applicationIdentifier = existingCustomerMember.member.identifier;
|
|
43
|
+
if (typeof applicationIdentifier !== 'string') {
|
|
44
|
+
throw new factory.errors.NotFound(`member.identifier of ${availableAt.id}`);
|
|
45
|
+
}
|
|
46
|
+
// アプリケーションコードで利用可能な拡張オファーを検索
|
|
47
|
+
const existingEventOffer = (yield repos.eventOffer.findEventOffers({
|
|
48
|
+
limit: 1,
|
|
49
|
+
page: 1,
|
|
50
|
+
project: { id: { $eq: event.project.id } }, // プロジェクト
|
|
51
|
+
validFrom: { $lte: acceptedDate.toDate() },
|
|
52
|
+
validThrough: { $gte: acceptedDate.toDate() },
|
|
53
|
+
itemOffered: { id: { $eq: event.id } }, // 対象イベント
|
|
54
|
+
identifier: { $eq: eventOfferIdentifierMustBe }, // オファーコード
|
|
55
|
+
availableAtOrFrom: { identifier: { $eq: applicationIdentifier } } // アプリケーションコード
|
|
56
|
+
}, ['identifier', 'itemOffered', 'offeredBy', 'typeOf', 'validFrom', 'validThrough'])).shift();
|
|
57
|
+
if (existingEventOffer === undefined) {
|
|
58
|
+
throw new factory.errors.NotFound(`eventOffer: ${eventOfferIdentifierMustBe}`);
|
|
59
|
+
}
|
|
60
|
+
return existingEventOffer;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
@@ -2,6 +2,7 @@ import * as factory from '../../../factory';
|
|
|
2
2
|
import { IMinimizedIndividualEvent } from '../../../factory/event';
|
|
3
3
|
import type { EventOfferRepo } from '../../../repo/eventOffer';
|
|
4
4
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
5
|
+
import type { MemberRepo } from '../../../repo/member';
|
|
5
6
|
import type { MemberProgramRepo } from '../../../repo/memberProgram';
|
|
6
7
|
import type { ProductOfferRepo } from '../../../repo/productOffer';
|
|
7
8
|
declare function validateStartRequest(params: {
|
|
@@ -22,6 +23,7 @@ declare function validateStartRequest(params: {
|
|
|
22
23
|
}): (repos: {
|
|
23
24
|
eventOffer: EventOfferRepo;
|
|
24
25
|
issuer: IssuerRepo;
|
|
26
|
+
member: MemberRepo;
|
|
25
27
|
memberProgram: MemberProgramRepo;
|
|
26
28
|
productOffer: ProductOfferRepo;
|
|
27
29
|
}) => Promise<void>;
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.validateStartRequest = validateStartRequest;
|
|
13
13
|
const moment = require("moment");
|
|
14
14
|
const factory = require("../../../factory");
|
|
15
|
+
const fixExtendedEventOffer_1 = require("./validateStartRequest/fixExtendedEventOffer");
|
|
15
16
|
const validateIssuedOfferIfExists_1 = require("./validateStartRequest/validateIssuedOfferIfExists");
|
|
16
17
|
const validateMemberTierIfExists_1 = require("./validateStartRequest/validateMemberTierIfExists");
|
|
17
18
|
function validateStartRequest(params) {
|
|
@@ -40,7 +41,6 @@ function validateStartRequest(params) {
|
|
|
40
41
|
*/
|
|
41
42
|
function validateApplicationOffer(params) {
|
|
42
43
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
var _a, _b;
|
|
44
44
|
const { event, availableAt } = params;
|
|
45
45
|
const acceptedDate = moment(params.now);
|
|
46
46
|
const eventOffers = event.offers;
|
|
@@ -70,23 +70,7 @@ function validateApplicationOffer(params) {
|
|
|
70
70
|
}
|
|
71
71
|
// support extensibleEventOffer(2025-11-11~)
|
|
72
72
|
if (eventOffers.typeOf === factory.offerType.AggregateOffer) {
|
|
73
|
-
|
|
74
|
-
const eventOfferIdentifierMustBe = (_b = (_a = params.object.reservationFor) === null || _a === void 0 ? void 0 : _a.offers) === null || _b === void 0 ? void 0 : _b.identifier;
|
|
75
|
-
if (typeof eventOfferIdentifierMustBe !== 'string' || eventOfferIdentifierMustBe === '') {
|
|
76
|
-
throw new factory.errors.ArgumentNull('reservationFor.offers.identifier');
|
|
77
|
-
}
|
|
78
|
-
const existingEventOffer = (yield repos.eventOffer.findEventOffers({
|
|
79
|
-
limit: 1,
|
|
80
|
-
page: 1,
|
|
81
|
-
project: { id: { $eq: event.project.id } }, // プロジェクト
|
|
82
|
-
validFrom: { $lte: acceptedDate.toDate() },
|
|
83
|
-
validThrough: { $gte: acceptedDate.toDate() },
|
|
84
|
-
itemOffered: { id: { $eq: event.id } }, // 対象イベント
|
|
85
|
-
identifier: { $eq: eventOfferIdentifierMustBe } // オファーコード
|
|
86
|
-
}, ['identifier', 'itemOffered', 'offeredBy', 'typeOf', 'validFrom', 'validThrough'])).shift();
|
|
87
|
-
if (existingEventOffer === undefined) {
|
|
88
|
-
throw new factory.errors.NotFound(`eventOffer: ${eventOfferIdentifierMustBe}`);
|
|
89
|
-
}
|
|
73
|
+
const existingEventOffer = yield (0, fixExtendedEventOffer_1.fixExtendedEventOffer)(params)(repos);
|
|
90
74
|
// 拡張可能なオファー設定の場合のみ、オファートークンを検証する(2025-11-11~)
|
|
91
75
|
yield (0, validateIssuedOfferIfExists_1.validateIssuedOfferIfExists)({
|
|
92
76
|
event,
|
|
@@ -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
|
}
|
|
@@ -8,6 +8,7 @@ import type { EventRepo, IMinimizedIndividualEvent } from '../../../../repo/even
|
|
|
8
8
|
import type { EventOfferRepo } from '../../../../repo/eventOffer';
|
|
9
9
|
import { EventSeriesRepo } from '../../../../repo/eventSeries';
|
|
10
10
|
import type { IssuerRepo } from '../../../../repo/issuer';
|
|
11
|
+
import type { MemberRepo } from '../../../../repo/member';
|
|
11
12
|
import type { MemberProgramRepo } from '../../../../repo/memberProgram';
|
|
12
13
|
import type { OfferRepo } from '../../../../repo/offer/unitPriceInCatalog';
|
|
13
14
|
import type { OfferCatalogRepo } from '../../../../repo/offerCatalog';
|
|
@@ -57,6 +58,7 @@ declare function processStartReserve4chevre(params: {
|
|
|
57
58
|
eventOffer: EventOfferRepo;
|
|
58
59
|
eventSeries: EventSeriesRepo;
|
|
59
60
|
issuer: IssuerRepo;
|
|
61
|
+
member: MemberRepo;
|
|
60
62
|
memberProgram: MemberProgramRepo;
|
|
61
63
|
offer: OfferRepo;
|
|
62
64
|
offerCatalog: OfferCatalogRepo;
|
|
@@ -8,6 +8,7 @@ import type { EventRepo } from '../../../repo/event';
|
|
|
8
8
|
import type { EventOfferRepo } from '../../../repo/eventOffer';
|
|
9
9
|
import { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
10
10
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
11
|
+
import type { MemberRepo } from '../../../repo/member';
|
|
11
12
|
import type { MemberProgramRepo } from '../../../repo/memberProgram';
|
|
12
13
|
import type { OfferRepo } from '../../../repo/offer/unitPriceInCatalog';
|
|
13
14
|
import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
@@ -36,6 +37,7 @@ interface IAuthorizeRepos {
|
|
|
36
37
|
eventOffer: EventOfferRepo;
|
|
37
38
|
eventSeries: EventSeriesRepo;
|
|
38
39
|
issuer: IssuerRepo;
|
|
40
|
+
member: MemberRepo;
|
|
39
41
|
memberProgram: MemberProgramRepo;
|
|
40
42
|
stockHolder: StockHolderRepo;
|
|
41
43
|
offer: OfferRepo;
|
|
@@ -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