@chevre/domain 21.33.0-alpha.21 → 21.33.0-alpha.22

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.
@@ -56,7 +56,7 @@ declare function voidTransaction(params: factory.task.voidPayment.IData): (repos
56
56
  /**
57
57
  * クレジットカード決済
58
58
  */
59
- declare function payCreditCard(params: factory.task.pay.IPayActionData): (repos: {
59
+ declare function payCreditCard(params: factory.action.trade.pay.IAttributes): (repos: {
60
60
  action: ActionRepo;
61
61
  actionRecipe: ActionRecipeRepo;
62
62
  accountingReport: AccountingReportRepo;
@@ -9,7 +9,7 @@ import type { MongoRepository as TaskRepo } from '../../repo/task';
9
9
  declare function voidTransaction(__: factory.task.voidPayment.IData): (___: {
10
10
  product: ProductRepo;
11
11
  }) => Promise<void>;
12
- declare function payFaceToFace(params: factory.task.pay.IPayActionData): (repos: {
12
+ declare function payFaceToFace(params: factory.action.trade.pay.IAttributes): (repos: {
13
13
  action: ActionRepo;
14
14
  accountingReport: AccountingReportRepo;
15
15
  product: ProductRepo;
@@ -69,7 +69,7 @@ type IPayAction = factory.action.trade.pay.IAction;
69
69
  /**
70
70
  * MovieTicket着券
71
71
  */
72
- declare function payMovieTicket(params: factory.task.pay.IPayActionData): IPayOperation<IPayAction>;
72
+ declare function payMovieTicket(params: factory.action.trade.pay.IAttributes): IPayOperation<IPayAction>;
73
73
  /**
74
74
  * MovieTicket着券取消
75
75
  */
@@ -16,7 +16,7 @@ declare function authorize(params: factory.assetTransaction.pay.IStartParamsWith
16
16
  declare function voidTransaction(params: factory.task.voidPayment.IData): (repos: {
17
17
  product: ProductRepo;
18
18
  }) => Promise<void>;
19
- declare function payPaymentCard(params: factory.task.pay.IPayActionData): (repos: {
19
+ declare function payPaymentCard(params: factory.action.trade.pay.IAttributes): (repos: {
20
20
  action: ActionRepo;
21
21
  accountingReport: AccountingReportRepo;
22
22
  product: ProductRepo;
@@ -19,7 +19,15 @@ import * as factory from '../factory';
19
19
  /**
20
20
  * 決済確定
21
21
  */
22
- export declare function pay(params: factory.task.pay.IData): (repos: {
22
+ export declare function pay(params: factory.task.pay.IData & {
23
+ sameAs?: {
24
+ /**
25
+ * 実行元タスクID
26
+ */
27
+ id: string;
28
+ typeOf: 'Task';
29
+ };
30
+ }): (repos: {
23
31
  acceptedOffer: AcceptedOfferRepo;
24
32
  action: ActionRepo;
25
33
  actionRecipe: ActionRecipeRepo;
@@ -19,6 +19,7 @@ const MovieTicketPaymentService = require("./payment/movieTicket");
19
19
  const PaymentCardPaymentService = require("./payment/paymentCard");
20
20
  function payTask2payActionAttributes(params) {
21
21
  return (repos) => __awaiter(this, void 0, void 0, function* () {
22
+ var _a;
22
23
  let transaction;
23
24
  if (typeof params.object.paymentMethod.paymentMethodId === 'string') {
24
25
  transaction = yield repos.assetTransaction.findByTransactionNumber({
@@ -38,7 +39,7 @@ function payTask2payActionAttributes(params) {
38
39
  potentialActions: { pay: { purpose: params.purpose } },
39
40
  order
40
41
  });
41
- return payActions[0];
42
+ return Object.assign(Object.assign({}, payActions[0]), (typeof ((_a = params.sameAs) === null || _a === void 0 ? void 0 : _a.id) === 'string') ? { sameAs: params.sameAs } : undefined);
42
43
  });
43
44
  }
44
45
  /**
@@ -1,6 +1,6 @@
1
- import type { IOperationExecute } from '../task';
1
+ import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../task';
2
2
  import * as factory from '../../factory';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
6
- export declare function call(data: factory.task.pay.IData): IOperationExecute<void>;
6
+ export declare function call(params: Pick<factory.task.pay.ITask, IExecutableTaskKeys>): IOperationExecute<ICallResult>;
@@ -27,9 +27,10 @@ const PaymentService = require("../payment");
27
27
  /**
28
28
  * タスク実行関数
29
29
  */
30
- function call(data) {
30
+ function call(params) {
31
31
  return (settings) => __awaiter(this, void 0, void 0, function* () {
32
- yield PaymentService.pay(data)({
32
+ yield PaymentService.pay(Object.assign(Object.assign({}, params.data), { sameAs: { id: params.id, typeOf: 'Task' } // タスクIDを関連付け(2024-04-20~)
33
+ }))({
33
34
  acceptedOffer: new acceptedOffer_1.MongoRepository(settings.connection),
34
35
  accountingReport: new accountingReport_1.MongoRepository(settings.connection),
35
36
  action: new action_1.MongoRepository(settings.connection),
@@ -107,6 +107,7 @@ function execute(task) {
107
107
  case factory.taskName.AcceptCOAOffer:
108
108
  case factory.taskName.AuthorizePayment:
109
109
  case factory.taskName.CheckMovieTicket:
110
+ case factory.taskName.Pay:
110
111
  case factory.taskName.PublishPaymentUrl:
111
112
  case factory.taskName.Refund:
112
113
  case factory.taskName.VoidReserveTransaction:
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "@aws-sdk/credential-providers": "3.433.0",
13
- "@chevre/factory": "4.374.0-alpha.1",
13
+ "@chevre/factory": "4.374.0-alpha.2",
14
14
  "@cinerino/sdk": "7.0.0",
15
15
  "@motionpicture/coa-service": "9.4.0",
16
16
  "@motionpicture/gmo-service": "5.3.0",
@@ -110,5 +110,5 @@
110
110
  "postversion": "git push origin --tags",
111
111
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
112
112
  },
113
- "version": "21.33.0-alpha.21"
113
+ "version": "21.33.0-alpha.22"
114
114
  }