@chevre/domain 22.1.0-alpha.8 → 22.1.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 (42) hide show
  1. package/example/src/chevre/attendIfNotAttended.ts +11 -2
  2. package/example/src/chevre/projectReservationFields.ts +31 -0
  3. package/example/src/chevre/projectReservationFieldsById.ts +24 -0
  4. package/example/src/chevre/saveAggregateReservation.ts +43 -0
  5. package/example/src/chevre/unsetUnnecessaryFields.ts +68 -0
  6. package/example/src/chevre/updateProjectAggregateReservation.ts +21 -0
  7. package/lib/chevre/repo/accountingReport.d.ts +4 -0
  8. package/lib/chevre/repo/accountingReport.js +6 -0
  9. package/lib/chevre/repo/aggregateReservation.d.ts +4 -0
  10. package/lib/chevre/repo/aggregateReservation.js +7 -1
  11. package/lib/chevre/repo/event.d.ts +0 -1
  12. package/lib/chevre/repo/mongoose/schemas/accountingReport.js +2 -4
  13. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +13 -12
  14. package/lib/chevre/repo/mongoose/schemas/comments.js +10 -12
  15. package/lib/chevre/repo/mongoose/schemas/customerType.js +10 -12
  16. package/lib/chevre/repo/mongoose/schemas/emailMessages.js +10 -12
  17. package/lib/chevre/repo/mongoose/schemas/priceSpecification.js +11 -12
  18. package/lib/chevre/repo/mongoose/schemas/project.js +5 -4
  19. package/lib/chevre/repo/mongoose/schemas/reservation.js +11 -13
  20. package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +10 -12
  21. package/lib/chevre/repo/mongoose/schemas/telemetry.js +2 -4
  22. package/lib/chevre/repo/priceSpecification.d.ts +4 -0
  23. package/lib/chevre/repo/priceSpecification.js +6 -0
  24. package/lib/chevre/repo/project.d.ts +4 -0
  25. package/lib/chevre/repo/project.js +11 -5
  26. package/lib/chevre/repo/reservation.d.ts +16 -9
  27. package/lib/chevre/repo/reservation.js +181 -64
  28. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +2 -1
  29. package/lib/chevre/service/assetTransaction/cancelReservation/factory.d.ts +3 -1
  30. package/lib/chevre/service/assetTransaction/cancelReservation.js +5 -2
  31. package/lib/chevre/service/reserve/cancelReservation.js +9 -7
  32. package/lib/chevre/service/reserve/confirmReservation.js +5 -2
  33. package/lib/chevre/service/reserve/findByCode.js +3 -3
  34. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +3 -4
  35. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +2 -3
  36. package/lib/chevre/service/reserve/searchByOrder.js +1 -1
  37. package/lib/chevre/service/reserve/useReservation.js +3 -3
  38. package/lib/chevre/service/task/onAuthorizationCreated.js +5 -2
  39. package/lib/chevre/service/transaction/returnOrder/preStart.js +2 -2
  40. package/package.json +3 -3
  41. package/example/src/chevre/projectOrderFields.ts +0 -55
  42. package/example/src/chevre/projectOrderFieldsById.ts +0 -41
@@ -10,11 +10,20 @@ async function main() {
10
10
 
11
11
  const reservation = await reservationRepo.attendIfNotAttended(
12
12
  {
13
- id: '864318975593476-0',
13
+ id: '948926445022844-0',
14
14
  now: new Date()
15
15
  }
16
16
  );
17
- console.log('event found', reservation);
17
+ console.log('reservation found', reservation);
18
+
19
+ // await reservationRepo.cancel(
20
+ // {
21
+ // id: '948926445022844-0',
22
+ // previousReservationStatus: chevre.factory.reservationStatusType.ReservationConfirmed,
23
+ // modifiedTime: new Date()
24
+ // }
25
+ // );
26
+ // console.log('reservation canceled');
18
27
  }
19
28
 
20
29
  main()
