@chevre/domain 24.0.0-alpha.74 → 24.0.0-alpha.76

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.
Files changed (42) hide show
  1. package/lib/chevre/index.d.ts +0 -2
  2. package/lib/chevre/index.js +0 -8
  3. package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.js +5 -5
  4. package/lib/chevre/service/assetTransaction/registerService/potentialActions.js +0 -1
  5. package/lib/chevre/service/assetTransaction/registerService.d.ts +3 -0
  6. package/lib/chevre/service/assetTransaction/registerService.js +2 -55
  7. package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +35 -69
  8. package/lib/chevre/service/assetTransaction/reserve/start.js +18 -85
  9. package/lib/chevre/service/assetTransaction.d.ts +0 -2
  10. package/lib/chevre/service/assetTransaction.js +1 -10
  11. package/lib/chevre/service/task/payment/payByTask.js +4 -4
  12. package/lib/chevre/service/task/payment/refundByTask.js +4 -4
  13. package/lib/chevre/service/task/payment/voidPaymentByTask.js +4 -4
  14. package/lib/chevre/service/taskHandler.d.ts +6 -1
  15. package/lib/chevre/service/taskHandler.js +10 -1
  16. package/lib/chevre/service.d.ts +0 -4
  17. package/lib/chevre/service.js +1 -21
  18. package/package.json +1 -3
  19. package/lib/chevre/pecorinoapi.d.ts +0 -5
  20. package/lib/chevre/pecorinoapi.js +0 -9
  21. package/lib/chevre/service/assetTransaction/moneyTransfer/potentialActions.d.ts +0 -7
  22. package/lib/chevre/service/assetTransaction/moneyTransfer/potentialActions.js +0 -104
  23. package/lib/chevre/service/assetTransaction/moneyTransfer.d.ts +0 -51
  24. package/lib/chevre/service/assetTransaction/moneyTransfer.js +0 -444
  25. package/lib/chevre/service/assetTransaction/pay/start/account/validation.d.ts +0 -8
  26. package/lib/chevre/service/assetTransaction/pay/start/account/validation.js +0 -43
  27. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeAccount.d.ts +0 -13
  28. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeAccount.js +0 -72
  29. package/lib/chevre/service/delivery.d.ts +0 -27
  30. package/lib/chevre/service/delivery.js +0 -315
  31. package/lib/chevre/service/moneyTransfer.d.ts +0 -76
  32. package/lib/chevre/service/moneyTransfer.js +0 -669
  33. package/lib/chevre/service/payment/paymentCard.d.ts +0 -42
  34. package/lib/chevre/service/payment/paymentCard.js +0 -452
  35. package/lib/chevre/service/task/cancelMoneyTransfer.d.ts +0 -6
  36. package/lib/chevre/service/task/cancelMoneyTransfer.js +0 -19
  37. package/lib/chevre/service/task/givePointAward.d.ts +0 -6
  38. package/lib/chevre/service/task/givePointAward.js +0 -65
  39. package/lib/chevre/service/task/moneyTransfer.d.ts +0 -6
  40. package/lib/chevre/service/task/moneyTransfer.js +0 -59
  41. package/lib/chevre/service/task/returnPointAward.d.ts +0 -6
  42. package/lib/chevre/service/task/returnPointAward.js +0 -65
