@chevre/domain 25.1.0 → 25.2.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.
Files changed (22) hide show
  1. package/lib/chevre/repo/action/actionProcess.js +5 -15
  2. package/lib/chevre/repo/action/authorizeOffer.d.ts +1 -1
  3. package/lib/chevre/service/assetTransaction/reserveCOA/cancel.d.ts +1 -13
  4. package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +66 -54
  5. package/lib/chevre/service/offer/event/authorize/factory.d.ts +2 -0
  6. package/lib/chevre/service/offer/event/authorize/factory.js +3 -13
  7. package/lib/chevre/service/offer/event/authorize.d.ts +4 -0
  8. package/lib/chevre/service/offer/event/authorize.js +1 -5
  9. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.d.ts +1 -0
  10. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.js +11 -1
  11. package/lib/chevre/service/offer/event/voidTransaction.js +1 -0
  12. package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +2 -0
  13. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -0
  14. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +2 -0
  15. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +6 -13
  16. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +5 -1
  17. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +3 -8
  18. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +5 -0
  19. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +3 -32
  20. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.d.ts +0 -1
  21. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +0 -1
  22. package/package.json +2 -2
@@ -272,23 +272,13 @@ class ActionProcessRepo {
272
272
  }
273
273
  });
274
274
  }
275
- const objectEventIdIn = params.object?.event?.id?.$in;
276
- if (Array.isArray(objectEventIdIn)) {
277
- andConditions.push({
278
- 'object.event.id': {
279
- $exists: true,
280
- $in: objectEventIdIn
281
- }
282
- });
283
- }
284
- // discontinue(2024-06-18~)
285
- // const objectAcceptedOfferSeatNumberIn =
286
- // params.object?.acceptedOffer?.itemOffered?.serviceOutput?.reservedTicket?.ticketedSeat?.seatNumber?.$in;
287
- // if (Array.isArray(objectAcceptedOfferSeatNumberIn)) {
275
+ // 承認アクションのobject.event廃止につき検索条件も廃止(2026-07-04~)
276
+ // const objectEventIdIn = params.object?.event?.id?.$in;
277
+ // if (Array.isArray(objectEventIdIn)) {
288
278
  // andConditions.push({
289
- // 'object.acceptedOffer.itemOffered.serviceOutput.reservedTicket.ticketedSeat.seatNumber': {
279
+ // 'object.event.id': {
290
280
  // $exists: true,
291
- // $in: objectAcceptedOfferSeatNumberIn
281
+ // $in: objectEventIdIn
292
282
  // }
293
283
  // });
294
284
  // }
@@ -65,7 +65,7 @@ export declare class AuthorizeOfferActionRepo extends ActionProcessRepo<IAuthori
65
65
  }): Promise<void>;
66
66
  reCompleteAuthorizeEventOfferAction(params: {
67
67
  id: string;
68
- object: factory.action.authorize.offer.eventService.IObject;
68
+ object: factory.action.authorize.offer.eventService.IObject4COA;
69
69
  result: factory.action.authorize.offer.eventService.IResult;
70
70
  }): Promise<void>;
71
71
  }
@@ -8,7 +8,6 @@ interface ICancelRepos {
8
8
  reserveService: COA.service.Reserve;
9
9
  task: TaskRepo;
10
10
  }
