@chevre/domain 24.0.0-alpha.39 → 24.0.0-alpha.40

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 (44) hide show
  1. package/lib/chevre/repo/action/acceptPay.d.ts +3 -0
  2. package/lib/chevre/repo/action/acceptPay.js +7 -1
  3. package/lib/chevre/repo/action.d.ts +6 -2
  4. package/lib/chevre/repo/action.js +3 -3
  5. package/lib/chevre/repo/aggregateOffer.d.ts +3 -3
  6. package/lib/chevre/repo/aggregateOffer.js +1 -0
  7. package/lib/chevre/repo/assetTransaction.d.ts +1 -1
  8. package/lib/chevre/repo/assetTransaction.js +1 -0
  9. package/lib/chevre/repo/creativeWork.d.ts +2 -2
  10. package/lib/chevre/repo/creativeWork.js +1 -0
  11. package/lib/chevre/repo/customerType.d.ts +1 -1
  12. package/lib/chevre/repo/customerType.js +1 -0
  13. package/lib/chevre/repo/eventOffer.d.ts +3 -3
  14. package/lib/chevre/repo/eventOffer.js +1 -0
  15. package/lib/chevre/repo/eventSellerMakesOffer.d.ts +3 -3
  16. package/lib/chevre/repo/eventSellerMakesOffer.js +1 -0
  17. package/lib/chevre/repo/note.d.ts +3 -3
  18. package/lib/chevre/repo/note.js +1 -0
  19. package/lib/chevre/repo/noteAboutOrder.d.ts +1 -1
  20. package/lib/chevre/repo/noteAboutOrder.js +1 -0
  21. package/lib/chevre/repo/offerCatalog.d.ts +3 -3
  22. package/lib/chevre/repo/offerCatalog.js +1 -0
  23. package/lib/chevre/repo/offerCatalogItem.d.ts +3 -3
  24. package/lib/chevre/repo/offerCatalogItem.js +1 -0
  25. package/lib/chevre/repo/place/seat.d.ts +6 -6
  26. package/lib/chevre/repo/place/seat.js +3 -0
  27. package/lib/chevre/repo/product.d.ts +3 -3
  28. package/lib/chevre/repo/product.js +1 -0
  29. package/lib/chevre/repo/productOffer.d.ts +3 -3
  30. package/lib/chevre/repo/productOffer.js +1 -0
  31. package/lib/chevre/repo/reservation.d.ts +1 -1
  32. package/lib/chevre/repo/reservation.js +1 -0
  33. package/lib/chevre/repo/sellerMakesOffer.d.ts +2 -2
  34. package/lib/chevre/repo/sellerMakesOffer.js +2 -0
  35. package/lib/chevre/repo/transaction.d.ts +1 -1
  36. package/lib/chevre/repo/transaction.js +1 -0
  37. package/lib/chevre/service/assetTransaction.d.ts +1 -1
  38. package/lib/chevre/service/order/placeOrder.js +1 -1
  39. package/lib/chevre/service/reserve/cancelReservation.js +1 -1
  40. package/lib/chevre/service/reserve/confirmReservation.js +1 -1
  41. package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +3 -2
  42. package/lib/chevre/service/transaction/placeOrder/confirm.js +20 -9
  43. package/lib/chevre/service/transaction.d.ts +1 -1
  44. package/package.json +1 -1
@@ -16,6 +16,9 @@ export declare class AcceptPayActionRepo extends ActionProcessRepo<IAcceptPayAct
16
16
  purpose: {
17
17
  id: string;
18
18
  };
19
+ actionStatus?: factory.actionStatusType.CompletedActionStatus;
20
+ limit?: number;
21
+ page?: number;
19
22
  }, inclusion: IKeyOfProjection[]): Promise<IAcceptPayAction[]>;
20
23
  /**
21
24
  * 決済取引番号から完了済の決済採用アクションを参照する
@@ -38,13 +38,19 @@ class AcceptPayActionRepo extends actionProcess_1.ActionProcessRepo {
38
38
  * 件数はlimitされない
39
39
  */
