@chevre/domain 28.1.0-alpha.4 → 28.1.0-alpha.5

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 (90) hide show
  1. package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +1 -1
  2. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +23 -20
  3. package/lib/chevre/repo/mongoose/schemas/setting.js +7 -4
  4. package/lib/chevre/repo/setting/integration.d.ts +1 -0
  5. package/lib/chevre/repo/setting/integration.js +31 -0
  6. package/lib/chevre/repo/setting.d.ts +1 -1
  7. package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +3 -4
  8. package/lib/chevre/service/assetTransaction/reserve/cancel.js +1 -3
  9. package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +3 -4
  10. package/lib/chevre/service/assetTransaction/reserve/confirm.js +1 -3
  11. package/lib/chevre/service/assetTransaction/reserve/start.d.ts +3 -2
  12. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +3 -2
  13. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.js +2 -6
  14. package/lib/chevre/service/offer/event/authorize.d.ts +3 -2
  15. package/lib/chevre/service/offer/event/authorize.js +2 -2
  16. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +3 -4
  17. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.js +2 -2
  18. package/lib/chevre/service/offer/event/voidTransaction.d.ts +3 -4
  19. package/lib/chevre/service/offer/event/voidTransaction.js +3 -3
  20. package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +3 -4
  21. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +2 -2
  22. package/lib/chevre/service/offer/onEventChanged.js +4 -4
  23. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.d.ts +0 -2
  24. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +3 -4
  25. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.js +2 -2
  26. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onReserveTransactionConfirmed.d.ts +0 -2
  27. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +3 -4
  28. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +2 -2
  29. package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -2
  30. package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +1 -1
  31. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.d.ts +2 -2
  32. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +1 -1
  33. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.d.ts +2 -2
  34. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +1 -1
  35. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +2 -2
  36. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +1 -1
  37. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.d.ts +2 -2
  38. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +2 -4
  39. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.d.ts +2 -2
  40. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +1 -1
  41. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +3 -4
  42. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +3 -3
  43. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +2 -2
  44. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +1 -1
  45. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.d.ts +2 -2
  46. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +1 -1
  47. package/lib/chevre/service/order/onOrderUpdated/factory.d.ts +2 -2
  48. package/lib/chevre/service/order/onOrderUpdated/factory.js +1 -1
  49. package/lib/chevre/service/order/onOrderUpdated.d.ts +2 -2
  50. package/lib/chevre/service/order/onOrderUpdated.js +1 -1
  51. package/lib/chevre/service/order/payOrder.d.ts +3 -4
  52. package/lib/chevre/service/order/payOrder.js +2 -2
  53. package/lib/chevre/service/order/placeOrder.d.ts +3 -4
  54. package/lib/chevre/service/order/placeOrder.js +2 -2
  55. package/lib/chevre/service/order/returnOrder.d.ts +2 -2
  56. package/lib/chevre/service/order/sendOrder.d.ts +2 -2
  57. package/lib/chevre/service/reserve/cancelReservation.d.ts +3 -3
  58. package/lib/chevre/service/reserve/checkInReservation.d.ts +2 -2
  59. package/lib/chevre/service/reserve/confirmReservation.d.ts +2 -2
  60. package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.d.ts +2 -2
  61. package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +2 -3
  62. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +2 -2
  63. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +2 -3
  64. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.d.ts +2 -2
  65. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +2 -2
  66. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +2 -2
  67. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +2 -2
  68. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +2 -2
  69. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +2 -3
  70. package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.d.ts +2 -2
  71. package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +2 -3
  72. package/lib/chevre/service/reserve/useReservation.d.ts +2 -2
  73. package/lib/chevre/service/task/cancelPendingReservation.js +3 -4
  74. package/lib/chevre/service/task/cancelReservation.js +2 -2
  75. package/lib/chevre/service/task/confirmReserveTransaction.d.ts +3 -4
  76. package/lib/chevre/service/task/confirmReserveTransaction.js +6 -7
  77. package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +3 -4
  78. package/lib/chevre/service/task/onAuthorizationCreated.js +2 -2
  79. package/lib/chevre/service/task/onOrderPaymentCompleted.js +2 -4
  80. package/lib/chevre/service/task/placeOrder.js +2 -4
  81. package/lib/chevre/service/task/reserve.js +2 -2
  82. package/lib/chevre/service/task/returnOrder.js +2 -2
  83. package/lib/chevre/service/task/sendOrder.js +2 -2
  84. package/lib/chevre/service/task/useReservation.js +2 -2
  85. package/lib/chevre/service/task/voidReserveTransaction.js +4 -5
  86. package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.d.ts +2 -2
  87. package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +4 -4
  88. package/lib/chevre/service/taskHandler/onOperationFailed.d.ts +2 -2
  89. package/lib/chevre/service/taskHandler.js +2 -2
  90. package/package.json +1 -1
