@chevre/domain 20.1.0-alpha.0 → 20.1.0-alpha.1

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.
@@ -243,7 +243,7 @@ class MongoRepository {
243
243
  */
244
244
  start(params) {
245
245
  return __awaiter(this, void 0, void 0, function* () {
246
- return this.transactionModel.create(Object.assign(Object.assign({ typeOf: params.typeOf }, params), { status: factory.transactionStatusType.InProgress, startDate: new Date(), endDate: undefined, tasksExportationStatus: factory.transactionTasksExportationStatus.Unexported }))
246
+ return this.transactionModel.create(Object.assign(Object.assign({}, params), { typeOf: params.typeOf, status: factory.transactionStatusType.InProgress, startDate: new Date(), endDate: undefined, tasksExportationStatus: factory.transactionTasksExportationStatus.Unexported }))
247
247
  .then((doc) => doc.toObject());
248
248
  });
249
249
  }
@@ -24,7 +24,9 @@ const schema = new mongoose.Schema({
24
24
  amount: mongoose.SchemaTypes.Mixed,
25
25
  fromLocation: mongoose.SchemaTypes.Mixed,
26
26
  toLocation: mongoose.SchemaTypes.Mixed,
27
- instrument: mongoose.SchemaTypes.Mixed
27
+ instrument: mongoose.SchemaTypes.Mixed,
28
+ // add location(2022-11-11~)
29
+ location: mongoose.SchemaTypes.Mixed
28
30
  }, {
29
31
  collection: 'actions',
30
32
  id: true,
@@ -24,7 +24,9 @@ const schema = new mongoose.Schema({
24
24
  endDate: Date,
25
25
  tasksExportedAt: Date,
26
26
  tasksExportationStatus: String,
27
- potentialActions: mongoose.SchemaTypes.Mixed
27
+ potentialActions: mongoose.SchemaTypes.Mixed,
28
+ // add location(2022-11-11~)
29
+ location: mongoose.SchemaTypes.Mixed
28
30
  }, {
29
31
  collection: 'assetTransactions',
30
32
  id: true,
@@ -7,4 +7,5 @@ export declare function createStartParams(params: factory.assetTransaction.pay.I
7
7
  paymentServiceType: factory.service.paymentService.PaymentServiceType;
8
8
  amount: number;
9
9
  paymentService?: factory.service.paymentService.IService;
10
+ location?: factory.action.trade.pay.ILocation;
10
11
  }): factory.assetTransaction.IStartParams<factory.assetTransactionType.Pay>;
@@ -6,7 +6,7 @@ exports.createStartParams = void 0;
6
6
  */
7
7
  const factory = require("../../../factory");
8
8
  function createStartParams(params) {
9
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
9
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
10
10
  const paymentServiceId = (params.paymentService !== undefined)
11
11
  ? String(params.paymentService.id)
12
12
  : '';
@@ -48,13 +48,7 @@ function createStartParams(params) {
48
48
  }
49
49
  const informPaymentParams = createInformPaymentParams({ paymentService: params.paymentService });
50
50
  const accountId = (_e = params.object.paymentMethod) === null || _e === void 0 ? void 0 : _e.accountId;
51
- return {
52
- project: { typeOf: factory.organizationType.Project, id: params.project.id },
53
- transactionNumber: params.transactionNumber,
54
- typeOf: factory.assetTransactionType.Pay,
55
- agent: params.agent,
56
- recipient: params.recipient,
57
- object: {
51
+ return Object.assign({ project: { typeOf: factory.organizationType.Project, id: params.project.id }, transactionNumber: params.transactionNumber, typeOf: factory.assetTransactionType.Pay, agent: params.agent, recipient: params.recipient, object: {
58
52
  // パラメータから必要なもののみ取り込む
59
53
  accountId: (typeof accountId === 'string') ? accountId : '',
60
54
  paymentMethodId: params.transactionNumber,
@@ -76,9 +70,9 @@ function createStartParams(params) {
76
70
  : undefined), (Array.isArray((_q = params.object.paymentMethod) === null || _q === void 0 ? void 0 : _q.movieTickets))
77
71
  ? { movieTickets: (_r = params.object.paymentMethod) === null || _r === void 0 ? void 0 : _r.movieTickets }
78
72
  : undefined)
79
- },
80
- expires: params.expires
81
- };
73
+ }, expires: params.expires }, (typeof ((_s = params.location) === null || _s === void 0 ? void 0 : _s.typeOf) === 'string')
74
+ ? { location: params.location }
75
+ : undefined);
82
76
  }
83
77
  exports.createStartParams = createStartParams;
84
78
  function createInformPaymentParams(params) {
@@ -16,6 +16,7 @@ export declare function creatPayTransactionStartParams(params: {
16
16
  paymentServiceType: factory.service.paymentService.PaymentServiceType;
17
17
  transaction: factory.transaction.ITransaction<factory.transactionType>;
18
18
  transactionNumber: string;
19
+ location?: factory.action.trade.pay.ILocation;
19
20
  }): factory.assetTransaction.pay.IStartParamsWithoutDetail;
20
21
  export declare function createAuthorizeResult(params: {
21
22
  object: factory.action.authorize.paymentMethod.any.IObject;
@@ -4,7 +4,7 @@ exports.optimizeAction4inform = exports.createAuthorizeResult = exports.creatPay
4
4
  const moment = require("moment");
5
5
  const factory = require("../../../factory");
6
6
  function creatPayTransactionStartParams(params) {
7
- var _a, _b, _c;
7
+ var _a, _b, _c, _d;
8
8
  const expires = moment(params.transaction.expires)
9
9
  .add(1, 'month')
10
10
  .toDate(); // 余裕を持って
@@ -13,18 +13,13 @@ function creatPayTransactionStartParams(params) {
13
13
  const accountId = (typeof params.accountId === 'string')
14
14
  ? params.accountId
15
15
  : (typeof params.object.accountId === 'string') ? params.object.accountId : undefined;
16
- return Object.assign({ project: { id: params.transaction.project.id, typeOf: factory.organizationType.Project }, typeOf: factory.assetTransactionType.Pay, transactionNumber: params.transactionNumber, agent: {
16
+ return Object.assign(Object.assign({ project: { id: params.transaction.project.id, typeOf: factory.organizationType.Project }, typeOf: factory.assetTransactionType.Pay, transactionNumber: params.transactionNumber, agent: {
17
17
  // Sellerに変更(2022-05-30~)
18
18
  typeOf: params.transaction.seller.typeOf,
19
19
  id: String(params.transaction.seller.id),
20
20
  name: (typeof params.transaction.seller.name === 'string')
21
21
  ? params.transaction.seller.name
22
22
  : String((_b = params.transaction.seller.name) === null || _b === void 0 ? void 0 : _b.ja),
23
- // typeOf: params.transaction.agent.typeOf,
24
- // id: params.transaction.agent.id,
25
- // name: (typeof params.transaction.agent.name === 'string' && params.transaction.agent.name.length > 0)
26
- // ? params.transaction.agent.name
27
- // : params.transaction.agent.id
28
23
  identifier: [
29
24
  { name: 'transaction', value: params.transaction.id },
30
25
  {
@@ -51,6 +46,8 @@ function creatPayTransactionStartParams(params) {
51
46
  confirmationNumber: confirmationNumber
52
47
  }
53
48
  }
49
+ : undefined), (typeof ((_d = params.location) === null || _d === void 0 ? void 0 : _d.typeOf) === 'string')
50
+ ? { location: params.location }
54
51
  : undefined);
55
52
  }
56
53
  exports.creatPayTransactionStartParams = creatPayTransactionStartParams;
@@ -87,6 +87,7 @@ declare function publishPaymentUrl(params: {
87
87
  object: factory.action.authorize.paymentMethod.any.IObject;
88
88
  purpose: factory.action.authorize.paymentMethod.any.IPurpose;
89
89
  paymentServiceType: factory.service.paymentService.PaymentServiceType;
90
+ location: factory.action.trade.pay.ILocation;
90
91
  }): IPublishPaymentUrlOperation<PayTransactionService.IPublishPaymentUrlResult>;
91
92
  /**
92
93
  * 決済承認
@@ -101,5 +102,6 @@ declare function authorize(params: {
101
102
  object: factory.action.authorize.paymentMethod.any.IObject;
102
103
  purpose: factory.action.authorize.paymentMethod.any.IPurpose;
103
104
  paymentServiceType: factory.service.paymentService.PaymentServiceType;
105
+ location?: factory.action.trade.pay.ILocation;
104
106
  }): IAuthorizeOperation<IAuthorizePaymentAction>;
105
107
  export { onPaymentStatusChanged, authorize, invalidatePaymentUrl, voidPayTransaction, person2username, processVoidPayTransaction, publishPaymentUrl };
@@ -175,7 +175,8 @@ function publishPaymentUrl(params) {
175
175
  object: params.object,
176
176
  paymentServiceType,
177
177
  transaction: transaction,
178
- transactionNumber: transactionNumber
178
+ transactionNumber: transactionNumber,
179
+ location: params.location
179
180
  });
180
181
  // result = await repos.payTransaction.publishPaymentUrl({ ...startParams, iss: params.iss });
181
182
  result = yield PayTransactionService.publishPaymentUrl(startParams)(repos);
@@ -253,7 +254,8 @@ function authorize(params) {
253
254
  object: params.object,
254
255
  paymentServiceType,
255
256
  transaction: transaction,
256
- transactionNumber: transactionNumber
257
+ transactionNumber: transactionNumber,
258
+ location: params.location
257
259
  });
258
260
  // payTransaction = await repos.payTransaction.start({ ...startParams, iss: params.iss });
259
261
  payTransaction = yield PayTransactionService.start(startParams)(repos);
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.276.0-alpha.0",
12
+ "@chevre/factory": "4.276.0-alpha.1",
13
13
  "@cinerino/sdk": "3.132.0-alpha.0",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
@@ -120,5 +120,5 @@
120
120
  "postversion": "git push origin --tags",
121
121
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
122
122
  },
123
- "version": "20.1.0-alpha.0"
123
+ "version": "20.1.0-alpha.1"
124
124
  }