@chevre/domain 22.2.0-alpha.21 → 22.2.0-alpha.23

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 (169) hide show
  1. package/example/src/chevre/createProject.ts +19 -0
  2. package/example/src/chevre/migrateDeleteTransactionTasks.ts +1 -1
  3. package/example/src/chevre/projectFields.ts +6 -7
  4. package/example/src/chevre/{projectEventFieldsById.ts → projectFieldsById.ts} +6 -11
  5. package/example/src/chevre/searchTransactions.ts +1 -1
  6. package/example/src/chevre/unsetUnnecessaryFields.ts +2 -15
  7. package/lib/chevre/repo/accountTitle.d.ts +9 -3
  8. package/lib/chevre/repo/accountingReport.d.ts +2 -15
  9. package/lib/chevre/repo/action.d.ts +55 -3
  10. package/lib/chevre/repo/aggregateReservation.d.ts +1 -14
  11. package/lib/chevre/repo/assetTransaction.d.ts +134 -7
  12. package/lib/chevre/repo/assetTransaction.js +2 -2
  13. package/lib/chevre/repo/categoryCode.d.ts +4 -0
  14. package/lib/chevre/repo/categoryCode.js +6 -0
  15. package/lib/chevre/repo/comment.d.ts +5 -1
  16. package/lib/chevre/repo/creativeWork.d.ts +14 -2
  17. package/lib/chevre/repo/customer.d.ts +5 -1
  18. package/lib/chevre/repo/customerType.d.ts +1 -1
  19. package/lib/chevre/repo/event.d.ts +49 -2
  20. package/lib/chevre/repo/member.d.ts +5 -1
  21. package/lib/chevre/repo/merchantReturnPolicy.d.ts +22 -2
  22. package/lib/chevre/repo/message.d.ts +1 -15
  23. package/lib/chevre/repo/mongoose/schemas/account.d.ts +8 -3
  24. package/lib/chevre/repo/mongoose/schemas/account.js +1 -1
  25. package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +8 -3
  26. package/lib/chevre/repo/mongoose/schemas/accountTitle.js +2 -2
  27. package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +8 -3
  28. package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +1 -1
  29. package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +22 -3
  30. package/lib/chevre/repo/mongoose/schemas/accountingReport.js +1 -1
  31. package/lib/chevre/repo/mongoose/schemas/action.d.ts +12 -3
  32. package/lib/chevre/repo/mongoose/schemas/action.js +1 -1
  33. package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +14 -3
  34. package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +2 -5
  35. package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +8 -3
  36. package/lib/chevre/repo/mongoose/schemas/additionalProperty.js +12 -12
  37. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.d.ts +11 -3
  38. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +1 -1
  39. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.d.ts +22 -3
  40. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +1 -1
  41. package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +7 -3
  42. package/lib/chevre/repo/mongoose/schemas/aggregation.js +2 -1
  43. package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +10 -3
  44. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +1 -1
  45. package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +8 -3
  46. package/lib/chevre/repo/mongoose/schemas/authorization.js +1 -1
  47. package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +8 -3
  48. package/lib/chevre/repo/mongoose/schemas/categoryCode.js +1 -1
  49. package/lib/chevre/repo/mongoose/schemas/comments.d.ts +8 -3
  50. package/lib/chevre/repo/mongoose/schemas/comments.js +1 -1
  51. package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +10 -3
  52. package/lib/chevre/repo/mongoose/schemas/creativeWork.js +2 -2
  53. package/lib/chevre/repo/mongoose/schemas/customer.d.ts +8 -3
  54. package/lib/chevre/repo/mongoose/schemas/customer.js +1 -1
  55. package/lib/chevre/repo/mongoose/schemas/customerType.d.ts +9 -3
  56. package/lib/chevre/repo/mongoose/schemas/customerType.js +1 -1
  57. package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +8 -3
  58. package/lib/chevre/repo/mongoose/schemas/emailMessages.js +1 -1
  59. package/lib/chevre/repo/mongoose/schemas/event.d.ts +19 -3
  60. package/lib/chevre/repo/mongoose/schemas/event.js +1 -1
  61. package/lib/chevre/repo/mongoose/schemas/member.d.ts +8 -3
  62. package/lib/chevre/repo/mongoose/schemas/member.js +1 -1
  63. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +8 -3
  64. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.js +1 -1
  65. package/lib/chevre/repo/mongoose/schemas/message.d.ts +23 -3
  66. package/lib/chevre/repo/mongoose/schemas/message.js +1 -1
  67. package/lib/chevre/repo/mongoose/schemas/note.d.ts +8 -3
  68. package/lib/chevre/repo/mongoose/schemas/note.js +1 -1
  69. package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +12 -3
  70. package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +1 -1
  71. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.d.ts +12 -3
  72. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +1 -1
  73. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +8 -3
  74. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +1 -1
  75. package/lib/chevre/repo/mongoose/schemas/order.d.ts +10 -3
  76. package/lib/chevre/repo/mongoose/schemas/order.js +1 -1
  77. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +10 -3
  78. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +1 -1
  79. package/lib/chevre/repo/mongoose/schemas/paymentService.d.ts +10 -3
  80. package/lib/chevre/repo/mongoose/schemas/paymentService.js +1 -1
  81. package/lib/chevre/repo/mongoose/schemas/place.d.ts +16 -3
  82. package/lib/chevre/repo/mongoose/schemas/place.js +1 -1
  83. package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +11 -3
  84. package/lib/chevre/repo/mongoose/schemas/priceSpecification.js +1 -1
  85. package/lib/chevre/repo/mongoose/schemas/product.d.ts +12 -3
  86. package/lib/chevre/repo/mongoose/schemas/product.js +1 -1
  87. package/lib/chevre/repo/mongoose/schemas/productModel.d.ts +30 -3
  88. package/lib/chevre/repo/mongoose/schemas/productModel.js +1 -1
  89. package/lib/chevre/repo/mongoose/schemas/project.d.ts +12 -3
  90. package/lib/chevre/repo/mongoose/schemas/project.js +3 -3
  91. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +12 -3
  92. package/lib/chevre/repo/mongoose/schemas/reservation.js +5 -5
  93. package/lib/chevre/repo/mongoose/schemas/role.d.ts +9 -3
  94. package/lib/chevre/repo/mongoose/schemas/role.js +1 -1
  95. package/lib/chevre/repo/mongoose/schemas/seller.d.ts +8 -3
  96. package/lib/chevre/repo/mongoose/schemas/seller.js +1 -1
  97. package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +8 -3
  98. package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +1 -1
  99. package/lib/chevre/repo/mongoose/schemas/task.d.ts +8 -3
  100. package/lib/chevre/repo/mongoose/schemas/task.js +1 -1
  101. package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +7 -3
  102. package/lib/chevre/repo/mongoose/schemas/telemetry.js +2 -1
  103. package/lib/chevre/repo/mongoose/schemas/ticket.d.ts +26 -3
  104. package/lib/chevre/repo/mongoose/schemas/ticket.js +1 -1
  105. package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +8 -3
  106. package/lib/chevre/repo/mongoose/schemas/transaction.js +2 -2
  107. package/lib/chevre/repo/mongoose/schemas/trip.d.ts +8 -3
  108. package/lib/chevre/repo/mongoose/schemas/trip.js +3 -3
  109. package/lib/chevre/repo/offer.d.ts +13 -4
  110. package/lib/chevre/repo/offerCatalog.d.ts +15 -2
  111. package/lib/chevre/repo/order.d.ts +13 -1
  112. package/lib/chevre/repo/ownershipInfo.d.ts +13 -1
  113. package/lib/chevre/repo/place/movieTheater.d.ts +54 -2
  114. package/lib/chevre/repo/priceSpecification.d.ts +42 -1
  115. package/lib/chevre/repo/product.d.ts +6 -1
  116. package/lib/chevre/repo/productModel.d.ts +1 -22
  117. package/lib/chevre/repo/project.d.ts +21 -1
  118. package/lib/chevre/repo/project.js +2 -2
  119. package/lib/chevre/repo/reservation.d.ts +35 -3
  120. package/lib/chevre/repo/reservation.js +1 -1
  121. package/lib/chevre/repo/role.d.ts +2 -9
  122. package/lib/chevre/repo/role.js +20 -10
  123. package/lib/chevre/repo/seller.d.ts +54 -2
  124. package/lib/chevre/repo/task.d.ts +64 -3
  125. package/lib/chevre/repo/telemetry.d.ts +3 -2
  126. package/lib/chevre/repo/ticket.d.ts +2 -19
  127. package/lib/chevre/repo/transaction.d.ts +30 -14
  128. package/lib/chevre/repo/transaction.js +106 -77
  129. package/lib/chevre/service/assetTransaction/cancelReservation.d.ts +1 -1
  130. package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -3
  131. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +3 -2
  132. package/lib/chevre/service/offer/event/authorize.d.ts +1 -1
  133. package/lib/chevre/service/offer/event/authorize.js +1 -1
  134. package/lib/chevre/service/offer/event/voidTransaction.js +2 -2
  135. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -1
  136. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.d.ts +2 -2
  137. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/factory.d.ts +3 -3
  138. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +2 -2
  139. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +4 -2
  140. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +1 -1
  141. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
  142. package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +8 -5
  143. package/lib/chevre/service/offer/eventServiceByCOA/validateAcceptedOffers.d.ts +1 -1
  144. package/lib/chevre/service/offer/moneyTransfer/authorize.js +1 -1
  145. package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +1 -1
  146. package/lib/chevre/service/offer/product.js +2 -2
  147. package/lib/chevre/service/order/findPlaceOrderTransaction.js +1 -1
  148. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
  149. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
  150. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
  151. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
  152. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +1 -1
  153. package/lib/chevre/service/order/returnOrder.js +1 -1
  154. package/lib/chevre/service/payment/any.js +5 -5
  155. package/lib/chevre/service/payment.d.ts +1 -1
  156. package/lib/chevre/service/report/telemetry.js +2 -2
  157. package/lib/chevre/service/task/onResourceUpdated.js +14 -2
  158. package/lib/chevre/service/task/returnPayTransaction.js +1 -1
  159. package/lib/chevre/service/transaction/deleteTransaction.js +2 -2
  160. package/lib/chevre/service/transaction/moneyTransfer.js +3 -3
  161. package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -1
  162. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
  163. package/lib/chevre/service/transaction/placeOrder/start.js +1 -1
  164. package/lib/chevre/service/transaction/returnOrder.js +2 -2
  165. package/lib/chevre/service/transaction.js +1 -1
  166. package/package.json +3 -3
  167. package/example/src/chevre/findTransactionById.ts +0 -23
  168. package/example/src/chevre/findTransactionInProgressById.ts +0 -23
  169. package/example/src/chevre/migrateTransactionObjectPaymentMethods.ts +0 -154
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchema = exports.indexes = exports.modelName = void 0;
3
+ exports.modelName = exports.indexes = exports.createSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const writeConcern_1 = require("../writeConcern");
6
6
  const settings_1 = require("../../../settings");
