@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
@@ -508,12 +508,6 @@ class ActionRepo {
508
508
  var _a, _b;
509
509
  return __awaiter(this, void 0, void 0, function* () {
510
510
  const startDate = new Date();
511
- // const startedAction: IAction<T> = await this.actionModel.create<AnyKeys<IAction<T>>>({
512
- // ...attributes,
513
- // actionStatus: factory.actionStatusType.ActiveActionStatus,
514
- // startDate
515
- // })
516
- // .then((doc) => doc.toObject());
517
511
  const creatingAction = Object.assign(Object.assign({}, attributes), { actionStatus: factory.actionStatusType.ActiveActionStatus, startDate });
518
512
  // reimplemnt with insertMany(2024-08-29~)
519
513
  const result = yield this.actionModel.insertMany(creatingAction, { rawResult: true });
@@ -1221,7 +1215,10 @@ class ActionRepo {
1221
1215
  return this.actionRecipeModel.findOne({
1222
1216
  'project.id': { $eq: params.project.id },
1223
1217
  'recipeFor.id': { $eq: params.recipeFor.id }
1224
- }, { step: 1, recipeCategory: 1 }, { lean: true })
1218
+ }, { step: 1, recipeCategory: 1 }
1219
+ // { lean: true }
1220
+ )
1221
+ .lean()
1225
1222
  .exec();
1226
1223
  // if (result === null) {
1227
1224
  // throw new factory.errors.NotFound(this.actionRecipeModel.modelName);
@@ -1,23 +1,47 @@
1
- import type { Connection } from 'mongoose';
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" />
25
+ import type { Connection, FilterQuery } from 'mongoose';
2
26
  import * as factory from '../factory';
27
+ type IKeyOfProjection = keyof factory.additionalProperty.IAdditionalProperty;
3
28
  /**
4
29
  * 追加特性リポジトリ
5
30
  */
6
31
  export declare class AdditionalPropertyRepo {
7
32
  private readonly additionalPropertyModel;
8
33
  constructor(connection: Connection);
9
- static CREATE_MONGO_CONDITIONS(params: factory.additionalProperty.ISearchConditions): any[];
34
+ static CREATE_MONGO_CONDITIONS(params: factory.additionalProperty.ISearchConditions): FilterQuery<factory.additionalProperty.IAdditionalProperty>[];
10
35
  /**
11
36
  * 検索
12
37
  */
13
- search(params: factory.additionalProperty.ISearchConditions): Promise<factory.additionalProperty.IAdditionalProperty[]>;
14
- findById(params: {
15
- id: string;
16
- }): Promise<factory.additionalProperty.IAdditionalProperty>;
38
+ projectFields(params: factory.additionalProperty.ISearchConditions, inclusion: IKeyOfProjection[]): Promise<factory.additionalProperty.IAdditionalProperty[]>;
17
39
  save(params: {
18
40
  id?: string;
19
41
  attributes: factory.additionalProperty.IAdditionalProperty;
20
- }): Promise<factory.additionalProperty.IAdditionalProperty>;
42
+ }): Promise<{
43
+ id: string;
44
+ }>;
21
45
  /**
22
46
  * 削除する
23
47
  */
@@ -35,5 +59,6 @@ export declare class AdditionalPropertyRepo {
35
59
  unsetUnnecessaryFields(params: {
36
60
  filter: any;
37
61
  $unset: any;
38
- }): Promise<import("mongodb").UpdateResult>;
62
+ }): Promise<import("mongoose").UpdateWriteOpResult>;
39
63
  }
64
+ export {};
@@ -21,9 +21,16 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.AdditionalPropertyRepo = void 0;
24
- const additionalProperty_1 = require("./mongoose/schemas/additionalProperty");
25
24
  const factory = require("../factory");
26
25
  const settings_1 = require("../settings");
26
+ const additionalProperty_1 = require("./mongoose/schemas/additionalProperty");
27
+ const AVAILABLE_PROJECT_FIELDS = [
28
+ 'project',
29
+ 'typeOf',
30
+ 'codeValue',
31
+ 'inCodeSet',
32
+ 'name'
33
+ ];
27
34
  /**
28
35
  * 追加特性リポジトリ
29
36
  */
@@ -33,109 +40,58 @@ class AdditionalPropertyRepo {
33
40
  }
