@chevre/domain 28.0.0-alpha.1 → 28.0.0-alpha.10

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 (78) hide show
  1. package/lib/chevre/eventEmitter/transaction.d.ts +2 -2
  2. package/lib/chevre/eventEmitter/transaction.js +1 -1
  3. package/lib/chevre/repo/adminEvent.d.ts +0 -6
  4. package/lib/chevre/repo/adminEvent.js +3 -9
  5. package/lib/chevre/repo/adminEventSeries.d.ts +89 -0
  6. package/lib/chevre/repo/adminEventSeries.js +174 -0
  7. package/lib/chevre/repo/adminTransaction.d.ts +35 -39
  8. package/lib/chevre/repo/adminTransaction.js +0 -98
  9. package/lib/chevre/repo/aggregateEvent.js +0 -1
  10. package/lib/chevre/repo/aggregateTransaction.d.ts +0 -1
  11. package/lib/chevre/repo/aggregateTransaction.js +0 -1
  12. package/lib/chevre/repo/event.d.ts +2 -2
  13. package/lib/chevre/repo/event.js +71 -110
  14. package/lib/chevre/repo/eventSeries.d.ts +3 -82
  15. package/lib/chevre/repo/eventSeries.js +3 -201
  16. package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +2 -3
  17. package/lib/chevre/repo/mongoose/schemas/transaction.js +81 -70
  18. package/lib/chevre/repo/order.js +3 -1
  19. package/lib/chevre/repo/orderInTransaction.js +0 -6
  20. package/lib/chevre/repo/place/{hasPOS.d.ts → pos.d.ts} +3 -7
  21. package/lib/chevre/repo/place/{hasPOS.js → pos.js} +14 -13
  22. package/lib/chevre/repo/place/screeningRoom.d.ts +22 -1
  23. package/lib/chevre/repo/place/screeningRoom.js +28 -17
  24. package/lib/chevre/repo/transaction/placeOrder.d.ts +6 -12
  25. package/lib/chevre/repo/transaction/placeOrder.js +53 -146
  26. package/lib/chevre/repo/transaction/returnOrderInProgress.d.ts +1 -1
  27. package/lib/chevre/repo/transaction.d.ts +1 -1
  28. package/lib/chevre/repo/transaction.js +0 -1
  29. package/lib/chevre/repository.d.ts +10 -5
  30. package/lib/chevre/repository.js +19 -8
  31. package/lib/chevre/service/aggregation/event/aggregateOffers.js +1 -2
  32. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +0 -1
  33. package/lib/chevre/service/aggregation/system.js +1 -3
  34. package/lib/chevre/service/assetTransaction/pay/start/preStart/validateAcceptedPaymentMethodIfNeeded.js +1 -2
  35. package/lib/chevre/service/event/saveScreeningEventSeries.d.ts +2 -2
  36. package/lib/chevre/service/event/saveScreeningEventSeries.js +1 -1
  37. package/lib/chevre/service/event/saveScreeningEvents.d.ts +2 -0
  38. package/lib/chevre/service/event.d.ts +2 -0
  39. package/lib/chevre/service/event.js +0 -1
  40. package/lib/chevre/service/offer/event/authorize/factory.d.ts +2 -2
  41. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
  42. package/lib/chevre/service/offer/event/authorize.js +1 -4
  43. package/lib/chevre/service/offer/event/issueEventOfferTicket.js +1 -1
  44. package/lib/chevre/service/offer/event/voidTransaction.js +2 -5
  45. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -4
  46. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +2 -9
  47. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
  48. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +1 -4
  49. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -4
  50. package/lib/chevre/service/offer/onEventChanged.js +2 -4
  51. package/lib/chevre/service/offer.js +1 -2
  52. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +1 -1
  53. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
  54. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +1 -1
  55. package/lib/chevre/service/payment/any/authorize.js +1 -1
  56. package/lib/chevre/service/payment/any/factory.d.ts +2 -2
  57. package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +1 -4
  58. package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
  59. package/lib/chevre/service/payment/any/publishPaymentUrl.js +1 -1
  60. package/lib/chevre/service/task/importEventsFromCOA.js +2 -0
  61. package/lib/chevre/service/task/onResourceDeleted.js +2 -2
  62. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.d.ts +2 -2
  63. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +3 -4
  64. package/lib/chevre/service/task/onResourceUpdated.js +2 -2
  65. package/lib/chevre/service/task/syncResourcesFromCOA.js +3 -1
  66. package/lib/chevre/service/transaction/deleteTransaction.js +1 -1
  67. package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -2
  68. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +2 -2
  69. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -4
  70. package/lib/chevre/service/transaction/placeOrder/start.js +1 -1
  71. package/lib/chevre/service/transaction/placeOrder/updateAgent.js +1 -4
  72. package/lib/chevre/service/transaction/returnOrder/potentialActions.js +1 -3
  73. package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +13 -1
  74. package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -2
  75. package/lib/chevre/service/transaction/returnOrder.d.ts +14 -3
  76. package/lib/chevre/service/transaction/returnOrder.js +1 -6
  77. package/lib/chevre/service/transaction.d.ts +1 -1
  78. package/package.json +2 -2