@@ -1,5 +1,10 @@
1
- import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ import * as factory from '../../../factory';
3
+ type IDocType = factory.permit.IPermit;
4
+ type IModel = Model<IDocType>;
5
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
6
+ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
2
7
  declare const modelName = "ServiceOutput";
3
- declare function createSchema(): Schema;
8
+ declare function createSchema(): ISchema;
4
9
  declare const indexes: [d: IndexDefinition, o: IndexOptions][];
5
- export { modelName, indexes, createSchema };
10
+ export { createSchema, IModel, indexes, modelName };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchema = exports.indexes = exports.modelName = void 0;
3
+ exports.modelName = exports.indexes = exports.createSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const writeConcern_1 = require("../writeConcern");
6
6
  const settings_1 = require("../../../settings");
@@ -1,5 +1,10 @@
1
- import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ import * as factory from '../../../factory';
3
+ type IDocType = Omit<factory.task.ITask<factory.taskName>, 'id'>;
4
+ type IModel = Model<IDocType>;
5
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
6
+ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
2
7
  declare const modelName = "Task";
3
8
  declare const indexes: [d: IndexDefinition, o: IndexOptions][];
4
- declare function createSchema(): Schema;
5
- export { modelName, indexes, createSchema };
9
+ declare function createSchema(): ISchema;
10
+ export { createSchema, IModel, indexes, modelName };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchema = exports.indexes = exports.modelName = void 0;
3
+ exports.modelName = exports.indexes = exports.createSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const writeConcern_1 = require("../writeConcern");
6
6
  const settings_1 = require("../../../settings");
