@chevre/domain 21.8.0-alpha.40 → 21.8.0-alpha.42
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.
|
@@ -5,24 +5,24 @@ import * as mongoose from 'mongoose';
|
|
|
5
5
|
import { chevre } from '../../../lib/index';
|
|
6
6
|
|
|
7
7
|
async function main() {
|
|
8
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI
|
|
8
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
9
9
|
|
|
10
10
|
const offerRepo = new chevre.repository.Offer(mongoose.connection);
|
|
11
11
|
|
|
12
12
|
const { offers } = await offerRepo.findOffersByOfferCatalogId({
|
|
13
13
|
limit: 100,
|
|
14
14
|
page: 1,
|
|
15
|
-
// ids: ['
|
|
15
|
+
// ids: ['al96nqj7z', 'xxx', '1001'],
|
|
16
16
|
// ids: ['xx', 'xxx'],
|
|
17
17
|
offerCatalog: {
|
|
18
|
-
id: '
|
|
18
|
+
id: '0001'
|
|
19
19
|
// id: 'xxx'
|
|
20
20
|
},
|
|
21
21
|
excludeAppliesToMovieTicket: false
|
|
22
|
+
// useOffersAsPrimary: true
|
|
22
23
|
});
|
|
23
|
-
// console.log(offers);
|
|
24
24
|
console.log(offers.map((offer) => {
|
|
25
|
-
return `${offer.project?.id} ${offer.identifier} ${offer.priceSpecification?.price} ${offer.name?.ja} ${offer.id}`;
|
|
25
|
+
return `${offer.project?.id} ${offer.identifier} ${offer.priceSpecification?.price} ${offer.name?.ja} ${offer.id} ${(<any>offer).offerIndex}`;
|
|
26
26
|
}));
|
|
27
27
|
console.log(offers.length);
|
|
28
28
|
console.log('USE_AGGREGATE_OFFERS_AS_PRIMARY:', process.env.USE_AGGREGATE_OFFERS_AS_PRIMARY);
|
|
@@ -107,7 +107,7 @@ function createEmailMessageAbout(params) {
|
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
function createEmailMessageSender(params) {
|
|
110
|
-
var _a, _b
|
|
110
|
+
var _a, _b;
|
|
111
111
|
return {
|
|
112
112
|
typeOf: params.order.seller.typeOf,
|
|
113
113
|
name: (typeof ((_b = (_a = params.email) === null || _a === void 0 ? void 0 : _a.sender) === null || _b === void 0 ? void 0 : _b.name) === 'string')
|
|
@@ -115,10 +115,11 @@ function createEmailMessageSender(params) {
|
|
|
115
115
|
: (typeof params.order.seller.name === 'string')
|
|
116
116
|
? params.order.seller.name
|
|
117
117
|
: String(params.order.seller.id),
|
|
118
|
-
// sender.email
|
|
119
|
-
email: (
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
// sender.email指定を廃止(2023-09-07~)
|
|
119
|
+
// email: (USE_CUSTOM_SENDER_EMAIL && typeof params.email?.sender?.email === 'string')
|
|
120
|
+
// ? params.email.sender.email
|
|
121
|
+
// : DEFAULT_SENDER_EMAIL
|
|
122
|
+
email: settings_1.DEFAULT_SENDER_EMAIL
|
|
122
123
|
};
|
|
123
124
|
}
|
|
124
125
|
/**
|
|
@@ -65,6 +65,10 @@ export declare class MongoRepository {
|
|
|
65
65
|
limit?: number;
|
|
66
66
|
page?: number;
|
|
67
67
|
projection?: IProjection;
|
|
68
|
+
/**
|
|
69
|
+
* 強制的にoffersコレクションを使用する
|
|
70
|
+
*/
|
|
71
|
+
useOffersAsPrimary?: boolean;
|
|
68
72
|
}): Promise<{
|
|
69
73
|
offers: factory.unitPriceOffer.IUnitPriceOffer[];
|
|
70
74
|
sortedOfferIds: string[];
|
package/lib/chevre/repo/offer.js
CHANGED
|
@@ -834,7 +834,10 @@ class MongoRepository {
|
|
|
834
834
|
? { sort: { identifier: factory.sortType.Ascending } }
|
|
835
835
|
: undefined), (typeof params.limit === 'number') ? { limit: params.limit } : undefined), (typeof params.page === 'number') ? { page: params.page } : undefined);
|
|
836
836
|
// USE_AGGREGATE_OFFERS_AS_PRIMARY_ON_SEARCH_BY_CATALOG対応(2023-09-06~)
|
|
837
|
-
|
|
837
|
+
const useOffersAsPrimary = (params.useOffersAsPrimary === true)
|
|
838
|
+
? true
|
|
839
|
+
: !settings_1.USE_AGGREGATE_OFFERS_AS_PRIMARY_ON_SEARCH_BY_CATALOG;
|
|
840
|
+
offers = yield this.search(searchOffersConditions, params.projection, useOffersAsPrimary);
|
|
838
841
|
// 完全廃止(基本的にsortedOfferIdsと合わせて利用する想定)(2023-09-04~)
|
|
839
842
|
// if (params.sort) {
|
|
840
843
|
// // sorting
|
package/lib/chevre/settings.d.ts
CHANGED
|
@@ -40,7 +40,6 @@ export declare const USE_NEW_EVENT_AVAILABILITY_KEY_FROM: moment.Moment;
|
|
|
40
40
|
export declare const USE_ADVANCE_BOOKING_REQUIREMENT: boolean;
|
|
41
41
|
export declare const USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT: boolean;
|
|
42
42
|
export declare const USE_DELETE_EVENT_BY_ORDER: boolean;
|
|
43
|
-
export declare const USE_CUSTOM_SENDER_EMAIL: boolean;
|
|
44
43
|
export declare const USE_ORDER_PAYMENT_DUE_ON_PLACED: boolean;
|
|
45
44
|
export declare const USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY: boolean;
|
|
46
45
|
export declare const USE_AGGREGATE_OFFERS_AS_PRIMARY: boolean;
|
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_AGGREGATE_OFFERS_AS_PRIMARY_ON_SEARCH_BY_CATALOG = exports.USE_AGGREGATE_OFFERS_AS_PRIMARY = exports.USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY = exports.USE_ORDER_PAYMENT_DUE_ON_PLACED = exports.
|
|
3
|
+
exports.settings = exports.MONGO_MAX_TIME_MS = exports.USE_AGGREGATE_OFFERS_AS_PRIMARY_ON_SEARCH_BY_CATALOG = exports.USE_AGGREGATE_OFFERS_AS_PRIMARY = 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')
|
|
@@ -72,7 +72,6 @@ exports.USE_NEW_EVENT_AVAILABILITY_KEY_FROM = (typeof process.env.USE_NEW_EVENT_
|
|
|
72
72
|
exports.USE_ADVANCE_BOOKING_REQUIREMENT = process.env.USE_ADVANCE_BOOKING_REQUIREMENT === '1';
|
|
73
73
|
exports.USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT = process.env.USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT === '1';
|
|
74
74
|
exports.USE_DELETE_EVENT_BY_ORDER = process.env.USE_DELETE_EVENT_BY_ORDER === '1';
|
|
75
|
-
exports.USE_CUSTOM_SENDER_EMAIL = process.env.USE_CUSTOM_SENDER_EMAIL === '1';
|
|
76
75
|
exports.USE_ORDER_PAYMENT_DUE_ON_PLACED = process.env.USE_ORDER_PAYMENT_DUE_ON_PLACED === '1';
|
|
77
76
|
exports.USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY = process.env.USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY === '1';
|
|
78
77
|
exports.USE_AGGREGATE_OFFERS_AS_PRIMARY = process.env.USE_AGGREGATE_OFFERS_AS_PRIMARY === '1';
|
package/package.json
CHANGED