@chevre/domain 21.8.0-alpha.61 → 21.8.0-alpha.63
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/searchEventTicketOffers.ts +2 -2
- package/example/src/chevre/searchEvents.ts +2 -2
- package/example/src/chevre/searchOffersByCatalog.ts +4 -4
- package/lib/chevre/repo/offer.d.ts +18 -35
- package/lib/chevre/repo/offer.js +179 -941
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +3 -41
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +2 -40
- package/lib/chevre/service/aggregation/event/findEventOffers.d.ts +14 -0
- package/lib/chevre/service/aggregation/event/findEventOffers.js +51 -0
- package/lib/chevre/service/assetTransaction/registerService.js +2 -1
- package/lib/chevre/service/assetTransaction/reserve.js +3 -2
- package/lib/chevre/service/offer/event/authorize.js +2 -1
- package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +1 -0
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +15 -8
- package/lib/chevre/service/offer/product/searchProductOffers.d.ts +1 -0
- package/lib/chevre/service/offer/product/searchProductOffers.js +12 -5
- package/lib/chevre/service/offer/product.d.ts +1 -0
- package/lib/chevre/service/offer/product.js +3 -2
- package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +3 -3
- package/lib/chevre/settings.d.ts +0 -2
- package/lib/chevre/settings.js +1 -3
- package/package.json +1 -1
- /package/example/src/chevre/{migrateAggregateOffers.ts → syncCatalogs2aggregateOffers.ts} +0 -0
|
@@ -18,6 +18,7 @@ const moment = require("moment-timezone");
|
|
|
18
18
|
const event_1 = require("../../../repo/event");
|
|
19
19
|
const factory = require("../../../factory");
|
|
20
20
|
const settings_1 = require("../../../settings");
|
|
21
|
+
const findEventOffers_1 = require("./findEventOffers");
|
|
21
22
|
const debug = createDebug('chevre-domain:service');
|
|
22
23
|
/**
|
|
23
24
|
* イベントデータをID指定で集計する
|
|
@@ -31,7 +32,7 @@ function aggregateScreeningEvent(params) {
|
|
|
31
32
|
let aggregatingEvents = [event];
|
|
32
33
|
// プロジェクト限定(2023-02-22~)
|
|
33
34
|
if (settings_1.settings.useOfferRateLimitProjects.includes(event.project.id)) {
|
|
34
|
-
const availableOffers = yield
|
|
35
|
+
const availableOffers = yield (0, findEventOffers_1.findEventOffers)({ event })(repos);
|
|
35
36
|
const offerRateLimitExists = availableOffers.some((o) => { var _a; return typeof ((_a = o.validRateLimit) === null || _a === void 0 ? void 0 : _a.scope) === 'string'; });
|
|
36
37
|
if (offerRateLimitExists) {
|
|
37
38
|
// 同location、かつ同時間帯、のイベントに関しても集計する(ttts暫定対応)
|
|
@@ -133,7 +134,7 @@ function aggregateOfferByEvent(params) {
|
|
|
133
134
|
var _a, _b, _c;
|
|
134
135
|
// プロジェクト限定(2023-02-22~)
|
|
135
136
|
if (settings_1.settings.useAggregateOfferProjects.includes(params.event.project.id)) {
|
|
136
|
-
const availableOffers = yield
|
|
137
|
+
const availableOffers = yield (0, findEventOffers_1.findEventOffers)(params)(repos);
|
|
137
138
|
// オファーごとの予約集計
|
|
138
139
|
const offersWithAggregateReservation = [];
|
|
139
140
|
for (const o of availableOffers) {
|
|
@@ -163,45 +164,6 @@ function aggregateOfferByEvent(params) {
|
|
|
163
164
|
}
|
|
164
165
|
});
|
|
165
166
|
}
|
|
166
|
-
/**
|
|
167
|
-
* イベントオファー検索
|
|
168
|
-
* NotFoundエラーをハンドリングする
|
|
169
|
-
*/
|
|
170
|
-
function findOffers(params) {
|
|
171
|
-
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
172
|
-
var _a, _b;
|
|
173
|
-
let availableOffers = [];
|
|
174
|
-
try {
|
|
175
|
-
// 興行設定があれば興行のカタログを参照する(2022-08-31~)
|
|
176
|
-
const eventOffers = params.event.offers;
|
|
177
|
-
if (typeof ((_a = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.itemOffered) === null || _a === void 0 ? void 0 : _a.id) === 'string') {
|
|
178
|
-
const eventService = yield repos.product.findById({ id: eventOffers.itemOffered.id }, ['hasOfferCatalog'], []);
|
|
179
|
-
if (typeof ((_b = eventService.hasOfferCatalog) === null || _b === void 0 ? void 0 : _b.id) === 'string') {
|
|
180
|
-
const { offers } = yield repos.offer.searchByOfferCatalogId({
|
|
181
|
-
offerCatalog: { id: eventService.hasOfferCatalog.id },
|
|
182
|
-
excludeAppliesToMovieTicket: false
|
|
183
|
-
// sort: false // ソート不要(2023-01-27~) // 完全廃止(2023-09-04~)
|
|
184
|
-
});
|
|
185
|
-
availableOffers = offers;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
throw new factory.errors.NotFound('event.offers.itemOffered.id');
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
catch (error) {
|
|
193
|
-
let throwsError = true;
|
|
194
|
-
// 万が一カタログが見つからない場合に対応
|
|
195
|
-
if (error instanceof factory.errors.NotFound) {
|
|
196
|
-
throwsError = false;
|
|
197
|
-
}
|
|
198
|
-
if (throwsError) {
|
|
199
|
-
throw error;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
return availableOffers;
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
167
|
function calculateOfferCount(params) {
|
|
206
168
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
207
169
|
var _a, _b, _c;
|
|
@@ -15,6 +15,7 @@ exports.aggregateUseActionsOnEvent = void 0;
|
|
|
15
15
|
*/
|
|
16
16
|
const createDebug = require("debug");
|
|
17
17
|
const factory = require("../../../factory");
|
|
18
|
+
const findEventOffers_1 = require("./findEventOffers");
|
|
18
19
|
const debug = createDebug('chevre-domain:service');
|
|
19
20
|
function aggregateUseActionsOnEvent(params) {
|
|
20
21
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -88,45 +89,6 @@ function findEntranceGates(params) {
|
|
|
88
89
|
return movieTheater === null || movieTheater === void 0 ? void 0 : movieTheater.hasEntranceGate;
|
|
89
90
|
});
|
|
90
91
|
}
|
|
91
|
-
/**
|
|
92
|
-
* イベントオファー検索
|
|
93
|
-
* NotFoundエラーをハンドリングする
|
|
94
|
-
*/
|
|
95
|
-
function findOffers(params) {
|
|
96
|
-
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
97
|
-
var _a, _b;
|
|
98
|
-
let availableOffers = [];
|
|
99
|
-
try {
|
|
100
|
-
// 興行設定があれば興行のカタログを参照する(2022-08-31~)
|
|
101
|
-
const eventOffers = params.event.offers;
|
|
102
|
-
if (typeof ((_a = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.itemOffered) === null || _a === void 0 ? void 0 : _a.id) === 'string') {
|
|
103
|
-
const eventService = yield repos.product.findById({ id: eventOffers.itemOffered.id }, ['hasOfferCatalog'], []);
|
|
104
|
-
if (typeof ((_b = eventService.hasOfferCatalog) === null || _b === void 0 ? void 0 : _b.id) === 'string') {
|
|
105
|
-
const { offers } = yield repos.offer.searchByOfferCatalogId({
|
|
106
|
-
offerCatalog: { id: eventService.hasOfferCatalog.id },
|
|
107
|
-
excludeAppliesToMovieTicket: false
|
|
108
|
-
// sort: false // ソート不要(2023-01-27~) // 完全廃止(2023-09-04~)
|
|
109
|
-
});
|
|
110
|
-
availableOffers = offers;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
throw new factory.errors.NotFound('event.offers.itemOffered.id');
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
catch (error) {
|
|
118
|
-
let throwsError = true;
|
|
119
|
-
// 万が一カタログが見つからない場合に対応
|
|
120
|
-
if (error instanceof factory.errors.NotFound) {
|
|
121
|
-
throwsError = false;
|
|
122
|
-
}
|
|
123
|
-
if (throwsError) {
|
|
124
|
-
throw error;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return availableOffers;
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
92
|
/**
|
|
131
93
|
* 入場ゲートごとに集計する
|
|
132
94
|
*/
|
|
@@ -135,7 +97,7 @@ function aggregateEntranceGateByEvent(params) {
|
|
|
135
97
|
// 入場ゲートの予約使用アクション集計
|
|
136
98
|
const places = [];
|
|
137
99
|
if (Array.isArray(params.entranceGates) && params.entranceGates.length > 0) {
|
|
138
|
-
const availableOffers = yield
|
|
100
|
+
const availableOffers = yield (0, findEventOffers_1.findEventOffers)(params)(repos);
|
|
139
101
|
// 念のため、identifierの存在する入場ゲートに絞る
|
|
140
102
|
const entranceGates = params.entranceGates.filter((e) => {
|
|
141
103
|
return typeof e.identifier === 'string' && e.identifier.length > 0;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IMinimizedIndividualEvent } from '../../../repo/event';
|
|
2
|
+
import { MongoRepository as OfferRepo } from '../../../repo/offer';
|
|
3
|
+
import { MongoRepository as ProductRepo } from '../../../repo/product';
|
|
4
|
+
import * as factory from '../../../factory';
|
|
5
|
+
/**
|
|
6
|
+
* イベントオファー検索
|
|
7
|
+
* NotFoundエラーをハンドリングする
|
|
8
|
+
*/
|
|
9
|
+
export declare function findEventOffers(params: {
|
|
10
|
+
event: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent> | IMinimizedIndividualEvent<factory.eventType.Event>;
|
|
11
|
+
}): (repos: {
|
|
12
|
+
product: ProductRepo;
|
|
13
|
+
offer: OfferRepo;
|
|
14
|
+
}) => Promise<factory.unitPriceOffer.IUnitPriceOffer[]>;
|
|
@@ -0,0 +1,51 @@
|
|
|
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.findEventOffers = void 0;
|
|
13
|
+
const factory = require("../../../factory");
|
|
14
|
+
/**
|
|
15
|
+
* イベントオファー検索
|
|
16
|
+
* NotFoundエラーをハンドリングする
|
|
17
|
+
*/
|
|
18
|
+
function findEventOffers(params) {
|
|
19
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
let availableOffers = [];
|
|
22
|
+
try {
|
|
23
|
+
// 興行設定があれば興行のカタログを参照する
|
|
24
|
+
const eventOffers = params.event.offers;
|
|
25
|
+
if (typeof ((_a = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.itemOffered) === null || _a === void 0 ? void 0 : _a.id) === 'string') {
|
|
26
|
+
const eventService = yield repos.product.findById({ id: eventOffers.itemOffered.id }, ['hasOfferCatalog'], []);
|
|
27
|
+
if (typeof ((_b = eventService.hasOfferCatalog) === null || _b === void 0 ? void 0 : _b.id) === 'string') {
|
|
28
|
+
const { offers } = yield repos.offer.searchAllByOfferCatalogId({
|
|
29
|
+
offerCatalog: { id: eventService.hasOfferCatalog.id }
|
|
30
|
+
});
|
|
31
|
+
availableOffers = offers;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
throw new factory.errors.NotFound('event.offers.itemOffered.id');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
let throwsError = true;
|
|
40
|
+
// 万が一カタログが見つからない場合に対応
|
|
41
|
+
if (error instanceof factory.errors.NotFound) {
|
|
42
|
+
throwsError = false;
|
|
43
|
+
}
|
|
44
|
+
if (throwsError) {
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return availableOffers;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
exports.findEventOffers = findEventOffers;
|
|
@@ -94,7 +94,8 @@ function createTransactionObject(params) {
|
|
|
94
94
|
ids: params.acceptedOffers.map((o) => o.id),
|
|
95
95
|
itemOffered: { id: String(params.product.id) },
|
|
96
96
|
onlyValid: true,
|
|
97
|
-
addSortIndex: false
|
|
97
|
+
addSortIndex: false,
|
|
98
|
+
useIncludeInDataCatalog: false
|
|
98
99
|
})(repos);
|
|
99
100
|
const transactionObject = [];
|
|
100
101
|
for (const acceptedOffer of params.acceptedOffers) {
|
|
@@ -120,7 +120,8 @@ function addReservations(params) {
|
|
|
120
120
|
store: { id: (_a = params.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.id },
|
|
121
121
|
onlyValid: true,
|
|
122
122
|
addSortIndex: false,
|
|
123
|
-
validateOfferRateLimit: true
|
|
123
|
+
validateOfferRateLimit: true,
|
|
124
|
+
useIncludeInDataCatalog: false
|
|
124
125
|
})(repos);
|
|
125
126
|
ticketOffers = searchEventTicketOffersResult.ticketOffers;
|
|
126
127
|
availableOffers = searchEventTicketOffersResult.unitPriceOffers;
|
|
@@ -476,7 +477,7 @@ function searchAvailableAddOns(params) {
|
|
|
476
477
|
if (Array.isArray(params.ticketOffer.addOn)) {
|
|
477
478
|
const addOnProductIds = [...new Set(params.ticketOffer.addOn.map((o) => String(o.itemOffered.id)))];
|
|
478
479
|
for (const addOnProductId of addOnProductIds) {
|
|
479
|
-
const { offers, product } = yield OfferService.product.search(Object.assign({ ids: params.ids, project: { id: params.project.id }, itemOffered: { id: addOnProductId }, onlyValid: true, addSortIndex: false }, (typeof ((_a = params.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.id) === 'string')
|
|
480
|
+
const { offers, product } = yield OfferService.product.search(Object.assign({ ids: params.ids, project: { id: params.project.id }, itemOffered: { id: addOnProductId }, onlyValid: true, addSortIndex: false, useIncludeInDataCatalog: false }, (typeof ((_a = params.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.id) === 'string')
|
|
480
481
|
? { availableAt: { id: params.availableAtOrFrom.id } }
|
|
481
482
|
: undefined))(repos);
|
|
482
483
|
availableAddOns.push(...offers.map((o) => {
|
|
@@ -239,7 +239,8 @@ function validateAcceptedOffers(params) {
|
|
|
239
239
|
store: params.store,
|
|
240
240
|
onlyValid: true,
|
|
241
241
|
addSortIndex: false,
|
|
242
|
-
validateOfferRateLimit: true
|
|
242
|
+
validateOfferRateLimit: true,
|
|
243
|
+
useIncludeInDataCatalog: false
|
|
243
244
|
})(repos);
|
|
244
245
|
// 利用可能なチケットオファーであれば受け入れる
|
|
245
246
|
const acceptedOffers = (Array.isArray(acceptedOffersWithoutDetail))
|
|
@@ -47,6 +47,7 @@ declare function searchEventTicketOffers(params: {
|
|
|
47
47
|
page?: number;
|
|
48
48
|
addSortIndex: boolean;
|
|
49
49
|
validateOfferRateLimit: boolean;
|
|
50
|
+
useIncludeInDataCatalog: boolean;
|
|
50
51
|
}): ISearchEventTicketOffersOperation<{
|
|
51
52
|
ticketOffers: ITicketOfferWithSortIndex[];
|
|
52
53
|
unitPriceOffers: factory.unitPriceOffer.IUnitPriceOffer[];
|
|
@@ -27,32 +27,37 @@ function searchTicketOffersByItemOffered(params) {
|
|
|
27
27
|
throw new factory.errors.NotFound('itemOffered.hasOfferCatalog');
|
|
28
28
|
}
|
|
29
29
|
if (params.withSortIndex) {
|
|
30
|
+
// addSortIndexの場合はid指定廃止(2023-09-13~)
|
|
31
|
+
if (Array.isArray(params.ids)) {
|
|
32
|
+
throw new factory.errors.NotImplemented('id specification on addSortIndex not implemented');
|
|
33
|
+
}
|
|
30
34
|
const { offers, sortedOfferIds } = yield repos.offer.searchByOfferCatalogIdWithSortIndex({
|
|
31
|
-
ids: params.ids,
|
|
35
|
+
// ids: params.ids,
|
|
32
36
|
offerCatalog: { id: catalogId },
|
|
33
37
|
availableAtOrFrom: { id: (_d = params.store) === null || _d === void 0 ? void 0 : _d.id },
|
|
34
38
|
unacceptedPaymentMethod: params.unacceptedPaymentMethod,
|
|
35
39
|
excludeAppliesToMovieTicket: params.excludeAppliesToMovieTicket,
|
|
36
40
|
onlyValid: params.onlyValid === true,
|
|
37
|
-
|
|
41
|
+
useIncludeInDataCatalog: params.useIncludeInDataCatalog,
|
|
38
42
|
limit: params.limit,
|
|
39
43
|
page: params.page
|
|
40
|
-
// sort: false // 完全廃止(2023-09-04~)
|
|
41
44
|
});
|
|
42
45
|
return { availableOffers: offers, sortedOfferIds };
|
|
43
46
|
}
|
|
44
47
|
else {
|
|
45
|
-
|
|
48
|
+
// addSortIndexの場合はid指定廃止(2023-09-13~)
|
|
49
|
+
if (!Array.isArray(params.ids)) {
|
|
50
|
+
throw new factory.errors.ArgumentNull('ids', 'ids must be specified');
|
|
51
|
+
}
|
|
52
|
+
const { offers } = yield repos.offer.searchByIdsAndOfferCatalogId({
|
|
46
53
|
ids: params.ids,
|
|
47
54
|
offerCatalog: { id: catalogId },
|
|
48
55
|
availableAtOrFrom: { id: (_e = params.store) === null || _e === void 0 ? void 0 : _e.id },
|
|
49
56
|
unacceptedPaymentMethod: params.unacceptedPaymentMethod,
|
|
50
57
|
excludeAppliesToMovieTicket: params.excludeAppliesToMovieTicket,
|
|
51
58
|
onlyValid: params.onlyValid === true,
|
|
52
|
-
// Mongoのpagingを利用するオプション(2023-02-21~)
|
|
53
59
|
limit: params.limit,
|
|
54
60
|
page: params.page
|
|
55
|
-
// sort: false // 完全廃止(2023-09-04~)
|
|
56
61
|
});
|
|
57
62
|
return { availableOffers: offers };
|
|
58
63
|
}
|
|
@@ -102,7 +107,8 @@ function searchEventTicketOffersByEvent(params) {
|
|
|
102
107
|
onlyValid: params.onlyValid,
|
|
103
108
|
unacceptedPaymentMethod,
|
|
104
109
|
excludeAppliesToMovieTicket,
|
|
105
|
-
withSortIndex: params.addSortIndex
|
|
110
|
+
withSortIndex: params.addSortIndex,
|
|
111
|
+
useIncludeInDataCatalog: params.useIncludeInDataCatalog
|
|
106
112
|
})(repos);
|
|
107
113
|
// 冗長な検索について最適化(2023-03-03~)
|
|
108
114
|
const { soundFormatChargeSpecs, videoFormatChargeSpecs, movieTicketTypeChargeSpecs } = yield searchPriceSpecs4event({
|
|
@@ -266,7 +272,8 @@ function searchEventTicketOffers(params) {
|
|
|
266
272
|
page: params.page,
|
|
267
273
|
addSortIndex: params.addSortIndex,
|
|
268
274
|
validateOfferRateLimit: params.validateOfferRateLimit,
|
|
269
|
-
onlyValid: params.onlyValid === true
|
|
275
|
+
onlyValid: params.onlyValid === true,
|
|
276
|
+
useIncludeInDataCatalog: params.useIncludeInDataCatalog
|
|
270
277
|
})(repos);
|
|
271
278
|
offers = searchOffersResult.ticketOffers;
|
|
272
279
|
unitPriceOffers = searchOffersResult.unitPriceOffers;
|
|
@@ -27,27 +27,34 @@ function searchProductOffers(params) {
|
|
|
27
27
|
let offers;
|
|
28
28
|
let sortedOfferIds;
|
|
29
29
|
if (params.addSortIndex) {
|
|
30
|
+
// addSortIndexの場合はid指定廃止(2023-09-13~)
|
|
31
|
+
if (Array.isArray(params.ids)) {
|
|
32
|
+
throw new factory.errors.NotImplemented('id specification on addSortIndex not implemented');
|
|
33
|
+
}
|
|
30
34
|
const searchByOfferCatalogIdResult = yield repos.offer.searchByOfferCatalogIdWithSortIndex({
|
|
31
|
-
ids: params.ids,
|
|
35
|
+
// ids: params.ids,
|
|
32
36
|
offerCatalog: { id: offerCatalogId },
|
|
33
37
|
excludeAppliesToMovieTicket: false,
|
|
34
38
|
limit: params.limit,
|
|
35
39
|
page: params.page,
|
|
36
|
-
// sort: false, // 完全廃止(2023-09-04~)
|
|
37
40
|
onlyValid: params.onlyValid === true,
|
|
38
|
-
availableAtOrFrom: params.availableAt
|
|
41
|
+
availableAtOrFrom: params.availableAt,
|
|
42
|
+
useIncludeInDataCatalog: params.useIncludeInDataCatalog
|
|
39
43
|
});
|
|
40
44
|
offers = searchByOfferCatalogIdResult.offers;
|
|
41
45
|
sortedOfferIds = searchByOfferCatalogIdResult.sortedOfferIds;
|
|
42
46
|
}
|
|
43
47
|
else {
|
|
44
|
-
|
|
48
|
+
// addSortIndexの場合はid指定廃止(2023-09-13~)
|
|
49
|
+
if (!Array.isArray(params.ids)) {
|
|
50
|
+
throw new factory.errors.ArgumentNull('ids', 'ids must be specified');
|
|
51
|
+
}
|
|
52
|
+
const searchByOfferCatalogIdResult = yield repos.offer.searchByIdsAndOfferCatalogId({
|
|
45
53
|
ids: params.ids,
|
|
46
54
|
offerCatalog: { id: offerCatalogId },
|
|
47
55
|
excludeAppliesToMovieTicket: false,
|
|
48
56
|
limit: params.limit,
|
|
49
57
|
page: params.page,
|
|
50
|
-
// sort: false, // 完全廃止(2023-09-04~)
|
|
51
58
|
onlyValid: params.onlyValid === true,
|
|
52
59
|
availableAtOrFrom: params.availableAt
|
|
53
60
|
});
|
|
@@ -66,7 +66,8 @@ function search(params) {
|
|
|
66
66
|
itemOffered: { id: params.itemOffered.id },
|
|
67
67
|
availableAt: params.availableAt,
|
|
68
68
|
onlyValid: params.onlyValid,
|
|
69
|
-
addSortIndex: params.addSortIndex
|
|
69
|
+
addSortIndex: params.addSortIndex,
|
|
70
|
+
useIncludeInDataCatalog: params.useIncludeInDataCatalog
|
|
70
71
|
})(repos);
|
|
71
72
|
return { offers, product };
|
|
72
73
|
// Mongoへ移行(2023-03-01~)
|
|
@@ -211,7 +212,7 @@ function fixProductAndOffers(params) {
|
|
|
211
212
|
if (product === undefined) {
|
|
212
213
|
throw new factory.errors.NotFound('Product');
|
|
213
214
|
}
|
|
214
|
-
const { offers } = yield search(Object.assign({ ids: params.object.map((o) => String(o.id)), project: { id: params.project.id }, itemOffered: { id: String(product.id) }, onlyValid: true, addSortIndex: false }, (typeof ((_c = params.location) === null || _c === void 0 ? void 0 : _c.id) === 'string') ? { availableAt: { id: params.location.id } } : undefined))(repos);
|
|
215
|
+
const { offers } = yield search(Object.assign({ ids: params.object.map((o) => String(o.id)), project: { id: params.project.id }, itemOffered: { id: String(product.id) }, onlyValid: true, addSortIndex: false, useIncludeInDataCatalog: false }, (typeof ((_c = params.location) === null || _c === void 0 ? void 0 : _c.id) === 'string') ? { availableAt: { id: params.location.id } } : undefined))(repos);
|
|
215
216
|
return { product, availableOffers: offers };
|
|
216
217
|
});
|
|
217
218
|
}
|
|
@@ -26,17 +26,17 @@ export type IExternalOrder = Pick<factory.order.IOrder, 'project' | 'typeOf' | '
|
|
|
26
26
|
*/
|
|
27
27
|
export declare function createOnOrderSentTasksByTransaction(params: {
|
|
28
28
|
potentialActions?: factory.action.transfer.send.order.IPotentialActions;
|
|
29
|
-
}): (import("@chevre/factory/lib/task
|
|
29
|
+
}): (import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task/createEvent").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/syncAggregateOffer").IAttributes | import("@chevre/factory/lib/task/syncScreeningRooms").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
|
|
30
30
|
/**
|
|
31
31
|
* 注文返品後のアクション
|
|
32
32
|
*/
|
|
33
33
|
export declare function createOnOrderReturnedTasksByTransaction(params: {
|
|
34
34
|
potentialActions?: factory.action.transfer.returnAction.order.IPotentialActions;
|
|
35
|
-
}): (import("@chevre/factory/lib/task
|
|
35
|
+
}): (import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task/createEvent").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/syncAggregateOffer").IAttributes | import("@chevre/factory/lib/task/syncScreeningRooms").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
|
|
36
36
|
/**
|
|
37
37
|
* 注文中止時のアクション
|
|
38
38
|
*/
|
|
39
39
|
export declare function createOnOrderCancelledTasksByTransaction(params: {
|
|
40
40
|
transaction?: factory.transaction.placeOrder.ITransaction;
|
|
41
|
-
}): (import("@chevre/factory/lib/task
|
|
41
|
+
}): (import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task/createEvent").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/syncAggregateOffer").IAttributes | import("@chevre/factory/lib/task/syncScreeningRooms").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
|
|
42
42
|
export {};
|
package/lib/chevre/settings.d.ts
CHANGED
|
@@ -42,8 +42,6 @@ export declare const USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT: boolean;
|
|
|
42
42
|
export declare const USE_DELETE_EVENT_BY_ORDER: boolean;
|
|
43
43
|
export declare const USE_ORDER_PAYMENT_DUE_ON_PLACED: boolean;
|
|
44
44
|
export declare const USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY: boolean;
|
|
45
|
-
export declare const USE_AGGREGATE_OFFERS_AS_PRIMARY: boolean;
|
|
46
|
-
export declare const USE_PROHIBIT_OFFERS_AS_PRIMARY: boolean;
|
|
47
45
|
export declare const USE_OPTIMIZE_TICKET_OFFER: boolean;
|
|
48
46
|
export declare const MONGO_MAX_TIME_MS: number;
|
|
49
47
|
/**
|
package/lib/chevre/settings.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.settings = exports.MONGO_MAX_TIME_MS = exports.USE_OPTIMIZE_TICKET_OFFER = exports.
|
|
3
|
+
exports.settings = exports.MONGO_MAX_TIME_MS = exports.USE_OPTIMIZE_TICKET_OFFER = exports.USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY = exports.USE_ORDER_PAYMENT_DUE_ON_PLACED = exports.USE_DELETE_EVENT_BY_ORDER = exports.USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT = exports.USE_ADVANCE_BOOKING_REQUIREMENT = exports.USE_NEW_EVENT_AVAILABILITY_KEY_FROM = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = exports.DEFAULT_TASKS_EXPORT_AGENT_NAME = exports.DEFAULT_SENDER_EMAIL = exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS = exports.TRANSACTION_CONFIRMED_STORAGE_PERIOD_IN_DAYS = exports.ASSET_TRANSACTION_STORAGE_PERIOD_IN_DAYS = exports.ABORTED_TASKS_WITHOUT_REPORT = exports.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS = exports.TRIGGER_WEBHOOK_MAX_RETRY_COUNT = void 0;
|
|
4
4
|
const moment = require("moment");
|
|
5
5
|
const factory = require("./factory");
|
|
6
6
|
const transactionWebhookUrls = (typeof process.env.INFORM_TRANSACTION_URL === 'string')
|
|
@@ -74,8 +74,6 @@ exports.USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT = process.env.USE_OBJECT_AS_PAY_TRA
|
|
|
74
74
|
exports.USE_DELETE_EVENT_BY_ORDER = process.env.USE_DELETE_EVENT_BY_ORDER === '1';
|
|
75
75
|
exports.USE_ORDER_PAYMENT_DUE_ON_PLACED = process.env.USE_ORDER_PAYMENT_DUE_ON_PLACED === '1';
|
|
76
76
|
exports.USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY = process.env.USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY === '1';
|
|
77
|
-
exports.USE_AGGREGATE_OFFERS_AS_PRIMARY = process.env.USE_AGGREGATE_OFFERS_AS_PRIMARY === '1';
|
|
78
|
-
exports.USE_PROHIBIT_OFFERS_AS_PRIMARY = process.env.USE_PROHIBIT_OFFERS_AS_PRIMARY === '1';
|
|
79
77
|
exports.USE_OPTIMIZE_TICKET_OFFER = process.env.USE_OPTIMIZE_TICKET_OFFER === '1';
|
|
80
78
|
exports.MONGO_MAX_TIME_MS = (typeof process.env.MONGO_MAX_TIME_MS === 'string')
|
|
81
79
|
? Number(process.env.MONGO_MAX_TIME_MS)
|
package/package.json
CHANGED
|
File without changes
|