@chevre/domain 23.1.0-alpha.1 → 23.1.0-alpha.10
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 +9 -3
- package/example/src/chevre/authorizeEventServiceOffer.ts +8 -5
- package/example/src/chevre/eventOffer/adminEventOffers.ts +67 -0
- package/example/src/chevre/member/migrateMemberIdentifier.ts +99 -0
- package/example/src/chevre/reIndex.ts +2 -2
- package/lib/chevre/repo/eventOffer.d.ts +52 -0
- package/lib/chevre/repo/eventOffer.js +191 -0
- package/lib/chevre/repo/member.d.ts +18 -1
- package/lib/chevre/repo/member.js +14 -8
- package/lib/chevre/repo/mongoose/schemas/eventOffer.d.ts +10 -0
- package/lib/chevre/repo/mongoose/schemas/eventOffer.js +102 -0
- package/lib/chevre/repo/mongoose/schemas/member.js +10 -0
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +15 -2
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +8 -0
- package/lib/chevre/service/assetTransaction/reserve/start.js +6 -1
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/fixExtendedEventOffer.d.ts +23 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/fixExtendedEventOffer.js +62 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateIssuedOfferIfExists.d.ts +2 -1
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateIssuedOfferIfExists.js +24 -24
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.d.ts +1 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.js +10 -26
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/verifyTicketTokenAsNeeded.d.ts +23 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/verifyTicketTokenAsNeeded.js +62 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.d.ts +9 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +36 -16
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +0 -3
- package/lib/chevre/service/offer/event/authorize/factory.js +4 -3
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +42 -25
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +6 -0
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.js +4 -4
- package/lib/chevre/service/offer/event/authorize.d.ts +5 -0
- package/lib/chevre/service/offer/event/authorize.js +10 -5
- package/lib/chevre/service/offer/onEventChanged.js +29 -13
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +29 -23
- package/package.json +3 -3
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
2
|
import { IMinimizedIndividualEvent } from '../../../factory/event';
|
|
3
|
+
import type { AuthorizationRepo } from '../../../repo/authorization';
|
|
4
|
+
import type { EventOfferRepo } from '../../../repo/eventOffer';
|
|
3
5
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
6
|
+
import type { MemberRepo } from '../../../repo/member';
|
|
4
7
|
import type { MemberProgramRepo } from '../../../repo/memberProgram';
|
|
5
8
|
import type { ProductOfferRepo } from '../../../repo/productOffer';
|
|
9
|
+
import type { TicketRepo } from '../../../repo/ticket';
|
|
6
10
|
declare function validateStartRequest(params: {
|
|
7
11
|
object: factory.assetTransaction.reserve.IObjectWithoutDetail;
|
|
12
|
+
instrument: factory.assetTransaction.reserve.IInstrument[];
|
|
8
13
|
event: Pick<IMinimizedIndividualEvent, 'offers' | 'id' | 'project' | 'identifier'>;
|
|
9
14
|
/**
|
|
10
15
|
* アプリケーションごとのオファーを検証するかどうか
|
|
@@ -19,8 +24,12 @@ declare function validateStartRequest(params: {
|
|
|
19
24
|
id?: string;
|
|
20
25
|
};
|
|
21
26
|
}): (repos: {
|
|
27
|
+
authorization: AuthorizationRepo;
|
|
28
|
+
eventOffer: EventOfferRepo;
|
|
22
29
|
issuer: IssuerRepo;
|
|
30
|
+
member: MemberRepo;
|
|
23
31
|
memberProgram: MemberProgramRepo;
|
|
24
32
|
productOffer: ProductOfferRepo;
|
|
33
|
+
ticket: TicketRepo;
|
|
25
34
|
}) => Promise<void>;
|
|
26
35
|
export { validateStartRequest };
|
|
@@ -12,8 +12,10 @@ 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");
|
|
18
|
+
const verifyTicketTokenAsNeeded_1 = require("./validateStartRequest/verifyTicketTokenAsNeeded");
|
|
17
19
|
function validateStartRequest(params) {
|
|
18
20
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
19
21
|
var _a;
|
|
@@ -23,11 +25,20 @@ function validateStartRequest(params) {
|
|
|
23
25
|
if (typeof ((_a = params.store) === null || _a === void 0 ? void 0 : _a.id) !== 'string') {
|
|
24
26
|
throw new factory.errors.NotFound('store.id');
|
|
25
27
|
}
|
|
28
|
+
// ticketTokenから、acceptedEventOfferを生成(2025-11-18~)
|
|
29
|
+
const { acceptedEventOffer } = yield (0, verifyTicketTokenAsNeeded_1.verifyTicketTokenAsNeeded)({
|
|
30
|
+
event,
|
|
31
|
+
now,
|
|
32
|
+
availableAt: { id: params.store.id },
|
|
33
|
+
object: params.object,
|
|
34
|
+
instrument: params.instrument
|
|
35
|
+
})(repos);
|
|
26
36
|
yield validateApplicationOffer({
|
|
27
37
|
event,
|
|
28
38
|
now,
|
|
29
39
|
availableAt: { id: params.store.id },
|
|
30
|
-
object: params.object
|
|
40
|
+
object: params.object,
|
|
41
|
+
acceptedEventOffer
|
|
31
42
|
})(repos);
|
|
32
43
|
}
|
|
33
44
|
if (params.validateEvent === true) {
|
|
@@ -40,7 +51,7 @@ function validateStartRequest(params) {
|
|
|
40
51
|
*/
|
|
41
52
|
function validateApplicationOffer(params) {
|
|
42
53
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
const { event, availableAt } = params;
|
|
54
|
+
const { event, availableAt, acceptedEventOffer } = params;
|
|
44
55
|
const acceptedDate = moment(params.now);
|
|
45
56
|
const eventOffers = event.offers;
|
|
46
57
|
// アプリケーションごとの設定を参照する(2022-11-19~)
|
|
@@ -67,20 +78,29 @@ function validateApplicationOffer(params) {
|
|
|
67
78
|
throw new factory.errors.Argument('reservationFor.id', `Offer of ${params.event.id} is valid through ${validThrough}`);
|
|
68
79
|
}
|
|
69
80
|
}
|
|
70
|
-
//
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
// support extensibleEventOffer(2025-11-11~)
|
|
82
|
+
if (eventOffers.typeOf === factory.offerType.AggregateOffer) {
|
|
83
|
+
const existingEventOffer = yield (0, fixExtendedEventOffer_1.fixExtendedEventOffer)(params)(repos);
|
|
84
|
+
// 拡張可能なオファー設定の場合のみ、オファートークンを検証する(2025-11-11~)
|
|
85
|
+
yield (0, validateIssuedOfferIfExists_1.validateIssuedOfferIfExists)({
|
|
86
|
+
event,
|
|
87
|
+
now: params.now,
|
|
88
|
+
object: params.object,
|
|
89
|
+
eventOffer: existingEventOffer,
|
|
90
|
+
acceptedEventOffer
|
|
91
|
+
})(repos);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
// 拡張可能なオファーに場合に、有効メンバープログラムティア設定は存在しない前提
|
|
95
|
+
// 有効メンバープログラムティアが存在する場合
|
|
96
|
+
yield (0, validateMemberTierIfExists_1.validateMemberTierIfExists)({
|
|
97
|
+
event,
|
|
98
|
+
now: params.now,
|
|
99
|
+
object: params.object,
|
|
100
|
+
makesOfferOnApplication,
|
|
101
|
+
acceptedEventOffer
|
|
102
|
+
})(repos);
|
|
103
|
+
}
|
|
84
104
|
});
|
|
85
105
|
}
|
|
86
106
|
/**
|
|
@@ -7,9 +7,6 @@ declare function createReserveTransactionStartParams(params: {
|
|
|
7
7
|
acceptedOffers: factory.assetTransaction.reserve.IAcceptedTicketOfferWithoutDetail[];
|
|
8
8
|
event: {
|
|
9
9
|
id: string;
|
|
10
|
-
offers?: {
|
|
11
|
-
validForMemberTier?: factory.assetTransaction.reserve.ITokenizedMemberProgramTier;
|
|
12
|
-
};
|
|
13
10
|
};
|
|
14
11
|
broker?: factory.reservation.IBroker<factory.reservationType>;
|
|
15
12
|
transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'expires' | 'seller'>;
|
|
@@ -8,7 +8,7 @@ exports.responseBody2acceptedOffers4result = responseBody2acceptedOffers4result;
|
|
|
8
8
|
const moment = require("moment");
|
|
9
9
|
const factory = require("../../../../factory");
|
|
10
10
|
function createReserveTransactionStartParams(params) {
|
|
11
|
-
var _a
|
|
11
|
+
var _a;
|
|
12
12
|
const { transaction, transactionNumber } = params;
|
|
13
13
|
const { seller } = transaction;
|
|
14
14
|
const acceptedTicketOffersWithoutDetail = (Array.isArray(params.acceptedOffers))
|
|
@@ -48,8 +48,9 @@ function createReserveTransactionStartParams(params) {
|
|
|
48
48
|
// }
|
|
49
49
|
// ]
|
|
50
50
|
};
|
|
51
|
-
const
|
|
52
|
-
|
|
51
|
+
const object = Object.assign({ acceptedOffer: acceptedTicketOffersWithoutDetail, reservationFor: {
|
|
52
|
+
id: params.event.id
|
|
53
|
+
} }, (params.broker !== undefined) ? { broker: params.broker } : undefined);
|
|
53
54
|
return {
|
|
54
55
|
project: { typeOf: factory.organizationType.Project, id: params.project.id },
|
|
55
56
|
typeOf: factory.assetTransactionType.Reserve,
|
|
@@ -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,34 +51,51 @@ 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
|
-
|
|
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
|
+
// }
|
|
82
|
+
}
|
|
83
|
+
else if (ownedGoodType === factory.service.paymentService.PaymentServiceType.FaceToFace) {
|
|
84
|
+
const paymentMethodId = permitOwnershipInfo.typeOfGood.serviceOutput.paymentMethodId;
|
|
85
|
+
if (typeof paymentMethodId !== 'string' || paymentMethodId === '') {
|
|
86
|
+
throw new factory.errors.Argument('programMembershipUsed', 'paymentMethodId required');
|
|
75
87
|
}
|
|
88
|
+
programMembershipUsedAsPermit = {
|
|
89
|
+
identifier: paymentMethodId,
|
|
90
|
+
issuedThrough: { typeOf: ownedGoodType },
|
|
91
|
+
typeOf: factory.permit.PermitType.Permit
|
|
92
|
+
};
|
|
76
93
|
}
|
|
77
94
|
else if (ownedGoodType === factory.service.paymentService.PaymentServiceType.CreditCard) {
|
|
78
95
|
// CreditCard決済の場合、決済方法所有権を受け入れる(2025-11-11~)
|
|
79
|
-
const paymentServiceId = (
|
|
96
|
+
const paymentServiceId = (_b = permitOwnershipInfo.typeOfGood) === null || _b === void 0 ? void 0 : _b.id;
|
|
80
97
|
const paymentMethodId = permitOwnershipInfo.typeOfGood.serviceOutput.paymentMethodId;
|
|
81
|
-
if (typeof
|
|
98
|
+
if (typeof paymentServiceId !== 'string' || paymentServiceId === '') {
|
|
82
99
|
throw new factory.errors.Argument('programMembershipUsed', 'paymentServiceId required');
|
|
83
100
|
}
|
|
84
101
|
if (typeof paymentMethodId !== 'string' || paymentMethodId === '') {
|
|
@@ -91,7 +108,7 @@ function requestedProgramMembershipUsed2permit(params) {
|
|
|
91
108
|
};
|
|
92
109
|
}
|
|
93
110
|
else {
|
|
94
|
-
throw new factory.errors.Argument('programMembershipUsed',
|
|
111
|
+
throw new factory.errors.Argument('programMembershipUsed', `ownershipInfo.typeOfGood.typeOf: ${ownedGoodType} invalid`);
|
|
95
112
|
}
|
|
96
113
|
}
|
|
97
114
|
}
|
|
@@ -5,8 +5,10 @@ import type { AdvanceBookingRequirementRepo } from '../../../../repo/advanceBook
|
|
|
5
5
|
import type { AssetTransactionRepo } from '../../../../repo/assetTransaction';
|
|
6
6
|
import type { AuthorizationRepo } from '../../../../repo/authorization';
|
|
7
7
|
import type { EventRepo, IMinimizedIndividualEvent } from '../../../../repo/event';
|
|
8
|
+
import type { EventOfferRepo } from '../../../../repo/eventOffer';
|
|
8
9
|
import { EventSeriesRepo } from '../../../../repo/eventSeries';
|
|
9
10
|
import type { IssuerRepo } from '../../../../repo/issuer';
|
|
11
|
+
import type { MemberRepo } from '../../../../repo/member';
|
|
10
12
|
import type { MemberProgramRepo } from '../../../../repo/memberProgram';
|
|
11
13
|
import type { OfferRepo } from '../../../../repo/offer/unitPriceInCatalog';
|
|
12
14
|
import type { OfferCatalogRepo } from '../../../../repo/offerCatalog';
|
|
@@ -28,6 +30,7 @@ declare function processStartReserve4chevre(params: {
|
|
|
28
30
|
event: Pick<IMinimizedIndividualEvent, 'id'> & {
|
|
29
31
|
offers?: {
|
|
30
32
|
validForMemberTier?: factory.assetTransaction.reserve.ITokenizedMemberProgramTier;
|
|
33
|
+
identifier?: string;
|
|
31
34
|
};
|
|
32
35
|
};
|
|
33
36
|
broker?: factory.reservation.IBroker<factory.reservationType>;
|
|
@@ -41,6 +44,7 @@ declare function processStartReserve4chevre(params: {
|
|
|
41
44
|
validateEventOfferPeriod: boolean;
|
|
42
45
|
validateEvent: boolean;
|
|
43
46
|
orderNumber: string;
|
|
47
|
+
instrument: factory.action.reserve.ITicketAsInstrument[];
|
|
44
48
|
}, options: {
|
|
45
49
|
/**
|
|
46
50
|
* 最大n日前から予約可能
|
|
@@ -52,8 +56,10 @@ declare function processStartReserve4chevre(params: {
|
|
|
52
56
|
authorization: AuthorizationRepo;
|
|
53
57
|
stockHolder: StockHolderRepo;
|
|
54
58
|
event: EventRepo;
|
|
59
|
+
eventOffer: EventOfferRepo;
|
|
55
60
|
eventSeries: EventSeriesRepo;
|
|
56
61
|
issuer: IssuerRepo;
|
|
62
|
+
member: MemberRepo;
|
|
57
63
|
memberProgram: MemberProgramRepo;
|
|
58
64
|
offer: OfferRepo;
|
|
59
65
|
offerCatalog: OfferCatalogRepo;
|
|
@@ -20,21 +20,21 @@ function processStartReserve4chevre(params, options) {
|
|
|
20
20
|
// jwt: JWTCredentials;
|
|
21
21
|
// }
|
|
22
22
|
) => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
var _a, _b;
|
|
24
23
|
const { event, transaction, transactionNumber } = params;
|
|
25
24
|
let acceptedOffers4result = [];
|
|
26
25
|
// 予約取引開始
|
|
27
26
|
const startParams = (0, factory_1.createReserveTransactionStartParams)(Object.assign({ project: transaction.project,
|
|
28
27
|
// object: <IObjectWithDetail>action.object,
|
|
29
|
-
acceptedOffers: params.acceptedOffers, event:
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
acceptedOffers: params.acceptedOffers, event: {
|
|
29
|
+
id: event.id
|
|
30
|
+
}, transaction,
|
|
32
31
|
transactionNumber }, (params.broker !== undefined) ? { broker: params.broker } : undefined));
|
|
33
32
|
const startParamObject = yield validateObjectWithoutDetail(startParams, { id: params.transaction.id })(repos);
|
|
34
33
|
const startReserveTransactionResult = yield ReserveTransactionService.start(Object.assign(Object.assign({}, startParams), { object: startParamObject,
|
|
35
34
|
// discontinue preSearchedEvent(2024-07-17~)
|
|
36
35
|
// preSearchedEvent: event,
|
|
37
36
|
preSearchedTicketOffers: params.ticketOffers, preSearchedUnitPriceOffers: params.unitPriceOffers, availableAtOrFrom: { id: params.availableAtOrFrom.id }, validateEvent: params.validateEvent, validateEventOfferPeriod: params.validateEventOfferPeriod, validateAppliesToMovieTicket: true, instrument: [
|
|
37
|
+
...params.instrument, // support Ticket(2025-11-18~)
|
|
38
38
|
{ orderNumber: params.orderNumber, typeOf: factory.order.OrderType.Order },
|
|
39
39
|
{ id: transaction.id, typeOf: transaction.typeOf }
|
|
40
40
|
] }), options)(repos, settings);
|
|
@@ -5,8 +5,10 @@ import type { AdvanceBookingRequirementRepo } from '../../../repo/advanceBooking
|
|
|
5
5
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
6
6
|
import type { AuthorizationRepo } from '../../../repo/authorization';
|
|
7
7
|
import type { EventRepo } from '../../../repo/event';
|
|
8
|
+
import type { EventOfferRepo } from '../../../repo/eventOffer';
|
|
8
9
|
import { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
9
10
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
11
|
+
import type { MemberRepo } from '../../../repo/member';
|
|
10
12
|
import type { MemberProgramRepo } from '../../../repo/memberProgram';
|
|
11
13
|
import type { OfferRepo } from '../../../repo/offer/unitPriceInCatalog';
|
|
12
14
|
import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
@@ -32,8 +34,10 @@ interface IAuthorizeRepos {
|
|
|
32
34
|
assetTransaction: AssetTransactionRepo;
|
|
33
35
|
authorization: AuthorizationRepo;
|
|
34
36
|
event: EventRepo;
|
|
37
|
+
eventOffer: EventOfferRepo;
|
|
35
38
|
eventSeries: EventSeriesRepo;
|
|
36
39
|
issuer: IssuerRepo;
|
|
40
|
+
member: MemberRepo;
|
|
37
41
|
memberProgram: MemberProgramRepo;
|
|
38
42
|
stockHolder: StockHolderRepo;
|
|
39
43
|
offer: OfferRepo;
|
|
@@ -76,6 +80,7 @@ declare function authorize(params: {
|
|
|
76
80
|
typeOf: factory.organizationType.Project;
|
|
77
81
|
};
|
|
78
82
|
object: IObjectWithoutDetail;
|
|
83
|
+
instrument: factory.action.reserve.ITicketAsInstrument[];
|
|
79
84
|
agent: {
|
|
80
85
|
id: string;
|
|
81
86
|
};
|
|
@@ -53,7 +53,7 @@ function authorize(params, options) {
|
|
|
53
53
|
const action = yield repos.action.start(actionAttributes);
|
|
54
54
|
try {
|
|
55
55
|
const processStartReserveResult = yield (0, processStartReserve4chevre_1.processStartReserve4chevre)(Object.assign({ acceptedOffers, event,
|
|
56
|
-
transactionNumber, transaction, availableAtOrFrom: { id: params.store.id }, ticketOffers, unitPriceOffers, validateEvent: params.validateEvent === true, validateEventOfferPeriod: params.validateEventOfferPeriod === true, orderNumber }, (typeof ((_a = params.object.broker) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? { broker: params.object.broker } : undefined), options)(repos, settings);
|
|
56
|
+
transactionNumber, transaction, availableAtOrFrom: { id: params.store.id }, ticketOffers, unitPriceOffers, validateEvent: params.validateEvent === true, validateEventOfferPeriod: params.validateEventOfferPeriod === true, orderNumber, instrument: params.instrument }, (typeof ((_a = params.object.broker) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? { broker: params.object.broker } : undefined), options)(repos, settings);
|
|
57
57
|
acceptedOffers4result = processStartReserveResult.acceptedOffers4result;
|
|
58
58
|
// add orderInTransaction(2024-01-15~)
|
|
59
59
|
if (!noOfferSpecified) {
|
|
@@ -82,7 +82,7 @@ function authorize(params, options) {
|
|
|
82
82
|
}
|
|
83
83
|
function validateCreateRequest(params) {
|
|
84
84
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
85
|
-
var _a, _b
|
|
85
|
+
var _a, _b;
|
|
86
86
|
const transaction = yield repos.transaction.projectFieldsInProgressById({
|
|
87
87
|
typeOf: factory.transactionType.PlaceOrder,
|
|
88
88
|
id: params.transaction.id
|
|
@@ -98,9 +98,14 @@ function validateCreateRequest(params) {
|
|
|
98
98
|
if (typeof ((_b = params.object.reservationFor) === null || _b === void 0 ? void 0 : _b.id) !== 'string' || params.object.reservationFor.id.length === 0) {
|
|
99
99
|
throw new factory.errors.ArgumentNull('object.reservationFor.id');
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
const event = {
|
|
102
|
+
id: params.object.reservationFor.id,
|
|
103
|
+
typeOf: factory.eventType.ScreeningEvent // ひとまずfix(2024-07-17~)
|
|
104
|
+
// offers: {
|
|
105
|
+
// ...(typeof validForMemberTier?.token === 'string') ? { validForMemberTier } : undefined,
|
|
106
|
+
// ...(typeof eventOfferIdentifier === 'string') ? { identifier: eventOfferIdentifier } : undefined
|
|
107
|
+
// }
|
|
108
|
+
};
|
|
104
109
|
return { transaction, event };
|
|
105
110
|
});
|
|
106
111
|
}
|
|
@@ -116,29 +116,45 @@ function createInformTasks(params, setting) {
|
|
|
116
116
|
);
|
|
117
117
|
// 最適化(2024-03-22~)
|
|
118
118
|
events4inform = screeningEvents4inform.map(({ project, organizer, typeOf, name, doorTime, endDate, eventStatus, location, startDate, superEvent, offers, id, additionalProperty, identifier }) => {
|
|
119
|
-
var _a;
|
|
120
|
-
const
|
|
121
|
-
? {
|
|
119
|
+
var _a, _b;
|
|
120
|
+
const sellerMakesOffersAsNotification = (Array.isArray((_a = offers.seller) === null || _a === void 0 ? void 0 : _a.makesOffer))
|
|
121
|
+
? offers.seller.makesOffer.map((eventSellerMakesOffer) => {
|
|
122
|
+
return Object.assign({ availabilityEnds: eventSellerMakesOffer.availabilityEnds, availabilityStarts: eventSellerMakesOffer.availabilityStarts, validFrom: eventSellerMakesOffer.validFrom, validThrough: eventSellerMakesOffer.validThrough, availableAtOrFrom: [eventSellerMakesOffer.availableAtOrFrom] }, (typeof eventSellerMakesOffer.identifier === 'string')
|
|
123
|
+
? { identifier: eventSellerMakesOffer.identifier }
|
|
124
|
+
: undefined // support notify identifier(2025-11-01~)
|
|
125
|
+
);
|
|
126
|
+
})
|
|
127
|
+
: [];
|
|
128
|
+
let eventOfferAsNotification;
|
|
129
|
+
if (((_b = offers.offeredThrough) === null || _b === void 0 ? void 0 : _b.identifier) === factory.service.webAPI.Identifier.COA) {
|
|
130
|
+
eventOfferAsNotification = {
|
|
122
131
|
typeOf: offers.typeOf,
|
|
123
132
|
itemOffered: offers.itemOffered
|
|
124
|
-
}
|
|
125
|
-
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
else if (offers.typeOf === factory.offerType.AggregateOffer) {
|
|
136
|
+
eventOfferAsNotification = {
|
|
137
|
+
typeOf: offers.typeOf,
|
|
138
|
+
itemOffered: offers.itemOffered,
|
|
139
|
+
seller: {
|
|
140
|
+
id: offers.seller.id,
|
|
141
|
+
typeOf: offers.seller.typeOf,
|
|
142
|
+
makesOffer: sellerMakesOffersAsNotification
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
eventOfferAsNotification = {
|
|
126
148
|
typeOf: offers.typeOf,
|
|
127
149
|
itemOffered: offers.itemOffered,
|
|
128
150
|
seller: {
|
|
129
151
|
id: offers.seller.id,
|
|
130
152
|
typeOf: offers.seller.typeOf,
|
|
131
153
|
// makesOfferを追加(2024-03-26~)
|
|
132
|
-
makesOffer:
|
|
133
|
-
? offers.seller.makesOffer.map((eventSellerMakesOffer) => {
|
|
134
|
-
return Object.assign({ availabilityEnds: eventSellerMakesOffer.availabilityEnds, availabilityStarts: eventSellerMakesOffer.availabilityStarts, validFrom: eventSellerMakesOffer.validFrom, validThrough: eventSellerMakesOffer.validThrough, availableAtOrFrom: [eventSellerMakesOffer.availableAtOrFrom] }, (typeof eventSellerMakesOffer.identifier === 'string')
|
|
135
|
-
? { identifier: eventSellerMakesOffer.identifier }
|
|
136
|
-
: undefined // support notify identifier(2025-11-01~)
|
|
137
|
-
);
|
|
138
|
-
})
|
|
139
|
-
: []
|
|
154
|
+
makesOffer: sellerMakesOffersAsNotification
|
|
140
155
|
}
|
|
141
156
|
};
|
|
157
|
+
}
|
|
142
158
|
return Object.assign({ project, organizer, typeOf, name, doorTime, endDate,
|
|
143
159
|
eventStatus, location, startDate, superEvent, id, additionalProperty, offers: eventOfferAsNotification }, (typeof identifier === 'string') ? { identifier } : undefined // support notify identifier(2025-11-01~)
|
|
144
160
|
);
|
|
@@ -11,9 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.verifyTicketTokenAsNeeded = verifyTicketTokenAsNeeded;
|
|
13
13
|
const factory = require("../../../factory");
|
|
14
|
+
// tslint:disable-next-line:max-func-body-length
|
|
14
15
|
function verifyTicketTokenAsNeeded(params) {
|
|
16
|
+
// tslint:disable-next-line:cyclomatic-complexity
|
|
15
17
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
var _a
|
|
18
|
+
var _a;
|
|
17
19
|
const { paymentServiceType, object, project } = params;
|
|
18
20
|
const { issuedThrough, ticketToken } = object;
|
|
19
21
|
let permitOrInvoice;
|
|
@@ -46,34 +48,38 @@ function verifyTicketTokenAsNeeded(params) {
|
|
|
46
48
|
if (authorizedObject.typeOf === 'OwnershipInfo') {
|
|
47
49
|
const { typeOfGood } = authorizedObject;
|
|
48
50
|
if (typeOfGood.typeOf === factory.permit.PermitType.Permit || typeOfGood.typeOf === 'Invoice') {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
|
|
67
|
-
}
|
|
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
|
+
// }
|
|
68
70
|
}
|
|
69
71
|
else if (typeOfGood.typeOf === factory.service.paymentService.PaymentServiceType.CreditCard
|
|
70
|
-
|| typeOfGood.typeOf === factory.service.paymentService.PaymentServiceType.MovieTicket
|
|
72
|
+
|| typeOfGood.typeOf === factory.service.paymentService.PaymentServiceType.MovieTicket
|
|
73
|
+
|| typeOfGood.typeOf === factory.service.paymentService.PaymentServiceType.FaceToFace) {
|
|
71
74
|
// 決済方法所有権を受け入れる(2025-11-11~)
|
|
72
75
|
if (typeOfGood.typeOf !== paymentServiceType) {
|
|
73
76
|
throw new factory.errors.Argument('ticketToken', 'paymentServiceType not matched');
|
|
74
77
|
}
|
|
75
|
-
|
|
76
|
-
|
|
78
|
+
// FaceToFace以外の場合、発行サービスIDを検証
|
|
79
|
+
if (typeOfGood.typeOf !== factory.service.paymentService.PaymentServiceType.FaceToFace) {
|
|
80
|
+
if (typeOfGood.id !== issuedThrough.id) {
|
|
81
|
+
throw new factory.errors.Argument('ticketToken', 'issuedThrough.id not matched');
|
|
82
|
+
}
|
|
77
83
|
}
|
|
78
84
|
permitOrInvoice = { paymentMethodId: typeOfGood.serviceOutput.paymentMethodId, typeOf: 'Invoice' };
|
|
79
85
|
}
|
package/package.json
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
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": "5.2.0-alpha.
|
|
15
|
-
"@cinerino/sdk": "12.
|
|
14
|
+
"@chevre/factory": "5.2.0-alpha.13",
|
|
15
|
+
"@cinerino/sdk": "12.8.0-alpha.2",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.4.0-alpha.1",
|
|
18
18
|
"@sendgrid/client": "8.1.4",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"postversion": "git push origin --tags",
|
|
116
116
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
117
117
|
},
|
|
118
|
-
"version": "23.1.0-alpha.
|
|
118
|
+
"version": "23.1.0-alpha.10"
|
|
119
119
|
}
|