@chevre/domain 24.0.0-alpha.74 → 24.0.0-alpha.75
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/index.d.ts +0 -2
- package/lib/chevre/index.js +0 -8
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.js +5 -5
- package/lib/chevre/service/assetTransaction/registerService/potentialActions.js +0 -1
- package/lib/chevre/service/assetTransaction/registerService.d.ts +3 -0
- package/lib/chevre/service/assetTransaction/registerService.js +2 -55
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +35 -69
- package/lib/chevre/service/assetTransaction/reserve/start.js +18 -85
- package/lib/chevre/service/assetTransaction.d.ts +0 -2
- package/lib/chevre/service/assetTransaction.js +1 -10
- package/lib/chevre/service/task/payment/payByTask.js +4 -4
- package/lib/chevre/service/task/payment/refundByTask.js +4 -4
- package/lib/chevre/service/task/payment/voidPaymentByTask.js +4 -4
- package/lib/chevre/service.d.ts +0 -4
- package/lib/chevre/service.js +1 -21
- package/package.json +1 -3
- package/lib/chevre/pecorinoapi.d.ts +0 -5
- package/lib/chevre/pecorinoapi.js +0 -9
- package/lib/chevre/service/assetTransaction/moneyTransfer/potentialActions.d.ts +0 -7
- package/lib/chevre/service/assetTransaction/moneyTransfer/potentialActions.js +0 -104
- package/lib/chevre/service/assetTransaction/moneyTransfer.d.ts +0 -51
- package/lib/chevre/service/assetTransaction/moneyTransfer.js +0 -444
- package/lib/chevre/service/assetTransaction/pay/start/account/validation.d.ts +0 -8
- package/lib/chevre/service/assetTransaction/pay/start/account/validation.js +0 -43
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeAccount.d.ts +0 -13
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeAccount.js +0 -72
- package/lib/chevre/service/delivery.d.ts +0 -27
- package/lib/chevre/service/delivery.js +0 -315
- package/lib/chevre/service/moneyTransfer.d.ts +0 -76
- package/lib/chevre/service/moneyTransfer.js +0 -669
- package/lib/chevre/service/payment/paymentCard.d.ts +0 -42
- package/lib/chevre/service/payment/paymentCard.js +0 -452
- package/lib/chevre/service/task/cancelMoneyTransfer.d.ts +0 -6
- package/lib/chevre/service/task/cancelMoneyTransfer.js +0 -19
- package/lib/chevre/service/task/givePointAward.d.ts +0 -6
- package/lib/chevre/service/task/givePointAward.js +0 -65
- package/lib/chevre/service/task/moneyTransfer.d.ts +0 -6
- package/lib/chevre/service/task/moneyTransfer.js +0 -59
- package/lib/chevre/service/task/returnPointAward.d.ts +0 -6
- package/lib/chevre/service/task/returnPointAward.js +0 -65
package/lib/chevre/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type * as Pecorinoapi from './pecorinoapi';
|
|
2
1
|
import { credentials } from './credentials';
|
|
3
2
|
import * as errorHandler from './errorHandler';
|
|
4
3
|
import * as eventEmitter from './eventEmitter';
|
|
@@ -8,4 +7,3 @@ import * as service from './service';
|
|
|
8
7
|
import * as settings from './settings';
|
|
9
8
|
import * as taskSettings from './taskSettings';
|
|
10
9
|
export { credentials, errorHandler, eventEmitter, factory, repository, service, settings, taskSettings };
|
|
11
|
-
export declare function loadPecorinoapi(): Promise<typeof Pecorinoapi>;
|
package/lib/chevre/index.js
CHANGED
|
@@ -34,7 +34,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.taskSettings = exports.settings = exports.service = exports.repository = exports.factory = exports.eventEmitter = exports.errorHandler = exports.credentials = void 0;
|
|
37
|
-
exports.loadPecorinoapi = loadPecorinoapi;
|
|
38
37
|
const credentials_1 = require("./credentials");
|
|
39
38
|
Object.defineProperty(exports, "credentials", { enumerable: true, get: function () { return credentials_1.credentials; } });
|
|
40
39
|
const errorHandler = __importStar(require("./errorHandler"));
|
|
@@ -51,10 +50,3 @@ const settings = __importStar(require("./settings"));
|
|
|
51
50
|
exports.settings = settings;
|
|
52
51
|
const taskSettings = __importStar(require("./taskSettings"));
|
|
53
52
|
exports.taskSettings = taskSettings;
|
|
54
|
-
let pecorinoapi;
|
|
55
|
-
async function loadPecorinoapi() {
|
|
56
|
-
if (pecorinoapi === undefined) {
|
|
57
|
-
pecorinoapi = await import('./pecorinoapi.js');
|
|
58
|
-
}
|
|
59
|
-
return pecorinoapi;
|
|
60
|
-
}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.processAuthorize = processAuthorize;
|
|
4
4
|
const factory_1 = require("../../../../factory");
|
|
5
5
|
const factory_2 = require("./factory");
|
|
6
|
-
const processAuthorizeAccount_1 = require("./processAuthorizeAccount");
|
|
7
6
|
const processAuthorizeCreditCard_1 = require("./processAuthorizeCreditCard");
|
|
8
7
|
const processAuthorizeMovieTicket_1 = require("./processAuthorizeMovieTicket");
|
|
9
8
|
/**
|
|
@@ -11,14 +10,15 @@ const processAuthorizeMovieTicket_1 = require("./processAuthorizeMovieTicket");
|
|
|
11
10
|
*/
|
|
12
11
|
function processAuthorize(params, options, transactionBeforeAuthorize, paymentServiceType, paymentService) {
|
|
13
12
|
return async (repos, settings) => {
|
|
14
|
-
|
|
13
|
+
const transaction = transactionBeforeAuthorize;
|
|
15
14
|
switch (paymentServiceType) {
|
|
16
15
|
case factory_1.factory.service.paymentService.PaymentServiceType.FaceToFace:
|
|
17
16
|
// 対面決済は特に何もしない
|
|
18
17
|
break;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
// discontinue(2026-04-17~)
|
|
19
|
+
// case factory.service.paymentService.PaymentServiceType.PaymentCard:
|
|
20
|
+
// transaction = await processAuthorizeAccount(params, transactionBeforeAuthorize, String(paymentService?.id))(repos);
|
|
21
|
+
// break;
|
|
22
22
|
case factory_1.factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
23
23
|
await (0, processAuthorizeCreditCard_1.processAuthorizeCreditCard)(params, transactionBeforeAuthorize, String(paymentService?.id), (0, factory_2.createAuthorizeCreditCardOptions)(options))(repos, settings);
|
|
24
24
|
break;
|
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createPotentialActions = createPotentialActions;
|
|
7
|
-
// import * as pecorinoapi from '@pecorino/api-nodejs-client';
|
|
8
7
|
const moment_1 = __importDefault(require("moment"));
|
|
9
8
|
const factory_1 = require("../../../factory");
|
|
10
9
|
const MAX_VALID_UNTIL = '3000-01-01T00:00:00Z';
|
|
@@ -40,7 +40,6 @@ exports.exportTasksById = exportTasksById;
|
|
|
40
40
|
/**
|
|
41
41
|
* サービス登録取引サービス
|
|
42
42
|
*/
|
|
43
|
-
const pecorinoapi = __importStar(require("../../pecorinoapi"));
|
|
44
43
|
const factory_1 = require("../../factory");
|
|
45
44
|
const searchProductOffers_1 = require("../offer/product/searchProductOffers");
|
|
46
45
|
const factory_2 = require("./registerService/factory");
|
|
@@ -136,7 +135,8 @@ function createTransactionObject(params) {
|
|
|
136
135
|
if (offer === undefined) {
|
|
137
136
|
throw new factory_1.factory.errors.NotFound('Offer', `Offer ${acceptedOffer.id} not found`);
|
|
138
137
|
}
|
|
139
|
-
|
|
138
|
+
// discontinue(2026-04-17~)
|
|
139
|
+
// await validatePointAward({ project: { id: params.project.id }, acceptedOffer })(repos);
|
|
140
140
|
const pointAward = (0, factory_2.createPointAward)({
|
|
141
141
|
acceptedOffer: acceptedOffer,
|
|
142
142
|
offer: offer
|
|
@@ -163,59 +163,6 @@ function createTransactionObject(params) {
|
|
|
163
163
|
return transactionObject;
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
-
function createPermitService(params) {
|
|
167
|
-
return async (repos) => {
|
|
168
|
-
const product = (await repos.product.projectFields({
|
|
169
|
-
limit: 1,
|
|
170
|
-
page: 1,
|
|
171
|
-
id: { $eq: params.issuedThrough.id }
|
|
172
|
-
}, ['availableChannel']
|
|
173
|
-
// []
|
|
174
|
-
)).shift();
|
|
175
|
-
if (product === undefined) {
|
|
176
|
-
throw new factory_1.factory.errors.NotFound('Product');
|
|
177
|
-
}
|
|
178
|
-
const permitServiceEndpoint = product.availableChannel?.serviceUrl;
|
|
179
|
-
const permitServiceAuthorizeServerDomain = product.availableChannel?.credentials?.authorizeServerDomain;
|
|
180
|
-
const permitServiceClientId = product.availableChannel?.credentials?.clientId;
|
|
181
|
-
const permitServiceClientSecret = product.availableChannel?.credentials?.clientSecret;
|
|
182
|
-
if (typeof permitServiceEndpoint !== 'string' || permitServiceEndpoint.length === 0
|
|
183
|
-
|| typeof permitServiceAuthorizeServerDomain !== 'string' || permitServiceAuthorizeServerDomain.length === 0
|
|
184
|
-
|| typeof permitServiceClientId !== 'string' || permitServiceClientId.length === 0
|
|
185
|
-
|| typeof permitServiceClientSecret !== 'string' || permitServiceClientSecret.length === 0) {
|
|
186
|
-
throw new factory_1.factory.errors.Internal('product availableChannel invalid');
|
|
187
|
-
}
|
|
188
|
-
return new (await pecorinoapi.loadPecorino()).service.Permit({
|
|
189
|
-
endpoint: permitServiceEndpoint,
|
|
190
|
-
auth: await pecorinoapi.auth.ClientCredentials.createInstance({
|
|
191
|
-
domain: permitServiceAuthorizeServerDomain,
|
|
192
|
-
clientId: permitServiceClientId,
|
|
193
|
-
clientSecret: permitServiceClientSecret,
|
|
194
|
-
scopes: [],
|
|
195
|
-
state: ''
|
|
196
|
-
})
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
function validatePointAward(params) {
|
|
201
|
-
return async (repos) => {
|
|
202
|
-
// Permit識別子確認
|
|
203
|
-
const permitIdentifier = params.acceptedOffer.itemOffered?.pointAward?.toLocation?.identifier;
|
|
204
|
-
const issuedThroughId = params.acceptedOffer.itemOffered.pointAward?.toLocation?.issuedThrough.id;
|
|
205
|
-
if (typeof permitIdentifier === 'string' && permitIdentifier.length > 0) {
|
|
206
|
-
if (typeof issuedThroughId !== 'string' || issuedThroughId.length === 0) {
|
|
207
|
-
throw new factory_1.factory.errors.ArgumentNull('acceptedOffer.itemOffered.pointAward.toLocation.issuedThrough.id');
|
|
208
|
-
}
|
|
209
|
-
// pointAwardの指定がある場合、Permitの存在確認
|
|
210
|
-
const permitService = await createPermitService({ issuedThrough: { id: issuedThroughId } })(repos);
|
|
211
|
-
await permitService.findByIdentifier({
|
|
212
|
-
project: { id: params.project.id },
|
|
213
|
-
identifier: permitIdentifier,
|
|
214
|
-
issuedThrough: { typeOf: factory_1.factory.product.ProductType.PaymentCard }
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
166
|
/**
|
|
220
167
|
* 取引確定
|
|
221
168
|
*/
|
|
@@ -40,7 +40,6 @@ exports.createSubReservations = createSubReservations;
|
|
|
40
40
|
const debug_1 = __importDefault(require("debug"));
|
|
41
41
|
const moment_1 = __importDefault(require("moment"));
|
|
42
42
|
const factory_1 = require("../../../../factory");
|
|
43
|
-
const pecorinoapi = __importStar(require("../../../../pecorinoapi"));
|
|
44
43
|
// import * as OfferService from '../../../offer';
|
|
45
44
|
const ProductOfferService = __importStar(require("../../../offer/product"));
|
|
46
45
|
const createReservation_1 = require("./factory/createReservation");
|
|
@@ -375,7 +374,7 @@ function validateAdvanceBookingRequirement(params) {
|
|
|
375
374
|
}
|
|
376
375
|
function validateProgramMembershipUsed(params) {
|
|
377
376
|
return async (repos) => {
|
|
378
|
-
const now = new Date();
|
|
377
|
+
// const now = new Date();
|
|
379
378
|
let programMembershipUsed;
|
|
380
379
|
const requestedProgramMembershipUsed = params.acceptedOffer.itemOffered?.serviceOutput?.programMembershipUsed;
|
|
381
380
|
if (typeof requestedProgramMembershipUsed === 'string') {
|
|
@@ -472,39 +471,40 @@ function validateProgramMembershipUsed(params) {
|
|
|
472
471
|
}
|
|
473
472
|
break;
|
|
474
473
|
}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
474
|
+
// discontinue(2026-04-17~)
|
|
475
|
+
// case factory.product.ProductType.MembershipService: {
|
|
476
|
+
// // requestedProgramMembershipUsedの発行サービスIDから外部連携設定を取得する
|
|
477
|
+
// const permitService = await createPermitService({ issuedThrough: { id: permitIssuedThrough.id } })(repos);
|
|
478
|
+
// // メンバーシップの存在確認
|
|
479
|
+
// const serviceOutput = await permitService.findByIdentifier({
|
|
480
|
+
// project: { id: params.project.id },
|
|
481
|
+
// identifier: programMembershipUsedIdentifier,
|
|
482
|
+
// issuedThrough: { typeOf: factory.product.ProductType.MembershipService }
|
|
483
|
+
// });
|
|
484
|
+
// // 有効期間のチェック
|
|
485
|
+
// if (serviceOutput.validFrom === undefined || serviceOutput.validFrom === null
|
|
486
|
+
// || serviceOutput.validUntil === undefined || serviceOutput.validUntil === null) {
|
|
487
|
+
// throw new factory.errors.Argument('acceptedOffer.itemOffered.serviceOutput.programMembershipUsed', 'not valid programMembership');
|
|
488
|
+
// }
|
|
489
|
+
// if (moment(serviceOutput.validFrom)
|
|
490
|
+
// .isAfter(moment(now))
|
|
491
|
+
// || moment(serviceOutput.validUntil)
|
|
492
|
+
// .isBefore(moment(now))) {
|
|
493
|
+
// throw new factory.errors.Argument('acceptedOffer.itemOffered.serviceOutput.programMembershipUsed', 'unavailable programMembership');
|
|
494
|
+
// }
|
|
495
|
+
// if (permitIssuedThrough.serviceType?.typeOf === 'CategoryCode') {
|
|
496
|
+
// programMembershipUsed = {
|
|
497
|
+
// typeOf: factory.programMembership.ProgramMembershipType.ProgramMembership,
|
|
498
|
+
// identifier: programMembershipUsedIdentifier,
|
|
499
|
+
// issuedThrough: {
|
|
500
|
+
// id: permitIssuedThrough.id,
|
|
501
|
+
// serviceType: { codeValue: permitIssuedThrough.serviceType.codeValue },
|
|
502
|
+
// typeOf: permitIssuedThrough.typeOf
|
|
503
|
+
// }
|
|
504
|
+
// };
|
|
505
|
+
// }
|
|
506
|
+
// break;
|
|
507
|
+
// }
|
|
508
508
|
default:
|
|
509
509
|
throw new factory_1.factory.errors.Argument('acceptedOffer.itemOffered.serviceOutput.programMembershipUsed', `${permitIssuedThrough.typeOf} not implemented`);
|
|
510
510
|
}
|
|
@@ -512,37 +512,3 @@ function validateProgramMembershipUsed(params) {
|
|
|
512
512
|
return programMembershipUsed;
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
|
-
function createPermitService(params) {
|
|
516
|
-
return async (repos) => {
|
|
517
|
-
const product = (await repos.product.projectFields({
|
|
518
|
-
limit: 1,
|
|
519
|
-
page: 1,
|
|
520
|
-
id: { $eq: params.issuedThrough.id }
|
|
521
|
-
}, ['availableChannel']
|
|
522
|
-
// []
|
|
523
|
-
)).shift();
|
|
524
|
-
if (product === undefined) {
|
|
525
|
-
throw new factory_1.factory.errors.NotFound('Product');
|
|
526
|
-
}
|
|
527
|
-
const permitServiceEndpoint = product.availableChannel?.serviceUrl;
|
|
528
|
-
const permitServiceAuthorizeServerDomain = product.availableChannel?.credentials?.authorizeServerDomain;
|
|
529
|
-
const permitServiceClientId = product.availableChannel?.credentials?.clientId;
|
|
530
|
-
const permitServiceClientSecret = product.availableChannel?.credentials?.clientSecret;
|
|
531
|
-
if (typeof permitServiceEndpoint !== 'string' || permitServiceEndpoint.length === 0
|
|
532
|
-
|| typeof permitServiceAuthorizeServerDomain !== 'string' || permitServiceAuthorizeServerDomain.length === 0
|
|
533
|
-
|| typeof permitServiceClientId !== 'string' || permitServiceClientId.length === 0
|
|
534
|
-
|| typeof permitServiceClientSecret !== 'string' || permitServiceClientSecret.length === 0) {
|
|
535
|
-
throw new factory_1.factory.errors.Internal('product availableChannel invalid');
|
|
536
|
-
}
|
|
537
|
-
return new (await pecorinoapi.loadPecorino()).service.Permit({
|
|
538
|
-
endpoint: permitServiceEndpoint,
|
|
539
|
-
auth: await pecorinoapi.auth.ClientCredentials.createInstance({
|
|
540
|
-
domain: permitServiceAuthorizeServerDomain,
|
|
541
|
-
clientId: permitServiceClientId,
|
|
542
|
-
clientSecret: permitServiceClientSecret,
|
|
543
|
-
scopes: [],
|
|
544
|
-
state: ''
|
|
545
|
-
})
|
|
546
|
-
});
|
|
547
|
-
};
|
|
548
|
-
}
|
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
@@ -40,7 +7,6 @@ exports.start = start;
|
|
|
40
7
|
const debug_1 = __importDefault(require("debug"));
|
|
41
8
|
const moment_1 = __importDefault(require("moment"));
|
|
42
9
|
const factory_1 = require("../../../factory");
|
|
43
|
-
const pecorinoapi = __importStar(require("../../../pecorinoapi"));
|
|
44
10
|
const seat_1 = require("../../../repo/place/seat");
|
|
45
11
|
const searchOffersByIds_1 = require("../../offer/event/searchOffersByIds");
|
|
46
12
|
const cancelReservation_1 = require("../../reserve/cancelReservation");
|
|
@@ -440,57 +406,24 @@ function getAcceptedSeatNumbersAndSeatSections(params) {
|
|
|
440
406
|
acceptedSeatSections
|
|
441
407
|
};
|
|
442
408
|
}
|
|
443
|
-
function
|
|
444
|
-
return async (
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
//
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|| typeof permitServiceClientId !== 'string' || permitServiceClientId.length === 0
|
|
462
|
-
|| typeof permitServiceClientSecret !== 'string' || permitServiceClientSecret.length === 0) {
|
|
463
|
-
throw new factory_1.factory.errors.Internal('product availableChannel invalid');
|
|
464
|
-
}
|
|
465
|
-
return new (await pecorinoapi.loadPecorino()).service.Permit({
|
|
466
|
-
endpoint: permitServiceEndpoint,
|
|
467
|
-
auth: await pecorinoapi.auth.ClientCredentials.createInstance({
|
|
468
|
-
domain: permitServiceAuthorizeServerDomain,
|
|
469
|
-
clientId: permitServiceClientId,
|
|
470
|
-
clientSecret: permitServiceClientSecret,
|
|
471
|
-
scopes: [],
|
|
472
|
-
state: ''
|
|
473
|
-
})
|
|
474
|
-
});
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
function validatePointAward(params) {
|
|
478
|
-
return async (repos) => {
|
|
479
|
-
// 口座番号確認ではなく、Permit識別子確認
|
|
480
|
-
const permitIdentifier = params.acceptedOffer.itemOffered?.pointAward?.toLocation?.identifier;
|
|
481
|
-
const issuedThroughId = params.acceptedOffer.itemOffered?.pointAward?.toLocation?.issuedThrough?.id;
|
|
482
|
-
if (typeof permitIdentifier === 'string' && permitIdentifier.length > 0) {
|
|
483
|
-
if (typeof issuedThroughId !== 'string' || issuedThroughId.length === 0) {
|
|
484
|
-
throw new factory_1.factory.errors.ArgumentNull('acceptedOffer.itemOffered.pointAward.toLocation.issuedThrough.id');
|
|
485
|
-
}
|
|
486
|
-
// pointAwardの指定がある場合、Permitの存在確認
|
|
487
|
-
const permitService = await createPermitService({ issuedThrough: { id: issuedThroughId } })(repos);
|
|
488
|
-
await permitService.findByIdentifier({
|
|
489
|
-
project: { id: params.project.id },
|
|
490
|
-
identifier: permitIdentifier,
|
|
491
|
-
issuedThrough: { typeOf: factory_1.factory.product.ProductType.PaymentCard }
|
|
492
|
-
});
|
|
493
|
-
}
|
|
409
|
+
function validatePointAward(_params) {
|
|
410
|
+
return async (_repos) => {
|
|
411
|
+
// pointAwardを廃止したので何もしない(2026-04-17~)
|
|
412
|
+
// // 口座番号確認ではなく、Permit識別子確認
|
|
413
|
+
// const permitIdentifier = params.acceptedOffer.itemOffered?.pointAward?.toLocation?.identifier;
|
|
414
|
+
// const issuedThroughId = params.acceptedOffer.itemOffered?.pointAward?.toLocation?.issuedThrough?.id;
|
|
415
|
+
// if (typeof permitIdentifier === 'string' && permitIdentifier.length > 0) {
|
|
416
|
+
// if (typeof issuedThroughId !== 'string' || issuedThroughId.length === 0) {
|
|
417
|
+
// throw new factory.errors.ArgumentNull('acceptedOffer.itemOffered.pointAward.toLocation.issuedThrough.id');
|
|
418
|
+
// }
|
|
419
|
+
// // pointAwardの指定がある場合、Permitの存在確認
|
|
420
|
+
// const permitService = await createPermitService({ issuedThrough: { id: issuedThroughId } })(repos);
|
|
421
|
+
// await permitService.findByIdentifier({
|
|
422
|
+
// project: { id: params.project.id },
|
|
423
|
+
// identifier: permitIdentifier,
|
|
424
|
+
// issuedThrough: { typeOf: factory.product.ProductType.PaymentCard }
|
|
425
|
+
// });
|
|
426
|
+
// }
|
|
494
427
|
};
|
|
495
428
|
}
|
|
496
429
|
function processLockOfferRateLimit(params) {
|
|
@@ -2,13 +2,11 @@ import { factory } from '../factory';
|
|
|
2
2
|
import type { AssetTransactionRepo } from '../repo/assetTransaction';
|
|
3
3
|
import type { TaskRepo } from '../repo/task';
|
|
4
4
|
import * as CancelReservationTransactionService from './assetTransaction/cancelReservation';
|
|
5
|
-
import * as MoneyTransferTransactionService from './assetTransaction/moneyTransfer';
|
|
6
5
|
import * as PayTransactionService from './assetTransaction/pay';
|
|
7
6
|
import * as RefundTransactionService from './assetTransaction/refund';
|
|
8
7
|
import * as RegisterServiceTransactionService from './assetTransaction/registerService';
|
|
9
8
|
import * as ReserveTransactionService from './assetTransaction/reserve';
|
|
10
9
|
export import cancelReservation = CancelReservationTransactionService;
|
|
11
|
-
export import moneyTransfer = MoneyTransferTransactionService;
|
|
12
10
|
export import pay = PayTransactionService;
|
|
13
11
|
export import refund = RefundTransactionService;
|
|
14
12
|
export import registerService = RegisterServiceTransactionService;
|
|
@@ -33,17 +33,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.reserve = exports.registerService = exports.refund = exports.pay = exports.
|
|
36
|
+
exports.reserve = exports.registerService = exports.refund = exports.pay = exports.cancelReservation = void 0;
|
|
37
37
|
exports.exportOneTransactionTasksIfExists = exportOneTransactionTasksIfExists;
|
|
38
38
|
const factory_1 = require("../factory");
|
|
39
39
|
const CancelReservationTransactionService = __importStar(require("./assetTransaction/cancelReservation"));
|
|
40
|
-
const MoneyTransferTransactionService = __importStar(require("./assetTransaction/moneyTransfer"));
|
|
41
40
|
const PayTransactionService = __importStar(require("./assetTransaction/pay"));
|
|
42
41
|
const RefundTransactionService = __importStar(require("./assetTransaction/refund"));
|
|
43
42
|
const RegisterServiceTransactionService = __importStar(require("./assetTransaction/registerService"));
|
|
44
43
|
const ReserveTransactionService = __importStar(require("./assetTransaction/reserve"));
|
|
45
44
|
exports.cancelReservation = CancelReservationTransactionService;
|
|
46
|
-
exports.moneyTransfer = MoneyTransferTransactionService;
|
|
47
45
|
exports.pay = PayTransactionService;
|
|
48
46
|
exports.refund = RefundTransactionService;
|
|
49
47
|
exports.registerService = RegisterServiceTransactionService;
|
|
@@ -75,13 +73,6 @@ function exportOneTransactionTasksIfExists(params) {
|
|
|
75
73
|
// runsTasksAfterInSeconds: params.runsTasksAfterInSeconds
|
|
76
74
|
})(repos);
|
|
77
75
|
break;
|
|
78
|
-
case factory_1.factory.assetTransactionType.MoneyTransfer:
|
|
79
|
-
// createdTasks =
|
|
80
|
-
await MoneyTransferTransactionService.exportTasksById({
|
|
81
|
-
id: transaction.id,
|
|
82
|
-
runsTasksAfterInSeconds: params.runsTasksAfterInSeconds
|
|
83
|
-
})(repos);
|
|
84
|
-
break;
|
|
85
76
|
case factory_1.factory.assetTransactionType.Pay:
|
|
86
77
|
// createdTasks =
|
|
87
78
|
await PayTransactionService.exportTasksById({
|
|
@@ -44,7 +44,6 @@ const CreditCardPaymentService = __importStar(require("../../payment/creditCard"
|
|
|
44
44
|
const FaceToFacePaymentService = __importStar(require("../../payment/faceToFace"));
|
|
45
45
|
const factory_2 = require("../../payment/factory");
|
|
46
46
|
const MovieTicketPaymentService = __importStar(require("../../payment/movieTicket"));
|
|
47
|
-
const PaymentCardPaymentService = __importStar(require("../../payment/paymentCard"));
|
|
48
47
|
const debug = (0, debug_1.default)('chevre-domain:service:payment');
|
|
49
48
|
function fixOrderAsPurpose(params, transaction) {
|
|
50
49
|
return async (repos) => {
|
|
@@ -181,9 +180,10 @@ payActionAttributes) {
|
|
|
181
180
|
case factory_1.factory.service.paymentService.PaymentServiceType.FaceToFace:
|
|
182
181
|
await FaceToFacePaymentService.payFaceToFace(payActionAttributes)(repos);
|
|
183
182
|
break;
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
// discontinue(2026-04-17~)
|
|
184
|
+
// case factory.service.paymentService.PaymentServiceType.PaymentCard:
|
|
185
|
+
// await PaymentCardPaymentService.payPaymentCard(payActionAttributes)(repos);
|
|
186
|
+
// break;
|
|
187
187
|
case factory_1.factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
188
188
|
await CreditCardPaymentService.payCreditCard(payActionAttributes)(repos, settings);
|
|
189
189
|
break;
|
|
@@ -38,7 +38,6 @@ const factory_1 = require("../../../factory");
|
|
|
38
38
|
const CreditCardPaymentService = __importStar(require("../../payment/creditCard"));
|
|
39
39
|
const FaceToFacePaymentService = __importStar(require("../../payment/faceToFace"));
|
|
40
40
|
const MovieTicketPaymentService = __importStar(require("../../payment/movieTicket"));
|
|
41
|
-
const PaymentCardPaymentService = __importStar(require("../../payment/paymentCard"));
|
|
42
41
|
function refundByTask(params) {
|
|
43
42
|
return async (repos, settings) => {
|
|
44
43
|
const paymentServiceType = params.object[0]?.typeOf;
|
|
@@ -46,9 +45,10 @@ function refundByTask(params) {
|
|
|
46
45
|
case factory_1.factory.service.paymentService.PaymentServiceType.FaceToFace:
|
|
47
46
|
await FaceToFacePaymentService.refundFaceToFace(params)(repos);
|
|
48
47
|
break;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
// discontinue(2026-04-17~)
|
|
49
|
+
// case factory.service.paymentService.PaymentServiceType.PaymentCard:
|
|
50
|
+
// await PaymentCardPaymentService.refundPaymentCard(params)(repos);
|
|
51
|
+
// break;
|
|
52
52
|
case factory_1.factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
53
53
|
await CreditCardPaymentService.refundCreditCard(params
|
|
54
54
|
// { requirePayAction: true }
|
|
@@ -38,7 +38,6 @@ const factory_1 = require("../../../factory");
|
|
|
38
38
|
const CreditCardPaymentService = __importStar(require("../../payment/creditCard"));
|
|
39
39
|
const FaceToFacePaymentService = __importStar(require("../../payment/faceToFace"));
|
|
40
40
|
const MovieTicketPaymentService = __importStar(require("../../payment/movieTicket"));
|
|
41
|
-
const PaymentCardPaymentService = __importStar(require("../../payment/paymentCard"));
|
|
42
41
|
function voidPaymentByTask(params) {
|
|
43
42
|
return async (repos, settings) => {
|
|
44
43
|
const paymentServiceType = params.object.object.typeOf;
|
|
@@ -46,9 +45,10 @@ function voidPaymentByTask(params) {
|
|
|
46
45
|
case factory_1.factory.service.paymentService.PaymentServiceType.FaceToFace:
|
|
47
46
|
await FaceToFacePaymentService.voidTransaction(params)(repos);
|
|
48
47
|
break;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
// discontinue(2026-04-17~)
|
|
49
|
+
// case factory.service.paymentService.PaymentServiceType.PaymentCard:
|
|
50
|
+
// await PaymentCardPaymentService.voidTransaction(params)(repos);
|
|
51
|
+
// break;
|
|
52
52
|
case factory_1.factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
53
53
|
await CreditCardPaymentService.voidTransaction(params)(repos, settings);
|
|
54
54
|
break;
|
package/lib/chevre/service.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ import type * as AccountService from './service/account';
|
|
|
11
11
|
import type * as AccountTransactionService from './service/accountTransaction';
|
|
12
12
|
import type * as AggregationService from './service/aggregation';
|
|
13
13
|
import type * as AssetTransactionService from './service/assetTransaction';
|
|
14
|
-
import type * as DeliveryService from './service/delivery';
|
|
15
14
|
import type * as EventService from './service/event';
|
|
16
15
|
import type * as IAMService from './service/iam';
|
|
17
16
|
import type * as NotificationService from './service/notification';
|
|
@@ -35,9 +34,6 @@ export declare namespace aggregation {
|
|
|
35
34
|
export declare namespace assetTransaction {
|
|
36
35
|
function createService(): Promise<typeof AssetTransactionService>;
|
|
37
36
|
}
|
|
38
|
-
export declare namespace delivery {
|
|
39
|
-
function createService(): Promise<typeof DeliveryService>;
|
|
40
|
-
}
|
|
41
37
|
export declare namespace event {
|
|
42
38
|
function createService(): Promise<typeof EventService>;
|
|
43
39
|
}
|
package/lib/chevre/service.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.factory = exports.transaction = exports.task = exports.reserve = exports.project = exports.permit = exports.payment = exports.order = exports.offer = exports.notification = exports.iam = exports.event = exports.
|
|
36
|
+
exports.factory = exports.transaction = exports.task = exports.reserve = exports.project = exports.permit = exports.payment = exports.order = exports.offer = exports.notification = exports.iam = exports.event = exports.assetTransaction = exports.aggregation = exports.accountTransaction = exports.account = void 0;
|
|
37
37
|
/**
|
|
38
38
|
* service module
|
|
39
39
|
*/
|
|
@@ -88,26 +88,6 @@ var assetTransaction;
|
|
|
88
88
|
}
|
|
89
89
|
assetTransaction.createService = createService;
|
|
90
90
|
})(assetTransaction || (exports.assetTransaction = assetTransaction = {}));
|
|
91
|
-
// export namespace code {
|
|
92
|
-
// let service: typeof CodeService | undefined;
|
|
93
|
-
// export async function createService() {
|
|
94
|
-
// if (service === undefined) {
|
|
95
|
-
// service = await import('./service/code');
|
|
96
|
-
// }
|
|
97
|
-
// return service;
|
|
98
|
-
// }
|
|
99
|
-
// }
|
|
100
|
-
var delivery;
|
|
101
|
-
(function (delivery) {
|
|
102
|
-
let service;
|
|
103
|
-
async function createService() {
|
|
104
|
-
if (service === undefined) {
|
|
105
|
-
service = await import('./service/delivery.js');
|
|
106
|
-
}
|
|
107
|
-
return service;
|
|
108
|
-
}
|
|
109
|
-
delivery.createService = createService;
|
|
110
|
-
})(delivery || (exports.delivery = delivery = {}));
|
|
111
91
|
var event;
|
|
112
92
|
(function (event) {
|
|
113
93
|
let service;
|
package/package.json
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
14
|
"@chevre/factory": "7.0.0",
|
|
15
|
-
"@cinerino/sdk": "14.0.0",
|
|
16
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
17
16
|
"@motionpicture/gmo-service": "6.0.0",
|
|
18
17
|
"@sendgrid/client": "8.1.4",
|
|
@@ -47,7 +46,6 @@
|
|
|
47
46
|
"csvtojson": "^2.0.10",
|
|
48
47
|
"dependency-cruiser": "17.3.8",
|
|
49
48
|
"eslint": "9.39.2",
|
|
50
|
-
"jose": "6.0.12",
|
|
51
49
|
"mongodb": "6.20.0",
|
|
52
50
|
"mongoose": "8.23.0",
|
|
53
51
|
"redis": "4.6.5",
|
|
@@ -93,5 +91,5 @@
|
|
|
93
91
|
"postversion": "git push origin --tags",
|
|
94
92
|
"prepublishOnly": "npm run clean && npm run build"
|
|
95
93
|
},
|
|
96
|
-
"version": "24.0.0-alpha.
|
|
94
|
+
"version": "24.0.0-alpha.75"
|
|
97
95
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadPecorino = exports.auth = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Pecorino API Client
|
|
6
|
-
*/
|
|
7
|
-
const sdk_1 = require("@cinerino/sdk");
|
|
8
|
-
Object.defineProperty(exports, "auth", { enumerable: true, get: function () { return sdk_1.auth; } });
|
|
9
|
-
Object.defineProperty(exports, "loadPecorino", { enumerable: true, get: function () { return sdk_1.loadPecorino; } });
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { factory } from '../../../factory';
|
|
2
|
-
/**
|
|
3
|
-
* 取引のポストアクションを作成する
|
|
4
|
-
*/
|
|
5
|
-
export declare function createPotentialActions(params: {
|
|
6
|
-
transaction: factory.assetTransaction.ITransaction<factory.assetTransactionType.MoneyTransfer>;
|
|
7
|
-
}): Promise<factory.assetTransaction.IPotentialActions<factory.assetTransactionType.MoneyTransfer>>;
|