@@ -0,0 +1,31 @@
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
+ async function main() {
9
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
10
+
11
+ const reservationRepo = await chevre.repository.Reservation.createInstance(mongoose.connection);
12
+
13
+ const reservations = await reservationRepo.projectFields<chevre.factory.reservationType.EventReservation>(
14
+ {
15
+ limit: 1,
16
+ page: 1,
17
+ typeOf: chevre.factory.reservationType.EventReservation,
18
+ project: { id: { $eq: project.id } }
19
+ },
20
+ {
21
+ id: 1
22
+ }
23
+ );
24
+ // tslint:disable-next-line:no-null-keyword
25
+ console.dir(reservations, { depth: null });
26
+ console.log(reservations.length, 'reservations found');
27
+ }
28
+
29
+ main()
30
+ .then()
31
+ .catch(console.error);
@@ -0,0 +1,24 @@
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
+ async function main() {
9
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
10
+
11
+ const reservationRepo = await chevre.repository.Reservation.createInstance(mongoose.connection);
12
+ const result = await reservationRepo.projectFieldsById(
13
+ {
14
+ id: '948926445022844-0',
15
+ inclusion: ['reservationStatus', 'reservationFor.id']
16
+ }
17
+ );
18
+ // tslint:disable-next-line:no-null-keyword
19
+ console.dir(result, { depth: null });
20
+ }
21
+
22
+ main()
23
+ .then(console.log)
24
+ .catch(console.error);
@@ -0,0 +1,43 @@
1
+ // tslint:disable:no-console
2
+ import * as moment from 'moment';
3
+ import * as mongoose from 'mongoose';
4
+ import { chevre } from '../../../lib/index';
5
+
6
+ const PROJECT_ID = String(process.env.PROJECT_ID);
7
+
8
+ async function main() {
9
+ // const now = new Date();
10
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
11
+
12
+ const aggregateReservationRepo = await chevre.repository.AggregateReservation.createInstance(mongoose.connection);
13
+
14
+ const result = await aggregateReservationRepo.save(
15
+ {
16
+ project: { id: PROJECT_ID, typeOf: chevre.factory.organizationType.Project },
17
+ reservationFor: {
18
+ id: 'blxonxv24',
19
+ typeOf: chevre.factory.eventType.ScreeningEvent,
20
+ startDate: moment('2024-08-07T10:10:00.000+00:00')
21
+ .toDate()
22
+ }
23
+ },
24
+ {
25
+ $set: {
26
+ // aggregateOffer: {
27
+ // typeOf: chevre.factory.offerType.AggregateOffer,
28
+ // aggregateDate: now
29
+ // },
30
+ // aggregateEntranceGate: {
31
+ // typeOf: chevre.factory.placeType.AggregatePlace,
32
+ // aggregateDate: now,
33
+ // places: []
34
+ // }
35
+ }
36
+ }
37
+ );
38
+ console.log(result);
39
+ }
40
+
41
+ main()
42
+ .then(console.log)
43
+ .catch(console.error);
@@ -0,0 +1,68 @@
1
+ // tslint:disable:no-console
2
+ import * as mongoose from 'mongoose';
3
+
4
+ import { chevre } from '../../../lib/index';
5
+
6
+ async function main() {
7
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
8
+
9
+ const accountingReportRepo = await chevre.repository.AccountingReport.createInstance(mongoose.connection);
10
+ const aggregateReservationRepo = await chevre.repository.AggregateReservation.createInstance(mongoose.connection);
11
+ const reservationRepo = await chevre.repository.Reservation.createInstance(mongoose.connection);
12
+ const projectRepo = await chevre.repository.Project.createInstance(mongoose.connection);
13
+
14
+ let updateResult: any;
15
+ updateResult = await accountingReportRepo.unsetUnnecessaryFields({
16
+ filter: {
17
+ _id: { $exists: true }
18
+ },
19
+ $unset: {
20
+ createdAt: 1,
21
+ updatedAt: 1,
22
+ __v: 1
23
+ }
24
+ });
25
+ console.log(updateResult);
26
+
27
+ updateResult = await aggregateReservationRepo.unsetUnnecessaryFields({
28
+ filter: {
29
+ _id: { $exists: true }
30
+ },
31
+ $unset: {
32
+ createdAt: 1,
33
+ updatedAt: 1,
34
+ __v: 1
35
+ }
36
+ });
37
+ console.log(updateResult);
38
+
39
+ updateResult = await projectRepo.unsetUnnecessaryFields({
40
+ filter: {
41
+ _id: { $exists: true }
42
+ },
43
+ $unset: {
44
+ createdAt: 1,
45
+ updatedAt: 1,
46
+ __v: 1
47
+ }
48
+ });
49
+ console.log(updateResult);
50
+
51
+ updateResult = await reservationRepo.unsetUnnecessaryFields({
52
+ filter: {
53
+ _id: { $exists: true }
54
+ },
55
+ $unset: {
56
+ createdAt: 1,
57
+ updatedAt: 1,
58
+ __v: 1
59
+ }
60
+ });
61
+ console.log(updateResult);
62
+ }
63
+
64
+ main()
65
+ .then(() => {
66
+ console.log('success!');
67
+ })
68
+ .catch(console.error);
@@ -0,0 +1,21 @@
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
+ async function main() {
8
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
9
+
10
+ const projectRepo = await chevre.repository.Project.createInstance(mongoose.connection);
11
+
12
+ const result = await projectRepo.updateAggregateReservation({
13
+ id: PROJECT_ID
14
+ // aggregateReservation?: any;
15
+ });
16
+ console.log(result);
17
+ }
18
+
19
+ main()
20
+ .then(console.log)
21
+ .catch(console.error);
@@ -53,5 +53,9 @@ export declare class AccountingReportRepo {
53
53
  id?: string;
54
54
  };