40
40
  async findAcceptActionsByPurpose(params, inclusion) {
41
+ const { actionStatus, limit, page } = params;
41
42
  return this.findAnyActions({
42
43
  project: { id: { $eq: params.project.id } },
43
44
  typeOf: { $eq: factory.actionType.AcceptAction }, // 採用アクション
44
45
  purpose: { id: { $in: [params.purpose.id] } },
45
46
  object: {
46
47
  typeOf: { $eq: factory.assetTransactionType.Pay } // 対象が決済取引
47
- }
48
+ },
49
+ ...(typeof actionStatus === 'string')
50
+ ? { actionStatus: { $in: [actionStatus] } }
51
+ : undefined,
52
+ ...(typeof limit === 'number') ? { limit } : undefined,
53
+ ...(typeof page === 'number') ? { page } : undefined,
48
54
  }, inclusion);
49
55
  // const andConditions: FilterQuery<IAcceptPayAction>[] = [
50
56
  // { typeOf: { $eq: factory.actionType.AcceptAction } },
@@ -14,9 +14,13 @@ type IAvailableActionRecipe = IActionRecipe<Exclude<factory.recipe.RecipeCategor
14
14
  */
15
15
  export declare class ActionRepo extends ActionProcessRepo<IAction<StartableActionType>, IAvailableActionRecipe> {
16
16
  /**
17
- * アクション検索
17
+ * 汎用アクション検索
18
18
  */
19
- search<T extends StartableActionType>(params: factory.action.ISearchConditions & {}, inclusion: IKeyOfProjection[]): Promise<IAction<T>[]>;
19
+ findActionsByType<T extends StartableActionType>(params: factory.action.ISearchConditions & {
20
+ typeOf?: T | {
21
+ $eq?: T;
22
+ };
23
+ }, inclusion: IKeyOfProjection[]): Promise<IAction<T>[]>;
20
24
  findPayAction(params: {
21
25
  project: {
22
26
  id: string;
@@ -42,9 +42,9 @@ class ActionRepo extends actionProcess_1.ActionProcessRepo {
42
42
  // this.actionRecipeModel = connection.model(recipeModelName, createRecipeSchema());
43
43
  // }
44
44
  /**
45
- * アクション検索
45
+ * 汎用アクション検索
46
46
  */
47
- async search(params, inclusion) {
47
+ async findActionsByType(params, inclusion) {
48
48
  return (this.findAnyActions(params, inclusion));
49
49
  }
50
50
  // /**
@@ -281,7 +281,7 @@ class ActionRepo extends actionProcess_1.ActionProcessRepo {
281
281
  // return doc;
282
282
  // }
283
283
  async findPayAction(params) {
284
- const payActions = await this.search({
284
+ const payActions = await this.findActionsByType({
285
285
  limit: 1,
286
286
  page: 1,
287
287
  actionStatus: (Array.isArray(params.actionStatus?.$in))
@@ -84,11 +84,11 @@ export declare class AggregateOfferRepo {
84
84
  */
85
85
  productType: factory.product.ProductType;
86
86
  }): Promise<{
87
- bulkWriteResult: BulkWriteResult;
88
- modifiedOffers: {
87
+ bulkWriteResult?: BulkWriteResult;
88
+ modifiedOffers?: {
89
89
  id: string;
90
90
  }[];
91
- } | void>;
91
+ }>;
92
92
  /**
93
93
  * sskts専用オファー保管
94
94
  */
@@ -707,6 +707,7 @@ class AggregateOfferRepo {
707
707
  .exec();
708
708
  return { bulkWriteResult, modifiedOffers };
709
709
  }
710
+ return {};
710
711
  }
711
712
  /**
712
713
  * sskts専用オファー保管
@@ -150,7 +150,7 @@ export declare class AssetTransactionRepo {
150
150
  expires: {
151
151
  $lt: Date;
152
152
  };
153
- }): Promise<Pick<factory.assetTransaction.ITransaction<factory.assetTransactionType>, 'id' | 'typeOf'> | void>;
153
+ }): Promise<Pick<factory.assetTransaction.ITransaction<factory.assetTransactionType>, 'id' | 'typeOf'> | undefined>;
154
154
  /**
155
155
  * 取引を期限切れにする
156
156
  */
@@ -740,6 +740,7 @@ class AssetTransactionRepo {
740
740
  .exec();
741
741
  if (doc === null) {
742
742
  // no op
743
+ return;
743
744
  }
744
745
  else {
745
746
  assetTransaction_2.assetTransactionEventEmitter.emitAssetTransactionStatusChanged({
@@ -32,8 +32,8 @@ export declare class CreativeWorkRepo {
32
32
  [key in keyof factory.creativeWork.movie.ICreativeWork]?: 1;
33
33
  };
34
34
  }[]): Promise<{
35
- bulkWriteResult: BulkWriteResult;
36
- } | void>;
35
+ bulkWriteResult?: BulkWriteResult;
36
+ }>;
37
37
  /**
38
38
  * コンテンツを検索する
39
39
  */
@@ -247,6 +247,7 @@ class CreativeWorkRepo {
247
247
  const bulkWriteResult = await this.creativeWorkModel.bulkWrite(bulkWriteOps, { ordered: false });
248
248
  return { bulkWriteResult };
249
249
  }
250
+ return {};
250
251
  }
251
252
  /**
252
253
  * コンテンツを検索する
@@ -17,6 +17,6 @@ export declare class CustomerTypeRepo {
17
17
  saveManyByCodeValue(params: {
18
18
  attributes: ICustomerType;
19
19
  upsert?: boolean;
20
- }[]): Promise<BulkWriteResult | void>;
20
+ }[]): Promise<BulkWriteResult | undefined>;
21
21
  }
22
22
  export {};
@@ -83,6 +83,7 @@ class CustomerTypeRepo {
83
83
  if (bulkWriteOps.length > 0) {
84
84
  return this.customerTypeModel.bulkWrite(bulkWriteOps, { ordered: false });
85
85
  }
86
+ return;
86
87
  }
87
88
  }
88
89
  exports.CustomerTypeRepo = CustomerTypeRepo;
@@ -32,11 +32,11 @@ export declare class EventOfferRepo {
32
32
  */
33
33
  update: boolean;
34
34
  }): Promise<{
35
- bulkWriteResult: BulkWriteResult;
36
- modifiedProductOffers: {
35
+ bulkWriteResult?: BulkWriteResult;
36
+ modifiedProductOffers?: {
37
37
  id: string;
38
38
  }[];
39
- } | void>;
39
+ }>;
40
40
  /**
41
41
  * 販売者の提供するイベントオファーを削除する
42
42
  */
@@ -198,6 +198,7 @@ class EventOfferRepo {
198
198
  .exec();
199
199
  return { bulkWriteResult, modifiedProductOffers };
200
200
  }
201
+ return {};
201
202
  }
202
203
  /**
203
204
  * 販売者の提供するイベントオファーを削除する
@@ -31,9 +31,9 @@ export declare class EventSellerMakesOfferRepo {
31
31
  };
32
32
  };
33
33
  }[]): Promise<{
34
- bulkWriteResult: BulkWriteResult;
35
- modifiedEvents: {
34
+ bulkWriteResult?: BulkWriteResult;
35
+ modifiedEvents?: {
36
36
  id: string;
37
37
  }[];
38
- } | void>;
38
+ }>;
39
39
  }
@@ -124,6 +124,7 @@ class EventSellerMakesOfferRepo {
124
124
  .exec();
125
125
  return { bulkWriteResult, modifiedEvents };
126
126
  }
127
+ return {};
127
128
  }
128
129
  }
129
130
  exports.EventSellerMakesOfferRepo = EventSellerMakesOfferRepo;
@@ -29,11 +29,11 @@ export declare class NoteRepo {
29
29
  */
30
30
  update: boolean;
31
31
  }): Promise<{
32
- bulkWriteResult: BulkWriteResult;
33
- modifiedNotes: {
32
+ bulkWriteResult?: BulkWriteResult;
33
+ modifiedNotes?: {
34
34
  id: string;
35
35
  }[];
36
- } | void>;
36
+ }>;
37
37
  /**
38
38
  * 主題リソースから全メモを削除する
39
39
  */
@@ -234,6 +234,7 @@ class NoteRepo {
234
234
  .exec();
235
235
  return { bulkWriteResult, modifiedNotes };
236
236
  }
237
+ return {};
237
238
  }
238
239
  // /**
239
240
  // * 既知のメモIDリストからメモを削除する
@@ -21,7 +21,7 @@ export declare class NoteAboutOrderRepo {
21
21
  */
22
22
  upsertOrderNoteByIdentifier(params: Pick<INoteAboutOrder, 'about' | 'creator' | 'identifier' | 'project' | 'provider' | 'text' | 'version'>[], options: {
23
23
  overwrite: boolean;
24
- }): Promise<BulkWriteResult | void>;
24
+ }): Promise<BulkWriteResult | undefined>;
25
25
  updateById(params: {
26
26
  id: string;
27
27
  attributes: Pick<INoteAboutOrder, 'text' | 'editor'>;
@@ -173,6 +173,7 @@ class NoteAboutOrderRepo {
173
173
  if (bulkWriteOps.length > 0) {
174
174
  return this.noteModel.bulkWrite(bulkWriteOps, { ordered: false });
175
175
  }
176
+ return;
176
177
  }
177
178
  async updateById(params) {
178
179
  const updateFields = {
@@ -49,11 +49,11 @@ export declare class OfferCatalogRepo {
49
49
  */
50
50
  itemListElementType: factory.offerCatalog.IItemListElement['typeOf'];
51
51
  }): Promise<{
52
- bulkWriteResult: BulkWriteResult;
53
- modifiedCatalogs: {
52
+ bulkWriteResult?: BulkWriteResult;
53
+ modifiedCatalogs?: {
54
54
  id: string;
55
55
  }[];
56
- } | void>;
56
+ }>;
57
57
  /**
58
58
  * 同期日時を更新する
59
59
  */
@@ -270,6 +270,7 @@ class OfferCatalogRepo {
270
270
  .exec();
271
271
  return { bulkWriteResult, modifiedCatalogs };
272
272
  }
273
+ return {};
273
274
  }
274
275
  /**
275
276
  * 同期日時を更新する
@@ -42,11 +42,11 @@ export declare class OfferCatalogItemRepo {
42
42
  */
43
43
  productType: factory.product.ProductType;
44
44
  }): Promise<{
45
- bulkWriteResult: BulkWriteResult;
46
- modifiedCatalogs: {
45
+ bulkWriteResult?: BulkWriteResult;
46
+ modifiedCatalogs?: {
47
47
  id: string;
48
48
  }[];
49
- } | void>;
49
+ }>;
50
50
  /**
51
51
  * 同期日時を更新する
52
52
  */
@@ -223,6 +223,7 @@ class OfferCatalogItemRepo {
223
223
  .exec();
224
224
  return { bulkWriteResult, modifiedCatalogs };
225
225
  }
226
+ return {};
226
227
  }
227
228
  /**
228
229
  * 同期日時を更新する
@@ -47,8 +47,8 @@ export declare class SeatRepo {
47
47
  addSeatsByBranchCodeIfNotExist(params: {
48
48
  $set: ICreatingSeat;
49
49
  }[], options: IUpdateOptions): Promise<{
50
- bulkWriteResult: BulkWriteResult;
51
- } | void>;
50
+ bulkWriteResult?: BulkWriteResult;
51
+ }>;
52
52
  /**
53
53
  * コードをキーにして冪等編集
54
54
  */
@@ -58,8 +58,8 @@ export declare class SeatRepo {
58
58
  [key in keyof ICreatingSeat]?: 1;
59
59
  };
60
60
  }[], options: IUpdateOptions): Promise<{
61
- bulkWriteResult: BulkWriteResult;
62
- } | void>;
61
+ bulkWriteResult?: BulkWriteResult;
62
+ }>;
63
63
  updateSeatByBranchCode(seat: ICreatingSeat, $unset: any, options: IUpdateOptions): Promise<IUpdateSeatResult>;