@@ -63,7 +63,7 @@ function issueEventOfferTicket(params) {
63
63
  return async (repos) => {
64
64
  const { now, audience, eventId, eventOfferId, ticketedOffer, author, project, instrument } = params;
65
65
  // 取引は存在するか
66
- const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ typeOf: factory_1.factory.transactionType.PlaceOrder, id: audience.id }, ['expires', 'typeOf', 'seller']);
66
+ const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: audience.id }, ['expires', 'typeOf', 'seller']);
67
67
  // イベントは存在するか
68
68
  const event = await repos.event.projectEventFieldsById({ id: eventId }, ['project', 'offers', 'identifier']);
69
69
  const { seller } = transaction;
@@ -22,7 +22,7 @@ function voidTransaction(params) {
22
22
  agent: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
23
23
  ...(typeof params.sameAs?.id === 'string') ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } : undefined
24
24
  };
25
- const transaction = await repos.placeOrder.findPlaceOrderById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status', 'object']);
25
+ const transaction = await repos.placeOrder.findPlaceOrderById({ id: params.purpose.id }, ['typeOf', 'status', 'object']);
26
26
  // 興行オファー承認アクション検索
27
27
  let authorizeActions = await repos.actions.authorizeOffer.findAuthorizeOfferActionsByPurpose({
28
28
  // typeOf: factory.actionType.AuthorizeAction,
@@ -115,10 +115,7 @@ function cancelAcceptActions(params) {
115
115
  agent: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
116
116
  ...(typeof params.sameAs?.id === 'string') ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } : undefined
117
117
  };
118
- const transaction = await repos.placeOrder.findPlaceOrderById({
119
- typeOf: params.purpose.typeOf,
120
- id: params.purpose.id
121
- }, ['typeOf', 'status']);
118
+ const transaction = await repos.placeOrder.findPlaceOrderById({ id: params.purpose.id }, ['typeOf', 'status']);
122
119
  // 興行オファー承認アクション検索
123
120
  const completedAuthorizeActions = await repos.actions.authorizeOffer.findAuthorizeOfferActionsByPurpose({
124
121
  // typeOf: factory.actionType.AuthorizeAction,
@@ -19,10 +19,7 @@ function voidTransactionByActionId(params) {
19
19
  agent: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
20
20
  ...(typeof params.sameAs?.id === 'string') ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } : undefined
21
21
  };
22
- const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
23
- typeOf: factory_1.factory.transactionType.PlaceOrder,
24
- id: params.purpose.id
25
- }, ['typeOf']);
22
+ const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.purpose.id }, ['typeOf']);
26
23
  // if (transaction.agent.id !== params.agent.id) {
27
24
  // throw new factory.errors.Forbidden('Transaction not yours');
28
25
  // }
@@ -12,7 +12,6 @@ function findCOAInfo(params) {
12
12
  project: { id: { $eq: params.project.id } },
13
13
  limit: 1,
14
14
  page: 1,
15
- typeOf: factory_1.factory.eventType.ScreeningEvent,
16
15
  id: { $eq: params.id }
17
16
  }, ['coaInfo'])).shift();
18
17
  if (event === undefined) {
@@ -33,10 +32,7 @@ function acceptOffer(params) {
33
32
  if (typeof params.sameAs.id !== 'string' || params.sameAs.id === '') {
34
33
  throw new factory_1.factory.errors.ArgumentNull('sameAs.id');
35
34
  }
36
- const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
37
- typeOf: factory_1.factory.transactionType.PlaceOrder,
38
- id: params.purpose.id
39
- }, ['project', 'agent', 'typeOf']);
35
+ const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.purpose.id }, ['project', 'agent', 'typeOf']);
40
36
  // // 注文ドキュメントを参照(2026-06-24~)
41
37
  // const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
42
38
  // identifier: transaction.id,
@@ -118,10 +114,7 @@ function reAcceptOffer(params) {
118
114
  if (typeof params.potentialActions?.id !== 'string' || params.potentialActions.id === '') {
119
115
  throw new factory_1.factory.errors.ArgumentNull('potentialActions.id');
120
116
  }
121
- const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
122
- typeOf: factory_1.factory.transactionType.PlaceOrder,
123
- id: params.purpose.id
124
- }, ['project', 'agent', 'typeOf']);
117
+ const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.purpose.id }, ['project', 'agent', 'typeOf']);
125
118
  // const orderNumber = await repos.placeOrder.findInProgressOrderNumberById({ id: transaction.id });