55
55
  }): Promise<any[]>;
56
+ unsetUnnecessaryFields(params: {
57
+ filter: any;
58
+ $unset: any;
59
+ }): Promise<import("mongodb").UpdateResult>;
56
60
  }
57
61
  export {};
@@ -203,5 +203,11 @@ class AccountingReportRepo {
203
203
  .exec();
204
204
  });
205
205
  }
206
+ unsetUnnecessaryFields(params) {
207
+ return __awaiter(this, void 0, void 0, function* () {
208
+ return this.accountingReportModel.updateMany(params.filter, { $unset: params.$unset }, { timestamps: false })
209
+ .exec();
210
+ });
211
+ }
206
212
  }
207
213
  exports.AccountingReportRepo = AccountingReportRepo;
@@ -64,5 +64,9 @@ export declare class AggregateReservationRepo {
64
64
  * 予約集計を保管する
65
65
  */
66
66
  save(filter: Pick<IAggregateReservation, 'project' | 'reservationFor'>, update: IUpdateAggregateReservationParams): Promise<void>;
67
+ unsetUnnecessaryFields(params: {
68
+ filter: any;
69
+ $unset: any;
70
+ }): Promise<import("mongodb").UpdateResult>;
67
71
  }
68
72
  export {};
@@ -128,7 +128,7 @@ class AggregateReservationRepo {
128
128
  'project.id': { $eq: filter.project.id },
129
129
  'reservationFor.id': { $eq: filter.reservationFor.id }
130
130
  }, {
131
- $set: Object.assign({ updatedAt: new Date() }, $set),
131
+ $set: Object.assign({}, $set),
132
132
  $setOnInsert: setOnInsert
133
133
  }, {
134
134
  new: true,
@@ -141,5 +141,11 @@ class AggregateReservationRepo {
141
141
  }
142
142
  });
143
143
  }
144
+ unsetUnnecessaryFields(params) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ return this.aggregateReservationModel.updateMany(params.filter, { $unset: params.$unset }, { timestamps: false })
147
+ .exec();
148
+ });
149
+ }
144
150
  }
145
151
  exports.AggregateReservationRepo = AggregateReservationRepo;
@@ -32,7 +32,6 @@ export interface IAttributes4patchUpdate<T extends factory.eventType> {
32
32
  }
