@chevre/domain 25.2.0-alpha.1 → 25.2.0-alpha.11

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 (27) hide show
  1. package/lib/chevre/repo/action/actionProcess.js +57 -57
  2. package/lib/chevre/repo/action.d.ts +4 -1
  3. package/lib/chevre/repo/action.js +3 -2
  4. package/lib/chevre/repo/assetTransaction.d.ts +1 -1
  5. package/lib/chevre/repo/assetTransaction.js +1 -1
  6. package/lib/chevre/repo/mongoose/schemas/action.js +67 -66
  7. package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
  8. package/lib/chevre/repo/orderInTransaction.d.ts +13 -0
  9. package/lib/chevre/repo/orderInTransaction.js +17 -0
  10. package/lib/chevre/repo/transaction/placeOrder.d.ts +1 -0
  11. package/lib/chevre/repo/transaction/placeOrder.js +1 -0
  12. package/lib/chevre/service/offer/event/authorize/factory.d.ts +0 -1
  13. package/lib/chevre/service/offer/event/authorize/factory.js +10 -12
  14. package/lib/chevre/service/offer/event/authorize.js +1 -1
  15. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +2 -2
  16. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
  17. package/lib/chevre/service/payment/any/authorize.js +6 -32
  18. package/lib/chevre/service/payment/any/factory.js +1 -1
  19. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +22 -0
  20. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +120 -0
  21. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +9 -1
  22. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +109 -93
  23. package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +7 -0
  24. package/lib/chevre/service/transaction/placeOrder/confirm.js +27 -58
  25. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +2 -0
  26. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +5 -0
  27. package/package.json +2 -2
@@ -19,9 +19,9 @@ exports.AVAILABLE_PROJECT_FIELDS = [
19
19
  'endDate',
20
20
  'purpose',
21
21
  'potentialActions',
22
- 'amount',
23
- 'fromLocation',
24
- 'toLocation',
22
+ // 'amount', // discontinue(2026-07-08~)
23
+ // 'fromLocation', // discontinue(2026-07-08~)
24
+ // 'toLocation', // discontinue(2026-07-08~)
25
25
  'instrument',
26
26
  'location',
27
27
  'replacer',
@@ -322,60 +322,60 @@ class ActionProcessRepo {
322
322
  startDate: { $lte: startDateLte }
323
323
  });
324
324
  }
