@chevre/domain 21.9.0 → 21.11.0-alpha.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/README.md +4 -35
- package/example/src/chevre/createManyEventsIfNotExist.ts +2 -2
- package/example/src/chevre/offer/searchAllByIdsAndOfferCatalogId.ts +31 -0
- package/example/src/chevre/{searchEventTicketOffers.ts → offer/searchEventTicketOffers.ts} +2 -1
- package/example/src/chevre/{searchOffersByCatalog.ts → offer/searchOffersByCatalog.ts} +2 -3
- package/example/src/chevre/searchOrders.ts +18 -14
- package/lib/chevre/repo/offer.d.ts +9 -7
- package/lib/chevre/repo/offer.js +59 -24
- package/lib/chevre/repo/order.js +19 -11
- package/lib/chevre/service/assetTransaction/registerService.js +1 -0
- package/lib/chevre/service/assetTransaction/reserve.js +2 -1
- package/lib/chevre/service/offer/event/authorize.js +1 -0
- package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +3 -0
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +25 -14
- package/lib/chevre/service/offer/product/searchProductOffers.d.ts +3 -0
- package/lib/chevre/service/offer/product/searchProductOffers.js +20 -10
- package/lib/chevre/service/offer/product.d.ts +3 -0
- package/lib/chevre/service/offer/product.js +2 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
[](https://snyk.io/test/github/chevre-jp/domain)
|
|
7
7
|
[](https://nodei.co/npm/@chevre/domain/)
|
|
8
8
|
|
|
9
|
-
Node.js client library for using Chevre backend programming.
|
|
10
|
-
|
|
11
9
|
## Table of contents
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
- [Chevre Domain Library for Node.js](#chevre-domain-library-for-nodejs)
|
|
12
|
+
- [Table of contents](#table-of-contents)
|
|
13
|
+
- [Usage](#usage)
|
|
14
|
+
- [License](#license)
|
|
16
15
|
|
|
17
16
|
## Usage
|
|
18
17
|
|
|
@@ -20,36 +19,6 @@ Node.js client library for using Chevre backend programming.
|
|
|
20
19
|
npm install @chevre/domain
|
|
21
20
|
```
|
|
22
21
|
|
|
23
|
-
### Environment variables
|
|
24
|
-
|
|
25
|
-
| Name | Required | Value | Purpose |
|
|
26
|
-
| -------------------------------- | -------- | --------------- | ------------------------------ |
|
|
27
|
-
| `AWS_ACCESS_KEY_ID` | true | | AWS access key |
|
|
28
|
-
| `AWS_SECRET_ACCESS_KEY` | true | | AWS secret access key |
|
|
29
|
-
| `CHEVRE_AUTHORIZE_SERVER_DOMAIN` | true | | Chevre credentials |
|
|
30
|
-
| `CHEVRE_CLIENT_ID` | true | | Chevre credentials |
|
|
31
|
-
| `CHEVRE_CLIENT_SECRET` | true | | Chevre credentials |
|
|
32
|
-
| `CHEVRE_ENDPOINT` | true | | Chevre credentials |
|
|
33
|
-
| `CUSTOM_SEARCH_ENGINE_ID` | true | | Google Custom Search Engine ID |
|
|
34
|
-
| `COA_ENDPOINT` | true | | COA credentilas |
|
|
35
|
-
| `COA_REFRESH_TOKEN` | true | | credentilas |
|
|
36
|
-
| `DEBUG` | false | chevre-domain:* | Debug |
|
|
37
|
-
| `GOOGLE_API_KEY` | true | | Google API Key |
|
|
38
|
-
| `INFORM_ORDER_URL` | false | | Inform Order URLs |
|
|
39
|
-
| `INFORM_TRANSACTION_URL` | false | | Inform Transaction URLs |
|
|
40
|
-
| `LINE_NOTIFY_URL` | true | | LINE Notify URL |
|
|
41
|
-
| `LINE_NOTIFY_ACCESS_TOKEN` | true | | LINE Notify access token |
|
|
42
|
-
| `SENDGRID_API_KEY` | true | | SendGrid API key |
|
|
43
|
-
| `COA_TIMEOUT` | false | | Timeout settings |
|
|
44
|
-
| `GMO_TIMEOUT` | false | | Timeout settings |
|
|
45
|
-
| `MVTK_TIMEOUT` | false | | Timeout settings |
|
|
46
|
-
| `TRIGGER_WEBHOOK_TIMEOUT` | false | | Timeout settings |
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
## Code Samples
|
|
50
|
-
|
|
51
|
-
Code sample are [here](https://github.com/chevre-jp/domain/tree/master/example).
|
|
52
|
-
|
|
53
22
|
## License
|
|
54
23
|
|
|
55
24
|
ISC
|
|
@@ -92,7 +92,7 @@ async function main() {
|
|
|
92
92
|
.toDate(),
|
|
93
93
|
description: {
|
|
94
94
|
en: 'english description',
|
|
95
|
-
ja: '
|
|
95
|
+
ja: 'イベント説明'
|
|
96
96
|
},
|
|
97
97
|
headline: {
|
|
98
98
|
en: 'headlineheadlineheadlineheadlineheadlineheadlineheadline',
|
|
@@ -261,7 +261,7 @@ async function main() {
|
|
|
261
261
|
.toDate(),
|
|
262
262
|
description: {
|
|
263
263
|
en: 'english description',
|
|
264
|
-
ja: '
|
|
264
|
+
ja: 'イベント説明'
|
|
265
265
|
},
|
|
266
266
|
headline: {
|
|
267
267
|
en: 'headlineheadlineheadlineheadlineheadlineheadlineheadline',
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
// import * as redis from 'redis';
|
|
3
|
+
import * as mongoose from 'mongoose';
|
|
4
|
+
|
|
5
|
+
import { chevre } from '../../../../lib/index';
|
|
6
|
+
|
|
7
|
+
async function main() {
|
|
8
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
9
|
+
|
|
10
|
+
const offerRepo = new chevre.repository.Offer(mongoose.connection);
|
|
11
|
+
|
|
12
|
+
const offers = await offerRepo.searchAllByIdsAndOfferCatalogId({
|
|
13
|
+
ids: ['xx', 'xxx', '1001', '901'],
|
|
14
|
+
includedInDataCatalog: {
|
|
15
|
+
id: ['0001'],
|
|
16
|
+
isOfferCatalogItem: false
|
|
17
|
+
// id: ['6509262f69b07dde13c708eb', '6509262f69b07dde13c708ec', '6508dd91584bb60769914d2b', '651360e04df434b49114e4bb'],
|
|
18
|
+
// isOfferCatalogItem: true
|
|
19
|
+
},
|
|
20
|
+
excludeAppliesToMovieTicket: false
|
|
21
|
+
});
|
|
22
|
+
// console.log(offers);
|
|
23
|
+
console.log(offers.map((offer) => {
|
|
24
|
+
return `${offer.project?.id} ${offer.identifier} ${offer.priceSpecification?.price} ${offer.name?.ja} ${offer.id} ${offer.offerIndex}`;
|
|
25
|
+
}));
|
|
26
|
+
console.log(offers.length);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
main()
|
|
30
|
+
.then(console.log)
|
|
31
|
+
.catch(console.error);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as mongoose from 'mongoose';
|
|
3
3
|
import * as redis from 'redis';
|
|
4
4
|
|
|
5
|
-
import { chevre } from '
|
|
5
|
+
import { chevre } from '../../../../lib/index';
|
|
6
6
|
|
|
7
7
|
// const PROJECT_ID = process.env.PROJECT_ID;
|
|
8
8
|
|
|
@@ -28,6 +28,7 @@ async function main() {
|
|
|
28
28
|
const { ticketOffers } = await chevre.service.offer.event.searchEventTicketOffers({
|
|
29
29
|
event: { id: 'ale6qiedq' },
|
|
30
30
|
onlyValid: true,
|
|
31
|
+
includedInDataCatalog: { id: '' },
|
|
31
32
|
priceSpecification: {},
|
|
32
33
|
validateOfferRateLimit: true,
|
|
33
34
|
addSortIndex: true,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// import * as redis from 'redis';
|
|
3
3
|
import * as mongoose from 'mongoose';
|
|
4
4
|
|
|
5
|
-
import { chevre } from '
|
|
5
|
+
import { chevre } from '../../../../lib/index';
|
|
6
6
|
|
|
7
7
|
async function main() {
|
|
8
8
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
@@ -13,7 +13,7 @@ async function main() {
|
|
|
13
13
|
limit: 10,
|
|
14
14
|
page: 1,
|
|
15
15
|
// ids: ['xx', 'xxx', '1001', '901'],
|
|
16
|
-
|
|
16
|
+
offerCatalog: {
|
|
17
17
|
id: '0001',
|
|
18
18
|
isOfferCatalogItem: false
|
|
19
19
|
},
|
|
@@ -33,7 +33,6 @@ async function main() {
|
|
|
33
33
|
return `${offer.project?.id} ${offer.identifier} ${offer.priceSpecification?.price} ${offer.name?.ja} ${offer.id} ${offer.offerIndex} ${sortIndex}`;
|
|
34
34
|
}));
|
|
35
35
|
console.log(offers.length);
|
|
36
|
-
console.log('USE_AGGREGATE_OFFERS_AS_PRIMARY:', process.env.USE_AGGREGATE_OFFERS_AS_PRIMARY);
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
main()
|
|
@@ -6,27 +6,31 @@ import { chevre } from '../../../lib/index';
|
|
|
6
6
|
const project = { id: String(process.env.PROJECT_ID) };
|
|
7
7
|
|
|
8
8
|
async function main() {
|
|
9
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex:
|
|
9
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
10
10
|
|
|
11
11
|
const orderRepo = new chevre.repository.Order(mongoose.connection);
|
|
12
12
|
|
|
13
13
|
const orders = await orderRepo.search({
|
|
14
14
|
limit: 10,
|
|
15
15
|
project: { id: { $eq: project.id } },
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// $in: [
|
|
25
|
-
// { name: 'orderId', value: '0102022031518442020' },
|
|
26
|
-
// { name: 'orderId', value: '0102022031518423030' }
|
|
27
|
-
// ]
|
|
28
|
-
// }
|
|
16
|
+
acceptedOffers: {
|
|
17
|
+
// $size: 1
|
|
18
|
+
// itemOffered: {
|
|
19
|
+
// issuedThrough: { typeOf: { $eq: chevre.factory.product.ProductType.MembershipService } }
|
|
20
|
+
// }
|
|
21
|
+
},
|
|
22
|
+
orderedItem: {
|
|
23
|
+
$size: 3
|
|
29
24
|
}
|
|
25
|
+
// paymentMethods: {
|
|
26
|
+
// paymentMethod: { identifier: { $in: ['Cash'] } }
|
|
27
|
+
// additionalProperty: {
|
|
28
|
+
// $in: [
|
|
29
|
+
// { name: 'orderId', value: '0102022031518442020' },
|
|
30
|
+
// { name: 'orderId', value: '0102022031518423030' }
|
|
31
|
+
// ]
|
|
32
|
+
// }
|
|
33
|
+
// }
|
|
30
34
|
});
|
|
31
35
|
console.log('orders found', orders);
|
|
32
36
|
console.log(orders.length, 'orders found');
|
|
@@ -48,11 +48,11 @@ export declare class MongoRepository {
|
|
|
48
48
|
* 指定したIDの単価オファーだけ取得
|
|
49
49
|
*/
|
|
50
50
|
ids: string[];
|
|
51
|
-
|
|
51
|
+
includedInDataCatalog: {
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* オファー記載のカタログID(複数対応)
|
|
54
54
|
*/
|
|
55
|
-
id: string;
|
|
55
|
+
id: string[];
|
|
56
56
|
isOfferCatalogItem: boolean;
|
|
57
57
|
};
|
|
58
58
|
availableAtOrFrom?: {
|
|
@@ -62,15 +62,13 @@ export declare class MongoRepository {
|
|
|
62
62
|
excludeAppliesToMovieTicket: boolean;
|
|
63
63
|
onlyValid?: boolean;
|
|
64
64
|
projection?: IProjection;
|
|
65
|
-
}): Promise<
|
|
66
|
-
offers: IUnitPriceOfferFromAggregateOffer[];
|
|
67
|
-
}>;
|
|
65
|
+
}): Promise<IUnitPriceOfferFromAggregateOffer[]>;
|
|
68
66
|
/**
|
|
69
67
|
* カタログに含まれるオファーを検索する(カタログ内ソートは保証しない)
|
|
70
68
|
* カタログ内ソートインデックスはsortedOfferIdsで判断する
|
|
71
69
|
*/
|
|
72
70
|
searchByOfferCatalogIdWithSortIndex(params: {
|
|
73
|
-
|
|
71
|
+
offerCatalog: {
|
|
74
72
|
/**
|
|
75
73
|
* サブカタログID
|
|
76
74
|
*/
|
|
@@ -166,5 +164,9 @@ export declare class MongoRepository {
|
|
|
166
164
|
* サブカタログから集計オファーIDリストを検索する
|
|
167
165
|
*/
|
|
168
166
|
private searchAggregateOfferIdsBySubOfferCatalog;
|
|
167
|
+
/**
|
|
168
|
+
* 複数サブカタログから集計オファーIDリストを検索する
|
|
169
|
+
*/
|
|
170
|
+
private searchAggregateOfferIdsBySubOfferCatalogs;
|
|
169
171
|
}
|
|
170
172
|
export {};
|
package/lib/chevre/repo/offer.js
CHANGED
|
@@ -492,17 +492,17 @@ class MongoRepository {
|
|
|
492
492
|
if (aggregateOfferIds.length === 0) {
|
|
493
493
|
throw new factory.errors.NotFound(factory.offerType.AggregateOffer);
|
|
494
494
|
}
|
|
495
|
-
const
|
|
496
|
-
id: params.
|
|
497
|
-
isOfferCatalogItem: params.
|
|
495
|
+
const aggregateOfferIdsInDataCatalog = yield this.searchAggregateOfferIdsBySubOfferCatalogs({
|
|
496
|
+
id: params.includedInDataCatalog.id,
|
|
497
|
+
isOfferCatalogItem: params.includedInDataCatalog.isOfferCatalogItem,
|
|
498
498
|
itemListElementIds: aggregateOfferIds
|
|
499
499
|
});
|
|
500
500
|
let offers = [];
|
|
501
|
-
if (
|
|
502
|
-
debug('searchAllByIdsAndOfferCatalogId:searching offers...,
|
|
501
|
+
if (aggregateOfferIdsInDataCatalog.length > 0) {
|
|
502
|
+
debug('searchAllByIdsAndOfferCatalogId:searching offers...,aggregateOfferIdsInDataCatalog:', aggregateOfferIdsInDataCatalog, 'ids:', params.ids);
|
|
503
503
|
const searchOffersConditions = Object.assign({
|
|
504
504
|
// aggregateOffer.idで検索する(2023-09-09~)
|
|
505
|
-
parentOffer: { id: { $in:
|
|
505
|
+
parentOffer: { id: { $in: aggregateOfferIdsInDataCatalog } }, id: { $in: params.ids }, priceSpecification: {
|
|
506
506
|
appliesToMovieTicket: Object.assign(Object.assign({}, (Array.isArray(params.unacceptedPaymentMethod) && params.unacceptedPaymentMethod.length > 0)
|
|
507
507
|
? {
|
|
508
508
|
serviceOutput: {
|
|
@@ -516,17 +516,10 @@ class MongoRepository {
|
|
|
516
516
|
: undefined)
|
|
517
517
|
}, onlyValid: params.onlyValid === true }, (typeof ((_a = params.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.id) === 'string')
|
|
518
518
|
? { availableAtOrFrom: { id: { $eq: params.availableAtOrFrom.id } } } // store.idでのフィルターをmongoで処理(2023-01-27~)
|
|
519
|
-
: undefined
|
|
520
|
-
// ...(typeof params.limit === 'number' && typeof params.page === 'number')
|
|
521
|
-
// // 明示的なソート指定を調整(決して重複しない属性が相応)(2023-09-07~)
|
|
522
|
-
// ? { sort: { identifier: factory.sortType.Ascending } }
|
|
523
|
-
// : undefined,
|
|
524
|
-
// ...(typeof params.limit === 'number') ? { limit: params.limit } : undefined,
|
|
525
|
-
// ...(typeof params.page === 'number') ? { page: params.page } : undefined
|
|
526
|
-
);
|
|
519
|
+
: undefined);
|
|
527
520
|
offers = yield this.search(searchOffersConditions, params.projection);
|
|
528
521
|
}
|
|
529
|
-
return
|
|
522
|
+
return offers;
|
|
530
523
|
});
|
|
531
524
|
}
|
|
532
525
|
/**
|
|
@@ -537,8 +530,8 @@ class MongoRepository {
|
|
|
537
530
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
538
531
|
return __awaiter(this, void 0, void 0, function* () {
|
|
539
532
|
const sortedOfferIds = yield this.searchAggregateOfferIdsBySubOfferCatalog({
|
|
540
|
-
id: params.
|
|
541
|
-
isOfferCatalogItem: params.
|
|
533
|
+
id: params.offerCatalog.id,
|
|
534
|
+
isOfferCatalogItem: params.offerCatalog.isOfferCatalogItem
|
|
542
535
|
});
|
|
543
536
|
let offers = [];
|
|
544
537
|
if (sortedOfferIds.length > 0) {
|
|
@@ -562,7 +555,7 @@ class MongoRepository {
|
|
|
562
555
|
: undefined)
|
|
563
556
|
};
|
|
564
557
|
const searchOffersConditions = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ priceSpecification: priceSpecificationConditions, onlyValid: params.onlyValid === true }, (params.useIncludeInDataCatalog)
|
|
565
|
-
? { includedInDataCatalog: { id: { $in: [params.
|
|
558
|
+
? { includedInDataCatalog: { id: { $in: [params.offerCatalog.id] } } }
|
|
566
559
|
: { parentOffer: { id: { $in: sortedOfferIds } } }), (typeof ((_h = params.availableAtOrFrom) === null || _h === void 0 ? void 0 : _h.id) === 'string')
|
|
567
560
|
? { availableAtOrFrom: { id: { $eq: params.availableAtOrFrom.id } } } // store.idでのフィルターをmongoで処理(2023-01-27~)
|
|
568
561
|
: undefined), (typeof params.limit === 'number' && typeof params.page === 'number')
|
|
@@ -891,9 +884,6 @@ class MongoRepository {
|
|
|
891
884
|
let itemListElements;
|
|
892
885
|
if (params.isOfferCatalogItem) {
|
|
893
886
|
const matchStages = [{ $match: { _id: { $eq: new mongoose_1.Types.ObjectId(params.id) } } }]; // ObjectIdなので注意
|
|
894
|
-
if (Array.isArray(params.itemListElementIds)) {
|
|
895
|
-
matchStages.push({ $match: { 'itemListElement.id': { $exists: true, $in: params.itemListElementIds } } });
|
|
896
|
-
}
|
|
897
887
|
itemListElements = yield this.offerCatalogItemModel.aggregate([
|
|
898
888
|
{ $unwind: '$itemListElement' },
|
|
899
889
|
...matchStages,
|
|
@@ -908,9 +898,6 @@ class MongoRepository {
|
|
|
908
898
|
}
|
|
909
899
|
else {
|
|
910
900
|
const matchStages = [{ $match: { _id: { $eq: params.id } } }];
|
|
911
|
-
if (Array.isArray(params.itemListElementIds)) {
|
|
912
|
-
matchStages.push({ $match: { 'itemListElement.id': { $exists: true, $in: params.itemListElementIds } } });
|
|
913
|
-
}
|
|
914
901
|
itemListElements = yield this.offerCatalogModel.aggregate([
|
|
915
902
|
{ $unwind: '$itemListElement' },
|
|
916
903
|
...matchStages,
|
|
@@ -928,5 +915,53 @@ class MongoRepository {
|
|
|
928
915
|
: [];
|
|
929
916
|
});
|
|
930
917
|
}
|
|
918
|
+
/**
|
|
919
|
+
* 複数サブカタログから集計オファーIDリストを検索する
|
|
920
|
+
*/
|
|
921
|
+
searchAggregateOfferIdsBySubOfferCatalogs(params) {
|
|
922
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
923
|
+
if (!Array.isArray(params.itemListElementIds) || params.itemListElementIds.length === 0) {
|
|
924
|
+
throw new factory.errors.ArgumentNull('itemListElementIds');
|
|
925
|
+
}
|
|
926
|
+
let itemListElements;
|
|
927
|
+
if (params.isOfferCatalogItem) {
|
|
928
|
+
const matchStages = [
|
|
929
|
+
{ $match: { _id: { $in: params.id.map((id) => new mongoose_1.Types.ObjectId(id)) } } },
|
|
930
|
+
{ $match: { 'itemListElement.id': { $exists: true, $in: params.itemListElementIds } } }
|
|
931
|
+
];
|
|
932
|
+
itemListElements = yield this.offerCatalogItemModel.aggregate([
|
|
933
|
+
{ $unwind: '$itemListElement' },
|
|
934
|
+
...matchStages,
|
|
935
|
+
{
|
|
936
|
+
$group: { _id: '$itemListElement.id' }
|
|
937
|
+
}
|
|
938
|
+
])
|
|
939
|
+
.exec();
|
|
940
|
+
}
|
|
941
|
+
else {
|
|
942
|
+
// 1カタログしかありえないはず
|
|
943
|
+
if (params.id.length !== 1) {
|
|
944
|
+
throw new factory.errors.Argument('id', 'length must be 1');
|
|
945
|
+
}
|
|
946
|
+
const matchStages = [
|
|
947
|
+
{ $match: { _id: { $in: params.id } } },
|
|
948
|
+
{ $match: { 'itemListElement.id': { $exists: true, $in: params.itemListElementIds } } }
|
|
949
|
+
];
|
|
950
|
+
itemListElements = yield this.offerCatalogModel.aggregate([
|
|
951
|
+
{ $unwind: '$itemListElement' },
|
|
952
|
+
...matchStages,
|
|
953
|
+
{
|
|
954
|
+
$project: {
|
|
955
|
+
_id: '$itemListElement.id'
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
])
|
|
959
|
+
.exec();
|
|
960
|
+
}
|
|
961
|
+
return (Array.isArray(itemListElements))
|
|
962
|
+
? itemListElements.map((element) => element._id)
|
|
963
|
+
: [];
|
|
964
|
+
});
|
|
965
|
+
}
|
|
931
966
|
}
|
|
932
967
|
exports.MongoRepository = MongoRepository;
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -24,7 +24,7 @@ class MongoRepository {
|
|
|
24
24
|
}
|
|
25
25
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
26
26
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
27
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22;
|
|
27
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24;
|
|
28
28
|
const andConditions = [];
|
|
29
29
|
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
30
30
|
if (typeof projectIdEq === 'string') {
|
|
@@ -345,7 +345,15 @@ class MongoRepository {
|
|
|
345
345
|
}
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
|
-
const
|
|
348
|
+
const orderedItemSize = (_r = params.orderedItem) === null || _r === void 0 ? void 0 : _r.$size;
|
|
349
|
+
if (typeof orderedItemSize === 'number') {
|
|
350
|
+
andConditions.push({ orderedItem: { $size: orderedItemSize } });
|
|
351
|
+
}
|
|
352
|
+
const acceptedOffersSize = (_s = params.acceptedOffers) === null || _s === void 0 ? void 0 : _s.$size;
|
|
353
|
+
if (typeof acceptedOffersSize === 'number') {
|
|
354
|
+
andConditions.push({ acceptedOffers: { $size: acceptedOffersSize } });
|
|
355
|
+
}
|
|
356
|
+
const itemOfferedIdentifierIn = (_v = (_u = (_t = params.acceptedOffers) === null || _t === void 0 ? void 0 : _t.itemOffered) === null || _u === void 0 ? void 0 : _u.identifier) === null || _v === void 0 ? void 0 : _v.$in;
|
|
349
357
|
if (Array.isArray(itemOfferedIdentifierIn)) {
|
|
350
358
|
andConditions.push({
|
|
351
359
|
'acceptedOffers.itemOffered.identifier': {
|
|
@@ -354,7 +362,7 @@ class MongoRepository {
|
|
|
354
362
|
}
|
|
355
363
|
});
|
|
356
364
|
}
|
|
357
|
-
const itemOfferedTypeOfIn = (
|
|
365
|
+
const itemOfferedTypeOfIn = (_y = (_x = (_w = params.acceptedOffers) === null || _w === void 0 ? void 0 : _w.itemOffered) === null || _x === void 0 ? void 0 : _x.typeOf) === null || _y === void 0 ? void 0 : _y.$in;
|
|
358
366
|
if (Array.isArray(itemOfferedTypeOfIn)) {
|
|
359
367
|
andConditions.push({
|
|
360
368
|
'acceptedOffers.itemOffered.typeOf': {
|
|
@@ -363,7 +371,7 @@ class MongoRepository {
|
|
|
363
371
|
}
|
|
364
372
|
});
|
|
365
373
|
}
|
|
366
|
-
const itemOfferedIssuedThroughTypeOfEq = (
|
|
374
|
+
const itemOfferedIssuedThroughTypeOfEq = (_2 = (_1 = (_0 = (_z = params.acceptedOffers) === null || _z === void 0 ? void 0 : _z.itemOffered) === null || _0 === void 0 ? void 0 : _0.issuedThrough) === null || _1 === void 0 ? void 0 : _1.typeOf) === null || _2 === void 0 ? void 0 : _2.$eq;
|
|
367
375
|
if (typeof itemOfferedIssuedThroughTypeOfEq === 'string') {
|
|
368
376
|
andConditions.push({
|
|
369
377
|
'acceptedOffers.itemOffered.issuedThrough.typeOf': {
|
|
@@ -372,7 +380,7 @@ class MongoRepository {
|
|
|
372
380
|
}
|
|
373
381
|
});
|
|
374
382
|
}
|
|
375
|
-
const itemOfferedIssuedThroughIdIn = (
|
|
383
|
+
const itemOfferedIssuedThroughIdIn = (_6 = (_5 = (_4 = (_3 = params.acceptedOffers) === null || _3 === void 0 ? void 0 : _3.itemOffered) === null || _4 === void 0 ? void 0 : _4.issuedThrough) === null || _5 === void 0 ? void 0 : _5.id) === null || _6 === void 0 ? void 0 : _6.$in;
|
|
376
384
|
if (Array.isArray(itemOfferedIssuedThroughIdIn)) {
|
|
377
385
|
andConditions.push({
|
|
378
386
|
'acceptedOffers.itemOffered.issuedThrough.id': {
|
|
@@ -381,7 +389,7 @@ class MongoRepository {
|
|
|
381
389
|
}
|
|
382
390
|
});
|
|
383
391
|
}
|
|
384
|
-
const itemOfferedProgramMembershipUsedIdentifierEq = (
|
|
392
|
+
const itemOfferedProgramMembershipUsedIdentifierEq = (_10 = (_9 = (_8 = (_7 = params.acceptedOffers) === null || _7 === void 0 ? void 0 : _7.itemOffered) === null || _8 === void 0 ? void 0 : _8.programMembershipUsed) === null || _9 === void 0 ? void 0 : _9.identifier) === null || _10 === void 0 ? void 0 : _10.$eq;
|
|
385
393
|
if (typeof itemOfferedProgramMembershipUsedIdentifierEq === 'string') {
|
|
386
394
|
andConditions.push({
|
|
387
395
|
'acceptedOffers.itemOffered.programMembershipUsed.identifier': {
|
|
@@ -390,7 +398,7 @@ class MongoRepository {
|
|
|
390
398
|
}
|
|
391
399
|
});
|
|
392
400
|
}
|
|
393
|
-
const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq = (
|
|
401
|
+
const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq = (_16 = (_15 = (_14 = (_13 = (_12 = (_11 = params.acceptedOffers) === null || _11 === void 0 ? void 0 : _11.itemOffered) === null || _12 === void 0 ? void 0 : _12.programMembershipUsed) === null || _13 === void 0 ? void 0 : _13.issuedThrough) === null || _14 === void 0 ? void 0 : _14.serviceType) === null || _15 === void 0 ? void 0 : _15.codeValue) === null || _16 === void 0 ? void 0 : _16.$eq;
|
|
394
402
|
if (typeof itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq === 'string') {
|
|
395
403
|
andConditions.push({
|
|
396
404
|
'acceptedOffers.itemOffered.programMembershipUsed.issuedThrough.serviceType.codeValue': {
|
|
@@ -552,11 +560,11 @@ class MongoRepository {
|
|
|
552
560
|
}
|
|
553
561
|
}
|
|
554
562
|
}
|
|
555
|
-
const paymentMethodIdentifierIn = (
|
|
563
|
+
const paymentMethodIdentifierIn = (_19 = (_18 = (_17 = params.paymentMethods) === null || _17 === void 0 ? void 0 : _17.paymentMethod) === null || _18 === void 0 ? void 0 : _18.identifier) === null || _19 === void 0 ? void 0 : _19.$in;
|
|
556
564
|
if (Array.isArray(paymentMethodIdentifierIn)) {
|
|
557
565
|
andConditions.push({ 'paymentMethods.paymentMethod.identifier': { $exists: true, $in: paymentMethodIdentifierIn } });
|
|
558
566
|
}
|
|
559
|
-
const paymentMethodsTypeOfIn = (
|
|
567
|
+
const paymentMethodsTypeOfIn = (_20 = params.paymentMethods) === null || _20 === void 0 ? void 0 : _20.typeOfs;
|
|
560
568
|
if (Array.isArray(paymentMethodsTypeOfIn)) {
|
|
561
569
|
andConditions.push({ 'paymentMethods.typeOf': { $exists: true, $in: paymentMethodsTypeOfIn } });
|
|
562
570
|
}
|
|
@@ -584,7 +592,7 @@ class MongoRepository {
|
|
|
584
592
|
});
|
|
585
593
|
}
|
|
586
594
|
}
|
|
587
|
-
const paymentMethodAdditionalPropertyAll = (
|
|
595
|
+
const paymentMethodAdditionalPropertyAll = (_22 = (_21 = params.paymentMethods) === null || _21 === void 0 ? void 0 : _21.additionalProperty) === null || _22 === void 0 ? void 0 : _22.$all;
|
|
588
596
|
if (Array.isArray(paymentMethodAdditionalPropertyAll)) {
|
|
589
597
|
andConditions.push({
|
|
590
598
|
'paymentMethods.additionalProperty': {
|
|
@@ -593,7 +601,7 @@ class MongoRepository {
|
|
|
593
601
|
}
|
|
594
602
|
});
|
|
595
603
|
}
|
|
596
|
-
const paymentMethodAdditionalPropertyIn = (
|
|
604
|
+
const paymentMethodAdditionalPropertyIn = (_24 = (_23 = params.paymentMethods) === null || _23 === void 0 ? void 0 : _23.additionalProperty) === null || _24 === void 0 ? void 0 : _24.$in;
|
|
597
605
|
if (Array.isArray(paymentMethodAdditionalPropertyIn)) {
|
|
598
606
|
andConditions.push({
|
|
599
607
|
'paymentMethods.additionalProperty': {
|
|
@@ -94,6 +94,7 @@ 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
|
+
includedInDataCatalog: { id: '' },
|
|
97
98
|
addSortIndex: false,
|
|
98
99
|
useIncludeInDataCatalog: false
|
|
99
100
|
})(repos);
|
|
@@ -119,6 +119,7 @@ function addReservations(params) {
|
|
|
119
119
|
// 対応アプリケーション条件追加(2023-01-27~)
|
|
120
120
|
store: { id: (_a = params.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.id },
|
|
121
121
|
priceSpecification: {},
|
|
122
|
+
includedInDataCatalog: { id: '' },
|
|
122
123
|
onlyValid: true,
|
|
123
124
|
addSortIndex: false,
|
|
124
125
|
validateOfferRateLimit: true,
|
|
@@ -478,7 +479,7 @@ function searchAvailableAddOns(params) {
|
|
|
478
479
|
if (Array.isArray(params.ticketOffer.addOn)) {
|
|
479
480
|
const addOnProductIds = [...new Set(params.ticketOffer.addOn.map((o) => String(o.itemOffered.id)))];
|
|
480
481
|
for (const addOnProductId of addOnProductIds) {
|
|
481
|
-
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')
|
|
482
|
+
const { offers, product } = yield OfferService.product.search(Object.assign({ ids: params.ids, project: { id: params.project.id }, itemOffered: { id: addOnProductId }, onlyValid: true, addSortIndex: false, includedInDataCatalog: { id: '' }, useIncludeInDataCatalog: false }, (typeof ((_a = params.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.id) === 'string')
|
|
482
483
|
? { availableAt: { id: params.availableAtOrFrom.id } }
|
|
483
484
|
: undefined))(repos);
|
|
484
485
|
availableAddOns.push(...offers.map((o) => {
|
|
@@ -41,6 +41,9 @@ declare function searchEventTicketOffers(params: {
|
|
|
41
41
|
*/
|
|
42
42
|
onlyValid: boolean;
|
|
43
43
|
priceSpecification: Pick<factory.unitPriceOffer.IPriceSpecificationSearchConditions, 'appliesToMovieTicket'>;
|
|
44
|
+
includedInDataCatalog: {
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
44
47
|
limit?: number;
|
|
45
48
|
page?: number;
|
|
46
49
|
addSortIndex: boolean;
|
|
@@ -16,12 +16,11 @@ const factory_1 = require("../factory");
|
|
|
16
16
|
function searchTicketOffersByItemOffered(params) {
|
|
17
17
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
18
18
|
var _a, _b, _c, _d, _e;
|
|
19
|
+
let eventService;
|
|
19
20
|
let catalogId;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
catalogId = eventService.hasOfferCatalog.id;
|
|
24
|
-
}
|
|
21
|
+
eventService = yield repos.product.findById({ id: (_a = params.itemOffered) === null || _a === void 0 ? void 0 : _a.id }, ['hasOfferCatalog', 'project'], []);
|
|
22
|
+
if (typeof ((_b = eventService.hasOfferCatalog) === null || _b === void 0 ? void 0 : _b.id) === 'string') {
|
|
23
|
+
catalogId = eventService.hasOfferCatalog.id;
|
|
25
24
|
}
|
|
26
25
|
if (typeof catalogId !== 'string') {
|
|
27
26
|
throw new factory.errors.NotFound('itemOffered.hasOfferCatalog');
|
|
@@ -39,9 +38,12 @@ function searchTicketOffersByItemOffered(params) {
|
|
|
39
38
|
if (Array.isArray(params.ids)) {
|
|
40
39
|
throw new factory.errors.NotImplemented('id specification on addSortIndex not implemented');
|
|
41
40
|
}
|
|
41
|
+
// 明示的にカタログ指定可能にする
|
|
42
|
+
if (typeof ((_c = params.includedInDataCatalog) === null || _c === void 0 ? void 0 : _c.id) === 'string' && params.includedInDataCatalog.id.length > 0) {
|
|
43
|
+
subOfferCatalogId = params.includedInDataCatalog.id;
|
|
44
|
+
}
|
|
42
45
|
const { offers, sortedOfferIds } = yield repos.offer.searchByOfferCatalogIdWithSortIndex({
|
|
43
|
-
|
|
44
|
-
subOfferCatalog: { id: subOfferCatalogId, isOfferCatalogItem },
|
|
46
|
+
offerCatalog: { id: subOfferCatalogId, isOfferCatalogItem },
|
|
45
47
|
availableAtOrFrom: { id: (_d = params.store) === null || _d === void 0 ? void 0 : _d.id },
|
|
46
48
|
unacceptedPaymentMethod: params.unacceptedPaymentMethod,
|
|
47
49
|
excludeAppliesToMovieTicket: params.excludeAppliesToMovieTicket,
|
|
@@ -54,21 +56,28 @@ function searchTicketOffersByItemOffered(params) {
|
|
|
54
56
|
return { availableOffers: offers, sortedOfferIds };
|
|
55
57
|
}
|
|
56
58
|
else {
|
|
57
|
-
//
|
|
59
|
+
// id指定必須(2023-09-13~)
|
|
58
60
|
if (!Array.isArray(params.ids)) {
|
|
59
61
|
throw new factory.errors.ArgumentNull('ids', 'ids must be specified');
|
|
60
62
|
}
|
|
61
|
-
|
|
63
|
+
let includedInDataCatalogIds = [subOfferCatalogId];
|
|
64
|
+
if (isOfferCatalogItem) {
|
|
65
|
+
// 複数カタログ対応(2023-09-27~)
|
|
66
|
+
const offerCatalogItems = yield repos.offerCatalog.findItemListElementById({
|
|
67
|
+
id: catalogId,
|
|
68
|
+
project: { id: eventService.project.id }
|
|
69
|
+
});
|
|
70
|
+
includedInDataCatalogIds = offerCatalogItems.itemListElement.map((element) => element.id);
|
|
71
|
+
}
|
|
72
|
+
const availableOffers = yield repos.offer.searchAllByIdsAndOfferCatalogId({
|
|
62
73
|
ids: params.ids,
|
|
63
|
-
|
|
74
|
+
includedInDataCatalog: { id: includedInDataCatalogIds, isOfferCatalogItem },
|
|
64
75
|
availableAtOrFrom: { id: (_e = params.store) === null || _e === void 0 ? void 0 : _e.id },
|
|
65
76
|
unacceptedPaymentMethod: params.unacceptedPaymentMethod,
|
|
66
77
|
excludeAppliesToMovieTicket: params.excludeAppliesToMovieTicket,
|
|
67
78
|
onlyValid: params.onlyValid === true
|
|
68
|
-
// limit: params.limit,
|
|
69
|
-
// page: params.page
|
|
70
79
|
});
|
|
71
|
-
return { availableOffers
|
|
80
|
+
return { availableOffers };
|
|
72
81
|
}
|
|
73
82
|
});
|
|
74
83
|
}
|
|
@@ -108,12 +117,13 @@ function searchEventTicketOffersByEvent(params) {
|
|
|
108
117
|
// 興行設定があれば興行のカタログを参照する(2022-08-31~)
|
|
109
118
|
const eventOffers = event.offers;
|
|
110
119
|
const { availableOffers, sortedOfferIds } = yield searchTicketOffersByItemOffered({
|
|
111
|
-
itemOffered: { id: (_a = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.itemOffered) === null || _a === void 0 ? void 0 : _a.id },
|
|
120
|
+
itemOffered: { id: String((_a = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.itemOffered) === null || _a === void 0 ? void 0 : _a.id) },
|
|
112
121
|
ids: params.ids,
|
|
113
122
|
store: params.store,
|
|
114
123
|
limit: params.limit,
|
|
115
124
|
page: params.page,
|
|
116
125
|
onlyValid: params.onlyValid,
|
|
126
|
+
includedInDataCatalog: params.includedInDataCatalog,
|
|
117
127
|
unacceptedPaymentMethod,
|
|
118
128
|
excludeAppliesToMovieTicket,
|
|
119
129
|
priceSpecification: params.priceSpecification,
|
|
@@ -279,6 +289,7 @@ function searchEventTicketOffers(params) {
|
|
|
279
289
|
event,
|
|
280
290
|
store: params.store,
|
|
281
291
|
priceSpecification: params.priceSpecification,
|
|
292
|
+
includedInDataCatalog: params.includedInDataCatalog,
|
|
282
293
|
limit: params.limit,
|
|
283
294
|
page: params.page,
|
|
284
295
|
addSortIndex: params.addSortIndex,
|
|
@@ -15,12 +15,12 @@ const settings_1 = require("../../../settings");
|
|
|
15
15
|
/**
|
|
16
16
|
* プロダクトオファーを検索する
|
|
17
17
|
*/
|
|
18
|
-
// tslint:disable-next-line:max-func-body-length
|
|
19
18
|
function searchProductOffers(params) {
|
|
19
|
+
// tslint:disable-next-line:max-func-body-length
|
|
20
20
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
var _a;
|
|
21
|
+
var _a, _b;
|
|
22
22
|
// プロダクト検索
|
|
23
|
-
const productWithOffers = yield repos.product.findById({ id: params.itemOffered.id }, ['hasOfferCatalog'], []);
|
|
23
|
+
const productWithOffers = yield repos.product.findById({ id: params.itemOffered.id }, ['hasOfferCatalog', 'project'], []);
|
|
24
24
|
const offerCatalogId = (_a = productWithOffers.hasOfferCatalog) === null || _a === void 0 ? void 0 : _a.id;
|
|
25
25
|
if (typeof offerCatalogId !== 'string') {
|
|
26
26
|
return [];
|
|
@@ -40,9 +40,12 @@ function searchProductOffers(params) {
|
|
|
40
40
|
if (Array.isArray(params.ids)) {
|
|
41
41
|
throw new factory.errors.NotImplemented('id specification on addSortIndex not implemented');
|
|
42
42
|
}
|
|
43
|
+
// 明示的にカタログ指定可能にする
|
|
44
|
+
if (typeof ((_b = params.includedInDataCatalog) === null || _b === void 0 ? void 0 : _b.id) === 'string' && params.includedInDataCatalog.id.length > 0) {
|
|
45
|
+
subOfferCatalogId = params.includedInDataCatalog.id;
|
|
46
|
+
}
|
|
43
47
|
const searchByOfferCatalogIdResult = yield repos.offer.searchByOfferCatalogIdWithSortIndex({
|
|
44
|
-
|
|
45
|
-
subOfferCatalog: { id: subOfferCatalogId, isOfferCatalogItem },
|
|
48
|
+
offerCatalog: { id: subOfferCatalogId, isOfferCatalogItem },
|
|
46
49
|
excludeAppliesToMovieTicket: false,
|
|
47
50
|
priceSpecification: {},
|
|
48
51
|
limit: params.limit,
|
|
@@ -55,20 +58,27 @@ function searchProductOffers(params) {
|
|
|
55
58
|
sortedOfferIds = searchByOfferCatalogIdResult.sortedOfferIds;
|
|
56
59
|
}
|
|
57
60
|
else {
|
|
58
|
-
//
|
|
61
|
+
// id指定必須(2023-09-13~)
|
|
59
62
|
if (!Array.isArray(params.ids)) {
|
|
60
63
|
throw new factory.errors.ArgumentNull('ids', 'ids must be specified');
|
|
61
64
|
}
|
|
65
|
+
let includedInDataCatalogIds = [subOfferCatalogId];
|
|
66
|
+
if (isOfferCatalogItem) {
|
|
67
|
+
// 複数カタログ対応(2023-09-27~)
|
|
68
|
+
const offerCatalogItems = yield repos.offerCatalog.findItemListElementById({
|
|
69
|
+
id: offerCatalogId,
|
|
70
|
+
project: { id: productWithOffers.project.id }
|
|
71
|
+
});
|
|
72
|
+
includedInDataCatalogIds = offerCatalogItems.itemListElement.map((element) => element.id);
|
|
73
|
+
}
|
|
62
74
|
const searchByOfferCatalogIdResult = yield repos.offer.searchAllByIdsAndOfferCatalogId({
|
|
63
75
|
ids: params.ids,
|
|
64
|
-
|
|
76
|
+
includedInDataCatalog: { id: includedInDataCatalogIds, isOfferCatalogItem },
|
|
65
77
|
excludeAppliesToMovieTicket: false,
|
|
66
|
-
// limit: params.limit,
|
|
67
|
-
// page: params.page,
|
|
68
78
|
onlyValid: params.onlyValid === true,
|
|
69
79
|
availableAtOrFrom: params.availableAt
|
|
70
80
|
});
|
|
71
|
-
offers = searchByOfferCatalogIdResult
|
|
81
|
+
offers = searchByOfferCatalogIdResult;
|
|
72
82
|
}
|
|
73
83
|
return offers.map((o) => {
|
|
74
84
|
var _a;
|
|
@@ -64,6 +64,7 @@ function search(params) {
|
|
|
64
64
|
itemOffered: { id: params.itemOffered.id },
|
|
65
65
|
availableAt: params.availableAt,
|
|
66
66
|
onlyValid: params.onlyValid,
|
|
67
|
+
includedInDataCatalog: params.includedInDataCatalog,
|
|
67
68
|
addSortIndex: params.addSortIndex,
|
|
68
69
|
useIncludeInDataCatalog: params.useIncludeInDataCatalog,
|
|
69
70
|
limit: params.limit,
|
|
@@ -185,7 +186,7 @@ function fixProductAndOffers(params) {
|
|
|
185
186
|
if (product === undefined) {
|
|
186
187
|
throw new factory.errors.NotFound('Product');
|
|
187
188
|
}
|
|
188
|
-
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);
|
|
189
|
+
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, includedInDataCatalog: { id: '' }, addSortIndex: false, useIncludeInDataCatalog: false }, (typeof ((_c = params.location) === null || _c === void 0 ? void 0 : _c.id) === 'string') ? { availableAt: { id: params.location.id } } : undefined))(repos);
|
|
189
190
|
return { product, availableOffers: offers };
|
|
190
191
|
});
|
|
191
192
|
}
|
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.
|
|
13
|
-
"@cinerino/sdk": "3.
|
|
12
|
+
"@chevre/factory": "4.331.0",
|
|
13
|
+
"@cinerino/sdk": "3.170.0",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.0",
|
|
16
16
|
"@sendgrid/mail": "6.4.0",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"postversion": "git push origin --tags",
|
|
118
118
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
119
119
|
},
|
|
120
|
-
"version": "21.
|
|
120
|
+
"version": "21.11.0-alpha.0"
|
|
121
121
|
}
|