33
33
  export interface IUpdateAggregateReservationParams {
34
34
  $set: {
35
- updatedAt: Date;
36
35
  aggregateReservation: factory.event.event.IAggregateReservation;
37
36
  aggregateOffer?: Pick<factory.event.event.IAggregateOffer, 'aggregateDate' | 'offerCount' | 'typeOf'>;
38
37
  maximumAttendeeCapacity?: number;
@@ -21,10 +21,8 @@ const schemaOptions = {
21
21
  writeConcern: writeConcern_1.writeConcern,
22
22
  strict: false,
23
23
  strictQuery: false,
24
- timestamps: {
25
- createdAt: 'createdAt',
26
- updatedAt: 'updatedAt'
27
- },
24
+ timestamps: false,
25
+ versionKey: false,
28
26
  toJSON: {
29
27
  getters: false,
30
28
  virtuals: false,
@@ -12,6 +12,9 @@ const schemaDefinition = {
12
12
  reservationFor: { type: mongoose_1.SchemaTypes.Mixed, required: true },
13
13
  aggregateEntranceGate: mongoose_1.SchemaTypes.Mixed,
14
14
  aggregateOffer: mongoose_1.SchemaTypes.Mixed
15
+ // createdAt: SchemaTypes.Mixed,
16
+ // updatedAt: SchemaTypes.Mixed,
17
+ // __v: SchemaTypes.Mixed
15
18
  };
16
19
  const schemaOptions = {
17
20
  autoIndex: settings_1.MONGO_AUTO_INDEX,
@@ -22,10 +25,8 @@ const schemaOptions = {
22
25
  writeConcern: writeConcern_1.writeConcern,
23
26
  strict: true,
24
27
  strictQuery: false,
25
- timestamps: {
26
- createdAt: 'createdAt',
27
- updatedAt: 'updatedAt'
28
- },
28
+ timestamps: false,
29
+ versionKey: false,
29
30
  toJSON: {
30
31
  getters: false,
31
32
  virtuals: false,
@@ -40,14 +41,14 @@ const schemaOptions = {
40
41
  }
41
42
  };
42
43
  const indexes = [
43
- [
44
- { createdAt: 1 },
45
- { name: 'searchByCreatedAt' }
46
- ],
47
- [
48
- { updatedAt: 1 },
49
- { name: 'searchByUpdatedAt' }
50
- ],
44
+ // [ // discontinue(2024-08-07~)
45
+ // { createdAt: 1 },
46
+ // { name: 'searchByCreatedAt' }
47
+ // ],
48
+ // [
49
+ // { updatedAt: 1 },
50
+ // { name: 'searchByUpdatedAt' }
51
+ // ],
51
52
  [
52
53
  { 'reservationFor.startDate': 1 },
53
54
  { name: 'searchByReservationForStartDate' }
@@ -34,10 +34,8 @@ const schemaOptions = {
34
34
  writeConcern: writeConcern_1.writeConcern,
35
35
  strict: true,
36
36
  strictQuery: false,
37
- timestamps: {
38
- createdAt: 'createdAt',
39
- updatedAt: 'updatedAt'
40
- },
37
+ timestamps: false,
38
+ versionKey: false,
41
39
  toJSON: {
42
40
  getters: false,
43
41
  virtuals: false,
@@ -63,14 +61,14 @@ function createSchema() {
63
61
  }
64
62
  exports.createSchema = createSchema;
65
63
  const indexes = [
66
- [
67
- { createdAt: 1 },
68
- { name: 'searchByCreatedAt' }
69
- ],
70
- [
71
- { updatedAt: 1 },
72
- { name: 'searchByUpdatedAt' }
73
- ],
64
+ // [ // discontinue(2024-08-07~)
65
+ // { createdAt: 1 },
66
+ // { name: 'searchByCreatedAt' }
67
+ // ],
68
+ // [
69
+ // { updatedAt: 1 },
70
+ // { name: 'searchByUpdatedAt' }
71
+ // ],
74
72
  [
75
73
  { dateCreated: 1 },
76
74
  {
@@ -20,10 +20,8 @@ const schemaOptions = {
20
20
  writeConcern: writeConcern_1.writeConcern,
21
21
  strict: true,
22
22
  strictQuery: false,
23
- timestamps: {
24
- createdAt: 'createdAt',
25
- updatedAt: 'updatedAt'
26
- },
23
+ timestamps: false,
24
+ versionKey: false,
27
25
  toJSON: {
28
26
  getters: false,
29
27
  virtuals: false,
@@ -38,14 +36,14 @@ const schemaOptions = {
38
36
  }
39
37
  };
40
38
  const indexes = [
41
- [
42
- { createdAt: 1 },
43
- { name: 'searchByCreatedAt' }
44
- ],
45
- [
46
- { updatedAt: 1 },
47
- { name: 'searchByUpdatedAt' }
48
- ]
39
+ // [ // discontinue(2024-08-07~)
40
+ // { createdAt: 1 },
41
+ // { name: 'searchByCreatedAt' }
42
+ // ],
43
+ // [
44
+ // { updatedAt: 1 },
45
+ // { name: 'searchByUpdatedAt' }
46
+ // ]
49
47
  ];
50
48
  exports.indexes = indexes;
51
49
  /**
@@ -27,10 +27,8 @@ const schemaOptions = {
27
27
  writeConcern: writeConcern_1.writeConcern,
28
28
  strict: true,
29
29
  strictQuery: false,
30
- timestamps: {
31
- createdAt: 'createdAt',
32
- updatedAt: 'updatedAt'
33
- },
30
+ timestamps: false,
31
+ versionKey: false,
34
32
  toJSON: {
35
33
  getters: false,
36
34
  virtuals: false,
@@ -56,14 +54,14 @@ function createSchema() {
56
54
  }
57
55
  exports.createSchema = createSchema;
58
56
  const indexes = [
59
- [
60
- { createdAt: 1 },
61
- { name: 'searchByCreatedAt' }
62
- ],
63
- [
64
- { updatedAt: 1 },
65
- { name: 'searchByUpdatedAt' }
66
- ],
57
+ // [ // discontinue(2024-08-07~)
58
+ // { createdAt: 1 },
59
+ // { name: 'searchByCreatedAt' }
60
+ // ],
61
+ // [
62
+ // { updatedAt: 1 },
63
+ // { name: 'searchByUpdatedAt' }
64
+ // ],
67
65
  [
68
66
  { identifier: 1 },
69
67
  {
@@ -20,6 +20,9 @@ const schemaDefinition = {
20
20
  appliesToCategoryCode: mongoose_1.SchemaTypes.Mixed,
21
21
  appliesToMovieTicket: mongoose_1.SchemaTypes.Mixed,
22
22
  appliesToVideoFormat: String
23
+ // createdAt: SchemaTypes.Mixed,
24
+ // updatedAt: SchemaTypes.Mixed,
25
+ // __v: SchemaTypes.Mixed
23
26
  };
24
27
  const schemaOptions = {
25
28
  autoIndex: settings_1.MONGO_AUTO_INDEX,
@@ -30,10 +33,6 @@ const schemaOptions = {
30
33
  writeConcern: writeConcern_1.writeConcern,
31
34
  strict: true,
32
35
  strictQuery: false,
33
- // timestamps: {
34
- // createdAt: 'createdAt',
35
- // updatedAt: 'updatedAt'
36
- // },
37
36
  timestamps: false,
38
37
  versionKey: false,
39
38
  toJSON: {
@@ -61,14 +60,14 @@ function createSchema() {
61
60
  }
62
61
  exports.createSchema = createSchema;
63
62
  const indexes = [
64
- [
65
- { createdAt: 1 },
66
- { name: 'searchByCreatedAt' }
67
- ],
68
- [
69
- { updatedAt: 1 },
70
- { name: 'searchByUpdatedAt' }
71
- ],
63
+ // [ // discontinue(2024-08-07~)
64
+ // { createdAt: 1 },
65
+ // { name: 'searchByCreatedAt' }
66
+ // ],
67
+ // [
68
+ // { updatedAt: 1 },
69
+ // { name: 'searchByUpdatedAt' }
70
+ // ],
72
71
  [
73
72
  { price: 1 },
74
73
  { name: 'searchByPrice' }
@@ -20,6 +20,9 @@ const schemaDefinition = {
20
20
  type: String,
21
21
  required: true
22
22
  }
23
+ // createdAt: SchemaTypes.Mixed,
24
+ // updatedAt: SchemaTypes.Mixed,
25
+ // __v: SchemaTypes.Mixed
23
26
  };
24
27
  const schemaOptions = {
25
28
  autoIndex: settings_1.MONGO_AUTO_INDEX,
@@ -30,10 +33,8 @@ const schemaOptions = {
30
33
  writeConcern: writeConcern_1.writeConcern,
31
34
  strict: true,
32
35
  strictQuery: false,
33
- timestamps: {
34
- createdAt: 'createdAt',
35
- updatedAt: 'updatedAt'
36
- },
36
+ timestamps: false,
37
+ versionKey: false,
37
38
  toJSON: {
38
39
  getters: false,
39
40
  virtuals: false,
@@ -50,6 +50,9 @@ const schemaDefinition = {
50
50
  attended: { type: Boolean, default: false },
51
51
  additionalProperty: mongoose_1.SchemaTypes.Mixed,
52
52
  issuedThrough: mongoose_1.SchemaTypes.Mixed
53
+ // createdAt: SchemaTypes.Mixed,
54
+ // updatedAt: SchemaTypes.Mixed,
55
+ // __v: SchemaTypes.Mixed
53
56
  };
54
57
  const schemaOptions = {
55
58
  autoIndex: settings_1.MONGO_AUTO_INDEX,
@@ -60,11 +63,6 @@ const schemaOptions = {
60
63
  writeConcern: writeConcern_1.writeConcern,
61
64
  strict: true,
62
65
  strictQuery: false,
63
- // discontinue(2024-07-02~)
64
- // timestamps: {
65
- // createdAt: 'createdAt',
66
- // updatedAt: 'updatedAt'
67
- // },
68
66
  timestamps: false,
69
67
  versionKey: false,
70
68
  toJSON: {
@@ -92,14 +90,14 @@ function createSchema() {
92
90
  }
93
91
  exports.createSchema = createSchema;
94
92
  const indexes = [
95
- [
96
- { createdAt: 1 },
97
- { name: 'searchByCreatedAt' }
98
- ],
99
- [
100
- { updatedAt: 1 },
101
- { name: 'searchByUpdatedAt' }
102
- ],
93
+ // [ // discontinue(2024-08-07~)
94
+ // { createdAt: 1 },
95
+ // { name: 'searchByCreatedAt' }
96
+ // ],
97
+ // [
98
+ // { updatedAt: 1 },
99
+ // { name: 'searchByUpdatedAt' }
100
+ // ],
103
101
  [
104
102
  { bookingTime: -1 },
105
103
  { name: 'searchByBookingTime-v3' }
@@ -22,10 +22,8 @@ const schemaOptions = {
22
22
  writeConcern: writeConcern_1.writeConcern,
23
23
  strict: false,
24
24
  strictQuery: false,
25
- timestamps: {
26
- createdAt: 'createdAt',
27
- updatedAt: 'updatedAt'
28
- },
25
+ timestamps: false,
26
+ versionKey: false,
29
27
  toJSON: {
30
28
  getters: false,
31
29
  virtuals: false,
@@ -51,14 +49,14 @@ function createSchema() {
51
49
  }
52
50
  exports.createSchema = createSchema;
53
51
  const indexes = [
54
- [
55
- { createdAt: 1 },
56
- { name: 'searchByCreatedAt' }
57
- ],
58
- [
59
- { updatedAt: 1 },
60
- { name: 'searchByUpdatedAt' }
61
- ],
52
+ // [ // discontinue(2024-08-07~)
53
+ // { createdAt: 1 },
54
+ // { name: 'searchByCreatedAt' }
55
+ // ],
56
+ // [
57
+ // { updatedAt: 1 },
58
+ // { name: 'searchByUpdatedAt' }
59
+ // ],
62
60
  [
63
61
  {
64
62
  typeOf: 1,
@@ -24,10 +24,8 @@ const schemaOptions = {
24
24
  writeConcern: writeConcern_1.writeConcern,
25
25
  strict: true,
26
26
  strictQuery: false,
27
- timestamps: {
28
- createdAt: 'createdAt',
29
- updatedAt: 'updatedAt'
30
- },
27
+ timestamps: false,
28
+ versionKey: false,
31
29
  toJSON: {
32
30
  getters: false,
33
31
  virtuals: false,
@@ -56,4 +56,8 @@ export declare class PriceSpecificationRepo {
56
56
  }): Promise<void>;
57
57
  getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
58
58
  reIndex(): Promise<import("bson").Document>;
59
+ unsetUnnecessaryFields(params: {
60
+ filter: any;
61
+ $unset: any;
62
+ }): Promise<import("mongodb").UpdateResult>;
59
63
  }
@@ -283,5 +283,11 @@ class PriceSpecificationRepo {
283
283
  });
284
284
  });
285
285
  }
286
+ unsetUnnecessaryFields(params) {
287
+ return __awaiter(this, void 0, void 0, function* () {
288
+ return this.priceSpecificationModel.updateMany(params.filter, { $unset: params.$unset }, { timestamps: false })
289
+ .exec();
290
+ });
291
+ }
286
292
  }
287
293
  exports.PriceSpecificationRepo = PriceSpecificationRepo;
@@ -69,5 +69,9 @@ export declare class ProjectRepo {
69
69
  id: string;
70
70
  }): Promise<void>;
71
71
  getCursor(conditions: FilterQuery<factory.project.IProject>, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
72
+ unsetUnnecessaryFields(params: {
73
+ filter: any;
74
+ $unset: any;
75
+ }): Promise<import("mongodb").UpdateResult>;
72
76
  }
73
77
  export {};