@chevre/domain 22.2.0-alpha.4 → 22.2.0-alpha.6
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/{projectReservationFieldsById.ts → projectOwnershipInfoFieldsById.ts} +4 -4
- package/lib/chevre/repo/ownershipInfo.d.ts +5 -3
- package/lib/chevre/repo/ownershipInfo.js +37 -10
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.d.ts +0 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +20 -20
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +0 -2
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -2
- package/lib/chevre/service/order/sendOrder.js +9 -5
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.d.ts +0 -2
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +18 -21
- package/lib/chevre/service/payment/any.d.ts +0 -2
- package/lib/chevre/service/report/ownershipInfo.d.ts +3 -1
- package/lib/chevre/service/task/authorizePayment.js +0 -2
- package/lib/chevre/service/task/onAuthorizationCreated.js +1 -1
- package/package.json +2 -2
package/example/src/chevre/{projectReservationFieldsById.ts → projectOwnershipInfoFieldsById.ts}
RENAMED
|
@@ -8,12 +8,12 @@ import { chevre } from '../../../lib/index';
|
|
|
8
8
|
async function main() {
|
|
9
9
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
const result = await
|
|
11
|
+
const ownershipInfoRepo = await chevre.repository.OwnershipInfo.createInstance(mongoose.connection);
|
|
12
|
+
const result = await ownershipInfoRepo.projectFieldsById(
|
|
13
13
|
{
|
|
14
|
-
id: '
|
|
15
|
-
inclusion: ['reservationStatus', 'reservationFor.id']
|
|
14
|
+
id: 'd9080760-1bdb-49cf-86eb-50f98fab0010'
|
|
16
15
|
}
|
|
16
|
+
// ['id', 'typeOfGood']
|
|
17
17
|
);
|
|
18
18
|
// tslint:disable-next-line:no-null-keyword
|
|
19
19
|
console.dir(result, { depth: null });
|
|
@@ -35,10 +35,12 @@ export declare class OwnershipInfoRepo {
|
|
|
35
35
|
/**
|
|
36
36
|
* なければ作成する
|
|
37
37
|
*/
|
|
38
|
-
createIfNotExistByIdentifier(ownershipInfo: IOwnershipInfo): Promise<
|
|
39
|
-
findById(params: {
|
|
38
|
+
createIfNotExistByIdentifier(ownershipInfo: Omit<IOwnershipInfo, 'id'>): Promise<{
|
|
40
39
|
id: string;
|
|
41
|
-
}
|
|
40
|
+
}>;
|
|
41
|
+
projectFieldsById(params: {
|
|
42
|
+
id: string;
|
|
43
|
+
}, inclusion?: (keyof IOwnershipInfo)[]): Promise<IOwnershipInfo>;
|
|
42
44
|
/**
|
|
43
45
|
* 所有権を検索する
|
|
44
46
|
*/
|
|
@@ -233,11 +233,14 @@ class OwnershipInfoRepo {
|
|
|
233
233
|
new: true,
|
|
234
234
|
upsert: true,
|
|
235
235
|
projection: {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
_id: 0,
|
|
237
|
+
id: { $toString: '$_id' }
|
|
238
|
+
// __v: 0,
|
|
239
|
+
// createdAt: 0,
|
|
240
|
+
// updatedAt: 0
|
|
239
241
|
}
|
|
240
242
|
})
|
|
243
|
+
.lean()
|
|
241
244
|
.exec();
|
|
242
245
|
}
|
|
243
246
|
catch (error) {
|
|
@@ -254,26 +257,50 @@ class OwnershipInfoRepo {
|
|
|
254
257
|
if (duplicate) {
|
|
255
258
|
// 重複の場合、再度取得
|
|
256
259
|
doc = yield this.ownershipInfoModel.findOne({ identifier: { $eq: ownershipInfo.identifier } }, {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
+
_id: 0,
|
|
261
|
+
id: { $toString: '$_id' }
|
|
262
|
+
// __v: 0,
|
|
263
|
+
// createdAt: 0,
|
|
264
|
+
// updatedAt: 0
|
|
260
265
|
})
|
|
266
|
+
.lean()
|
|
261
267
|
.exec();
|
|
262
268
|
}
|
|
263
269
|
if (doc === undefined || doc === null) {
|
|
264
270
|
throw new factory.errors.NotFound(this.ownershipInfoModel.modelName);
|
|
265
271
|
}
|
|
266
|
-
return doc.
|
|
272
|
+
return { id: doc.id };
|
|
273
|
+
// return <IOwnershipInfo>doc.toObject();
|
|
267
274
|
});
|
|
268
275
|
}
|
|
269
|
-
|
|
276
|
+
projectFieldsById(params, inclusion) {
|
|
270
277
|
return __awaiter(this, void 0, void 0, function* () {
|
|
271
|
-
|
|
278
|
+
let projection = {
|
|
279
|
+
_id: 0,
|
|
280
|
+
id: { $toString: '$_id' },
|
|
281
|
+
project: 1,
|
|
282
|
+
typeOf: 1,
|
|
283
|
+
identifier: 1,
|
|
284
|
+
ownedBy: 1,
|
|
285
|
+
acquiredFrom: 1,
|
|
286
|
+
ownedFrom: 1,
|
|
287
|
+
ownedThrough: 1,
|
|
288
|
+
typeOfGood: 1
|
|
289
|
+
};
|
|
290
|
+
const positiveProjectionFields = (Array.isArray(inclusion))
|
|
291
|
+
? inclusion.filter((key) => key !== 'id' && String(key) !== '_id')
|
|
292
|
+
: undefined;
|
|
293
|
+
if (Array.isArray(positiveProjectionFields)) {
|
|
294
|
+
projection = Object.assign({ _id: 0, id: { $toString: '$_id' } }, Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1]))));
|
|
295
|
+
}
|
|
296
|
+
const doc = yield this.ownershipInfoModel.findOne({ _id: { $eq: params.id } }, projection)
|
|
297
|
+
.lean() // lean(2024-08-15~)
|
|
272
298
|
.exec();
|
|
273
299
|
if (doc === null) {
|
|
274
300
|
throw new factory.errors.NotFound(this.ownershipInfoModel.modelName);
|
|
275
301
|
}
|
|
276
|
-
return doc
|
|
302
|
+
return doc;
|
|
303
|
+
// return doc.toObject();
|
|
277
304
|
});
|
|
278
305
|
}
|
|
279
306
|
/**
|
|
@@ -2,7 +2,6 @@ import * as factory from '../../../../../factory';
|
|
|
2
2
|
import type { JWTCredentials } from '../../../../../credentials/jwt';
|
|
3
3
|
import type { ActionRepo } from '../../../../../repo/action';
|
|
4
4
|
import type { AuthorizationRepo } from '../../../../../repo/authorization';
|
|
5
|
-
import type { OwnershipInfoRepo } from '../../../../../repo/ownershipInfo';
|
|
6
5
|
import type { TicketRepo } from '../../../../../repo/ticket';
|
|
7
6
|
/**
|
|
8
7
|
* チケット化された適用メンバーシップをPermitに変換する
|
|
@@ -18,7 +17,6 @@ declare function requestedProgramMembershipUsed2permit(params: {
|
|
|
18
17
|
}): (repos: {
|
|
19
18
|
action: ActionRepo;
|
|
20
19
|
authorization: AuthorizationRepo;
|
|
21
|
-
ownershipInfo: OwnershipInfoRepo;
|
|
22
20
|
ticket: TicketRepo;
|
|
23
21
|
}, credentials: {
|
|
24
22
|
jwt: JWTCredentials;
|
|
@@ -18,10 +18,9 @@ const CodeService = require("../../../../code");
|
|
|
18
18
|
function requestedProgramMembershipUsed2permit(params) {
|
|
19
19
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
20
20
|
return (repos, credentials) => __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
var _a, _b, _c, _d
|
|
21
|
+
var _a, _b, _c, _d;
|
|
22
22
|
let programMembershipUsedAsPermit;
|
|
23
23
|
const { programMembershipUsed, placeOrder } = params;
|
|
24
|
-
const now = new Date();
|
|
25
24
|
// トークン化されたメンバーシップがリクエストされた場合、実メンバーシップ情報へ変換する
|
|
26
25
|
if (typeof programMembershipUsed === 'string') {
|
|
27
26
|
const { authorizedObject } = yield CodeService.verifyToken({
|
|
@@ -71,33 +70,34 @@ function requestedProgramMembershipUsed2permit(params) {
|
|
|
71
70
|
throw new factory.errors.NotFound('Ticket');
|
|
72
71
|
}
|
|
73
72
|
// 承認を参照
|
|
74
|
-
const { object } = yield repos.authorization.findValidOneByCode({
|
|
73
|
+
const { audience, object } = yield repos.authorization.findValidOneByCode({
|
|
75
74
|
project: { id: params.project.id },
|
|
76
75
|
code: ticket.ticketToken
|
|
77
76
|
});
|
|
78
77
|
if (object.typeOf !== 'OwnershipInfo') {
|
|
79
78
|
throw new factory.errors.Argument('programMembershipUsed', 'invalid authorization');
|
|
80
79
|
}
|
|
81
|
-
const ownershipInfoId = object.id;
|
|
82
|
-
const permitOwnershipInfo = (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
})).shift();
|
|
90
|
-
if (permitOwnershipInfo === undefined) {
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
//
|
|
94
|
-
if (
|
|
95
|
-
throw new factory.errors.Argument('programMembershipUsed', '
|
|
80
|
+
// const ownershipInfoId = object.id;
|
|
81
|
+
// const permitOwnershipInfo = (await repos.ownershipInfo.search({
|
|
82
|
+
// limit: 1,
|
|
83
|
+
// page: 1,
|
|
84
|
+
// project: { id: { $eq: params.project.id } },
|
|
85
|
+
// ids: [ownershipInfoId],
|
|
86
|
+
// ownedFrom: now,
|
|
87
|
+
// ownedThrough: now
|
|
88
|
+
// })).shift();
|
|
89
|
+
// if (permitOwnershipInfo === undefined) {
|
|
90
|
+
// throw new factory.errors.NotFound('OwnershipInfo');
|
|
91
|
+
// }
|
|
92
|
+
// audience検証
|
|
93
|
+
if ((audience === null || audience === void 0 ? void 0 : audience.typeOf) !== factory.transactionType.PlaceOrder || audience.id !== placeOrder.id) {
|
|
94
|
+
throw new factory.errors.Argument('programMembershipUsed', 'audience not matched with placeOrder');
|
|
96
95
|
}
|
|
96
|
+
const permitOwnershipInfo = object;
|
|
97
97
|
if (permitOwnershipInfo.typeOfGood.typeOf !== factory.permit.PermitType.Permit) {
|
|
98
98
|
throw new factory.errors.Argument('programMembershipUsed', 'ownershipInfo.typeOfGood.typeOf must be Permit');
|
|
99
99
|
}
|
|
100
|
-
const issuedThroughTypeOf = (
|
|
100
|
+
const issuedThroughTypeOf = (_c = permitOwnershipInfo.typeOfGood.issuedThrough) === null || _c === void 0 ? void 0 : _c.typeOf;
|
|
101
101
|
if (issuedThroughTypeOf === factory.service.paymentService.PaymentServiceType.FaceToFace) {
|
|
102
102
|
programMembershipUsedAsPermit = {
|
|
103
103
|
identifier: permitOwnershipInfo.typeOfGood.identifier,
|
|
@@ -107,7 +107,7 @@ function requestedProgramMembershipUsed2permit(params) {
|
|
|
107
107
|
}
|
|
108
108
|
else if (issuedThroughTypeOf === factory.product.ProductType.MembershipService
|
|
109
109
|
|| issuedThroughTypeOf === factory.service.paymentService.PaymentServiceType.CreditCard) {
|
|
110
|
-
if (typeof ((
|
|
110
|
+
if (typeof ((_d = permitOwnershipInfo.typeOfGood.issuedThrough) === null || _d === void 0 ? void 0 : _d.id) !== 'string') {
|
|
111
111
|
throw new factory.errors.Argument('programMembershipUsed', 'ownershipInfo.typeOfGood.issuedThrough.id undefined');
|
|
112
112
|
}
|
|
113
113
|
programMembershipUsedAsPermit = {
|
|
@@ -7,7 +7,6 @@ import type { EventRepo, IMinimizedIndividualEvent } from '../../../../repo/even
|
|
|
7
7
|
import type { OfferRepo } from '../../../../repo/offer';
|
|
8
8
|
import type { OfferCatalogRepo } from '../../../../repo/offerCatalog';
|
|
9
9
|
import type { OfferCatalogItemRepo } from '../../../../repo/offerCatalogItem';
|
|
10
|
-
import type { OwnershipInfoRepo } from '../../../../repo/ownershipInfo';
|
|
11
10
|
import type { PaymentServiceRepo } from '../../../../repo/paymentService';
|
|
12
11
|
import type { SeatRepo } from '../../../../repo/place/seat';
|
|
13
12
|
import type { PriceSpecificationRepo } from '../../../../repo/priceSpecification';
|
|
@@ -46,7 +45,6 @@ declare function processStartReserve4chevre(params: {
|
|
|
46
45
|
offerCatalog: OfferCatalogRepo;
|
|
47
46
|
offerCatalogItem: OfferCatalogItemRepo;
|
|
48
47
|
offerRateLimit: OfferRateLimitRepo;
|
|
49
|
-
ownershipInfo: OwnershipInfoRepo;
|
|
50
48
|
paymentService: PaymentServiceRepo;
|
|
51
49
|
product: ProductRepo;
|
|
52
50
|
productOffer: ProductOfferRepo;
|
|
@@ -9,7 +9,6 @@ import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
|
9
9
|
import type { OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
|
|
10
10
|
import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
11
11
|
import type { OrderNumberRepo } from '../../../repo/orderNumber';
|
|
12
|
-
import type { OwnershipInfoRepo } from '../../../repo/ownershipInfo';
|
|
13
12
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
14
13
|
import type { SeatRepo } from '../../../repo/place/seat';
|
|
15
14
|
import type { PriceSpecificationRepo } from '../../../repo/priceSpecification';
|
|
@@ -34,7 +33,6 @@ interface IAuthorizeRepos {
|
|
|
34
33
|
offerRateLimit: OfferRateLimitRepo;
|
|
35
34
|
orderInTransaction: OrderInTransactionRepo;
|
|
36
35
|
orderNumber: OrderNumberRepo;
|
|
37
|
-
ownershipInfo: OwnershipInfoRepo;
|
|
38
36
|
paymentService: PaymentServiceRepo;
|
|
39
37
|
priceSpecification: PriceSpecificationRepo;
|
|
40
38
|
product: ProductRepo;
|
|
@@ -86,7 +86,8 @@ function sendOrder(params) {
|
|
|
86
86
|
typeOf: factory.actionType.SendAction
|
|
87
87
|
};
|
|
88
88
|
const action = yield repos.action.start(sendOrderActionAttributes);
|
|
89
|
-
let
|
|
89
|
+
let creatingOwnershipInfos = [];
|
|
90
|
+
let createdOwnershipInfos = [];
|
|
90
91
|
let allOffersDelivered = false;
|
|
91
92
|
let acceptedOffers;
|
|
92
93
|
// 所有権生成を最小化(2024-03-01~)
|
|
@@ -111,12 +112,15 @@ function sendOrder(params) {
|
|
|
111
112
|
debug('delivering...', order.orderNumber, acceptedOffers.map((offer) => `${offer.itemOffered.id}`), params.object.acceptedOffers, 'offerIndexBase:', offerIndexBase);
|
|
112
113
|
// 所有権作成
|
|
113
114
|
if (createOwnerships) {
|
|
114
|
-
|
|
115
|
+
creatingOwnershipInfos = (0, factory_1.createOwnershipInfosFromOrder)({
|
|
115
116
|
order: Object.assign(Object.assign({}, order), { acceptedOffers }),
|
|
116
117
|
offerIndexBase
|
|
117
118
|
});
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
createdOwnershipInfos = yield Promise.all(creatingOwnershipInfos.map((creatingOwnershipInfo) => __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
const { id } = yield repos.ownershipInfo.createIfNotExistByIdentifier(creatingOwnershipInfo);
|
|
121
|
+
return Object.assign({ id }, (typeof creatingOwnershipInfo.identifier === 'string')
|
|
122
|
+
? { identifier: creatingOwnershipInfo.identifier }
|
|
123
|
+
: undefined);
|
|
120
124
|
})));
|
|
121
125
|
}
|
|
122
126
|
// const deliveredCount = limit * page;
|
|
@@ -140,7 +144,7 @@ function sendOrder(params) {
|
|
|
140
144
|
}
|
|
141
145
|
throw error;
|
|
142
146
|
}
|
|
143
|
-
const result =
|
|
147
|
+
const result = createdOwnershipInfos;
|
|
144
148
|
yield repos.action.completeWithVoid({ typeOf: sendOrderActionAttributes.typeOf, id: action.id, result: result });
|
|
145
149
|
debug('allOffersDelivered?:', allOffersDelivered, order.orderNumber);
|
|
146
150
|
if (params.useOnOrderStatusChanged) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
2
|
import type { AuthorizationRepo } from '../../../repo/authorization';
|
|
3
|
-
import type { OwnershipInfoRepo } from '../../../repo/ownershipInfo';
|
|
4
3
|
import type { TicketRepo } from '../../../repo/ticket';
|
|
5
4
|
type IObjectWithoutDetail = factory.action.authorize.paymentMethod.any.IObjectWithoutDetail & {
|
|
6
5
|
ticketToken?: string;
|
|
@@ -14,7 +13,6 @@ declare function verifyTicketTokenAsNeeded(params: {
|
|
|
14
13
|
purpose: factory.action.authorize.paymentMethod.any.IPurpose;
|
|
15
14
|
}): (repos: {
|
|
16
15
|
authorization: AuthorizationRepo;
|
|
17
|
-
ownershipInfo: OwnershipInfoRepo;
|
|
18
16
|
ticket: TicketRepo;
|
|
19
17
|
}) => Promise<{
|
|
20
18
|
permit: Pick<factory.ownershipInfo.IPermitAsGood, 'identifier'> | undefined;
|
|
@@ -13,7 +13,7 @@ exports.verifyTicketTokenAsNeeded = void 0;
|
|
|
13
13
|
const factory = require("../../../factory");
|
|
14
14
|
function verifyTicketTokenAsNeeded(params) {
|
|
15
15
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
var _a;
|
|
16
|
+
var _a, _b;
|
|
17
17
|
const { paymentServiceType, object, project } = params;
|
|
18
18
|
const { ticketToken } = object;
|
|
19
19
|
let permit;
|
|
@@ -41,32 +41,29 @@ function verifyTicketTokenAsNeeded(params) {
|
|
|
41
41
|
if (authorizedObject.typeOf !== 'OwnershipInfo') {
|
|
42
42
|
throw new factory.errors.Argument('ticketToken', 'must be OwnershipInfo');
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
project: { id: { $eq: params.project.id } },
|
|
49
|
-
ids: [ownershipInfoId]
|
|
50
|
-
})).shift();
|
|
51
|
-
if (permitOwnershipInfo === undefined) {
|
|
52
|
-
throw new factory.errors.NotFound('OwnershipInfo');
|
|
44
|
+
// audience検証
|
|
45
|
+
if (((_a = validAuthorization.audience) === null || _a === void 0 ? void 0 : _a.typeOf) !== factory.transactionType.PlaceOrder
|
|
46
|
+
|| validAuthorization.audience.id !== params.purpose.id) {
|
|
47
|
+
throw new factory.errors.Argument('ticketToken', 'audience not matched with placeOrder');
|
|
53
48
|
}
|
|
54
|
-
const
|
|
49
|
+
const permitOwnershipInfo = authorizedObject;
|
|
50
|
+
// const ownershipInfoId = authorizedObject.id;
|
|
51
|
+
// const permitOwnershipInfo = (await repos.ownershipInfo.search({
|
|
52
|
+
// limit: 1,
|
|
53
|
+
// page: 1,
|
|
54
|
+
// project: { id: { $eq: params.project.id } },
|
|
55
|
+
// ids: [ownershipInfoId]
|
|
56
|
+
// })).shift();
|
|
57
|
+
// if (permitOwnershipInfo === undefined) {
|
|
58
|
+
// throw new factory.errors.NotFound('OwnershipInfo');
|
|
59
|
+
// }
|
|
60
|
+
const { typeOfGood } = permitOwnershipInfo;
|
|
55
61
|
if (typeOfGood.typeOf !== factory.permit.PermitType.Permit) {
|
|
56
62
|
throw new factory.errors.Argument('ticketToken', 'must be Permit');
|
|
57
63
|
}
|
|
58
|
-
if (((
|
|
64
|
+
if (((_b = typeOfGood.issuedThrough) === null || _b === void 0 ? void 0 : _b.typeOf) !== paymentServiceType) {
|
|
59
65
|
throw new factory.errors.Argument('ticketToken', 'paymentServiceType not matched');
|
|
60
66
|
}
|
|
61
|
-
if (!Array.isArray(ownedBy)) {
|
|
62
|
-
throw new factory.errors.Argument('ticketToken', 'ownershipInfo.ownedBy must be Array');
|
|
63
|
-
}
|
|
64
|
-
if (ownedBy[0].typeOf !== factory.transactionType.PlaceOrder) {
|
|
65
|
-
throw new factory.errors.Argument('ticketToken', 'ownershipInfo.ownedBy.typeOf must be PlaceOrder');
|
|
66
|
-
}
|
|
67
|
-
if (ownedBy[0].id !== params.purpose.id) {
|
|
68
|
-
throw new factory.errors.Argument('ticketToken', 'ownershipInfo.ownedBy.id not matched');
|
|
69
|
-
}
|
|
70
67
|
permit = { identifier: typeOfGood.identifier };
|
|
71
68
|
}
|
|
72
69
|
break;
|
|
@@ -10,7 +10,6 @@ import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
|
10
10
|
import type { AuthorizationRepo } from '../../repo/authorization';
|
|
11
11
|
import type { ConfirmationNumberRepo } from '../../repo/confirmationNumber';
|
|
12
12
|
import type { EventRepo } from '../../repo/event';
|
|
13
|
-
import type { OwnershipInfoRepo } from '../../repo/ownershipInfo';
|
|
14
13
|
import type { PaymentServiceRepo } from '../../repo/paymentService';
|
|
15
14
|
import type { PaymentServiceProviderRepo } from '../../repo/paymentServiceProvider';
|
|
16
15
|
import type { ProductRepo } from '../../repo/product';
|
|
@@ -80,7 +79,6 @@ interface IAuthorizeRepos {
|
|
|
80
79
|
authorization: AuthorizationRepo;
|
|
81
80
|
confirmationNumber: ConfirmationNumberRepo;
|
|
82
81
|
event: EventRepo;
|
|
83
|
-
ownershipInfo: OwnershipInfoRepo;
|
|
84
82
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
85
83
|
paymentService: PaymentServiceRepo;
|
|
86
84
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
@@ -21,5 +21,7 @@ export interface IOwnershipInfoReport {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
export declare function ownershipInfo2report(params: {
|
|
24
|
-
ownershipInfo: factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood
|
|
24
|
+
ownershipInfo: factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
25
27
|
}): IOwnershipInfoReport;
|
|
@@ -17,7 +17,6 @@ const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
|
17
17
|
const authorization_1 = require("../../repo/authorization");
|
|
18
18
|
const confirmationNumber_1 = require("../../repo/confirmationNumber");
|
|
19
19
|
const event_1 = require("../../repo/event");
|
|
20
|
-
const ownershipInfo_1 = require("../../repo/ownershipInfo");
|
|
21
20
|
const paymentService_1 = require("../../repo/paymentService");
|
|
22
21
|
const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
|
|
23
22
|
const product_1 = require("../../repo/product");
|
|
@@ -55,7 +54,6 @@ function call(params) {
|
|
|
55
54
|
authorization: new authorization_1.AuthorizationRepo(connection),
|
|
56
55
|
confirmationNumber: new confirmationNumber_1.ConfirmationNumberRepo(redisClient),
|
|
57
56
|
event: new event_1.EventRepo(connection),
|
|
58
|
-
ownershipInfo: new ownershipInfo_1.OwnershipInfoRepo(connection),
|
|
59
57
|
paymentAccepted: new sellerPaymentAccepted_1.SellerPaymentAcceptedRepo(connection),
|
|
60
58
|
paymentService: new paymentService_1.PaymentServiceRepo(connection),
|
|
61
59
|
paymentServiceProvider: new paymentServiceProvider_1.PaymentServiceProviderRepo(connection),
|
|
@@ -70,7 +70,7 @@ function onAuthorizationCreated(params) {
|
|
|
70
70
|
// 所有権検索
|
|
71
71
|
const ownershipInfoId = authorization.object.id;
|
|
72
72
|
if (typeof ownershipInfoId === 'string' && ownershipInfoId.length > 0) {
|
|
73
|
-
const ownershipInfo = yield repos.ownershipInfo.
|
|
73
|
+
const ownershipInfo = yield repos.ownershipInfo.projectFieldsById({ id: ownershipInfoId }, ['typeOfGood']);
|
|
74
74
|
// 座席予約に対する所有権であれば発券
|
|
75
75
|
if (ownershipInfo.typeOfGood.typeOf === factory.reservationType.EventReservation
|
|
76
76
|
|| ownershipInfo.typeOfGood.typeOf === factory.reservationType.BusReservation) {
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.381.0-alpha.
|
|
12
|
+
"@chevre/factory": "4.381.0-alpha.6",
|
|
13
13
|
"@cinerino/sdk": "10.5.0-alpha.1",
|
|
14
14
|
"@motionpicture/coa-service": "9.4.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.3.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.6"
|
|
114
114
|
}
|