@chevre/domain 22.0.0-alpha.16 → 22.0.0-alpha.17
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/searchMinimizedEvent.ts +2 -7
- package/lib/chevre/repo/event.d.ts +1 -1
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +2 -2
- package/lib/chevre/service/aggregation/event/findEventOffers.d.ts +7 -3
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +6 -7
- package/lib/chevre/service/payment/movieTicket/factory.d.ts +13 -2
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +6 -2
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.d.ts +11 -5
- package/lib/chevre/service/payment/movieTicket/validation.js +3 -1
- package/package.json +1 -1
|
@@ -19,13 +19,8 @@ async function main() {
|
|
|
19
19
|
// id: 'blxonxv1m'
|
|
20
20
|
},
|
|
21
21
|
[
|
|
22
|
-
'
|
|
23
|
-
|
|
24
|
-
// 'offers.itemOffered',
|
|
25
|
-
'offers.itemOffered.id',
|
|
26
|
-
'offers.offeredThrough',
|
|
27
|
-
'offers.eligibleQuantity',
|
|
28
|
-
'offers.unacceptedPaymentMethod'
|
|
22
|
+
'additionalProperty', 'startDate', 'offers.offeredThrough', 'superEvent.workPerformed.identifier',
|
|
23
|
+
'location.branchCode'
|
|
29
24
|
]
|
|
30
25
|
);
|
|
31
26
|
// tslint:disable-next-line:no-null-keyword
|
|
@@ -74,7 +74,7 @@ type IKeyOfProjection<T extends factory.eventType> = keyof factory.event.IEvent<
|
|
|
74
74
|
* minimizedEvent検索時のprojection候補
|
|
75
75
|
* add(2024-07-18~)
|
|
76
76
|
*/
|
|
77
|
-
type IKeyOfProjection4minimizedEvent<T extends factory.eventType> = T extends factory.eventType.ScreeningEvent ? keyof IMinimizedIndividualEvent<T> | '
|
|
77
|
+
type IKeyOfProjection4minimizedEvent<T extends factory.eventType> = T extends factory.eventType.ScreeningEvent ? keyof IMinimizedIndividualEvent<T> | 'superEvent.id' | 'location.branchCode' | 'superEvent.workPerformed.identifier' | 'offers.itemOffered' | 'offers.itemOffered.id' | 'offers.offeredThrough' | 'offers.unacceptedPaymentMethod' | 'offers.eligibleQuantity' : T extends factory.eventType.Event ? keyof IMinimizedIndividualEvent<T> | 'superEvent.id' | 'location.branchCode' | 'superEvent.workPerformed.identifier' | 'offers.itemOffered' | 'offers.itemOffered.id' | 'offers.offeredThrough' | 'offers.unacceptedPaymentMethod' | 'offers.eligibleQuantity' : never;
|
|
78
78
|
type IUnset<T extends factory.eventType> = {
|
|
79
79
|
[key in keyof factory.event.IEvent<T>]?: 1;
|
|
80
80
|
};
|
|
@@ -22,8 +22,8 @@ function aggregateUseActionsOnEvent(params) {
|
|
|
22
22
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
23
23
|
const now = new Date();
|
|
24
24
|
// 集計対象イベント検索
|
|
25
|
-
//
|
|
26
|
-
|
|
25
|
+
const event = yield repos.event.findMinimizedIndividualEventById(params, ['offers.itemOffered.id', 'project', 'startDate', 'superEvent', 'typeOf'] // optimize projection(2024-07-19~)
|
|
26
|
+
);
|
|
27
27
|
// 入場ゲート検索
|
|
28
28
|
const entranceGates = yield findEntranceGates({ event })(repos);
|
|
29
29
|
// 入場ゲートごとの集計
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import type { IMinimizedIndividualEvent } from '../../../repo/event';
|
|
2
1
|
import type { IUnitPriceOfferFromAggregateOffer, OfferRepo } from '../../../repo/offer';
|
|
3
2
|
import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
4
3
|
import type { ProductRepo } from '../../../repo/product';
|
|
5
|
-
import * as factory from '../../../factory';
|
|
6
4
|
/**
|
|
7
5
|
* 興行オファー検索
|
|
8
6
|
* NotFoundエラーをハンドリングする
|
|
9
7
|
*/
|
|
10
8
|
export declare function findEventOffers(params: {
|
|
11
|
-
event:
|
|
9
|
+
event: {
|
|
10
|
+
offers?: {
|
|
11
|
+
itemOffered?: {
|
|
12
|
+
id?: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
12
16
|
}): (repos: {
|
|
13
17
|
offer: OfferRepo;
|
|
14
18
|
offerCatalog: OfferCatalogRepo;
|
|
@@ -53,9 +53,10 @@ function checkMovieTicket(params) {
|
|
|
53
53
|
if (eventIds.length !== 1) {
|
|
54
54
|
throw new factory.errors.Argument('movieTickets', 'Number of events must be 1');
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
const screeningEvent = yield repos.event.findMinimizedIndividualEventById({ id: eventIds[0] }, [
|
|
57
|
+
'typeOf', 'project', 'additionalProperty', 'startDate', 'offers.offeredThrough', 'superEvent.workPerformed.identifier'
|
|
58
|
+
] // optimize projection(2024-07-19~)
|
|
59
|
+
);
|
|
59
60
|
const sellerId = (_f = optimizedCheckObject[0]) === null || _f === void 0 ? void 0 : _f.seller.id;
|
|
60
61
|
const paymentAccepted = yield repos.paymentAccepted.isAcceptedBySeller({
|
|
61
62
|
seller: { id: sellerId },
|
|
@@ -65,10 +66,8 @@ function checkMovieTicket(params) {
|
|
|
65
66
|
throw new factory.errors.Argument('transactionId', `payment not accepted [${paymentMethodType}]`);
|
|
66
67
|
}
|
|
67
68
|
processPurchaseNumberAuthResult = yield (0, processPurchaseNumberAuth_1.processPurchaseNumberAuth)({
|
|
68
|
-
movieTickets
|
|
69
|
-
seller: { id: sellerId }
|
|
70
|
-
screeningEvent: screeningEvent,
|
|
71
|
-
paymentServiceId
|
|
69
|
+
movieTickets, screeningEvent, paymentServiceId,
|
|
70
|
+
seller: { id: sellerId }
|
|
72
71
|
})(repos, settings);
|
|
73
72
|
// add recipe(2024-06-07~)
|
|
74
73
|
recipe = (0, factory_1.processPurchaseNumberAuthResult2checkRecipe)({
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import * as surfrock from '@surfrock/sdk';
|
|
2
2
|
import * as factory from '../../../factory';
|
|
3
3
|
import { IMinimizedIndividualEvent } from '../../../factory/event';
|
|
4
|
+
type IEvent4seatInfoSync = Pick<IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>, 'id' | 'additionalProperty' | 'startDate'> & {
|
|
5
|
+
location: Pick<factory.event.event.ILocation, 'branchCode'>;
|
|
6
|
+
offers: {
|
|
7
|
+
offeredThrough?: factory.event.screeningEvent.IOfferedThrough | factory.event.screeningEvent.IOffer4COA['offeredThrough'];
|
|
8
|
+
};
|
|
9
|
+
superEvent: {
|
|
10
|
+
workPerformed: {
|
|
11
|
+
identifier: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
4
15
|
declare function createSeatInfoSyncIn(params: {
|
|
5
16
|
paymentMethodType: string;
|
|
6
17
|
paymentMethodId: string;
|
|
7
18
|
movieTickets: factory.action.trade.pay.IMovieTicket[];
|
|
8
|
-
event:
|
|
19
|
+
event: IEvent4seatInfoSync;
|
|
9
20
|
purpose: factory.action.trade.pay.IPurpose;
|
|
10
21
|
credentials: {
|
|
11
22
|
kgygishCd: string;
|
|
@@ -50,4 +61,4 @@ declare enum MovieticketReserveRequestErrorMessage {
|
|
|
50
61
|
ReservationResult19 = "ReservationResult 19",
|
|
51
62
|
CancellationPeriodPassed = "\u5EA7\u5E2D\u4E88\u7D04\u53D6\u6D88\u53EF\u80FD\u671F\u9593\u3092\u904E\u304E\u3066\u3044\u307E\u3059\u3002"
|
|
52
63
|
}
|
|
53
|
-
export { createSeatInfoSyncIn, createStartingPayAction, processPurchaseNumberAuthResult2checkRecipe, processSeatInfoSyncResult2payRecipe, processSeatInfoSyncResult2refundRecipe, MovieticketReserveRequestErrorMessage, IProcessPurchaseNumberAuthResult, IProcessSeatInfoSyncResult, IProcessSeatInfoSyncCancelResult };
|
|
64
|
+
export { createSeatInfoSyncIn, createStartingPayAction, processPurchaseNumberAuthResult2checkRecipe, processSeatInfoSyncResult2payRecipe, processSeatInfoSyncResult2refundRecipe, MovieticketReserveRequestErrorMessage, IEvent4seatInfoSync, IProcessPurchaseNumberAuthResult, IProcessSeatInfoSyncResult, IProcessSeatInfoSyncCancelResult };
|
|
@@ -111,8 +111,12 @@ function payActionParams2seatInfoSyncIn(params) {
|
|
|
111
111
|
if (eventIds.length !== 1) {
|
|
112
112
|
throw new factory.errors.Argument('movieTickets', 'Number of events must be 1');
|
|
113
113
|
}
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
const event = yield repos.event.findMinimizedIndividualEventById({ id: eventIds[0] },
|
|
115
|
+
// optimize projection(2024-07-19~)
|
|
116
|
+
[
|
|
117
|
+
'superEvent', 'additionalProperty', 'startDate', 'project',
|
|
118
|
+
'offers.offeredThrough', 'location.branchCode', 'superEvent.workPerformed.identifier'
|
|
119
|
+
]);
|
|
116
120
|
const sellerId = String((_d = params.recipient) === null || _d === void 0 ? void 0 : _d.id);
|
|
117
121
|
// 全購入管理番号のMovieTicketをマージ
|
|
118
122
|
const movieTickets = params.object.reduce((a, b) => [...a, ...(Array.isArray(b.movieTickets)) ? b.movieTickets : []], []);
|
|
@@ -7,16 +7,22 @@ interface ICheckResult {
|
|
|
7
7
|
purchaseNumberAuthIn: factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthIn;
|
|
8
8
|
purchaseNumberAuthResult: factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthResult;
|
|
9
9
|
}
|
|
10
|
+
type IEvent4checkByIdentifier = Pick<IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>, 'id' | 'typeOf' | 'project' | 'additionalProperty' | 'startDate'> & {
|
|
11
|
+
offers: {
|
|
12
|
+
offeredThrough?: factory.event.screeningEvent.IOfferedThrough | factory.event.screeningEvent.IOffer4COA['offeredThrough'];
|
|
13
|
+
};
|
|
14
|
+
superEvent: {
|
|
15
|
+
workPerformed: {
|
|
16
|
+
identifier: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
10
20
|
interface ICheckByIdentifierParams {
|
|
11
21
|
movieTickets: factory.action.check.paymentMethod.movieTicket.IMovieTicket[];
|
|
12
22
|
seller: {
|
|
13
23
|
id: string;
|
|
14
24
|
};
|
|
15
|
-
screeningEvent:
|
|
16
|
-
offers: {
|
|
17
|
-
offeredThrough?: factory.event.screeningEvent.IOfferedThrough | factory.event.screeningEvent.IOffer4COA['offeredThrough'];
|
|
18
|
-
};
|
|
19
|
-
};
|
|
25
|
+
screeningEvent: IEvent4checkByIdentifier;
|
|
20
26
|
paymentServiceId: string;
|
|
21
27
|
}
|
|
22
28
|
declare function processPurchaseNumberAuth(params: ICheckByIdentifierParams): (repos: {
|
|
@@ -45,7 +45,9 @@ function validateMovieTicket(params, paymentServiceId, useCheckByIdentifierIfNot
|
|
|
45
45
|
throw new factory.errors.ArgumentNull('object.paymentMethod.identifier');
|
|
46
46
|
}
|
|
47
47
|
// イベント取得属性最適化(2023-01-23~)
|
|
48
|
-
const screeningEvent = yield repos.event.findMinimizedIndividualEventById({ id: eventIds[0] }, [
|
|
48
|
+
const screeningEvent = yield repos.event.findMinimizedIndividualEventById({ id: eventIds[0] }, [
|
|
49
|
+
'typeOf', 'project', 'additionalProperty', 'startDate', 'offers.offeredThrough', 'superEvent.workPerformed.identifier'
|
|
50
|
+
] // optimize(2024-07-18~)
|
|
49
51
|
);
|
|
50
52
|
// 販売者からムビチケ決済情報取得
|
|
51
53
|
const sellerId = (_c = params.recipient) === null || _c === void 0 ? void 0 : _c.id;
|
package/package.json
CHANGED