64
64
  searchSeats(params: factory.place.seat.ISearchConditions): Promise<factory.place.seat.IPlace[]>;
65
65
  projectSeatsByScreeningRoom(params: Pick<factory.place.seat.ISearchConditions, '$projection' | 'additionalProperty' | 'branchCode' | 'seatingType' | 'name' | 'limit' | 'page'> & {
@@ -161,8 +161,8 @@ export declare class SeatRepo {
161
161
  */
162
162
  branchCode: string;
163
163
  }[], options: IUpdateOptions): Promise<{
164
- bulkWriteResult: BulkWriteResult;
165
- } | void>;
164
+ bulkWriteResult?: BulkWriteResult;
165
+ }>;
166
166
  deleteSeatByBranchCode(seat: {
167
167
  /**
168
168
  * 座席コード
@@ -356,6 +356,7 @@ class SeatRepo {
356
356
  const bulkWriteResult = await this.placeModel.bulkWrite(bulkWriteOps, { ordered: false });
357
357
  return { bulkWriteResult };
358
358
  }
359
+ return {};
359
360
  }
360
361
  /**
361
362
  * コードをキーにして冪等編集
@@ -432,6 +433,7 @@ class SeatRepo {
432
433
  const bulkWriteResult = await this.placeModel.bulkWrite(bulkWriteOps, { ordered: false });
433
434
  return { bulkWriteResult };
434
435
  }
436
+ return {};
435
437
  }
436
438
  async updateSeatByBranchCode(seat, $unset, options) {
437
439
  const { project, parentOrganization, movieTheaterCode, roomCode, sectionCode } = options;
@@ -788,6 +790,7 @@ class SeatRepo {
788
790
  const bulkWriteResult = await this.placeModel.bulkWrite(bulkWriteOps, { ordered: false });
789
791
  return { bulkWriteResult };
790
792
  }
793
+ return {};
791
794
  }
792
795
  async deleteSeatByBranchCode(seat, options) {
793
796
  const { project, parentOrganization, movieTheaterCode, roomCode, sectionCode } = options;
@@ -69,11 +69,11 @@ export declare class ProductRepo {
69
69
  [key in IUnsetKey]?: 1;
70
70
  };
71
71
  }[]): Promise<{
72
- bulkWriteResult: BulkWriteResult;
73
- modifiedProducts: {
72
+ bulkWriteResult?: BulkWriteResult;
73
+ modifiedProducts?: {
74
74
  id: string;
75
75
  }[];
76
- } | void>;
76
+ }>;
77
77
  /**
78
78
  * プロダクトIDからavailableChannelを取得する
79
79
  */
@@ -338,6 +338,7 @@ class ProductRepo {
338
338
  .exec();
339
339
  return { bulkWriteResult, modifiedProducts };
340
340
  }
341
+ return {};
341
342
  }
342
343
  /**
343
344
  * プロダクトIDからavailableChannelを取得する
@@ -32,11 +32,11 @@ export declare class ProductOfferRepo {
32
32
  */
33
33
  update: boolean;
34
34
  }): Promise<{
35
- bulkWriteResult: BulkWriteResult;
36
- modifiedProductOffers: {
35
+ bulkWriteResult?: BulkWriteResult;
36
+ modifiedProductOffers?: {
37
37
  id: string;
38
38
  }[];
39
- } | void>;
39
+ }>;
40
40
  /**
41
41
  * 販売者の提供するプロダクトオファーを削除する
42
42
  */
