@chevre/domain 20.4.0-alpha.17 → 20.4.0-alpha.19
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.
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Connection } from 'mongoose';
|
|
2
2
|
import * as factory from '../factory';
|
|
3
|
+
interface IProjection {
|
|
4
|
+
[key: string]: 0;
|
|
5
|
+
}
|
|
3
6
|
/**
|
|
4
7
|
* オファーリポジトリ
|
|
5
8
|
*/
|
|
@@ -29,6 +32,7 @@ export declare class MongoRepository {
|
|
|
29
32
|
limit?: number;
|
|
30
33
|
page?: number;
|
|
31
34
|
sort: boolean;
|
|
35
|
+
projection?: IProjection;
|
|
32
36
|
}): Promise<{
|
|
33
37
|
offers: factory.unitPriceOffer.IUnitPriceOffer[];
|
|
34
38
|
sortedOfferIds: string[];
|
|
@@ -37,7 +41,7 @@ export declare class MongoRepository {
|
|
|
37
41
|
id: string;
|
|
38
42
|
}): Promise<factory.unitPriceOffer.IUnitPriceOffer>;
|
|
39
43
|
count(params: factory.unitPriceOffer.ISearchConditions): Promise<number>;
|
|
40
|
-
search(params: factory.unitPriceOffer.ISearchConditions): Promise<factory.unitPriceOffer.IUnitPriceOffer[]>;
|
|
44
|
+
search(params: factory.unitPriceOffer.ISearchConditions, projection?: IProjection): Promise<factory.unitPriceOffer.IUnitPriceOffer[]>;
|
|
41
45
|
save(params: factory.unitPriceOffer.IUnitPriceOffer): Promise<factory.unitPriceOffer.IUnitPriceOffer>;
|
|
42
46
|
saveManyByIdentifier(params: {
|
|
43
47
|
attributes: factory.unitPriceOffer.IUnitPriceOffer;
|
|
@@ -53,3 +57,4 @@ export declare class MongoRepository {
|
|
|
53
57
|
}): Promise<void>;
|
|
54
58
|
getCursor(conditions: any, projection: any): import("mongoose").QueryCursor<any>;
|
|
55
59
|
}
|
|
60
|
+
export {};
|
package/lib/chevre/repo/offer.js
CHANGED
|
@@ -373,7 +373,7 @@ class MongoRepository {
|
|
|
373
373
|
}, onlyValid: params.onlyValid === true }), (typeof params.limit === 'number' && typeof params.page === 'number')
|
|
374
374
|
? { sort: { _id: factory.sortType.Ascending } }
|
|
375
375
|
: undefined), (typeof params.limit === 'number') ? { limit: params.limit } : undefined), (typeof params.page === 'number') ? { page: params.page } : undefined);
|
|
376
|
-
offers = yield this.search(searchOffersConditions);
|
|
376
|
+
offers = yield this.search(searchOffersConditions, params.projection);
|
|
377
377
|
if (params.sort) {
|
|
378
378
|
// sorting
|
|
379
379
|
offers = offers.sort((a, b) => sortedOfferIds.indexOf(String(a.id)) - sortedOfferIds.indexOf(String(b.id)));
|
|
@@ -404,14 +404,10 @@ class MongoRepository {
|
|
|
404
404
|
.exec();
|
|
405
405
|
});
|
|
406
406
|
}
|
|
407
|
-
search(params) {
|
|
407
|
+
search(params, projection) {
|
|
408
408
|
return __awaiter(this, void 0, void 0, function* () {
|
|
409
409
|
const conditions = MongoRepository.CREATE_OFFER_MONGO_CONDITIONS(params);
|
|
410
|
-
const query = this.offerModel.find((conditions.length > 0) ? { $and: conditions } : {}, {
|
|
411
|
-
__v: 0,
|
|
412
|
-
createdAt: 0,
|
|
413
|
-
updatedAt: 0
|
|
414
|
-
});
|
|
410
|
+
const query = this.offerModel.find((conditions.length > 0) ? { $and: conditions } : {}, Object.assign(Object.assign({}, projection), { __v: 0, createdAt: 0, updatedAt: 0 }));
|
|
415
411
|
if (typeof params.limit === 'number') {
|
|
416
412
|
const page = (typeof params.page === 'number') ? params.page : 1;
|
|
417
413
|
query.limit(params.limit)
|
|
@@ -294,7 +294,7 @@ function coaTicket2offer(params) {
|
|
|
294
294
|
const eligibleMembershipType = (params.ticketResult.flgMember === COA.factory.master.FlgMember.Member
|
|
295
295
|
&& typeof ((_b = params.defaultMembershipType) === null || _b === void 0 ? void 0 : _b.typeOf) === 'string')
|
|
296
296
|
? [{
|
|
297
|
-
project: params.defaultMembershipType.project,
|
|
297
|
+
// project: params.defaultMembershipType.project,
|
|
298
298
|
typeOf: params.defaultMembershipType.typeOf,
|
|
299
299
|
id: params.defaultMembershipType.id,
|
|
300
300
|
codeValue: params.defaultMembershipType.codeValue,
|
|
@@ -13,9 +13,7 @@ interface ISearchEventTicketOffersRepos {
|
|
|
13
13
|
}
|
|
14
14
|
declare type ISearchEventTicketOffersOperation<T> = (repos: ISearchEventTicketOffersRepos) => Promise<T>;
|
|
15
15
|
declare type IAcceptedPaymentMethod = factory.paymentMethod.paymentCard.movieTicket.IMovieTicket;
|
|
16
|
-
declare type ITicketOfferWithSortIndex = factory.product.ITicketOffer
|
|
17
|
-
sortIndex?: number;
|
|
18
|
-
};
|
|
16
|
+
declare type ITicketOfferWithSortIndex = factory.product.ITicketOffer;
|
|
19
17
|
/**
|
|
20
18
|
* 興行オファー検索
|
|
21
19
|
*/
|
|
@@ -97,10 +97,17 @@ exports.invalidatePaymentUrl = invalidatePaymentUrl;
|
|
|
97
97
|
*/
|
|
98
98
|
function processVoidPayTransaction(params) {
|
|
99
99
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
let transaction;
|
|
101
|
+
// アクションID指定の場合、進行中取引検証(2023-02-24~)
|
|
102
|
+
if (typeof params.id === 'string') {
|
|
103
|
+
transaction = yield repos.transaction.findInProgressById({ typeOf: params.purpose.typeOf, id: params.purpose.id });
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
transaction = yield repos.transaction.findById({
|
|
107
|
+
typeOf: params.purpose.typeOf,
|
|
108
|
+
id: params.purpose.id
|
|
109
|
+
});
|
|
110
|
+
}
|
|
104
111
|
// 承認アクションを取得
|
|
105
112
|
let authorizeActions;
|
|
106
113
|
if (typeof params.id === 'string') {
|
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.289.0-alpha.
|
|
13
|
-
"@cinerino/sdk": "3.140.0-alpha.
|
|
12
|
+
"@chevre/factory": "4.289.0-alpha.15",
|
|
13
|
+
"@cinerino/sdk": "3.140.0-alpha.16",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.0",
|
|
16
16
|
"@sendgrid/mail": "6.4.0",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"postversion": "git push origin --tags",
|
|
121
121
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
122
122
|
},
|
|
123
|
-
"version": "20.4.0-alpha.
|
|
123
|
+
"version": "20.4.0-alpha.19"
|
|
124
124
|
}
|