126
119
  // if (typeof orderNumber !== 'string') {
127
120
  // // 事前に発行されているはず
@@ -8,7 +8,7 @@ export declare function createAuthorizeSeatReservationActionAttributes(params: {
8
8
  acceptAction: {
9
9
  id: string;
10
10
  };
11
- transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
11
+ transaction: Pick<factory.transaction.placeOrder.ITransaction, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
12
12
  /**
13
13
  * 仮予約済のCOA予約取引
14
14
  */
@@ -14,10 +14,7 @@ const factory_2 = require("../../../factory");
14
14
  */
15
15
  function authorize(params) {
16
16
  return async (repos) => {
17
- const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
18
- typeOf: factory_2.factory.transactionType.PlaceOrder,
19
- id: params.transaction.id
20
- }, ['agent', 'project', 'seller', 'typeOf', 'instrument']);
17
+ const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.transaction.id }, ['agent', 'project', 'seller', 'typeOf', 'instrument']);
21
18
  if (transaction.agent.id !== params.agent.id) {
22
19
  throw new factory_2.factory.errors.Forbidden('Transaction not yours');
23
20
  }
@@ -14,10 +14,7 @@ const factory_2 = require("../../../factory");
14
14
  */
15
15
  function changeOffers(params) {
16
16
  return async (repos) => {
17
- const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
18
- typeOf: factory_2.factory.transactionType.PlaceOrder,
19
- id: params.transaction.id
20
- }, ['typeOf', 'agent', 'project', 'seller']);
17
+ const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.transaction.id }, ['typeOf', 'agent', 'project', 'seller']);
21
18
  if (transaction.agent.id !== params.agent.id) {
22
19
  throw new factory_2.factory.errors.Forbidden('Transaction not yours');
23
20
  }
