@chevre/domain 24.0.0-alpha.73 → 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/credentials.js +3 -26
- package/lib/chevre/errorHandler.js +15 -38
- package/lib/chevre/eventEmitter.js +17 -7
- package/lib/chevre/index.d.ts +0 -2
- package/lib/chevre/index.js +17 -29
- package/lib/chevre/repo/aggregateOffer.js +3 -26
- package/lib/chevre/repo/event.js +17 -7
- package/lib/chevre/repo/eventSeries.js +1 -24
- package/lib/chevre/repo/offerCatalog.js +3 -26
- package/lib/chevre/repository.js +103 -126
- package/lib/chevre/service/accountTransaction.js +17 -7
- package/lib/chevre/service/aggregation.js +17 -7
- package/lib/chevre/service/assetTransaction/pay/check.js +17 -7
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +17 -7
- package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.js +17 -7
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.js +5 -5
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.js +17 -7
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.js +17 -7
- 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 +19 -62
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +52 -76
- package/lib/chevre/service/assetTransaction/reserve/start.js +18 -75
- package/lib/chevre/service/assetTransaction.d.ts +0 -2
- package/lib/chevre/service/assetTransaction.js +18 -17
- package/lib/chevre/service/notification/notifyByEmail.js +1 -1
- package/lib/chevre/service/notification/sendEmailMessage.js +1 -1
- package/lib/chevre/service/notification/triggerWebhook.js +22 -12
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.js +17 -7
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.js +2 -2
- package/lib/chevre/service/offer/product.js +17 -7
- package/lib/chevre/service/offer.js +17 -7
- package/lib/chevre/service/order/confirmPayTransaction.js +17 -7
- package/lib/chevre/service/payment/any/authorize.js +17 -7
- package/lib/chevre/service/payment/any/processVoidPayTransaction.js +17 -7
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +17 -7
- package/lib/chevre/service/payment/creditCard/authorize/handleAuthorizeError.js +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket/processSeatInfoSync.js +1 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket/processSeatInfoSync.js +4 -4
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket/processSeatInfoSyncCancel.js +1 -1
- package/lib/chevre/service/permit.js +17 -7
- package/lib/chevre/service/reserveCOA/cancelReservation.js +1 -1
- package/lib/chevre/service/task/aggregateScreeningEvent.js +17 -7
- package/lib/chevre/service/task/deletePerson.js +2 -25
- package/lib/chevre/service/task/deleteTransaction.js +17 -7
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +17 -7
- package/lib/chevre/service/task/importEventsFromCOA.js +17 -7
- package/lib/chevre/service/task/importOffersFromCOA.js +17 -7
- package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.js +17 -7
- package/lib/chevre/service/task/payment/payByTask.js +21 -11
- package/lib/chevre/service/task/payment/refundByTask.js +21 -11
- package/lib/chevre/service/task/payment/voidPaymentByTask.js +21 -11
- package/lib/chevre/service/task/returnPayTransaction.js +17 -7
- package/lib/chevre/service/task/returnReserveTransaction.js +17 -7
- package/lib/chevre/service/task.js +2 -25
- package/lib/chevre/service/taskHandler.js +3 -26
- package/lib/chevre/service/transaction/returnOrder/preStart/getReturnPolicyByProject.js +5 -5
- package/lib/chevre/service/transaction.js +17 -7
- package/lib/chevre/service.d.ts +0 -4
- package/lib/chevre/service.js +33 -43
- package/lib/index.js +17 -7
- package/package.json +9 -14
- 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 -434
- 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 -62
- package/lib/chevre/service/delivery.d.ts +0 -27
- package/lib/chevre/service/delivery.js +0 -305
- package/lib/chevre/service/moneyTransfer.d.ts +0 -76
- package/lib/chevre/service/moneyTransfer.js +0 -659
- package/lib/chevre/service/payment/paymentCard.d.ts +0 -42
- package/lib/chevre/service/payment/paymentCard.js +0 -442
- 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 -55
- package/lib/chevre/service/task/moneyTransfer.d.ts +0 -6
- package/lib/chevre/service/task/moneyTransfer.js +0 -49
- package/lib/chevre/service/task/returnPointAward.d.ts +0 -6
- package/lib/chevre/service/task/returnPointAward.js +0 -55
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.withdraw = exports.transfer = exports.deposit = void 0;
|
|
27
37
|
exports.confirm = confirm;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.system = exports.project = exports.event = void 0;
|
|
27
37
|
/**
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.check = check;
|
|
27
37
|
const factory_1 = require("../../../factory");
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.publishPaymentUrl = publishPaymentUrl;
|
|
27
37
|
const factory_1 = require("../../../factory");
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.searchGMOTrade = searchGMOTrade;
|
|
27
37
|
const factory_1 = require("../../../factory");
|
|
@@ -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;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.processAuthorizeCreditCard = processAuthorizeCreditCard;
|
|
27
37
|
const CreditCardPayment = __importStar(require("../../../payment/creditCard"));
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.processAuthorizeMovieTicket = processAuthorizeMovieTicket;
|
|
27
37
|
const MovieTicketPayment = __importStar(require("../../../payment/movieTicket"));
|
|
@@ -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';
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.start = start;
|
|
27
37
|
exports.confirm = confirm;
|
|
@@ -30,7 +40,6 @@ exports.exportTasksById = exportTasksById;
|
|
|
30
40
|
/**
|
|
31
41
|
* サービス登録取引サービス
|
|
32
42
|
*/
|
|
33
|
-
const pecorinoapi = __importStar(require("../../pecorinoapi"));
|
|
34
43
|
const factory_1 = require("../../factory");
|
|
35
44
|
const searchProductOffers_1 = require("../offer/product/searchProductOffers");
|
|
36
45
|
const factory_2 = require("./registerService/factory");
|
|
@@ -126,7 +135,8 @@ function createTransactionObject(params) {
|
|
|
126
135
|
if (offer === undefined) {
|
|
127
136
|
throw new factory_1.factory.errors.NotFound('Offer', `Offer ${acceptedOffer.id} not found`);
|
|
128
137
|
}
|
|
129
|
-
|
|
138
|
+
// discontinue(2026-04-17~)
|
|
139
|
+
// await validatePointAward({ project: { id: params.project.id }, acceptedOffer })(repos);
|
|
130
140
|
const pointAward = (0, factory_2.createPointAward)({
|
|
131
141
|
acceptedOffer: acceptedOffer,
|
|
132
142
|
offer: offer
|
|
@@ -153,59 +163,6 @@ function createTransactionObject(params) {
|
|
|
153
163
|
return transactionObject;
|
|
154
164
|
};
|
|
155
165
|
}
|
|
156
|
-
function createPermitService(params) {
|
|
157
|
-
return async (repos) => {
|
|
158
|
-
const product = (await repos.product.projectFields({
|
|
159
|
-
limit: 1,
|
|
160
|
-
page: 1,
|
|
161
|
-
id: { $eq: params.issuedThrough.id }
|
|
162
|
-
}, ['availableChannel']
|
|
163
|
-
// []
|
|
164
|
-
)).shift();
|
|
165
|
-
if (product === undefined) {
|
|
166
|
-
throw new factory_1.factory.errors.NotFound('Product');
|
|
167
|
-
}
|
|
168
|
-
const permitServiceEndpoint = product.availableChannel?.serviceUrl;
|
|
169
|
-
const permitServiceAuthorizeServerDomain = product.availableChannel?.credentials?.authorizeServerDomain;
|
|
170
|
-
const permitServiceClientId = product.availableChannel?.credentials?.clientId;
|
|
171
|
-
const permitServiceClientSecret = product.availableChannel?.credentials?.clientSecret;
|
|
172
|
-
if (typeof permitServiceEndpoint !== 'string' || permitServiceEndpoint.length === 0
|
|
173
|
-
|| typeof permitServiceAuthorizeServerDomain !== 'string' || permitServiceAuthorizeServerDomain.length === 0
|
|
174
|
-
|| typeof permitServiceClientId !== 'string' || permitServiceClientId.length === 0
|
|
175
|
-
|| typeof permitServiceClientSecret !== 'string' || permitServiceClientSecret.length === 0) {
|
|
176
|
-
throw new factory_1.factory.errors.Internal('product availableChannel invalid');
|
|
177
|
-
}
|
|
178
|
-
return new (await pecorinoapi.loadPecorino()).service.Permit({
|
|
179
|
-
endpoint: permitServiceEndpoint,
|
|
180
|
-
auth: await pecorinoapi.auth.ClientCredentials.createInstance({
|
|
181
|
-
domain: permitServiceAuthorizeServerDomain,
|
|
182
|
-
clientId: permitServiceClientId,
|
|
183
|
-
clientSecret: permitServiceClientSecret,
|
|
184
|
-
scopes: [],
|
|
185
|
-
state: ''
|
|
186
|
-
})
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
function validatePointAward(params) {
|
|
191
|
-
return async (repos) => {
|
|
192
|
-
// Permit識別子確認
|
|
193
|
-
const permitIdentifier = params.acceptedOffer.itemOffered?.pointAward?.toLocation?.identifier;
|
|
194
|
-
const issuedThroughId = params.acceptedOffer.itemOffered.pointAward?.toLocation?.issuedThrough.id;
|
|
195
|
-
if (typeof permitIdentifier === 'string' && permitIdentifier.length > 0) {
|
|
196
|
-
if (typeof issuedThroughId !== 'string' || issuedThroughId.length === 0) {
|
|
197
|
-
throw new factory_1.factory.errors.ArgumentNull('acceptedOffer.itemOffered.pointAward.toLocation.issuedThrough.id');
|
|
198
|
-
}
|
|
199
|
-
// pointAwardの指定がある場合、Permitの存在確認
|
|
200
|
-
const permitService = await createPermitService({ issuedThrough: { id: issuedThroughId } })(repos);
|
|
201
|
-
await permitService.findByIdentifier({
|
|
202
|
-
project: { id: params.project.id },
|
|
203
|
-
identifier: permitIdentifier,
|
|
204
|
-
issuedThrough: { typeOf: factory_1.factory.product.ProductType.PaymentCard }
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
166
|
/**
|
|
210
167
|
* 取引確定
|
|
211
168
|
*/
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -30,7 +40,6 @@ exports.createSubReservations = createSubReservations;
|
|
|
30
40
|
const debug_1 = __importDefault(require("debug"));
|
|
31
41
|
const moment_1 = __importDefault(require("moment"));
|
|
32
42
|
const factory_1 = require("../../../../factory");
|
|
33
|
-
const pecorinoapi = __importStar(require("../../../../pecorinoapi"));
|
|
34
43
|
// import * as OfferService from '../../../offer';
|
|
35
44
|
const ProductOfferService = __importStar(require("../../../offer/product"));
|
|
36
45
|
const createReservation_1 = require("./factory/createReservation");
|
|
@@ -365,7 +374,7 @@ function validateAdvanceBookingRequirement(params) {
|
|
|
365
374
|
}
|
|
366
375
|
function validateProgramMembershipUsed(params) {
|
|
367
376
|
return async (repos) => {
|
|
368
|
-
const now = new Date();
|
|
377
|
+
// const now = new Date();
|
|
369
378
|
let programMembershipUsed;
|
|
370
379
|
const requestedProgramMembershipUsed = params.acceptedOffer.itemOffered?.serviceOutput?.programMembershipUsed;
|
|
371
380
|
if (typeof requestedProgramMembershipUsed === 'string') {
|
|
@@ -462,39 +471,40 @@ function validateProgramMembershipUsed(params) {
|
|
|
462
471
|
}
|
|
463
472
|
break;
|
|
464
473
|
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
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
|
+
// }
|
|
498
508
|
default:
|
|
499
509
|
throw new factory_1.factory.errors.Argument('acceptedOffer.itemOffered.serviceOutput.programMembershipUsed', `${permitIssuedThrough.typeOf} not implemented`);
|
|
500
510
|
}
|
|
@@ -502,37 +512,3 @@ function validateProgramMembershipUsed(params) {
|
|
|
502
512
|
return programMembershipUsed;
|
|
503
513
|
};
|
|
504
514
|
}
|
|
505
|
-
function createPermitService(params) {
|
|
506
|
-
return async (repos) => {
|
|
507
|
-
const product = (await repos.product.projectFields({
|
|
508
|
-
limit: 1,
|
|
509
|
-
page: 1,
|
|
510
|
-
id: { $eq: params.issuedThrough.id }
|
|
511
|
-
}, ['availableChannel']
|
|
512
|
-
// []
|
|
513
|
-
)).shift();
|
|
514
|
-
if (product === undefined) {
|
|
515
|
-
throw new factory_1.factory.errors.NotFound('Product');
|
|
516
|
-
}
|
|
517
|
-
const permitServiceEndpoint = product.availableChannel?.serviceUrl;
|
|
518
|
-
const permitServiceAuthorizeServerDomain = product.availableChannel?.credentials?.authorizeServerDomain;
|
|
519
|
-
const permitServiceClientId = product.availableChannel?.credentials?.clientId;
|
|
520
|
-
const permitServiceClientSecret = product.availableChannel?.credentials?.clientSecret;
|
|
521
|
-
if (typeof permitServiceEndpoint !== 'string' || permitServiceEndpoint.length === 0
|
|
522
|
-
|| typeof permitServiceAuthorizeServerDomain !== 'string' || permitServiceAuthorizeServerDomain.length === 0
|
|
523
|
-
|| typeof permitServiceClientId !== 'string' || permitServiceClientId.length === 0
|
|
524
|
-
|| typeof permitServiceClientSecret !== 'string' || permitServiceClientSecret.length === 0) {
|
|
525
|
-
throw new factory_1.factory.errors.Internal('product availableChannel invalid');
|
|
526
|
-
}
|
|
527
|
-
return new (await pecorinoapi.loadPecorino()).service.Permit({
|
|
528
|
-
endpoint: permitServiceEndpoint,
|
|
529
|
-
auth: await pecorinoapi.auth.ClientCredentials.createInstance({
|
|
530
|
-
domain: permitServiceAuthorizeServerDomain,
|
|
531
|
-
clientId: permitServiceClientId,
|
|
532
|
-
clientSecret: permitServiceClientSecret,
|
|
533
|
-
scopes: [],
|
|
534
|
-
state: ''
|
|
535
|
-
})
|
|
536
|
-
});
|
|
537
|
-
};
|
|
538
|
-
}
|