@chevre/domain 21.9.0-alpha.8 → 21.9.0
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/searchAvaialbleAppliesToMovieTicketByOfferCatalogId.ts +4 -1
- package/example/src/chevre/searchEventTicketOffers.ts +1 -0
- package/example/src/chevre/searchOfferCatalogItemAvailability.ts +38 -0
- package/example/src/chevre/searchOfferCatalogItems.ts +41 -26
- package/example/src/chevre/searchOffers.ts +16 -4
- package/example/src/chevre/searchOffersByCatalog.ts +9 -3
- package/example/src/chevre/syncCatalogs2aggregateOffers.ts +23 -21
- package/lib/chevre/repo/aggregateOffer.d.ts +19 -3
- package/lib/chevre/repo/aggregateOffer.js +227 -27
- package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +45 -45
- package/lib/chevre/repo/offer.d.ts +21 -13
- package/lib/chevre/repo/offer.js +145 -58
- package/lib/chevre/repo/offerCatalog.d.ts +11 -3
- package/lib/chevre/repo/offerCatalog.js +30 -15
- package/lib/chevre/repo/offerCatalogItem.d.ts +20 -1
- package/lib/chevre/repo/offerCatalogItem.js +67 -23
- package/lib/chevre/repo/task.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve.js +1 -0
- package/lib/chevre/service/offer/event/authorize.js +1 -0
- package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +53 -7
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +127 -6
- package/lib/chevre/service/offer/event.d.ts +2 -2
- package/lib/chevre/service/offer/event.js +3 -1
- package/lib/chevre/service/offer/product/searchProductOffers.js +4 -3
- package/lib/chevre/service/offer/product.js +3 -30
- package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +3 -3
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.d.ts +20 -0
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +28 -0
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +15 -5
- package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.js +45 -33
- package/lib/chevre/service/task/onResourceUpdated.js +2 -2
- package/package.json +3 -3
|
@@ -4,6 +4,10 @@ export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, '
|
|
|
4
4
|
numberOfItems?: number;
|
|
5
5
|
itemListElementTypeOf: factory.offerType.Offer;
|
|
6
6
|
};
|
|
7
|
+
type KeyOfOfferCatalogItem = keyof factory.offerCatalog.IOfferCatalog;
|
|
8
|
+
type IProjection = {
|
|
9
|
+
[key in KeyOfOfferCatalogItem]?: 0 | 1;
|
|
10
|
+
};
|
|
7
11
|
/**
|
|
8
12
|
* オファーカタログアイテムリポジトリ
|
|
9
13
|
*/
|
|
@@ -20,7 +24,7 @@ export declare class MongoRepository {
|
|
|
20
24
|
dateSynced: Date;
|
|
21
25
|
}): Promise<void>;
|
|
22
26
|
count(params: Omit<factory.offerCatalog.ISearchConditions, 'limit' | 'page' | 'sort'>): Promise<number>;
|
|
23
|
-
search(params: factory.offerCatalog.ISearchConditions): Promise<IAggregatedOfferCatalog[]>;
|
|
27
|
+
search(params: factory.offerCatalog.ISearchConditions, projection: IProjection): Promise<IAggregatedOfferCatalog[]>;
|
|
24
28
|
findItemListElementById(params: {
|
|
25
29
|
id: string;
|
|
26
30
|
project: {
|
|
@@ -30,4 +34,19 @@ export declare class MongoRepository {
|
|
|
30
34
|
deleteById(params: {
|
|
31
35
|
id: string;
|
|
32
36
|
}): Promise<void>;
|
|
37
|
+
pullItemListElement(params: {
|
|
38
|
+
project: {
|
|
39
|
+
id: string;
|
|
40
|
+
};
|
|
41
|
+
$pull: {
|
|
42
|
+
itemListElement: {
|
|
43
|
+
$elemMatch: {
|
|
44
|
+
id: {
|
|
45
|
+
$in: string[];
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}): Promise<import("mongodb").UpdateResult | undefined>;
|
|
33
51
|
}
|
|
52
|
+
export {};
|
|
@@ -146,38 +146,61 @@ class MongoRepository {
|
|
|
146
146
|
return (result.length > 0) ? result[0].numItems : 0;
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
-
search(params) {
|
|
149
|
+
search(params, projection) {
|
|
150
150
|
var _a;
|
|
151
151
|
return __awaiter(this, void 0, void 0, function* () {
|
|
152
152
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
153
153
|
const matchStages = conditions.map((condition) => {
|
|
154
154
|
return { $match: condition };
|
|
155
155
|
});
|
|
156
|
+
let projectStage = {
|
|
157
|
+
_id: 0,
|
|
158
|
+
name: '$name',
|
|
159
|
+
description: '$description',
|
|
160
|
+
project: '$project',
|
|
161
|
+
typeOf: '$typeOf',
|
|
162
|
+
id: { $toString: '$_id' },
|
|
163
|
+
identifier: '$identifier',
|
|
164
|
+
itemOffered: '$itemOffered',
|
|
165
|
+
additionalProperty: '$additionalProperty',
|
|
166
|
+
relatedOffer: '$relatedOffer',
|
|
167
|
+
numberOfItems: {
|
|
168
|
+
$cond: {
|
|
169
|
+
if: { $isArray: '$itemListElement' },
|
|
170
|
+
then: { $size: '$itemListElement' },
|
|
171
|
+
else: 0
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
itemListElementTypeOf: { $first: '$itemListElement.typeOf' },
|
|
175
|
+
dateSynced: '$dateSynced'
|
|
176
|
+
};
|
|
177
|
+
const positiveProjectionFields = Object.keys(projection)
|
|
178
|
+
.filter((key) => projection[key] !== 0);
|
|
179
|
+
const negativeProjectionFields = Object.keys(projection)
|
|
180
|
+
.filter((key) => projection[key] === 0);
|
|
181
|
+
if (positiveProjectionFields.length > 0) {
|
|
182
|
+
projectStage = {
|
|
183
|
+
_id: 0,
|
|
184
|
+
id: { $toString: '$_id' }
|
|
185
|
+
};
|
|
186
|
+
positiveProjectionFields.forEach((field) => {
|
|
187
|
+
if (field !== '_id' && field !== 'id') {
|
|
188
|
+
projectStage[field] = `$${field}`;
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
else if (negativeProjectionFields.length > 0) {
|
|
193
|
+
negativeProjectionFields.forEach((field) => {
|
|
194
|
+
if (projectStage[field] !== undefined && projectStage[field] !== null) {
|
|
195
|
+
// tslint:disable-next-line:no-dynamic-delete
|
|
196
|
+
delete projectStage[field];
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
156
200
|
const aggregate = this.offerCatalogItemModel.aggregate([
|
|
157
201
|
...(((_a = params.sort) === null || _a === void 0 ? void 0 : _a.identifier) !== undefined) ? [{ $sort: { identifier: params.sort.identifier } }] : [],
|
|
158
202
|
...matchStages,
|
|
159
|
-
{
|
|
160
|
-
$project: {
|
|
161
|
-
_id: 0,
|
|
162
|
-
name: '$name',
|
|
163
|
-
description: '$description',
|
|
164
|
-
project: '$project',
|
|
165
|
-
typeOf: '$typeOf',
|
|
166
|
-
id: { $toString: '$_id' },
|
|
167
|
-
identifier: '$identifier',
|
|
168
|
-
itemOffered: '$itemOffered',
|
|
169
|
-
additionalProperty: '$additionalProperty',
|
|
170
|
-
relatedOffer: '$relatedOffer',
|
|
171
|
-
numberOfItems: {
|
|
172
|
-
$cond: {
|
|
173
|
-
if: { $isArray: '$itemListElement' },
|
|
174
|
-
then: { $size: '$itemListElement' },
|
|
175
|
-
else: 0
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
itemListElementTypeOf: { $first: '$itemListElement.typeOf' }
|
|
179
|
-
}
|
|
180
|
-
}
|
|
203
|
+
{ $project: projectStage }
|
|
181
204
|
]);
|
|
182
205
|
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
183
206
|
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
@@ -206,5 +229,26 @@ class MongoRepository {
|
|
|
206
229
|
.exec();
|
|
207
230
|
});
|
|
208
231
|
}
|
|
232
|
+
pullItemListElement(params) {
|
|
233
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
234
|
+
if (params.$pull.itemListElement.$elemMatch.id.$in.length === 0) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
return this.offerCatalogItemModel.updateMany({
|
|
238
|
+
'project.id': { $eq: params.project.id },
|
|
239
|
+
'itemListElement.id': {
|
|
240
|
+
$exists: true,
|
|
241
|
+
$in: params.$pull.itemListElement.$elemMatch.id.$in
|
|
242
|
+
}
|
|
243
|
+
}, {
|
|
244
|
+
$pull: {
|
|
245
|
+
itemListElement: {
|
|
246
|
+
id: { $in: params.$pull.itemListElement.$elemMatch.id.$in }
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
})
|
|
250
|
+
.exec();
|
|
251
|
+
});
|
|
252
|
+
}
|
|
209
253
|
}
|
|
210
254
|
exports.MongoRepository = MongoRepository;
|
|
@@ -74,7 +74,7 @@ export declare class MongoRepository {
|
|
|
74
74
|
*/
|
|
75
75
|
$nin?: factory.taskName[];
|
|
76
76
|
};
|
|
77
|
-
}): Promise<Pick<import("@chevre/factory/lib/task").ITask | import("@chevre/factory/lib/task/confirmMoneyTransfer").ITask | import("@chevre/factory/lib/task/confirmRegisterService").ITask | import("@chevre/factory/lib/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/task/createEvent").ITask | import("@chevre/factory/lib/task/deleteTransaction").ITask | import("@chevre/factory/lib/task/givePointAward").ITask | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").ITask | import("@chevre/factory/lib/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/task/onEventChanged").ITask | import("@chevre/factory/lib/task/onResourceUpdated").ITask | import("@chevre/factory/lib/task/onOrderPaymentCompleted").ITask | import("@chevre/factory/lib/task/placeOrder").ITask | import("@chevre/factory/lib/task/returnOrder").ITask | import("@chevre/factory/lib/task/returnMoneyTransfer").ITask | import("@chevre/factory/lib/task/returnPayTransaction").ITask | import("@chevre/factory/lib/task/returnPointAward").ITask | import("@chevre/factory/lib/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/task/sendEmailMessage").ITask | import("@chevre/factory/lib/task/sendOrder").ITask | import("@chevre/factory/lib/task/
|
|
77
|
+
}): Promise<Pick<import("@chevre/factory/lib/task").ITask | import("@chevre/factory/lib/task/confirmMoneyTransfer").ITask | import("@chevre/factory/lib/task/confirmRegisterService").ITask | import("@chevre/factory/lib/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/task/createEvent").ITask | import("@chevre/factory/lib/task/deleteTransaction").ITask | import("@chevre/factory/lib/task/givePointAward").ITask | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").ITask | import("@chevre/factory/lib/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/task/onEventChanged").ITask | import("@chevre/factory/lib/task/onResourceUpdated").ITask | import("@chevre/factory/lib/task/onOrderPaymentCompleted").ITask | import("@chevre/factory/lib/task/placeOrder").ITask | import("@chevre/factory/lib/task/returnOrder").ITask | import("@chevre/factory/lib/task/returnMoneyTransfer").ITask | import("@chevre/factory/lib/task/returnPayTransaction").ITask | import("@chevre/factory/lib/task/returnPointAward").ITask | import("@chevre/factory/lib/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/task/sendEmailMessage").ITask | import("@chevre/factory/lib/task/sendOrder").ITask | import("@chevre/factory/lib/task/syncScreeningRooms").ITask | import("@chevre/factory/lib/task/triggerWebhook").ITask | import("@chevre/factory/lib/task/useReservation").ITask | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").ITask | import("@chevre/factory/lib/task/voidPayTransaction").ITask | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/voidReserveTransaction").ITask, "id" | "name" | "status">[]>;
|
|
78
78
|
retry(params: {
|
|
79
79
|
intervalInMinutes: number;
|
|
80
80
|
}): Promise<void>;
|
|
@@ -118,6 +118,7 @@ function addReservations(params) {
|
|
|
118
118
|
event: { id: event.id },
|
|
119
119
|
// 対応アプリケーション条件追加(2023-01-27~)
|
|
120
120
|
store: { id: (_a = params.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.id },
|
|
121
|
+
priceSpecification: {},
|
|
121
122
|
onlyValid: true,
|
|
122
123
|
addSortIndex: false,
|
|
123
124
|
validateOfferRateLimit: true,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MongoRepository as EventRepo } from '../../../repo/event';
|
|
2
2
|
import { MongoRepository as OfferRepo } from '../../../repo/offer';
|
|
3
3
|
import { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
4
|
+
import { MongoRepository as OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
|
|
4
5
|
import { MongoRepository as PriceSpecificationRepo } from '../../../repo/priceSpecification';
|
|
5
6
|
import { MongoRepository as ProductRepo } from '../../../repo/product';
|
|
6
7
|
import { RedisRepository as OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
@@ -39,12 +40,7 @@ declare function searchEventTicketOffers(params: {
|
|
|
39
40
|
* 有効期間内のみかどうか
|
|
40
41
|
*/
|
|
41
42
|
onlyValid: boolean;
|
|
42
|
-
|
|
43
|
-
* どの決済方法に対して
|
|
44
|
-
*/
|
|
45
|
-
/**
|
|
46
|
-
* COAムビチケ券種もほしい場合に指定
|
|
47
|
-
*/
|
|
43
|
+
priceSpecification: Pick<factory.unitPriceOffer.IPriceSpecificationSearchConditions, 'appliesToMovieTicket'>;
|
|
48
44
|
limit?: number;
|
|
49
45
|
page?: number;
|
|
50
46
|
addSortIndex: boolean;
|
|
@@ -76,10 +72,60 @@ declare function searchOfferAppliesToMovieTicket(params: {
|
|
|
76
72
|
* 有効なオファーのみ対象とするか
|
|
77
73
|
*/
|
|
78
74
|
onlyValid?: boolean;
|
|
75
|
+
useIncludeInDataCatalog: boolean;
|
|
79
76
|
}): (repos: {
|
|
80
77
|
event: EventRepo;
|
|
81
78
|
offer: OfferRepo;
|
|
82
79
|
offerCatalog: OfferCatalogRepo;
|
|
83
80
|
product: ProductRepo;
|
|
84
81
|
}) => Promise<Pick<factory.priceSpecification.unitPrice.IAppliesToMovieTicket, 'serviceOutput'>[]>;
|
|
85
|
-
|
|
82
|
+
type ISearchOfferCatalogItemResult = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'additionalProperty' | 'relatedOffer'> & {
|
|
83
|
+
elementIndex: number;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* サブカタログ検索
|
|
87
|
+
*/
|
|
88
|
+
declare function searchOfferCatalogItems(params: {
|
|
89
|
+
event: {
|
|
90
|
+
/**
|
|
91
|
+
* イベントID
|
|
92
|
+
*/
|
|
93
|
+
id: string;
|
|
94
|
+
};
|
|
95
|
+
limit: number;
|
|
96
|
+
page: number;
|
|
97
|
+
}): (repos: {
|
|
98
|
+
event: EventRepo;
|
|
99
|
+
offerCatalog: OfferCatalogRepo;
|
|
100
|
+
offerCatalogItem: OfferCatalogItemRepo;
|
|
101
|
+
product: ProductRepo;
|
|
102
|
+
}) => Promise<ISearchOfferCatalogItemResult[]>;
|
|
103
|
+
interface ISearchOfferCatalogItemAvailabilityResult {
|
|
104
|
+
id: string;
|
|
105
|
+
isAvailable: boolean;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* サブカタログ利用可能性検索
|
|
109
|
+
*/
|
|
110
|
+
declare function searchOfferCatalogItemAvailability(params: {
|
|
111
|
+
event: {
|
|
112
|
+
/**
|
|
113
|
+
* イベントID
|
|
114
|
+
*/
|
|
115
|
+
id: string;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* どのアプリケーションに対して
|
|
119
|
+
*/
|
|
120
|
+
availableAtOrFrom: {
|
|
121
|
+
id: string;
|
|
122
|
+
};
|
|
123
|
+
limit: number;
|
|
124
|
+
page: number;
|
|
125
|
+
}): (repos: {
|
|
126
|
+
event: EventRepo;
|
|
127
|
+
offer: OfferRepo;
|
|
128
|
+
offerCatalog: OfferCatalogRepo;
|
|
129
|
+
product: ProductRepo;
|
|
130
|
+
}) => Promise<ISearchOfferCatalogItemAvailabilityResult[]>;
|
|
131
|
+
export { searchEventTicketOffers, searchOfferAppliesToMovieTicket, searchOfferCatalogItems, searchOfferCatalogItemAvailability };
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.searchOfferAppliesToMovieTicket = exports.searchEventTicketOffers = void 0;
|
|
12
|
+
exports.searchOfferCatalogItemAvailability = exports.searchOfferCatalogItems = exports.searchOfferAppliesToMovieTicket = exports.searchEventTicketOffers = void 0;
|
|
13
13
|
const moment = require("moment-timezone");
|
|
14
14
|
const factory = require("../../../factory");
|
|
15
15
|
const factory_1 = require("../factory");
|
|
@@ -45,6 +45,7 @@ function searchTicketOffersByItemOffered(params) {
|
|
|
45
45
|
availableAtOrFrom: { id: (_d = params.store) === null || _d === void 0 ? void 0 : _d.id },
|
|
46
46
|
unacceptedPaymentMethod: params.unacceptedPaymentMethod,
|
|
47
47
|
excludeAppliesToMovieTicket: params.excludeAppliesToMovieTicket,
|
|
48
|
+
priceSpecification: params.priceSpecification,
|
|
48
49
|
onlyValid: params.onlyValid === true,
|
|
49
50
|
useIncludeInDataCatalog: params.useIncludeInDataCatalog,
|
|
50
51
|
limit: params.limit,
|
|
@@ -57,15 +58,15 @@ function searchTicketOffersByItemOffered(params) {
|
|
|
57
58
|
if (!Array.isArray(params.ids)) {
|
|
58
59
|
throw new factory.errors.ArgumentNull('ids', 'ids must be specified');
|
|
59
60
|
}
|
|
60
|
-
const { offers } = yield repos.offer.
|
|
61
|
+
const { offers } = yield repos.offer.searchAllByIdsAndOfferCatalogId({
|
|
61
62
|
ids: params.ids,
|
|
62
63
|
subOfferCatalog: { id: subOfferCatalogId, isOfferCatalogItem },
|
|
63
64
|
availableAtOrFrom: { id: (_e = params.store) === null || _e === void 0 ? void 0 : _e.id },
|
|
64
65
|
unacceptedPaymentMethod: params.unacceptedPaymentMethod,
|
|
65
66
|
excludeAppliesToMovieTicket: params.excludeAppliesToMovieTicket,
|
|
66
|
-
onlyValid: params.onlyValid === true
|
|
67
|
-
limit: params.limit,
|
|
68
|
-
page: params.page
|
|
67
|
+
onlyValid: params.onlyValid === true
|
|
68
|
+
// limit: params.limit,
|
|
69
|
+
// page: params.page
|
|
69
70
|
});
|
|
70
71
|
return { availableOffers: offers };
|
|
71
72
|
}
|
|
@@ -115,6 +116,7 @@ function searchEventTicketOffersByEvent(params) {
|
|
|
115
116
|
onlyValid: params.onlyValid,
|
|
116
117
|
unacceptedPaymentMethod,
|
|
117
118
|
excludeAppliesToMovieTicket,
|
|
119
|
+
priceSpecification: params.priceSpecification,
|
|
118
120
|
withSortIndex: params.addSortIndex,
|
|
119
121
|
useIncludeInDataCatalog: params.useIncludeInDataCatalog
|
|
120
122
|
})(repos);
|
|
@@ -276,6 +278,7 @@ function searchEventTicketOffers(params) {
|
|
|
276
278
|
ids: params.ids,
|
|
277
279
|
event,
|
|
278
280
|
store: params.store,
|
|
281
|
+
priceSpecification: params.priceSpecification,
|
|
279
282
|
limit: params.limit,
|
|
280
283
|
page: params.page,
|
|
281
284
|
addSortIndex: params.addSortIndex,
|
|
@@ -330,19 +333,137 @@ function searchOfferAppliesToMovieTicket(params) {
|
|
|
330
333
|
}
|
|
331
334
|
// サブカタログIDを決定
|
|
332
335
|
let subOfferCatalogId = catalogId;
|
|
336
|
+
let isOfferCatalogItem = false;
|
|
333
337
|
const offerCatalogFirstElement = yield repos.offerCatalog.findFirstItemListElementById({ id: catalogId });
|
|
334
338
|
if (offerCatalogFirstElement.typeOf === 'OfferCatalog') {
|
|
335
339
|
subOfferCatalogId = offerCatalogFirstElement.id;
|
|
340
|
+
isOfferCatalogItem = true;
|
|
336
341
|
}
|
|
337
342
|
return repos.offer.searchAvaialbleAppliesToMovieTicketByOfferCatalogId({
|
|
338
|
-
subOfferCatalog: { id: subOfferCatalogId },
|
|
343
|
+
subOfferCatalog: { id: subOfferCatalogId, isOfferCatalogItem },
|
|
339
344
|
availableAtOrFrom: { id: (_c = params.store) === null || _c === void 0 ? void 0 : _c.id },
|
|
340
345
|
unacceptedPaymentMethod: unacceptedPaymentMethod,
|
|
341
346
|
excludeAppliesToMovieTicket: excludeAppliesToMovieTicket,
|
|
342
347
|
onlyValid: params.onlyValid === true,
|
|
348
|
+
useIncludeInDataCatalog: params.useIncludeInDataCatalog,
|
|
343
349
|
limit: params.limit,
|
|
344
350
|
page: params.page
|
|
345
351
|
});
|
|
346
352
|
});
|
|
347
353
|
}
|
|
348
354
|
exports.searchOfferAppliesToMovieTicket = searchOfferAppliesToMovieTicket;
|
|
355
|
+
/**
|
|
356
|
+
* サブカタログ検索
|
|
357
|
+
*/
|
|
358
|
+
function searchOfferCatalogItems(params) {
|
|
359
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
360
|
+
var _a, _b;
|
|
361
|
+
if (typeof params.limit !== 'number') {
|
|
362
|
+
throw new factory.errors.Argument('limit', 'must be number');
|
|
363
|
+
}
|
|
364
|
+
if (typeof params.page !== 'number') {
|
|
365
|
+
throw new factory.errors.Argument('page', 'must be number');
|
|
366
|
+
}
|
|
367
|
+
let offerCatalogItems = [];
|
|
368
|
+
const event = yield repos.event.findMinimizedIndividualEventById({ id: params.event.id });
|
|
369
|
+
// 興行設定があれば興行のカタログを参照する
|
|
370
|
+
const eventOffers = event.offers;
|
|
371
|
+
let catalogId;
|
|
372
|
+
if (typeof ((_a = eventOffers.itemOffered) === null || _a === void 0 ? void 0 : _a.id) === 'string') {
|
|
373
|
+
const eventService = yield repos.product.findById({ id: eventOffers.itemOffered.id }, ['hasOfferCatalog'], []);
|
|
374
|
+
if (typeof ((_b = eventService.hasOfferCatalog) === null || _b === void 0 ? void 0 : _b.id) === 'string') {
|
|
375
|
+
catalogId = eventService.hasOfferCatalog.id;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
if (typeof catalogId !== 'string') {
|
|
379
|
+
throw new factory.errors.NotFound('itemOffered.hasOfferCatalog');
|
|
380
|
+
}
|
|
381
|
+
const offerCatalogFirstElement = yield repos.offerCatalog.findFirstItemListElementById({ id: catalogId });
|
|
382
|
+
if (offerCatalogFirstElement.typeOf === 'OfferCatalog') {
|
|
383
|
+
const catalogItemListElements = yield repos.offerCatalog.searchItemListElementById({
|
|
384
|
+
id: catalogId,
|
|
385
|
+
limit: params.limit,
|
|
386
|
+
page: params.page
|
|
387
|
+
});
|
|
388
|
+
if (catalogItemListElements.length > 0) {
|
|
389
|
+
// サブカタログ検索
|
|
390
|
+
const searchOfferCatalogItemsResult = yield repos.offerCatalogItem.search({
|
|
391
|
+
id: { $in: catalogItemListElements.map((element) => element.id) }
|
|
392
|
+
}, {
|
|
393
|
+
id: 1,
|
|
394
|
+
name: 1,
|
|
395
|
+
description: 1,
|
|
396
|
+
additionalProperty: 1,
|
|
397
|
+
relatedOffer: 1
|
|
398
|
+
});
|
|
399
|
+
offerCatalogItems = catalogItemListElements.map((element) => {
|
|
400
|
+
const offerCatalogItem = searchOfferCatalogItemsResult.find((item) => item.id === element.id);
|
|
401
|
+
if (offerCatalogItem === undefined) {
|
|
402
|
+
throw new factory.errors.NotFound('OfferCatalog', `offerCatalogItem '${element.id}' not found`);
|
|
403
|
+
}
|
|
404
|
+
return Object.assign(Object.assign({}, element), offerCatalogItem);
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
// Offerによるカタログの場合はひとまずempty
|
|
410
|
+
}
|
|
411
|
+
return offerCatalogItems;
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
exports.searchOfferCatalogItems = searchOfferCatalogItems;
|
|
415
|
+
/**
|
|
416
|
+
* サブカタログ利用可能性検索
|
|
417
|
+
*/
|
|
418
|
+
function searchOfferCatalogItemAvailability(params) {
|
|
419
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
420
|
+
var _a, _b;
|
|
421
|
+
if (typeof params.limit !== 'number') {
|
|
422
|
+
throw new factory.errors.Argument('limit', 'must be number');
|
|
423
|
+
}
|
|
424
|
+
if (typeof params.page !== 'number') {
|
|
425
|
+
throw new factory.errors.Argument('page', 'must be number');
|
|
426
|
+
}
|
|
427
|
+
let availabilities = [];
|
|
428
|
+
const event = yield repos.event.findMinimizedIndividualEventById({ id: params.event.id });
|
|
429
|
+
// 興行設定があれば興行のカタログを参照する
|
|
430
|
+
const eventOffers = event.offers;
|
|
431
|
+
let catalogId;
|
|
432
|
+
if (typeof ((_a = eventOffers.itemOffered) === null || _a === void 0 ? void 0 : _a.id) === 'string') {
|
|
433
|
+
const eventService = yield repos.product.findById({ id: eventOffers.itemOffered.id }, ['hasOfferCatalog'], []);
|
|
434
|
+
if (typeof ((_b = eventService.hasOfferCatalog) === null || _b === void 0 ? void 0 : _b.id) === 'string') {
|
|
435
|
+
catalogId = eventService.hasOfferCatalog.id;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
if (typeof catalogId !== 'string') {
|
|
439
|
+
throw new factory.errors.NotFound('itemOffered.hasOfferCatalog');
|
|
440
|
+
}
|
|
441
|
+
const offerCatalogFirstElement = yield repos.offerCatalog.findFirstItemListElementById({ id: catalogId });
|
|
442
|
+
if (offerCatalogFirstElement.typeOf === 'OfferCatalog') {
|
|
443
|
+
const catalogItemListElements = yield repos.offerCatalog.searchItemListElementById({
|
|
444
|
+
id: catalogId,
|
|
445
|
+
limit: params.limit,
|
|
446
|
+
page: params.page
|
|
447
|
+
});
|
|
448
|
+
if (catalogItemListElements.length > 0) {
|
|
449
|
+
// 単価オファーから利用可能なサブカタログを検索
|
|
450
|
+
const availableCatalogs = yield repos.offer.searchAvailableCatalogs({
|
|
451
|
+
project: { id: event.project.id },
|
|
452
|
+
includedInDataCatalog: { id: catalogItemListElements.map((element) => element.id) },
|
|
453
|
+
availableAtOrFrom: { id: params.availableAtOrFrom.id }
|
|
454
|
+
});
|
|
455
|
+
availabilities = catalogItemListElements.map((element) => {
|
|
456
|
+
return {
|
|
457
|
+
id: element.id,
|
|
458
|
+
isAvailable: availableCatalogs.some((item) => item.id === element.id)
|
|
459
|
+
};
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
// Offerによるカタログの場合はひとまずempty
|
|
465
|
+
}
|
|
466
|
+
return availabilities;
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
exports.searchOfferCatalogItemAvailability = searchOfferCatalogItemAvailability;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { authorize } from './event/authorize';
|
|
2
2
|
import { cancel } from './event/cancel';
|
|
3
3
|
import { importCategoryCodesFromCOA, importFromCOA } from './event/importFromCOA';
|
|
4
|
-
import { searchEventTicketOffers, searchOfferAppliesToMovieTicket } from './event/searchEventTicketOffers';
|
|
4
|
+
import { searchEventTicketOffers, searchOfferAppliesToMovieTicket, searchOfferCatalogItemAvailability, searchOfferCatalogItems } from './event/searchEventTicketOffers';
|
|
5
5
|
import { voidTransaction } from './event/voidTransaction';
|
|
6
|
-
export { authorize, cancel, importCategoryCodesFromCOA, importFromCOA, voidTransaction, searchEventTicketOffers, searchOfferAppliesToMovieTicket };
|
|
6
|
+
export { authorize, cancel, importCategoryCodesFromCOA, importFromCOA, voidTransaction, searchEventTicketOffers, searchOfferAppliesToMovieTicket, searchOfferCatalogItemAvailability, searchOfferCatalogItems };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.searchOfferAppliesToMovieTicket = exports.searchEventTicketOffers = exports.voidTransaction = exports.importFromCOA = exports.importCategoryCodesFromCOA = exports.cancel = exports.authorize = void 0;
|
|
3
|
+
exports.searchOfferCatalogItems = exports.searchOfferCatalogItemAvailability = exports.searchOfferAppliesToMovieTicket = exports.searchEventTicketOffers = exports.voidTransaction = exports.importFromCOA = exports.importCategoryCodesFromCOA = exports.cancel = exports.authorize = void 0;
|
|
4
4
|
const authorize_1 = require("./event/authorize");
|
|
5
5
|
Object.defineProperty(exports, "authorize", { enumerable: true, get: function () { return authorize_1.authorize; } });
|
|
6
6
|
const cancel_1 = require("./event/cancel");
|
|
@@ -11,5 +11,7 @@ Object.defineProperty(exports, "importFromCOA", { enumerable: true, get: functio
|
|
|
11
11
|
const searchEventTicketOffers_1 = require("./event/searchEventTicketOffers");
|
|
12
12
|
Object.defineProperty(exports, "searchEventTicketOffers", { enumerable: true, get: function () { return searchEventTicketOffers_1.searchEventTicketOffers; } });
|
|
13
13
|
Object.defineProperty(exports, "searchOfferAppliesToMovieTicket", { enumerable: true, get: function () { return searchEventTicketOffers_1.searchOfferAppliesToMovieTicket; } });
|
|
14
|
+
Object.defineProperty(exports, "searchOfferCatalogItemAvailability", { enumerable: true, get: function () { return searchEventTicketOffers_1.searchOfferCatalogItemAvailability; } });
|
|
15
|
+
Object.defineProperty(exports, "searchOfferCatalogItems", { enumerable: true, get: function () { return searchEventTicketOffers_1.searchOfferCatalogItems; } });
|
|
14
16
|
const voidTransaction_1 = require("./event/voidTransaction");
|
|
15
17
|
Object.defineProperty(exports, "voidTransaction", { enumerable: true, get: function () { return voidTransaction_1.voidTransaction; } });
|
|
@@ -44,6 +44,7 @@ function searchProductOffers(params) {
|
|
|
44
44
|
// ids: params.ids,
|
|
45
45
|
subOfferCatalog: { id: subOfferCatalogId, isOfferCatalogItem },
|
|
46
46
|
excludeAppliesToMovieTicket: false,
|
|
47
|
+
priceSpecification: {},
|
|
47
48
|
limit: params.limit,
|
|
48
49
|
page: params.page,
|
|
49
50
|
onlyValid: params.onlyValid === true,
|
|
@@ -58,12 +59,12 @@ function searchProductOffers(params) {
|
|
|
58
59
|
if (!Array.isArray(params.ids)) {
|
|
59
60
|
throw new factory.errors.ArgumentNull('ids', 'ids must be specified');
|
|
60
61
|
}
|
|
61
|
-
const searchByOfferCatalogIdResult = yield repos.offer.
|
|
62
|
+
const searchByOfferCatalogIdResult = yield repos.offer.searchAllByIdsAndOfferCatalogId({
|
|
62
63
|
ids: params.ids,
|
|
63
64
|
subOfferCatalog: { id: subOfferCatalogId, isOfferCatalogItem },
|
|
64
65
|
excludeAppliesToMovieTicket: false,
|
|
65
|
-
limit: params.limit,
|
|
66
|
-
page: params.page,
|
|
66
|
+
// limit: params.limit,
|
|
67
|
+
// page: params.page,
|
|
67
68
|
onlyValid: params.onlyValid === true,
|
|
68
69
|
availableAtOrFrom: params.availableAt
|
|
69
70
|
});
|
|
@@ -19,7 +19,6 @@ const placeOrderInProgress_1 = require("../transaction/placeOrderInProgress");
|
|
|
19
19
|
const factory_1 = require("./product/factory");
|
|
20
20
|
const searchProductOffers_1 = require("./product/searchProductOffers");
|
|
21
21
|
exports.ERROR_MESSAGE_ALREADY_REGISTERED = 'Already registered';
|
|
22
|
-
// export { searchProductOffers };
|
|
23
22
|
/**
|
|
24
23
|
* プロダクトオファーを検索する
|
|
25
24
|
*/
|
|
@@ -60,43 +59,17 @@ function search(params) {
|
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
}
|
|
63
|
-
// let offers: factory.product.ITicketOffer[] = [];
|
|
64
62
|
const offers = yield (0, searchProductOffers_1.searchProductOffers)({
|
|
65
63
|
ids: params.ids,
|
|
66
64
|
itemOffered: { id: params.itemOffered.id },
|
|
67
65
|
availableAt: params.availableAt,
|
|
68
66
|
onlyValid: params.onlyValid,
|
|
69
67
|
addSortIndex: params.addSortIndex,
|
|
70
|
-
useIncludeInDataCatalog: params.useIncludeInDataCatalog
|
|
68
|
+
useIncludeInDataCatalog: params.useIncludeInDataCatalog,
|
|
69
|
+
limit: params.limit,
|
|
70
|
+
page: params.page
|
|
71
71
|
})(repos);
|
|
72
72
|
return { offers, product };
|
|
73
|
-
// Mongoへ移行(2023-03-01~)
|
|
74
|
-
// 店舗条件によって対象を絞る
|
|
75
|
-
// const storeId = params.availableAt?.id;
|
|
76
|
-
// if (typeof storeId === 'string') {
|
|
77
|
-
// // アプリケーションが利用可能なオファーに絞る
|
|
78
|
-
// offers = offers.filter((o) => {
|
|
79
|
-
// return Array.isArray(o.availableAtOrFrom)
|
|
80
|
-
// && o.availableAtOrFrom.some((availableApplication) => availableApplication.id === storeId);
|
|
81
|
-
// });
|
|
82
|
-
// }
|
|
83
|
-
// Mongoへ移行(2023-03-01~)
|
|
84
|
-
// 有効期間を適用
|
|
85
|
-
// if (params.onlyValid === true) {
|
|
86
|
-
// offers = offers.filter((o) => {
|
|
87
|
-
// let isValid = true;
|
|
88
|
-
// if (o.validFrom !== undefined && moment(o.validFrom)
|
|
89
|
-
// .isAfter(now)) {
|
|
90
|
-
// isValid = false;
|
|
91
|
-
// }
|
|
92
|
-
// if (o.validThrough !== undefined && moment(o.validThrough)
|
|
93
|
-
// .isBefore(now)) {
|
|
94
|
-
// isValid = false;
|
|
95
|
-
// }
|
|
96
|
-
// return isValid;
|
|
97
|
-
// });
|
|
98
|
-
// }
|
|
99
|
-
// return offers;
|
|
100
73
|
});
|
|
101
74
|
}
|
|
102
75
|
exports.search = search;
|
|
@@ -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").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/
|
|
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/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").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/
|
|
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/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").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/
|
|
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/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 {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as factory from '../../../factory';
|
|
2
|
+
import { MongoRepository as AggregateOfferRepo } from '../../../repo/aggregateOffer';
|
|
3
|
+
import { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
4
|
+
import { MongoRepository as OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
|
|
5
|
+
/**
|
|
6
|
+
* オファーカタログ変更時処理
|
|
7
|
+
*/
|
|
8
|
+
export declare function onOfferCatalogUpdated(params: {
|
|
9
|
+
project: {
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
ids: string[];
|
|
13
|
+
typeOf: factory.task.onResourceUpdated.OfferCatalogType;
|
|
14
|
+
isDeleted: boolean;
|
|
15
|
+
isOfferCatalogItem: boolean;
|
|
16
|
+
}): (repos: {
|
|
17
|
+
aggregateOffer: AggregateOfferRepo;
|
|
18
|
+
offerCatalog: OfferCatalogRepo;
|
|
19
|
+
offerCatalogItem: OfferCatalogItemRepo;
|
|
20
|
+
}) => Promise<void>;
|