@@ -201,6 +201,7 @@ class ProductOfferRepo {
201
201
  .exec();
202
202
  return { bulkWriteResult, modifiedProductOffers };
203
203
  }
204
+ return {};
204
205
  }
205
206
  // public async deleteProductOffersByIds(params: {
206
207
  // project: { id: string };
@@ -49,7 +49,7 @@ export declare class ReservationRepo {
49
49
  reservationNumber: string;
50
50
  underName?: factory.reservation.IUnderName<factory.reservationType.EventReservation>;
51
51
  broker?: factory.reservation.IBroker<factory.reservationType>;
52
- }): Promise<BulkWriteResult | void>;
52
+ }): Promise<BulkWriteResult | undefined>;
53
53
  /**
54
54
  * 予約取消
55
55
  */
@@ -918,6 +918,7 @@ class ReservationRepo {
918
918
  if (bulkWriteOps.length > 0) {
919
919
  return this.reservationModel.bulkWrite(bulkWriteOps, { ordered: false });
920
920
  }
921
+ return;
921
922
  }
922
923
  /**
923
924
  * 予約取消
@@ -51,7 +51,7 @@ export declare class SellerMakesOfferRepo {
51
51
  id: string;
52
52
  };
53
53
  }[];
54
- }): Promise<BulkWriteResult | void>;
54
+ }): Promise<BulkWriteResult | undefined>;
55
55
  /**
56
56
  * 販売者とアプリケーションに対してオファーが存在すれば削除する
57
57
  */