@@ -16,7 +16,7 @@ const schemaDefinition = {
16
16
  typeOf: { type: String, required: true },
17
17
  itemListElement: [mongoose_1.SchemaTypes.Mixed],
18
18
  itemOffered: { type: mongoose_1.SchemaTypes.Mixed, required: true },
19
- // additionalProperty: [SchemaTypes.Mixed], // TODO discontinue(2026-10-31~)
19
+ // additionalProperty: [SchemaTypes.Mixed], // discontinue(2026-10-31~)
20
20
  dateSynced: Date // 追加(2023-09-13~)
21
21
  };
22
22
  const schemaOptions = {
@@ -2,19 +2,10 @@ import type { Algorithm } from 'jsonwebtoken';
2
2
  import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
3
3
  import { factory } from '../../../factory';
4
4
  import { IVirtuals } from '../virtuals';
5
- interface IOnOrderStatusChanged {
6
- /**
7
- * AggService通知先
8
- */
9
- informOrder?: factory.project.IInformParams[];
10
- }
11
- interface IOnReservationStatusChanged {
12
- /**
13
- * AggService通知先
14
- */
15
- informReservation?: factory.project.IInformParams[];
16
- }
17
- interface IOnTaskStatusChanged {
5
+ /**
6
+ * @deprecated integration.aggへ移行済(2026-11-03~)
7
+ */
8
+ export interface IOnTaskStatusChanged {
18
9
  /**
19
10
  * AggService通知先
20
11
  */
@@ -28,9 +19,6 @@ interface IOnTaskStatusChanged {
28
19
  */
29
20
  informTaskStatuses?: factory.taskStatus[];
30
21
  }
31
- interface IOnEventChanged {
32
- informEvent2agg?: factory.project.IInformParams[];
33
- }
34
22
  export interface IStorageSettings {
35
23
  deleteTransactionTaskExpiresInDays: number;
36
24
  /**
@@ -198,6 +186,20 @@ export interface IHubSettings {
198
186
  */
199
187
  googleTargetAudience?: string;
200
188
  }
189
+ export interface IAggSettings {
190
+ /**
191
+ * AggService通知先
192
+ */
193
+ informActions?: factory.project.IInformParams[];
194
+ /**
195
+ * 分析連携するtaskNameリスト
196
+ */
197
+ informTaskNames?: factory.taskName[];
198
+ /**
199
+ * 分析連携するtaskStatusリスト
200
+ */
201
+ informTaskStatuses?: factory.taskStatus[];
202
+ }
201
203
  export interface IIntegrationSettings {
202
204
  abortedTasksWithoutReport: string[];
203
205
  numTryConfirmReserveTransaction: number;
@@ -215,6 +217,11 @@ export interface IIntegrationSettings {
215
217
  * 2026-06-02~
216
218
  */
217
219
  hub?: IHubSettings;
220
+ /**
221
+ * 集計サービスへの連携設定
222
+ * 2026-11-02~
223
+ */
224
+ agg?: IAggSettings;
218
225
  useExperimentalFeature: boolean;
219
226
  }
220
227
  /**
@@ -261,10 +268,6 @@ export interface IMemberSetting {
261
268
  export interface ISetting {
262
269
  defaultSenderEmail?: string;
263
270
  jwt?: IJWTSetting;
264
- onEventChanged?: IOnEventChanged;
265
- onOrderStatusChanged: IOnOrderStatusChanged;
266
- onReservationStatusChanged?: IOnReservationStatusChanged;
267
- onTaskStatusChanged?: IOnTaskStatusChanged;
268
271
  orderNumber?: IOrderNumberSetting;
269
272
  project: {
270
273
  id: string;
@@ -11,10 +11,13 @@ const schemaDefinition = {
11
11
  defaultSenderEmail: String,
12
12
  jwt: mongoose_1.SchemaTypes.Mixed,
13
13
  project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
14
- onEventChanged: mongoose_1.SchemaTypes.Mixed,
15
- onOrderStatusChanged: mongoose_1.SchemaTypes.Mixed,
16
- onReservationStatusChanged: mongoose_1.SchemaTypes.Mixed,
17
- onTaskStatusChanged: mongoose_1.SchemaTypes.Mixed,
14
+ // discontinue(2026-11-02~)
15
+ ...{
16
+ onEventChanged: mongoose_1.SchemaTypes.Mixed,
17
+ onOrderStatusChanged: mongoose_1.SchemaTypes.Mixed,
18
+ onReservationStatusChanged: mongoose_1.SchemaTypes.Mixed,
19
+ onTaskStatusChanged: mongoose_1.SchemaTypes.Mixed,
20
+ },
18
21
  // onResourceUpdated: SchemaTypes.Mixed, // discontinue(2026-11-02~)
19
22
  // onTransactionStatusChanged: SchemaTypes.Mixed, // discontinue(2026-06-29~)
20
23
  orderNumber: mongoose_1.SchemaTypes.Mixed,
@@ -24,4 +24,5 @@ export declare class IntegrationSettingRepo {
24
24
  getByKey<T extends keyof IIntegrationSettings>(key: T): Promise<IIntegrationSettings[T]>;
25
25
  addSendGridSettings(params: ISendGridSettings): Promise<import("mongoose").UpdateWriteOpResult>;
26
26
  addHubSettings(params: IHubSettings): Promise<import("mongoose").UpdateWriteOpResult>;
27
+ migrateAggSettings(): Promise<import("mongoose").UpdateWriteOpResult | undefined>;
27
28
  }
@@ -98,5 +98,36 @@ class IntegrationSettingRepo {
98
98
  })
99
99
  .exec();
100
100
  }
101
+ async migrateAggSettings() {
102
+ const oldSetting = await this.settingModel.findOne({ 'project.id': { $eq: '*' } }, { onTaskStatusChanged: 1 })
103
+ .lean()
104
+ .exec();
105
+ if (oldSetting?.onTaskStatusChanged !== undefined) {
106
+ const { informTask, informTaskNames, informTaskStatuses } = oldSetting.onTaskStatusChanged;
107
+ const aggSettings = {
108
+ informActions: informTask,
109
+ informTaskNames,
110
+ informTaskStatuses
111
+ };
112
+ console.dir(aggSettings, { depth: null });
113
+ const updateResult = await this.settingModel.updateOne({ 'project.id': { $eq: '*' } }, {
114
+ $set: { 'integration.agg': aggSettings }
115
+ })
116
+ .exec();
117
+ // const unsetResult = await this.settingModel.updateOne(
118
+ // { 'project.id': { $eq: '*' } },
119
+ // {
120
+ // $unset: {
121
+ // onEventChanged: 1,
122
+ // onOrderStatusChanged: 1,
123
+ // onReservationStatusChanged: 1,
124
+ // onTaskStatusChanged: 1,
125
+ // }
126
+ // }
127
+ // )
128
+ // .exec();
129
+ return updateResult;
130
+ }
131
+ }
101
132
  }
102
133
  exports.IntegrationSettingRepo = IntegrationSettingRepo;
@@ -1,7 +1,7 @@
1
1
  import type { Connection, FilterQuery } from 'mongoose';
2
2
  import { ISetting, IStorageSettings } from './mongoose/schemas/setting';
3
3
  type IKeyOfProjection = Exclude<keyof ISetting, 'jwt' | 'project' | 'waiter' | 'integration'>;
4
- type IGlobalSetting = Pick<ISetting, 'defaultSenderEmail' | 'onEventChanged' | 'onOrderStatusChanged' | 'onReservationStatusChanged' | 'onTaskStatusChanged' | 'orderNumber' | 'quota' | 'serviceOutputIdentifier' | 'storage' | 'transactionNumber' | 'triggerWebhook' | 'useInformResourceTypes' | 'useMongo4confirmationNumberFrom' | 'useMongo4orderNumberFrom' | 'useMongo4transactionNumberFrom' | 'useMongoAsStockHolder' | 'useMongoAsStockHolderProjects' | 'userPoolIdNew' | 'userPoolIdOld'>;
4
+ type IGlobalSetting = Pick<ISetting, 'defaultSenderEmail' | 'orderNumber' | 'quota' | 'serviceOutputIdentifier' | 'storage' | 'transactionNumber' | 'triggerWebhook' | 'useInformResourceTypes' | 'useMongo4confirmationNumberFrom' | 'useMongo4orderNumberFrom' | 'useMongo4transactionNumberFrom' | 'useMongoAsStockHolder' | 'useMongoAsStockHolderProjects' | 'userPoolIdNew' | 'userPoolIdOld'>;
5
5
  export { IGlobalSetting as ISetting };
6
6
  /**
7
7
  * 設定リポジトリ
@@ -1,9 +1,8 @@
1
- import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
2
1
  import type { CancelActionRepo } from '../../../repo/action/cancel';
3
2
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
4
3
  import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
5
4
  import type { ReservationRepo } from '../../../repo/reservation';
6
- import type { SettingRepo } from '../../../repo/setting';
5
+ import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
7
6
  import type { StockHolderRepo } from '../../../repo/stockHolder';
8
7
  import type { TaskRepo } from '../../../repo/task';
9
8
  type ICancelOperation<T> = (repos: {
@@ -13,10 +12,10 @@ type ICancelOperation<T> = (repos: {
13
12
  stockHolder: StockHolderRepo;
14
13
  offerRateLimit: OfferRateLimitRepo;
15
14
  reservation: ReservationRepo;
16
- setting: SettingRepo;
15
+ integrationSetting: IntegrationSettingRepo;
17
16
  task: TaskRepo;
18
17
  assetTransaction: AssetTransactionRepo;
19
- }, settings: Settings) => Promise<T>;
18
+ }) => Promise<T>;
20
19
  /**
21
20
  * 取引中止
22
21
  */
@@ -7,9 +7,7 @@ const cancelReservation_1 = require("../../reserve/cancelReservation");
7
7
  * 取引中止
8
8
  */
9
9
  function cancel(params) {
10
- return async (repos
11
- // settings: Settings
12
- ) => {
10
+ return async (repos) => {
13
11
  // まず取引状態変更
14
12
  const { id } = await repos.assetTransaction.cancel({
15
13
  typeOf: factory_1.factory.assetTransactionType.Reserve,
@@ -1,11 +1,10 @@
1
1
  import { factory } from '../../../factory';
2
- import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
3
2
  import type { ReserveActionRepo } from '../../../repo/action/reserve';
4
3
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
5
4
  import type { AuthorizationRepo } from '../../../repo/authorization';
6
5
  import type { OrderRepo } from '../../../repo/order';
7
6
  import type { ReservationRepo } from '../../../repo/reservation';
8
- import type { SettingRepo } from '../../../repo/setting';
7
+ import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
9
8
  import type { TaskRepo } from '../../../repo/task';
10
9
  interface IConfirmRepo {
11
10
  actions: {
@@ -15,10 +14,10 @@ interface IConfirmRepo {
15
14
  code: AuthorizationRepo;
16
15
  order: OrderRepo;
17
16
  reservation: ReservationRepo;
18
- setting: SettingRepo;
17
+ integrationSetting: IntegrationSettingRepo;
19
18
  task: TaskRepo;
20
19
  }
21
- type IConfirmOperation<T> = (repos: IConfirmRepo, settings: Settings) => Promise<T>;
20
+ type IConfirmOperation<T> = (repos: IConfirmRepo) => Promise<T>;
22
21
  /**
23
22
  * 取引確定
24
23
  */
@@ -8,9 +8,7 @@ const factory_2 = require("./confirm/factory");
8
8
  * 取引確定
9
9
  */
10
10
  function confirm(params) {
11
- return async (repos
12
- // settings: Settings
13
- ) => {
11
+ return async (repos) => {
14
12
  let transaction;
15
13
  // 取引存在確認
16
14
  if (typeof params.id === 'string') {
@@ -1,5 +1,4 @@
1
1
  import { factory } from '../../../factory';
2
- import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
3
2
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
4
3
  import type { AuthorizationRepo } from '../../../repo/authorization';
5
4
  import type { EventRepo } from '../../../repo/event';
@@ -17,6 +16,7 @@ import type { PriceSpecificationRepo } from '../../../repo/priceSpecification';
17
16
  import type { ProductRepo } from '../../../repo/product';
18
17
  import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
19
18
  import type { SettingRepo } from '../../../repo/setting';
19
+ import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
20
20
  import type { StockHolderRepo } from '../../../repo/stockHolder';
21
21
  import type { TaskRepo } from '../../../repo/task';
22
22
  import type { TicketRepo } from '../../../repo/ticket';
@@ -38,11 +38,12 @@ interface IStartOperationRepos {
38
38
  priceSpecification: PriceSpecificationRepo;
39
39
  seat: SeatRepo;
40
40
  setting: SettingRepo;
41
+ integrationSetting: IntegrationSettingRepo;
41
42
  task: TaskRepo;
42
43
  ticket: TicketRepo;
43
44
  assetTransaction: AssetTransactionRepo;
44
45
  }
45
- type IStartOperation<T> = (repos: IStartOperationRepos, settings: Settings) => Promise<T>;
46
+ type IStartOperation<T> = (repos: IStartOperationRepos) => Promise<T>;
46
47
  type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
47
48
  type IStartParams = factory.assetTransaction.reserve.IStartParamsWithoutDetail & {
48
49
  /**
@@ -1,5 +1,4 @@
1
1
  import { factory } from '../../../../factory';
2
- import type { IntegrationSettingRepo as Settings } from '../../../../repo/setting/integration';
3
2
  import type { AssetTransactionRepo } from '../../../../repo/assetTransaction';
4
3
  import type { AuthorizationRepo } from '../../../../repo/authorization';
5
4
  import type { EventRepo, IMinimizedIndividualEvent } from '../../../../repo/event';
@@ -17,6 +16,7 @@ import type { PriceSpecificationRepo } from '../../../../repo/priceSpecification
17
16
  import type { ProductRepo } from '../../../../repo/product';
18
17
  import type { OfferRateLimitRepo } from '../../../../repo/rateLimit/offer';
19
18
  import type { SettingRepo } from '../../../../repo/setting';
19
+ import type { IntegrationSettingRepo } from '../../../../repo/setting/integration';
20
20
  import type { StockHolderRepo } from '../../../../repo/stockHolder';
21
21
  import type { TaskRepo } from '../../../../repo/task';
22
22
  import type { TicketRepo } from '../../../../repo/ticket';
@@ -64,10 +64,11 @@ declare function processStartReserve4chevre(params: {
64
64
  priceSpecification: PriceSpecificationRepo;
65
65
  seat: SeatRepo;
66
66
  setting: SettingRepo;
67
+ integrationSetting: IntegrationSettingRepo;
67
68
  task: TaskRepo;
68
69
  ticket: TicketRepo;
69
70
  assetTransaction: AssetTransactionRepo;
70
- }, settings: Settings) => Promise<{
71
+ }) => Promise<{
71
72
  acceptedOffers4result: IResultAcceptedOffer[];
72
73
  }>;
73
74
  export { processStartReserve4chevre };
@@ -39,11 +39,7 @@ const ReserveTransactionService = __importStar(require("../../../assetTransactio
39
39
  const factory_2 = require("./factory");
40
40
  const requestedProgramMembershipUsed2permit_1 = require("./processStartReserve4chevre/requestedProgramMembershipUsed2permit");
41
41
  function processStartReserve4chevre(params, options) {
42
- return async (repos, settings
43
- // credentials: {
44
- // jwt: JWTCredentials;
45
- // }
46
- ) => {
42
+ return async (repos) => {
47
43
  const { event, transaction, transactionNumber } = params;
48
44
  // 予約取引開始
49
45
  const startParams = (0, factory_2.createReserveTransactionStartParams)({
@@ -76,7 +72,7 @@ function processStartReserve4chevre(params, options) {
76
72
  ]
77
73
  // useHoldStockByTransactionNumber: params.useHoldStockByTransactionNumber, // discontinue(2024-07-02~)
78
74
  // stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd
79
- }, options)(repos, settings);
75
+ }, options)(repos);
80
76
  // 予約取引結果から注文オファーを生成する
81
77
  const acceptedOffers4result = (0, factory_2.responseBody2acceptedOffers4result)({
82
78
  issuedThrough: startReserveTransactionResult.issuedThrough,
@@ -1,5 +1,4 @@
1
1
  import { factory } from '../../../factory';
2
- import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
3
2
  import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
4
3
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
5
4
  import type { AuthorizationRepo } from '../../../repo/authorization';
@@ -19,6 +18,7 @@ import type { PriceSpecificationRepo } from '../../../repo/priceSpecification';
19
18
  import type { ProductRepo } from '../../../repo/product';
20
19
  import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
21
20
  import type { SettingRepo } from '../../../repo/setting';
21
+ import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
22
22
  import type { StockHolderRepo } from '../../../repo/stockHolder';
23
23
  import type { TaskRepo } from '../../../repo/task';
24
24
  import type { TicketRepo } from '../../../repo/ticket';
@@ -45,12 +45,13 @@ interface IAuthorizeRepos {
45
45
  product: ProductRepo;
46
46
  seat: SeatRepo;
47
47
  setting: SettingRepo;
48
+ integrationSetting: IntegrationSettingRepo;
48
49
  task: TaskRepo;
49
50
  ticket: TicketRepo;
50
51
  placeOrder: PlaceOrderRepo;
51
52
  transactionNumber: TransactionNumberRepo;
52
53
  }
53
- type IAuthorizeOperation<T> = (repos: IAuthorizeRepos, settings: Settings) => Promise<T>;
54
+ type IAuthorizeOperation<T> = (repos: IAuthorizeRepos) => Promise<T>;
54
55
  type IAuthorizeOfferAction = factory.action.authorize.offer.eventService.IAction;
55
56
  type IObjectWithoutDetail = factory.action.authorize.offer.eventService.IObjectWithoutDetail;
56
57
  interface IAuthorizeOptions {
@@ -11,7 +11,7 @@ const searchOffersByIds_1 = require("./searchOffersByIds");
11
11
  * 興行オファー承認
12
12
  */
13
13
  function authorize(params, options) {
14
- return async (repos, settings) => {
14
+ return async (repos) => {
15
15
  const { noOfferSpecified } = options;
16
16
  const { transaction, event } = await validateCreateRequest(params)(repos);
17
17
  const { acceptedOffers, ticketOffers, unitPriceOffers } = await validateAcceptedOffers({
@@ -47,7 +47,7 @@ function authorize(params, options) {
47
47
  orderNumber,
48
48
  instrument: params.instrument,
49
49
  ...(typeof params.object.broker?.typeOf === 'string') ? { broker: params.object.broker } : undefined
50
- }, options)(repos, settings);
50
+ }, options)(repos);
51
51
  acceptedOffers4result = processStartReserveResult.acceptedOffers4result;
52
52
  if (!noOfferSpecified) {
53
53
  const minimizedAcceptedOffers = acceptedOffers4result.map((acceptOffer4result, offerIndex) => {
@@ -1,11 +1,10 @@
1
1
  import { factory } from '../../../../factory';
2
- import type { IntegrationSettingRepo as Settings } from '../../../../repo/setting/integration';
3
2
  import type { CancelActionRepo } from '../../../../repo/action/cancel';
4
3
  import type { AssetTransactionRepo } from '../../../../repo/assetTransaction';
5
4
  import type { OrderInTransactionRepo } from '../../../../repo/orderInTransaction';
6
5
  import type { OfferRateLimitRepo } from '../../../../repo/rateLimit/offer';
7
6
  import type { ReservationRepo } from '../../../../repo/reservation';
8
- import type { SettingRepo } from '../../../../repo/setting';
7
+ import type { IntegrationSettingRepo } from '../../../../repo/setting/integration';
9
8
  import type { StockHolderRepo } from '../../../../repo/stockHolder';
10
9
  import type { TaskRepo } from '../../../../repo/task';
11
10
  interface IVoidTransactionRepos {
@@ -17,10 +16,10 @@ interface IVoidTransactionRepos {
17
16
  offerRateLimit: OfferRateLimitRepo;
18
17
  orderInTransaction: OrderInTransactionRepo;
19
18
  reservation: ReservationRepo;
20
- setting: SettingRepo;
19
+ integrationSetting: IntegrationSettingRepo;
21
20
  task: TaskRepo;
22
21
  }
23
22
  declare function processVoidTransaction4chevre(params: {
24
23
  action: factory.action.authorize.offer.eventService.IAction;
25
- }): (repos: IVoidTransactionRepos, settings: Settings) => Promise<void>;
24
+ }): (repos: IVoidTransactionRepos) => Promise<void>;
26
25
  export { processVoidTransaction4chevre };
@@ -4,7 +4,7 @@ exports.processVoidTransaction4chevre = processVoidTransaction4chevre;
4
4
  const factory_1 = require("../../../../factory");
5
5
  const reserve_1 = require("../../../assetTransaction/reserve");
6
6
  function processVoidTransaction4chevre(params) {
7
- return async (repos, settings) => {
7
+ return async (repos) => {
8
8
  const transactionNumber = params.action.instrument.transactionNumber;
9
9
  if (typeof transactionNumber === 'string') {
10
10
  // 取引が存在すれば中止
@@ -16,7 +16,7 @@ function processVoidTransaction4chevre(params) {
16
16
  transactionNumber: { $eq: transactionNumber }
17
17
  }, ['_id']);
18
18
  if (assetTransactions.length > 0) {
19
- await (0, reserve_1.cancel)({ transactionNumber })(repos, settings);
19
+ await (0, reserve_1.cancel)({ transactionNumber })(repos);
20
20
  }
21
21
  }
22
22
  };
@@ -1,6 +1,5 @@
1
1
  import type { COA } from '@motionpicture/coa-service';
2
2
  import { factory } from '../../../factory';
3
- import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
4
3
  import type { CancelActionRepo } from '../../../repo/action/cancel';
5
4
  import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
6
5
  import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
@@ -8,7 +7,7 @@ import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
8
7
  import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
9
8
  import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
10
9
  import type { ReservationRepo } from '../../../repo/reservation';
11
- import type { SettingRepo } from '../../../repo/setting';
10
+ import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
12
11
  import type { StockHolderRepo } from '../../../repo/stockHolder';
13
12
  import type { TaskRepo } from '../../../repo/task';
14
13
  import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
@@ -26,7 +25,7 @@ interface IVoidTransactionRepos {
26
25
  offerRateLimit: OfferRateLimitRepo;
27
26
  orderInTransaction: OrderInTransactionRepo;
28
27
  reservation: ReservationRepo;
29
- setting: SettingRepo;
28
+ integrationSetting: IntegrationSettingRepo;
30
29
  task: TaskRepo;
31
30
  placeOrder: PlaceOrderRepo;
32
31
  /**
@@ -48,5 +47,5 @@ declare function voidTransaction(params: factory.task.voidReserveTransaction.IDa
48
47
  */
49
48
  id: string;
50
49
  };
51
- }): (repos: IVoidTransactionRepos, settings: Settings) => Promise<void>;
50
+ }): (repos: IVoidTransactionRepos) => Promise<void>;
52
51
  export { IVoidTransactionRepos, voidTransaction };
@@ -11,10 +11,10 @@ const voidTransactionByActionId_1 = require("./voidTransactionByActionId");
11
11
  * 取引中の承認アクション全てについて処理する or 特定の承認アクションについて処理する
12
12
  */
13
13
  function voidTransaction(params) {
14
- return async (repos, settings) => {
14
+ return async (repos) => {
15
15
  // support void by action ID(2024-05-26~)
16
16
  if (typeof params.id === 'string') {
17
- await (0, voidTransactionByActionId_1.voidTransactionByActionId)(params)(repos, settings);
17
+ await (0, voidTransactionByActionId_1.voidTransactionByActionId)(params)(repos);
18
18
  return;
19
19
  }
20
20
  const cancelAction = {
@@ -98,7 +98,7 @@ function voidTransaction(params) {
98
98
  await (0, processVoidTransaction4chevre_1.processVoidTransaction4chevre)({
99
99
  // action: <factory.action.authorize.offer.eventService.IAction<WebAPIIdentifier.Chevre>>action
100
100
  action
101
- })(repos, settings);
101
+ })(repos);
102
102
  }
103
103
  }));
104
104
  // acceptActionについても取り消す(2024-05-27~)
@@ -1,6 +1,5 @@
1
1
  import type { COA } from '@motionpicture/coa-service';
2
2
  import { factory } from '../../../factory';
3
- import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
4
3
  import type { CancelActionRepo } from '../../../repo/action/cancel';
5
4
  import { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
6
5
  import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
@@ -8,7 +7,7 @@ import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
8
7
  import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
9
8
  import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
10
9
  import type { ReservationRepo } from '../../../repo/reservation';
11
- import type { SettingRepo } from '../../../repo/setting';
10
+ import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
12
11
  import type { StockHolderRepo } from '../../../repo/stockHolder';
13
12
  import type { TaskRepo } from '../../../repo/task';
14
13
  import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
@@ -26,7 +25,7 @@ interface IVoidTransactionByActionIdRepos {
26
25
  offerRateLimit: OfferRateLimitRepo;
27
26
  orderInTransaction: OrderInTransactionRepo;
28
27
  reservation: ReservationRepo;
29
- setting: SettingRepo;
28
+ integrationSetting: IntegrationSettingRepo;
30
29
  task: TaskRepo;
31
30
  placeOrder: PlaceOrderRepo;
32
31
  /**
@@ -48,5 +47,5 @@ declare function voidTransactionByActionId(params: factory.task.voidReserveTrans
48
47
  */
49
48
  id: string;
50
49
  };
51
- }): (repos: IVoidTransactionByActionIdRepos, settings: Settings) => Promise<void>;
50
+ }): (repos: IVoidTransactionByActionIdRepos) => Promise<void>;
52
51
  export { IVoidTransactionByActionIdRepos, voidTransactionByActionId };
@@ -10,7 +10,7 @@ const processVoidTransaction4coa_1 = require("./voidTransaction/processVoidTrans
10
10
  * 特定の承認アクションについて処理する
11
11
  */
12
12
  function voidTransactionByActionId(params) {
13
- return async (repos, settings) => {
13
+ return async (repos) => {
14
14
  if (typeof params.id !== 'string' || params.id === '') {
15
15
  throw new factory_1.factory.errors.ArgumentNull('id');
16
16
  }
@@ -51,7 +51,7 @@ function voidTransactionByActionId(params) {
51
51
  default:
52
52
  await (0, processVoidTransaction4chevre_1.processVoidTransaction4chevre)({
53
53
  action
54
- })(repos, settings);
54
+ })(repos);
55
55
  // const transactionNumber = action.object.pendingTransaction?.transactionNumber;
56
56
  // if (typeof transactionNumber === 'string') {
57
57
  // // すでに取消済であったとしても、すべて取消処理(actionStatusに関係なく)
@@ -14,7 +14,8 @@ const debug = (0, debug_1.default)('chevre-domain:service:offer:onEventChanged')
14
14
  function onEventChanged(params) {
15
15
  return async (repos) => {
16
16
  if (params.id.length > 0) {
17
- const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['onEventChanged', 'useInformResourceTypes']);
17
+ const integrationSetting = await repos.integrationSetting.getByKey('agg');
18
+ const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['useInformResourceTypes']);
18
19
  const hubSettings = (await repos.integrationSetting.getByKey('hub'));
19
20
  const useInformResourceTypes = setting?.useInformResourceTypes;
20
21
  const useInform = params.useInform === true
@@ -26,7 +27,7 @@ function onEventChanged(params) {
26
27
  ids: params.id,
27
28
  typeOf: params.typeOf,
28
29
  isNew: params.isNew
29
- }, setting)(repos);
30
+ }, integrationSetting)(repos);
30
31
  if (useInform) {
31
32
  await createInformTasks({
32
33
  project: { id: params.project.id },
@@ -228,8 +229,7 @@ function createInform2aggTasks(params, setting) {
228
229
  // settings: Settings
229
230
  ) => {
230
231
  let event4inform;
231
- // const informEvent2agg = settings.onEventChanged.informEvent2agg;
232
- const informEvent2agg = setting?.onEventChanged?.informEvent2agg;
232
+ const informEvent2agg = setting?.informActions;
233
233
  if (params.typeOf === factory_1.factory.eventType.ScreeningEvent) {
234
234
  event4inform = {
235
235
  id: params.ids,
@@ -1,7 +1,6 @@
1
1
  import type { AcceptedOfferRepo } from '../../../repo/acceptedOffer';
2
2
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
3
3
  import type { OrderRepo } from '../../../repo/order';
4
- import type { SettingRepo } from '../../../repo/setting';
5
4
  import type { TaskRepo } from '../../../repo/task';
6
5
  import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
7
6
  import { factory } from '../../../factory';
@@ -9,7 +8,6 @@ interface IOnPayTransactionCanceledRepos {
9
8
  acceptedOffer: AcceptedOfferRepo;
10
9
  assetTransaction: AssetTransactionRepo;
11
10
  order: OrderRepo;
12
- setting: SettingRepo;
13
11
  task: TaskRepo;
14
12
  placeOrder: PlaceOrderRepo;
15
13
  }
@@ -2,17 +2,16 @@ import type { AcceptedOfferRepo } from '../../../repo/acceptedOffer';
2
2
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
3
3
  import type { MessageRepo } from '../../../repo/message';
4
4
  import type { OrderRepo } from '../../../repo/order';
5
- import type { SettingRepo } from '../../../repo/setting';
5
+ import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
6
6
  import type { TaskRepo } from '../../../repo/task';
7
7
  import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
8
8
  import { factory } from '../../../factory';
9
- import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
10
9
  interface IOnPayTransactionConfirmedRepos {
11
10
  acceptedOffer: AcceptedOfferRepo;
12
11
  assetTransaction: AssetTransactionRepo;
13
12
  message: MessageRepo;
14
13
  order: OrderRepo;
15
- setting: SettingRepo;
14
+ integrationSetting: IntegrationSettingRepo;
16
15
  task: TaskRepo;
17
16
  placeOrder: PlaceOrderRepo;
18
17
  }
@@ -20,5 +19,5 @@ declare function onPayTransactionConfirmed(params: factory.task.onAssetTransacti
20
19
  object: factory.task.onAssetTransactionStatusChanged.IObjectAsPayTransaction & {
21
20
  status: factory.transactionStatusType.Confirmed;
22
21
  };
23
- }): (repos: IOnPayTransactionConfirmedRepos, settings: Settings) => Promise<void>;
22
+ }): (repos: IOnPayTransactionConfirmedRepos) => Promise<void>;
24
23
  export { IOnPayTransactionConfirmedRepos, onPayTransactionConfirmed };
@@ -4,7 +4,7 @@ exports.onPayTransactionConfirmed = onPayTransactionConfirmed;
4
4
  const paymentDue2Processing_1 = require("../onAssetTransactionStatusChanged/paymentDue2Processing");
5
5
  const factory_1 = require("../../../factory");
6
6
  function onPayTransactionConfirmed(params) {
7
- return async (repos, settings) => {
7
+ return async (repos) => {
8
8
  if (typeof params.useOnOrderStatusChanged !== 'boolean') {
9
9
  throw new factory_1.factory.errors.Argument('useOnOrderStatusChanged', 'must be boolean');
10
10
  }
@@ -29,7 +29,7 @@ function onPayTransactionConfirmed(params) {
29
29
  confirmationNumber,
30
30
  orderNumber,
31
31
  useOnOrderStatusChanged: params.useOnOrderStatusChanged
32
- })(repos, settings);
32
+ })(repos);
33
33
  }
34
34
  }
35
35
  };
@@ -1,7 +1,6 @@
1
1
  import type { AcceptedOfferRepo } from '../../../repo/acceptedOffer';
2
2
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
3
3
  import type { OrderRepo } from '../../../repo/order';
4
- import type { SettingRepo } from '../../../repo/setting';
5
4
  import type { TaskRepo } from '../../../repo/task';
6
5
  import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
7
6
  import { factory } from '../../../factory';
@@ -10,7 +9,6 @@ interface IOnReserveTransactionConfirmedRepos {
10
9
  acceptedOffer: AcceptedOfferRepo;
11
10
  assetTransaction: AssetTransactionRepo;
12
11
  order: OrderRepo;
13
- setting: SettingRepo;
14
12
  task: TaskRepo;
15
13
  placeOrder: PlaceOrderRepo;
16
14
  }