@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
@@ -0,0 +1,19 @@
1
+ // tslint:disable:no-console
2
+ import * as mongoose from 'mongoose';
3
+ import { chevre } from '../../../lib/index';
4
+
5
+ async function main() {
6
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
7
+
8
+ const projectRepo = await chevre.repository.Project.createInstance(mongoose.connection);
9
+ const result = await projectRepo.createById({
10
+ id: 'xxx',
11
+ typeOf: chevre.factory.organizationType.Project
12
+ });
13
+ // tslint:disable-next-line:no-null-keyword
14
+ console.dir(result, { depth: null });
15
+ }
16
+
17
+ main()
18
+ .then(console.log)
19
+ .catch(console.error);
@@ -68,7 +68,7 @@ async function main() {
68
68
  deleteTransactionTask.project.id, deleteTransactionTask.name, deleteTransactionTask.id, deleteTransactionTask.runsAt,
69
69
  placeOrderTransactionId
70
70
  );
71
- const placeOrderTransaction = (await transactionRepo.search({
71
+ const placeOrderTransaction = (await transactionRepo.projectFields({
72
72
  limit: 1,
73
73
  page: 1,
74
74
  typeOf: chevre.factory.transactionType.PlaceOrder,
@@ -3,7 +3,7 @@ import * as mongoose from 'mongoose';
3
3
 
4
4
  import { chevre } from '../../../lib/index';
5
5
 
6
- const project = { id: String(process.env.PROJECT_ID) };
6
+ // const project = { id: String(process.env.PROJECT_ID) };
7
7
 
8
8
  mongoose.Model.on('index', (...args) => {
9
9
  console.error('******** index event emitted. ********\n', args);
@@ -12,16 +12,15 @@ mongoose.Model.on('index', (...args) => {
12
12
  async function main() {
13
13
  await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
14
14
 
15
- const sellerRepo = await chevre.repository.Seller.createInstance(mongoose.connection);
15
+ const transactionrRepo = await chevre.repository.Transaction.createInstance(mongoose.connection);
16
16
 
17
- const docs = await sellerRepo.projectFields(
17
+ const docs = await transactionrRepo.projectFields(
18
18
  {
19
19
  limit: 1,
20
20
  page: 1,
21
- project: { id: { $eq: project.id } }
22
- },
23
- [],
24
- ['hasMerchantReturnPolicy', 'makesOffer', 'additionalProperty']
21
+ typeOf: chevre.factory.transactionType.PlaceOrder,
22
+ inclusion: ['startDate']
23
+ }
25
24
  );
26
25
  // tslint:disable-next-line:no-null-keyword
27
26
  console.dir(docs, { depth: null });
@@ -11,23 +11,18 @@ console.log(`importing chevre took ${diff[0]} seconds and ${diff[1]} nanoseconds
11
11
  async function main() {
12
12
  await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
13
13
 
14
- const eventRepo: chevre.repository.Event = await chevre.repository.Event.createInstance(mongoose.connection);
14
+ const transactionrRepo = await chevre.repository.Transaction.createInstance(mongoose.connection);
15
15
 
16
- const event = await eventRepo.projectFieldsById(
16
+ const transaction = await transactionrRepo.projectFieldsById(
17
17
  {
18
18
  // id: '120162210202407171202250'
19
- id: 'blxonxv1m'
19
+ id: '66c6a1bb261e960547f8e138',
20
+ typeOf: chevre.factory.transactionType.PlaceOrder
20
21
  },
21
- // [
22
- // 'project', 'organizer', 'typeOf',
23
- // 'name', 'doorTime', 'endDate', 'eventStatus',
24
- // 'location', 'startDate', 'superEvent',
25
- // 'offers'
26
- // ]
27
- ['project', 'startDate', 'typeOf', 'superEvent.location.id']
22
+ ['startDate']
28
23
  );
29
24
  // tslint:disable-next-line:no-null-keyword
30
- console.dir(event, { depth: null });
25
+ console.dir(transaction, { depth: null });
31
26
  }
32
27
 
33
28
  main()
@@ -14,7 +14,7 @@ async function main() {
14
14
 
15
15
  const transactionRepo = await chevre.repository.Transaction.createInstance(mongoose.connection);
16
16
 
17
- const transactions = await transactionRepo.search<chevre.factory.transactionType.PlaceOrder, 'status' | 'startDate'>({
17
+ const transactions = await transactionRepo.projectFields<chevre.factory.transactionType.PlaceOrder, 'status' | 'startDate'>({
18
18
  limit: 1,
19
19
  page: 1,
20
20
  project: { id: { $eq: project.id } },
@@ -6,23 +6,10 @@ import { chevre } from '../../../lib/index';
6
6
  async function main() {
7
7
  await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
8
8
 
9
- const productRepo = await chevre.repository.Product.createInstance(mongoose.connection);
10
- const sellerRepo = await chevre.repository.Seller.createInstance(mongoose.connection);
9
+ const categoryCodeRepo = await chevre.repository.CategoryCode.createInstance(mongoose.connection);
11
10
 
12
11
  let updateResult: any;
13
- updateResult = await productRepo.unsetUnnecessaryFields({
14
- filter: {
15
- _id: { $exists: true }
16
- },
17
- $unset: {
18
- createdAt: 1,
19
- updatedAt: 1,
20
- __v: 1
21
- }
22
- });
23
- console.log(updateResult);
24
-
25
- updateResult = await sellerRepo.unsetUnnecessaryFields({
12
+ updateResult = await categoryCodeRepo.unsetUnnecessaryFields({
26
13
  filter: {
27
14
  _id: { $exists: true }
28
15
  },
@@ -22,17 +22,23 @@
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, Model } from 'mongoose';
25
+ import type { Connection } from 'mongoose';
26
+ import * as factory from '../factory';
27
+ import { IModel } from './mongoose/schemas/accountTitle';
26
28
  /**
27
29
  * 科目リポジトリ
28
30
  */
29
31
  export declare class AccountTitleRepo {
30
- readonly accountTitleModel: typeof Model;
32
+ readonly accountTitleModel: IModel;
31
33
  constructor(connection: Connection);
32
34
  deleteByProject(params: {
33
35
  project: {
34
36
  id: string;
35
37
  };
36
38
  }): Promise<void>;
37
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
39
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, factory.accountTitle.IAccountTitle> & Omit<factory.accountTitle.IAccountTitle & {
40
+ _id: import("mongoose").Types.ObjectId;
41
+ }, never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, factory.accountTitle.IAccountTitle> & Omit<factory.accountTitle.IAccountTitle & {
42
+ _id: import("mongoose").Types.ObjectId;
43
+ }, never>>>;
38
44
  }
@@ -1,20 +1,8 @@
1
1
  import type { Connection, PipelineStage } from 'mongoose';
2
+ import { IAccountingReport, IChildReport, IOrder4report } from './mongoose/schemas/accountingReport';
2
3
  import * as factory from '../factory';
3
4
  type IMatchStage = PipelineStage.Match;
4
- export type IOrder4report = factory.report.accountingReport.IOrderAsMainEntity;
5
- export interface IChildReport {
6
- typeOf: 'Report';
7
- mainEntity: factory.report.accountingReport.IAction;
8
- }
9
- export interface IAccountingReport {
10
- project: {
11
- id: string;
12
- typeOf: factory.organizationType.Project;
13
- };
14
- typeOf: 'Report';
15
- hasPart: IChildReport[];
16
- mainEntity: IOrder4report;
17
- }
5
+ export { IAccountingReport, IChildReport, IOrder4report };
18
6
  /**
19
7
  * 経理レポートリポジトリ
20
8
  */
@@ -58,4 +46,3 @@ export declare class AccountingReportRepo {
58
46
  $unset: any;
59
47
  }): Promise<import("mongodb").UpdateResult>;
60
48
  }
61
- export {};
@@ -23,9 +23,9 @@
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import { factory as surfrockFactory } from '@surfrock/sdk';
26
- import { Connection, FilterQuery, QueryOptions, UpdateQuery } from 'mongoose';
26
+ import { Connection, Document, FilterQuery, QueryOptions, UpdateQuery } from 'mongoose';
27
27
  import * as factory from '../factory';
28
- export type IAction<T extends factory.actionType> = T extends factory.actionType.OrderAction ? factory.action.trade.order.IAction : T extends factory.actionType.AuthorizeAction ? factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>> : factory.action.IAction<factory.action.IAttributes<T, any, any>>;
28
+ export type IAction<T extends factory.actionType> = T extends factory.actionType.OrderAction ? factory.action.trade.order.IAction : T extends factory.actionType.AuthorizeAction ? factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>> : T extends factory.actionType.MoneyTransfer ? factory.action.transfer.moneyTransfer.IAction : T extends factory.actionType.ReplaceAction ? factory.action.update.replace.IAction<factory.action.update.replace.IAttributes<any, any>> : factory.action.IAction<factory.action.IAttributes<T, any, any>>;
29
29
  export type IPayAction = factory.action.trade.pay.IAction;
30
30
  export interface IUseActionCountByOffer {
31
31
  _id: string[];
@@ -391,7 +391,59 @@ export declare class ActionRepo {
391
391
  startFrom: Date;
392
392
  startThrough: Date;
393
393
  }): Promise<IAggregateAction>;
394
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, QueryOptions<any>>;
394
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<Document<unknown, {}, (import("@chevre/factory/lib/action").IAction<import("@chevre/factory/lib/action").IAttributes<factory.actionType, any, any>> | import("@chevre/factory/lib/action/transfer/moneyTransfer").IAction | (import("@chevre/factory/lib/action/update/replace").IAttributes<any, any> & import("@chevre/factory/lib/action").IDynamicAttributes & {
395
+ id: string;
396
+ } & {
397
+ targetCollection?: any;
398
+ })) & {
399
+ cancelAction?: any;
400
+ }> & Omit<(import("@chevre/factory/lib/action").IAttributes<factory.actionType, any, any> & import("@chevre/factory/lib/action").IDynamicAttributes & {
401
+ id: string;
402
+ } & {
403
+ cancelAction?: any;
404
+ } & {
405
+ _id: import("mongoose").Types.ObjectId;
406
+ }) | (import("@chevre/factory/lib/action/transfer/moneyTransfer").IAttributes & import("@chevre/factory/lib/action").IDynamicAttributes & {
407
+ id: string;
408
+ } & {
409
+ cancelAction?: any;
410
+ } & {
411
+ _id: import("mongoose").Types.ObjectId;
412
+ }) | (import("@chevre/factory/lib/action/update/replace").IAttributes<any, any> & import("@chevre/factory/lib/action").IDynamicAttributes & {
413
+ id: string;
414
+ } & {
415
+ targetCollection?: any;
416
+ } & {
417
+ cancelAction?: any;
418
+ } & {
419
+ _id: import("mongoose").Types.ObjectId;
420
+ }), never>, QueryOptions<Document<unknown, {}, (import("@chevre/factory/lib/action").IAction<import("@chevre/factory/lib/action").IAttributes<factory.actionType, any, any>> | import("@chevre/factory/lib/action/transfer/moneyTransfer").IAction | (import("@chevre/factory/lib/action/update/replace").IAttributes<any, any> & import("@chevre/factory/lib/action").IDynamicAttributes & {
421
+ id: string;
422
+ } & {
423
+ targetCollection?: any;
424
+ })) & {
425
+ cancelAction?: any;
426
+ }> & Omit<(import("@chevre/factory/lib/action").IAttributes<factory.actionType, any, any> & import("@chevre/factory/lib/action").IDynamicAttributes & {
427
+ id: string;
428
+ } & {
429
+ cancelAction?: any;
430
+ } & {
431
+ _id: import("mongoose").Types.ObjectId;
432
+ }) | (import("@chevre/factory/lib/action/transfer/moneyTransfer").IAttributes & import("@chevre/factory/lib/action").IDynamicAttributes & {
433
+ id: string;
434
+ } & {
435
+ cancelAction?: any;
436
+ } & {
437
+ _id: import("mongoose").Types.ObjectId;
438
+ }) | (import("@chevre/factory/lib/action/update/replace").IAttributes<any, any> & import("@chevre/factory/lib/action").IDynamicAttributes & {
439
+ id: string;
440
+ } & {
441
+ targetCollection?: any;
442
+ } & {
443
+ cancelAction?: any;
444
+ } & {
445
+ _id: import("mongoose").Types.ObjectId;
446
+ }), never>>>;
395
447
  unsetUnnecessaryFields(params: {
396
448
  filter: FilterQuery<factory.action.IAction<factory.action.IAttributes<factory.actionType, any, any>>>;
397
449
  $unset: any;
@@ -1,20 +1,7 @@
1
1
  import type { Connection, PipelineStage } from 'mongoose';
2
2
  import * as factory from '../factory';
3
+ import { IAggregateReservation } from './mongoose/schemas/aggregateReservation';
3
4
  type IMatchStage = PipelineStage.Match;
4
- export interface IAggregateReservation {
5
- project: {
6
- id: string;
7
- typeOf: factory.organizationType.Project;
8
- };
9
- typeOf: 'AggregateReservation';
10
- reservationFor: {
11
- id: string;
12
- typeOf: factory.eventType;
13
- startDate: Date;
14
- };
15
- aggregateEntranceGate?: factory.event.event.IAggregateEntranceGate;
16
- aggregateOffer?: factory.event.event.IAggregateOffer;
17
- }
18
5
  export interface IUpdateAggregateReservationParams {
19
6
  $set: {
20
7
  aggregateOffer?: factory.event.event.IAggregateOffer;
@@ -46,13 +46,14 @@ export interface IAggregateReserve {
46
46
  statuses: IStatus[];
47
47
  }
48
48
  type IKeyOfProjection<T extends factory.assetTransactionType> = keyof Pick<factory.assetTransaction.ITransaction<factory.assetTransactionType>, 'agent' | 'endDate' | 'expires' | 'project' | 'startDate' | 'status' | 'typeOf' | 'transactionNumber'> | Exclude<keyof factory.assetTransaction.ITransaction<T>, 'id'>;
49
+ type AvailableAssetTransactionType = factory.assetTransactionType.CancelReservation | factory.assetTransactionType.MoneyTransfer | factory.assetTransactionType.Pay | factory.assetTransactionType.Refund | factory.assetTransactionType.RegisterService | factory.assetTransactionType.Reserve;
49
50
  /**
50
51
  * 資産取引リポジトリ
51
52
  */
52
53
  export declare class AssetTransactionRepo {
53
54
  private readonly transactionModel;
54
55
  constructor(connection: Connection);
55
- static CREATE_MONGO_CONDITIONS(params: factory.assetTransaction.ISearchConditions<factory.assetTransactionType>): FilterQuery<import("@chevre/factory/lib/assetTransaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/assetTransaction/reserve").ITransaction | import("@chevre/factory/lib/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/assetTransaction/pay").ITransaction | import("@chevre/factory/lib/assetTransaction/refund").ITransaction | import("@chevre/factory/lib/assetTransaction/registerService").ITransaction>[];
56
+ static CREATE_MONGO_CONDITIONS(params: factory.assetTransaction.ISearchConditions<factory.assetTransactionType>): FilterQuery<import("@chevre/factory/lib/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/assetTransaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/assetTransaction/pay").ITransaction | import("@chevre/factory/lib/assetTransaction/refund").ITransaction | import("@chevre/factory/lib/assetTransaction/registerService").ITransaction | import("@chevre/factory/lib/assetTransaction/reserve").ITransaction>[];
56
57
  /**
57
58
  * 取引を開始する
58
59
  */
@@ -91,11 +92,13 @@ export declare class AssetTransactionRepo {
91
92
  /**
92
93
  * 取引を開始&確定
93
94
  */
94
- startAndConfirm<T extends factory.assetTransactionType>(params: factory.assetTransaction.IStartParams<T> & {
95
+ startAndConfirm<T extends AvailableAssetTransactionType>(params: factory.assetTransaction.IStartParams<T> & {
95
96
  id: string;
96
97
  result: factory.assetTransaction.IResult<T>;
97
98
  potentialActions: factory.assetTransaction.IPotentialActions<T>;
98
- }): Promise<factory.assetTransaction.ITransaction<T>>;
99
+ }): Promise<{
100
+ id: string;
101
+ }>;
99
102
  /**
100
103
  * タスク未エクスポートの取引をひとつ取得してエクスポートを開始する
101
104
  */
@@ -123,7 +126,7 @@ export declare class AssetTransactionRepo {
123
126
  status: {
124
127
  $in: factory.transactionStatusType[];
125
128
  };
126
- }): Promise<Pick<import("@chevre/factory/lib/assetTransaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/assetTransaction/reserve").ITransaction | import("@chevre/factory/lib/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/assetTransaction/pay").ITransaction | import("@chevre/factory/lib/assetTransaction/refund").ITransaction | import("@chevre/factory/lib/assetTransaction/registerService").ITransaction, "typeOf" | "id" | "status">[]>;
129
+ }): Promise<Pick<import("@chevre/factory/lib/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/assetTransaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/assetTransaction/pay").ITransaction | import("@chevre/factory/lib/assetTransaction/refund").ITransaction | import("@chevre/factory/lib/assetTransaction/registerService").ITransaction | import("@chevre/factory/lib/assetTransaction/reserve").ITransaction, "id" | "typeOf" | "status">[]>;
127
130
  /**
128
131
  * set task status exported by transaction id
129
132
  * IDでタスクをエクスポート済に変更する
@@ -153,7 +156,7 @@ export declare class AssetTransactionRepo {
153
156
  /**
154
157
  * 取引を検索する
155
158
  */
156
- search<T extends factory.assetTransactionType>(params: factory.assetTransaction.ISearchConditions<T>, inclusion?: string[], exclusion?: string[]): Promise<factory.assetTransaction.ITransaction<T>[]>;
159
+ search<T extends AvailableAssetTransactionType>(params: factory.assetTransaction.ISearchConditions<T>, inclusion?: string[], exclusion?: string[]): Promise<factory.assetTransaction.ITransaction<T>[]>;
157
160
  /**
158
161
  * 取引番号指定で削除する
159
162
  */
@@ -197,7 +200,55 @@ export declare class AssetTransactionRepo {
197
200
  object: {
198
201
  reservationNumber: string;
199
202
  };
200
- }): Promise<any>;
203
+ }): Promise<(import("@chevre/factory/lib/assetTransaction/cancelReservation").IAttributes & {
204
+ id: string;
205
+ } & {
206
+ seller?: any;
207
+ } & {
208
+ _id: import("mongoose").Types.ObjectId;
209
+ } & Required<{
210
+ _id: import("mongoose").Types.ObjectId;
211
+ }>) | (import("@chevre/factory/lib/assetTransaction/moneyTransfer").IAttributes & {
212
+ id: string;
213
+ } & {
214
+ seller?: any;
215
+ } & {
216
+ _id: import("mongoose").Types.ObjectId;
217
+ } & Required<{
218
+ _id: import("mongoose").Types.ObjectId;
219
+ }>) | (import("@chevre/factory/lib/assetTransaction/pay").IAttributes & {
220
+ id: string;
221
+ } & {
222
+ seller?: any;
223
+ } & {
224
+ _id: import("mongoose").Types.ObjectId;
225
+ } & Required<{
226
+ _id: import("mongoose").Types.ObjectId;
227
+ }>) | (import("@chevre/factory/lib/assetTransaction/refund").IAttributes & {
228
+ id: string;
229
+ } & {
230
+ seller?: any;
231
+ } & {
232
+ _id: import("mongoose").Types.ObjectId;
233
+ } & Required<{
234
+ _id: import("mongoose").Types.ObjectId;
235
+ }>) | (import("@chevre/factory/lib/assetTransaction/registerService").IAttributes & {
236
+ id: string;
237
+ } & {
238
+ seller?: any;
239
+ } & {
240
+ _id: import("mongoose").Types.ObjectId;
241
+ } & Required<{
242
+ _id: import("mongoose").Types.ObjectId;
243
+ }>) | (import("@chevre/factory/lib/assetTransaction/reserve").IAttributes & {
244
+ id: string;
245
+ } & {
246
+ seller?: any;
247
+ } & {
248
+ _id: import("mongoose").Types.ObjectId;
249
+ } & Required<{
250
+ _id: import("mongoose").Types.ObjectId;
251
+ }>)>;
201
252
  /**
202
253
  * 互換性維持対応専用
203
254
  */
@@ -215,7 +266,83 @@ export declare class AssetTransactionRepo {
215
266
  findByIdAndDelete(params: {
216
267
  id: string;
217
268
  }): Promise<void>;
218
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
269
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, (import("@chevre/factory/lib/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/assetTransaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/assetTransaction/pay").ITransaction | import("@chevre/factory/lib/assetTransaction/refund").ITransaction | import("@chevre/factory/lib/assetTransaction/registerService").ITransaction | import("@chevre/factory/lib/assetTransaction/reserve").ITransaction) & {
270
+ seller?: any;
271
+ }> & Omit<(import("@chevre/factory/lib/assetTransaction/cancelReservation").IAttributes & {
272
+ id: string;
273
+ } & {
274
+ seller?: any;
275
+ } & {
276
+ _id: import("mongoose").Types.ObjectId;
277
+ }) | (import("@chevre/factory/lib/assetTransaction/moneyTransfer").IAttributes & {
278
+ id: string;
279
+ } & {
280
+ seller?: any;
281
+ } & {
282
+ _id: import("mongoose").Types.ObjectId;
283
+ }) | (import("@chevre/factory/lib/assetTransaction/pay").IAttributes & {
284
+ id: string;
285
+ } & {
286
+ seller?: any;
287
+ } & {
288
+ _id: import("mongoose").Types.ObjectId;
289
+ }) | (import("@chevre/factory/lib/assetTransaction/refund").IAttributes & {
290
+ id: string;
291
+ } & {
292
+ seller?: any;
293
+ } & {
294
+ _id: import("mongoose").Types.ObjectId;
295
+ }) | (import("@chevre/factory/lib/assetTransaction/registerService").IAttributes & {
296
+ id: string;
297
+ } & {
298
+ seller?: any;
299
+ } & {
300
+ _id: import("mongoose").Types.ObjectId;
301
+ }) | (import("@chevre/factory/lib/assetTransaction/reserve").IAttributes & {
302
+ id: string;
303
+ } & {
304
+ seller?: any;
305
+ } & {
306
+ _id: import("mongoose").Types.ObjectId;
307
+ }), never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, (import("@chevre/factory/lib/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/assetTransaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/assetTransaction/pay").ITransaction | import("@chevre/factory/lib/assetTransaction/refund").ITransaction | import("@chevre/factory/lib/assetTransaction/registerService").ITransaction | import("@chevre/factory/lib/assetTransaction/reserve").ITransaction) & {
308
+ seller?: any;
309
+ }> & Omit<(import("@chevre/factory/lib/assetTransaction/cancelReservation").IAttributes & {
310
+ id: string;
311
+ } & {
312
+ seller?: any;
313
+ } & {
314
+ _id: import("mongoose").Types.ObjectId;
315
+ }) | (import("@chevre/factory/lib/assetTransaction/moneyTransfer").IAttributes & {
316
+ id: string;
317
+ } & {
318
+ seller?: any;
319
+ } & {
320
+ _id: import("mongoose").Types.ObjectId;
321
+ }) | (import("@chevre/factory/lib/assetTransaction/pay").IAttributes & {
322
+ id: string;
323
+ } & {
324
+ seller?: any;
325
+ } & {
326
+ _id: import("mongoose").Types.ObjectId;
327
+ }) | (import("@chevre/factory/lib/assetTransaction/refund").IAttributes & {
328
+ id: string;
329
+ } & {
330
+ seller?: any;
331
+ } & {
332
+ _id: import("mongoose").Types.ObjectId;
333
+ }) | (import("@chevre/factory/lib/assetTransaction/registerService").IAttributes & {
334
+ id: string;
335
+ } & {
336
+ seller?: any;
337
+ } & {
338
+ _id: import("mongoose").Types.ObjectId;
339
+ }) | (import("@chevre/factory/lib/assetTransaction/reserve").IAttributes & {
340
+ id: string;
341
+ } & {
342
+ seller?: any;
343
+ } & {
344
+ _id: import("mongoose").Types.ObjectId;
345
+ }), never>>>;
219
346
  unsetUnnecessaryFields(params: {
220
347
  filter: any;
221
348
  $unset: any;
@@ -439,7 +439,7 @@ class AssetTransactionRepo {
439
439
  startAndConfirm(params) {
440
440
  return __awaiter(this, void 0, void 0, function* () {
441
441
  const startDate = new Date();
442
- const confirmedTransaction = yield this.transactionModel.create(Object.assign(Object.assign({}, params), { _id: params.id, typeOf: params.typeOf, startDate, status: factory.transactionStatusType.Confirmed, tasksExportAction: {
442
+ yield this.transactionModel.create(Object.assign(Object.assign({}, params), { _id: params.id, typeOf: params.typeOf, startDate, status: factory.transactionStatusType.Confirmed, tasksExportAction: {
443
443
  actionStatus: factory.actionStatusType.PotentialActionStatus
444
444
  },
445
445
  // tasksExportationStatus: factory.transactionTasksExportationStatus.Unexported, // discontinue(2024-06-20~)
@@ -450,7 +450,7 @@ class AssetTransactionRepo {
450
450
  typeOf: params.typeOf,
451
451
  status: factory.transactionStatusType.Confirmed
452
452
  });
453
- return confirmedTransaction;
453
+ return { id: params.id };
454
454
  });
455
455
  }
456
456
  /**
@@ -83,5 +83,9 @@ export declare class CategoryCodeRepo {
83
83
  };
84
84
  }): Promise<void>;
85
85
  getCursor(conditions: FilterQuery<factory.categoryCode.ICategoryCode>, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
86
+ unsetUnnecessaryFields(params: {
87
+ filter: FilterQuery<factory.categoryCode.ICategoryCode>;
88
+ $unset: any;
89
+ }): Promise<import("mongodb").UpdateResult>;
86
90
  }
87
91
  export {};
@@ -344,5 +344,11 @@ class CategoryCodeRepo {
344
344
  .sort({ codeValue: factory.sortType.Ascending })
345
345
  .cursor();
346
346
  }
347
+ unsetUnnecessaryFields(params) {
348
+ return __awaiter(this, void 0, void 0, function* () {
349
+ return this.categoryCodeModel.updateMany(params.filter, { $unset: params.$unset }, { timestamps: false })
350
+ .exec();
351
+ });
352
+ }
347
353
  }
348
354
  exports.CategoryCodeRepo = CategoryCodeRepo;
@@ -54,5 +54,9 @@ export declare class CommentRepo {
54
54
  deleteById(params: {
55
55
  id: string;
56
56
  }): Promise<void>;
57
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
57
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/creativeWork/comment").IComment> & Omit<import("@chevre/factory/lib/creativeWork/comment").IComment & {
58
+ _id: import("mongoose").Types.ObjectId;
59
+ }, never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/creativeWork/comment").IComment> & Omit<import("@chevre/factory/lib/creativeWork/comment").IComment & {
60
+ _id: import("mongoose").Types.ObjectId;
61
+ }, never>>>;
58
62
  }
@@ -23,7 +23,7 @@
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import type { BulkWriteResult } from 'mongodb';
26
- import { Connection, FilterQuery } from 'mongoose';
26
+ import { Connection, Document, FilterQuery, Types } from 'mongoose';
27
27
  import * as factory from '../factory';
28
28
  type IKeyOfProjection = keyof factory.creativeWork.movie.ICreativeWork | '_id';
29
29
  /**
@@ -72,7 +72,19 @@ export declare class CreativeWorkRepo {
72
72
  id: string;
73
73
  };
74
74
  }): Promise<void>;
75
- getCursor(conditions: FilterQuery<factory.creativeWork.movie.ICreativeWork>, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
75
+ getCursor(conditions: FilterQuery<factory.creativeWork.movie.ICreativeWork>, projection: any): import("mongoose").Cursor<Document<unknown, {}, import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
76
+ description?: string | undefined;
77
+ }> & Omit<import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
78
+ description?: string | undefined;
79
+ } & {
80
+ _id: Types.ObjectId;
81
+ }, never>, import("mongoose").QueryOptions<Document<unknown, {}, import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
82
+ description?: string | undefined;
83
+ }> & Omit<import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
84
+ description?: string | undefined;
85
+ } & {
86
+ _id: Types.ObjectId;
87
+ }, never>>>;
76
88
  unsetUnnecessaryFields(params: {
77
89
  filter: FilterQuery<factory.creativeWork.movie.ICreativeWork>;
78
90
  $unset: any;
@@ -45,6 +45,10 @@ export declare class CustomerRepo {
45
45
  deleteById(params: {
46
46
  id: string;
47
47
  }): Promise<void>;
48
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
48
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, factory.customer.ICustomer> & Omit<factory.customer.ICustomer & {
49
+ _id: import("mongoose").Types.ObjectId;
50
+ }, never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, factory.customer.ICustomer> & Omit<factory.customer.ICustomer & {
51
+ _id: import("mongoose").Types.ObjectId;
52
+ }, never>>>;
49
53
  }
50
54
  export {};
@@ -1,7 +1,7 @@
1
1
  import type { BulkWriteResult } from 'mongodb';
2
2
  import { Connection, FilterQuery } from 'mongoose';
3
+ import { ICustomerType } from './mongoose/schemas/customerType';
3
4
  import * as factory from '../factory';
4
- type ICustomerType = Pick<factory.categoryCode.ICategoryCode, 'codeValue' | 'id' | 'name' | 'typeOf'>;
5
5
  type IKeyOfProjection = keyof ICustomerType | '_id';
6
6
  /**
7
7
  * カスタマータイプリポジトリ