@@ -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>;
@@ -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
- let transaction = transactionBeforeAuthorize;
13
+ const transaction = transactionBeforeAuthorize;
15
14
  switch (paymentServiceType) {
16
15
  case factory_1.factory.service.paymentService.PaymentServiceType.FaceToFace:
17
16
  // 対面決済は特に何もしない
18
17
  break;
19
- case factory_1.factory.service.paymentService.PaymentServiceType.PaymentCard:
20
- transaction = await (0, processAuthorizeAccount_1.processAuthorizeAccount)(params, transactionBeforeAuthorize, String(paymentService?.id))(repos);
21
- break;
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';
@@ -1,3 +1,6 @@
1
+ /**
2
+ * サービス登録取引サービス
3
+ */
1
4
  import { factory } from '../../factory';
2
5
  import type { AccountRepo } from '../../repo/account';
3
6
  import type { AssetTransactionRepo } from '../../repo/assetTransaction';
@@ -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
- await validatePointAward({ project: { id: params.project.id }, acceptedOffer })(repos);
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
- case factory_1.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_1.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_1.factory.errors.Argument('acceptedOffer.itemOffered.serviceOutput.programMembershipUsed', 'not valid programMembership');
488
- }
489
- if ((0, moment_1.default)(serviceOutput.validFrom)
490
- .isAfter((0, moment_1.default)(now))
491
- || (0, moment_1.default)(serviceOutput.validUntil)
492
- .isBefore((0, moment_1.default)(now))) {
493
- throw new factory_1.factory.errors.Argument('acceptedOffer.itemOffered.serviceOutput.programMembershipUsed', 'unavailable programMembership');
494
- }
495
- if (permitIssuedThrough.serviceType?.typeOf === 'CategoryCode') {
496
- programMembershipUsed = {
497
- typeOf: factory_1.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
- }
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 createPermitService(params) {
444
- return async (repos) => {
445
- const product = (await repos.product.projectFields({
446
- limit: 1,
447
- page: 1,
448
- id: { $eq: params.issuedThrough.id }
449
- }, ['availableChannel']
450
- // []
451
- )).shift();
452
- if (product === undefined) {
453
- throw new factory_1.factory.errors.NotFound('Product');
454
- }
455
- const permitServiceEndpoint = product.availableChannel?.serviceUrl;
456
- const permitServiceAuthorizeServerDomain = product.availableChannel?.credentials?.authorizeServerDomain;
457
- const permitServiceClientId = product.availableChannel?.credentials?.clientId;
458
- const permitServiceClientSecret = product.availableChannel?.credentials?.clientSecret;
459
- if (typeof permitServiceEndpoint !== 'string' || permitServiceEndpoint.length === 0
460
- || typeof permitServiceAuthorizeServerDomain !== 'string' || permitServiceAuthorizeServerDomain.length === 0
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.moneyTransfer = exports.cancelReservation = void 0;
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
- case factory_1.factory.service.paymentService.PaymentServiceType.PaymentCard:
185
- await PaymentCardPaymentService.payPaymentCard(payActionAttributes)(repos);
186
- break;
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
- case factory_1.factory.service.paymentService.PaymentServiceType.PaymentCard:
50
- await PaymentCardPaymentService.refundPaymentCard(params)(repos);
51
- break;
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
- case factory_1.factory.service.paymentService.PaymentServiceType.PaymentCard:
50
- await PaymentCardPaymentService.voidTransaction(params)(repos);
51
- break;
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;
@@ -1,6 +1,11 @@
1
1
  import type { INextFunction } from '../eventEmitter/task';
2
2
  import { factory } from '../factory';
3
- import type { ICallResult, ICallableTaskOperation, IExecutableTask, IExecutableTaskKeys, IOperationExecute } from '../taskSettings';
3
+ import type { ICallResult, ICallableTaskOperation, ICallableTaskOperationSimple, IExecutableTask, IExecutableTaskKeys, IOperationExecute } from '../taskSettings';
4
+ export declare const taskLoader: {
5
+ load: (taskName: string) => Promise<{
6
+ call: ICallableTaskOperationSimple | ICallableTaskOperation;
7
+ }>;
8
+ };
4
9
  /**
5
10
  * タスクを実行する
6
11
  */
@@ -3,12 +3,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.taskLoader = void 0;
6
7
  exports.executeTask = executeTask;
7
8
  const debug_1 = __importDefault(require("debug"));
8
9
  const moment_1 = __importDefault(require("moment"));
9
10
  const factory_1 = require("../factory");
10
11
  const onOperationFailed_1 = require("./taskHandler/onOperationFailed");
11
12
  const debug = (0, debug_1.default)('chevre-domain:service:taskHandler');
13
+ exports.taskLoader = {
14
+ load: (taskName) => {
15
+ return import(`./task/${taskName}.js`);
16
+ }
17
+ };
12
18
  /**
13
19
  * タスクを実行する
14
20
  */
@@ -36,7 +42,10 @@ function executeTask(task, next) {
36
42
  }
37
43
  // タスク名の関数が定義されていなければ、TypeErrorとなる
38
44
  let callResult;
39
- const { call } = await import(`./task/${task.name}`);
45
+ // const { call } = await import(`./task/${task.name}.js`) as {
46
+ // call: ICallableTaskOperationSimple | ICallableTaskOperation;
47
+ // };
48
+ const { call } = await exports.taskLoader.load(task.name); // testが書きづらいのでtaskLoader経由で呼ぶ
40
49
  switch (task.name) {
41
50
  case factory_1.factory.taskName.AcceptCOAOffer:
42
51
  case factory_1.factory.taskName.AggregateOnSystem:
@@ -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
  }
@@ -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.delivery = exports.assetTransaction = exports.aggregation = exports.accountTransaction = exports.account = void 0;
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;