11
- type ICancelOperation<T> = (repos: ICancelRepos) => Promise<T>;
12
11
  interface ICancelByAcceptActionRepos {
13
12
  action: ActionRepo;
14
13
  acceptCOAOfferAction: AcceptCOAOfferActionRepo;
@@ -16,17 +15,6 @@ interface ICancelByAcceptActionRepos {
16
15
  task: TaskRepo;
17
16
  }
18
17
  type ICancelByAcceptActionOperation<T> = (repos: ICancelByAcceptActionRepos) => Promise<T>;
19
- /**
20
- * 興行オファー承認アクションからCOA予約を取り消す
21
- */
22
- declare function cancel(params: {
23
- action: factory.action.authorize.offer.eventService.IAction;
24
- }, options: {
25
- /**
26
- * cancelPendingReservation async?(2025-03-03~)
27
- */
28
- asyncCancelPendingReservation: boolean;
29
- }): ICancelOperation<void>;
30
18
  /**
31
19
  * 興行オファー採用アクションからCOA予約を取り消す
32
20
  */
@@ -38,4 +26,4 @@ declare function cancelByAcceptAction(params: {
38
26
  */
39
27
  asyncCancelPendingReservation: boolean;
40
28
  }): ICancelByAcceptActionOperation<void>;
41
- export { ICancelRepos, ICancelByAcceptActionRepos, cancel, cancelByAcceptAction };
29
+ export { ICancelRepos, ICancelByAcceptActionRepos, cancelByAcceptAction };
@@ -1,62 +1,74 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cancel = cancel;
4
3
  exports.cancelByAcceptAction = cancelByAcceptAction;
5
4
  const factory_1 = require("../../../factory");
6
5
  const cancelReservation_1 = require("../../reserveCOA/cancelReservation");
7
- /**
8
- * 興行オファー承認アクションからCOA予約を取り消す
9
- */
10
- function cancel(params, options) {
11
- return async (repos) => {
12
- // object.pendingTransactionに連携内容情報が記録されているので、その情報を元に仮予約を取り消す
13
- let delTmpReserveParams;
14
- // objectに進行中取引情報があれば利用する(2023-09-11~)
15
- const pendingTransaction = params.action.object.pendingTransaction;
16
- if (typeof pendingTransaction?.typeOf === 'string') {
17
- delTmpReserveParams = {
18
- theaterCode: pendingTransaction.theaterCode,
19
- dateJouei: pendingTransaction.dateJouei,
20
- titleCode: pendingTransaction.titleCode,
21
- titleBranchNum: pendingTransaction.titleBranchNum,
22
- timeBegin: pendingTransaction.timeBegin,
23
- tmpReserveNum: pendingTransaction.tmpReserveNum
24
- };
25
- }
26
- if (delTmpReserveParams !== undefined) {
27
- const { asyncCancelPendingReservation } = options;
28
- const object = {
29
- ...delTmpReserveParams,
30
- reservationStatus: factory_1.factory.reservationStatusType.ReservationPending,
31
- transactionNumber: delTmpReserveParams.tmpReserveNum,
32
- typeOf: factory_1.factory.assetTransactionType.COAReserveTransaction
33
- };
34
- const instrument = [params.action.purpose];
35
- if (asyncCancelPendingReservation) {
36
- // support async(2025-03-03~)
37
- const data = { object, instrument };
38
- const cancelPendingReservationTask = {
39
- project: { id: params.action.project.id, typeOf: factory_1.factory.organizationType.Project },
40
- name: factory_1.factory.taskName.CancelPendingReservation,
41
- status: factory_1.factory.taskStatus.Ready,
42
- runsAt: new Date(),
43
- remainingNumberOfTries: 10,
44
- numberOfTried: 0,
45
- executionResults: [],
46
- data
47
- };
48
- await repos.task.saveMany([cancelPendingReservationTask], { emitImmediately: true });
49
- }
50
- else {
51
- await (0, cancelReservation_1.cancelPendingReservation)({
52
- project: { id: params.action.project.id },
53
- object,
54
- instrument
55
- })(repos);
56
- }
57
- }
58
- };
59
- }
6
+ // /**
7
+ // * 興行オファー承認アクションからCOA予約を取り消す
8
+ // */
9
+ // function cancel(
10
+ // params: {
11
+ // action: factory.action.authorize.offer.eventService.IAction;
12
+ // },
13
+ // options: {
14
+ // /**
15
+ // * cancelPendingReservation async?(2025-03-03~)
16
+ // */
17
+ // asyncCancelPendingReservation: boolean;
18
+ // }
19
+ // ): ICancelOperation<void> {
20
+ // return async (repos: {
21
+ // action: ActionRepo;
22
+ // reserveService: COA.service.Reserve;
23
+ // task: TaskRepo;
24
+ // }) => {
25
+ // // object.pendingTransactionに連携内容情報が記録されているので、その情報を元に仮予約を取り消す
26
+ // let delTmpReserveParams: COA.factory.reserve.IDelTmpReserveArgs | undefined;
27
+ // // objectに進行中取引情報があれば利用する(2023-09-11~)
28
+ // const pendingTransaction = params.action.object.pendingTransaction;
29
+ // if (typeof pendingTransaction?.typeOf === 'string') {
30
+ // delTmpReserveParams = {
31
+ // theaterCode: pendingTransaction.theaterCode,
32
+ // dateJouei: pendingTransaction.dateJouei,
33
+ // titleCode: pendingTransaction.titleCode,
34
+ // titleBranchNum: pendingTransaction.titleBranchNum,
35
+ // timeBegin: pendingTransaction.timeBegin,
36
+ // tmpReserveNum: pendingTransaction.tmpReserveNum
37
+ // };
38
+ // }
39
+ // if (delTmpReserveParams !== undefined) {
40
+ // const { asyncCancelPendingReservation } = options;
41
+ // const object: factory.action.cancel.coaReserve.IObject = {
42
+ // ...delTmpReserveParams,
43
+ // reservationStatus: factory.reservationStatusType.ReservationPending,
44
+ // transactionNumber: delTmpReserveParams.tmpReserveNum,
45
+ // typeOf: factory.assetTransactionType.COAReserveTransaction
46
+ // };
47
+ // const instrument: factory.action.cancel.coaReserve.IPlaceOrderAsInstrument[] = [params.action.purpose];
48
+ // if (asyncCancelPendingReservation) {
49
+ // // support async(2025-03-03~)
50
+ // const data: factory.task.cancelPendingReservation.IPotentialCancelCOAReserveAction = { object, instrument };
51
+ // const cancelPendingReservationTask: factory.task.cancelPendingReservation.IAttributes = {
52
+ // project: { id: params.action.project.id, typeOf: factory.organizationType.Project },
53
+ // name: factory.taskName.CancelPendingReservation,
54
+ // status: factory.taskStatus.Ready,
55
+ // runsAt: new Date(),
56
+ // remainingNumberOfTries: 10,
57
+ // numberOfTried: 0,
58
+ // executionResults: [],
59
+ // data
60
+ // };
61
+ // await repos.task.saveMany([cancelPendingReservationTask], { emitImmediately: true });
62
+ // } else {
63
+ // await cancelPendingReservation({
64
+ // project: { id: params.action.project.id },
65
+ // object,
66
+ // instrument
67
+ // })(repos);
68
+ // }
69
+ // }
70
+ // };
71
+ // }
60
72
  /**
61
73
  * 興行オファー採用アクションからCOA予約を取り消す
62
74
  */
@@ -21,6 +21,8 @@ declare function createAuthorizeSeatReservationActionAttributes(params: {
21
21
  transactionNumber: string;
22
22
  };
23
23
  transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
24
+ }, options: {
25
+ useLegacyAuthorizeOfferObject: boolean;
24
26
  }): factory.action.authorize.offer.eventService.IAttributes;