325
- const fromLocationTypeOfIn = params.fromLocation?.typeOf?.$in;
326
- if (Array.isArray(fromLocationTypeOfIn)) {
327
- andConditions.push({
328
- 'fromLocation.typeOf': {
329
- $exists: true,
330
- $in: fromLocationTypeOfIn
331
- }
332
- });
333
- }
334
- const fromLocationAccountNumberIn = params.fromLocation?.accountNumber?.$in;
335
- if (Array.isArray(fromLocationAccountNumberIn)) {
336
- andConditions.push({
337
- 'fromLocation.accountNumber': {
338
- $exists: true,
339
- $in: fromLocationAccountNumberIn
340
- }
341
- });
342
- }
343
- const fromLocationAccountTypeIn = params.fromLocation?.accountType?.$in;
344
- if (Array.isArray(fromLocationAccountTypeIn)) {
345
- andConditions.push({
346
- 'fromLocation.accountType': {
347
- $exists: true,
348
- $in: fromLocationAccountTypeIn
349
- }
350
- });
351
- }
352
- const toLocationTypeOfIn = params.toLocation?.typeOf?.$in;
353
- if (Array.isArray(toLocationTypeOfIn)) {
354
- andConditions.push({
355
- 'toLocation.typeOf': {
356
- $exists: true,
357
- $in: toLocationTypeOfIn
358
- }
359
- });
360
- }
361
- const toLocationAccountNumberIn = params.toLocation?.accountNumber?.$in;
362
- if (Array.isArray(toLocationAccountNumberIn)) {
363
- andConditions.push({
364
- 'toLocation.accountNumber': {
365
- $exists: true,
366
- $in: toLocationAccountNumberIn
367
- }
368
- });
369
- }
370
- const toLocationAccountTypeIn = params.toLocation?.accountType?.$in;
371
- if (Array.isArray(toLocationAccountTypeIn)) {
372
- andConditions.push({
373
- 'toLocation.accountType': {
374
- $exists: true,
375
- $in: toLocationAccountTypeIn
376
- }
377
- });
378
- }
325
+ // const fromLocationTypeOfIn = params.fromLocation?.typeOf?.$in;
326
+ // if (Array.isArray(fromLocationTypeOfIn)) {
327
+ // andConditions.push({
328
+ // 'fromLocation.typeOf': {
329
+ // $exists: true,
330
+ // $in: fromLocationTypeOfIn
331
+ // }
332
+ // });
333
+ // }
334
+ // const fromLocationAccountNumberIn = params.fromLocation?.accountNumber?.$in;
335
+ // if (Array.isArray(fromLocationAccountNumberIn)) {
336
+ // andConditions.push({
337
+ // 'fromLocation.accountNumber': {
338
+ // $exists: true,
339
+ // $in: fromLocationAccountNumberIn
340
+ // }
341
+ // });
342
+ // }
343
+ // const fromLocationAccountTypeIn = params.fromLocation?.accountType?.$in;
344
+ // if (Array.isArray(fromLocationAccountTypeIn)) {
345
+ // andConditions.push({
346
+ // 'fromLocation.accountType': {
347
+ // $exists: true,
348
+ // $in: fromLocationAccountTypeIn
349
+ // }
350
+ // });
351
+ // }
352
+ // const toLocationTypeOfIn = params.toLocation?.typeOf?.$in;
353
+ // if (Array.isArray(toLocationTypeOfIn)) {
354
+ // andConditions.push({
355
+ // 'toLocation.typeOf': {
356
+ // $exists: true,
357
+ // $in: toLocationTypeOfIn
358
+ // }
359
+ // });
360
+ // }
361
+ // const toLocationAccountNumberIn = params.toLocation?.accountNumber?.$in;
362
+ // if (Array.isArray(toLocationAccountNumberIn)) {
363
+ // andConditions.push({
364
+ // 'toLocation.accountNumber': {
365
+ // $exists: true,
366
+ // $in: toLocationAccountNumberIn
367
+ // }
368
+ // });
369
+ // }
370
+ // const toLocationAccountTypeIn = params.toLocation?.accountType?.$in;
371
+ // if (Array.isArray(toLocationAccountTypeIn)) {
372
+ // andConditions.push({
373
+ // 'toLocation.accountType': {
374
+ // $exists: true,
375
+ // $in: toLocationAccountTypeIn
376
+ // }
377
+ // });
378
+ // }
379
379
  const purposeTypeOfIn = params.purpose?.typeOf?.$in;
