@chevre/domain 22.3.0-alpha.8 → 22.3.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 (134) hide show
  1. package/example/src/chevre/aggregation/createAggregateEventTasks.ts +1 -1
  2. package/example/src/chevre/importEventsFromCOA.ts +6 -3
  3. package/example/src/chevre/migrateAccountTitleAdditionalProperties.ts +9 -6
  4. package/example/src/chevre/migrateCustomerAdditionalProperties.ts +8 -6
  5. package/example/src/chevre/migrateEventSeries2secondary.ts +70 -0
  6. package/example/src/chevre/migrateRoomAdditionalProperties.ts +8 -6
  7. package/example/src/chevre/migrateRoomSectionAdditionalProperties.ts +8 -6
  8. package/example/src/chevre/projectFields.ts +6 -10
  9. package/example/src/chevre/unsetUnnecessaryFields.ts +15 -2
  10. package/example/src/chevre/upsertManyEventsByAdditionalProperty.ts +180 -0
  11. package/lib/chevre/repo/account.d.ts +25 -1
  12. package/lib/chevre/repo/accountTitle.d.ts +4 -4
  13. package/lib/chevre/repo/accountingReport.d.ts +25 -1
  14. package/lib/chevre/repo/action.d.ts +11 -11
  15. package/lib/chevre/repo/action.js +4 -7
  16. package/lib/chevre/repo/additionalProperty.d.ts +33 -8
  17. package/lib/chevre/repo/additionalProperty.js +52 -106
  18. package/lib/chevre/repo/aggregateOffer.d.ts +26 -2
  19. package/lib/chevre/repo/aggregateReservation.d.ts +25 -1
  20. package/lib/chevre/repo/aggregation.d.ts +26 -2
  21. package/lib/chevre/repo/assetTransaction.d.ts +5 -5
  22. package/lib/chevre/repo/authorization.d.ts +25 -1
  23. package/lib/chevre/repo/categoryCode.d.ts +1 -1
  24. package/lib/chevre/repo/comment.d.ts +3 -3
  25. package/lib/chevre/repo/creativeWork.d.ts +12 -10
  26. package/lib/chevre/repo/creativeWork.js +51 -23
  27. package/lib/chevre/repo/customer.d.ts +4 -4
  28. package/lib/chevre/repo/event.d.ts +55 -82
  29. package/lib/chevre/repo/event.js +130 -274
  30. package/lib/chevre/repo/eventSeries.d.ts +74 -11
  31. package/lib/chevre/repo/eventSeries.js +301 -45
  32. package/lib/chevre/repo/member.d.ts +4 -4
  33. package/lib/chevre/repo/member.js +0 -15
  34. package/lib/chevre/repo/merchantReturnPolicy.d.ts +3 -3
  35. package/lib/chevre/repo/message.d.ts +30 -6
  36. package/lib/chevre/repo/message.js +25 -22
  37. package/lib/chevre/repo/mongoose/schemas/additionalProperty.js +0 -3
  38. package/lib/chevre/repo/mongoose/schemas/civicStructure.d.ts +12 -0
  39. package/lib/chevre/repo/mongoose/schemas/civicStructure.js +131 -0
  40. package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +1 -1
  41. package/lib/chevre/repo/mongoose/schemas/creativeWork.js +21 -23
  42. package/lib/chevre/repo/mongoose/schemas/event.d.ts +1 -5
  43. package/lib/chevre/repo/mongoose/schemas/event.js +11 -78
  44. package/lib/chevre/repo/mongoose/schemas/eventSeries.d.ts +13 -0
  45. package/lib/chevre/repo/mongoose/schemas/eventSeries.js +219 -0
  46. package/lib/chevre/repo/mongoose/schemas/message.js +0 -3
  47. package/lib/chevre/repo/mongoose/schemas/note.js +0 -3
  48. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +1 -1
  49. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +21 -23
  50. package/lib/chevre/repo/mongoose/schemas/place.d.ts +1 -5
  51. package/lib/chevre/repo/mongoose/schemas/place.js +38 -42
  52. package/lib/chevre/repo/note.d.ts +27 -6
  53. package/lib/chevre/repo/note.js +25 -22
  54. package/lib/chevre/repo/offer.d.ts +8 -8
  55. package/lib/chevre/repo/offer.js +0 -21
  56. package/lib/chevre/repo/offerCatalog.d.ts +4 -4
  57. package/lib/chevre/repo/offerCatalogItem.d.ts +25 -1
  58. package/lib/chevre/repo/offerItemCondition.d.ts +28 -0
  59. package/lib/chevre/repo/offerItemCondition.js +8 -1
  60. package/lib/chevre/repo/order.d.ts +5 -5
  61. package/lib/chevre/repo/order.js +0 -73
  62. package/lib/chevre/repo/orderInTransaction.d.ts +27 -3
  63. package/lib/chevre/repo/ownershipInfo.d.ts +5 -5
  64. package/lib/chevre/repo/paymentService.d.ts +25 -1
  65. package/lib/chevre/repo/paymentServiceProvider.d.ts +26 -2
  66. package/lib/chevre/repo/place/busStop.d.ts +1 -1
  67. package/lib/chevre/repo/place/busStop.js +11 -11
  68. package/lib/chevre/repo/place/hasPOS.d.ts +1 -1
  69. package/lib/chevre/repo/place/hasPOS.js +7 -7
  70. package/lib/chevre/repo/place/movieTheater.d.ts +24 -53
  71. package/lib/chevre/repo/place/movieTheater.js +115 -140
  72. package/lib/chevre/repo/place/screeningRoom.d.ts +5 -0
  73. package/lib/chevre/repo/place/screeningRoom.js +67 -3
  74. package/lib/chevre/repo/place/seat.d.ts +1 -0
  75. package/lib/chevre/repo/place/seat.js +4 -1
  76. package/lib/chevre/repo/place/section.d.ts +1 -0
  77. package/lib/chevre/repo/place/section.js +4 -1
  78. package/lib/chevre/repo/priceSpecification.d.ts +4 -4
  79. package/lib/chevre/repo/priceSpecification.js +0 -1
  80. package/lib/chevre/repo/product.d.ts +4 -4
  81. package/lib/chevre/repo/productModel.d.ts +25 -1
  82. package/lib/chevre/repo/productOffer.d.ts +25 -1
  83. package/lib/chevre/repo/project.d.ts +5 -5
  84. package/lib/chevre/repo/project.js +0 -2
  85. package/lib/chevre/repo/reservation.d.ts +5 -5
  86. package/lib/chevre/repo/reservation.js +6 -59
  87. package/lib/chevre/repo/seller.d.ts +5 -5
  88. package/lib/chevre/repo/serviceOutput.d.ts +25 -1
  89. package/lib/chevre/repo/task.d.ts +8 -8
  90. package/lib/chevre/repo/transaction.d.ts +4 -4
  91. package/lib/chevre/repo/trip.d.ts +25 -1
  92. package/lib/chevre/service/aggregation/event/aggregateOffers.js +2 -2
  93. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +3 -3
  94. package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +5 -4
  95. package/lib/chevre/service/assetTransaction/reserve/start.d.ts +2 -0
  96. package/lib/chevre/service/assetTransaction/reserve/start.js +1 -1
  97. package/lib/chevre/service/event/createEvent.js +4 -2
  98. package/lib/chevre/service/event.d.ts +6 -0
  99. package/lib/chevre/service/event.js +134 -49
  100. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +2 -0
  101. package/lib/chevre/service/offer/event/authorize.d.ts +2 -0
  102. package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +3 -0
  103. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +10 -10
  104. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +1 -1
  105. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +1 -1
  106. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
  107. package/lib/chevre/service/offer/onEventChanged.d.ts +2 -0
  108. package/lib/chevre/service/offer/onEventChanged.js +22 -6
  109. package/lib/chevre/service/offer.js +1 -1
  110. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +1 -1
  111. package/lib/chevre/service/payment/movieTicket/factory.js +0 -6
  112. package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +1 -1
  113. package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +0 -6
  114. package/lib/chevre/service/payment/movieTicket/validation.js +1 -1
  115. package/lib/chevre/service/report/telemetry.js +1 -1
  116. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +1 -1
  117. package/lib/chevre/service/task/importEventsFromCOA.js +2 -0
  118. package/lib/chevre/service/task/onEventChanged.js +2 -0
  119. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +4 -2
  120. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +2 -0
  121. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +12 -7
  122. package/lib/chevre/service/task/onResourceUpdated.js +13 -11
  123. package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
  124. package/package.json +6 -6
  125. package/example/src/chevre/createManyEvents.ts +0 -75
  126. package/example/src/chevre/migrateAccountTitleCategoryAdditionalProperties.ts +0 -113
  127. package/example/src/chevre/migrateAccountTitleSetAdditionalProperties.ts +0 -120
  128. package/example/src/chevre/migrateMembers2.ts +0 -74
  129. package/example/src/chevre/playAroundMessage.ts +0 -73
  130. package/example/src/chevre/playAroundNote.ts +0 -34
  131. package/example/src/chevre/projectEventFields.ts +0 -39
  132. package/example/src/chevre/searchAvaialbleAppliesToMovieTicketByOfferCatalogId.ts +0 -45
  133. package/example/src/chevre/searchEventIds.ts +0 -24
  134. package/example/src/chevre/searchScreeningEventSeries.ts +0 -34