@@ -1,5 +1,9 @@
1
- import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ type IDocType = any;
3
+ type IModel = Model<IDocType>;
4
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
5
+ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
2
6
  declare const modelName = "Telemetry";
3
- declare function createSchema(): Schema;
7
+ declare function createSchema(): ISchema;
4
8
  declare const indexes: [d: IndexDefinition, o: IndexOptions][];
5
- export { modelName, indexes, createSchema };
9
+ export { createSchema, IModel, indexes, modelName };
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchema = exports.indexes = exports.modelName = void 0;
3
+ exports.modelName = exports.indexes = exports.createSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const writeConcern_1 = require("../writeConcern");
6
+ // import * as factory from '../../../factory';
6
7
  const settings_1 = require("../../../settings");
7
8
  const modelName = 'Telemetry';
8
9
  exports.modelName = modelName;
@@ -1,5 +1,28 @@
1
- import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ import * as factory from '../../../factory';
3
+ export interface ITicketIssuedBy {
4
+ id: string;
5
+ typeOf: factory.organizationType.Corporation | factory.organizationType.Project;
6
+ }
7
+ export interface ITicket {
8
+ /**
9
+ * チケットID(jti)
10
+ */
11
+ id: string;
12
+ project: {
13
+ id: string;
14
+ typeOf: factory.organizationType.Project;
15
+ };
16
+ typeOf: 'Ticket';
17
+ ticketToken: string;
18
+ dateIssued: Date;
19
+ issuedBy: ITicketIssuedBy;
20
+ }
21
+ type IDocType = Omit<ITicket, 'id'>;
22
+ type IModel = Model<IDocType>;
23
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
24
+ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
2
25
  declare const modelName = "Ticket";
3
26
  declare const indexes: [d: IndexDefinition, o: IndexOptions][];