34
41
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
35
42
  static CREATE_MONGO_CONDITIONS(params) {
36
- var _a, _b, _c, _d;
37
- // MongoDB検索条件
43
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
38
44
  const andConditions = [];
39
- // tslint:disable-next-line:no-single-line-block-comment
40
- /* istanbul ignore else */
41
- if (params.project !== undefined && params.project !== null) {
42
- if (params.project.id !== undefined && params.project.id !== null) {
43
- if (typeof params.project.id.$eq === 'string') {
44
- andConditions.push({
45
- 'project.id': {
46
- $eq: params.project.id.$eq
47
- }
48
- });
49
- }
50
- }
45
+ const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
46
+ if (typeof projectIdEq === 'string') {
47
+ andConditions.push({ 'project.id': { $eq: projectIdEq } });
51
48
  }
52
- // tslint:disable-next-line:no-single-line-block-comment
53
- /* istanbul ignore else */
54
- if (params.id !== undefined && params.id !== null) {
55
- if (typeof params.id.$eq === 'string') {
56
- andConditions.push({
57
- _id: {
58
- $eq: params.id.$eq
59
- }
60
- });
61
- }
49
+ const idEq = (_c = params.id) === null || _c === void 0 ? void 0 : _c.$eq;
50
+ if (typeof idEq === 'string') {
51
+ andConditions.push({ _id: { $eq: idEq } });
62
52
  }
63
- // tslint:disable-next-line:no-single-line-block-comment
64
- /* istanbul ignore else */
65
- if (params.name !== undefined && params.name !== null) {
66
- if (typeof params.name.$regex === 'string' && params.name.$regex.length > 0) {
67
- andConditions.push({
68
- $or: [
69
- {
70
- 'name.ja': {
71
- $exists: true,
72
- $regex: new RegExp(params.name.$regex)
73
- }
74
- },
75
- {
76
- 'name.en': {
77
- $exists: true,
78
- $regex: new RegExp(params.name.$regex)
79
- }
80
- }
81
- ]
82
- });
83
- }
84
- }
85
- const codeValueEq = (_a = params.codeValue) === null || _a === void 0 ? void 0 : _a.$eq;
86
- if (typeof codeValueEq === 'string') {
53
+ const nameRegex = (_d = params.name) === null || _d === void 0 ? void 0 : _d.$regex;
54
+ if (typeof nameRegex === 'string' && nameRegex.length > 0) {
87
55
  andConditions.push({
88
- codeValue: {
89
- $exists: true,
90
- $eq: codeValueEq
91
- }
56
+ $or: [
57
+ { 'name.ja': { $exists: true, $regex: new RegExp(nameRegex) } },
58
+ { 'name.en': { $exists: true, $regex: new RegExp(nameRegex) } }
59
+ ]
92
60
  });
93
61
  }
94
- const codeValueIn = (_b = params.codeValue) === null || _b === void 0 ? void 0 : _b.$in;
62
+ const codeValueEq = (_e = params.codeValue) === null || _e === void 0 ? void 0 : _e.$eq;
63
+ if (typeof codeValueEq === 'string') {
64
+ andConditions.push({ codeValue: { $exists: true, $eq: codeValueEq } });
65
+ }
66
+ const codeValueIn = (_f = params.codeValue) === null || _f === void 0 ? void 0 : _f.$in;
95
67
  if (Array.isArray(codeValueIn)) {
96
- andConditions.push({
97
- codeValue: {
98
- $exists: true,
99
- $in: codeValueIn
100
- }
101
- });
68
+ andConditions.push({ codeValue: { $exists: true, $in: codeValueIn } });
102
69
  }
103
- // tslint:disable-next-line:no-single-line-block-comment
104
- /* istanbul ignore else */
105
- if (params.inCodeSet !== undefined && params.inCodeSet !== null) {
106
- if (params.inCodeSet.identifier !== undefined && params.inCodeSet.identifier !== null) {
107
- if (typeof params.inCodeSet.identifier.$eq === 'string') {
108
- andConditions.push({
109
- 'inCodeSet.identifier': {
110
- $exists: true,
111
- $eq: params.inCodeSet.identifier.$eq
112
- }
113
- });
114
- }
115
- }
70
+ const inCodeSetIdentifierEq = (_h = (_g = params.inCodeSet) === null || _g === void 0 ? void 0 : _g.identifier) === null || _h === void 0 ? void 0 : _h.$eq;
71
+ if (typeof inCodeSetIdentifierEq === 'string') {
72
+ andConditions.push({ 'inCodeSet.identifier': { $exists: true, $eq: inCodeSetIdentifierEq } });
116
73
  }
117
- const inCodeSetIdentifierIn = (_d = (_c = params.inCodeSet) === null || _c === void 0 ? void 0 : _c.identifier) === null || _d === void 0 ? void 0 : _d.$in;
74
+ const inCodeSetIdentifierIn = (_k = (_j = params.inCodeSet) === null || _j === void 0 ? void 0 : _j.identifier) === null || _k === void 0 ? void 0 : _k.$in;
118
75
  if (Array.isArray(inCodeSetIdentifierIn)) {
119
- andConditions.push({
120
- 'inCodeSet.identifier': {
121
- $exists: true,
122
- $in: inCodeSetIdentifierIn
123
- }
124
- });
76
+ andConditions.push({ 'inCodeSet.identifier': { $exists: true, $in: inCodeSetIdentifierIn } });
125
77
  }
126
78
  return andConditions;
127
79
  }
128
80
  /**
129
81
  * 検索
130
82
  */
131
- search(params) {
83
+ projectFields(params, inclusion) {
132
84
  return __awaiter(this, void 0, void 0, function* () {
133
85
  const conditions = AdditionalPropertyRepo.CREATE_MONGO_CONDITIONS(params);
134
- const query = this.additionalPropertyModel.find((conditions.length > 0) ? { $and: conditions } : {}, {
135
- __v: 0,
136
- createdAt: 0,
137
- updatedAt: 0
138
- });
86
+ let positiveProjectionFields = AVAILABLE_PROJECT_FIELDS;
87
+ if (Array.isArray(inclusion) && inclusion.length > 0) {
88
+ positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PROJECT_FIELDS.includes(key));
89
+ }
90
+ else {
91
+ throw new factory.errors.ArgumentNull('inclusion', 'inclusion must be specified');
92
+ }
93
+ const projection = Object.assign({ _id: 0, id: { $toString: '$_id' } }, Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1]))));
94
+ const query = this.additionalPropertyModel.find((conditions.length > 0) ? { $and: conditions } : {}, projection);
139
95
  if (typeof params.limit === 'number' && params.limit > 0) {
140
96
  const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
141
97
  query.limit(params.limit)
@@ -147,39 +103,29 @@ class AdditionalPropertyRepo {
147
103
  query.sort(params.sort);
148
104
  }
149
105
  return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
150
- .exec()
151
- .then((docs) => docs.map((doc) => doc.toObject()));
152
- });
153
- }
154
- findById(params) {
155
- return __awaiter(this, void 0, void 0, function* () {
156
- const doc = yield this.additionalPropertyModel.findOne({ _id: params.id }, {
157
- __v: 0,
158
- createdAt: 0,
159
- updatedAt: 0
160
- })
106
+ .lean() // 2024-09-19~
161
107
  .exec();
162
- if (doc === null) {
163
- throw new factory.errors.NotFound(this.additionalPropertyModel.modelName);
164
- }
165
- return doc.toObject();
166
108
  });
167
109
  }
168
110
  save(params) {
169
111
  return __awaiter(this, void 0, void 0, function* () {
112
+ let savedId;
170
113
  let doc;
171
114
  if (typeof params.id !== 'string') {
172
- doc = yield this.additionalPropertyModel.create(params.attributes);
115
+ const _a = params.attributes, { id } = _a, createParams = __rest(_a, ["id"]);
116
+ doc = yield this.additionalPropertyModel.create(createParams);
117
+ savedId = doc.id;
173
118
  }
174
119
  else {
175
- const _a = params.attributes, { id, codeValue, inCodeSet, project, typeOf } = _a, updateFields = __rest(_a, ["id", "codeValue", "inCodeSet", "project", "typeOf"]);
176
- doc = yield this.additionalPropertyModel.findOneAndUpdate({ _id: params.id }, updateFields, { upsert: false, new: true })
120
+ const _b = params.attributes, { id, codeValue, inCodeSet, project, typeOf } = _b, updateFields = __rest(_b, ["id", "codeValue", "inCodeSet", "project", "typeOf"]);
121
+ doc = yield this.additionalPropertyModel.findOneAndUpdate({ _id: { $eq: params.id } }, updateFields, { upsert: false, new: true, projection: { _id: 1 } })
177
122
  .exec();
123
+ savedId = params.id;
178
124
  }
179
125
  if (doc === null) {
180
126
  throw new factory.errors.NotFound(this.additionalPropertyModel.modelName);
181
127
  }
182
- return doc.toObject();
128
+ return { id: savedId };
183
129
  });
184
130
  }
185
131
  /**
@@ -187,7 +133,7 @@ class AdditionalPropertyRepo {
187
133
  */
188
134
  deleteById(params) {
189
135
  return __awaiter(this, void 0, void 0, function* () {
190
- yield this.additionalPropertyModel.findOneAndRemove({ _id: params.id })
136
+ yield this.additionalPropertyModel.findOneAndRemove({ _id: { $eq: params.id } }, { projection: { _id: 1 } })
191
137
  .exec();
192
138
  });
193
139
  }
@@ -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 { AnyExpression, Connection, FilterQuery, PipelineStage } from 'mongoose';
2
26
  import * as factory from '../factory';
3
27
  type IMatchStage = PipelineStage.Match;
@@ -68,10 +92,10 @@ export declare class AggregateOfferRepo {
68
92
  /**
69
93
  * 単価オファー最適化作業における一時的な処理
70
94
  */
71
- optimizeOffers(): Promise<import("mongodb").UpdateResult>;
95
+ optimizeOffers(): Promise<import("mongoose").UpdateWriteOpResult>;
72
96
  unsetUnnecessaryFields(params: {
73
97
  filter: FilterQuery<factory.aggregateOffer.IAggregateOffer>;
74
98
  $unset: any;
75
- }): Promise<import("mongodb").UpdateResult>;
99
+ }): Promise<import("mongoose").UpdateWriteOpResult>;
76
100
  }