380
380
  if (Array.isArray(purposeTypeOfIn)) {
381
381
  andConditions.push({
@@ -71,7 +71,10 @@ export declare class ActionRepo extends ActionProcessRepo<IAction<StartableActio
71
71
  */
72
72
  deleteEndDatePassedCertainPeriod(params: {
73
73
  $lt: Date;
74
- }): Promise<void>;
74
+ }): Promise<{
75
+ deleteActionRecipesResult: import("mongodb").DeleteResult;
76
+ deleteActionsResult: import("mongodb").DeleteResult;
77
+ } | undefined>;
75
78
  /**
76
79
  * 取引からアクションを削除する
77
80
  */
@@ -454,7 +454,7 @@ class ActionRepo extends actionProcess_1.ActionProcessRepo {
454
454
  async deleteEndDatePassedCertainPeriod(params) {
455
455
  const { $lt } = params;
456
456
  if ($lt instanceof Date) {
457
- await this.actionModel.deleteMany({
457
+ const deleteActionsResult = await this.actionModel.deleteMany({
458
458
  // 終了日時を一定期間過ぎたもの
459
459
  endDate: { $exists: true, $lt }
460
460
  })
@@ -463,10 +463,11 @@ class ActionRepo extends actionProcess_1.ActionProcessRepo {
463
463
  const dateCreatedLt = (0, moment_1.default)($lt)
464
464
  .add(-1, 'day') // レシピ作成とアクション終了の時間差を考慮
465
465
  .toDate();
466
- await this.actionRecipeModel.deleteMany({
466
+ const deleteActionRecipesResult = await this.actionRecipeModel.deleteMany({
467
467
  dateCreated: { $lt: dateCreatedLt }
468
468
  })
469
469
  .exec();
470
+ return { deleteActionRecipesResult, deleteActionsResult };
470
471
  }
471
472
  }
472
473
  /**
@@ -203,7 +203,7 @@ export declare class AssetTransactionRepo {
203
203
  */
204
204
  deleteEndDatePassedCertainPeriod(params: {
205
205
  $lt: Date;
206
- }): Promise<void>;
206
+ }): Promise<import("mongodb").DeleteResult>;
207
207
  /**
208
208
  * 特定の取引を更新する(汎用)
209
209
  */
@@ -904,7 +904,7 @@ class AssetTransactionRepo {
904
904
  * 終了日時を一定期間過ぎたアクションを削除する
905
905
  */
906
906
  async deleteEndDatePassedCertainPeriod(params) {
907
- await this.transactionModel.deleteMany({
907
+ return this.transactionModel.deleteMany({
908
908
  // 終了日時を一定期間過ぎたもの
909
909
  endDate: {
910
910
  $exists: true,
@@ -21,9 +21,9 @@ const schemaDefinition = {
21
21
  endDate: Date,
22
22
  purpose: mongoose_1.SchemaTypes.Mixed,
23
23
  potentialActions: mongoose_1.SchemaTypes.Mixed,
24
- amount: mongoose_1.SchemaTypes.Mixed,
25
- fromLocation: mongoose_1.SchemaTypes.Mixed,
26
- toLocation: mongoose_1.SchemaTypes.Mixed,
24
+ // amount: SchemaTypes.Mixed, // discontinue(2026-07-08~)
25
+ // fromLocation: SchemaTypes.Mixed, // discontinue(2026-07-08~)
26
+ // toLocation: SchemaTypes.Mixed, // discontinue(2026-07-08~)
27
27
  instrument: mongoose_1.SchemaTypes.Mixed,
28
28
  location: mongoose_1.SchemaTypes.Mixed, // add location(2022-11-11~)
29
29
  replacer: mongoose_1.SchemaTypes.Mixed, // add replacer(2024-03-19~)
@@ -221,15 +221,16 @@ const indexes = [
221
221
  }
222
222
  }
223
223
  ],
224
- [
225
- { 'object.event.id': 1, startDate: -1 },
226
- {
227
- name: 'searchByObjectEventId',
228
- partialFilterExpression: {
229
- 'object.event.id': { $exists: true }
230
- }
231
- }
232
- ],
224
+ // 承認アクションのobject.event廃止につき検索条件も廃止(2026-07-07~)
225
+ // [
226
+ // { 'object.event.id': 1, startDate: -1 },
227
+ // {
228
+ // name: 'searchByObjectEventId',
229
+ // partialFilterExpression: {
230
+ // 'object.event.id': { $exists: true }
231
+ // }
232
+ // }
233
+ // ],
233
234
  [
234
235
  { 'about.id': 1, startDate: -1 },
235
236
  {
@@ -329,60 +330,60 @@ const indexes = [
329
330
  }
330
331
  }
331
332
  ],
332
- [
333
- { 'fromLocation.typeOf': 1, startDate: -1 },
334
- {
335
- name: 'searchByFromLocationTypeOf',
336
- partialFilterExpression: {
337
- 'fromLocation.typeOf': { $exists: true }
338
- }
339
- }
340
- ],
341
- [
342
- { 'fromLocation.accountNumber': 1, startDate: -1 },
343
- {
344
- name: 'searchByFromLocationAccountNumber',
345
- partialFilterExpression: {
346
- 'fromLocation.accountNumber': { $exists: true }
347
- }
348
- }
349
- ],
350
- [
351
- { 'fromLocation.accountType': 1, startDate: -1 },
352
- {
353
- name: 'searchByFromLocationAccountType',
354
- partialFilterExpression: {
355
- 'fromLocation.accountType': { $exists: true }
356
- }
357
- }
358
- ],
359
- [
360
- { 'toLocation.typeOf': 1, startDate: -1 },
361
- {
362
- name: 'searchByToLocationTypeOf',
363
- partialFilterExpression: {
364
- 'toLocation.typeOf': { $exists: true }
365
- }
366
- }
367
- ],
368
- [
369
- { 'toLocation.accountNumber': 1, startDate: -1 },
370
- {
371
- name: 'searchByToLocationAccountNumber',
372
- partialFilterExpression: {
373
- 'toLocation.accountNumber': { $exists: true }
374
- }
375
- }
376
- ],
377
- [
378
- { 'toLocation.accountType': 1, startDate: -1 },
379
- {
380
- name: 'searchByToLocationAccountType',
381
- partialFilterExpression: {
382
- 'toLocation.accountType': { $exists: true }
383
- }
384
- }
385
- ],
333
+ // [
334
+ // { 'fromLocation.typeOf': 1, startDate: -1 },
335
+ // {
336
+ // name: 'searchByFromLocationTypeOf',
337
+ // partialFilterExpression: {
338
+ // 'fromLocation.typeOf': { $exists: true }
339
+ // }
340
+ // }
341
+ // ],
342
+ // [
343
+ // { 'fromLocation.accountNumber': 1, startDate: -1 },
344
+ // {
345
+ // name: 'searchByFromLocationAccountNumber',
346
+ // partialFilterExpression: {
347
+ // 'fromLocation.accountNumber': { $exists: true }
348
+ // }
349
+ // }
350
+ // ],
351
+ // [
352
+ // { 'fromLocation.accountType': 1, startDate: -1 },
353
+ // {
354
+ // name: 'searchByFromLocationAccountType',
355
+ // partialFilterExpression: {
356
+ // 'fromLocation.accountType': { $exists: true }
357
+ // }
358
+ // }
359
+ // ],
360
+ // [
361
+ // { 'toLocation.typeOf': 1, startDate: -1 },
362
+ // {
363
+ // name: 'searchByToLocationTypeOf',
364
+ // partialFilterExpression: {
365
+ // 'toLocation.typeOf': { $exists: true }
366
+ // }
367
+ // }
368
+ // ],
369
+ // [
370
+ // { 'toLocation.accountNumber': 1, startDate: -1 },
371
+ // {
372
+ // name: 'searchByToLocationAccountNumber',
373
+ // partialFilterExpression: {
374
+ // 'toLocation.accountNumber': { $exists: true }
375
+ // }
376
+ // }
377
+ // ],
378
+ // [
379
+ // { 'toLocation.accountType': 1, startDate: -1 },
380
+ // {
381
+ // name: 'searchByToLocationAccountType',
382
+ // partialFilterExpression: {
383
+ // 'toLocation.accountType': { $exists: true }
384
+ // }
385
+ // }
386
+ // ],
386
387
  [
387
388
  { 'instrument.transactionNumber': 1, startDate: -1 },
388
389
  {
@@ -214,19 +214,19 @@ const indexes = [
214
214
  alternateName: { $exists: true }
215
215
  }
216
216
  }
217
+ ],
218
+ // add unique index(dev)(2025-03-28~)
219
+ // add unique index(test,prod)(2026-07-08~)
220
+ [
221
+ { identifier: 1 },
222
+ {
223
+ unique: true,
224
+ name: 'uniqueIdentifier',
225
+ partialFilterExpression: {
226
+ identifier: { $exists: true }
227
+ }
228
+ }
217
229
  ]
218
- // eslint-disable-next-line no-warning-comments
219
- // TODO add unique index(2025-03-28~)
220
- // [
221
- // { identifier: 1 },
222
- // {
223
- // unique: true,
224
- // name: 'uniqueIdentifier',
225
- // partialFilterExpression: {
226
- // identifier: { $exists: true }
227
- // }
228
- // }
229
- // ]
230
230
  ];
231
231
  exports.indexes = indexes;
232
232
  /**
@@ -127,6 +127,19 @@ export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
127
127
  setCustomerByIdentifier(params: Pick<IOrderInTransaction, 'project' | 'identifier'> & {
128
128
  customer: factory.order.ICustomer;
129
129
  }): Promise<import("mongoose").UpdateWriteOpResult>;
130
+ /**
131
+ * 注文ドキュメントに確認番号を保管する
132
+ * 確認番号未発行の場合のみ保管される
133
+ */
134
+ saveConfirmationNumberIfNotExist(params: {
135
+ identifier: string;
136
+ confirmationNumber: string;
137
+ }, options: {
138
+ /**
139
+ * 注文取引タイプのドキュメントのみを参照対象にするかどうか
140
+ */
141
+ onlyPlaceOrder: boolean;
142
+ }): Promise<void>;
130
143
  deleteByIdentifier(params: {
131
144
  identifier: string;
132
145
  }): Promise<import("mongodb").DeleteResult>;
@@ -241,6 +241,23 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
241
241
  }
242
242
  return result;
243
243
  }
244
+ /**
245
+ * 注文ドキュメントに確認番号を保管する
246
+ * 確認番号未発行の場合のみ保管される
247
+ */
248
+ async saveConfirmationNumberIfNotExist(params, options) {
249
+ const { identifier, confirmationNumber } = params;
250
+ const onlyPlaceOrder = options.onlyPlaceOrder === true;
251
+ if (typeof confirmationNumber !== 'string' || confirmationNumber === '') {
252
+ throw new factory_1.factory.errors.ArgumentNull('confirmationNumber');
253
+ }
254
+ await this.orderModel.updateOne({
255
+ identifier: { $eq: identifier },
256
+ confirmationNumber: { $exists: false },
257
+ ...((onlyPlaceOrder) && { typeOf: { $eq: factory_1.factory.transactionType.PlaceOrder } })
258
+ }, { $set: { confirmationNumber } })
259
+ .exec();
260
+ }
244
261
  async deleteByIdentifier(params) {
245
262
  return this.orderModel.deleteOne({
246
263
  typeOf: { $eq: factory_1.factory.transactionType.PlaceOrder },
@@ -125,6 +125,7 @@ export declare class PlaceOrderRepo {
125
125
  object: {
126
126
  orderDate: Date;
127
127
  orderNumber: string;
128
+ confirmationNumber: string;
128
129
  };
129
130
  result: factory.transaction.IResult<factory.transactionType.PlaceOrder>;
130
131
  potentialActions: factory.transaction.IPotentialActions<factory.transactionType.PlaceOrder>;
@@ -441,6 +441,7 @@ class PlaceOrderRepo {
441
441
  endDate,
442
442
  'object.orderDate': params.object.orderDate, // add(2026-06-15~)
443
443
  'object.orderNumber': params.object.orderNumber, // add(2026-06-27~)
444
+ 'object.confirmationNumber': params.object.confirmationNumber, // add(2026-07-08~)
444
445
  result: params.result, // resultを更新
445
446
  potentialActions: params.potentialActions // resultを更新
446
447
  }, {
@@ -28,7 +28,6 @@ declare function acceptedOffers2amount(params: {
28
28
  acceptedOffers: Pick<IResultAcceptedOffer, 'priceSpecification' | 'id'>[];
29
29
  }): number;
30
30
  declare function acceptedOffers2authorizeResult(params: {
31
- acceptedOffers: factory.assetTransaction.reserve.IAcceptedTicketOfferWithoutDetail[];
32
31
  acceptedOffers4result: IResultAcceptedOffer[];
33
32
  noOfferSpecified: boolean;
34
33
  ticketOffers: factory.product.ITicketOffer[];
@@ -173,9 +173,8 @@ function acceptedOffers2programMembershipUsed(params) {
173
173
  return programMembershipUsed;
174
174
  }
175
175
  function acceptedOffers2authorizeResult(params) {
176
- const { acceptedOffers, acceptedOffers4result, noOfferSpecified, ticketOffers } = params;
177
- const priceCurrency = factory_1.factory.priceCurrency.JPY; // fix(2024-07-03~)
178
- // redefine as typeOf: AggregateOffer(2024-06-18~)
176
+ const { acceptedOffers4result, noOfferSpecified, ticketOffers } = params;
177
+ // const priceCurrency = factory.priceCurrency.JPY; // fix(2024-07-03~)
179
178
  let offers;
180
179
  let price;
181
180
  let programMembershipUsed = [];
@@ -183,13 +182,15 @@ function acceptedOffers2authorizeResult(params) {
183
182
  price = acceptedOffers2amount({ acceptedOffers: acceptedOffers4result }); // オファー指定の場合のみ金額計算(2023-11-27~)
184
183
  programMembershipUsed = acceptedOffers2programMembershipUsed({ acceptedOffers: acceptedOffers4result });
185
184
  // オファーIDごとに集計
186
- const offerIds = [...new Set(acceptedOffers.map((o) => o.id))];
185
+ const offerIds = [...new Set(acceptedOffers4result.map((o) => String(o.id)))];
186
+ // const offerIds = [...new Set(acceptedOffers.map((o) => o.id))];
187
187
  offers = offerIds.map((offerId) => {
188
188
  const acceptedOffer = ticketOffers.find(({ id }) => id === offerId);
189
189
  if (acceptedOffer === undefined) {
190
190
  throw new factory_1.factory.errors.Internal(`acceptedOffer not found [id:${offerId}]`);
191
191
  }
192
- const amountOfThisGood = acceptedOffers.filter(({ id }) => id === offerId).length;
192
+ const amountOfThisGood = acceptedOffers4result.filter(({ id }) => id === offerId).length;
193
+ // const amountOfThisGood: number = acceptedOffers.filter(({ id }) => id === offerId).length;
193
194
  const { acceptedPaymentMethod, priceSpecification } = acceptedOffer;
194
195
  const unitPriceSpec = priceSpecification.priceComponent.find((spec) => spec.typeOf === factory_1.factory.priceSpecificationType.UnitPriceSpecification
195
196
  && (!Array.isArray(spec.appliesToAddOn)) // アドオン単価ではない
@@ -197,14 +198,14 @@ function acceptedOffers2authorizeResult(params) {
197
198
  if (unitPriceSpec === undefined) {
198
199
  throw new factory_1.factory.errors.Internal(`unitPriceSpec not found [id:${offerId}]`);
199
200
  }
200
- const { eligibleQuantity, eligibleTransactionVolume } = unitPriceSpec;
201
+ const { eligibleQuantity } = unitPriceSpec;
201
202
  return {
202
203
  id: offerId,
203
204
  includesObject: { amountOfThisGood },
204
205
  typeOf: factory_1.factory.offerType.Offer,
205
206
  priceSpecification: {
206
207
  ...(eligibleQuantity !== undefined) ? { eligibleQuantity } : undefined,
207
- ...(eligibleTransactionVolume !== undefined) ? { eligibleTransactionVolume } : undefined
208
+ // ...(eligibleTransactionVolume !== undefined) ? { eligibleTransactionVolume } : undefined // discontinue(2026-07-05~)
208
209
  },
209
210
  ...(acceptedPaymentMethod !== undefined) ? { acceptedPaymentMethod } : undefined
210
211
  };
@@ -212,14 +213,11 @@ function acceptedOffers2authorizeResult(params) {
212
213
  }
213
214
  return {
214
215
  typeOf: factory_1.factory.offerType.AggregateOffer,
215
- priceCurrency,
216
- amount: [],
216
+ // priceCurrency, // discontinue(2026-07-06~)
217
+ // amount: [], // discontinue(2026-07-06~)
217
218
  itemOffered: {
218
219
  serviceOutput: { programMembershipUsed } // add programMembershipUsed required(2024-08-15~)
219
220
  },
220
- // requestBody: {}, // discontinue(2024-06-11~)
221
- // responseBody: {}, // discontinue(2024-06-11~)
222
- // acceptedOffers: [] // discontinue(2024-06-17~)
223
221
  ...(typeof price === 'number') ? { price } : undefined,
224
222
  ...(Array.isArray(offers)) ? { offers } : undefined
225
223
  };
@@ -78,7 +78,7 @@ function authorize(params, options) {
78
78
  }
79
79
  throw error;
80
80
  }
81
- const result = (0, factory_2.acceptedOffers2authorizeResult)({ acceptedOffers, acceptedOffers4result, noOfferSpecified, ticketOffers });
81
+ const result = (0, factory_2.acceptedOffers2authorizeResult)({ acceptedOffers4result, noOfferSpecified, ticketOffers });
82
82
  await repos.authorizeOfferAction.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result });
83
83
  return { id: action.id, result };
84
84
  };
@@ -109,8 +109,8 @@ function authorize(params, options) {
109
109
  result = {
110
110
  typeOf: factory_2.factory.offerType.AggregateOffer, // add(2024-06-18~)
111
111
  price: price,
112
- priceCurrency: factory_2.factory.priceCurrency.JPY,
113
- amount: []
112
+ // priceCurrency: factory.priceCurrency.JPY, // discontinue(2026-07-06~)
113
+ // amount: [] // discontinue(2026-07-06~)
114
114
  };
115
115
  await (0, any_1.acceptOffer)({
116
116
  project: transaction.project,
@@ -133,7 +133,7 @@ function changeOffers(params) {
133
133
  const actionResult = {
134
134
  ...authorizeAction.result,
135
135
  price: price,
136
- amount: []
136
+ // amount: [] // discontinue(2026-07-06~)
137
137
  };
138
138
  // ActiveActionStatus->CompletedActionStatusで再実装(2024-01-15~)
139
139
  await repos.action.reStart({ id: authorizeAction.id, typeOf: authorizeAction.typeOf });
@@ -209,40 +209,14 @@ function authorize(params) {
209
209
  * 承認しようとしているobjectからaccountIdを決定する
210
210
  */
211
211
  function fixAccountIdIfPossible(params) {
212
- return async (
213
- // repos: {
214
- // action: ActionRepo;
215
- // authorization: AuthorizationRepo;
216
- // ticket: TicketRepo;
217
- // }
218
- // credentials: {
219
- // jwt: JWTCredentials;
220
- // }
221
- ) => {
212
+ return async () => {
222
213
  let accountId = '';
223
- const fromLocation = params.object?.fromLocation;
214
+ // const fromLocation = params.object?.fromLocation;
224
215
  const movieTickets = params.object?.movieTickets;
225
- // discontinue token as fromLocation(ticketTokenへ移行するべき)(2024-12-18~)
226
- if (typeof fromLocation === 'string') {
227
- throw new factory_1.factory.errors.NotImplemented('object.fromLocation as string not implemented');
228
- // トークン化されたペイメントカード情報でリクエストされた場合、実ペイメントカード情報へ変換する
229
- // const { authorizedObject } = await verifyToken({
230
- // project: { id: params.project.id },
231
- // agent: { id: params.project.id, typeOf: factory.organizationType.Project },
232
- // token: fromLocation
233
- // })(repos);
234
- // const paymentCardOwnershipInfo = authorizedObject;
235
- // if (Array.isArray(paymentCardOwnershipInfo)) {
236
- // throw new factory.errors.NotImplemented('fromLocation as an array not implemented');
237
- // }
238
- // if (paymentCardOwnershipInfo.typeOf !== 'OwnershipInfo') {
239
- // throw new factory.errors.Argument('fromLocation', 'must be OwnershipInfo');
240
- // }
241
- // if (paymentCardOwnershipInfo.typeOfGood.typeOf !== factory.permit.PermitType.Permit) {
242
- // throw new factory.errors.Argument('fromLocation', 'must be Permit');
243
- // }
244
- // accountId = paymentCardOwnershipInfo.typeOfGood.identifier;
245
- }
216
+ // // discontinue token as fromLocation(ticketTokenへ移行するべき)(2024-12-18~)
217
+ // if (typeof fromLocation === 'string') {
218
+ // throw new factory.errors.NotImplemented('object.fromLocation as string not implemented');
219
+ // }
246
220
  // 購入番号管理番号をaccountIdにセット(2024-03-24~)
247
221
  if (Array.isArray(movieTickets) && movieTickets.length > 0) {
248
222
  accountId = movieTickets[0].identifier; // 決済カードidentifierは1つのみ許可の前提
@@ -140,7 +140,7 @@ function creatPayTransactionStartParams(params) {
140
140
  ...(typeof params.object.name === 'string') ? { name: params.object.name } : undefined,
141
141
  ...(typeof accountId === 'string') ? { accountId } : undefined,
142
142
  ...(typeof params.object.description === 'string') ? { description: params.object.description } : undefined,
143
- ...(typeof params.object.fromLocation === 'string') ? { fromLocation: params.object.fromLocation } : undefined,
143
+ // ...(typeof params.object.fromLocation === 'string') ? { fromLocation: params.object.fromLocation } : undefined, // discontinue(2026-07-08~)
144
144
  ...(params.object.creditCard !== undefined) ? { creditCard: params.object.creditCard } : undefined,
145
145
  ...(Array.isArray(movieTickets)) ? { movieTickets } : undefined
146
146
  },
@@ -0,0 +1,22 @@
1
+ import type { OfferRepo } from '../../../../repo/offer/unitPriceInCatalog';
2
+ import { factory } from '../../../../factory';
3
+ export type IAuthorizeEventServiceOffer = factory.action.authorize.offer.eventService.IAction;
4
+ type IOrderAcceptedOffer = Pick<factory.order.IAcceptedOffer, 'itemOffered' | 'offeredThrough' | 'serialNumber' | 'priceSpecification' | 'id'>;
5
+ export declare function createAuthorizeOfferResultsExpected(params: {
6
+ authorizeEventServiceOfferActions: Pick<IAuthorizeEventServiceOffer, 'id' | 'result'>[];
7
+ }): Pick<IAuthorizeEventServiceOffer, 'id' | 'result'>[];
8
+ /**
9
+ * 注文ドキュメントと予約取引ドキュメントを参照することによって生成した、単価オファー検証条件
10
+ * 元々オファー承認アクションのresultに保管されていた
11
+ */
12
+ type IPreparedUnitPriceOfferConditions = Pick<IAuthorizeEventServiceOffer, 'id' | 'result'>;
13
+ declare function prepareUnitPriceOfferConditions(params: {
14
+ project: {
15
+ id: string;
16
+ };
17
+ acceptedOffers: IOrderAcceptedOffer[];
18
+ authorizeEventServiceOfferActions: IAuthorizeEventServiceOffer[];
19
+ }): (repos: {
20
+ offer: OfferRepo;
21
+ }) => Promise<IPreparedUnitPriceOfferConditions[]>;
22
+ export { IPreparedUnitPriceOfferConditions, prepareUnitPriceOfferConditions };