@@ -67,6 +67,6 @@ export declare class SellerMakesOfferRepo {
67
67
  id: string;
68
68
  };
69
69
  }[];
70
- }): Promise<BulkWriteResult | void>;
70
+ }): Promise<BulkWriteResult | undefined>;
71
71
  }
72
72
  export {};
@@ -112,6 +112,7 @@ class SellerMakesOfferRepo {
112
112
  if (bulkWriteOps.length > 0) {
113
113
  return this.sellerModel.bulkWrite(bulkWriteOps, { ordered: false });
114
114
  }
115
+ return;
115
116
  }
116
117
  /**
117
118
  * 販売者とアプリケーションに対してオファーが存在すれば削除する
@@ -141,6 +142,7 @@ class SellerMakesOfferRepo {
141
142
  if (bulkWriteOps.length > 0) {
142
143
  return this.sellerModel.bulkWrite(bulkWriteOps, { ordered: false });
143
144
  }
145
+ return;
144
146
  }
145
147
  }
146
148
  exports.SellerMakesOfferRepo = SellerMakesOfferRepo;
@@ -99,7 +99,7 @@ export declare class TransactionRepo {
99
99
  expires: {
100
100
  $lt: Date;
101
101
  };
102
- }): Promise<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'typeOf'> | void>;
102
+ }): Promise<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'typeOf'> | undefined>;
103
103
  /**
104
104
  * 取引を期限切れにする
105
105
  */