77
101
  export {};
@@ -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 * as factory from '../factory';
3
27
  import { IAggregateReservation } from './mongoose/schemas/aggregateReservation';
@@ -54,6 +78,6 @@ export declare class AggregateReservationRepo {
54
78
  unsetUnnecessaryFields(params: {
55
79
  filter: any;
56
80
  $unset: any;
57
- }): Promise<import("mongodb").UpdateResult>;
81
+ }): Promise<import("mongoose").UpdateWriteOpResult>;
58
82
  }
59
83
  export {};
@@ -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
  export declare enum AggregationType {
@@ -38,7 +62,7 @@ export interface IAggregation {
38
62
  export declare class AggregationRepo {
39
63
  private readonly aggregationModel;
40
64
  constructor(connection: Connection);
41
- saveAggregation(params: IAggregation): Promise<import("mongodb").UpdateResult>;
65
+ saveAggregation(params: IAggregation): Promise<import("mongoose").UpdateWriteOpResult>;
42
66
  search(params: {
43
67
  limit: number;
44
68
  page: number;
@@ -64,5 +88,5 @@ export declare class AggregationRepo {
64
88
  unsetUnnecessaryFields(params: {
65
89
  filter: any;
66
90
  $unset: any;
67
- }): Promise<import("mongodb").UpdateResult>;
91
+ }): Promise<import("mongoose").UpdateWriteOpResult>;
68
92
  }
@@ -268,7 +268,7 @@ export declare class AssetTransactionRepo {
268
268
  }): Promise<void>;
269
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
270
  seller?: any;
271
- }> & Omit<(import("@chevre/factory/lib/assetTransaction/cancelReservation").IAttributes & {
271
+ }> & ((import("@chevre/factory/lib/assetTransaction/cancelReservation").IAttributes & {
272
272
  id: string;
273
273
  } & {
274
274
  seller?: any;
@@ -304,9 +304,9 @@ export declare class AssetTransactionRepo {
304
304
  seller?: any;
305
305
  } & {
306
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) & {
307
+ })), 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
308
  seller?: any;
309
- }> & Omit<(import("@chevre/factory/lib/assetTransaction/cancelReservation").IAttributes & {
309
+ }> & ((import("@chevre/factory/lib/assetTransaction/cancelReservation").IAttributes & {
310
310
  id: string;
311
311
  } & {
312
312
  seller?: any;
@@ -342,11 +342,11 @@ export declare class AssetTransactionRepo {
342
342
  seller?: any;
343
343
  } & {
344
344
  _id: import("mongoose").Types.ObjectId;
345
- }), never>>>;
345
+ }))>>;
346
346
  unsetUnnecessaryFields(params: {
347
347
  filter: any;
348
348
  $unset: any;
349
- }): Promise<import("mongodb").UpdateResult>;
349
+ }): Promise<import("mongoose").UpdateWriteOpResult>;
350
350
  aggregateAssetTransaction(params: {
351
351
  project?: {
352
352
  id?: {
@@ -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, FilterQuery } from 'mongoose';
2
26
  import * as factory from '../factory';
3
27
  type IFindValidOneResult = Pick<factory.authorization.IAuthorization, 'object' | 'typeOf' | 'audience' | 'issuedBy'> & {
@@ -48,7 +72,7 @@ export declare class AuthorizationRepo {
48
72
  unsetUnnecessaryFields(params: {
49
73
  filter: FilterQuery<factory.authorization.IAuthorization>;
50
74
  $unset: any;
51
- }): Promise<import("mongodb").UpdateResult>;
75
+ }): Promise<import("mongoose").UpdateWriteOpResult>;
52
76
  /**
53
77
  * コードを保管する
54
78
  */
@@ -86,6 +86,6 @@ export declare class CategoryCodeRepo {
86
86
  unsetUnnecessaryFields(params: {
87
87
  filter: FilterQuery<factory.categoryCode.ICategoryCode>;
88
88
  $unset: any;
89
- }): Promise<import("mongodb").UpdateResult>;
89
+ }): Promise<import("mongoose").UpdateWriteOpResult>;
90
90
  }
91
91
  export {};
@@ -54,9 +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<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/creativeWork/comment").IComment> & Omit<import("@chevre/factory/lib/creativeWork/comment").IComment & {
57
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/creativeWork/comment").IComment> & import("@chevre/factory/lib/creativeWork/comment").IComment & {
58
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 & {
59
+ }, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/creativeWork/comment").IComment> & import("@chevre/factory/lib/creativeWork/comment").IComment & {
60
60
  _id: import("mongoose").Types.ObjectId;
61
- }, never>>>;
61
+ }>>;
62
62
  }
