@chevre/domain 25.2.0-alpha.21 → 25.2.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.
@@ -364,7 +364,7 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
364
364
  }
365
365
  const paymentMethodIdByOrder = orderDoc.paymentMethodId;
366
366
  if (typeof paymentMethodIdByOrder === 'string') {
367
- console.log('paymentMethodId matched?', JSON.stringify(doc), JSON.stringify(orderDoc));
367
+ // console.log('paymentMethodId matched?', JSON.stringify(doc), JSON.stringify(orderDoc));
368
368
  if (paymentMethodId !== paymentMethodIdByOrder) {
369
369
  throw new factory_1.factory.errors.Internal('paymentMethodId not matched unexpectedly');
370
370
  }
@@ -1,5 +1,4 @@
1
1
  import { factory } from '../../../../factory';
2
- import { IMinimizedIndividualEvent } from '../../../../factory/event';
3
2
  declare function createReserveTransactionStartParams(params: {
4
3
  project: {
5
4
  id: string;
@@ -13,7 +12,6 @@ declare function createReserveTransactionStartParams(params: {
13
12
  transactionNumber: string;
14
13
  }): factory.assetTransaction.reserve.IStartParamsWithoutDetail;
15
14
  declare function createAuthorizeSeatReservationActionAttributes(params: {
16
- event: Pick<IMinimizedIndividualEvent, 'id'>;
17
15
  instrument: {
18
16
  /**
19
17
  * 予約取引番号
@@ -21,8 +19,6 @@ declare function createAuthorizeSeatReservationActionAttributes(params: {
21
19
  transactionNumber: string;
22
20
  };
23
21
  transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
24
- }, options: {
25
- useLegacyAuthorizeOfferObject: boolean;
26
22
  }): factory.action.authorize.offer.eventService.IAttributes;
27
23
  declare function acceptedOffers2amount(params: {
28
24
  acceptedOffers: Pick<IResultAcceptedOffer, 'priceSpecification' | 'id'>[];
@@ -80,16 +80,16 @@ function createReserveTransactionStartParams(params) {
80
80
  .toDate() // 余裕を持って
81
81
  };
82
82
  }
83
- function createAuthorizeSeatReservationActionAttributes(params, options) {
84
- const { useLegacyAuthorizeOfferObject } = options;
85
- const { event, transaction } = params;
86
- const authorizeObjectEvent = {
87
- id: event.id,
88
- typeOf: factory_1.factory.eventType.ScreeningEvent // fix(2024-07-17~)
89
- };
83
+ function createAuthorizeSeatReservationActionAttributes(params) {
84
+ // const { useLegacyAuthorizeOfferObject } = options;
85
+ const { transaction } = params;
86
+ // const authorizeObjectEvent: factory.action.authorize.offer.eventService.IEventInObject = {
87
+ // id: event.id,
88
+ // typeOf: factory.eventType.ScreeningEvent // fix(2024-07-17~)
89
+ // };
90
90
  const object = {
91
91
  typeOf: factory_1.factory.action.authorize.offer.eventService.ObjectType.SeatReservation,
92
- ...((useLegacyAuthorizeOfferObject) && { event: authorizeObjectEvent })
92
+ // ...((useLegacyAuthorizeOfferObject) && { event: authorizeObjectEvent })
93
93
  };
94
94
  const instrument = {
95
95
  typeOf: factory_1.factory.assetTransactionType.Reserve, // 変更(2024-03-08~)
@@ -63,10 +63,6 @@ interface IAuthorizeOptions {
63
63
  * 最大n日前から予約可能
64
64
  */
65
65
  maxReservationGracePeriodInDays: number;
66
- /**
67
- * 2026-07-04~
68
- */
69
- useLegacyAuthorizeOfferObject: boolean;
70
66
  /**
71
67
  * 2026-07-10~
72
68
  */
@@ -32,9 +32,9 @@ function authorize(params, options) {
32
32
  // まず取引番号発行
33
33
  const { transactionNumber } = await repos.transactionNumber.publishByTimestamp({ startDate: now });
34
34
  const actionAttributes = (0, factory_2.createAuthorizeSeatReservationActionAttributes)({
35
- event, transaction,
35
+ transaction,
36
36
  instrument: { transactionNumber }
37
- }, options);
37
+ });
38
38
  const action = await repos.authorizeOfferAction.start(actionAttributes);
39
39
  try {
40
40
  const processStartReserveResult = await (0, processStartReserve4chevre_1.processStartReserve4chevre)({
@@ -8,14 +8,13 @@ export declare function createAuthorizeSeatReservationActionAttributes(params: {
8
8
  acceptAction: {
9
9
  id: string;
10
10
  };
11
- event: {
12
- id: string;
13
- typeOf: factory.eventType.ScreeningEvent;
14
- };
15
11
  transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
16
- pendingTransaction: factory.action.authorize.offer.eventService.ICOAPendingTransaction;
17
- }, options: {
18
- useLegacyAuthorizeOfferObject: boolean;
12
+ /**
13
+ * 仮予約済のCOA予約取引
14
+ */
15
+ pendingTransaction: {
16
+ transactionNumber: string;
17
+ };
19
18
  }): factory.action.authorize.offer.eventService.IAttributes;
20
19
  /**
21
20
  * 供給情報から承認アクションの価格を導き出す
@@ -9,20 +9,20 @@ 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, options) {
13
- const { useLegacyAuthorizeOfferObject } = options;
12
+ function createAuthorizeSeatReservationActionAttributes(params) {
13
+ // const { useLegacyAuthorizeOfferObject } = options;
14
14
  const transaction = params.transaction;
15
- const authorizeObjectEvent = {
16
- id: params.event.id,
17
- typeOf: params.event.typeOf
18
- };
15
+ // const authorizeObjectEvent: factory.action.authorize.offer.eventService.IEventInObject = {
16
+ // id: params.event.id,
17
+ // typeOf: params.event.typeOf
18
+ // };
19
19
  const authorizeObject = {
20
20
  typeOf: factory_1.factory.action.authorize.offer.eventService.ObjectType.SeatReservation,
21
21
  id: params.acceptAction.id,
22
- ...((useLegacyAuthorizeOfferObject) && {
23
- event: authorizeObjectEvent,
24
- pendingTransaction: params.pendingTransaction
25
- })
22
+ // ...((useLegacyAuthorizeOfferObject) && {
23
+ // event: authorizeObjectEvent,
24
+ // pendingTransaction: params.pendingTransaction
25
+ // })
26
26
  };
27
27
  const instrument = {
28
28
  typeOf: factory_1.factory.assetTransactionType.COAReserveTransaction, // 変更(2024-03-08~)
@@ -53,11 +53,6 @@ export declare function authorize(params: {
53
53
  requestBody: IRequestBody;
54
54
  responseBody: IResponseBody;
55
55
  };
56
- }, options: {
57
- /**
58
- * 2026-07-04~
59
- */
60
- useLegacyAuthorizeOfferObject: boolean;
61
56
  }): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id' | 'instrument'> & {
62
57
  result: IAuthorizeOfferAction['result'];
63
58
  }>;
@@ -12,7 +12,7 @@ const factory_2 = require("../../../factory");
12
12
  /**
13
13
  * COA興行オファー承認
14
14
  */
15
- function authorize(params, options) {
15
+ function authorize(params) {
16
16
  return async (repos) => {
17
17
  const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
18
18
  typeOf: factory_2.factory.transactionType.PlaceOrder,
@@ -28,15 +28,18 @@ function authorize(params, options) {
28
28
  }
29
29
  let screeningEvent;
30
30
  let acceptedOffers;
31
+ // const pendingTransaction: factory.action.authorize.offer.eventService.ICOAPendingTransaction = {
32
+ // theaterCode: params.result.requestBody.theaterCode,
33
+ // dateJouei: params.result.requestBody.dateJouei,
34
+ // titleCode: params.result.requestBody.titleCode,
35
+ // titleBranchNum: params.result.requestBody.titleBranchNum,
36
+ // timeBegin: params.result.requestBody.timeBegin,
37
+ // tmpReserveNum: params.result.responseBody.tmpReserveNum,
38
+ // transactionNumber: params.result.responseBody.tmpReserveNum,
39
+ // typeOf: factory.assetTransactionType.COAReserveTransaction
40
+ // };
31
41
  const pendingTransaction = {
32
- theaterCode: params.result.requestBody.theaterCode,
33
- dateJouei: params.result.requestBody.dateJouei,
34
- titleCode: params.result.requestBody.titleCode,
35
- titleBranchNum: params.result.requestBody.titleBranchNum,
36
- timeBegin: params.result.requestBody.timeBegin,
37
- tmpReserveNum: params.result.responseBody.tmpReserveNum,
38
42
  transactionNumber: params.result.responseBody.tmpReserveNum,
39
- typeOf: factory_2.factory.assetTransactionType.COAReserveTransaction
40
43
  };
41
44
  try {
42
45
  screeningEvent = await repos.event.projectEventFieldsById({ id: params.object.event.id }, [
@@ -71,10 +74,10 @@ function authorize(params, options) {
71
74
  // アクション開始前に例外がthrowされてもCOA仮予約を取り消す機会をつくるためにFailedアクションを作成する(2023-09-12~)
72
75
  const failedActionAttributes = (0, factory_1.createAuthorizeSeatReservationActionAttributes)({
73
76
  acceptAction: params.object.acceptAction,
74
- event: { id: params.object.event.id, typeOf: factory_2.factory.eventType.ScreeningEvent },
77
+ // event: { id: params.object.event.id, typeOf: factory.eventType.ScreeningEvent },
75
78
  transaction,
76
79
  pendingTransaction
77
- }, options);
80
+ });
78
81
  const failedAction = await repos.action.start(failedActionAttributes);
79
82
  await repos.action.giveUp({ typeOf: failedAction.typeOf, id: failedAction.id, error });
80
83
  throw error;
@@ -88,10 +91,10 @@ function authorize(params, options) {
88
91
  // 承認アクションを開始
89
92
  const actionAttributes = (0, factory_1.createAuthorizeSeatReservationActionAttributes)({
90
93
  acceptAction: params.object.acceptAction,
91
- event: { id: screeningEvent.id, typeOf: screeningEvent.typeOf },
94
+ // event: { id: screeningEvent.id, typeOf: screeningEvent.typeOf },
92
95
  transaction,
93
96
  pendingTransaction
94
- }, options);
97
+ });
95
98
  const action = await repos.action.start(actionAttributes);
96
99
  try {
97
100
  // 座席仮予約からオファー情報を生成する
@@ -26,11 +26,6 @@ export declare function authorizeByAcceptAction(params: {
26
26
  */
27
27
  id: string;
28
28
  };
29
- }, options: {
30
- /**
31
- * 2026-07-04~
32
- */
33
- useLegacyAuthorizeOfferObject: boolean;
34
29
  }): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id' | 'instrument'> & {
35
30
  result: IAuthorizeOfferAction['result'];
36
31
  }>;
@@ -7,7 +7,7 @@ const factory_1 = require("../../../factory");
7
7
  /**
8
8
  * 採用アクションからCOA興行オファー承認
9
9
  */
10
- function authorizeByAcceptAction(params, options) {
10
+ function authorizeByAcceptAction(params) {
11
11
  return async (repos) => {
12
12
  const acceptAction = await repos.accpetCOAOfferAction.findCompletedById({
13
13
  project: { id: params.project.id },
@@ -57,7 +57,7 @@ function authorizeByAcceptAction(params, options) {
57
57
  store: { id: params.store.id },
58
58
  result: { requestBody, responseBody }
59
59
  };
60
- action = await (0, authorize_1.authorize)(authorizeParams, options)(repos);
60
+ action = await (0, authorize_1.authorize)(authorizeParams)(repos);
61
61
  }
62
62
  return action;
63
63
  };
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.5.0-alpha.6",
14
+ "@chevre/factory": "9.5.0-alpha.7",
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.2.0-alpha.21"
94
+ "version": "25.2.0-alpha.22"
95
95
  }