@chevre/domain 23.2.0-alpha.2 → 23.2.0-alpha.20
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/actions/checkAuthorizePaymentActions.ts +55 -0
- package/example/src/chevre/event/importEventsFromCOAByTitle.ts +1 -1
- package/example/src/chevre/eventSeries/migrateEventSeriesOffers.ts +75 -0
- package/example/src/chevre/eventSeries/migrateEventSeriesVideoFormat.ts +80 -0
- package/example/src/chevre/place/adminEntranceGates.ts +68 -0
- package/example/src/chevre/place/checkEntranceGatesCount.ts +82 -0
- package/example/src/chevre/place/findRooms.ts +24 -0
- package/example/src/chevre/place/findSections.ts +28 -0
- package/example/src/chevre/place/migrateSectionIdentifier.ts +92 -0
- package/example/src/chevre/place/seatsJson2csv.ts +63 -0
- package/example/src/chevre/place/upsertSeatsByBranchCode.ts +72 -0
- package/example/src/chevre/reIndex.ts +1 -1
- package/example/src/chevre/roles/addAdminEventSeriesReadPermissionIfNotExists.ts +49 -0
- package/example/src/chevre/roles/addAdminMovieReadPermissionIfNotExists.ts +49 -0
- package/example/src/chevre/roles/addAdminMovieTheaterReadPermissionIfNotExists.ts +34 -0
- package/example/src/chevre/roles/addAdminMovieTheaterWritePermissionIfNotExists.ts +34 -0
- package/example/src/chevre/roles/addAdminRoomReadPermissionIfNotExists.ts +34 -0
- package/example/src/chevre/roles/addAdminRoomWritePermissionIfNotExists.ts +34 -0
- package/lib/chevre/repo/acceptedPaymentMethod.js +14 -10
- package/lib/chevre/repo/aggregateOrder.js +0 -93
- package/lib/chevre/repo/aggregateReservation.d.ts +0 -1
- package/lib/chevre/repo/aggregateReservation.js +0 -2
- package/lib/chevre/repo/creativeWork.js +9 -5
- package/lib/chevre/repo/eventSeries.js +16 -12
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +0 -1
- package/lib/chevre/repo/mongoose/schemas/creativeWork.js +10 -9
- package/lib/chevre/repo/mongoose/schemas/eventSeries.js +10 -0
- package/lib/chevre/repo/place/entranceGate.d.ts +58 -0
- package/lib/chevre/repo/place/entranceGate.js +159 -0
- package/lib/chevre/repo/place/movieTheater.d.ts +5 -2
- package/lib/chevre/repo/place/movieTheater.js +3 -1
- package/lib/chevre/repo/place/screeningRoom.d.ts +38 -31
- package/lib/chevre/repo/place/screeningRoom.js +166 -135
- package/lib/chevre/repo/place/seat.d.ts +47 -45
- package/lib/chevre/repo/place/seat.js +175 -45
- package/lib/chevre/repo/place/section.d.ts +36 -30
- package/lib/chevre/repo/place/section.js +214 -130
- package/lib/chevre/repository.d.ts +8 -0
- package/lib/chevre/repository.js +16 -0
- package/lib/chevre/service/assetTransaction/pay/validateAcceptedPaymentMethodIfNeeded.d.ts +6 -1
- package/lib/chevre/service/assetTransaction/pay/validateAcceptedPaymentMethodIfNeeded.js +26 -4
- package/lib/chevre/service/assetTransaction/pay.d.ts +3 -0
- package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +1 -1
- package/lib/chevre/service/event/processUpdateMovieTheater.js +1 -1
- package/lib/chevre/service/event/saveScreeningEvents.d.ts +1 -1
- package/lib/chevre/service/event/saveScreeningEvents.js +1 -1
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +7 -4
- package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +9 -6
- package/lib/chevre/service/offer/event/searchOffersByIds.js +7 -4
- package/lib/chevre/service/offer/onEventChanged.js +7 -5
- package/lib/chevre/service/payment/any/factory.d.ts +5 -0
- package/lib/chevre/service/payment/any/factory.js +11 -2
- package/lib/chevre/service/payment/any.d.ts +8 -0
- package/lib/chevre/service/payment/any.js +3 -2
- package/lib/chevre/service/task/authorizePayment.js +3 -1
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.d.ts +1 -1
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.js +2 -2
- package/lib/chevre/service/task/createEvent/createEventBySchedule/schedule2events.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.js +2 -2
- package/lib/chevre/service/task/publishPaymentUrl.js +3 -1
- package/lib/chevre/service/task/syncResourcesFromCOA.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +3 -1
- package/lib/chevre/service/transaction/placeOrder/confirm.js +3 -1
- package/package.json +3 -2
- package/lib/chevre/service/eventOld.d.ts +0 -60
- package/lib/chevre/service/eventOld.js +0 -864
|
@@ -28,7 +28,7 @@ function getUnacceptedPaymentMethodByEvent(params) {
|
|
|
28
28
|
*/
|
|
29
29
|
function searchOfferAppliesToMovieTicket(params) {
|
|
30
30
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
var _a, _b, _c, _d;
|
|
31
|
+
var _a, _b, _c, _d, _e;
|
|
32
32
|
// optimize(2024-07-18~)
|
|
33
33
|
const event = yield repos.event.projectEventFieldsById({ id: params.event.id }, ['project', 'startDate', 'typeOf', 'superEvent.id', 'offers.itemOffered.id', 'offers.unacceptedPaymentMethod']);
|
|
34
34
|
// let soundFormatTypes: string[] = [];
|
|
@@ -39,13 +39,16 @@ function searchOfferAppliesToMovieTicket(params) {
|
|
|
39
39
|
page: 1,
|
|
40
40
|
id: { $eq: event.superEvent.id }
|
|
41
41
|
// typeOf: factory.eventType.ScreeningEventSeries
|
|
42
|
-
},
|
|
42
|
+
},
|
|
43
|
+
// ['soundFormat', 'videoFormat', 'subEvent']
|
|
44
|
+
['soundFormat', 'subEvent']);
|
|
43
45
|
const superEvent = superEvents.shift();
|
|
44
46
|
if (superEvent === undefined) {
|
|
45
47
|
throw new factory.errors.NotFound(factory.eventType.ScreeningEventSeries);
|
|
46
48
|
}
|
|
47
49
|
// soundFormatTypes = (Array.isArray(superEvent.soundFormat)) ? superEvent.soundFormat.map((f) => f.typeOf) : [];
|
|
48
|
-
videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
|
|
50
|
+
// videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
|
|
51
|
+
videoFormatTypes = (Array.isArray((_a = superEvent.subEvent) === null || _a === void 0 ? void 0 : _a.videoFormat)) ? superEvent.subEvent.videoFormat : [];
|
|
49
52
|
}
|
|
50
53
|
const unacceptedPaymentMethod = getUnacceptedPaymentMethodByEvent({ event });
|
|
51
54
|
// 上映方式がなければMovieTicket除外
|
|
@@ -53,7 +56,7 @@ function searchOfferAppliesToMovieTicket(params) {
|
|
|
53
56
|
// 興行設定があれば興行のカタログを参照する
|
|
54
57
|
const eventOffers = event.offers;
|
|
55
58
|
let catalogId;
|
|
56
|
-
if (typeof ((
|
|
59
|
+
if (typeof ((_b = eventOffers.itemOffered) === null || _b === void 0 ? void 0 : _b.id) === 'string') {
|
|
57
60
|
const eventService = (yield repos.product.projectFields({
|
|
58
61
|
limit: 1,
|
|
59
62
|
page: 1,
|
|
@@ -65,7 +68,7 @@ function searchOfferAppliesToMovieTicket(params) {
|
|
|
65
68
|
throw new factory.errors.NotFound(factory.product.ProductType.EventService);
|
|
66
69
|
}
|
|
67
70
|
// const firstCatalogIdOfProduct = eventService.hasOfferCatalog?.id; // migrate to itemListElement(2024-09-30~)
|
|
68
|
-
const firstCatalogIdOfProduct = (
|
|
71
|
+
const firstCatalogIdOfProduct = (_d = (_c = eventService.hasOfferCatalog) === null || _c === void 0 ? void 0 : _c.itemListElement.at(0)) === null || _d === void 0 ? void 0 : _d.id;
|
|
69
72
|
if (typeof firstCatalogIdOfProduct === 'string') {
|
|
70
73
|
catalogId = firstCatalogIdOfProduct;
|
|
71
74
|
}
|
|
@@ -83,7 +86,7 @@ function searchOfferAppliesToMovieTicket(params) {
|
|
|
83
86
|
}
|
|
84
87
|
return repos.offer.searchAvaialbleAppliesToMovieTicketByOfferCatalogId({
|
|
85
88
|
subOfferCatalog: { id: subOfferCatalogId, isOfferCatalogItem },
|
|
86
|
-
availableAtOrFrom: { id: (
|
|
89
|
+
availableAtOrFrom: { id: (_e = params.store) === null || _e === void 0 ? void 0 : _e.id },
|
|
87
90
|
unacceptedPaymentMethod: unacceptedPaymentMethod,
|
|
88
91
|
excludeAppliesToMovieTicket: excludeAppliesToMovieTicket,
|
|
89
92
|
onlyValid: params.onlyValid === true,
|
|
@@ -110,7 +110,7 @@ function searchTicketOffersByItemOffered(params) {
|
|
|
110
110
|
function searchEventTicketOffersByEvent(params) {
|
|
111
111
|
// tslint:disable-next-line:max-func-body-length
|
|
112
112
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
113
|
-
var _a;
|
|
113
|
+
var _a, _b;
|
|
114
114
|
const event = params.event;
|
|
115
115
|
let soundFormatTypes = [];
|
|
116
116
|
let videoFormatTypes = [];
|
|
@@ -120,13 +120,16 @@ function searchEventTicketOffersByEvent(params) {
|
|
|
120
120
|
page: 1,
|
|
121
121
|
id: { $eq: event.superEvent.id }
|
|
122
122
|
// typeOf: factory.eventType.ScreeningEventSeries
|
|
123
|
-
},
|
|
123
|
+
},
|
|
124
|
+
// ['soundFormat', 'videoFormat', 'subEvent']
|
|
125
|
+
['soundFormat', 'subEvent']);
|
|
124
126
|
const superEvent = superEvents.shift();
|
|
125
127
|
if (superEvent === undefined) {
|
|
126
128
|
throw new factory.errors.NotFound(factory.eventType.ScreeningEventSeries);
|
|
127
129
|
}
|
|
128
130
|
soundFormatTypes = (Array.isArray(superEvent.soundFormat)) ? superEvent.soundFormat.map((f) => f.typeOf) : [];
|
|
129
|
-
videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
|
|
131
|
+
// videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
|
|
132
|
+
videoFormatTypes = (Array.isArray((_a = superEvent.subEvent) === null || _a === void 0 ? void 0 : _a.videoFormat)) ? superEvent.subEvent.videoFormat : [];
|
|
130
133
|
}
|
|
131
134
|
const unacceptedPaymentMethod = getUnacceptedPaymentMethodByEvent({ event });
|
|
132
135
|
// 上映方式がなければMovieTicket除外(2023-02-21~)
|
|
@@ -134,7 +137,7 @@ function searchEventTicketOffersByEvent(params) {
|
|
|
134
137
|
// 興行設定があれば興行のカタログを参照する(2022-08-31~)
|
|
135
138
|
const eventOffers = event.offers;
|
|
136
139
|
const { availableOffers } = yield searchTicketOffersByItemOffered({
|
|
137
|
-
itemOffered: { id: String((
|
|
140
|
+
itemOffered: { id: String((_b = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.itemOffered) === null || _b === void 0 ? void 0 : _b.id) },
|
|
138
141
|
ids: params.ids,
|
|
139
142
|
store: params.store,
|
|
140
143
|
// limit: params.limit,
|
|
@@ -165,15 +165,17 @@ function createInformTasks(params, setting) {
|
|
|
165
165
|
id: { $in: params.ids }
|
|
166
166
|
// typeOf: params.typeOf
|
|
167
167
|
}, [
|
|
168
|
-
'project', 'organizer', 'typeOf', 'name', 'location', '
|
|
168
|
+
'project', 'organizer', 'typeOf', 'name', 'location', 'soundFormat', 'workPerformed', 'kanaName', 'eventStatus',
|
|
169
169
|
'endDate', 'startDate', 'additionalProperty', 'subtitleLanguage', 'dubLanguage',
|
|
170
|
-
'alternativeHeadline', 'description', 'duration', 'headline'
|
|
170
|
+
'alternativeHeadline', 'description', 'duration', 'headline', 'subEvent'
|
|
171
171
|
] // inclusion(2024-07-30~)
|
|
172
172
|
);
|
|
173
173
|
// 最適化(2024-03-25~)
|
|
174
|
-
events4inform = screeningEventSeries4inform.map(({ project, organizer, typeOf, name, location, id,
|
|
175
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ project, organizer, typeOf, name, location, id,
|
|
176
|
-
endDate, startDate
|
|
174
|
+
events4inform = screeningEventSeries4inform.map(({ project, organizer, typeOf, name, location, id, soundFormat, workPerformed, kanaName, eventStatus, endDate, startDate, additionalProperty, subtitleLanguage, dubLanguage, alternativeHeadline, description, duration, headline, subEvent }) => {
|
|
175
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ project, organizer, typeOf, name, location, id, soundFormat, workPerformed, kanaName, eventStatus,
|
|
176
|
+
endDate, startDate, videoFormat: (Array.isArray(subEvent === null || subEvent === void 0 ? void 0 : subEvent.videoFormat))
|
|
177
|
+
? subEvent.videoFormat.map((codeValue) => ({ typeOf: codeValue, name: codeValue }))
|
|
178
|
+
: [] }, (Array.isArray(additionalProperty)) ? { additionalProperty } : undefined), (subtitleLanguage !== undefined) ? {} : undefined), (dubLanguage !== undefined) ? { dubLanguage } : undefined), (alternativeHeadline !== undefined) ? { alternativeHeadline } : undefined), (description !== undefined) ? { description } : undefined), (typeof duration === 'string') ? { duration } : undefined), (headline !== undefined) ? { headline } : undefined);
|
|
177
179
|
});
|
|
178
180
|
}
|
|
179
181
|
if (events4inform.length > 0) {
|
|
@@ -16,6 +16,7 @@ export declare function creatPublishPaymentUrlParams(params: {
|
|
|
16
16
|
* 決済採用に使用される決済方法チケットトークン
|
|
17
17
|
*/
|
|
18
18
|
ticketToken?: string;
|
|
19
|
+
instrument: factory.action.trade.pay.IAcceptedPaymentMethodOfferAsInstrument[];
|
|
19
20
|
}): Pick<factory.assetTransaction.pay.IStartParamsWithoutDetail, 'agent' | 'location' | 'project' | 'recipient' | 'transactionNumber' | 'typeOf'> & {
|
|
20
21
|
object: factory.action.accept.pay.IPayObject;
|
|
21
22
|
identifier?: string;
|
|
@@ -40,6 +41,10 @@ export declare function creatPayTransactionStartParams(params: {
|
|
|
40
41
|
* 決済方法チケット
|
|
41
42
|
*/
|
|
42
43
|
ticketToken?: string;
|
|
44
|
+
/**
|
|
45
|
+
* ツールとしての対応決済方法オファー
|
|
46
|
+
*/
|
|
47
|
+
instrument: factory.action.trade.pay.IAcceptedPaymentMethodOfferAsInstrument[];
|
|
43
48
|
}): factory.assetTransaction.pay.IStartParamsWithoutDetail & {
|
|
44
49
|
instrument: factory.action.trade.pay.IPlaceOrderRelatedInstrument[];
|
|
45
50
|
};
|
|
@@ -28,7 +28,15 @@ function creatPublishPaymentUrlParams(params) {
|
|
|
28
28
|
referencesOrder: params.object.referencesOrder
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
+
const instrument = [];
|
|
31
32
|
const ticketAsInstrument = (typeof params.ticketToken === 'string') ? { ticketToken: params.ticketToken, typeOf: 'Ticket' } : undefined;
|
|
33
|
+
if (ticketAsInstrument !== undefined) {
|
|
34
|
+
instrument.push(ticketAsInstrument);
|
|
35
|
+
}
|
|
36
|
+
// instrumentを対応決済方法オファーに対応(2025-12-14~)
|
|
37
|
+
if (Array.isArray(params.instrument)) {
|
|
38
|
+
instrument.push(...params.instrument);
|
|
39
|
+
}
|
|
32
40
|
return Object.assign(Object.assign(Object.assign({ project: { id: params.transaction.project.id, typeOf: factory.organizationType.Project }, typeOf: factory.assetTransactionType.Pay, transactionNumber: params.transactionNumber, agent: {
|
|
33
41
|
typeOf: params.transaction.seller.typeOf,
|
|
34
42
|
id: params.transaction.seller.id,
|
|
@@ -43,7 +51,7 @@ function creatPublishPaymentUrlParams(params) {
|
|
|
43
51
|
typeOf: params.transaction.seller.typeOf
|
|
44
52
|
}, object }, (typeof ((_d = params.location) === null || _d === void 0 ? void 0 : _d.typeOf) === 'string')
|
|
45
53
|
? { location: params.location }
|
|
46
|
-
: undefined), { instrument
|
|
54
|
+
: undefined), { instrument }), (typeof params.identifier === 'string')
|
|
47
55
|
? { identifier: params.identifier }
|
|
48
56
|
: undefined);
|
|
49
57
|
}
|
|
@@ -71,7 +79,8 @@ function creatPayTransactionStartParams(params) {
|
|
|
71
79
|
const instrument = [
|
|
72
80
|
{ id: params.action.id, typeOf: params.action.typeOf },
|
|
73
81
|
{ orderNumber, typeOf: factory.order.OrderType.Order },
|
|
74
|
-
...(ticketAsInstrument !== undefined) ? [ticketAsInstrument] : [] // add ticketAsInstrument(2025-11-25~)
|
|
82
|
+
...(ticketAsInstrument !== undefined) ? [ticketAsInstrument] : [], // add ticketAsInstrument(2025-11-25~)
|
|
83
|
+
...(Array.isArray(params.instrument)) ? params.instrument : [] // instrumentを対応決済方法オファーに対応(2025-12-14~)
|
|
75
84
|
];
|
|
76
85
|
return Object.assign({ project: { id: params.transaction.project.id, typeOf: factory.organizationType.Project }, typeOf: factory.assetTransactionType.Pay, transactionNumber: params.transactionNumber, agent: {
|
|
77
86
|
typeOf: params.transaction.seller.typeOf,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
2
|
import { Settings } from '../../settings';
|
|
3
|
+
import type { AcceptedPaymentMethodRepo } from '../../repo/acceptedPaymentMethod';
|
|
3
4
|
import type { AccountingReportRepo } from '../../repo/accountingReport';
|
|
4
5
|
import type { ActionRepo, IMinimizedPurchaseNumberAuthResult } from '../../repo/action';
|
|
5
6
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
@@ -79,6 +80,7 @@ declare function processVoidPayTransaction(params: factory.task.IData<factory.ta
|
|
|
79
80
|
transaction: TransactionRepo;
|
|
80
81
|
}) => Promise<void>;
|
|
81
82
|
interface IAuthorizeRepos {
|
|
83
|
+
acceptedPaymentMethod: AcceptedPaymentMethodRepo;
|
|
82
84
|
accountingReport: AccountingReportRepo;
|
|
83
85
|
action: ActionRepo;
|
|
84
86
|
assetTransaction: AssetTransactionRepo;
|
|
@@ -101,6 +103,7 @@ interface IAuthorizeRepos {
|
|
|
101
103
|
}
|
|
102
104
|
type IAuthorizeOperation<T> = (repos: IAuthorizeRepos, settings: Settings) => Promise<T>;
|
|
103
105
|
interface IPublishPaymentUrlRepos {
|
|
106
|
+
acceptedPaymentMethod: AcceptedPaymentMethodRepo;
|
|
104
107
|
action: ActionRepo;
|
|
105
108
|
assetTransaction: AssetTransactionRepo;
|
|
106
109
|
authorization: AuthorizationRepo;
|
|
@@ -143,6 +146,7 @@ declare function publishPaymentUrl(params: {
|
|
|
143
146
|
* add identifier for an unique index(2025-02-25~)
|
|
144
147
|
*/
|
|
145
148
|
identifier?: string;
|
|
149
|
+
instrument: factory.action.trade.pay.IAcceptedPaymentMethodOfferAsInstrument[];
|
|
146
150
|
}): IPublishPaymentUrlOperation<Pick<PayTransactionService.IPublishPaymentUrlResult, 'paymentMethodId' | 'paymentUrl'>>;
|
|
147
151
|
/**
|
|
148
152
|
* 決済承認
|
|
@@ -173,6 +177,10 @@ declare function authorize(params: {
|
|
|
173
177
|
*/
|
|
174
178
|
id: string;
|
|
175
179
|
};
|
|
180
|
+
/**
|
|
181
|
+
* ツールとしての対応決済方法オファー
|
|
182
|
+
*/
|
|
183
|
+
instrument: factory.action.trade.pay.IAcceptedPaymentMethodOfferAsInstrument[];
|
|
176
184
|
}): IAuthorizeOperation<{
|
|
177
185
|
/**
|
|
178
186
|
* 承認アクションID
|
|
@@ -366,7 +366,7 @@ function publishPaymentUrl(params) {
|
|
|
366
366
|
referencesOrder: (((_a = params.object.referencesOrder) === null || _a === void 0 ? void 0 : _a.typeOf) === factory.order.OrderType.Order)
|
|
367
367
|
? params.object.referencesOrder
|
|
368
368
|
: { typeOf: factory.order.OrderType.Order } });
|
|
369
|
-
const startParams = (0, factory_1.creatPublishPaymentUrlParams)(Object.assign(Object.assign({ object: authorizeObject, paymentServiceType, transaction: transaction, transactionNumber: transactionNumber, location: params.location }, (typeof params.identifier === 'string') ? { identifier: params.identifier } : undefined), (typeof ticketToken === 'string') ? { ticketToken } : undefined));
|
|
369
|
+
const startParams = (0, factory_1.creatPublishPaymentUrlParams)(Object.assign(Object.assign({ object: authorizeObject, paymentServiceType, transaction: transaction, transactionNumber: transactionNumber, location: params.location, instrument: params.instrument }, (typeof params.identifier === 'string') ? { identifier: params.identifier } : undefined), (typeof ticketToken === 'string') ? { ticketToken } : undefined));
|
|
370
370
|
const taskId = (_b = params.sameAs) === null || _b === void 0 ? void 0 : _b.id;
|
|
371
371
|
result = yield PayTransactionService.publishPaymentUrl(startParams, {
|
|
372
372
|
purposeAsTransaction: { id: transaction.id },
|
|
@@ -539,7 +539,8 @@ function authorize(params) {
|
|
|
539
539
|
// orderNumber required(2025-02-14~)
|
|
540
540
|
order: { confirmationNumber, orderNumber },
|
|
541
541
|
action: { id: action.id, typeOf: action.typeOf },
|
|
542
|
-
ticketToken
|
|
542
|
+
ticketToken,
|
|
543
|
+
instrument: params.instrument
|
|
543
544
|
});
|
|
544
545
|
payTransaction = yield PayTransactionService.start(startParams, Object.assign({
|
|
545
546
|
// useCheckByIdentifierIfNotYet: params.options.useCheckByIdentifierIfNotYet,
|
|
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.call = call;
|
|
13
13
|
const factory = require("../../factory");
|
|
14
|
+
const acceptedPaymentMethod_1 = require("../../repo/acceptedPaymentMethod");
|
|
14
15
|
const accountingReport_1 = require("../../repo/accountingReport");
|
|
15
16
|
const action_1 = require("../../repo/action");
|
|
16
17
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
@@ -52,8 +53,9 @@ function call(params) {
|
|
|
52
53
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
53
54
|
&& typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
|
|
54
55
|
try {
|
|
55
|
-
yield (0, any_1.authorize)(Object.assign(Object.assign({}, params.data), { sameAs: { id: params.id } // タスクIDを関連付け(2024-04-20~)
|
|
56
|
+
yield (0, any_1.authorize)(Object.assign(Object.assign({}, params.data), { instrument: (Array.isArray(params.data.instrument)) ? params.data.instrument : [], sameAs: { id: params.id } // タスクIDを関連付け(2024-04-20~)
|
|
56
57
|
}))({
|
|
58
|
+
acceptedPaymentMethod: new acceptedPaymentMethod_1.AcceptedPaymentMethodRepo(connection),
|
|
57
59
|
accountingReport: new accountingReport_1.AccountingReportRepo(connection),
|
|
58
60
|
action: actionRepo,
|
|
59
61
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ICreatingEvent4ttts } from '../../../../repo/event';
|
|
2
2
|
import type { ICustomerMember } from '../../../../repo/member';
|
|
3
3
|
import * as factory from '../../../../factory';
|
|
4
|
-
declare function tour2creatingEvent(tour: ITourBySchedule, movieTheater: Pick<factory.place.movieTheater.IPlace, 'id' | 'branchCode' | 'parentOrganization'>, screeningRoom:
|
|
4
|
+
declare function tour2creatingEvent(tour: ITourBySchedule, movieTheater: Pick<factory.place.movieTheater.IPlace, 'id' | 'branchCode' | 'parentOrganization'>, screeningRoom: Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'maximumAttendeeCapacity'>, existingApplicationMembers: {
|
|
5
5
|
member: ICustomerMember;
|
|
6
6
|
}[], maxValue: number, eventService: Pick<factory.product.IProduct, 'id' | 'name'> & {
|
|
7
7
|
id: string;
|
|
@@ -83,7 +83,7 @@ function tour2creatingEvent(tour, movieTheater, screeningRoom, existingApplicati
|
|
|
83
83
|
}, typeOf: factory.product.ProductType.EventService, availableChannel: {
|
|
84
84
|
typeOf: 'ServiceChannel',
|
|
85
85
|
serviceLocation: {
|
|
86
|
-
typeOf:
|
|
86
|
+
typeOf: factory.placeType.ScreeningRoom,
|
|
87
87
|
branchCode: screeningRoom.branchCode,
|
|
88
88
|
name: screeningRoom.name,
|
|
89
89
|
containedInPlace: Object.assign({ typeOf: screeningEventSeries.location.typeOf, id: screeningEventSeries.location.id, branchCode: screeningEventSeries.location.branchCode }, (screeningEventSeries.location.name !== undefined)
|
|
@@ -104,7 +104,7 @@ function tour2creatingEvent(tour, movieTheater, screeningRoom, existingApplicati
|
|
|
104
104
|
: undefined), (screeningEventSeries.headline !== undefined)
|
|
105
105
|
? { headline: screeningEventSeries.headline }
|
|
106
106
|
: undefined);
|
|
107
|
-
const location = Object.assign({ typeOf:
|
|
107
|
+
const location = Object.assign({ typeOf: factory.placeType.ScreeningRoom, branchCode: screeningRoom.branchCode, name: screeningRoom.name }, (screeningRoom.address !== undefined) ? { address: screeningRoom.address } : undefined);
|
|
108
108
|
return {
|
|
109
109
|
project: { id: project.id, typeOf: factory.organizationType.Project },
|
|
110
110
|
typeOf: factory.eventType.ScreeningEvent,
|
|
@@ -61,7 +61,7 @@ function schedule2relatedResources(schedule) {
|
|
|
61
61
|
if (movieTheater === undefined) {
|
|
62
62
|
throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
63
63
|
}
|
|
64
|
-
const screeningRoom = (yield repos.screeningRoom.
|
|
64
|
+
const screeningRoom = (yield repos.screeningRoom.findRooms({
|
|
65
65
|
limit: 1,
|
|
66
66
|
page: 1,
|
|
67
67
|
project: { id: { $eq: project.id } },
|
|
@@ -433,14 +433,14 @@ function createInformMovieTheaterTasks(params, setting) {
|
|
|
433
433
|
throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
434
434
|
}
|
|
435
435
|
// ルームを検索
|
|
436
|
-
const screeningRooms = yield repos.screeningRoom.
|
|
436
|
+
const screeningRooms = yield repos.screeningRoom.findRooms({
|
|
437
437
|
containedInPlace: { id: { $eq: movieTheater.id } }
|
|
438
438
|
});
|
|
439
439
|
const movieTheaters4inform = [Object.assign(Object.assign({}, movieTheater), { containsPlace: screeningRooms.map((room) => {
|
|
440
440
|
return {
|
|
441
441
|
branchCode: room.branchCode,
|
|
442
442
|
name: room.name,
|
|
443
|
-
typeOf:
|
|
443
|
+
typeOf: factory.placeType.ScreeningRoom,
|
|
444
444
|
additionalProperty: room.additionalProperty,
|
|
445
445
|
address: room.address
|
|
446
446
|
};
|
|
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.call = call;
|
|
13
13
|
const factory = require("../../factory");
|
|
14
|
+
const acceptedPaymentMethod_1 = require("../../repo/acceptedPaymentMethod");
|
|
14
15
|
const action_1 = require("../../repo/action");
|
|
15
16
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
16
17
|
const authorization_1 = require("../../repo/authorization");
|
|
@@ -41,7 +42,8 @@ function call(params) {
|
|
|
41
42
|
const actionRepo = new action_1.ActionRepo(connection);
|
|
42
43
|
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
43
44
|
try {
|
|
44
|
-
yield (0, any_1.publishPaymentUrl)(Object.assign(Object.assign({}, params.data), { sameAs: { id: params.id } }))({
|
|
45
|
+
yield (0, any_1.publishPaymentUrl)(Object.assign(Object.assign({}, params.data), { instrument: (Array.isArray(params.data.instrument)) ? params.data.instrument : [], sameAs: { id: params.id } }))({
|
|
46
|
+
acceptedPaymentMethod: new acceptedPaymentMethod_1.AcceptedPaymentMethodRepo(connection),
|
|
45
47
|
action: actionRepo,
|
|
46
48
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
47
49
|
authorization: new authorization_1.AuthorizationRepo(connection),
|
|
@@ -216,7 +216,7 @@ function syncEvents(params) {
|
|
|
216
216
|
throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
217
217
|
}
|
|
218
218
|
// console.log('movieTheater:', movieTheater);
|
|
219
|
-
const screeningRoom = (yield repos.screeningRoom.
|
|
219
|
+
const screeningRoom = (yield repos.screeningRoom.findRooms({
|
|
220
220
|
project: { id: { $eq: params.project.id } },
|
|
221
221
|
containedInPlace: { branchCode: { $eq: movieTheater.branchCode } },
|
|
222
222
|
branchCode: { $eq: roomCode }
|
|
@@ -3,7 +3,7 @@ export type IAcceptPayAction = Pick<factory.action.accept.pay.IAction, 'object'
|
|
|
3
3
|
export type IAuthorizeEventServiceOffer = factory.action.authorize.offer.eventService.IAction;
|
|
4
4
|
export type IAuthorizeProductOffer = factory.action.authorize.offer.product.IAction;
|
|
5
5
|
export type IAuthorizeMoneyTransferOffer = factory.action.authorize.offer.moneyTransfer.IAction;
|
|
6
|
-
export type IAuthorizePaymentAction = Pick<factory.action.authorize.paymentMethod.any.IAction, 'id' | 'result' | 'endDate'
|
|
7
|
-
object: Pick<factory.action.authorize.paymentMethod.any.IObject, 'typeOf'>;
|
|
6
|
+
export type IAuthorizePaymentAction = Pick<factory.action.authorize.paymentMethod.any.IAction, 'id' | 'result' | 'endDate'> & {
|
|
7
|
+
object: Pick<factory.action.authorize.paymentMethod.any.IObject, 'typeOf' | 'paymentMethodId'>;
|
|
8
8
|
};
|
|
9
9
|
export type IPayTransaction = Pick<factory.assetTransaction.pay.ITransaction, 'object'>;
|
|
@@ -47,7 +47,9 @@ function validateTransaction(transaction, acceptPayActions, authorizePaymentActi
|
|
|
47
47
|
// authorizeMovieTicketActions.forEach((a) => {
|
|
48
48
|
// authorizedMovieTickets.push(...(Array.isArray(a.object.movieTickets)) ? a.object.movieTickets : []);
|
|
49
49
|
// });
|
|
50
|
-
|
|
50
|
+
// 決済承認アクションのinstrument依存をobject依存へ変更(2025-12-14~)
|
|
51
|
+
const payTransactionNumbers = authorizeMovieTicketActions.map((authorizeAction) => authorizeAction.object.paymentMethodId);
|
|
52
|
+
// const payTransactionNumbers = authorizeMovieTicketActions.map(({ instrument }) => instrument.transactionNumber);
|
|
51
53
|
payTransactions.filter(({ object }) => payTransactionNumbers.includes(object.paymentMethodId))
|
|
52
54
|
.forEach(({ object }) => {
|
|
53
55
|
if (Array.isArray(object.paymentMethod.movieTickets)) {
|
|
@@ -106,7 +106,9 @@ function confirm(params, options) {
|
|
|
106
106
|
.filter(({ serialNumber }) => typeof serialNumber === 'string' && serialNumbers.includes(serialNumber));
|
|
107
107
|
// authorizePaymentActionsからpayTransactionsを参照(2024-06-20~)
|
|
108
108
|
let payTransactions = [];
|
|
109
|
-
|
|
109
|
+
// 決済承認アクションのinstrument依存をobject依存へ変更(2025-12-14~)
|
|
110
|
+
const payTransactionNumbers = authorizePaymentActions.map((authorizeAction) => authorizeAction.object.paymentMethodId);
|
|
111
|
+
// const payTransactionNumbers = authorizePaymentActions.map(({ instrument }) => instrument.transactionNumber);
|
|
110
112
|
if (payTransactionNumbers.length > 0) {
|
|
111
113
|
payTransactions = yield repos.assetTransaction.search({
|
|
112
114
|
typeOf: factory.assetTransactionType.Pay,
|
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": "5.4.0-alpha.
|
|
14
|
+
"@chevre/factory": "5.4.0-alpha.12",
|
|
15
15
|
"@cinerino/sdk": "12.12.1",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.4.0-alpha.1",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"description": "Chevre Domain Library for Node.js",
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@eslint/js": "9.16.0",
|
|
36
|
+
"@json2csv/plainjs": "7.0.6",
|
|
36
37
|
"@sendgrid/helpers": "8.0.0",
|
|
37
38
|
"@types/debug": "0.0.30",
|
|
38
39
|
"@types/google-libphonenumber": "^7.4.19",
|
|
@@ -115,5 +116,5 @@
|
|
|
115
116
|
"postversion": "git push origin --tags",
|
|
116
117
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
117
118
|
},
|
|
118
|
-
"version": "23.2.0-alpha.
|
|
119
|
+
"version": "23.2.0-alpha.20"
|
|
119
120
|
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* マスターデータ同期サービス
|
|
3
|
-
*/
|
|
4
|
-
import type * as COA from '@motionpicture/coa-service';
|
|
5
|
-
import type { ActionRepo } from '../repo/action';
|
|
6
|
-
import type { CategoryCodeRepo } from '../repo/categoryCode';
|
|
7
|
-
import type { CreativeWorkRepo } from '../repo/creativeWork';
|
|
8
|
-
import type { EventRepo } from '../repo/event';
|
|
9
|
-
import type { EventSeriesRepo } from '../repo/eventSeries';
|
|
10
|
-
import type { MovieTheaterRepo } from '../repo/place/movieTheater';
|
|
11
|
-
import type { ScreeningRoomRepo } from '../repo/place/screeningRoom';
|
|
12
|
-
import type { SellerRepo } from '../repo/seller';
|
|
13
|
-
import * as factory from '../factory';
|
|
14
|
-
interface IImportFromCOAParams {
|
|
15
|
-
project: {
|
|
16
|
-
id: string;
|
|
17
|
-
typeOf: factory.organizationType.Project;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* 施設コード
|
|
21
|
-
*/
|
|
22
|
-
locationBranchCode: string;
|
|
23
|
-
importFrom: Date;
|
|
24
|
-
importThrough: Date;
|
|
25
|
-
/**
|
|
26
|
-
* 施設を保管するかどうか
|
|
27
|
-
*/
|
|
28
|
-
saveMovieTheater: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* 施設コンテンツを保管するかどうか
|
|
31
|
-
*/
|
|
32
|
-
saveScreeningEventSeries: boolean;
|
|
33
|
-
saveScreeningEventSeriesPeriodInMonth: number;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* イベントをインポートする
|
|
37
|
-
*/
|
|
38
|
-
declare function importFromCOA(params: IImportFromCOAParams): (repos: {
|
|
39
|
-
action: ActionRepo;
|
|
40
|
-
categoryCode: CategoryCodeRepo;
|
|
41
|
-
creativeWork: CreativeWorkRepo;
|
|
42
|
-
event: EventRepo;
|
|
43
|
-
eventSeries: EventSeriesRepo;
|
|
44
|
-
movieTheater: MovieTheaterRepo;
|
|
45
|
-
screeningRoom: ScreeningRoomRepo;
|
|
46
|
-
seller: SellerRepo;
|
|
47
|
-
masterService: COA.service.Master;
|
|
48
|
-
}) => Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* COA情報からイベントIDを作成する
|
|
51
|
-
*/
|
|
52
|
-
declare function createScreeningEventIdFromCOA(params: {
|
|
53
|
-
theaterCode: string;
|
|
54
|
-
titleCode: string;
|
|
55
|
-
titleBranchNum: string;
|
|
56
|
-
dateJouei: string;
|
|
57
|
-
screenCode: string;
|
|
58
|
-
timeBegin: string;
|
|
59
|
-
}): string;
|
|
60
|
-
export { importFromCOA, createScreeningEventIdFromCOA };
|