@@ -23,9 +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 { Connection, Document, FilterQuery, Types } from 'mongoose';
26
+ import { Connection, FilterQuery, Types } from 'mongoose';
27
27
  import * as factory from '../factory';
28
- type IKeyOfProjection = keyof factory.creativeWork.movie.ICreativeWork | '_id';
28
+ type IKeyOfProjection = keyof factory.creativeWork.movie.ICreativeWork;
29
29
  /**
30
30
  * コンテンツリポジトリ
31
31
  */
@@ -43,7 +43,9 @@ export declare class CreativeWorkRepo {
43
43
  $unset?: {
44
44
  [key in keyof factory.creativeWork.movie.ICreativeWork]?: 1;
45
45
  };
46
- }): Promise<any>;
46
+ }): Promise<{
47
+ id: string;
48
+ }>;
47
49
  /**
48
50
  * コードをキーにして冪等作成
49
51
  */
@@ -60,7 +62,7 @@ export declare class CreativeWorkRepo {
60
62
  /**
61
63
  * コンテンツを検索する
62
64
  */
63
- searchMovies(params: factory.creativeWork.movie.ISearchConditions, inclusion: IKeyOfProjection[], exclusion: IKeyOfProjection[]): Promise<factory.creativeWork.movie.ICreativeWork[]>;
65
+ projectFields(params: factory.creativeWork.movie.ISearchConditions, inclusion: IKeyOfProjection[]): Promise<factory.creativeWork.movie.ICreativeWork[]>;
64
66
  /**
65
67
  * コンテンツを削除する
66
68
  */
@@ -72,22 +74,22 @@ export declare class CreativeWorkRepo {
72
74
  id: string;
73
75
  };
74
76
  }): Promise<void>;
75
- getCursor(conditions: FilterQuery<factory.creativeWork.movie.ICreativeWork>, projection: any): import("mongoose").Cursor<Document<unknown, {}, import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
77
+ getCursor(conditions: FilterQuery<factory.creativeWork.movie.ICreativeWork>, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
76
78
  description?: string | undefined;
77
- }> & Omit<import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
79
+ }> & import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
78
80
  description?: string | undefined;
79
81
  } & {
80
82
  _id: Types.ObjectId;
81
- }, never>, import("mongoose").QueryOptions<Document<unknown, {}, import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
83
+ }, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
82
84
  description?: string | undefined;
83
- }> & Omit<import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
85
+ }> & import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
84
86
  description?: string | undefined;
85
87
  } & {
86
88
  _id: Types.ObjectId;
87
- }, never>>>;
89
+ }>>;
88
90
  unsetUnnecessaryFields(params: {
89
91
  filter: FilterQuery<factory.creativeWork.movie.ICreativeWork>;
90
92
  $unset: any;
91
- }): Promise<import("mongodb").UpdateResult>;
93
+ }): Promise<import("mongoose").UpdateWriteOpResult>;
92
94
  }
93
95
  export {};