25
27
  declare function acceptedOffers2amount(params: {
26
28
  acceptedOffers: Pick<IResultAcceptedOffer, 'priceSpecification' | 'id'>[];
@@ -80,29 +80,19 @@ function createReserveTransactionStartParams(params) {
80
80
  .toDate() // 余裕を持って
81
81
  };
82
82
  }
83
- function createAuthorizeSeatReservationActionAttributes(params) {
83
+ function createAuthorizeSeatReservationActionAttributes(params, options) {
84
+ const { useLegacyAuthorizeOfferObject } = options;
84
85
  const { event, transaction } = params;
85
86
  const authorizeObjectEvent = {
86
87
  id: event.id,
87
- // offers: { // discontinue(2024-06-22~)
88
- // offeredThrough: {
89
- // identifier: factory.service.webAPI.Identifier.Chevre,
90
- // typeOf: 'WebAPI'
91
- // }
92
- // },
93
- // typeOf: event.typeOf
94
88
  typeOf: factory_1.factory.eventType.ScreeningEvent // fix(2024-07-17~)
95
89
  };
96
90
  const object = {
97
91
  typeOf: factory_1.factory.action.authorize.offer.eventService.ObjectType.SeatReservation,
98
- event: authorizeObjectEvent
99
- // pendingTransaction: params.pendingTransaction, // discontinue(2024-06-22~)
100
- // ...(params.broker !== undefined) ? { broker: params.broker } : undefined // discontinue(2024-06-24~)
92
+ ...((useLegacyAuthorizeOfferObject) && { event: authorizeObjectEvent })
101
93
  };
102
94
  const instrument = {
103
- // typeOf: 'WebAPI',
104
95
  typeOf: factory_1.factory.assetTransactionType.Reserve, // 変更(2024-03-08~)
105
- // identifier: factory.service.webAPI.Identifier.Chevre, // discontinue(2025-01-02~)
106
96
  transactionNumber: params.instrument.transactionNumber
107
97
  };
108
98
  const agent = {
@@ -63,6 +63,10 @@ interface IAuthorizeOptions {
63
63
  * 最大n日前から予約可能
64
64
  */
65
65
  maxReservationGracePeriodInDays: number;
66
+ /**
67
+ * 2026-07-04~
68
+ */
69
+ useLegacyAuthorizeOfferObject: boolean;
66
70
  }
67
71
  /**
68
72
  * 興行オファー承認
@@ -34,7 +34,7 @@ function authorize(params, options) {
34
34
  const actionAttributes = (0, factory_2.createAuthorizeSeatReservationActionAttributes)({
35
35
  event, transaction,
36
36
  instrument: { transactionNumber }
37
- });
37
+ }, options);
38
38
  const action = await repos.authorizeOfferAction.start(actionAttributes);
39
39
  try {
40
40
  const processStartReserveResult = await (0, processStartReserve4chevre_1.processStartReserve4chevre)({
@@ -139,10 +139,6 @@ function validateCreateRequest(params) {
139
139
  const event = {
140
140
  id: params.object.reservationFor.id,
141
141
  typeOf: factory_1.factory.eventType.ScreeningEvent // ひとまずfix(2024-07-17~)
142
- // offers: {
143
- // ...(typeof validForMemberTier?.token === 'string') ? { validForMemberTier } : undefined,
144
- // ...(typeof eventOfferIdentifier === 'string') ? { identifier: eventOfferIdentifier } : undefined
145
- // }
146
142
  };
147
143
  return { transaction, event };
148
144
  };
@@ -12,6 +12,7 @@ declare function processVoidTransaction4coa(params: {
12
12
  asyncCancelPendingReservation: boolean;
13
13
  }): (repos: {
14
14
  action: ActionRepo;
15
+ acceptCOAOfferAction: AcceptCOAOfferActionRepo;
15
16
  reserveService: COA.service.Reserve;
16
17
  task: TaskRepo;
17
18
  }) => Promise<void>;
@@ -2,10 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.processVoidTransaction4coa = processVoidTransaction4coa;
4
4
  exports.processVoidTransactionByAcceptAction4coa = processVoidTransactionByAcceptAction4coa;
5
+ const factory_1 = require("../../../../factory");
5
6
  const cancel_1 = require("../../../assetTransaction/reserveCOA/cancel");
6
7
  function processVoidTransaction4coa(params, options) {
7
8
  return async (repos) => {
8
- await (0, cancel_1.cancel)(params, options)(repos);
9
+ // 採用アクションから取り消すように変更(2026-07-03~)
10
+ // await cancel(params, options)(repos);
11
+ // COA承認の場合、採用アクションは必ず存在するはず
12
+ const acceptActionId = params.action.object.id;
13
+ if (typeof acceptActionId !== 'string') {
14
+ throw new factory_1.factory.errors.NotFound('action.object.id');
15
+ }
16
+ const acceptAction = await repos.acceptCOAOfferAction.findById({ id: acceptActionId, typeOf: factory_1.factory.actionType.AcceptAction });
17
+ // console.log('processVoidTransaction4coa processing...', params.action.id, params.action.purpose.id, acceptAction);
18
+ await (0, cancel_1.cancelByAcceptAction)({ action: acceptAction }, options)(repos);
9
19
  };
10
20
  }
11
21
  function processVoidTransactionByAcceptAction4coa(params, options) {
@@ -89,6 +89,7 @@ function voidTransaction(params) {
89
89
  }
90
90
  await (0, processVoidTransaction4coa_1.processVoidTransaction4coa)({ action }, { asyncCancelPendingReservation: true })({
91
91
  action: repos.action,
92
+ acceptCOAOfferAction: repos.acceptCOAOfferAction,
92
93
  reserveService,
93
94
  task: repos.task
94
95
  });
@@ -2,6 +2,7 @@ import type { COA } from '@motionpicture/coa-service';
2
2
  import { factory } from '../../../factory';
3
3
  import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
4
4
  import type { ActionRepo } from '../../../repo/action';
5
+ import { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
5
6
  import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
6
7
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
7
8
  import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
@@ -16,6 +17,7 @@ interface IVoidTransactionByActionIdRepos {
16
17
  * CancelAction開始で使用される
17
18
  */
18
19
  action: ActionRepo;
20
+ acceptCOAOfferAction: AcceptCOAOfferActionRepo;
19
21
  authorizeOfferAction: AuthorizeOfferActionRepo;
20
22
  assetTransaction: AssetTransactionRepo;
21
23
  stockHolder: StockHolderRepo;
@@ -57,6 +57,7 @@ function voidTransactionByActionId(params) {
57
57
  }
58
58
  await (0, processVoidTransaction4coa_1.processVoidTransaction4coa)({ action }, { asyncCancelPendingReservation: false })({
59
59
  action: repos.action,
60
+ acceptCOAOfferAction: repos.acceptCOAOfferAction,
60
61
  reserveService,
61
62
  task: repos.task
62
63
  });
@@ -14,6 +14,8 @@ export declare function createAuthorizeSeatReservationActionAttributes(params: {
14
14
  };
15
15
  transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
16
16
  pendingTransaction: factory.action.authorize.offer.eventService.ICOAPendingTransaction;
17
+ }, options: {
18
+ useLegacyAuthorizeOfferObject: boolean;
17
19
  }): factory.action.authorize.offer.eventService.IAttributes;
18
20
  /**
19
21
  * 供給情報から承認アクションの価格を導き出す
@@ -9,30 +9,23 @@ exports.responseBody2acceptedOffers4result = responseBody2acceptedOffers4result;
9
9
  const moment_1 = __importDefault(require("moment"));
10
10
  const util_1 = require("util");
11
11
  const factory_1 = require("../../../../factory");
12
- function createAuthorizeSeatReservationActionAttributes(params) {
12
+ function createAuthorizeSeatReservationActionAttributes(params, options) {
13
+ const { useLegacyAuthorizeOfferObject } = options;
13
14
  const transaction = params.transaction;
14
- // 最適化(2022-06-07~)
15
15
  const authorizeObjectEvent = {
16
16
  id: params.event.id,
17
- // イベント提供サービスを識別できるようにするために追加(2022-06-04~)
18
- // offers: { // discontinue(2024-06-22~)
19
- // offeredThrough: {
20
- // identifier: factory.service.webAPI.Identifier.COA,
21
- // typeOf: 'WebAPI'
22
- // }
23
- // },
24
17
  typeOf: params.event.typeOf
25
18
  };
26
19
  const authorizeObject = {
27
20
  typeOf: factory_1.factory.action.authorize.offer.eventService.ObjectType.SeatReservation,
28
21
  id: params.acceptAction.id,
29
- event: authorizeObjectEvent,
30
- pendingTransaction: params.pendingTransaction
22
+ ...((useLegacyAuthorizeOfferObject) && {
23
+ event: authorizeObjectEvent,
24
+ pendingTransaction: params.pendingTransaction
25
+ })
31
26
  };
32
27
  const instrument = {
33
- // typeOf: 'WebAPI',
34
28
  typeOf: factory_1.factory.assetTransactionType.COAReserveTransaction, // 変更(2024-03-08~)
35
- // identifier: factory.service.webAPI.Identifier.COA,// discontinue(2025-01-02~)
36
29
  transactionNumber: params.pendingTransaction.transactionNumber
37
30
  };
38
31
  return {
@@ -53,7 +53,11 @@ export declare function authorize(params: {
53
53
  requestBody: IRequestBody;
54
54
  responseBody: IResponseBody;
55
55
  };
56
- options: Record<string, never>;
56
+ }, options: {
57
+ /**
58
+ * 2026-07-04~
59
+ */
60
+ useLegacyAuthorizeOfferObject: boolean;
57
61
  }): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id' | 'instrument'> & {
58
62
  result: IAuthorizeOfferAction['result'];
59
63
  }>;