4
- declare function createSchema(): Schema;
5
- export { modelName, indexes, createSchema };
27
+ declare function createSchema(): ISchema;
28
+ export { createSchema, IModel, indexes, modelName };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchema = exports.indexes = exports.modelName = void 0;
3
+ exports.modelName = exports.indexes = exports.createSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const writeConcern_1 = require("../writeConcern");
6
6
  const settings_1 = require("../../../settings");
@@ -1,5 +1,10 @@
1
- import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ import * as factory from '../../../factory';
3
+ type IDocType = factory.transaction.ITransaction<factory.transactionType>;
4
+ type IModel = Model<IDocType>;
5
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
6
+ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
2
7
  declare const modelName = "Transaction";
3
8
  declare const indexes: [d: IndexDefinition, o: IndexOptions][];
4
- declare function createSchema(): Schema;
5
- export { modelName, indexes, createSchema };
9
+ declare function createSchema(): ISchema;
10
+ export { createSchema, IModel, indexes, modelName };
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchema = exports.indexes = exports.modelName = void 0;
3
+ exports.modelName = exports.indexes = exports.createSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
- const factory = require("../../../factory");
6
5
  const writeConcern_1 = require("../writeConcern");
6
+ const factory = require("../../../factory");
7
7
  const settings_1 = require("../../../settings");
8
8
  const modelName = 'Transaction';
9
9
  exports.modelName = modelName;
@@ -1,5 +1,10 @@
1
- import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ import * as factory from '../../../factory';
3
+ type IDocType = Omit<factory.trip.ITrip<factory.tripType>, 'id'>;
4
+ type IModel = Model<IDocType>;
5
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
6
+ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
2
7
  declare const modelName = "Trip";
3
- declare function createSchema(): Schema;
4
8
  declare const indexes: [d: IndexDefinition, o: IndexOptions][];
5
- export { modelName, indexes, createSchema };
9
+ declare function createSchema(): ISchema;
10
+ export { createSchema, IModel, indexes, modelName };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchema = exports.indexes = exports.modelName = void 0;
3
+ exports.modelName = exports.indexes = exports.createSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const writeConcern_1 = require("../writeConcern");
6
6
  const settings_1 = require("../../../settings");
@@ -39,6 +39,8 @@ const schemaOptions = {
39
39
  versionKey: false
40
40
  }
41
41
  };
42
+ const indexes = [];
43
+ exports.indexes = indexes;
42
44
  /**
43
45
  * トリップスキーマ
44
46
  */
@@ -50,5 +52,3 @@ function createSchema() {
50
52
  return schema;
51
53
  }
52
54
  exports.createSchema = createSchema;
53
- const indexes = [];
54
- exports.indexes = indexes;
@@ -23,8 +23,9 @@
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import type { BulkWriteResult } from 'mongodb';
26
- import { AnyExpression, Connection, PipelineStage } from 'mongoose';
26
+ import { AnyExpression, Connection, Document, PipelineStage } from 'mongoose';
27
27
  import * as factory from '../factory';
28
+ import { IDocType as IAggregateOfferDocType } from './mongoose/schemas/aggregateOffer';
28
29
  type IMatchStage = PipelineStage.Match;
29
30
  type KeyOfUnitPriceOffer = keyof Omit<factory.unitPriceOffer.IUnitPriceOffer, 'id'>;
30
31
  type IProjection = {
@@ -216,7 +217,11 @@ export declare class OfferRepo {
216
217
  };
217
218
  };
218
219
  }): Promise<import("mongodb").UpdateResult | undefined>;
219
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
220
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<Document<unknown, {}, IAggregateOfferDocType> & Omit<IAggregateOfferDocType & Required<{
221
+ _id: string;
222
+ }>, never>, import("mongoose").QueryOptions<Document<unknown, {}, IAggregateOfferDocType> & Omit<IAggregateOfferDocType & Required<{
223
+ _id: string;
224
+ }>, never>>>;
220
225
  addAvailableAtOrFrom(params: {
221
226
  id: string;
222
227
  identifier: string;
@@ -225,7 +230,9 @@ export declare class OfferRepo {
225
230
  id: string;
226
231
  };
227
232
  };
228
- }): Promise<any>;
233
+ }): Promise<(Document<unknown, {}, IAggregateOfferDocType> & Omit<IAggregateOfferDocType & Required<{
234
+ _id: string;
235
+ }>, never>) | null>;
229
236
  deleteAvailableAtOrFrom(params: {
230
237
  id: string;
231
238
  offers: {
@@ -233,7 +240,9 @@ export declare class OfferRepo {
233
240
  id: string;
234
241
  };
235
242
  };
236
- }): Promise<any>;
243
+ }): Promise<(Document<unknown, {}, IAggregateOfferDocType> & Omit<IAggregateOfferDocType & Required<{
244
+ _id: string;
245
+ }>, never>) | null>;
237
246
  /**
238
247
  * サブカタログから集計オファーIDリストを検索する
239
248
  */
