@chevre/domain 28.0.0-alpha.8 → 28.0.0

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 (155) hide show
  1. package/lib/chevre/emailMessageBuilder.d.ts +9 -5
  2. package/lib/chevre/emailMessageBuilder.js +12 -11
  3. package/lib/chevre/factory/event.d.ts +1 -1
  4. package/lib/chevre/factory/event.js +1 -5
  5. package/lib/chevre/repo/acceptedOffer.d.ts +6 -5
  6. package/lib/chevre/repo/acceptedOffer.js +14 -9
  7. package/lib/chevre/repo/acceptedOfferInReserve.d.ts +6 -8
  8. package/lib/chevre/repo/acceptedOfferInReserve.js +13 -7
  9. package/lib/chevre/repo/action/unknown2actionError.d.ts +1 -0
  10. package/lib/chevre/repo/action/unknown2actionError.js +29 -1
  11. package/lib/chevre/repo/adminAcceptedOffer.d.ts +36 -12
  12. package/lib/chevre/repo/adminAcceptedOffer.js +40 -10
  13. package/lib/chevre/repo/adminAccountTitle.d.ts +49 -0
  14. package/lib/chevre/repo/adminAccountTitle.js +212 -0
  15. package/lib/chevre/repo/adminAccountTitleCategory.d.ts +37 -0
  16. package/lib/chevre/repo/adminAccountTitleCategory.js +127 -0
  17. package/lib/chevre/repo/adminAccountTitleSet.d.ts +42 -0
  18. package/lib/chevre/repo/adminAccountTitleSet.js +149 -0
  19. package/lib/chevre/repo/adminEvent.d.ts +1 -1
  20. package/lib/chevre/repo/adminEventSeries.d.ts +0 -22
  21. package/lib/chevre/repo/adminEventSeries.js +35 -31
  22. package/lib/chevre/repo/{paymentServiceChannel.d.ts → adminPaymentServiceChannel.d.ts} +13 -11
  23. package/lib/chevre/repo/{paymentServiceChannel.js → adminPaymentServiceChannel.js} +20 -19
  24. package/lib/chevre/repo/adminTask.d.ts +2 -2
  25. package/lib/chevre/repo/adminTransaction.d.ts +15 -15
  26. package/lib/chevre/repo/categoryCode.js +0 -21
  27. package/lib/chevre/repo/emailMessage.d.ts +3 -1
  28. package/lib/chevre/repo/emailMessage.js +20 -13
  29. package/lib/chevre/repo/eventSeries.d.ts +2 -2
  30. package/lib/chevre/repo/eventSeries.js +19 -12
  31. package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +1 -1
  32. package/lib/chevre/repo/issuer.d.ts +2 -6
  33. package/lib/chevre/repo/memberProgram.d.ts +1 -38
  34. package/lib/chevre/repo/memberProgram.js +1 -62
  35. package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +1 -1
  36. package/lib/chevre/repo/mongoose/schemas/accountTitle.js +22 -26
  37. package/lib/chevre/repo/mongoose/schemas/civicStructure.d.ts +1 -0
  38. package/lib/chevre/repo/mongoose/schemas/event.js +0 -13
  39. package/lib/chevre/repo/mongoose/schemas/eventSeries.js +1 -18
  40. package/lib/chevre/repo/mongoose/schemas/issuer.d.ts +1 -3
  41. package/lib/chevre/repo/mongoose/schemas/issuer.js +0 -10
  42. package/lib/chevre/repo/mongoose/schemas/message.d.ts +5 -1
  43. package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +0 -1
  44. package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +3 -12
  45. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.d.ts +1 -2
  46. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +6 -15
  47. package/lib/chevre/repo/mongoose/schemas/order.d.ts +22 -1
  48. package/lib/chevre/repo/mongoose/schemas/paymentServiceChannel.d.ts +1 -1
  49. package/lib/chevre/repo/mongoose/schemas/place.js +0 -9
  50. package/lib/chevre/repo/mongoose/schemas/project.d.ts +1 -2
  51. package/lib/chevre/repo/mongoose/schemas/project.js +1 -1
  52. package/lib/chevre/repo/mongoose/schemas/seller.d.ts +3 -1
  53. package/lib/chevre/repo/mongoose/schemas/seller.js +0 -2
  54. package/lib/chevre/repo/offerCatalog.d.ts +0 -2
  55. package/lib/chevre/repo/offerCatalogItem.d.ts +13 -20
  56. package/lib/chevre/repo/offerCatalogItem.js +8 -86
  57. package/lib/chevre/repo/order.d.ts +2 -2
  58. package/lib/chevre/repo/order.js +0 -31
  59. package/lib/chevre/repo/orderInTransaction.d.ts +5 -25
  60. package/lib/chevre/repo/place/movieTheater.d.ts +3 -1
  61. package/lib/chevre/repo/place/movieTheater.js +3 -1
  62. package/lib/chevre/repo/place/{hasPOS.d.ts → pos.d.ts} +13 -20
  63. package/lib/chevre/repo/place/{hasPOS.js → pos.js} +66 -29
  64. package/lib/chevre/repo/place/screeningRoom.d.ts +7 -2
  65. package/lib/chevre/repo/place/screeningRoom.js +12 -7
  66. package/lib/chevre/repo/priceSpecification.d.ts +8 -8
  67. package/lib/chevre/repo/project.d.ts +14 -20
  68. package/lib/chevre/repo/project.js +28 -44
  69. package/lib/chevre/repo/projectMakesOffer.js +2 -2
  70. package/lib/chevre/repo/role.d.ts +1 -1
  71. package/lib/chevre/repo/role.js +1 -30
  72. package/lib/chevre/repo/seller.d.ts +11 -4
  73. package/lib/chevre/repo/seller.js +31 -58
  74. package/lib/chevre/repo/sellerPaymentAccepted.d.ts +14 -21
  75. package/lib/chevre/repo/sellerPaymentAccepted.js +65 -38
  76. package/lib/chevre/repo/task.d.ts +3 -3
  77. package/lib/chevre/repository.d.ts +25 -15
  78. package/lib/chevre/repository.js +52 -30
  79. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +2 -1
  80. package/lib/chevre/service/aggregation.d.ts +0 -2
  81. package/lib/chevre/service/aggregation.js +1 -3
  82. package/lib/chevre/service/assetTransaction/pay/start/preStart/fixPaymentService.d.ts +1 -1
  83. package/lib/chevre/service/assetTransaction/pay/start/preStart/fixPaymentService.js +1 -15
  84. package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.d.ts +1 -1
  85. package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.js +9 -3
  86. package/lib/chevre/service/assetTransaction/pay/start.js +3 -3
  87. package/lib/chevre/service/assetTransaction/reserve/start.js +2 -1
  88. package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -1
  89. package/lib/chevre/service/event/saveScreeningEventSeries.js +1 -2
  90. package/lib/chevre/service/event/saveScreeningEvents.js +4 -4
  91. package/lib/chevre/service/notification/sendEmailMessage.d.ts +2 -0
  92. package/lib/chevre/service/notification/sendEmailMessage.js +23 -6
  93. package/lib/chevre/service/offer/any.d.ts +1 -1
  94. package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -3
  95. package/lib/chevre/service/offer/event/authorize/factory.js +1 -8
  96. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
  97. package/lib/chevre/service/offer/event/issueEventOfferTicket.js +0 -11
  98. package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +1 -4
  99. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +9 -13
  100. package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +2 -8
  101. package/lib/chevre/service/offer/event/searchOfferCatalogItems.js +2 -2
  102. package/lib/chevre/service/offer/event/searchOffersByIds.js +3 -9
  103. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
  104. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +0 -7
  105. package/lib/chevre/service/offer/onEventChanged.js +9 -18
  106. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +4 -6
  107. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +23 -4
  108. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +1 -1
  109. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.d.ts +1 -1
  110. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +1 -1
  111. package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +1 -1
  112. package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
  113. package/lib/chevre/service/order/sendOrder.js +2 -14
  114. package/lib/chevre/service/payment/creditCard/getGMOInfoFromSeller.js +1 -1
  115. package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.d.ts +3 -3
  116. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +1 -1
  117. package/lib/chevre/service/payment/movieTicket/payMovieTicket/payActionParams2seatInfoSyncIn.js +1 -1
  118. package/lib/chevre/service/payment/movieTicket/validation.js +1 -1
  119. package/lib/chevre/service/project.d.ts +3 -3
  120. package/lib/chevre/service/project.js +1 -1
  121. package/lib/chevre/service/task/onResourceDeleted.js +8 -8
  122. package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +8 -8
  123. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.d.ts +7 -3
  124. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +51 -50
  125. package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +1 -1
  126. package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.js +1 -1
  127. package/lib/chevre/service/task/onResourceUpdated.js +10 -47
  128. package/lib/chevre/service/task/sendEmailMessage.js +3 -1
  129. package/lib/chevre/service/task/syncResourcesFromCOA.js +2 -2
  130. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +6 -3
  131. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +2 -15
  132. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +6 -4
  133. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +3 -7
  134. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +1 -1
  135. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +1 -1
  136. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.d.ts +1 -1
  137. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +2 -2
  138. package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +0 -2
  139. package/lib/chevre/service/transaction/placeOrder/confirm.js +6 -11
  140. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.d.ts +6 -3
  141. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +8 -9
  142. package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.d.ts +6 -3
  143. package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.js +2 -7
  144. package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +6 -3
  145. package/lib/chevre/service/transaction/returnOrder/potentialActions.js +4 -3
  146. package/lib/chevre/service/transaction/returnOrder/preStart/factory.d.ts +1 -1
  147. package/lib/chevre/service/transaction/returnOrder.d.ts +0 -2
  148. package/lib/chevre/service/transaction/returnOrder.js +6 -6
  149. package/package.json +2 -2
  150. package/lib/chevre/repo/accountTitle.d.ts +0 -28
  151. package/lib/chevre/repo/accountTitle.js +0 -30
  152. package/lib/chevre/service/aggregation/project.d.ts +0 -17
  153. package/lib/chevre/service/aggregation/project.js +0 -98
  154. package/lib/chevre/service/delivery/factory.d.ts +0 -16
  155. package/lib/chevre/service/delivery/factory.js +0 -124