@@ -12,7 +12,7 @@ const factory_2 = require("../../../factory");
12
12
  /**
13
13
  * COA興行オファー承認
14
14
  */
15
- function authorize(params) {
15
+ function authorize(params, options) {
16
16
  return async (repos) => {
17
17
  const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
18
18
  typeOf: factory_2.factory.transactionType.PlaceOrder,
@@ -71,11 +71,10 @@ function authorize(params) {
71
71
  // アクション開始前に例外がthrowされてもCOA仮予約を取り消す機会をつくるためにFailedアクションを作成する(2023-09-12~)
72
72
  const failedActionAttributes = (0, factory_1.createAuthorizeSeatReservationActionAttributes)({
73
73
  acceptAction: params.object.acceptAction,
74
- // acceptedOffers: [],
75
74
  event: { id: params.object.event.id, typeOf: factory_2.factory.eventType.ScreeningEvent },
76
75
  transaction,
77
76
  pendingTransaction
78
- });
77
+ }, options);
79
78
  const failedAction = await repos.action.start(failedActionAttributes);
80
79
  await repos.action.giveUp({ typeOf: failedAction.typeOf, id: failedAction.id, error });
81
80
  throw error;
@@ -89,11 +88,10 @@ function authorize(params) {
89
88
  // 承認アクションを開始
90
89
  const actionAttributes = (0, factory_1.createAuthorizeSeatReservationActionAttributes)({
91
90
  acceptAction: params.object.acceptAction,
92
- // acceptedOffers,
93
91
  event: { id: screeningEvent.id, typeOf: screeningEvent.typeOf },
94
92
  transaction,
95
93
  pendingTransaction
96
- });
94
+ }, options);
97
95
  const action = await repos.action.start(actionAttributes);
98
96
  try {
99
97
  // 座席仮予約からオファー情報を生成する
@@ -114,14 +112,11 @@ function authorize(params) {
114
112
  priceCurrency: factory_2.factory.priceCurrency.JPY,
115
113
  amount: []
116
114
  };
117
- // add orderInTransaction(2024-01-15~)
118
- // if (params.options.useCreateOrderOnOfferAccepted) {
119
115
  await (0, any_1.acceptOffer)({
120
116
  project: transaction.project,
121
117
  placeOrderId: params.transaction.id,
122
118
  acceptedOffers: acceptedOffers4result
123
119
  })(repos);
124
- // }
125
120
  }
126
121
  catch (error) {
127
122
  try {
@@ -26,6 +26,11 @@ export declare function authorizeByAcceptAction(params: {
26
26
  */
27
27
  id: string;
28
28
  };
29
+ }, options: {
30
+ /**
31
+ * 2026-07-04~
32
+ */
33
+ useLegacyAuthorizeOfferObject: boolean;
29
34
  }): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id' | 'instrument'> & {
30
35
  result: IAuthorizeOfferAction['result'];
31
36
  }>;
@@ -7,23 +7,8 @@ const factory_1 = require("../../../factory");
7
7
  /**
8
8
  * 採用アクションからCOA興行オファー承認
9
9
  */
10
- function authorizeByAcceptAction(params) {
10
+ function authorizeByAcceptAction(params, options) {
11
11
  return async (repos) => {
12
- // const acceptAction = (<IAcceptAction[]>await repos.action.search(
13
- // {
14
- // limit: 1,
15
- // page: 1,
16
- // project: { id: { $eq: params.project.id } },
17
- // id: { $in: [params.object.id] },
18
- // typeOf: { $eq: factory.actionType.AcceptAction },
19
- // purpose: { id: { $in: [params.purpose.id] } },
20
- // actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] }
21
- // },
22
- // ['result', 'object', 'potentialActions']
23
- // )).shift();
24
- // if (acceptAction === undefined) {
25
- // throw new factory.errors.NotFound(factory.actionType.AcceptAction);
26
- // }
27
12
  const acceptAction = await repos.accpetCOAOfferAction.findCompletedById({
28
13
  project: { id: params.project.id },
29
14
  id: params.object.id,
@@ -44,9 +29,6 @@ function authorizeByAcceptAction(params) {
44
29
  agent: { id: params.agent.id },
45
30
  transaction: { id: params.purpose.id },
46
31
  id: acceptAction.potentialActions.id,
47
- options: {
48
- // useCreateOrderOnOfferAccepted: USE_CREATE_ORDER_ON_OFFER_ACCEPTED // discontinue(2024-05-28~)
49
- }
50
32
  };
51
33
  action = await (0, changeOffers_1.changeOffers)(changeOfferParams)(repos);
52
34
  }
@@ -64,14 +46,6 @@ function authorizeByAcceptAction(params) {
64
46
  if (responseBody === undefined) {
65
47
  throw new factory_1.factory.errors.NotFound('afterMedia by recipe');
66
48
  }
67
- // const requestBody = acceptAction.instrument.requestBody;
68
- // if (requestBody === undefined) {
69
- // throw new chevre.factory.errors.NotFound(`${chevre.factory.actionType.AcceptAction}.result.requestBody`);
70
- // }
71
- // const responseBody = acceptResult.result?.responseBody;
72
- // if (responseBody === undefined) {
73
- // throw new chevre.factory.errors.NotFound(`${chevre.factory.actionType.AcceptAction}.result.responseBody`);
74
- // }
75
49
  const authorizeParams = {
76
50
  object: {
77
51
  acceptAction: { id: params.object.id },
@@ -81,12 +55,9 @@ function authorizeByAcceptAction(params) {
81
55
  agent: { id: params.agent.id },
82
56
  transaction: { id: params.purpose.id },
83
57
  store: { id: params.store.id },
84
- result: { requestBody, responseBody },
85
- options: {
86
- // useCreateOrderOnOfferAccepted: USE_CREATE_ORDER_ON_OFFER_ACCEPTED // discontinue(2024-05-28~)
87
- }
58
+ result: { requestBody, responseBody }
88
59
  };
89
- action = await (0, authorize_1.authorize)(authorizeParams)(repos);
60
+ action = await (0, authorize_1.authorize)(authorizeParams, options)(repos);
90
61
  }
91
62
  return action;
92
63
  };
@@ -17,7 +17,6 @@ export declare function changeOffers(params: {
17
17
  transaction: {
18
18
  id: string;
19
19
  };
20
- options: Record<string, never>;
21
20
  }): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id' | 'instrument'> & {
22
21
  result: IAuthorizeOfferAction['result'];
23
22
  }>;
@@ -9,7 +9,6 @@ const any_1 = require("../any");
9
9
  const factory_1 = require("./authorize/factory");
10
10
  const validateAcceptedOffers_1 = require("./authorize/validateAcceptedOffers");
11
11
  const factory_2 = require("../../../factory");
12
- // type IAcceptAction = Pick<factory.action.accept.coaOffer.IAction, 'result'>;
13
12
  /**
14
13
  * COA興行オファー承認のオファーを変更
15
14
  */
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@aws-sdk/client-cognito-identity-provider": "3.600.0",
13
13
  "@aws-sdk/credential-providers": "3.600.0",
14
- "@chevre/factory": "9.4.0",
14
+ "@chevre/factory": "9.5.0-alpha.1",
15
15
  "@motionpicture/coa-service": "10.0.0",
16
16
  "@motionpicture/gmo-service": "6.1.0-alpha.0",
17
17
  "@sendgrid/client": "8.1.4",
@@ -91,5 +91,5 @@
91
91
  "postversion": "git push origin --tags",
92
92
  "prepublishOnly": "npm run clean && npm run build"
93
93
  },
94
- "version": "25.1.0"
94
+ "version": "25.2.0-alpha.1"
95
95
  }