@chevre/domain 24.0.0-alpha.77 → 24.0.0-alpha.79

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 (74) hide show
  1. package/lib/chevre/repo/action/actionProcess.d.ts +4 -4
  2. package/lib/chevre/repo/action/authorizeOffer.d.ts +2 -3
  3. package/lib/chevre/repo/action/authorizeOffer.js +2 -2
  4. package/lib/chevre/repo/action.d.ts +2 -2
  5. package/lib/chevre/repo/assetTransaction.d.ts +3 -51
  6. package/lib/chevre/repo/assetTransaction.js +51 -51
  7. package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +1 -1
  8. package/lib/chevre/repo/product.d.ts +0 -10
  9. package/lib/chevre/repo/product.js +28 -22
  10. package/lib/chevre/repo/task.d.ts +1 -1
  11. package/lib/chevre/repository.d.ts +0 -5
  12. package/lib/chevre/repository.js +0 -11
  13. package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
  14. package/lib/chevre/service/assetTransaction/pay/start/factory.js +7 -7
  15. package/lib/chevre/service/assetTransaction/pay/start/preStart/fixPaymentService.js +18 -16
  16. package/lib/chevre/service/assetTransaction/refund.js +19 -17
  17. package/lib/chevre/service/assetTransaction/reserve/start.js +8 -8
  18. package/lib/chevre/service/assetTransaction.d.ts +0 -2
  19. package/lib/chevre/service/assetTransaction.js +8 -10
  20. package/lib/chevre/service/delivery/factory.js +13 -13
  21. package/lib/chevre/service/offer/any.d.ts +1 -1
  22. package/lib/chevre/service/offer/event/authorize.js +7 -32
  23. package/lib/chevre/service/offer/product.d.ts +0 -62
  24. package/lib/chevre/service/offer/product.js +0 -409
  25. package/lib/chevre/service/order/onAssetTransactionStatusChanged/isDeliverable.d.ts +1 -1
  26. package/lib/chevre/service/order/onAssetTransactionStatusChanged/isDeliverable.js +48 -43
  27. package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +38 -37
  28. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
  29. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
  30. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +2 -96
  31. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
  32. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +18 -15
  33. package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +0 -1
  34. package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +3 -28
  35. package/lib/chevre/service/order/placeOrder/factory.js +5 -5
  36. package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +1 -1
  37. package/lib/chevre/service/payment/factory.js +23 -23
  38. package/lib/chevre/service/product.js +16 -16
  39. package/lib/chevre/service/reserve/confirmReservation.js +19 -17
  40. package/lib/chevre/service/reserve/factory.d.ts +0 -6
  41. package/lib/chevre/service/reserve/factory.js +0 -59
  42. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +16 -15
  43. package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +0 -1
  44. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validatePrice.d.ts +2 -2
  45. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validatePrice.js +2 -2
  46. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +3 -3
  47. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +16 -12
  48. package/lib/chevre/service/transaction/placeOrder/confirm.js +21 -23
  49. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +0 -21
  50. package/lib/chevre/service/transaction/returnOrder/potentialActions.js +4 -4
  51. package/lib/chevre/service/validation/validateOrder.js +11 -10
  52. package/package.json +2 -2
  53. package/lib/chevre/repo/action/authorizeProductOffer.d.ts +0 -26
  54. package/lib/chevre/repo/action/authorizeProductOffer.js +0 -32
  55. package/lib/chevre/service/assetTransaction/registerService/factory.d.ts +0 -21
  56. package/lib/chevre/service/assetTransaction/registerService/factory.js +0 -171
  57. package/lib/chevre/service/assetTransaction/registerService/potentialActions.d.ts +0 -8
  58. package/lib/chevre/service/assetTransaction/registerService/potentialActions.js +0 -148
  59. package/lib/chevre/service/assetTransaction/registerService.d.ts +0 -54
  60. package/lib/chevre/service/assetTransaction/registerService.js +0 -273
  61. package/lib/chevre/service/assetTransaction/reserve/start/factory/createPointAward.d.ts +0 -15
  62. package/lib/chevre/service/assetTransaction/reserve/start/factory/createPointAward.js +0 -44
  63. package/lib/chevre/service/delivery/product/factory.d.ts +0 -13
  64. package/lib/chevre/service/delivery/product/factory.js +0 -81
  65. package/lib/chevre/service/offer/product/factory.d.ts +0 -37
  66. package/lib/chevre/service/offer/product/factory.js +0 -208
  67. package/lib/chevre/service/task/confirmRegisterService.d.ts +0 -6
  68. package/lib/chevre/service/task/confirmRegisterService.js +0 -19
  69. package/lib/chevre/service/task/confirmRegisterServiceTransaction.d.ts +0 -17
  70. package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +0 -116
  71. package/lib/chevre/service/task/voidRegisterServiceTransaction.d.ts +0 -6
  72. package/lib/chevre/service/task/voidRegisterServiceTransaction.js +0 -23
  73. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.d.ts +0 -8
  74. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.js +0 -89