@@ -101,8 +101,7 @@ function createInformTasks(params, setting) {
101
101
  const informEvents = setting?.onResourceUpdated?.informResource;
102
102
  if (params.typeOf === factory_1.factory.eventType.ScreeningEvent) {
103
103
  const screeningEvents4inform = await repos.event.projectEventFields({
104
- id: { $in: params.ids },
105
- typeOf: params.typeOf
104
+ id: { $in: params.ids }
106
105
  }, [
107
106
  'project', 'organizer', 'typeOf', 'name', 'doorTime', 'endDate',
108
107
  'eventStatus', 'location', 'startDate', 'superEvent', 'offers', 'additionalProperty', 'identifier'
@@ -296,8 +295,7 @@ function syncEventEndDate2pendingReservations(params) {
296
295
  const events = await repos.event.projectEventFields({
297
296
  limit: 1,
298
297
  page: 1,
299
- id: { $eq: eventId },
300
- typeOf: params.typeOf
298
+ id: { $eq: eventId }
301
299
  }, ['endDate']);
302
300
  const endDate = events.shift()?.endDate;
303
301
  if (endDate instanceof Date) {
@@ -169,8 +169,7 @@ function findEventSeatOffersBySection(params) {
169
169
  page: 1,
170
170
  project: { id: { $eq: projectId } },
171
171
  organizer: { id: { $eq: sellerId } },
172
- id: { $eq: eventId },
173
- typeOf: factory_1.factory.eventType.ScreeningEvent
172
+ id: { $eq: eventId }
174
173
  }, ['startDate', 'offers.itemOffered', 'location', 'superEvent'])).shift();
175
174
  if (event === undefined) {
176
175
  throw new factory_1.factory.errors.NotFound(factory_1.factory.eventType.ScreeningEvent);
@@ -36,7 +36,7 @@ function cancelOrderIfExist(params) {
36
36
  limit: 1,
37
37
  page: 1,
38
38
  project: { id: { $eq: params.project.id } },
39
- typeOf: factory_1.factory.transactionType.PlaceOrder,
39
+ // typeOf: factory.transactionType.PlaceOrder,
40
40
  statuses: [factory_1.factory.transactionStatusType.Confirmed],
41
41
  // resultではなくobjectで参照するように変更(2026-06-16~)
42
42
  object: {
@@ -83,7 +83,7 @@ function createOnAuthorizationCreatedTask(order) {
83
83
  const placeOrderTransaction = (await repos.placeOrder.findPlaceOrderTransactions({
84
84
  limit: 1,
85
85
  page: 1,
86
- typeOf: factory_1.factory.transactionType.PlaceOrder,
86
+ // typeOf: factory.transactionType.PlaceOrder,
87
87
  object: { orderNumber: { $eq: order.orderNumber } },
88
88
  inclusion: ['result']
89
89
  })).shift();
@@ -11,7 +11,7 @@ function createPlacingOrderFromExistingTransaction(params) {
11
11
  limit: 1,
12
12
  page: 1,
13
13
  project: { id: { $eq: params.project.id } },
14
- typeOf: factory_1.factory.transactionType.PlaceOrder,
14
+ // typeOf: factory.transactionType.PlaceOrder,
15
15
  statuses: [factory_1.factory.transactionStatusType.Confirmed],
16
16
  // resultではなくobjectで参照するように変更(2026-06-16~)
17
17
  object: {
@@ -59,7 +59,7 @@ function authorize(params) {
59
59
  if (purpose.typeOf !== factory_1.factory.transactionType.PlaceOrder) {
60
60
  throw new factory_1.factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
61
61
  }
62
- const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ typeOf: purpose.typeOf, id: purpose.id }, ['agent', 'expires', 'typeOf', 'project', 'seller']);
62
+ const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: purpose.id }, ['agent', 'expires', 'typeOf', 'project', 'seller']);
63
63
  if (project.id !== transaction.project.id) {
64
64
  throw new factory_1.factory.errors.NotFound(factory_1.factory.transactionType.PlaceOrder);
65
65
  }
@@ -8,7 +8,7 @@ export declare function creatPublishPaymentUrlParams(params: {
8
8
  accountId?: string;
9
9
  object: Pick<factory.action.authorize.paymentMethod.any.IObjectIncludingPaymentMethodDetails, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod' | 'referencesOrder'>;
10
10
  paymentServiceType: factory.service.paymentService.PaymentServiceType;
11
- transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'expires' | 'seller' | 'project'>;
11
+ transaction: Pick<factory.transaction.placeOrder.ITransaction, 'expires' | 'seller' | 'project'>;
12
12
  transactionNumber: string;
13
13
  location?: factory.action.trade.pay.ILocation;
14
14
  identifier?: string;
@@ -26,7 +26,7 @@ export declare function creatPayTransactionStartParams(params: {
26
26
  accountId?: string;
27
27
  object: factory.action.authorize.paymentMethod.any.IObjectIncludingPaymentMethodDetails;
28
28
  paymentServiceType: factory.service.paymentService.PaymentServiceType;
29
- transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'expires' | 'seller' | 'project'>;
29
+ transaction: Pick<factory.transaction.placeOrder.ITransaction, 'expires' | 'seller' | 'project'>;
30
30
  transactionNumber: string;
31
31
  location?: factory.action.trade.pay.ILocation;
32
32
  order: {
@@ -12,10 +12,7 @@ function invalidatePaymentUrl(params) {
12
12
  if (params.purpose.typeOf !== factory_1.factory.transactionType.PlaceOrder) {
13
13
  throw new factory_1.factory.errors.Argument('purpose.typeOf', `must be ${factory_1.factory.transactionType.PlaceOrder}`);
14
14
  }
15
- const transaction = await repos.placeOrder.findPlaceOrderById({
16
- typeOf: params.purpose.typeOf,
17
- id: params.purpose.id
18
- }, ['typeOf', 'status', 'object', 'project', 'seller', 'agent']);
15
+ const transaction = await repos.placeOrder.findPlaceOrderById({ id: params.purpose.id }, ['typeOf', 'status', 'object', 'project', 'seller', 'agent']);
19
16
  // const orderCancelled: boolean = params.purpose.result?.order?.orderStatus === factory.orderStatus.OrderCancelled;
20
17
  // if (transaction.status === factory.transactionStatusType.Confirmed) {
21
18
  // if (!orderCancelled) {
@@ -50,10 +50,10 @@ function processVoidPayTransaction(params) {
50
50
  let transaction;
51
51
  // アクションID指定の場合、進行中取引検証(2023-02-24~)
52
52
  if (typeof params.id === 'string') {
53
- transaction = await repos.placeOrder.findPlaceOrderInProgressById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status']);
53
+ transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.purpose.id }, ['typeOf', 'status']);
54
54
  }
55
55
  else {
56
- transaction = await repos.placeOrder.findPlaceOrderById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status', 'result']);
56
+ transaction = await repos.placeOrder.findPlaceOrderById({ id: params.purpose.id }, ['typeOf', 'status', 'result']);
57
57
  }
58
58
  // 承認アクションを取得
59
59
  let authorizeActions;
@@ -48,7 +48,7 @@ function publishPaymentUrl(params) {
48
48
  throw new factory_1.factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
49
49
  }
50
50
  try {
51
- const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ typeOf: purpose.typeOf, id: purpose.id }, ['expires', 'seller', 'project']);
51
+ const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: purpose.id }, ['expires', 'seller', 'project']);
52
52
  if (project.id !== transaction.project.id) {
53
53
  throw new factory_1.factory.errors.NotFound(factory_1.factory.transactionType.PlaceOrder);
54
54
  }
@@ -39,6 +39,7 @@ const update_1 = require("../../repo/action/update");
39
39
  const categoryCode_1 = require("../../repo/categoryCode");
40
40
  const creativeWork_1 = require("../../repo/creativeWork");
41
41
  const adminEvent_1 = require("../../repo/adminEvent");
42
+ const adminEventSeries_1 = require("../../repo/adminEventSeries");
42
43
  const event_1 = require("../../repo/event");
43
44
  const eventSeries_1 = require("../../repo/eventSeries");
44
45
  const movieTheater_1 = require("../../repo/place/movieTheater");
@@ -78,6 +79,7 @@ function call(params) {
78
79
  categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
79
80
  creativeWork: new creativeWork_1.CreativeWorkRepo(connection),
80
81
  adminEvent: new adminEvent_1.AdminEventRepo(connection),
82
+ adminEventSeries: new adminEventSeries_1.AdminEventSeriesRepo(connection),
81
83
  event: new event_1.EventRepo(connection),
82
84
  eventSeries: new eventSeries_1.EventSeriesRepo(connection),
83
85
  movieTheater: new movieTheater_1.MovieTheaterRepo(connection),
@@ -13,7 +13,7 @@ const note_1 = require("../../repo/note");
13
13
  const offerCatalog_1 = require("../../repo/offerCatalog");
14
14
  const offerCatalogItem_1 = require("../../repo/offerCatalogItem");
15
15
  const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
16
- const hasPOS_1 = require("../../repo/place/hasPOS");
16
+ const pos_1 = require("../../repo/place/pos");
17
17
  const movieTheater_1 = require("../../repo/place/movieTheater");
18
18
  const screeningRoom_1 = require("../../repo/place/screeningRoom");
19
19
  const product_1 = require("../../repo/product");
@@ -42,7 +42,7 @@ function call(params) {
42
42
  adminEvent: new adminEvent_1.AdminEventRepo(connection),
43
43
  eventOffer: new eventOffer_1.EventOfferRepo(connection),
44
44
  eventSeries: new eventSeries_1.EventSeriesRepo(connection),
45
- hasPOS: new hasPOS_1.HasPOSRepo(connection, { id: '' }), // 先の処理で明示的に指定される
45
+ pos: new pos_1.POSRepo(connection, { id: '' }), // 先の処理で明示的に指定される
46
46
  member: new member_1.MemberRepo(connection),
47
47
  movieTheater: new movieTheater_1.MovieTheaterRepo(connection),
48
48
  note: new note_1.NoteRepo(connection),
@@ -1,5 +1,5 @@
1
1
  import { factory } from '../../../factory';
2
- import type { HasPOSRepo } from '../../../repo/place/hasPOS';
2
+ import type { POSRepo } from '../../../repo/place/pos';
3
3
  import type { MovieTheaterRepo } from '../../../repo/place/movieTheater';
4
4
  import type { SettingRepo } from '../../../repo/setting';
5
5
  import type { TaskRepo } from '../../../repo/task';
@@ -13,7 +13,7 @@ export declare function createInformHasPOSTasks(params: {
13
13
  ids: string[];
14
14
  typeOf: factory.placeType.MovieTheater;
15
15
  }): (repos: {
16
- hasPOS: HasPOSRepo;
16
+ pos: POSRepo;
17
17
  movieTheater: MovieTheaterRepo;
18
18
  setting: SettingRepo;
19
19
  task: TaskRepo;
@@ -25,12 +25,11 @@ function createInformHasPOSTasks(params) {
25
25
  throw new factory_1.factory.errors.NotFound(factory_1.factory.placeType.MovieTheater);
26
26
  }
27
27
  // 施設のhasPOSを全て連携する
28
- repos.hasPOS.operator.id = movieTheater.id;
29
- const hasPOS = await repos.hasPOS.search({
30
- project: { id: { $eq: params.project.id } }
28
+ repos.pos.operator.id = movieTheater.id;
29
+ const hasPOS = await repos.pos.findPOS({
30
+ projectId: params.project.id
31
31
  });
32
32
  const movieTheaters4inform = [{
33
- // hasPOS: (Array.isArray(movieTheater.hasPOS)) ? movieTheater.hasPOS : [],
34
33
  hasPOS: (Array.isArray(hasPOS)) ? hasPOS : [],
35
34
  id: movieTheater.id,
36
35
  typeOf: factory_1.factory.placeType.MovieTheater
@@ -15,7 +15,7 @@ const offerCatalog_1 = require("../../repo/offerCatalog");
15
15
  const offerCatalogItem_1 = require("../../repo/offerCatalogItem");
16
16
  const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
17
17
  const entranceGate_1 = require("../../repo/place/entranceGate");
18
- const hasPOS_1 = require("../../repo/place/hasPOS");
18
+ const pos_1 = require("../../repo/place/pos");
19
19
  const movieTheater_1 = require("../../repo/place/movieTheater");
20
20
  const screeningRoom_1 = require("../../repo/place/screeningRoom");
21
21
  const product_1 = require("../../repo/product");
@@ -39,7 +39,7 @@ function call(params) {
39
39
  entranceGate: new entranceGate_1.EntranceGateRepo(connection, { id: '' }), // 先の処理で明示的に指定される
40
40
  event: new event_1.EventRepo(connection),
41
41
  eventSeries: new eventSeries_1.EventSeriesRepo(connection),
42
- hasPOS: new hasPOS_1.HasPOSRepo(connection, { id: '' }), // 先の処理で明示的に指定される
42
+ pos: new pos_1.POSRepo(connection, { id: '' }), // 先の処理で明示的に指定される
43
43
  member: new member_1.MemberRepo(connection),
44
44
  movieTheater: new movieTheater_1.MovieTheaterRepo(connection),
45
45
  note: new note_1.NoteRepo(connection),
@@ -12,6 +12,7 @@ const categoryCode_1 = require("../../repo/categoryCode");
12
12
  const creativeWork_1 = require("../../repo/creativeWork");
13
13
  const credentials_1 = require("../../repo/credentials");
14
14
  const adminEvent_1 = require("../../repo/adminEvent");
15
+ const adminEventSeries_1 = require("../../repo/adminEventSeries");
15
16
  const eventSeries_1 = require("../../repo/eventSeries");
16
17
  const movieTheater_1 = require("../../repo/place/movieTheater");
17
18
  const screeningRoom_1 = require("../../repo/place/screeningRoom");
@@ -71,7 +72,7 @@ function call(params) {
71
72
  },
72
73
  categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
73
74
  creativeWork: new creativeWork_1.CreativeWorkRepo(connection),
74
- eventSeries: new eventSeries_1.EventSeriesRepo(connection),
75
+ adminEventSeries: new adminEventSeries_1.AdminEventSeriesRepo(connection),
75
76
  movieTheater: new movieTheater_1.MovieTheaterRepo(connection),
76
77
  masterService
77
78
  });
@@ -88,6 +89,7 @@ function call(params) {
88
89
  categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
89
90
  creativeWork: new creativeWork_1.CreativeWorkRepo(connection),
90
91
  adminEvent: new adminEvent_1.AdminEventRepo(connection),
92
+ adminEventSeries: new adminEventSeries_1.AdminEventSeriesRepo(connection),
91
93
  eventSeries: new eventSeries_1.EventSeriesRepo(connection),
92
94
  movieTheater: new movieTheater_1.MovieTheaterRepo(connection),
93
95
  screeningRoom: new screeningRoom_1.ScreeningRoomRepo(connection),
@@ -36,7 +36,7 @@ function deleteTransactionById(params) {
36
36
  if (params.object.typeOf === factory_1.factory.transactionType.PlaceOrder) {
37
37
  transaction = (await repos.placeOrder.findPlaceOrderTransactions({
38
38
  ids: [deletingTransactionId],
39
- typeOf: params.object.typeOf,
39
+ // typeOf: params.object.typeOf,
40
40
  inclusion: ['typeOf', 'project', 'status']
41
41
  })).shift();
42
42
  }
@@ -63,7 +63,7 @@ function confirm(params, options) {
63
63
  // status: { $in: [factory.transactionStatusType.Confirmed, factory.transactionStatusType.InProgress] },
64
64
  object: { orderDate: params.result.order.orderDate }
65
65
  })(repos);
66
- const transaction = await repos.placeOrder.findPlaceOrderById({ typeOf: factory_1.factory.transactionType.PlaceOrder, id: params.id }, ['typeOf', 'project', 'status', 'agent', 'seller', 'object', 'result']);
66
+ const transaction = await repos.placeOrder.findPlaceOrderById({ id: params.id }, ['typeOf', 'project', 'status', 'agent', 'seller', 'object', 'result']);
67
67
  // 注文ドキュメントから注文番号を参照(取引開始時に発行済の前提)(2026-06-26~)
68
68
  const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
69
69
  identifier: params.id,
@@ -169,7 +169,6 @@ function confirm(params, options) {
169
169
  // ステータス変更
170
170
  try {
171
171
  await repos.placeOrder.confirmPlaceOrder({
172
- typeOf: transaction.typeOf,
173
172
  id: transaction.id,
174
173
  object: {
175
174
  orderDate: params.result.order.orderDate,
@@ -6,10 +6,10 @@ type IPlaceOrderPotentialTask = factory.task.IAttributes<factory.taskName.PlaceO
6
6
  * 取引削除タスクを分離(2026-08-02~)
7
7
  */
8
8
  export declare function createImmediateTasks(params: {
9
- transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'endDate' | 'id' | 'object' | 'project' | 'seller' | 'startDate' | 'status' | 'typeOf'>;
9
+ transaction: Pick<factory.transaction.placeOrder.ITransaction, 'endDate' | 'id' | 'object' | 'project' | 'seller' | 'startDate' | 'status' | 'typeOf'>;
10
10
  taskRunsAt: Date;
11
11
  }): IPlaceOrderPotentialTask[];
12
12
  export declare function createScheduledTasks(params: {
13
- transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'endDate' | 'id' | 'object' | 'project' | 'status' | 'typeOf'>;
13
+ transaction: Pick<factory.transaction.placeOrder.ITransaction, 'endDate' | 'id' | 'object' | 'project' | 'status' | 'typeOf'>;
14
14
  }, setting: Pick<ISetting, 'storage'> | null): factory.task.deleteTransaction.IAttributes;
15
15
  export {};
@@ -12,10 +12,7 @@ const factory_2 = require("./exportTasks/factory");
12
12
  */
13
13
  function exportTasksById(params) {
14
14
  return async (repos) => {
15
- const transaction = await repos.placeOrder.findPlaceOrderById({
16
- typeOf: factory_1.factory.transactionType.PlaceOrder,
17
- id: params.id
18
- }, ['endDate', 'object', 'project', 'seller', 'startDate', 'status', 'typeOf']);
15
+ const transaction = await repos.placeOrder.findPlaceOrderById({ id: params.id }, ['endDate', 'object', 'project', 'seller', 'startDate', 'status', 'typeOf']);
19
16
  // タスク実行日時バッファの指定があれば調整
20
17
  let taskRunsAt = new Date();
21
18
  if (typeof params.runsTasksAfterInSeconds === 'number') {
@@ -34,7 +34,7 @@ function start(params, options) {
34
34
  // in case already locked
35
35
  const alreadyStartedTransaction = (await repos.placeOrder.findPlaceOrderTransactions({
36
36
  limit: 1, page: 1,
37
- typeOf: factory_1.factory.transactionType.PlaceOrder,
37
+ // typeOf: factory.transactionType.PlaceOrder,
38
38
  project: { id: { $eq: startParams.project.id } },
39
39
  status: { $in: [factory_1.factory.transactionStatusType.InProgress] },
40
40
  agent: { identifiers: [{ name: factory_2.AGENT_IDENTIFIER_NAME_PASSPORT, value: passport.identifier }] },
@@ -8,10 +8,7 @@ const fixCustomer_1 = require("./updateAgent/fixCustomer");
8
8
  */
9
9
  function updateAgent(params) {
10
10
  return async (repos) => {
11
- const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
12
- typeOf: factory_1.factory.transactionType.PlaceOrder,
13
- id: params.id
14
- }, ['agent', 'object', 'typeOf', 'project']);
11
+ const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.id }, ['agent', 'object', 'typeOf', 'project']);
15
12
  if (transaction.agent.id !== params.agent.id) {
16
13
  throw new factory_1.factory.errors.Forbidden('Transaction not yours');
17
14
  }
@@ -4,9 +4,7 @@ exports.createPotentialActions = createPotentialActions;
4
4
  const factory_1 = require("../../../factory");
5
5
  const returnPaymentMethod_1 = require("./potentialActions/returnPaymentMethod");
6
6
  const sendEmailMessage_1 = require("./potentialActions/sendEmailMessage");
7
- async function createPotentialActions(params,
8
- // settings: Settings
9
- setting) {
7
+ async function createPotentialActions(params, setting) {
10
8
  const emailMessages = [];
11
9
  const returnOrderActions = await Promise.all(params.orders.map(async (order) => {
12
10
  let returnOrderParams = params.potentialActions?.returnOrder;
@@ -23,10 +23,22 @@ interface IPreStartOperationRepos {
23
23
  }
24
24
  type IPreStartOperation<T> = (repos: IPreStartOperationRepos) => Promise<T>;
25
25
  type IFixedSeller = Pick<ISellerWithId, 'id' | 'name' | 'project' | 'hasMerchantReturnPolicy' | 'typeOf'>;
26
+ /**
27
+ * 注文返品開始パラメータ
28
+ */
29
+ export interface IStartParamsWithoutDetail {
30
+ project: Pick<factory.project.IProject, 'id' | 'typeOf'>;
31
+ expiresInSeconds: number;
32
+ agent: factory.transaction.returnOrder.IAgent;
33
+ object: {
34
+ order: [factory.transaction.returnOrder.IReturnableOrder];
35
+ reason: factory.transaction.returnOrder.Reason;
36
+ };
37
+ }
26
38
  /**
27
39
  * 返品取引開始前処理
28
40
  */
29
- declare function preStart(params: factory.transaction.returnOrder.IStartParamsWithoutDetail): IPreStartOperation<{
41
+ declare function preStart(params: IStartParamsWithoutDetail): IPreStartOperation<{
30
42
  transactionObject: factory.transaction.returnOrder.IObject;
31
43
  seller: IFixedSeller;
32
44
  expiresInSeconds: number;
@@ -36,8 +36,7 @@ function preStart(params) {
36
36
  let events = [];
37
37
  if (eventIds.length > 0) {
38
38
  events = await repos.event.projectEventFields({
39
- id: { $in: eventIds },
40
- typeOf: factory_1.factory.eventType.ScreeningEvent
39
+ id: { $in: eventIds }
41
40
  }, ['startDate']);
42
41
  }
43
42
  let returnPolicies = [];
@@ -13,7 +13,7 @@ import type { SellerReturnPolicyRepo } from '../../repo/sellerReturnPolicy';
13
13
  import type { SettingRepo } from '../../repo/setting';
14
14
  import type { TaskRepo } from '../../repo/task';
15
15
  import type { IStartedTransaction, ReturnOrderInProgressRepo } from '../../repo/transaction/returnOrderInProgress';
16
- import { preStart } from './returnOrder/preStart';
16
+ import { preStart, IStartParamsWithoutDetail } from './returnOrder/preStart';
17
17
  interface IStartOperationRepos {
18
18
  acceptedOffer: AcceptedOfferRepo;
19
19
  event: EventRepo;
@@ -31,7 +31,7 @@ type IStartOperation<T> = (repos: IStartOperationRepos) => Promise<T>;
31
31
  /**
32
32
  * 返品取引開始
33
33
  */
34
- declare function start(params: factory.transaction.returnOrder.IStartParamsWithoutDetail): IStartOperation<IStartedTransaction>;
34
+ declare function start(params: IStartParamsWithoutDetail): IStartOperation<IStartedTransaction>;
35
35
  interface IConfirmRepos {
36
36
  acceptedOffer: AcceptedOfferRepo;
37
37
  message: MessageRepo;
@@ -43,7 +43,18 @@ interface IConfirmRepos {
43
43
  /**
44
44
  * 取引確定
45
45
  */
46
- declare function confirm(params: factory.transaction.returnOrder.IConfirmParams & {
46
+ declare function confirm(params: {
47
+ /**
48
+ * 取引ID
49
+ */
50
+ id: string;
51
+ agent: {
52
+ id: string;
53
+ };
54
+ /**
55
+ * 取引確定後アクション
56
+ */
57
+ potentialActions?: factory.transaction.returnOrder.IPotentialActionsParams;
47
58
  object: {
48
59
  order: {
49
60
  dateReturned: Date;
@@ -16,16 +16,11 @@ Object.defineProperty(exports, "preStart", { enumerable: true, get: function ()
16
16
  */
17
17
  function start(params) {
18
18
  return async (repos) => {
19
- const { transactionObject, expiresInSeconds, seller } = await (0, preStart_1.preStart)(params)(repos);
19
+ const { transactionObject, expiresInSeconds, seller: _seller } = await (0, preStart_1.preStart)(params)(repos);
20
20
  const returnOrderAttributes = {
21
21
  project: params.project,
22
22
  typeOf: factory_1.factory.transactionType.ReturnOrder,
23
23
  agent: params.agent,
24
- seller: {
25
- id: String(seller.id),
26
- typeOf: seller.typeOf,
27
- name: seller.name
28
- },
29
24
  object: transactionObject,
30
25
  expiresInSeconds
31
26
  };
@@ -44,4 +44,4 @@ export declare function exportOneTransactionTasksIfExists(params: {
44
44
  endDate?: factory.sortType;
45
45
  startDate?: factory.sortType;
46
46
  };
47
- }): IExportTasksOperation<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'typeOf'> | undefined>;
47
+ }): IExportTasksOperation<Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'typeOf'> | undefined>;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@aws-sdk/client-cognito-identity-provider": "3.1090.0",
13
13
  "@aws-sdk/credential-providers": "3.1090.0",
14
- "@chevre/factory": "10.5.0-alpha.8",
14
+ "@chevre/factory": "11.0.0-alpha.3",
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",
@@ -88,5 +88,5 @@
88
88
  "postversion": "git push origin --tags",
89
89
  "prepublishOnly": "npm run clean && npm run build"
90
90
  },
91
- "version": "28.0.0-alpha.1"
91
+ "version": "28.0.0-alpha.10"
92
92
  }