@@ -23,8 +23,9 @@
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import type { BulkWriteResult } from 'mongodb';
26
- import type { Connection } from 'mongoose';
26
+ import type { Connection, Document } from 'mongoose';
27
27
  import * as factory from '../factory';
28
+ import { IDocType } from './mongoose/schemas/offerCatalog';
28
29
  export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty'> & {
29
30
  numberOfItems?: number;
30
31
  itemListElementTypeOf: factory.offerType.Offer | 'OfferCatalog';
@@ -136,5 +137,17 @@ export declare class OfferCatalogRepo {
136
137
  id: string;
137
138
  };
138
139
  }): Promise<void>;
139
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
140
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<Document<unknown, {}, IDocType> & Omit<factory.offerCatalog.IOfferCatalog & {
141
+ _id: string;
142
+ alternateName?: any;
143
+ dateSynced?: Date | undefined;
144
+ } & Required<{
145
+ _id: string;
146
+ }>, never>, import("mongoose").QueryOptions<Document<unknown, {}, IDocType> & Omit<factory.offerCatalog.IOfferCatalog & {
147
+ _id: string;
148
+ alternateName?: any;
149
+ dateSynced?: Date | undefined;
150
+ } & Required<{
151
+ _id: string;
152
+ }>, never>>>;
140
153
  }
@@ -160,7 +160,19 @@ export declare class OrderRepo {
160
160
  }): Promise<(IOrderWithoutAcceptedOffers & {
161
161
  id: string;
162
162
  })[]>;
163
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
163
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, Omit<factory.order.IOrder, "id"> & {
164
+ acceptedOffers?: factory.order.IAcceptedOffer<factory.order.IItemOffered>[] | undefined;
165
+ }> & Omit<Omit<factory.order.IOrder, "id"> & {
166
+ acceptedOffers?: factory.order.IAcceptedOffer<factory.order.IItemOffered>[] | undefined;
167
+ } & {
168
+ _id: import("mongoose").Types.ObjectId;
169
+ }, never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, Omit<factory.order.IOrder, "id"> & {
170
+ acceptedOffers?: factory.order.IAcceptedOffer<factory.order.IItemOffered>[] | undefined;
171
+ }> & Omit<Omit<factory.order.IOrder, "id"> & {
172
+ acceptedOffers?: factory.order.IAcceptedOffer<factory.order.IItemOffered>[] | undefined;
173
+ } & {
174
+ _id: import("mongoose").Types.ObjectId;
175
+ }, never>>>;
164
176
  unsetUnnecessaryFields(params: {
165
177
  filter: FilterQuery<factory.order.IOrder>;
166
178
  $unset: any;
@@ -97,7 +97,19 @@ export declare class OwnershipInfoRepo {
97
97
  $lt: Date;
98
98
  };
99
99
  }): Promise<void>;
100
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
100
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
101
+ _id: string;
102
+ }> & Omit<factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
103
+ _id: string;
104
+ } & Required<{
105
+ _id: string;
106
+ }>, never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
107
+ _id: string;
108
+ }> & Omit<factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
109
+ _id: string;
110
+ } & Required<{
111
+ _id: string;
112
+ }>, never>>>;
101
113
  /**
102
114
  * 所有者を追加する
103
115
  */
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import type { Connection, FilterQuery } from 'mongoose';
25
+ import type { Connection, Document, FilterQuery } from 'mongoose';
26
26
  import * as factory from '../../factory';
27
27
  export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
28
28
  export type IMovieTheaterIncludingScreeningRooms = factory.place.movieTheater.IPlace & {
@@ -73,6 +73,58 @@ export declare class MovieTheaterRepo {
73
73
  id: string;
74
74
  };
75
75
  }): Promise<void>;