@@ -12,7 +12,6 @@ const searchOffersByIds_1 = require("../../offer/event/searchOffersByIds");
12
12
  const cancelReservation_1 = require("../../reserve/cancelReservation");
13
13
  const onReservationsCreated_1 = require("../../reserve/potentialActions/onReservationsCreated");
14
14
  const createSubReservations_1 = require("./start/createSubReservations");
15
- const createPointAward_1 = require("./start/factory/createPointAward");
16
15
  const createStartParams_1 = require("./start/factory/createStartParams");
17
16
  const addOffers2seat_1 = require("./start/factory/addOffers2seat");
18
17
  const validateStartRequest_1 = require("./validateStartRequest");
@@ -357,17 +356,18 @@ function createAcceptedOffers4transactionObject(params) {
357
356
  const reservationId = `${reservationNumber}-${reservationIndex}`;
358
357
  // 入金先検証
359
358
  await validatePointAward({ project: { id: params.event.project.id }, acceptedOffer })(repos);
360
- const pointAward = (0, createPointAward_1.createPointAward)({
361
- project: { id: params.event.project.id },
362
- acceptedOffer: acceptedOffer,
363
- offer: ticketOffer,
364
- reservation: { id: reservationId }
365
- });
359
+ // const pointAward = createPointAward({
360
+ // project: { id: params.event.project.id },
361
+ // acceptedOffer: acceptedOffer,
362
+ // offer: ticketOffer,
363
+ // reservation: { id: reservationId }
364
+ // });
366
365
  // acceptedOffers4transactionObjectには必要な情報のみ保管する
367
366
  acceptedOffers4transactionObject.push({
368
367
  id: acceptedOffer.id,
369
368
  itemOffered: {
370
- ...(pointAward !== undefined) ? { pointAward } : undefined,
369
+ // discontinue(2026-04-18~)
370
+ // ...(pointAward !== undefined) ? { pointAward } : undefined,
371
371
  serviceOutput: { id: reservationId }
372
372
  }
373
373
  });
@@ -4,12 +4,10 @@ import type { TaskRepo } from '../repo/task';
4
4
  import * as CancelReservationTransactionService from './assetTransaction/cancelReservation';
5
5
  import * as PayTransactionService from './assetTransaction/pay';
6
6
  import * as RefundTransactionService from './assetTransaction/refund';
7
- import * as RegisterServiceTransactionService from './assetTransaction/registerService';
8
7
  import * as ReserveTransactionService from './assetTransaction/reserve';
9
8
  export import cancelReservation = CancelReservationTransactionService;
10
9
  export import pay = PayTransactionService;
11
10
  export import refund = RefundTransactionService;
12
- export import registerService = RegisterServiceTransactionService;
13
11
  export import reserve = ReserveTransactionService;
14
12
  /**
15
13
  * reimplement as exportOneTransactionTasksIfExists(2025-03-18~)
@@ -33,18 +33,16 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.reserve = exports.registerService = exports.refund = exports.pay = exports.cancelReservation = void 0;
36
+ exports.reserve = exports.refund = exports.pay = exports.cancelReservation = void 0;
37
37
  exports.exportOneTransactionTasksIfExists = exportOneTransactionTasksIfExists;
38
38
  const factory_1 = require("../factory");
39
39
  const CancelReservationTransactionService = __importStar(require("./assetTransaction/cancelReservation"));
40
40
  const PayTransactionService = __importStar(require("./assetTransaction/pay"));
41
41
  const RefundTransactionService = __importStar(require("./assetTransaction/refund"));
42
- const RegisterServiceTransactionService = __importStar(require("./assetTransaction/registerService"));
43
42
  const ReserveTransactionService = __importStar(require("./assetTransaction/reserve"));
44
43
  exports.cancelReservation = CancelReservationTransactionService;
45
44
  exports.pay = PayTransactionService;
46
45
  exports.refund = RefundTransactionService;
47
- exports.registerService = RegisterServiceTransactionService;
48
46
  exports.reserve = ReserveTransactionService;
49
47
  /**
50
48
  * reimplement as exportOneTransactionTasksIfExists(2025-03-18~)
@@ -87,13 +85,13 @@ function exportOneTransactionTasksIfExists(params) {
87
85
  runsTasksAfterInSeconds: params.runsTasksAfterInSeconds
88
86
  })(repos);
89
87
  break;
90
- case factory_1.factory.assetTransactionType.RegisterService:
91
- // createdTasks =
92
- await RegisterServiceTransactionService.exportTasksById({
93
- id: transaction.id
94
- // runsTasksAfterInSeconds: params.runsTasksAfterInSeconds
95
- })(repos);
96
- break;
88
+ // case factory.assetTransactionType.RegisterService:
89
+ // // createdTasks =
90
+ // await RegisterServiceTransactionService.exportTasksById({
91
+ // id: transaction.id
92
+ // // runsTasksAfterInSeconds: params.runsTasksAfterInSeconds
93
+ // })(repos);
94
+ // break;
97
95
  case factory_1.factory.assetTransactionType.Reserve:
98
96
  // createdTasks =
99
97
  await ReserveTransactionService.exportTasksById({
@@ -7,8 +7,8 @@ exports.createOwnershipInfosFromOrder = createOwnershipInfosFromOrder;
7
7
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
8
8
  const util_1 = require("util");
9
9
  const factory_1 = require("../../factory");
10
- const factory_2 = require("./product/factory");
11
- const factory_3 = require("./reservation/factory");
10
+ // import { createProductOwnershipInfo } from './product/factory';
11
+ const factory_2 = require("./reservation/factory");
12
12
  /**
13
13
  * 注文から所有権を作成する
14
14
  */
@@ -40,7 +40,7 @@ function createOwnershipInfosFromOrder(params) {
40
40
  // bookingService:COAでは作成しない(2024-12-31~)
41
41
  }
42
42
  else {
43
- ownershipInfo = (0, factory_3.createReservationOwnershipInfo)({
43
+ ownershipInfo = (0, factory_2.createReservationOwnershipInfo)({
44
44
  project: params.order.project,
45
45
  ownedBy: ownedBy,
46
46
  acceptedOffer: { ...acceptedOffer, itemOffered },
@@ -51,16 +51,16 @@ function createOwnershipInfosFromOrder(params) {
51
51
  }
52
52
  break;
53
53
  }
54
- case factory_1.factory.permit.PermitType.Permit:
55
- ownershipInfo = (0, factory_2.createProductOwnershipInfo)({
56
- project: params.order.project,
57
- ownedBy: ownedBy,
58
- acceptedOffer: { ...acceptedOffer, itemOffered },
59
- ownedFrom: ownedFrom,
60
- identifier: identifier,
61
- acquiredFrom: acquiredFrom
62
- });
63
- break;
54
+ // case factory.permit.PermitType.Permit:
55
+ // ownershipInfo = createProductOwnershipInfo({
56
+ // project: params.order.project,
57
+ // ownedBy: ownedBy,
58
+ // acceptedOffer: { ...acceptedOffer, itemOffered },
59
+ // ownedFrom: ownedFrom,
60
+ // identifier: identifier,
61
+ // acquiredFrom: acquiredFrom
62
+ // });
63
+ // break;
64
64
  // case factory.actionType.MoneyTransfer:
65
65
  // // no op
66
66
  // // 所有権は発生しない
@@ -4,7 +4,7 @@ interface IAcceptOfferOperationRepos {
4
4
  orderInTransaction: OrderInTransactionRepo;
5
5
  }
6
6
  type IAcceptOfferOperation<T> = (repos: IAcceptOfferOperationRepos) => Promise<T>;
7
- export type IAuthorizeActionWithInstrument = Pick<factory.action.authorize.offer.product.IAction | factory.action.authorize.offer.eventService.IAction, 'instrument'>;
7
+ export type IAuthorizeActionWithInstrument = Pick<factory.action.authorize.offer.eventService.IAction, 'instrument'>;
8
8
  export declare function acceptOffer(params: {
9
9
  orderNumber: string;
10
10
  project: {
@@ -246,11 +246,11 @@ function acceptedOfferWithoutDetail2acceptedOffer(params) {
246
246
  if (offer === undefined) {
247
247
  throw new factory_1.factory.errors.NotFound('Ticket Offer', `Ticket Offer ${offerWithoutDetail.id} not found`);
248
248
  }
249
- // ポイント特典入金先の指定があれば入金識別子を発行
250
- const pointAward = createPointAwardByOfferWithoutDetail({
251
- offerWithoutDetail,
252
- transaction: params.transaction
253
- });
249
+ // // ポイント特典入金先の指定があれば入金識別子を発行
250
+ // const pointAward = createPointAwardByOfferWithoutDetail({
251
+ // offerWithoutDetail,
252
+ // transaction: params.transaction
253
+ // });
254
254
  const acceptedAppliesToMovieTicket = offerWithoutDetail.priceSpecification?.appliesToMovieTicket;
255
255
  // 承認アクションオブジェクトのacceptedOfferにappliesToMovieTicketを連携する(2022-08-02~)
256
256
  // const priceSpecification: IAcceptedOfferPriceSpecification = {
@@ -358,7 +358,8 @@ function acceptedOfferWithoutDetail2acceptedOffer(params) {
358
358
  itemOffered: {
359
359
  // typeOf: factory.product.ProductType.EventService,
360
360
  ...(itemOfferedServiceOutput !== undefined) ? { serviceOutput: itemOfferedServiceOutput } : undefined,
361
- ...(pointAward !== undefined) ? { pointAward } : undefined
361
+ // discontinue(2026-04-18~)
362
+ // ...(pointAward !== undefined) ? { pointAward } : undefined
362
363
  },
363
364
  addOn: acceptedAddOns,
364
365
  // 追加属性をマージ
@@ -372,29 +373,3 @@ function acceptedOfferWithoutDetail2acceptedOffer(params) {
372
373
  };
373
374
  };
374
375
  }
375
- function createPointAwardByOfferWithoutDetail(params) {
376
- const offerWithoutDetail = params.offerWithoutDetail;
377
- // ポイント特典入金先の指定があれば入金識別子を発行
378
- let pointAward;
379
- const pointAwardToLocationIdentifier = offerWithoutDetail.itemOffered?.pointAward?.toLocation?.identifier;
380
- const pointAwardToLocationIssuedThroughId = offerWithoutDetail.itemOffered?.pointAward?.toLocation?.issuedThrough.id;
381
- if (typeof pointAwardToLocationIdentifier === 'string' && pointAwardToLocationIdentifier.length > 0
382
- && typeof pointAwardToLocationIssuedThroughId === 'string' && pointAwardToLocationIssuedThroughId.length > 0) {
383
- pointAward = {
384
- toLocation: {
385
- identifier: pointAwardToLocationIdentifier,
386
- issuedThrough: { id: pointAwardToLocationIssuedThroughId }
387
- },
388
- typeOf: factory_1.factory.actionType.MoneyTransfer,
389
- // purpose.identifierはChevre側で自動指定
390
- // purpose: { identifier: pointAwardPurposeIdentifier },
391
- // ひとまずrecipientは強制的に指定(指定しないと入金できない)
392
- recipient: {
393
- id: params.transaction.agent.id,
394
- name: `${params.transaction.agent.name}`,
395
- typeOf: params.transaction.agent.typeOf
396
- }
397
- };
398
- }
399
- return pointAward;
400
- }
@@ -1,37 +1,7 @@
1
1
  import { factory } from '../../factory';
2
- import type { AccountRepo } from '../../repo/account';
3
- import type { AuthorizeProductOfferActionRepo } from '../../repo/action/authorizeProductOffer';
4
- import type { AssetTransactionRepo } from '../../repo/assetTransaction';
5
2
  import type { OfferRepo } from '../../repo/offer/unitPriceInCatalog';
6
3
  import type { OfferCatalogRepo } from '../../repo/offerCatalog';
7
- import type { OrderInTransactionRepo } from '../../repo/orderInTransaction';
8
- import type { OrderNumberRepo } from '../../repo/orderNumber';
9
- import type { OwnershipInfoRepo } from '../../repo/ownershipInfo';
10
4
  import type { ProductRepo } from '../../repo/product';
11
- import type { ProjectRepo } from '../../repo/project';
12
- import type { ServiceOutputRepo } from '../../repo/serviceOutput';
13
- import type { ServiceOutputIdentifierRepo } from '../../repo/serviceOutputIdentifier';
14
- import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
15
- import type { TransactionNumberRepo } from '../../repo/transactionNumber';
16
- export interface IAuthorizeOperationRepos {
17
- account: AccountRepo;
18
- action?: never;
19
- authorizeProductOfferAction: AuthorizeProductOfferActionRepo;
20
- assetTransaction: AssetTransactionRepo;
21
- offer: OfferRepo;
22
- offerCatalog: OfferCatalogRepo;
23
- orderInTransaction: OrderInTransactionRepo;
24
- orderNumber: OrderNumberRepo;
25
- ownershipInfo: OwnershipInfoRepo;
26
- product: ProductRepo;
27
- project: ProjectRepo;
28
- serviceOutput: ServiceOutputRepo;
29
- serviceOutputIdentifier: ServiceOutputIdentifierRepo;
30
- placeOrder: PlaceOrderRepo;
31
- transactionNumber: TransactionNumberRepo;
32
- }
33
- export type IAuthorizeOperation<T> = (repos: IAuthorizeOperationRepos) => Promise<T>;
34
- export declare const ERROR_MESSAGE_ALREADY_REGISTERED = "Already registered";
35
5
  /**
36
6
  * プロダクトオファーを検索する
37
7
  */
@@ -68,35 +38,3 @@ export declare function search(params: {
68
38
  offers: factory.product.ITicketOffer[];
69
39
  product: Pick<factory.product.IProduct, "id" | "productID" | "typeOf" | "name" | "project" | "serviceOutput" | "serviceType" | "description">;
70
40
  }>;
71
- export type IAuthorizeOfferAction = factory.action.authorize.offer.product.IAction;
72
- /**
73
- * サービス(Chevreプロダクト)オファー承認
74
- */
75
- export declare function authorize(params: {
76
- project: {
77
- id: string;
78
- typeOf: factory.organizationType.Project;
79
- };
80
- object: factory.action.authorize.offer.product.IAcceptedOffer[];
81
- agent: {
82
- id: string;
83
- typeOf: factory.personType.Person | factory.creativeWorkType.WebApplication;
84
- };
85
- /**
86
- * 利用アプリケーション
87
- */
88
- location?: {
89
- id?: string;
90
- };
91
- transaction: {
92
- id: string;
93
- };
94
- }): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id'> & {
95
- result: IAuthorizeOfferAction['result'];
96
- }>;
97
- export declare function voidTransaction(params: factory.task.IData<factory.taskName.VoidRegisterServiceTransaction>): (repos: {
98
- action?: never;
99
- authorizeProductOfferAction: AuthorizeProductOfferActionRepo;
100
- assetTransaction: AssetTransactionRepo;
101
- placeOrder: PlaceOrderRepo;
102
- }) => Promise<void>;