@chevre/domain 22.2.0-alpha.7 → 22.2.0-alpha.8
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/lib/chevre/repo/authorization.d.ts +3 -1
- package/lib/chevre/repo/authorization.js +21 -10
- package/lib/chevre/repo/categoryCode.d.ts +6 -2
- package/lib/chevre/service/assetTransaction/pay/factory.js +1 -1
- package/lib/chevre/service/assetTransaction/refund/factory.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +19 -14
- package/lib/chevre/service/offer/event/importFromCOA/factory.d.ts +3 -1
- package/package.json +3 -3
|
@@ -36,7 +36,9 @@ export declare class AuthorizationRepo {
|
|
|
36
36
|
};
|
|
37
37
|
id: string;
|
|
38
38
|
}): Promise<Pick<IFindValidOneResult, 'object'>>;
|
|
39
|
-
|
|
39
|
+
projectFields(params: factory.authorization.ISearchConditions): Promise<(factory.authorization.IAuthorization & {
|
|
40
|
+
id: string;
|
|
41
|
+
})[]>;
|
|
40
42
|
/**
|
|
41
43
|
* 有効期限を一定期間過ぎた承認を削除する
|
|
42
44
|
*/
|
|
@@ -114,14 +114,17 @@ class AuthorizationRepo {
|
|
|
114
114
|
code: { $eq: String(params.code) },
|
|
115
115
|
validFrom: { $lte: now },
|
|
116
116
|
validUntil: { $gte: now }
|
|
117
|
-
}, {
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
}, {
|
|
118
|
+
_id: 0,
|
|
119
|
+
id: { $toString: '$_id' },
|
|
120
|
+
object: 1, typeOf: 1, audience: 1, issuedBy: 1
|
|
121
|
+
})
|
|
122
|
+
.lean()
|
|
120
123
|
.exec();
|
|
121
124
|
if (doc === null) {
|
|
122
125
|
throw new factory.errors.NotFound(this.authorizationModel.modelName);
|
|
123
126
|
}
|
|
124
|
-
const { id, object, typeOf, audience, issuedBy } = doc
|
|
127
|
+
const { id, object, typeOf, audience, issuedBy } = doc;
|
|
125
128
|
return Object.assign(Object.assign({ id, object, typeOf }, (typeof (issuedBy === null || issuedBy === void 0 ? void 0 : issuedBy.id) === 'string') ? { issuedBy } : undefined), (typeof (audience === null || audience === void 0 ? void 0 : audience.id) === 'string') ? { audience } : undefined);
|
|
126
129
|
});
|
|
127
130
|
}
|
|
@@ -145,14 +148,22 @@ class AuthorizationRepo {
|
|
|
145
148
|
return doc;
|
|
146
149
|
});
|
|
147
150
|
}
|
|
148
|
-
|
|
151
|
+
projectFields(params) {
|
|
149
152
|
var _a;
|
|
150
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
154
|
const conditions = AuthorizationRepo.CREATE_MONGO_CONDITIONS(params);
|
|
152
155
|
const query = this.authorizationModel.find((conditions.length > 0) ? { $and: conditions } : {}, {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
_id: 0,
|
|
157
|
+
id: { $toString: '$_id' },
|
|
158
|
+
project: 1,
|
|
159
|
+
typeOf: 1,
|
|
160
|
+
code: 1,
|
|
161
|
+
object: 1,
|
|
162
|
+
validFrom: 1,
|
|
163
|
+
validUntil: 1,
|
|
164
|
+
audience: 1,
|
|
165
|
+
author: 1,
|
|
166
|
+
issuedBy: 1
|
|
156
167
|
});
|
|
157
168
|
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
158
169
|
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
@@ -165,8 +176,8 @@ class AuthorizationRepo {
|
|
|
165
176
|
query.sort({ validFrom: params.sort.validFrom });
|
|
166
177
|
}
|
|
167
178
|
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
168
|
-
.
|
|
169
|
-
.
|
|
179
|
+
.lean()
|
|
180
|
+
.exec();
|
|
170
181
|
});
|
|
171
182
|
}
|
|
172
183
|
/**
|
|
@@ -45,13 +45,17 @@ export declare class CategoryCodeRepo {
|
|
|
45
45
|
/**
|
|
46
46
|
* 検索
|
|
47
47
|
*/
|
|
48
|
-
search(params: factory.categoryCode.ISearchConditions, inclusion: IKeyOfProjection[], exclusion: IKeyOfProjection[]): Promise<factory.categoryCode.ICategoryCode
|
|
48
|
+
search(params: factory.categoryCode.ISearchConditions, inclusion: IKeyOfProjection[], exclusion: IKeyOfProjection[]): Promise<(factory.categoryCode.ICategoryCode & {
|
|
49
|
+
id: string;
|
|
50
|
+
})[]>;
|
|
49
51
|
save(params: {
|
|
50
52
|
id?: string;
|
|
51
53
|
attributes: factory.categoryCode.ICategoryCode & {
|
|
52
54
|
$unset?: IUnset;
|
|
53
55
|
};
|
|
54
|
-
}): Promise<factory.categoryCode.ICategoryCode
|
|
56
|
+
}): Promise<factory.categoryCode.ICategoryCode & {
|
|
57
|
+
id: string;
|
|
58
|
+
}>;
|
|
55
59
|
saveManyByCodeValue(params: {
|
|
56
60
|
attributes: factory.categoryCode.ICategoryCode;
|
|
57
61
|
upsert?: boolean;
|
|
@@ -74,7 +74,7 @@ function createStartParams(params) {
|
|
|
74
74
|
else if (params.paymentServiceType === factory.service.paymentService.PaymentServiceType.CreditCard) {
|
|
75
75
|
const creditCardPaymentServiceOutput = (_l = params.paymentService) === null || _l === void 0 ? void 0 : _l.serviceOutput;
|
|
76
76
|
const invoiceAsServiceOutput = (Array.isArray(creditCardPaymentServiceOutput))
|
|
77
|
-
? creditCardPaymentServiceOutput.find((output) => output.typeOf === 'Invoice')
|
|
77
|
+
? creditCardPaymentServiceOutput.find((output) => (output === null || output === void 0 ? void 0 : output.typeOf) === 'Invoice')
|
|
78
78
|
: creditCardPaymentServiceOutput;
|
|
79
79
|
// カード通貨区分が存在すれば適用
|
|
80
80
|
if ((invoiceAsServiceOutput === null || invoiceAsServiceOutput === void 0 ? void 0 : invoiceAsServiceOutput.typeOf) === 'Invoice') {
|
|
@@ -24,7 +24,7 @@ function createStartParams(params) {
|
|
|
24
24
|
if (((_g = params.paymentService) === null || _g === void 0 ? void 0 : _g.typeOf) === factory.service.paymentService.PaymentServiceType.CreditCard) {
|
|
25
25
|
// カード通貨区分の存在する決済サービスを考慮(2023-08-09~)
|
|
26
26
|
const invoiceAsServiceOutput = (Array.isArray(params.paymentService.serviceOutput))
|
|
27
|
-
? params.paymentService.serviceOutput.find((output) => output.typeOf === 'Invoice')
|
|
27
|
+
? params.paymentService.serviceOutput.find((output) => (output === null || output === void 0 ? void 0 : output.typeOf) === 'Invoice')
|
|
28
28
|
: params.paymentService.serviceOutput;
|
|
29
29
|
let paymentServiceOutputAmountCurrency;
|
|
30
30
|
if ((invoiceAsServiceOutput === null || invoiceAsServiceOutput === void 0 ? void 0 : invoiceAsServiceOutput.typeOf) === 'Invoice') {
|
|
@@ -53,6 +53,7 @@ function createSubReservations(params) {
|
|
|
53
53
|
});
|
|
54
54
|
const programMembershipUsed = yield validateProgramMembershipUsed({
|
|
55
55
|
acceptedOffer,
|
|
56
|
+
availableOffer: ticketType,
|
|
56
57
|
project: { id: params.event.project.id }
|
|
57
58
|
})(repos);
|
|
58
59
|
// チケット作成
|
|
@@ -273,7 +274,7 @@ function validateAdvanceBookingRequirement(params) {
|
|
|
273
274
|
function validateProgramMembershipUsed(params) {
|
|
274
275
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
275
276
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
276
|
-
var _a, _b, _c, _d, _e, _f;
|
|
277
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
277
278
|
const now = new Date();
|
|
278
279
|
let programMembershipUsed;
|
|
279
280
|
const requestedProgramMembershipUsed = (_b = (_a = params.acceptedOffer.itemOffered) === null || _a === void 0 ? void 0 : _a.serviceOutput) === null || _b === void 0 ? void 0 : _b.programMembershipUsed;
|
|
@@ -329,32 +330,36 @@ function validateProgramMembershipUsed(params) {
|
|
|
329
330
|
}
|
|
330
331
|
switch (permitIssuedThrough.typeOf) {
|
|
331
332
|
case factory.service.paymentService.PaymentServiceType.FaceToFace:
|
|
332
|
-
//
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
333
|
+
// 適用メンバーシップ条件有のオファーであれば、問答無用に受け入れる
|
|
334
|
+
const eligibleMembershipType = (_g = (_f = params.availableOffer.eligibleMembershipType) === null || _f === void 0 ? void 0 : _f.shift()) === null || _g === void 0 ? void 0 : _g.codeValue;
|
|
335
|
+
if (typeof eligibleMembershipType === 'string') {
|
|
336
|
+
programMembershipUsed = {
|
|
337
|
+
typeOf: factory.permit.PermitType.Permit,
|
|
338
|
+
identifier: programMembershipUsedIdentifier,
|
|
339
|
+
issuedThrough: {
|
|
340
|
+
serviceType: { codeValue: eligibleMembershipType },
|
|
341
|
+
typeOf: permitIssuedThrough.typeOf
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
}
|
|
340
345
|
break;
|
|
341
346
|
// 発行サービスがCreditCardのケースに対応(2023-09-01~)
|
|
342
347
|
case factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
343
348
|
// 決済サービスのserviceOutputにPermitが存在すれば、設定されたメンバーシップ区分のPermitをprogramMembershipUsedとして適用する
|
|
344
349
|
let issuedThroughServiceType;
|
|
345
350
|
if (Array.isArray(permitIssuedThrough.serviceOutput)) {
|
|
346
|
-
const serviceOutputAsPermit = permitIssuedThrough.serviceOutput.find((output) => output.typeOf === factory.permit.PermitType.Permit);
|
|
351
|
+
const serviceOutputAsPermit = permitIssuedThrough.serviceOutput.find((output) => (output === null || output === void 0 ? void 0 : output.typeOf) === factory.permit.PermitType.Permit);
|
|
347
352
|
if ((serviceOutputAsPermit === null || serviceOutputAsPermit === void 0 ? void 0 : serviceOutputAsPermit.typeOf) === factory.permit.PermitType.Permit) {
|
|
348
353
|
issuedThroughServiceType = serviceOutputAsPermit.issuedThrough.serviceType;
|
|
349
354
|
}
|
|
350
355
|
}
|
|
351
|
-
if ((issuedThroughServiceType === null || issuedThroughServiceType === void 0 ? void 0 : issuedThroughServiceType.
|
|
356
|
+
if (typeof (issuedThroughServiceType === null || issuedThroughServiceType === void 0 ? void 0 : issuedThroughServiceType.codeValue) === 'string') {
|
|
352
357
|
programMembershipUsed = {
|
|
353
358
|
typeOf: factory.permit.PermitType.Permit,
|
|
354
359
|
identifier: programMembershipUsedIdentifier,
|
|
355
360
|
issuedThrough: {
|
|
356
361
|
id: permitIssuedThrough.id,
|
|
357
|
-
serviceType: issuedThroughServiceType,
|
|
362
|
+
serviceType: { codeValue: issuedThroughServiceType.codeValue },
|
|
358
363
|
typeOf: permitIssuedThrough.typeOf
|
|
359
364
|
}
|
|
360
365
|
};
|
|
@@ -383,13 +388,13 @@ function validateProgramMembershipUsed(params) {
|
|
|
383
388
|
.isBefore(moment(now))) {
|
|
384
389
|
throw new factory.errors.Argument('acceptedOffer.itemOffered.serviceOutput.programMembershipUsed', 'unavailable programMembership');
|
|
385
390
|
}
|
|
386
|
-
if (((
|
|
391
|
+
if (((_h = permitIssuedThrough.serviceType) === null || _h === void 0 ? void 0 : _h.typeOf) === 'CategoryCode') {
|
|
387
392
|
programMembershipUsed = {
|
|
388
393
|
typeOf: serviceOutput.typeOf,
|
|
389
394
|
identifier: programMembershipUsedIdentifier,
|
|
390
395
|
issuedThrough: {
|
|
391
396
|
id: permitIssuedThrough.id,
|
|
392
|
-
serviceType: permitIssuedThrough.serviceType,
|
|
397
|
+
serviceType: { codeValue: permitIssuedThrough.serviceType.codeValue },
|
|
393
398
|
typeOf: permitIssuedThrough.typeOf
|
|
394
399
|
}
|
|
395
400
|
};
|
|
@@ -4,6 +4,8 @@ declare function coaTicket2offer(params: {
|
|
|
4
4
|
theaterCode: string;
|
|
5
5
|
ticketResult: COA.factory.master.ITicketResult;
|
|
6
6
|
defaultCurrencyType?: factory.categoryCode.ICategoryCode;
|
|
7
|
-
defaultMembershipType?: factory.categoryCode.ICategoryCode
|
|
7
|
+
defaultMembershipType?: factory.categoryCode.ICategoryCode & {
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
8
10
|
}): factory.aggregateOffer.ISubOffer;
|
|
9
11
|
export { coaTicket2offer };
|
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.381.0-alpha.
|
|
13
|
-
"@cinerino/sdk": "10.5.0-alpha.
|
|
12
|
+
"@chevre/factory": "4.381.0-alpha.7",
|
|
13
|
+
"@cinerino/sdk": "10.5.0-alpha.2",
|
|
14
14
|
"@motionpicture/coa-service": "9.4.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.3.0",
|
|
16
16
|
"@sendgrid/mail": "6.4.0",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"postversion": "git push origin --tags",
|
|
111
111
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
112
112
|
},
|
|
113
|
-
"version": "22.2.0-alpha.
|
|
113
|
+
"version": "22.2.0-alpha.8"
|
|
114
114
|
}
|