76
- getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
76
+ getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<Document<unknown, {}, ((import("@chevre/factory/lib/place/movieTheater").IPlace & {
77
+ hasPOS?: import("@chevre/factory/lib/place/movieTheater").IPOS[] | undefined;
78
+ }) | import("@chevre/factory/lib/place/screeningRoom").IPlace) & {
79
+ alternateName?: any;
80
+ description?: any;
81
+ openingHoursSpecification?: any;
82
+ smokingAllowed?: boolean | undefined;
83
+ sameAs?: any;
84
+ }> & Omit<(import("@chevre/factory/lib/place/movieTheater").IPlace & {
85
+ hasPOS?: import("@chevre/factory/lib/place/movieTheater").IPOS[] | undefined;
86
+ } & {
87
+ alternateName?: any;
88
+ description?: any;
89
+ openingHoursSpecification?: any;
90
+ smokingAllowed?: boolean | undefined;
91
+ sameAs?: any;
92
+ } & {
93
+ _id: import("mongoose").Types.ObjectId;
94
+ }) | (import("@chevre/factory/lib/place/screeningRoom").IPlace & {
95
+ alternateName?: any;
96
+ description?: any;
97
+ openingHoursSpecification?: any;
98
+ smokingAllowed?: boolean | undefined;
99
+ sameAs?: any;
100
+ } & {
101
+ _id: import("mongoose").Types.ObjectId;
102
+ }), never>, import("mongoose").QueryOptions<Document<unknown, {}, ((import("@chevre/factory/lib/place/movieTheater").IPlace & {
103
+ hasPOS?: import("@chevre/factory/lib/place/movieTheater").IPOS[] | undefined;
104
+ }) | import("@chevre/factory/lib/place/screeningRoom").IPlace) & {
105
+ alternateName?: any;
106
+ description?: any;
107
+ openingHoursSpecification?: any;
108
+ smokingAllowed?: boolean | undefined;
109
+ sameAs?: any;
110
+ }> & Omit<(import("@chevre/factory/lib/place/movieTheater").IPlace & {
111
+ hasPOS?: import("@chevre/factory/lib/place/movieTheater").IPOS[] | undefined;
112
+ } & {
113
+ alternateName?: any;
114
+ description?: any;
115
+ openingHoursSpecification?: any;
116
+ smokingAllowed?: boolean | undefined;
117
+ sameAs?: any;
118
+ } & {
119
+ _id: import("mongoose").Types.ObjectId;
120
+ }) | (import("@chevre/factory/lib/place/screeningRoom").IPlace & {
121
+ alternateName?: any;
122
+ description?: any;
123
+ openingHoursSpecification?: any;
124
+ smokingAllowed?: boolean | undefined;
125
+ sameAs?: any;
126
+ } & {
127
+ _id: import("mongoose").Types.ObjectId;
128
+ }), never>>>;
77
129
  }
78
130
  export {};
@@ -24,6 +24,7 @@
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
+ import { IDocType } from './mongoose/schemas/priceSpecification';
27
28
  /**
28
29
  * 価格仕様リポジトリ
29
30
  */
@@ -54,7 +55,47 @@ export declare class PriceSpecificationRepo {
54
55
  id: string;
55
56
  };
56
57
  }): Promise<void>;
57
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
58
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, IDocType> & Omit<(import("@chevre/factory/lib/priceSpecification/categoryCodeChargeSpecification").IPriceSpecification & {
59
+ validFrom?: Date | undefined;
60
+ validThrough?: Date | undefined;
61
+ } & {
62
+ _id: import("mongoose").Types.ObjectId;
63
+ }) | (import("@chevre/factory/lib/priceSpecification/movieTicketTypeChargeSpecification").IPriceSpecification & {
64
+ validFrom?: Date | undefined;
65
+ validThrough?: Date | undefined;
66
+ } & {
67
+ _id: import("mongoose").Types.ObjectId;
68
+ }) | (import("@chevre/factory/lib/priceSpecification/unitPriceSpecification").IPriceSpecification & {
69
+ validFrom?: Date | undefined;
70
+ validThrough?: Date | undefined;
71
+ } & {
72
+ _id: import("mongoose").Types.ObjectId;
73
+ }) | (import("@chevre/factory/lib/priceSpecification").IPriceSpecification<factory.priceSpecificationType> & {
74
+ validFrom?: Date | undefined;
75
+ validThrough?: Date | undefined;
76
+ } & {
77
+ _id: import("mongoose").Types.ObjectId;
78
+ }), never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, IDocType> & Omit<(import("@chevre/factory/lib/priceSpecification/categoryCodeChargeSpecification").IPriceSpecification & {
79
+ validFrom?: Date | undefined;
80
+ validThrough?: Date | undefined;
81
+ } & {
82
+ _id: import("mongoose").Types.ObjectId;
83
+ }) | (import("@chevre/factory/lib/priceSpecification/movieTicketTypeChargeSpecification").IPriceSpecification & {
84
+ validFrom?: Date | undefined;
85
+ validThrough?: Date | undefined;
86
+ } & {
87
+ _id: import("mongoose").Types.ObjectId;
88
+ }) | (import("@chevre/factory/lib/priceSpecification/unitPriceSpecification").IPriceSpecification & {
89
+ validFrom?: Date | undefined;
90
+ validThrough?: Date | undefined;
91
+ } & {
92
+ _id: import("mongoose").Types.ObjectId;
93
+ }) | (import("@chevre/factory/lib/priceSpecification").IPriceSpecification<factory.priceSpecificationType> & {
94
+ validFrom?: Date | undefined;
95
+ validThrough?: Date | undefined;
96
+ } & {
97
+ _id: import("mongoose").Types.ObjectId;
98
+ }), never>>>;
58
99
  reIndex(): Promise<import("bson").Document>;
