@chevre/domain 21.2.0-alpha.22 → 21.2.0-alpha.24

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.
@@ -67,6 +67,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
67
67
  tasksExportationStatus?: string | undefined;
68
68
  tasksExportedAt?: Date | undefined;
69
69
  seller?: any;
70
+ tasksExportAction?: any;
70
71
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
71
72
  object?: any;
72
73
  typeOf?: string | undefined;
@@ -83,6 +84,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
83
84
  tasksExportationStatus?: string | undefined;
84
85
  tasksExportedAt?: Date | undefined;
85
86
  seller?: any;
87
+ tasksExportAction?: any;
86
88
  }>> & Omit<import("mongoose").FlatRecord<{
87
89
  object?: any;
88
90
  typeOf?: string | undefined;
@@ -99,6 +101,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
99
101
  tasksExportationStatus?: string | undefined;
100
102
  tasksExportedAt?: Date | undefined;
101
103
  seller?: any;
104
+ tasksExportAction?: any;
102
105
  }> & {
103
106
  _id: import("mongoose").Types.ObjectId;
104
107
  }, never>>;
@@ -22,6 +22,7 @@ const schema = new mongoose_1.Schema({
22
22
  expires: Date,
23
23
  startDate: Date,
24
24
  endDate: Date,
25
+ tasksExportAction: mongoose_1.SchemaTypes.Mixed,
25
26
  tasksExportedAt: Date,
26
27
  tasksExportationStatus: String,
27
28
  potentialActions: mongoose_1.SchemaTypes.Mixed
@@ -112,6 +112,11 @@ export declare class MongoRepository {
112
112
  };
113
113
  status: factory.transactionStatusType;
114
114
  id?: string;
115
+ tasksExportAction: {
116
+ agent: {
117
+ name: string;
118
+ };
119
+ };
115
120
  }): Promise<Pick<factory.transaction.ITransaction<T>, 'id' | 'typeOf'> | null>;
116
121
  /**
117
122
  * タスクエクスポートリトライ
@@ -458,7 +458,13 @@ class MongoRepository {
458
458
  // no op
459
459
  }
460
460
  const typeOfIn = (_a = params.typeOf) === null || _a === void 0 ? void 0 : _a.$in;
461
- return this.transactionModel.findOneAndUpdate(Object.assign(Object.assign(Object.assign(Object.assign({}, (params.project !== undefined) ? { 'project.id': { $eq: params.project.id } } : undefined), (Array.isArray(typeOfIn)) ? { typeOf: { $in: typeOfIn } } : undefined), { status: { $eq: params.status }, tasksExportationStatus: { $eq: factory.transactionTasksExportationStatus.Unexported } }), (typeof params.id === 'string') ? { _id: { $eq: params.id } } : undefined), { tasksExportationStatus: factory.transactionTasksExportationStatus.Exporting }, { new: true })
461
+ return this.transactionModel.findOneAndUpdate(Object.assign(Object.assign(Object.assign(Object.assign({}, (params.project !== undefined) ? { 'project.id': { $eq: params.project.id } } : undefined), (Array.isArray(typeOfIn)) ? { typeOf: { $in: typeOfIn } } : undefined), { status: { $eq: params.status }, tasksExportationStatus: { $eq: factory.transactionTasksExportationStatus.Unexported } }), (typeof params.id === 'string') ? { _id: { $eq: params.id } } : undefined), {
462
+ tasksExportAction: {
463
+ agent: { name: params.tasksExportAction.agent.name },
464
+ startDate: new Date()
465
+ },
466
+ tasksExportationStatus: factory.transactionTasksExportationStatus.Exporting
467
+ }, { new: true })
462
468
  .select({
463
469
  _id: 1,
464
470
  typeOf: 1
@@ -20,7 +20,7 @@ const NotificationService = require("./notification");
20
20
  const factory_1 = require("./notification/factory");
21
21
  const settings_1 = require("../settings");
22
22
  const debug = createDebug('chevre-domain:service:task');
23
- const DEFAULT_EXECUTOR_NAME = `${process.env.GAE_APPLICATION}:${process.env.GAE_INSTANCE}:${process.env.GAE_SERVICE}:jobs`;
23
+ const DEFAULT_EXECUTOR_NAME = `${process.env.GAE_APPLICATION}:${process.env.GAE_SERVICE}:jobs`;
24
24
  function executeById(params) {
25
25
  return (settings) => __awaiter(this, void 0, void 0, function* () {
26
26
  var _a;
@@ -46,6 +46,11 @@ export declare function exportTasks<T extends factory.transactionType>(params: {
46
46
  $in: T[];
47
47
  };
48
48
  id?: string;
49
+ tasksExportAction?: {
50
+ agent: {
51
+ name: string;
52
+ };
53
+ };
49
54
  }): IExportTasksOperation<void>;
50
55
  /**
51
56
  * 取引に関わるリソースを削除する
@@ -19,6 +19,7 @@ const MoneyTransferTransactionService = require("./transaction/moneyTransfer");
19
19
  const PlaceOrderTransactionService = require("./transaction/placeOrder");
20
20
  const PlaceOrderInProgressTransactionService = require("./transaction/placeOrderInProgress");
21
21
  const ReturnOrderTransactionService = require("./transaction/returnOrder");
22
+ const DEFAULT_TASKS_EXPORT_AGENT_NAME = `${process.env.GAE_APPLICATION}:${process.env.GAE_SERVICE}:jobs`;
22
23
  exports.moneyTransfer = MoneyTransferTransactionService;
23
24
  exports.placeOrder = PlaceOrderTransactionService;
24
25
  exports.placeOrderInProgress = PlaceOrderInProgressTransactionService;
@@ -77,7 +78,14 @@ exports.updateAgent = updateAgent;
77
78
  */
78
79
  function exportTasks(params) {
79
80
  return (repos) => __awaiter(this, void 0, void 0, function* () {
80
- const transaction = yield repos.transaction.startExportTasks(Object.assign({ project: params.project, typeOf: params.typeOf, status: params.status }, (typeof params.id === 'string') ? { id: params.id } : undefined));
81
+ var _a;
82
+ const transaction = yield repos.transaction.startExportTasks(Object.assign({ project: params.project, typeOf: params.typeOf, status: params.status, tasksExportAction: {
83
+ agent: {
84
+ name: (typeof ((_a = params.tasksExportAction) === null || _a === void 0 ? void 0 : _a.agent.name) === 'string')
85
+ ? params.tasksExportAction.agent.name
86
+ : DEFAULT_TASKS_EXPORT_AGENT_NAME
87
+ }
88
+ } }, (typeof params.id === 'string') ? { id: params.id } : undefined));
81
89
  if (transaction === null) {
82
90
  return;
83
91
  }
package/package.json CHANGED
@@ -117,5 +117,5 @@
117
117
  "postversion": "git push origin --tags",
118
118
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
119
119
  },
120
- "version": "21.2.0-alpha.22"
120
+ "version": "21.2.0-alpha.24"
121
121
  }