@@ -47,7 +47,6 @@ class MemberProgramRepo {
47
47
  _id: 0,
48
48
  typeOf: '$hasMemberProgram.typeOf',
49
49
  identifier: '$hasMemberProgram.identifier',
50
- hasTiers: '$hasMemberProgram.hasTiers',
51
50
  hostingOrganization: {
52
51
  identifier: '$identifier'
53
52
  }
@@ -62,62 +61,6 @@ class MemberProgramRepo {
62
61
  return aggregate.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
63
62
  .exec();
64
63
  }
65
- /**
66
- * tierを検索する
67
- */
68
- async projectMemberProgramTiers(params) {
69
- const matchStages = [];
70
- const projectIdEq = params.project?.id?.$eq;
71
- if (typeof projectIdEq === 'string') {
72
- matchStages.push({ $match: { 'project.id': { $eq: projectIdEq } } });
73
- }
74
- const hostingOrganizationIdEq = params.isTierOf?.hostingOrganization?.id?.$eq;
75
- if (typeof hostingOrganizationIdEq === 'string') {
76
- matchStages.push({ $match: { _id: { $eq: new mongoose_1.Types.ObjectId(hostingOrganizationIdEq) } } });
77
- }
78
- const memberProgramIdentifierEq = params.isTierOf?.identifier?.$eq;
79
- if (typeof memberProgramIdentifierEq === 'string') {
80
- matchStages.push({ $match: { 'hasMemberProgram.identifier': { $exists: true, $eq: memberProgramIdentifierEq } } });
81
- }
82
- const identifierEq = params.identifier?.$eq;
83
- if (typeof identifierEq === 'string') {
84
- matchStages.push({ $match: { 'hasMemberProgram.hasTiers.identifier': { $exists: true, $eq: identifierEq } } });
85
- }
86
- const aggregate = this.issuerModel.aggregate([
87
- {
88
- $unwind: {
89
- path: '$hasMemberProgram'
90
- }
91
- },
92
- {
93
- $unwind: {
94
- path: '$hasMemberProgram.hasTiers'
95
- }
96
- },
97
- ...matchStages,
98
- { $sort: { 'hasMemberProgram.hasTiers.identifier': factory_1.factory.sortType.Ascending } },
99
- {
100
- $project: {
101
- _id: 0,
102
- typeOf: '$hasMemberProgram.hasTiers.typeOf',
103
- identifier: '$hasMemberProgram.hasTiers.identifier',
104
- isTierOf: {
105
- identifier: '$hasMemberProgram.identifier',
106
- hostingOrganization: {
107
- identifier: '$identifier'
108
- }
109
- }
110
- }
111
- }
112
- ]);
113
- if (typeof params.limit === 'number' && params.limit > 0) {
114
- const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
115
- aggregate.skip(params.limit * (page - 1))
116
- .limit(params.limit);
117
- }
118
- return aggregate.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
119
- .exec();
120
- }
121
64
  async create(params) {
122
65
  let doc = await this.issuerModel.findOne({
123
66
  _id: { $eq: params.hostingOrganization.id },
@@ -146,13 +89,9 @@ class MemberProgramRepo {
146
89
  }
147
90
  }
148
91
  async updateOne(params) {
149
- const hasTiers = (Array.isArray(params.hasTiers))
150
- ? params.hasTiers.map(({ identifier }) => ({ identifier, typeOf: 'MemberProgramTier' }))
151
- : [];
152
92
  const updatingMemberProgram = {
153
93
  typeOf: 'MemberProgram',
154
- identifier: params.identifier,
155
- hasTiers
94
+ identifier: params.identifier
156
95
  };
157
96
  const doc = await this.issuerModel.findOneAndUpdate({
158
97
  _id: { $eq: params.hostingOrganization.id },
@@ -1,7 +1,7 @@
1
1
  import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
2
  import { IVirtuals } from '../virtuals';
3
3
  import { factory } from '../../../factory';
4
- type IDocType = factory.accountTitle.IAccountTitle;
4
+ type IDocType = Pick<factory.accountTitle.IAccountTitle, 'codeValue' | 'hasCategoryCode' | 'name' | 'project' | 'typeOf'>;
5
5
  type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
6
6
  type ISchemaDefinition = SchemaDefinition<IDocType>;
7
7
  type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
@@ -8,18 +8,15 @@ const settings_1 = require("../../../settings");
8
8
  const modelName = 'AccountTitle';
9
9
  exports.modelName = modelName;
10
10
  const schemaDefinition = {
11
- project: mongoose_1.SchemaTypes.Mixed,
12
- typeOf: {
13
- type: String,
14
- required: true
15
- },
16
- codeValue: String,
11
+ project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
12
+ typeOf: { type: String, required: true },
13
+ codeValue: { type: String, required: true },
17
14
  name: String,
18
- inCodeSet: mongoose_1.SchemaTypes.Mixed,
19
15
  hasCategoryCode: mongoose_1.SchemaTypes.Mixed,
20
- inDefinedTermSet: mongoose_1.SchemaTypes.Mixed,
21
- hasDefinedTerm: mongoose_1.SchemaTypes.Mixed,
22
- additionalProperty: mongoose_1.SchemaTypes.Mixed
16
+ // additionalProperty: SchemaTypes.Mixed // discontinue(2026-10-25~)
17
+ // inCodeSet: SchemaTypes.Mixed, // discontinue(2026-10-16~)
18
+ // inDefinedTermSet: SchemaTypes.Mixed, // discontinue(2026-10-16~)
19
+ // hasDefinedTerm: SchemaTypes.Mixed, // discontinue(2026-10-16~)
23
20
  };
24
21
  const schemaOptions = {
25
22
  autoIndex: settings_1.MONGO_AUTO_INDEX,
@@ -98,24 +95,23 @@ const indexes = [
98
95
  'hasCategoryCode.codeValue': { $exists: true }
99
96
  }
100
97
  }
101
- ]
98
+ ],
99
+ // 'hasCategoryCode.hasCategoryCode.codeValue': null のインデックスが作成されてうまくいかない
100
+ // [
101
+ // {
102
+ // 'project.id': 1,
103
+ // 'hasCategoryCode.hasCategoryCode.codeValue': 1
104
+ // },
105
+ // {
106
+ // name: 'uniqueAccountTitleCode',
107
+ // unique: true,
108
+ // partialFilterExpression: {
109
+ // 'hasCategoryCode.hasCategoryCode.codeValue': { $exists: true }
110
+ // }
111
+ // }
112
+ // ]
102
113
  ];
103
114
  exports.indexes = indexes;
104
- // 'hasCategoryCode.hasCategoryCode.codeValue': null のインデックスは作成されてうまくいかないので保留
105
- // schema.index(
106
- // {
107
- // 'project.id': 1,
108
- // 'hasCategoryCode.hasCategoryCode.codeValue': 1
109
- // },
110
- // {
111
- // name: 'uniqueHasCategoryCodeHasCategoryCodeCodeValue',
112
- // unique: true,
113
- // partialFilterExpression: {
114
- // 'project.id': { $exists: true },
115
- // 'hasCategoryCode.hasCategoryCode.codeValue': { $exists: true }
116
- // }
117
- // }
118
- // );
119
115
  /**
120
116
  * 勘定科目スキーマ
121
117
  */
@@ -3,6 +3,7 @@ import { IVirtuals } from '../virtuals';
3
3
  import { factory } from '../../../factory';
4
4
  export type IDocType = Omit<factory.place.movieTheater.IPlace, 'id'> & {
5
5
  hasPOS?: factory.place.movieTheater.IPOS[];
6
+ hasEntranceGate?: factory.place.movieTheater.IEntranceGate[];
6
7
  };
7
8
  type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
8
9
  type ISchemaDefinition = SchemaDefinition<IDocType>;
@@ -88,10 +88,6 @@ const indexes = [
88
88
  }
89
89
  }
90
90
  ],
91
- [
92
- { typeOf: 1, startDate: 1 },
93
- { name: 'searchByTypeOf' }
94
- ],
95
91
  [
96
92
  { eventStatus: 1, startDate: 1 },
97
93
  { name: 'searchByEventStatus' }
@@ -182,15 +178,6 @@ const indexes = [
182
178
  name: 'searchByOffersItemOfferedId'
183
179
  }
184
180
  ],
185
- [
186
- { 'offers.seller.makesOffer': 1, startDate: 1 },
187
- {
188
- name: 'searchBySellerMakesOffer',
189
- partialFilterExpression: {
190
- 'offers.seller.makesOffer': { $exists: true }
191
- }
192
- }
193
- ],
194
181
  [
195
182
  { 'offers.seller.makesOffer.availableAtOrFrom.id': 1, startDate: 1 },
196
183
  {
@@ -26,7 +26,7 @@ const schemaDefinition = {
26
26
  startDate: { type: Date, required: true }, // required(2025-10-08~)
27
27
  subEvent: mongoose_1.SchemaTypes.Mixed, // support(2025-12-31~)
28
28
  workPerformed: mongoose_1.SchemaTypes.Mixed,
29
- soundFormat: mongoose_1.SchemaTypes.Mixed,
29
+ // soundFormat: SchemaTypes.Mixed, // discontinue(2026-10-07~)
30
30
  subtitleLanguage: mongoose_1.SchemaTypes.Mixed,
31
31
  dubLanguage: mongoose_1.SchemaTypes.Mixed,
32
32
  kanaName: String,
@@ -74,14 +74,6 @@ const indexes = [
74
74
  { 'organizer.id': 1, startDate: 1 },
75
75
  { name: 'organizerId' }
76
76
  ],
77
- [
78
- { typeOf: 1, startDate: 1 },
79
- { name: 'typeOf' }
80
- ],
81
- [
82
- { eventStatus: 1, startDate: 1 },
83
- { name: 'eventStatus' }
84
- ],
85
77
  [
86
78
  { 'location.id': 1, startDate: 1 },
87
79
  {
@@ -146,15 +138,6 @@ const indexes = [
146
138
  }
147
139
  }
148
140
  ],
149
- [
150
- { 'soundFormat.typeOf': 1, startDate: 1 },
151
- {
152
- name: 'soundFormatTypeOf',
153
- partialFilterExpression: {
154
- 'soundFormat.typeOf': { $exists: true }
155
- }
156
- }
157
- ],
158
141
  [
159
142
  { 'name.ja': 1, startDate: 1 },
160
143
  {
@@ -2,9 +2,7 @@ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from '
2
2
  import { factory } from '../../../factory';
3
3
  import { IVirtuals } from '../virtuals';
4
4
  export type IDocType = Omit<factory.issuer.IIssuer, 'id'> & {
5
- hasMemberProgram?: (factory.issuer.IMemberProgram & {
6
- hasTiers?: Pick<factory.issuer.IMemberProgramTier, 'identifier' | 'typeOf'>[];
7
- })[];
5
+ hasMemberProgram?: factory.issuer.IMemberProgram[];
8
6
  };
9
7
  type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
10
8
  type ISchemaDefinition = SchemaDefinition<IDocType>;
@@ -61,16 +61,6 @@ const indexes = [
61
61
  }
62
62
  }
63
63
  ],
64
- [
65
- { 'project.id': 1, 'hasMemberProgram.hasTiers.identifier': 1 },
66
- {
67
- name: 'uniqueMemberProgramTierIdentifier',
68
- unique: true,
69
- partialFilterExpression: {
70
- 'hasMemberProgram.hasTiers.identifier': { $exists: true }
71
- }
72
- }
73
- ],
74
64
  [
75
65
  { 'hasMemberProgram.identifier': 1, identifier: 1 },
76
66
  { name: 'hasMemberProgramIdentifier' }
@@ -1,7 +1,11 @@
1
1
  import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
2
  import { IVirtuals } from '../virtuals';
3
3
  import { factory } from '../../../factory';
4
- export type IEmailMessage = factory.creativeWork.message.email.ICreativeWork & {
4
+ export type ISender = Pick<factory.creativeWork.message.email.ISender, 'name' | 'typeOf'> & {
5
+ email?: never;
6
+ };
7
+ export type IEmailMessage = Pick<factory.creativeWork.message.email.ICreativeWork, 'about' | 'identifier' | 'name' | 'text' | 'toRecipient' | 'typeOf'> & {
8
+ sender: ISender;
5
9
  datePublished: Date;
6
10
  mainEntity: Pick<factory.order.ISimpleOrder, 'orderNumber' | 'typeOf'>;
7
11
  project: {
@@ -3,7 +3,6 @@ import { IVirtuals } from '../virtuals';
3
3
  import { factory } from '../../../factory';
4
4
  export type IDocType = Omit<factory.offerCatalog.IOfferCatalog, 'id'> & {
5
5
  _id: string;
6
- alternateName?: any;
7
6
  dateSynced?: Date;
8
7
  };
9
8
  type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
@@ -10,24 +10,15 @@ exports.modelName = modelName;
10
10
  const schemaDefinition = {
11
11
  project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
12
12
  _id: String,
13
- identifier: {
14
- type: String,
15
- required: true
16
- },
13
+ identifier: { type: String, required: true },
17
14
  name: mongoose_1.SchemaTypes.Mixed,
18
15
  description: mongoose_1.SchemaTypes.Mixed,
19
- alternateName: mongoose_1.SchemaTypes.Mixed,
20
- typeOf: {
21
- type: String,
22
- required: true
23
- },
16
+ // alternateName: SchemaTypes.Mixed,
17
+ typeOf: { type: String, required: true },
24
18
  itemListElement: [mongoose_1.SchemaTypes.Mixed],
25
19
  itemOffered: { type: mongoose_1.SchemaTypes.Mixed, required: true },
26
20
  additionalProperty: [mongoose_1.SchemaTypes.Mixed],
27
21
  dateSynced: Date // 追加(2023-09-13~)
28
- // createdAt: SchemaTypes.Mixed,
29
- // updatedAt: SchemaTypes.Mixed,
30
- // __v: SchemaTypes.Mixed
31
22
  };
32
23
  const schemaOptions = {
33
24
  autoIndex: settings_1.MONGO_AUTO_INDEX,
@@ -1,9 +1,8 @@
1
1
  import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
2
  import { IVirtuals } from '../virtuals';
3
3
  import { factory } from '../../../factory';
4
- export type IDocType = Omit<factory.offerCatalog.IOfferCatalog, 'id'> & {
4
+ export type IDocType = Pick<factory.offerCatalog.IOfferCatalog, 'description' | 'identifier' | 'itemListElement' | 'itemOffered' | 'name' | 'project' | 'relatedOffer' | 'typeOf'> & {
5
5
  _id: string;
6
- alternateName?: any;
7
6
  dateSynced?: Date;
8
7
  };
9
8
  type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
@@ -9,25 +9,16 @@ const modelName = 'OfferCatalogItem';
9
9
  exports.modelName = modelName;
10
10
  const schemaDefinition = {
11
11
  project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
12
- identifier: {
13
- type: String,
14
- required: true
15
- },
16
- name: mongoose_1.SchemaTypes.Mixed,
17
- description: mongoose_1.SchemaTypes.Mixed,
18
- alternateName: mongoose_1.SchemaTypes.Mixed,
19
- typeOf: {
20
- type: String,
21
- required: true
22
- },
12
+ identifier: { type: String, required: true },
13
+ typeOf: { type: String, required: true },
23
14
  itemListElement: [mongoose_1.SchemaTypes.Mixed],
24
15
  itemOffered: { type: mongoose_1.SchemaTypes.Mixed, required: true },
25
- additionalProperty: [mongoose_1.SchemaTypes.Mixed],
16
+ name: mongoose_1.SchemaTypes.Mixed,
17
+ description: mongoose_1.SchemaTypes.Mixed,
18
+ // alternateName: SchemaTypes.Mixed,
19
+ // additionalProperty: [SchemaTypes.Mixed], // discontinue(2026-10-15~)
26
20
  dateSynced: Date,
27
21
  relatedOffer: mongoose_1.SchemaTypes.Mixed
28
- // createdAt: SchemaTypes.Mixed,
29
- // updatedAt: SchemaTypes.Mixed,
30
- // __v: SchemaTypes.Mixed
31
22
  };
32
23
  const schemaOptions = {
33
24
  autoIndex: settings_1.MONGO_AUTO_INDEX,
@@ -1,8 +1,29 @@
1
1
  import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
2
  import { IVirtuals } from '../virtuals';
3
3
  import { factory } from '../../../factory';
4
+ export type IMinimizedReservationFor = Pick<factory.acceptedOffer.IEventAsReservationFor, 'endDate' | 'id' | 'startDate' | 'typeOf'> & {
5
+ location: Pick<factory.acceptedOffer.IEventAsReservationFor['location'], 'branchCode' | 'typeOf'>;
6
+ superEvent: Pick<factory.acceptedOffer.ISuperEvent, 'id' | 'typeOf'> & {
7
+ location: Pick<factory.acceptedOffer.ISuperEvent['location'], 'branchCode' | 'typeOf'>;
8
+ workPerformed: Pick<factory.acceptedOffer.ISuperEvent['workPerformed'], 'identifier' | 'typeOf'>;
9
+ };
10
+ };
11
+ export type IMinimizedItemOffered = Pick<factory.acceptedOffer.IEventReservation, 'id' | 'reservationNumber' | 'typeOf'> & {
12
+ /**
13
+ * 予約番号ごとに、ひとつめのオファーのみreservationForを含むように変更するのでoptionalに
14
+ * 2026-06-04~
15
+ */
16
+ reservationFor?: IMinimizedReservationFor;
17
+ reservedTicket?: never;
18
+ };
19
+ export type IMinimizedAcceptedOffer = Pick<factory.acceptedOffer.IOptimizedAcceptedOffer, 'id' | 'offeredThrough' | 'serialNumber' | 'typeOf'> & {
20
+ itemOffered: IMinimizedItemOffered;
21
+ priceSpecification?: never;
22
+ name?: never;
23
+ };
24
+ export type IAcceptedOfferInDoc = IMinimizedAcceptedOffer | factory.acceptedOffer.ICOAAcceptedOffer;
4
25
  type IDocType = Omit<factory.order.IOrder, 'id'> & {
5
- acceptedOffers?: factory.order.IAcceptedOffer[];
26
+ acceptedOffers?: IAcceptedOfferInDoc[];
6
27
  /**
7
28
  * 注文取引IDとして再定義(2026-06-22~)
8
29
  */
@@ -1,7 +1,7 @@
1
1
  import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
2
  import { IVirtuals } from '../virtuals';
3
3
  import { factory } from '../../../factory';
4
- type IDocType = Omit<factory.serviceChannel.IServiceChannel, 'id'>;
4
+ type IDocType = Pick<factory.serviceChannel.IServiceChannel, 'credentials' | 'project' | 'providesService' | 'serviceUrl' | 'typeOf'>;
5
5
  type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
6
6
  type ISchemaDefinition = SchemaDefinition<IDocType>;
7
7
  type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
@@ -34,15 +34,6 @@ const schemaDefinition = {
34
34
  // ↓ルームの施設からの分離に伴い属性追加(2023-06-22~)
35
35
  openSeatingAllowed: mongoose_1.SchemaTypes.Mixed,
36
36
  amenityFeature: mongoose_1.SchemaTypes.Mixed
37
- // ↓migrated to civicStructures(2024-09-19~)
38
- // alternateName: SchemaTypes.Mixed,
39
- // hasEntranceGate: [SchemaTypes.Mixed],
40
- // hasPOS: [SchemaTypes.Mixed],
41
- // sameAs: String,
42
- // telephone: String,
43
- // url: String,
44
- // kanaName: String,
45
- // offers: SchemaTypes.Mixed,
46
37
  };
47
38
  const schemaOptions = {
48
39
  autoIndex: settings_1.MONGO_AUTO_INDEX,
@@ -1,9 +1,8 @@
1
1
  import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
2
  import { IVirtuals } from '../virtuals';
3
3
  import { factory } from '../../../factory';
4
- type IDocType = Omit<factory.project.IProject, 'id'> & {
4
+ type IDocType = Pick<factory.project.IProject, 'alternateName' | 'hasMerchantReturnPolicy' | 'logo' | 'name' | 'settings' | 'subscription' | 'typeOf'> & {
5
5
  _id: string;
6
- aggregateReservation?: any;
7
6
  makesOffer?: factory.project.IMakesOffer[];
8
7
  };
9
8
  type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
@@ -9,7 +9,7 @@ const modelName = 'Project';
9
9
  exports.modelName = modelName;
10
10
  const schemaDefinition = {
11
11
  _id: String,
12
- aggregateReservation: mongoose_1.SchemaTypes.Mixed,
12
+ // aggregateReservation: SchemaTypes.Mixed, // discontinue(2026-10-20~)
13
13
  alternateName: String,
14
14
  logo: String,
15
15
  hasMerchantReturnPolicy: mongoose_1.SchemaTypes.Mixed,
@@ -1,7 +1,9 @@
1
1
  import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
2
  import { IVirtuals } from '../virtuals';
3
3
  import { factory } from '../../../factory';
4
- type IDocType = Omit<factory.seller.ISeller, 'id'>;
4
+ type IDocType = Pick<factory.seller.ISeller, 'additionalProperty' | 'branchCode' | 'hasMerchantReturnPolicy' | 'makesOffer' | 'name' | 'project' | 'telephone' | 'typeOf' | 'url'> & {
5
+ paymentAccepted?: factory.seller.IPaymentAccepted[];
6
+ };
5
7
  type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
6
8
  type ISchemaDefinition = SchemaDefinition<IDocType>;
7
9
  type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
@@ -9,12 +9,10 @@ const modelName = 'Seller';
9
9
  exports.modelName = modelName;
10
10
  const schemaDefinition = {
11
11
  additionalProperty: [mongoose_1.SchemaTypes.Mixed],
12
- // areaServed: [SchemaTypes.Mixed],
13
12
  branchCode: String,
14
13
  hasMerchantReturnPolicy: [mongoose_1.SchemaTypes.Mixed],
15
14
  makesOffer: [mongoose_1.SchemaTypes.Mixed],
16
15
  name: mongoose_1.SchemaTypes.Mixed,
17
- // parentOrganization: SchemaTypes.Mixed,
18
16
  paymentAccepted: [mongoose_1.SchemaTypes.Mixed],
19
17
  project: mongoose_1.SchemaTypes.Mixed,
20
18
  typeOf: {
@@ -170,7 +170,6 @@ export declare class OfferCatalogRepo {
170
170
  }): Promise<void>;
171
171
  getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<factory.offerCatalog.IOfferCatalog, "id"> & {
172
172
  _id: string;
173
- alternateName?: any;
174
173
  dateSynced?: Date;
175
174
  } & Required<{
176
175
  _id: string;
@@ -178,7 +177,6 @@ export declare class OfferCatalogRepo {
178
177
  __v: number;
179
178
  }, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<factory.offerCatalog.IOfferCatalog, "id"> & {
180
179
  _id: string;
181
- alternateName?: any;
182
180
  dateSynced?: Date;
183
181
  } & Required<{
184
182
  _id: string;
@@ -1,6 +1,8 @@
1
1
  import { Connection, FilterQuery, mongo } from 'mongoose';
2
2
  import { factory } from '../factory';
3
- export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty' | 'relatedOffer'> & {
3
+ import { IDocType } from './mongoose/schemas/offerCatalogItem';
4
+ type IOfferCatalogItem = Pick<factory.offerCatalog.IOfferCatalog, 'description' | 'identifier' | 'itemListElement' | 'itemOffered' | 'name' | 'project' | 'relatedOffer' | 'typeOf' | 'id'>;
5
+ export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'relatedOffer'> & {
4
6
  numberOfItems?: number;
5
7
  itemListElementTypeOf: factory.offerType.Offer;
6
8
  };
@@ -11,25 +13,25 @@ type IKeyOfProjection = 'name' | 'description' | 'project' | 'typeOf' | 'id' | '
11
13
  export declare class OfferCatalogItemRepo {
12
14
  private readonly offerCatalogItemModel;
13
15
  constructor(connection: Connection);
14
- static CREATE_MONGO_CONDITIONS(params: factory.offerCatalog.ISearchConditions): any[];
15
- save(params: factory.offerCatalog.IOfferCatalog & {
16
- $unset?: any;
16
+ static CREATE_MONGO_CONDITIONS(params: factory.offerCatalog.ISearchConditions): FilterQuery<IDocType>[];
17
+ save(params: IOfferCatalogItem & {
18
+ $unset?: Partial<Record<keyof IDocType, 1>>;
17
19
  }): Promise<{
18
20
  id: string;
19
21
  }>;
20
22
  /**
21
23
  * プロジェクトとコードから冪等保管
22
24
  */
23
- saveByIdentifier(params: factory.offerCatalog.IOfferCatalog): Promise<{
25
+ saveByIdentifier(params: IOfferCatalogItem): Promise<{
24
26
  id: string;
25
27
  }>;
26
28
  /**
27
29
  * コードをキーにして冪等置換(2023-12-14~)
28
30
  */
29
31
  upsertManyByIdentifier(params: {
30
- $set: factory.offerCatalog.IOfferCatalog;
32
+ $set: IOfferCatalogItem;
31
33
  $unset?: {
32
- [key in keyof factory.offerCatalog.IOfferCatalog]?: 1;
34
+ [key in keyof IDocType]?: 1;
33
35
  };
34
36
  }[], options: {
35
37
  /**
@@ -73,8 +75,8 @@ export declare class OfferCatalogItemRepo {
73
75
  };
74
76
  };
75
77
  }): Promise<void>;
76
- count(params: Omit<factory.offerCatalog.ISearchConditions, 'limit' | 'page' | 'sort'>): Promise<number>;
77
- projectFields(params: factory.offerCatalog.ISearchConditions, inclusion: IKeyOfProjection[]): Promise<IAggregatedOfferCatalog[]>;
78
+ countOfferCatalogItems(params: Omit<factory.offerCatalog.ISearchConditions, 'limit' | 'page' | 'sort'>): Promise<number>;
79
+ findOfferCatalogItems(params: factory.offerCatalog.ISearchConditions, inclusion: IKeyOfProjection[]): Promise<IAggregatedOfferCatalog[]>;
78
80
  findItemListElementById(params: {
79
81
  id: string;
80
82
  project: {
@@ -118,17 +120,8 @@ export declare class OfferCatalogItemRepo {
118
120
  };
119
121
  }): Promise<import("mongoose").UpdateWriteOpResult | undefined>;
120
122
  unsetUnnecessaryFields(params: {
121
- filter: FilterQuery<factory.offerCatalog.IOfferCatalog>;
122
- $unset: any;
123
+ filter: FilterQuery<IDocType>;
124
+ $unset: Partial<Record<keyof IDocType, 1>>;
123
125
  }): Promise<import("mongoose").UpdateWriteOpResult>;
124
- aggregateItemList(params: {
125
- itemListElement: {
126
- typeOf: {
127
- $eq: factory.offerType.Offer | 'OfferCatalog';
128
- };
129
- };
130
- }): Promise<{
131
- aggregation: any;
132
- }>;
133
126
  }
134
127
  export {};