59
100
  unsetUnnecessaryFields(params: {
60
101
  filter: any;
@@ -24,6 +24,7 @@
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import type { BulkWriteResult } from 'mongodb';
26
26
  import type { Connection, FilterQuery } from 'mongoose';
27
+ import { IDocTypeAsProduct } from './mongoose/schemas/product';
27
28
  import * as factory from '../factory';
28
29
  type IKeyOfProjection = keyof factory.product.IProduct;
29
30
  /**
@@ -110,7 +111,11 @@ export declare class ProductRepo {
110
111
  id: string;
111
112
  };
112
113
  }): Promise<void>;
113
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
114
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, IDocTypeAsProduct & import("./mongoose/schemas/product").IDocTypeAsProductOffer> & Omit<IDocTypeAsProduct & import("./mongoose/schemas/product").IDocTypeAsProductOffer & {
115
+ _id: import("mongoose").Types.ObjectId;
116
+ }, never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, IDocTypeAsProduct & import("./mongoose/schemas/product").IDocTypeAsProductOffer> & Omit<IDocTypeAsProduct & import("./mongoose/schemas/product").IDocTypeAsProductOffer & {
117
+ _id: import("mongoose").Types.ObjectId;
118
+ }, never>>>;
114
119
  unsetUnnecessaryFields(params: {
115
120
  filter: FilterQuery<factory.product.IProduct>;
116
121
  $unset: any;
@@ -1,27 +1,6 @@
1
1
  import type { Connection, FilterQuery } from 'mongoose';
2
2
  import * as factory from '../factory';
3
- interface IProductModel {
4
- id?: string;
5
- project: {
6
- id: string;
7
- typeOf: factory.organizationType.Project;
8
- };
9
- typeOf: 'ProductModel';
10
- category: Pick<factory.categoryCode.ICategoryCode, 'codeValue' | 'inCodeSet'> & {
11
- /**
12
- * 区分ID
13
- * 削除時同期に必要
14
- */
15
- id: string;
16
- };
17
- name: factory.multilingualString;
18
- offers: {
19
- typeOf: factory.offerType.Offer;
20
- eligibleCustomerType?: {
21
- codeValue: string;
22
- }[];
23
- }[];
24
- }
3
+ import { IProductModel } from './mongoose/schemas/productModel';
25
4
  type IKeyOfProjection = keyof IProductModel | '_id';