@@ -15,7 +15,7 @@ async function main() {
15
15
  const events = <Pick<
16
16
  chevre.factory.event.IEvent<chevre.factory.eventType.ScreeningEvent>,
17
17
  'id' | 'typeOf' | 'startDate' | 'project'
18
- >[]>await eventRepo.projectFields<chevre.factory.eventType.ScreeningEvent>(
18
+ >[]>await eventRepo.projectEventFields<chevre.factory.eventType.ScreeningEvent>(
19
19
  {
20
20
  typeOf: chevre.factory.eventType.ScreeningEvent,
21
21
  project: { id: { $eq: PROJECT.id } },
@@ -14,18 +14,19 @@ async function main() {
14
14
  const categoryCodeRepo = await chevre.repository.CategoryCode.createInstance(mongoose.connection);
15
15
  const creativeWorkRepo = await chevre.repository.CreativeWork.createInstance(mongoose.connection);
16
16
  const eventRepo = await chevre.repository.Event.createInstance(mongoose.connection);
17
+ const eventSeriesRepo = await chevre.repository.EventSeries.createInstance(mongoose.connection);
17
18
  const screeningRoomRepo = await chevre.repository.place.ScreeningRoom.createInstance(mongoose.connection);
18
19
  const movieTheaterRepo = await chevre.repository.place.MovieTheater.createInstance(mongoose.connection);
19
20
  const sellerRepo = await chevre.repository.Seller.createInstance(mongoose.connection);
20
21
 
21
22
  const coaAuthClient = new (await chevre.loadCOA()).auth.RefreshToken({
22
- endpoint: '',
23
- refreshToken: '',
23
+ endpoint: String(process.env.COA_ENDPOINT),
24
+ refreshToken: process.env.COA_REFRESH_TOKEN,
24
25
  useFetch: true
25
26
  });
26
27
  const masterService = new (await chevre.loadCOA()).service.Master(
27
28
  {
28
- endpoint: '',
29
+ endpoint: String(process.env.COA_ENDPOINT),
29
30
  auth: coaAuthClient
30
31
  },
31
32
  { timeout: 20000 }
@@ -44,12 +45,14 @@ async function main() {
44
45
  .toDate(),
45
46
  saveMovieTheater: false,
46
47
  saveScreeningEventSeries: false,
48
+ // saveScreeningEventSeries: true,
47
49
  saveScreeningEventSeriesPeriodInMonth: 3
48
50
  })({
49
51
  action: actionRepo,
50
52
  categoryCode: categoryCodeRepo,
51
53
  creativeWork: creativeWorkRepo,
52
54
  event: eventRepo,
55
+ eventSeries: eventSeriesRepo,
53
56
  movieTheater: movieTheaterRepo,
54
57
  screeningRoom: screeningRoomRepo,
55
58
  seller: sellerRepo,
@@ -74,12 +74,15 @@ async function main() {
74
74
 
75
75
  for (const additionalPropertyNameOnResource of additionalPropertyNamesOnResource) {
76
76
  checked += 1;
77
- const existingAdditionalProperties = await additionalPropertyRepo.search({
78
- limit: 1,
79
- project: { id: { $eq: accountTitleCategory.project.id } },
80
- codeValue: { $eq: additionalPropertyNameOnResource },
81
- inCodeSet: { identifier: { $eq: accountTitle.typeOf } }
82
- });
77
+ const existingAdditionalProperties = <{ id: string }[]>await additionalPropertyRepo.projectFields(
78
+ {
79
+ limit: 1,
80
+ project: { id: { $eq: accountTitleCategory.project.id } },
81
+ codeValue: { $eq: additionalPropertyNameOnResource },
82
+ inCodeSet: { identifier: { $eq: accountTitle.typeOf } }
83
+ },
84
+ ['id']
85
+ );
83
86
  if (existingAdditionalProperties.length === 0) {
84
87
  const additionalProperty: chevre.factory.additionalProperty.IAdditionalProperty = {
85
88
  project: accountTitleCategory.project,
@@ -64,12 +64,14 @@ async function main() {
64
64
 
65
65
  for (const additionalPropertyNameOnResource of additionalPropertyNamesOnResource) {
66
66
  checked += 1;
67
- const existingAdditionalProperties = await additionalPropertyRepo.search({
68
- limit: 1,
69
- project: { id: { $eq: customer.project.id } },
70
- codeValue: { $eq: additionalPropertyNameOnResource },
71
- inCodeSet: { identifier: { $eq: customer.typeOf } }
72
- });
67
+ const existingAdditionalProperties = <{ id: string }[]>await additionalPropertyRepo.projectFields(
68
+ {
69
+ limit: 1,
70
+ project: { id: { $eq: customer.project.id } },
71
+ codeValue: { $eq: additionalPropertyNameOnResource },
72
+ inCodeSet: { identifier: { $eq: customer.typeOf } }
73
+ },
74
+ ['id']);
73
75
  if (existingAdditionalProperties.length === 0) {
74
76
  const additionalProperty: chevre.factory.additionalProperty.IAdditionalProperty = {
75
77
  project: customer.project,
@@ -0,0 +1,70 @@
1
+ // tslint:disable:no-console
2
+ import * as mongoose from 'mongoose';
3
+
4
+ import { chevre } from '../../../lib/index';
5
+
6
+ // const project = { id: String(process.env.PROJECT_ID) };
7
+
8
+ // tslint:disable-next-line:max-func-body-length
9
+ async function main() {
10
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
11
+
12
+ const eventSeriesRepo = await chevre.repository.EventSeries.createInstance(mongoose.connection);
13
+
14
+ const cursor = eventSeriesRepo.getCursor(
15
+ {
16
+ typeOf: { $eq: chevre.factory.eventType.ScreeningEventSeries }
17
+ },
18
+ {
19
+ _id: 1,
20
+ startDate: 1,
21
+ project: 1,
22
+ typeOf: 1
23
+ }
24
+ );
25
+ console.log('docs found');
26
+
27
+ let i = 0;
28
+ let updateCount = 0;
29
+ await cursor.eachAsync(async (doc) => {
30
+ i += 1;
31
+ const eventSeries: Pick<chevre.factory.event.screeningEventSeries.IEvent, 'id' | 'startDate' | 'project' | 'typeOf'> =
32
+ doc.toObject();
33
+ const alreadyMigrated = false;
34
+ if (alreadyMigrated) {
35
+ console.log(
36
+ 'already exist.',
37
+ eventSeries.project.id,
38
+ eventSeries.typeOf,
39
+ eventSeries.id,
40
+ eventSeries.startDate, i, updateCount
41
+ );
42
+ } else {
43
+ updateCount += 1;
44
+ console.log(
45
+ 'updating...',
46
+ eventSeries.project.id,
47
+ eventSeries.typeOf,
48
+ eventSeries.id,
49
+ eventSeries.startDate, i, updateCount
50
+ );
51
+ // await eventSeriesRepo.sync2secondary({
52
+ // id: eventSeries.id
53
+ // });
54
+ console.log(
55
+ 'updated.',
56
+ eventSeries.project.id,
57
+ eventSeries.typeOf,
58
+ eventSeries.id,
59
+ eventSeries.startDate, i, updateCount
60
+ );
61
+ }
62
+ });
63
+
64
+ console.log(i, 'docs checked');
65
+ console.log(updateCount, 'docs updated');
66
+ }
67
+
68
+ main()
69
+ .then()
70
+ .catch(console.error);
@@ -66,12 +66,14 @@ async function main() {
66
66
 
67
67
  for (const additionalPropertyNameOnResource of additionalPropertyNamesOnResource) {
68
68
  checked += 1;
69
- const existingAdditionalProperties = await additionalPropertyRepo.search({
70
- limit: 1,
71
- project: { id: { $eq: screeningRoom.project.id } },
72
- codeValue: { $eq: additionalPropertyNameOnResource },
73
- inCodeSet: { identifier: { $eq: screeningRoom.typeOf } }
74
- });
69
+ const existingAdditionalProperties = <{ id: string }[]>await additionalPropertyRepo.projectFields(
70
+ {
71
+ limit: 1,
72
+ project: { id: { $eq: screeningRoom.project.id } },
73
+ codeValue: { $eq: additionalPropertyNameOnResource },
74
+ inCodeSet: { identifier: { $eq: screeningRoom.typeOf } }
75
+ },
76
+ ['id']);
75
77
  if (existingAdditionalProperties.length === 0) {
76
78
  const additionalProperty: chevre.factory.additionalProperty.IAdditionalProperty = {
77
79
  project: screeningRoom.project,
@@ -68,12 +68,14 @@ async function main() {
68
68
 
69
69
  for (const additionalPropertyNameOnResource of additionalPropertyNamesOnResource) {
70
70
  checked += 1;
71
- const existingAdditionalProperties = await additionalPropertyRepo.search({
72
- limit: 1,
73
- project: { id: { $eq: screeningRoom.project.id } },
74
- codeValue: { $eq: additionalPropertyNameOnResource },
75
- inCodeSet: { identifier: { $eq: section.typeOf } }
76
- });
71
+ const existingAdditionalProperties = <{ id: string }[]>await additionalPropertyRepo.projectFields(
72
+ {
73
+ limit: 1,
74
+ project: { id: { $eq: screeningRoom.project.id } },
75
+ codeValue: { $eq: additionalPropertyNameOnResource },
76
+ inCodeSet: { identifier: { $eq: section.typeOf } }
77
+ },
78
+ ['id']);
77
79
  if (existingAdditionalProperties.length === 0) {
78
80
  const additionalProperty: chevre.factory.additionalProperty.IAdditionalProperty = {
79
81
  project: screeningRoom.project,
@@ -3,24 +3,20 @@ 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) };
7
-
8
- mongoose.Model.on('index', (...args) => {
9
- console.error('******** index event emitted. ********\n', args);
10
- });
6
+ const project = { id: String(process.env.PROJECT_ID) };
11
7
 
12
8
  async function main() {
13
9
  await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
14
10
 
15
- const customerRepo = await chevre.repository.Customer.createInstance(mongoose.connection);
11
+ const additionalPropertyRepo = await chevre.repository.AdditionalProperty.createInstance(mongoose.connection);
16
12
 
17
- const docs = await customerRepo.projectFields(
13
+ const docs = await additionalPropertyRepo.projectFields(
18
14
  {
19
15
  limit: 1,
20
- page: 1
16
+ page: 1,
17
+ project: { id: { $eq: project.id } }
21
18
  },
22
- ['contactPoint', 'additionalProperty'],
23
- ['contactPoint', 'additionalProperty']
19
+ ['id', 'codeValue', 'name']
24
20
  );
25
21
  // tslint:disable-next-line:no-null-keyword
26
22
  console.dir(docs, { depth: null });
@@ -6,10 +6,23 @@ 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 eventRepo = await chevre.repository.Event.createInstance(mongoose.connection);
9
+ const creativeWorkRepo = await chevre.repository.CreativeWork.createInstance(mongoose.connection);
10
+ const offerItemConditionRepo = await chevre.repository.OfferItemCondition.createInstance(mongoose.connection);
10
11
 
11
12
  let updateResult: any;
12
- updateResult = await eventRepo.unsetUnnecessaryFields({
13
+ updateResult = await creativeWorkRepo.unsetUnnecessaryFields({
14
+ filter: {
15
+ _id: { $exists: true }
16
+ },
17
+ $unset: <any>{
18
+ createdAt: 1,
19
+ updatedAt: 1,
20
+ __v: 1
21
+ }
22
+ });
23
+ console.log(updateResult);
24
+
25
+ updateResult = await offerItemConditionRepo.unsetUnnecessaryFields({
13
26
  filter: {
14
27
  _id: { $exists: true }
15
28
  },
@@ -0,0 +1,180 @@
1
+ // tslint:disable:no-console
2
+ import * as mongoose from 'mongoose';
3
+ import { chevre } from '../../../lib/index';
4
+
5
+ const PROJECT_ID = String(process.env.PROJECT_ID);
6
+
7
+ // tslint:disable-next-line:max-func-body-length
8
+ async function main() {
9
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
10
+
11
+ const eventRepo = await chevre.repository.Event.createInstance(mongoose.connection);
12
+ const result = await eventRepo.upsertManyByAdditionalProperty({
13
+ events: [
14
+ {
15
+ additionalProperty: [
16
+ {
17
+ name: 'createId',
18
+ value: 'akeuu512i-10-202409151130-01'
19
+ }
20
+ ],
21
+ project: {
22
+ id: PROJECT_ID,
23
+ typeOf: chevre.factory.organizationType.Project
24
+ },
25
+ typeOf: chevre.factory.eventType.ScreeningEvent,
26
+ doorTime: new Date('2024-09-15T02:30:00.000Z'),
27
+ endDate: new Date('2024-09-15T11:45:00.000Z'),
28
+ // eventStatus: chevre.factory.eventStatusType.EventScheduled,
29
+ eventStatus: chevre.factory.eventStatusType.EventCancelled,
30
+ location: {
31
+ typeOf: chevre.factory.placeType.ScreeningRoom,
32
+ branchCode: '10',
33
+ name: {
34
+ ja: 'シネマ1',
35
+ en: 'CINEMA1'
36
+ },
37
+ address: {
38
+ ja: '7階',
39
+ en: '7F'
40
+ }
41
+ },
42
+ name: {
43
+ en: 'Ocean\'s Eight',
44
+ ja: 'オーシャンズ8'
45
+ },
46
+ offers: {
47
+ typeOf: chevre.factory.offerType.Offer,
48
+ availabilityEnds: new Date('2024-09-15T11:45:00.000Z'),
49
+ availabilityStarts: new Date('2024-09-01T15:00:00.000Z'),
50
+ eligibleQuantity: {
51
+ typeOf: 'QuantitativeValue',
52
+ unitCode: chevre.factory.unitCode.C62,
53
+ maxValue: 10
54
+ },
55
+ itemOffered: {
56
+ id: '6603a61f0c914b6c7fd18f99',
57
+ name: {
58
+ ja: 'アップロードテスト用(ムビチケあり)'
59
+ },
60
+ serviceOutput: {
61
+ typeOf: chevre.factory.reservationType.EventReservation,
62
+ reservedTicket: {
63
+ typeOf: 'Ticket',
64
+ ticketedSeat: {
65
+ typeOf: chevre.factory.placeType.Seat
66
+ }
67
+ }
68
+ },
69
+ typeOf: chevre.factory.product.ProductType.EventService,
70
+ availableChannel: {
71
+ typeOf: 'ServiceChannel',
72
+ serviceLocation: {
73
+ typeOf: chevre.factory.placeType.ScreeningRoom,
74
+ branchCode: '10',
75
+ name: {
76
+ ja: 'シネマ1',
77
+ en: 'CINEMA1'
78
+ },
79
+ containedInPlace: {
80
+ typeOf: chevre.factory.placeType.MovieTheater,
81
+ id: '5bfb841d5a78d7948369979a',
82
+ branchCode: '118',
83
+ name: {
84
+ ja: 'シネモーション赤坂 ',
85
+ en: 'CineMotion Akasaka'
86
+ }
87
+ }
88
+ }
89
+ },
90
+ serviceType: {
91
+ codeValue: '0001',
92
+ id: '64caf203c73a205ccefe80c5',
93
+ inCodeSet: {
94
+ typeOf: 'CategoryCodeSet',
95
+ identifier: chevre.factory.categoryCode.CategorySetIdentifier.ServiceType
96
+ },
97
+ typeOf: 'CategoryCode'
98
+ }
99
+ },
100
+ validFrom: new Date('2024-09-01T15:00:00.000Z'),
101
+ validThrough: new Date('2024-09-15T11:45:00.000Z'),
102
+ seller: {
103
+ typeOf: chevre.factory.organizationType.Corporation,
104
+ id: '59d20831e53ebc2b4e774466',
105
+ name: {
106
+ ja: 'シネモーション赤坂',
107
+ en: 'CineMotion Akasaka'
108
+ },
109
+ makesOffer: []
110
+ },
111
+ unacceptedPaymentMethod: [
112
+ 'MovieTicket'
113
+ ]
114
+ },
115
+ organizer: {
116
+ id: '59d20831e53ebc2b4e774466'
117
+ },
118
+ startDate: new Date('2024-09-15T02:30:00.000Z'),
119
+ superEvent: {
120
+ typeOf: chevre.factory.eventType.ScreeningEventSeries,
121
+ id: 'akeuu512i',
122
+ videoFormat: [
123
+ {
124
+ typeOf: '2D',
125
+ name: '2D'
126
+ }
127
+ ],
128
+ soundFormat: [],
129
+ workPerformed: {
130
+ typeOf: chevre.factory.creativeWorkType.Movie,
131
+ identifier: '00002',
132
+ id: '5bfb841d5a78d79483699803',
133
+ name: {
134
+ en: 'Ocean\'s Eight',
135
+ ja: 'オーシャンズ8'
136
+ },
137
+ duration: 'PT1H50M'
138
+ },
139
+ location: {
140
+ typeOf: chevre.factory.placeType.MovieTheater,
141
+ id: '5bfb841d5a78d7948369979a',
142
+ branchCode: '118',
143
+ name: {
144
+ ja: 'シネモーション赤坂 ',
145
+ en: 'CineMotion Akasaka'
146
+ }
147
+ },
148
+ kanaName: '',
149
+ name: {
150
+ en: 'Ocean\'s Eight',
151
+ ja: 'オーシャンズ8'
152
+ },
153
+ additionalProperty: [],
154
+ startDate: new Date('2020-08-31T15:00:00.000Z'),
155
+ endDate: new Date('2030-01-01T15:00:00.000Z'),
156
+ description: {
157
+ en: '2018 United States crime movie.',
158
+ ja: '2018年のアメリカ合衆国の犯罪映画。'
159
+ },
160
+ headline: {
161
+ ja: '2018/12/14'
162
+ }
163
+ }
164
+ }
165
+ ],
166
+ additionalPropertyFilter: { name: 'createId' },
167
+ eventSeries: {
168
+ id: 'akeuu512i'
169
+ },
170
+ screeningRoom: {
171
+ branchCode: '10'
172
+ }
173
+ });
174
+ // tslint:disable-next-line:no-null-keyword
175
+ console.dir(result, { depth: null });
176
+ }
177
+
178
+ main()
179
+ .then(console.log)
180
+ .catch(console.error);
@@ -1,3 +1,27 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
1
25
  import type { Connection } from 'mongoose';
2
26
  import * as factory from '../factory';
3
27
  /**
@@ -125,5 +149,5 @@ export declare class AccountRepo {
125
149
  unsetUnnecessaryFields(params: {
126
150
  filter: any;
127
151
  $unset: any;
128
- }): Promise<import("mongodb").UpdateResult>;
152
+ }): Promise<import("mongoose").UpdateWriteOpResult>;
129
153
  }
@@ -36,13 +36,13 @@ export declare class AccountTitleRepo {
36
36
  id: string;
37
37
  };
38
38
  }): Promise<void>;
39
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, factory.accountTitle.IAccountTitle> & Omit<factory.accountTitle.IAccountTitle & {
39
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, factory.accountTitle.IAccountTitle> & factory.accountTitle.IAccountTitle & {
40
40
  _id: import("mongoose").Types.ObjectId;
41
- }, never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, factory.accountTitle.IAccountTitle> & Omit<factory.accountTitle.IAccountTitle & {
41
+ }, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, factory.accountTitle.IAccountTitle> & factory.accountTitle.IAccountTitle & {
42
42
  _id: import("mongoose").Types.ObjectId;
43
- }, never>>>;
43
+ }>>;
44
44
  unsetUnnecessaryFields(params: {
45
45
  filter: any;
46
46
  $unset: any;
47
- }): Promise<import("mongodb").UpdateResult>;
47
+ }): Promise<import("mongoose").UpdateWriteOpResult>;
48
48
  }
@@ -1,3 +1,27 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
1
25
  import type { Connection, PipelineStage } from 'mongoose';
2
26
  import { IAccountingReport, IChildReport, IOrder4report } from './mongoose/schemas/accountingReport';
3
27
  import * as factory from '../factory';
@@ -44,5 +68,5 @@ export declare class AccountingReportRepo {
44
68
  unsetUnnecessaryFields(params: {
45
69
  filter: any;
46
70
  $unset: any;
47
- }): Promise<import("mongodb").UpdateResult>;
71
+ }): Promise<import("mongoose").UpdateWriteOpResult>;
48
72
  }
@@ -284,8 +284,8 @@ export declare class ActionRepo {
284
284
  } | null>;
285
285
  saveRecipeWithDateCreated(savingRecipe: IRecipeAsDocument & {
286
286
  dateModified: Date;
287
- }): Promise<import("mongodb").UpdateResult>;
288
- saveActionWithEndDate(savingAction: Omit<factory.action.authorize.invoice.IAction, 'id'>): Promise<import("mongodb").UpdateResult>;
287
+ }): Promise<import("mongoose").UpdateWriteOpResult>;
288
+ saveActionWithEndDate(savingAction: Omit<factory.action.authorize.invoice.IAction, 'id'>): Promise<import("mongoose").UpdateWriteOpResult>;
289
289
  findRecipeByAction<T extends factory.recipe.RecipeCategory>(params: {
290
290
  project: {
291
291
  id: string;
@@ -381,6 +381,7 @@ export declare class ActionRepo {
381
381
  location?: any;
382
382
  description?: string | undefined;
383
383
  result?: any;
384
+ toLocation?: any;
384
385
  actionStatus: factory.actionStatusType;
385
386
  endDate?: Date | undefined;
386
387
  purpose?: import("@chevre/factory/lib/action").IPurpose | undefined;
@@ -391,11 +392,10 @@ export declare class ActionRepo {
391
392
  recipient?: import("@chevre/factory/lib/action").IParticipant | undefined;
392
393
  sameAs?: import("@chevre/factory/lib/action").ISameAs | undefined;
393
394
  fromLocation?: any;
394
- toLocation?: any;
395
395
  replacer?: any;
396
396
  targetCollection?: any;
397
397
  cancelAction?: any;
398
- }> & Omit<{
398
+ }> & {
399
399
  object: any;
400
400
  error?: any;
401
401
  project: Pick<factory.project.IProject, "id" | "typeOf">;
@@ -404,6 +404,7 @@ export declare class ActionRepo {
404
404
  location?: any;
405
405
  description?: string | undefined;
406
406
  result?: any;
407
+ toLocation?: any;
407
408
  actionStatus: factory.actionStatusType;
408
409
  endDate?: Date | undefined;
409
410
  purpose?: import("@chevre/factory/lib/action").IPurpose | undefined;
@@ -414,13 +415,12 @@ export declare class ActionRepo {
414
415
  recipient?: import("@chevre/factory/lib/action").IParticipant | undefined;
415
416
  sameAs?: import("@chevre/factory/lib/action").ISameAs | undefined;
416
417
  fromLocation?: any;
417
- toLocation?: any;
418
418
  replacer?: any;
419
419
  targetCollection?: any;
420
420
  cancelAction?: any;
421
421
  } & {
422
422
  _id: import("mongoose").Types.ObjectId;
423
- }, never>, QueryOptions<import("mongoose").Document<unknown, {}, {
423
+ }, QueryOptions<import("mongoose").Document<unknown, {}, {
424
424
  object: any;
425
425
  error?: any;
426
426
  project: Pick<factory.project.IProject, "id" | "typeOf">;
@@ -429,6 +429,7 @@ export declare class ActionRepo {
429
429
  location?: any;
430
430
  description?: string | undefined;
431
431
  result?: any;
432
+ toLocation?: any;
432
433
  actionStatus: factory.actionStatusType;
433
434
  endDate?: Date | undefined;
434
435
  purpose?: import("@chevre/factory/lib/action").IPurpose | undefined;
@@ -439,11 +440,10 @@ export declare class ActionRepo {
439
440
  recipient?: import("@chevre/factory/lib/action").IParticipant | undefined;
440
441
  sameAs?: import("@chevre/factory/lib/action").ISameAs | undefined;
441
442
  fromLocation?: any;
442
- toLocation?: any;
443
443
  replacer?: any;
444
444
  targetCollection?: any;
445
445
  cancelAction?: any;
446
- }> & Omit<{
446
+ }> & {
447
447
  object: any;
448
448
  error?: any;
449
449
  project: Pick<factory.project.IProject, "id" | "typeOf">;
@@ -452,6 +452,7 @@ export declare class ActionRepo {
452
452
  location?: any;
453
453
  description?: string | undefined;
454
454
  result?: any;
455
+ toLocation?: any;
455
456
  actionStatus: factory.actionStatusType;
456
457
  endDate?: Date | undefined;
457
458
  purpose?: import("@chevre/factory/lib/action").IPurpose | undefined;
@@ -462,17 +463,16 @@ export declare class ActionRepo {
462
463
  recipient?: import("@chevre/factory/lib/action").IParticipant | undefined;
463
464
  sameAs?: import("@chevre/factory/lib/action").ISameAs | undefined;
464
465
  fromLocation?: any;
465
- toLocation?: any;
466
466
  replacer?: any;
467
467
  targetCollection?: any;
468
468
  cancelAction?: any;
469
469
  } & {
470
470
  _id: import("mongoose").Types.ObjectId;
471
- }, never>>>;
471
+ }>>;
472
472
  unsetUnnecessaryFields(params: {
473
473
  filter: FilterQuery<factory.action.IAction<factory.action.IAttributes<factory.actionType, any, any>>>;
474
474
  $unset: any;
475
- }): Promise<import("mongodb").UpdateResult>;
475
+ }): Promise<import("mongoose").UpdateWriteOpResult>;
476
476
  private agggregateByStatus;
477
477
  private upsertRecipe;
478
478
  }