@@ -850,6 +850,7 @@ class TransactionRepo {
850
850
  .exec();
851
851
  if (doc === null) {
852
852
  // no op
853
+ return;
853
854
  }
854
855
  else {
855
856
  transaction_1.transactionEventEmitter.emitTransactionStatusChanged({
@@ -39,4 +39,4 @@ export declare function exportOneTransactionTasksIfExists(params: {
39
39
  }): (repos: {
40
40
  task: TaskRepo;
41
41
  assetTransaction: AssetTransactionRepo;
42
- }) => Promise<Pick<factory.assetTransaction.ITransaction<factory.assetTransactionType>, "id" | "typeOf"> | void>;
42
+ }) => Promise<Pick<factory.assetTransaction.ITransaction<factory.assetTransactionType>, "id" | "typeOf"> | undefined>;
@@ -77,7 +77,7 @@ function placeOrder(params) {
77
77
  typeOf: factory.actionType.OrderAction
78
78
  };
79
79
  // 冪等性を担保(2023-05-31~)
80
- const completedActions = await repos.action.search({
80
+ const completedActions = await repos.action.findActionsByType({
81
81
  limit: 1,
82
82
  page: 1,
83
83
  actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
@@ -75,7 +75,7 @@ function cancelPengindIfNotYet(params) {
75
75
  let actionId;
76
76
  const actionAttributes = (0, factory_1.createCancelPendingReservationAction)({ transaction: reserveTransaction });
77
77
  // 冪等性を担保(2023-06-05~)
78
- const completedActions = await repos.action.search({
78
+ const completedActions = await repos.action.findActionsByType({
79
79
  limit: 1,
80
80
  page: 1,
81
81
  actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
@@ -134,7 +134,7 @@ params, options) {
134
134
  const actionAttributes = reserveTransaction2action({ transaction: reserveTransaction });
135
135
  // 冪等性を担保(2023-05-31~)
136
136
  debug('searching completed reserveAction... byTask:', options?.byTask, 'reservationNumber:', reservationPackage.reservationNumber);
137
- const completedActions = await repos.action.search({
137
+ const completedActions = await repos.action.findActionsByType({
138
138
  limit: 1,
139
139
  page: 1,
140
140
  actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
@@ -1,4 +1,4 @@
1
- import type { ActionRepo } from '../../../repo/action';
1
+ import type { AcceptPayActionRepo } from '../../../repo/action/acceptPay';
2
2
  import type { AuthorizePaymentMethodActionRepo } from '../../../repo/action/authorizePaymentMethod';
3
3
  import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
4
4
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
@@ -14,7 +14,8 @@ import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
14
14
  import * as factory from '../../../factory';
15
15
  import { placeOrder as PlaceOrderFactory } from '../../../factory/transaction';
16
16
  interface IConfirmOperationRepos {
17
- action: ActionRepo;
17
+ action?: never;
18
+ acceptPayAction: AcceptPayActionRepo;
18
19
  authorizePaymentMethodAction: AuthorizePaymentMethodActionRepo;
19
20
  authorizeOfferAction: AuthorizeOfferActionRepo;
20
21
  assetTransaction: AssetTransactionRepo;
@@ -65,6 +65,7 @@ function processTransactionNotInProgress(transaction) {
65
65
  else if (transaction.status === factory.transactionStatusType.Canceled) {
66
66
  throw new factory.errors.Argument('transactionId', 'Transaction already canceled');
67
67
  }
68
+ return;
68
69
  };
69
70
  }
70
71
  /**
@@ -397,16 +398,26 @@ function createResult(params, options) {
397
398
  }
398
399
  function searchAcceptPayActions(params) {
399
400
  return async (repos) => {
400
- let acceptPayActions = await repos.action.search({
401
- project: { id: { $eq: params.project.id } },
402
- typeOf: { $eq: factory.actionType.AcceptAction },
403
- actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
401
+ // let acceptPayActions = <IAcceptPayAction[]>await repos.action.search(
402
+ // {
403
+ // project: { id: { $eq: params.project.id } },
404
+ // typeOf: { $eq: factory.actionType.AcceptAction },
405
+ // actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
406
+ // purpose: {
407
+ // id: { $in: [params.id] },
408
+ // typeOf: { $in: [factory.transactionType.PlaceOrder] }
409
+ // },
410
+ // object: {
411
+ // typeOf: { $eq: factory.assetTransactionType.Pay }
412
+ // }
413
+ // },
414
+ // ['object', 'endDate', 'result']
415
+ // );
416
+ let acceptPayActions = await repos.acceptPayAction.findAcceptActionsByPurpose({
417
+ project: { id: params.project.id },
418
+ actionStatus: factory.actionStatusType.CompletedActionStatus,
404
419
  purpose: {
405
- id: { $in: [params.id] },
406
- typeOf: { $in: [factory.transactionType.PlaceOrder] }
407
- },
408
- object: {
409
- typeOf: { $eq: factory.assetTransactionType.Pay }
420
+ id: params.id
410
421
  }
411
422
  }, ['object', 'endDate', 'result']);
412
423
  // 万が一このプロセス中に他処理が発生してもそれらを無視するように、endDateでフィルタリング
@@ -48,4 +48,4 @@ export declare function exportOneTransactionTasksIfExists(params: {
48
48
  endDate?: factory.sortType;
49
49
  startDate?: factory.sortType;
50
50
  };
51
- }): IExportTasksOperation<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'typeOf'> | void>;
51
+ }): IExportTasksOperation<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'typeOf'> | undefined>;
package/package.json CHANGED
@@ -99,5 +99,5 @@
99
99
  "postversion": "git push origin --tags",
100
100
  "prepublishOnly": "npm run clean && npm run build"
101
101
  },
102
- "version": "24.0.0-alpha.39"
102
+ "version": "24.0.0-alpha.40"
103
103
  }