26
5
  type ISearchConditions = Pick<factory.product.ISearchConditions, 'id' | 'limit' | 'page' | 'project'> & {
27
6
  category?: {
@@ -68,7 +68,27 @@ export declare class ProjectRepo {
68
68
  deleteById(params: {
69
69
  id: string;
70
70
  }): Promise<void>;
71
- getCursor(conditions: FilterQuery<factory.project.IProject>, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
71
+ getCursor(conditions: FilterQuery<factory.project.IProject>, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, Omit<factory.project.IProject, "id"> & {
72
+ _id: string;
73
+ aggregateReservation?: any;
74
+ makesOffer?: factory.project.IMakesOffer[] | undefined;
75
+ }> & Omit<Omit<factory.project.IProject, "id"> & {
76
+ _id: string;
77
+ aggregateReservation?: any;
78
+ makesOffer?: factory.project.IMakesOffer[] | undefined;
79
+ } & Required<{
80
+ _id: string;
81
+ }>, never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, Omit<factory.project.IProject, "id"> & {
82
+ _id: string;
83
+ aggregateReservation?: any;
84
+ makesOffer?: factory.project.IMakesOffer[] | undefined;
85
+ }> & Omit<Omit<factory.project.IProject, "id"> & {
86
+ _id: string;
87
+ aggregateReservation?: any;
88
+ makesOffer?: factory.project.IMakesOffer[] | undefined;
89
+ } & Required<{
90
+ _id: string;
91
+ }>, never>>>;
72
92
  unsetUnnecessaryFields(params: {
73
93
  filter: any;
74
94
  $unset: any;
@@ -139,7 +139,7 @@ class ProjectRepo {
139
139
  });
140
140
  }
141
141
  createById(params) {
142
- var _a, _b;
142
+ var _a;
143
143
  return __awaiter(this, void 0, void 0, function* () {
144
144
  // return this.projectModel.create({ ...params, _id: params.id })
145
145
  // .then((doc) => doc.toObject());
@@ -148,7 +148,7 @@ class ProjectRepo {
148
148
  throw new factory.errors.ArgumentNull('id');
149
149
  }
150
150
  const result = yield this.projectModel.insertMany(Object.assign(Object.assign({}, createParams), { typeOf: factory.organizationType.Project, _id: id }), { rawResult: true });
151
- const insertedId = (_b = (_a = result.insertedIds) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.toHexString();
151
+ const insertedId = (_a = result.insertedIds) === null || _a === void 0 ? void 0 : _a[0];
152
152
  if (typeof insertedId !== 'string') {
153
153
  throw new factory.errors.Internal(`project not saved unexpectedly. result:${JSON.stringify(result)}`);
154
154
  }
@@ -29,9 +29,9 @@ export interface IUpdatePartiallyParams {
29
29
  additionalTicketText?: string;
30
30
  }
31
31
  export type ICancelResult = UpdateWriteOpResult;
32
- export type ICreatingReservation<T extends factory.reservationType> = T extends factory.reservationType.BusReservation ? (factory.reservation.busReservation.IReservation) & {
32
+ export type ICreatingReservation<T extends factory.reservationType> = T extends factory.reservationType.BusReservation ? (Omit<factory.reservation.busReservation.IReservation, 'id'>) & {
33
33
  _id: string;
34
- } : T extends factory.reservationType.EventReservation ? (factory.reservation.eventReservation.IReservation) & {
34
+ } : T extends factory.reservationType.EventReservation ? (Omit<factory.reservation.eventReservation.IReservation, 'id'>) & {
35
35
  _id: string;
36
36
  } : never;
37
37
  type IKeyOfProjection = keyof factory.reservation.IReservation<factory.reservationType.BusReservation | factory.reservationType.EventReservation> | 'reservedTicket.dateUsed' | 'reservationFor.id' | 'reservationFor.typeOf';
@@ -151,7 +151,39 @@ export declare class ReservationRepo {
151
151
  $in: string[];
152
152
  };
153
153
  }): Promise<string[]>;
154
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
154
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, (Omit<import("@chevre/factory/lib/reservation/busReservation").IReservation, "id"> | Omit<import("@chevre/factory/lib/reservation/event").IReservation, "id">) & {
155
+ _id: string;
156
+ bookingAgent?: any;
157
+ previousReservationStatus?: factory.reservationStatusType | undefined;
158
+ }> & Omit<(Omit<import("@chevre/factory/lib/reservation/busReservation").IReservation, "id"> & {
159
+ _id: string;
160
+ bookingAgent?: any;
161
+ previousReservationStatus?: factory.reservationStatusType | undefined;
162
+ } & Required<{
163
+ _id: string;
164
+ }>) | (Omit<import("@chevre/factory/lib/reservation/event").IReservation, "id"> & {
165
+ _id: string;
166
+ bookingAgent?: any;
167
+ previousReservationStatus?: factory.reservationStatusType | undefined;
168
+ } & Required<{
169
+ _id: string;
170
+ }>), never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, (Omit<import("@chevre/factory/lib/reservation/busReservation").IReservation, "id"> | Omit<import("@chevre/factory/lib/reservation/event").IReservation, "id">) & {
171
+ _id: string;
172
+ bookingAgent?: any;
173
+ previousReservationStatus?: factory.reservationStatusType | undefined;
174
+ }> & Omit<(Omit<import("@chevre/factory/lib/reservation/busReservation").IReservation, "id"> & {
175
+ _id: string;
176
+ bookingAgent?: any;
177
+ previousReservationStatus?: factory.reservationStatusType | undefined;
178
+ } & Required<{
179
+ _id: string;
180
+ }>) | (Omit<import("@chevre/factory/lib/reservation/event").IReservation, "id"> & {
181
+ _id: string;
182
+ bookingAgent?: any;
183
+ previousReservationStatus?: factory.reservationStatusType | undefined;
184
+ } & Required<{
185
+ _id: string;
186
+ }>), never>>>;
155
187
  unsetUnnecessaryFields(params: {
156
188
  filter: any;
157
189
  $unset: any;
@@ -970,7 +970,7 @@ class ReservationRepo {
970
970
  }
971
971
  bulkWriteOps.push({
972
972
  updateOne: {
973
- filter: { _id: { $eq: setOnInsert.id } },
973
+ filter: { _id: { $eq: subReservation.id } },
974
974
  update: {
975
975
  $setOnInsert: setOnInsert
976
976
  },
@@ -1,13 +1,6 @@
1
1
  import type { Connection } from 'mongoose';
2
2
  import * as factory from '../factory';
3
- export declare enum RoleType {
4
- OrganizationRole = "OrganizationRole"
5
- }
6
- export interface IRole {
7
- typeOf: RoleType;
8
- roleName: string;
9
- permissions: string[];
10
- }
3
+ import { IRole } from './mongoose/schemas/role';
11
4
  /**
12
5
  * IAMロールリポジトリ
13
6
  */
@@ -15,7 +8,7 @@ export declare class RoleRepo {
15
8
  private readonly roleModel;
16
9
  constructor(connection: Connection);
17
10
  static CREATE_MONGO_CONDITIONS(params: factory.iam.IRoleSearchConditions): any[];
18
- search(params: factory.iam.IRoleSearchConditions): Promise<IRole[]>;
11
+ projectFields(params: factory.iam.IRoleSearchConditions): Promise<IRole[]>;
19
12
  aggregatePermissions(params: {
20
13
  roleName: {
21
14
  $in: string[];