@chevre/domain 28.2.0-alpha.3 → 28.2.0-alpha.4

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 (43) hide show
  1. package/lib/chevre/repo/adminEvent.d.ts +11 -11
  2. package/lib/chevre/repo/adminEvent.js +1 -2
  3. package/lib/chevre/repo/adminEventSeries.d.ts +3 -3
  4. package/lib/chevre/repo/adminEventSeries.js +1 -1
  5. package/lib/chevre/repo/aggregateOffer.d.ts +6 -6
  6. package/lib/chevre/repo/aggregateOffer.js +6 -7
  7. package/lib/chevre/repo/assetTransaction.d.ts +6 -6
  8. package/lib/chevre/repo/assetTransaction.js +3 -1
  9. package/lib/chevre/repo/creativeWork.d.ts +3 -3
  10. package/lib/chevre/repo/creativeWork.js +1 -1
  11. package/lib/chevre/repo/customerType.d.ts +3 -3
  12. package/lib/chevre/repo/emailMessage.d.ts +3 -1
  13. package/lib/chevre/repo/emailMessage.js +10 -8
  14. package/lib/chevre/repo/eventOffer.d.ts +5 -5
  15. package/lib/chevre/repo/eventSellerMakesOffer.d.ts +3 -2
  16. package/lib/chevre/repo/member.d.ts +2 -2
  17. package/lib/chevre/repo/merchantReturnPolicy.d.ts +6 -4
  18. package/lib/chevre/repo/merchantReturnPolicy.js +12 -10
  19. package/lib/chevre/repo/message.js +1 -2
  20. package/lib/chevre/repo/mongoose/schemas/order.d.ts +5 -1
  21. package/lib/chevre/repo/note.d.ts +4 -4
  22. package/lib/chevre/repo/note.js +4 -1
  23. package/lib/chevre/repo/noteAboutOrder.d.ts +3 -3
  24. package/lib/chevre/repo/offerCatalog.d.ts +3 -3
  25. package/lib/chevre/repo/offerCatalog.js +3 -0
  26. package/lib/chevre/repo/offerCatalogItem.d.ts +3 -3
  27. package/lib/chevre/repo/offerItemCondition.d.ts +1 -1
  28. package/lib/chevre/repo/offerItemCondition.js +7 -8
  29. package/lib/chevre/repo/order.d.ts +23 -3
  30. package/lib/chevre/repo/paymentServiceProvider.js +3 -3
  31. package/lib/chevre/repo/place/entranceGate.d.ts +5 -4
  32. package/lib/chevre/repo/place/movieTheater.d.ts +4 -4
  33. package/lib/chevre/repo/place/screeningRoom.d.ts +5 -5
  34. package/lib/chevre/repo/place/seat.d.ts +5 -4
  35. package/lib/chevre/repo/place/section.d.ts +4 -3
  36. package/lib/chevre/repo/priceSpecification.d.ts +2 -2
  37. package/lib/chevre/repo/priceSpecification.js +1 -1
  38. package/lib/chevre/repo/product.d.ts +4 -4
  39. package/lib/chevre/repo/reservation.d.ts +3 -3
  40. package/lib/chevre/repo/role.d.ts +1 -1
  41. package/lib/chevre/repo/sellerMakesOffer.d.ts +4 -3
  42. package/lib/chevre/repo/transactionNumberCounter.js +1 -1
  43. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
- import { Connection, mongo } from 'mongoose';
1
+ import { Connection } from 'mongoose';
2
2
  import type { FilterQuery } from './mongoose/types';
3
3
  import { factory } from '../factory';
4
- import { IDocType } from './mongoose/schemas/event';
4
+ import { IDocType, IModel } from './mongoose/schemas/event';
5
5
  export interface IAttributes4patchUpdate {
6
6
  typeOf: factory.eventType.ScreeningEvent;
7
7
  eventStatus?: factory.eventStatusType;
@@ -49,7 +49,7 @@ export declare class AdminEventRepo {
49
49
  */
50
50
  update: boolean;
51
51
  }): Promise<{
52
- bulkWriteResult?: mongo.BulkWriteResult;
52
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
53
53
  modifiedEvents: {
54
54
  id: string;
55
55
  }[];
@@ -120,7 +120,7 @@ export declare class AdminEventRepo {
120
120
  organizer: {
121
121
  id: string;
122
122
  };
123
- }): Promise<mongo.DeleteResult>;
123
+ }): Promise<import("mongodb").DeleteResult>;
124
124
  deleteManyEventsByScreeningRoom(params: {
125
125
  project: {
126
126
  id: string;
@@ -137,7 +137,7 @@ export declare class AdminEventRepo {
137
137
  id: string;
138
138
  };
139
139
  };
140
- }): Promise<mongo.DeleteResult>;
140
+ }): Promise<import("mongodb").DeleteResult>;
141
141
  deleteManyBySuperEventId(params: {
142
142
  project: {
143
143
  id: string;
@@ -145,7 +145,7 @@ export declare class AdminEventRepo {
145
145
  superEvent: {
146
146
  id: string;
147
147
  };
148
- }): Promise<mongo.DeleteResult>;
148
+ }): Promise<import("mongodb").DeleteResult>;
149
149
  deleteManyBySuperEventLocationId(params: {
150
150
  project: {
151
151
  id: string;
@@ -155,7 +155,7 @@ export declare class AdminEventRepo {
155
155
  id: string;
156
156
  };
157
157
  };
158
- }): Promise<mongo.DeleteResult>;
158
+ }): Promise<import("mongodb").DeleteResult>;
159
159
  /**
160
160
  * 興行(プロダクト)から削除する
161
161
  */
@@ -170,7 +170,7 @@ export declare class AdminEventRepo {
170
170
  };
171
171
  };
172
172
  };
173
- }): Promise<mongo.DeleteResult>;
173
+ }): Promise<import("mongodb").DeleteResult>;
174
174
  deleteManyEventsEndedByProject(params: {
175
175
  project: {
176
176
  id: string;
@@ -178,12 +178,12 @@ export declare class AdminEventRepo {
178
178
  endDate: {
179
179
  $lte: Date;
180
180
  };
181
- }): Promise<mongo.DeleteResult>;
181
+ }): Promise<import("mongodb").DeleteResult>;
182
182
  deleteManyEventsEnded(params: {
183
183
  endDate: {
184
184
  $lte: Date;
185
185
  };
186
- }): Promise<mongo.DeleteResult>;
186
+ }): Promise<import("mongodb").DeleteResult>;
187
187
  deleteByProject(params: {
188
188
  project: {
189
189
  id: string;
@@ -195,7 +195,7 @@ export declare class AdminEventRepo {
195
195
  updateAggregationById(params: {
196
196
  id: string;
197
197
  }, update: IUpdateAggregateReservationParams): Promise<void>;
198
- bulkWrite(bulkWriteOps: any[]): Promise<mongo.BulkWriteResult & {
198
+ bulkWrite(bulkWriteOps: any[]): Promise<import("mongodb").BulkWriteResult & {
199
199
  mongoose?: {
200
200
  validationErrors: import("mongoose").Error[];
201
201
  } | undefined;
@@ -124,7 +124,7 @@ class AdminEventRepo {
124
124
  const bulkWriteResult = await this.eventModel.bulkWrite(bulkWriteOps, { ordered: false });
125
125
  // update:falseの場合、upsertedIdsのみmodifiedEventsとして返せばよい(2026-01-16~)
126
126
  if (!update) {
127
- // BulkWriteResult -> upsertedIds: { '0': '7iri6p4m54k0r3g' }
127
+ // bulkWriteResult -> upsertedIds: { '0': '7iri6p4m54k0r3g' }
128
128
  return {
129
129
  bulkWriteResult,
130
130
  modifiedEvents: Object.values(bulkWriteResult.upsertedIds)
@@ -148,7 +148,6 @@ class AdminEventRepo {
148
148
  * イベント部分更新
149
149
  */
150
150
  async updatePartiallyById(params) {
151
- // let doc: Document | null;
152
151
  const { typeOf, ...updateFields } = params.attributes;
153
152
  if (typeof typeOf !== 'string' || typeOf.length === 0) {
154
153
  throw new factory_1.factory.errors.ArgumentNull('attributes.typeOf');
@@ -1,7 +1,7 @@
1
- import type { Connection, mongo } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import type { FilterQuery } from './mongoose/types';
3
3
  import { factory } from '../factory';
4
- import { IDocType } from './mongoose/schemas/eventSeries';
4
+ import { IDocType, IModel } from './mongoose/schemas/eventSeries';
5
5
  type IUnset = {
6
6
  [key in keyof factory.eventSeries.IEvent]?: 1;
7
7
  };
@@ -24,7 +24,7 @@ export declare class AdminEventSeriesRepo {
24
24
  */
25
25
  upsert: boolean;
26
26
  }): Promise<{
27
- bulkWriteResult?: mongo.BulkWriteResult;
27
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
28
28
  modifiedEvents: {
29
29
  id: string;
30
30
  }[];
@@ -75,7 +75,7 @@ class AdminEventSeriesRepo {
75
75
  const bulkWriteResult = await this.eventSeriesModel.bulkWrite(bulkWriteOps, { ordered: false });
76
76
  // upsert:falseの場合、upsertedIdsのみmodifiedEventsとして返せばよい(2026-01-27~)
77
77
  if (!upsert) {
78
- // BulkWriteResult -> upsertedIds: { '0': '7iri6p4m54k0r3g' }
78
+ // bulkWriteResult -> upsertedIds: { '0': '7iri6p4m54k0r3g' }
79
79
  return {
80
80
  bulkWriteResult,
81
81
  modifiedEvents: Object.values(bulkWriteResult.upsertedIds)
@@ -1,7 +1,7 @@
1
- import { AnyExpression, Connection, Document, PipelineStage, mongo } from 'mongoose';
1
+ import { AnyExpression, Connection, PipelineStage } from 'mongoose';
2
2
  import type { FilterQuery } from './mongoose/types';
3
3
  import { factory } from '../factory';
4
- import { IDocType } from './mongoose/schemas/aggregateOffer';
4
+ import { IDocType, IModel } from './mongoose/schemas/aggregateOffer';
5
5
  type IMatchStage = PipelineStage.Match;
6
6
  type KeyOfUnitPriceOffer = keyof factory.unitPriceOffer.IUnitPriceOffer;
7
7
  type IProjection = Partial<Record<KeyOfUnitPriceOffer, 0 | 1>>;
@@ -55,11 +55,11 @@ export declare class AggregateOfferRepo {
55
55
  };
56
56
  id: string;
57
57
  }): Promise<void>;
58
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & IDocType & Required<{
58
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & IDocType & Required<{
59
59
  _id: string;
60
60
  }> & {
61
61
  __v: number;
62
- }, import("mongoose").QueryOptions<IDocType>, (Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & IDocType & Required<{
62
+ }, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & IDocType & Required<{
63
63
  _id: string;
64
64
  }> & {
65
65
  __v: number;
@@ -68,7 +68,7 @@ export declare class AggregateOfferRepo {
68
68
  filter: FilterQuery<IDocType>;
69
69
  $unset: any;
70
70
  }): Promise<import("mongoose").UpdateWriteOpResult>;
71
- save(params: factory.unitPriceOffer.IUnitPriceOffer & {}): Promise<{
71
+ saveAggregateOffer(params: factory.unitPriceOffer.IUnitPriceOffer): Promise<{
72
72
  id: string;
73
73
  }>;
74
74
  /**
@@ -80,7 +80,7 @@ export declare class AggregateOfferRepo {
80
80
  */
81
81
  productType: factory.product.ProductType;
82
82
  }): Promise<{
83
- bulkWriteResult?: mongo.BulkWriteResult;
83
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
84
84
  modifiedOffers?: {
85
85
  id: string;
86
86
  }[];
@@ -510,8 +510,7 @@ class AggregateOfferRepo {
510
510
  return this.aggregateOfferModel.updateMany(params.filter, { $unset: params.$unset }, { timestamps: false })
511
511
  .exec();
512
512
  }
513
- async save(params) {
514
- let doc;
513
+ async saveAggregateOffer(params) {
515
514
  let aggregateOfferId;
516
515
  const { ...paramsWithoutUnset } = params;
517
516
  if (typeof params.id !== 'string' || params.id.length === 0) {
@@ -525,7 +524,7 @@ class AggregateOfferRepo {
525
524
  project: params.project,
526
525
  offers: [savedUnitPriceOffer]
527
526
  };
528
- doc = await this.aggregateOfferModel.create({
527
+ await this.aggregateOfferModel.create({
529
528
  ...aggregateOffer,
530
529
  _id: newId
531
530
  });
@@ -551,7 +550,7 @@ class AggregateOfferRepo {
551
550
  identifier: originalUnitPriceOffer.identifier,
552
551
  typeOf: originalUnitPriceOffer.typeOf
553
552
  };
554
- doc = await this.aggregateOfferModel.findOneAndUpdate({ _id: params.id }, // _idに変更(2023-12-22~)
553
+ const doc = await this.aggregateOfferModel.findOneAndUpdate({ _id: params.id }, // _idに変更(2023-12-22~)
555
554
  {
556
555
  $set: {
557
556
  'offers.0': subOffer // _idに変更(2023-12-22~)
@@ -561,9 +560,9 @@ class AggregateOfferRepo {
561
560
  new: true
562
561
  })
563
562
  .exec();
564
- }
565
- if (doc === null) {
566
- throw new factory_1.factory.errors.NotFound(this.aggregateOfferModel.modelName);
563
+ if (doc === null) {
564
+ throw new factory_1.factory.errors.NotFound(this.aggregateOfferModel.modelName);
565
+ }
567
566
  }
568
567
  return { id: aggregateOfferId };
569
568
  }
@@ -15,13 +15,13 @@ export declare class AssetTransactionRepo {
15
15
  /**
16
16
  * 取引を開始する
17
17
  */
18
- start<T extends factory.assetTransactionType>(params: factory.assetTransaction.IStartParams<T>): Promise<factory.assetTransaction.ITransaction<T>>;
18
+ start<T extends AvailableAssetTransactionType>(params: factory.assetTransaction.IStartParams<T>): Promise<factory.assetTransaction.ITransaction<T>>;
19
19
  startWithMinimalResponse<T extends factory.assetTransactionType>(params: factory.assetTransaction.IStartParams<T>): Promise<Pick<factory.assetTransaction.ITransaction<factory.assetTransactionType>, 'id' | 'startDate'>>;
20
- findById<T extends factory.assetTransactionType>(params: {
20
+ findById<T extends AvailableAssetTransactionType>(params: {
21
21
  typeOf: T;
22
22
  id: string;
23
23
  }, inclusion?: IKeyOfProjection<T>[]): Promise<factory.assetTransaction.ITransaction<T>>;
24
- findByTransactionNumber<T extends factory.assetTransactionType>(params: {
24
+ findByTransactionNumber<T extends AvailableAssetTransactionType>(params: {
25
25
  typeOf: T;
26
26
  transactionNumber: string;
27
27
  }, inclusion?: IKeyOfProjection<T>[]): Promise<factory.assetTransaction.ITransaction<T>>;
@@ -33,7 +33,7 @@ export declare class AssetTransactionRepo {
33
33
  /**
34
34
  * 取引を確定する
35
35
  */
36
- confirm<T extends factory.assetTransactionType>(params: {
36
+ confirm<T extends AvailableAssetTransactionType>(params: {
37
37
  typeOf: T;
38
38
  id: string;
39
39
  object?: Pick<factory.assetTransaction.reserve.IObject, 'underName'> & {
@@ -87,7 +87,7 @@ export declare class AssetTransactionRepo {
87
87
  /**
88
88
  * 取引を中止する
89
89
  */
90
- cancel<T extends factory.assetTransactionType>(params: {
90
+ cancel<T extends AvailableAssetTransactionType>(params: {
91
91
  typeOf: T;
92
92
  id?: string;
93
93
  transactionNumber?: string;
@@ -113,7 +113,7 @@ export declare class AssetTransactionRepo {
113
113
  id: string;
114
114
  };
115
115
  transactionNumbers: string[];
116
- typeOf: factory.assetTransactionType;
116
+ typeOf: AvailableAssetTransactionType;
117
117
  }): Promise<{
118
118
  n?: number;
119
119
  ok?: number;
@@ -489,7 +489,9 @@ class AssetTransactionRepo {
489
489
  result = { id: transaction.id };
490
490
  }
491
491
  else {
492
- result = { id: doc.toObject().id };
492
+ result = {
493
+ id: doc.toObject().id
494
+ };
493
495
  }
494
496
  assetTransaction_2.assetTransactionEventEmitter.emitAssetTransactionStatusChanged({
495
497
  id: result.id,
@@ -1,7 +1,7 @@
1
- import { Connection, Types, mongo } from 'mongoose';
1
+ import { Connection, Types } from 'mongoose';
2
2
  import type { FilterQuery } from './mongoose/types';
3
3
  import { factory } from '../factory';
4
- import { IDocType } from './mongoose/schemas/creativeWork';
4
+ import { IModel, IDocType } from './mongoose/schemas/creativeWork';
5
5
  type IKeyOfProjection = keyof factory.creativeWork.movie.ICreativeWork;
6
6
  /**
7
7
  * コンテンツリポジトリ
@@ -32,7 +32,7 @@ export declare class CreativeWorkRepo {
32
32
  [key in keyof factory.creativeWork.movie.ICreativeWork]?: 1;
33
33
  };
34
34
  }[]): Promise<{
35
- bulkWriteResult?: mongo.BulkWriteResult;
35
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
36
36
  }>;
37
37
  /**
38
38
  * コンテンツを検索する
@@ -196,7 +196,7 @@ class CreativeWorkRepo {
196
196
  // project,
197
197
  // identifier
198
198
  // };
199
- // const updateFilter: UpdateFilter<IDocType> = {
199
+ // const updateFilter: UpdateOneModel<IDocType>['update'] = {
200
200
  // $setOnInsert: setOnInsert,
201
201
  // // 変更可能な属性のみ上書き
202
202
  // $set: {
@@ -1,6 +1,6 @@
1
- import type { Connection, mongo } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import type { FilterQuery } from './mongoose/types';
3
- import { ICustomerType, IDocType } from './mongoose/schemas/customerType';
3
+ import { ICustomerType, IModel, IDocType } from './mongoose/schemas/customerType';
4
4
  import { factory } from '../factory';
5
5
  type IKeyOfProjection = keyof ICustomerType;
6
6
  /**
@@ -17,6 +17,6 @@ export declare class CustomerTypeRepo {
17
17
  saveManyByCodeValue(params: {
18
18
  attributes: ICustomerType;
19
19
  upsert?: boolean;
20
- }[]): Promise<mongo.BulkWriteResult | undefined>;
20
+ }[]): Promise<Awaited<ReturnType<IModel['bulkWrite']>> | undefined>;
21
21
  }
22
22
  export {};
@@ -40,7 +40,9 @@ export declare class EmailMessageRepo {
40
40
  private readonly emailMessageModel;
41
41
  constructor(connection: Connection);
42
42
  static CREATE_MONGO_CONDITIONS(params: ISearchConditions): FilterQuery<IDocType>[];
43
- save(params: IEmailMessage): Promise<any>;
43
+ saveEmailMessage(params: IEmailMessage): Promise<{
44
+ id: string;
45
+ }>;
44
46
  findEmailMessages(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<IEmailMessage[]>;
45
47
  deleteById(params: {
46
48
  id: string;
@@ -43,21 +43,23 @@ class EmailMessageRepo {
43
43
  }
44
44
  return andConditions;
45
45
  }
46
- async save(params) {
47
- let doc;
46
+ async saveEmailMessage(params) {
47
+ let savedId;
48
48
  if (typeof params.id !== 'string') {
49
- doc = await this.emailMessageModel.create(params);
49
+ const createdDoc = await this.emailMessageModel.create(params);
50
+ savedId = createdDoc.id;
50
51
  }
51
52
  else {
52
53
  // 上書き禁止属性を除外(2022-08-24~)
53
54
  const { id: _id, identifier: _identifier, project: _project, typeOf: _typeOf, ...updateFields } = params;
54
- doc = await this.emailMessageModel.findOneAndUpdate({ _id: params.id }, updateFields, { upsert: false, new: true })
55
+ const doc = await this.emailMessageModel.findOneAndUpdate({ _id: params.id }, updateFields, { upsert: false, new: true })
55
56
  .exec();
57
+ if (doc === null) {
58
+ throw new factory_1.factory.errors.NotFound(this.emailMessageModel.modelName);
59
+ }
60
+ savedId = params.id;
56
61
  }
57
- if (doc === null) {
58
- throw new factory_1.factory.errors.NotFound(this.emailMessageModel.modelName);
59
- }
60
- return doc.toObject();
62
+ return { id: savedId };
61
63
  }
62
64
  async findEmailMessages(params, inclusion) {
63
65
  const conditions = EmailMessageRepo.CREATE_MONGO_CONDITIONS(params);
@@ -1,7 +1,7 @@
1
- import type { Connection, mongo } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import type { FilterQuery } from './mongoose/types';
3
3
  import { factory } from '../factory';
4
- import { IDocType } from './mongoose/schemas/eventOffer';
4
+ import { IDocType, IModel } from './mongoose/schemas/eventOffer';
5
5
  type IUnset = {
6
6
  [key in keyof IDocType]?: 1;
7
7
  };
@@ -32,7 +32,7 @@ export declare class EventOfferRepo {
32
32
  */
33
33
  update: boolean;
34
34
  }): Promise<{
35
- bulkWriteResult?: mongo.BulkWriteResult;
35
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
36
36
  modifiedProductOffers?: {
37
37
  id: string;
38
38
  }[];
@@ -47,7 +47,7 @@ export declare class EventOfferRepo {
47
47
  seller: {
48
48
  id: string;
49
49
  };
50
- }): Promise<mongo.DeleteResult>;
50
+ }): Promise<Awaited<ReturnType<IModel['deleteMany']>>>;
51
51
  /**
52
52
  * 有効期間を過ぎたイベントオファーを削除する
53
53
  */
@@ -55,6 +55,6 @@ export declare class EventOfferRepo {
55
55
  validThrough: {
56
56
  $lte: Date;
57
57
  };
58
- }): Promise<mongo.DeleteResult>;
58
+ }): Promise<import("mongodb").DeleteResult>;
59
59
  }
60
60
  export {};
@@ -1,5 +1,6 @@
1
- import type { Connection, mongo } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import { factory } from '../factory';
3
+ import { IModel } from './mongoose/schemas/event';
3
4
  /**
4
5
  * イベントのアプリケーションオファーリポジトリ
5
6
  */
@@ -30,7 +31,7 @@ export declare class EventSellerMakesOfferRepo {
30
31
  };
31
32
  };
32
33
  }[]): Promise<{
33
- bulkWriteResult?: mongo.BulkWriteResult;
34
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
34
35
  modifiedEvents?: {
35
36
  id: string;
36
37
  }[];
@@ -75,7 +75,7 @@ export declare class MemberRepo {
75
75
  };
76
76
  };
77
77
  };
78
- }): Promise<string[]>;
78
+ }): Promise<factory.role.organizationRole.RoleName[]>;
79
79
  deleteByProject(params: {
80
80
  project: {
81
81
  id: string;
@@ -202,7 +202,7 @@ export declare class MemberRepo {
202
202
  $eq: string;
203
203
  };
204
204
  };
205
- }): Promise<string[]>;
205
+ }): Promise<factory.role.organizationRole.RoleName[]>;
206
206
  private projectFields;
207
207
  }
208
208
  export {};
@@ -1,4 +1,4 @@
1
- import type { Connection, Document } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import { factory } from '../factory';
3
3
  /**
4
4
  * 返品ポリシーリポジトリ
@@ -7,7 +7,9 @@ export declare class MerchantReturnPolicyRepo {
7
7
  private readonly merchantReturnPolicyModel;
8
8
  constructor(connection: Connection);
9
9
  static CREATE_MONGO_CONDITIONS(params: factory.unitPriceOffer.IOfferMerchantReturnPolicySearchConditions): any[];
10
- save(params: factory.unitPriceOffer.IOfferMerchantReturnPolicy): Promise<any>;
10
+ saveMerchantReturnPolicy(params: factory.unitPriceOffer.IOfferMerchantReturnPolicy): Promise<{
11
+ id: string;
12
+ }>;
11
13
  findById(params: {
12
14
  id: string;
13
15
  }): Promise<factory.unitPriceOffer.IOfferMerchantReturnPolicy>;
@@ -20,7 +22,7 @@ export declare class MerchantReturnPolicyRepo {
20
22
  id: string;
21
23
  };
22
24
  }): Promise<void>;
23
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<Document<unknown, Record<string, never>, factory.unitPriceOffer.IOfferMerchantReturnPolicy, import("./mongoose/virtuals").IVirtuals, {}> & Pick<factory.merchantReturnPolicy.IMerchantReturnPolicy, "typeOf" | "customerRemorseReturnFees" | "customerRemorseReturnFeesMovieTicket"> & {
25
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, factory.unitPriceOffer.IOfferMerchantReturnPolicy, import("./mongoose/virtuals").IVirtuals, {}> & Pick<factory.merchantReturnPolicy.IMerchantReturnPolicy, "typeOf" | "customerRemorseReturnFees" | "customerRemorseReturnFeesMovieTicket"> & {
24
26
  customerRemorseReturnFees: factory.merchantReturnPolicy.ICustomerRemorseReturnFees;
25
27
  customerRemorseReturnFeesMovieTicket: factory.merchantReturnPolicy.ICustomerRemorseReturnFeesMovieTicket;
26
28
  project: Pick<factory.project.IProject, "id" | "typeOf">;
@@ -32,7 +34,7 @@ export declare class MerchantReturnPolicyRepo {
32
34
  _id: import("mongoose").Types.ObjectId;
33
35
  } & {
34
36
  __v: number;
35
- }, import("mongoose").QueryOptions<factory.unitPriceOffer.IOfferMerchantReturnPolicy>, (Document<unknown, Record<string, never>, factory.unitPriceOffer.IOfferMerchantReturnPolicy, import("./mongoose/virtuals").IVirtuals, {}> & Pick<factory.merchantReturnPolicy.IMerchantReturnPolicy, "typeOf" | "customerRemorseReturnFees" | "customerRemorseReturnFeesMovieTicket"> & {
37
+ }, import("mongoose").QueryOptions<factory.unitPriceOffer.IOfferMerchantReturnPolicy>, (import("mongoose").Document<unknown, Record<string, never>, factory.unitPriceOffer.IOfferMerchantReturnPolicy, import("./mongoose/virtuals").IVirtuals, {}> & Pick<factory.merchantReturnPolicy.IMerchantReturnPolicy, "typeOf" | "customerRemorseReturnFees" | "customerRemorseReturnFeesMovieTicket"> & {
36
38
  customerRemorseReturnFees: factory.merchantReturnPolicy.ICustomerRemorseReturnFees;
37
39
  customerRemorseReturnFeesMovieTicket: factory.merchantReturnPolicy.ICustomerRemorseReturnFeesMovieTicket;
38
40
  project: Pick<factory.project.IProject, "id" | "typeOf">;
@@ -72,22 +72,24 @@ class MerchantReturnPolicyRepo {
72
72
  }
73
73
  return andConditions;
74
74
  }
75
- async save(params) {
76
- let doc;
77
- if (params.id === '') {
78
- delete params.id;
79
- doc = await this.merchantReturnPolicyModel.create(params);
75
+ async saveMerchantReturnPolicy(params) {
76
+ let savedId;
77
+ if (typeof params.id !== 'string' || params.id === '') {
78
+ const { id: _id, ...creatingDoc } = params;
79
+ const createdDoc = await this.merchantReturnPolicyModel.create(creatingDoc);
80
+ savedId = createdDoc.id;
80
81
  }
81
82
  else {
82
83
  // 上書き禁止属性を除外(2022-08-24~)
83
84
  const { id, identifier, project, typeOf, ...updateFields } = params; // eslint-disable-line @typescript-eslint/no-unused-vars
84
- doc = await this.merchantReturnPolicyModel.findOneAndUpdate({ _id: params.id }, updateFields, { upsert: false, new: true })
85
+ const doc = await this.merchantReturnPolicyModel.findOneAndUpdate({ _id: params.id }, updateFields, { upsert: false, new: true })
85
86
  .exec();
87
+ if (doc === null) {
88
+ throw new factory_1.factory.errors.NotFound(this.merchantReturnPolicyModel.modelName);
89
+ }
90
+ savedId = params.id;
86
91
  }
87
- if (doc === null) {
88
- throw new factory_1.factory.errors.NotFound(this.merchantReturnPolicyModel.modelName);
89
- }
90
- return doc.toObject();
92
+ return { id: savedId };
91
93
  }
92
94
  async findById(params) {
93
95
  const doc = await this.merchantReturnPolicyModel.findOne({ _id: params.id }, {
@@ -120,9 +120,8 @@ class MessageRepo {
120
120
  $setOnInsert: setOnInsert,
121
121
  $set: setFields
122
122
  };
123
- const options = { upsert: true };
124
123
  try {
125
- await this.messageModel.updateOne(filter, updateFilter, options)
124
+ await this.messageModel.updateOne(filter, updateFilter, { upsert: true })
126
125
  .exec();
127
126
  }
128
127
  catch (error) {
@@ -22,7 +22,7 @@ export type IMinimizedAcceptedOffer = Pick<factory.acceptedOffer.IOptimizedAccep
22
22
  name?: never;
23
23
  };
24
24
  export type IAcceptedOfferInDoc = IMinimizedAcceptedOffer | factory.acceptedOffer.ICOAAcceptedOffer;
25
- type IDocType = Omit<factory.order.IOrder, 'id'> & {
25
+ type IDocTypeAsOrder = Omit<factory.order.IOrder, 'id'> & {
26
26
  acceptedOffers?: IAcceptedOfferInDoc[];
27
27
  /**
28
28
  * 注文取引IDとして再定義(2026-06-22~)
@@ -33,6 +33,10 @@ type IDocType = Omit<factory.order.IOrder, 'id'> & {
33
33
  */
34
34
  paymentMethodId?: string;
35
35
  };
36
+ type IDocTypeAsPlaceOrder = Omit<IDocTypeAsOrder, 'typeOf'> & {
37
+ typeOf: factory.transactionType.PlaceOrder;
38
+ };
39
+ type IDocType = IDocTypeAsOrder | IDocTypeAsPlaceOrder;
36
40
  type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
37
41
  type ISchemaDefinition = SchemaDefinition<IDocType>;
38
42
  type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
@@ -1,7 +1,7 @@
1
- import type { Connection, mongo } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import type { FilterQuery } from './mongoose/types';
3
3
  import { factory } from '../factory';
4
- import { IDocType } from './mongoose/schemas/note';
4
+ import { IDocType, IModel } from './mongoose/schemas/note';
5
5
  type INoteDigitalDocument = factory.creativeWork.noteDigitalDocument.INoteDigitalDocument;
6
6
  type IKeyOfProjection = keyof INoteDigitalDocument;
7
7
  /**
@@ -30,7 +30,7 @@ export declare class NoteRepo {
30
30
  */
31
31
  update: boolean;
32
32
  }): Promise<{
33
- bulkWriteResult?: mongo.BulkWriteResult;
33
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
34
34
  modifiedNotes?: {
35
35
  id: string;
36
36
  }[];
@@ -43,7 +43,7 @@ export declare class NoteRepo {
43
43
  id: string;
44
44
  typeOf: factory.creativeWork.noteDigitalDocument.IAbout['typeOf'];
45
45
  };
46
- }): Promise<mongo.DeleteResult>;
46
+ }): Promise<Awaited<ReturnType<IModel['deleteMany']>>>;
47
47
  unsetUnnecessaryFields(params: {
48
48
  filter: any;
49
49
  $unset: any;
@@ -235,9 +235,12 @@ class NoteRepo {
235
235
  * 主題リソースから全メモを削除する
236
236
  */
237
237
  async deleteNotesByAbout(params) {
238
+ if (typeof params.about.typeOf !== 'string' || params.about.typeOf === '') {
239
+ throw new factory_1.factory.errors.ArgumentNull('about.typeOf');
240
+ }
238
241
  return this.noteModel.deleteMany({
239
242
  'about.id': { $eq: String(params.about.id) },
240
- 'about.typeOf': { $eq: String(params.about.typeOf) }
243
+ 'about.typeOf': { $eq: params.about.typeOf }
241
244
  })
242
245
  .exec();
243
246
  }
@@ -1,7 +1,7 @@
1
- import type { Connection, mongo } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import type { FilterQuery } from './mongoose/types';
3
3
  import { factory } from '../factory';
4
- import { IDocType } from './mongoose/schemas/note';
4
+ import { IModel, IDocType } from './mongoose/schemas/note';
5
5
  type INoteAboutOrder = factory.creativeWork.noteDigitalDocument.INoteAboutOrder;
6
6
  type IKeyOfProjection = keyof INoteAboutOrder;
7
7
  /**
@@ -22,7 +22,7 @@ export declare class NoteAboutOrderRepo {
22
22
  */
23
23
  upsertOrderNoteByIdentifier(params: Pick<INoteAboutOrder, 'about' | 'creator' | 'identifier' | 'project' | 'provider' | 'text' | 'version'>[], options: {
24
24
  overwrite: boolean;
25
- }): Promise<mongo.BulkWriteResult | undefined>;
25
+ }): Promise<Awaited<ReturnType<IModel['bulkWrite']>> | undefined>;
26
26
  updateById(params: {
27
27
  id: string;
28
28
  attributes: Pick<INoteAboutOrder, 'text' | 'editor'>;
@@ -1,7 +1,7 @@
1
- import type { Connection, mongo } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import type { FilterQuery } from './mongoose/types';
3
3
  import { factory } from '../factory';
4
- import { IDocType } from './mongoose/schemas/offerCatalog';
4
+ import { IDocType, IModel } from './mongoose/schemas/offerCatalog';
5
5
  export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered'> & {
6
6
  numberOfItems?: number;
7
7
  itemListElementTypeOf: factory.offerType.Offer | 'OfferCatalog';
@@ -49,7 +49,7 @@ export declare class OfferCatalogRepo {
49
49
  */
50
50
  itemListElementType: factory.offerCatalog.IItemListElement['typeOf'];
51
51
  }): Promise<{
52
- bulkWriteResult?: mongo.BulkWriteResult;
52
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
53
53
  modifiedCatalogs?: {
54
54
  id: string;
55
55
  }[];
@@ -168,6 +168,9 @@ class OfferCatalogRepo {
168
168
  })
169
169
  .lean()
170
170
  .exec();
171
+ if (doc === null) {
172
+ throw new factory_1.factory.errors.NotFound('OfferCatalog');
173
+ }
171
174
  return { id: doc.id };
172
175
  }
173
176
  /**
@@ -1,7 +1,7 @@
1
- import { Connection, mongo } from 'mongoose';
1
+ import { Connection } from 'mongoose';
2
2
  import type { FilterQuery } from './mongoose/types';
3
3
  import { factory } from '../factory';
4
- import { IDocType } from './mongoose/schemas/offerCatalogItem';
4
+ import { IDocType, IModel } from './mongoose/schemas/offerCatalogItem';
5
5
  type IOfferCatalogItem = Pick<factory.offerCatalog.IOfferCatalog, 'description' | 'identifier' | 'itemListElement' | 'itemOffered' | 'name' | 'project' | 'relatedOffer' | 'typeOf' | 'id'>;
6
6
  export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'relatedOffer'> & {
7
7
  numberOfItems?: number;
@@ -44,7 +44,7 @@ export declare class OfferCatalogItemRepo {
44
44
  */
45
45
  productType: factory.product.ProductType;
46
46
  }): Promise<{
47
- bulkWriteResult?: mongo.BulkWriteResult;
47
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
48
48
  modifiedCatalogs?: {
49
49
  id: string;
50
50
  }[];
@@ -9,7 +9,7 @@ export declare class OfferItemConditionRepo {
9
9
  constructor(connection: Connection);
10
10
  static CREATE_MONGO_CONDITIONS(params: factory.offerItemCondition.ISearchConditions): any[];
11
11
  projectFields(params: factory.offerItemCondition.ISearchConditions, inclusion: IKeyOfProjection[]): Promise<factory.offerItemCondition.IOfferItemCondition[]>;
12
- save(params: factory.offerItemCondition.IOfferItemCondition): Promise<{
12
+ saveOfferItemCondition(params: factory.offerItemCondition.IOfferItemCondition): Promise<{
13
13
  id: string;
14
14
  }>;
15
15
  deleteById(params: {
@@ -76,23 +76,22 @@ class OfferItemConditionRepo {
76
76
  .lean() // lean(2024-09-24~)
77
77
  .exec();
78
78
  }
79
- async save(params) {
79
+ async saveOfferItemCondition(params) {
80
80
  let savedId;
81
- let doc;
82
81
  if (typeof params.id !== 'string' || params.id === '') {
83
82
  const { id, ...creatingParams } = params; // eslint-disable-line @typescript-eslint/no-unused-vars
84
- doc = await this.offerItemConditionModel.create(creatingParams);
85
- savedId = doc.id;
83
+ const createdDoc = await this.offerItemConditionModel.create(creatingParams);
84
+ savedId = createdDoc.id;
86
85
  }
87
86
  else {
88
87
  const { id, identifier, project, typeOf, ...updateFields } = params; // eslint-disable-line @typescript-eslint/no-unused-vars
89
- doc = await this.offerItemConditionModel.findOneAndUpdate({ _id: { $eq: id } }, updateFields, { upsert: false, new: true, projection: { _id: 1 } })
88
+ const doc = await this.offerItemConditionModel.findOneAndUpdate({ _id: { $eq: id } }, updateFields, { upsert: false, new: true, projection: { _id: 1 } })
90
89
  .exec();
90
+ if (doc === null) {
91
+ throw new factory_1.factory.errors.NotFound(this.offerItemConditionModel.modelName);
92
+ }
91
93
  savedId = id;
92
94
  }
93
- if (doc === null) {
94
- throw new factory_1.factory.errors.NotFound(this.offerItemConditionModel.modelName);
95
- }
96
95
  return { id: savedId };
97
96
  }
98
97
  async deleteById(params) {
@@ -133,7 +133,7 @@ export declare class OrderRepo {
133
133
  }): Promise<(IOrderWithoutAcceptedOffers & {
134
134
  id: string;
135
135
  })[]>;
136
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<factory.order.IOrder, "id"> & {
136
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & ((Omit<factory.order.IOrder, "id"> & {
137
137
  acceptedOffers?: import("./mongoose/schemas/order").IAcceptedOfferInDoc[];
138
138
  identifier?: string;
139
139
  paymentMethodId?: string;
@@ -141,15 +141,35 @@ export declare class OrderRepo {
141
141
  _id: import("mongoose").Types.ObjectId;
142
142
  } & {
143
143
  __v: number;
144
- }, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<factory.order.IOrder, "id"> & {
144
+ }) | (Omit<Omit<factory.order.IOrder, "id"> & {
145
145
  acceptedOffers?: import("./mongoose/schemas/order").IAcceptedOfferInDoc[];
146
146
  identifier?: string;
147
147
  paymentMethodId?: string;
148
+ }, "typeOf"> & {
149
+ typeOf: factory.transactionType.PlaceOrder;
148
150
  } & {
149
151
  _id: import("mongoose").Types.ObjectId;
150
152
  } & {
151
153
  __v: number;
152
- }) | null>;
154
+ })), import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & ((Omit<factory.order.IOrder, "id"> & {
155
+ acceptedOffers?: import("./mongoose/schemas/order").IAcceptedOfferInDoc[];
156
+ identifier?: string;
157
+ paymentMethodId?: string;
158
+ } & {
159
+ _id: import("mongoose").Types.ObjectId;
160
+ } & {
161
+ __v: number;
162
+ }) | (Omit<Omit<factory.order.IOrder, "id"> & {
163
+ acceptedOffers?: import("./mongoose/schemas/order").IAcceptedOfferInDoc[];
164
+ identifier?: string;
165
+ paymentMethodId?: string;
166
+ }, "typeOf"> & {
167
+ typeOf: factory.transactionType.PlaceOrder;
168
+ } & {
169
+ _id: import("mongoose").Types.ObjectId;
170
+ } & {
171
+ __v: number;
172
+ }))) | null>;
153
173
  unsetUnnecessaryFields(params: {
154
174
  filter: FilterQuery<IDocType>;
155
175
  $unset: any;
@@ -125,13 +125,13 @@ class PaymentServiceProviderRepo {
125
125
  }
126
126
  async create(params) {
127
127
  // 決済サービス存在確認
128
- let doc = await this.paymentServiceModel.findOne({
128
+ const existingDoc = await this.paymentServiceModel.findOne({
129
129
  typeOf: { $eq: params.providesPaymentService.typeOf },
130
130
  'project.id': { $eq: params.project.id },
131
131
  _id: { $eq: params.providesPaymentService.id }
132
132
  }, { _id: 1, typeOf: 1 })
133
133
  .exec();
134
- if (doc === null) {
134
+ if (existingDoc === null) {
135
135
  throw new factory_1.factory.errors.NotFound(params.providesPaymentService.typeOf);
136
136
  }
137
137
  const creatingProvider = {
@@ -141,7 +141,7 @@ class PaymentServiceProviderRepo {
141
141
  // name: params.name,
142
142
  typeOf: params.typeOf
143
143
  };
144
- doc = await this.paymentServiceModel.findOneAndUpdate({
144
+ const doc = await this.paymentServiceModel.findOneAndUpdate({
145
145
  typeOf: { $eq: params.providesPaymentService.typeOf },
146
146
  'project.id': { $eq: params.project.id },
147
147
  _id: { $eq: params.providesPaymentService.id },
@@ -1,5 +1,6 @@
1
- import { Connection, mongo } from 'mongoose';
1
+ import { Connection } from 'mongoose';
2
2
  import { factory } from '../../factory';
3
+ import { IModel } from '../mongoose/schemas/civicStructure';
3
4
  /**
4
5
  * ゲートを操作する組織
5
6
  */
@@ -36,12 +37,12 @@ export declare class EntranceGateRepo {
36
37
  addEntranceGatesByIdentifierIfNotExist(params: {
37
38
  $set: ICreatingEntranceGate;
38
39
  }[], options: IUpdateOptions): Promise<{
39
- bulkWriteResult?: mongo.BulkWriteResult;
40
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
40
41
  }>;
41
42
  updateEntranceGatesByIdentifier(params: {
42
43
  $set: ICreatingEntranceGate;
43
44
  }[], options: IUpdateOptions): Promise<{
44
- bulkWriteResult?: mongo.BulkWriteResult;
45
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
45
46
  }>;
46
47
  deleteEntranceGatesByIdentifier(params: {
47
48
  /**
@@ -49,7 +50,7 @@ export declare class EntranceGateRepo {
49
50
  */
50
51
  identifier: string;
51
52
  }[], options: IUpdateOptions): Promise<{
52
- bulkWriteResult?: mongo.BulkWriteResult;
53
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
53
54
  }>;
54
55
  private createMatchStages;
55
56
  }
@@ -1,7 +1,7 @@
1
- import type { Connection, mongo } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
2
  import type { FilterQuery } from '../mongoose/types';
3
3
  import { factory } from '../../factory';
4
- import { IDocType } from '../mongoose/schemas/civicStructure';
4
+ import { IDocType, IModel } from '../mongoose/schemas/civicStructure';
5
5
  export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
6
6
  export type IMovieTheaterIncludingScreeningRooms = Pick<factory.place.movieTheater.IPlace, 'additionalProperty' | 'branchCode' | 'kanaName' | 'name' | 'offers' | 'parentOrganization' | 'project' | 'telephone' | 'typeOf'> & {
7
7
  containsPlace: factory.place.screeningRoom.IPlace[];
@@ -49,7 +49,7 @@ export declare class MovieTheaterRepo {
49
49
  [key in keyof IUpsertingMovieTheater]?: 1;
50
50
  };
51
51
  }[], options: IUpsertOptions): Promise<{
52
- bulkWriteResult?: mongo.BulkWriteResult;
52
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
53
53
  /**
54
54
  * 追加あるいは編集された施設
55
55
  */
@@ -86,7 +86,7 @@ export declare class MovieTheaterRepo {
86
86
  */
87
87
  id: string;
88
88
  };
89
- }): Promise<mongo.DeleteResult>;
89
+ }): Promise<import("mongodb").DeleteResult>;
90
90
  /**
91
91
  * プロジェクトに属する施設を全削除
92
92
  */
@@ -1,7 +1,7 @@
1
- import type { Connection, PipelineStage, mongo } from 'mongoose';
1
+ import type { Connection, PipelineStage } from 'mongoose';
2
2
  import type { FilterQuery } from '../mongoose/types';
3
3
  import { factory } from '../../factory';
4
- import { IDocType } from '../mongoose/schemas/place';
4
+ import { IDocType, IModel } from '../mongoose/schemas/place';
5
5
  export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
6
6
  type IMatchStage = PipelineStage.Match;
7
7
  type IUpsertingRoom = Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'openSeatingAllowed'>;
@@ -66,7 +66,7 @@ export declare class ScreeningRoomRepo {
66
66
  [key in keyof IUpsertingRoom]?: 1;
67
67
  };
68
68
  }[], options: IUpsertOptions): Promise<{
69
- bulkWriteResult?: mongo.BulkWriteResult;
69
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
70
70
  }>;
71
71
  deleteRoomByBranchCode(screeningRoom: {
72
72
  /**
@@ -84,7 +84,7 @@ export declare class ScreeningRoomRepo {
84
84
  */
85
85
  id: string;
86
86
  };
87
- }): Promise<mongo.DeleteResult>;
87
+ }): Promise<import("mongodb").DeleteResult>;
88
88
  /**
89
89
  * ルーム検索
90
90
  * sectionCount,seatCountのprojectが可能
@@ -137,7 +137,7 @@ export declare class ScreeningRoomRepo {
137
137
  */
138
138
  id: string;
139
139
  };
140
- }): Promise<mongo.DeleteResult>;
140
+ }): Promise<import("mongodb").DeleteResult>;
141
141
  /**
142
142
  * プロジェクトに属するルームを全削除
143
143
  */
@@ -1,5 +1,6 @@
1
- import type { AnyExpression, Connection, PipelineStage, mongo } from 'mongoose';
1
+ import type { AnyExpression, Connection, PipelineStage } from 'mongoose';
2
2
  import { factory } from '../../factory';
3
+ import { IModel } from '../mongoose/schemas/place';
3
4
  type IMatchStage = PipelineStage.Match;
4
5
  type ICreatingSeat = Pick<factory.place.seat.IPlace, 'additionalProperty' | 'branchCode' | 'name' | 'maximumAttendeeCapacity' | 'seatingType'>;
5
6
  interface IUpdateOptions {
@@ -44,7 +45,7 @@ export declare class SeatRepo {
44
45
  addSeatsByBranchCodeIfNotExist(params: {
45
46
  $set: ICreatingSeat;
46
47
  }[], options: IUpdateOptions): Promise<{
47
- bulkWriteResult?: mongo.BulkWriteResult;
48
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
48
49
  }>;
49
50
  /**
50
51
  * コードをキーにして冪等編集
@@ -55,7 +56,7 @@ export declare class SeatRepo {
55
56
  [key in keyof ICreatingSeat]?: 1;
56
57
  };
57
58
  }[], options: IUpdateOptions): Promise<{
58
- bulkWriteResult?: mongo.BulkWriteResult;
59
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
59
60
  }>;
60
61
  updateSeatByBranchCode(seat: ICreatingSeat, $unset: any, // eslint-disable-line @typescript-eslint/no-explicit-any
61
62
  options: IUpdateOptions): Promise<IUpdateSeatResult>;
@@ -165,7 +166,7 @@ export declare class SeatRepo {
165
166
  */
166
167
  branchCode: string;
167
168
  }[], options: IUpdateOptions): Promise<{
168
- bulkWriteResult?: mongo.BulkWriteResult;
169
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
169
170
  }>;
170
171
  deleteSeatByBranchCode(seat: {
171
172
  /**
@@ -1,5 +1,6 @@
1
- import type { Connection, PipelineStage, mongo } from 'mongoose';
1
+ import type { Connection, PipelineStage } from 'mongoose';
2
2
  import { factory } from '../../factory';
3
+ import { IModel } from '../mongoose/schemas/place';
3
4
  type IScreeningRoomSectionWithoutContainsPlace = Omit<factory.place.screeningRoomSection.IPlace, 'containsPlace'>;
4
5
  type ICreatingSection = Pick<factory.place.screeningRoomSection.IPlace, 'additionalProperty' | 'branchCode' | 'name'>;
5
6
  type IMatchStage = PipelineStage.Match;
@@ -56,7 +57,7 @@ export declare class SectionRepo {
56
57
  addSeatSectionsByBranchCodeIfNotExist(params: {
57
58
  $set: IUpsertingSeatSection;
58
59
  }[], options: IUpsertOptions): Promise<{
59
- bulkWriteResult?: mongo.BulkWriteResult;
60
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
60
61
  }>;
61
62
  /**
62
63
  * コードをキーにして冪等編集
@@ -64,7 +65,7 @@ export declare class SectionRepo {
64
65
  updateSeatSectionsByBranchCode(params: {
65
66
  $set: IUpsertingSeatSection;
66
67
  }[], options: IUpsertOptions): Promise<{
67
- bulkWriteResult?: mongo.BulkWriteResult;
68
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
68
69
  }>;
69
70
  migrateSectionIdentifier(screeningRoomSection: {
70
71
  project: {
@@ -13,9 +13,9 @@ export declare class PriceSpecificationRepo {
13
13
  findById<T extends factory.priceSpecificationType>(params: {
14
14
  id: string;
15
15
  }): Promise<factory.priceSpecification.IPriceSpecification<T>>;
16
- save<T extends factory.priceSpecificationType.CategoryCodeChargeSpecification | factory.priceSpecificationType.MovieTicketTypeChargeSpecification>(params: {
16
+ savePriceSpec(params: {
17
17
  id?: string;
18
- attributes: factory.priceSpecification.IPriceSpecification<T> & {
18
+ attributes: (Omit<factory.priceSpecification.IPriceSpecification<factory.priceSpecificationType.CategoryCodeChargeSpecification>, 'id'> | Omit<factory.priceSpecification.IPriceSpecification<factory.priceSpecificationType.MovieTicketTypeChargeSpecification>, 'id'>) & {
19
19
  id?: never;
20
20
  $unset?: never;
21
21
  };
@@ -196,7 +196,7 @@ class PriceSpecificationRepo {
196
196
  }
197
197
  return doc;
198
198
  }
199
- async save(params) {
199
+ async savePriceSpec(params) {
200
200
  let savedId;
201
201
  if (typeof params.id !== 'string') {
202
202
  const { $unset, id, ...creatingDoc } = params.attributes; // eslint-disable-line @typescript-eslint/no-unused-vars
@@ -1,7 +1,7 @@
1
- import { Connection, Types, mongo } from 'mongoose';
1
+ import { Connection, Types } from 'mongoose';
2
2
  import type { FilterQuery } from './mongoose/types';
3
3
  import { factory } from '../factory';
4
- import { IDocType, IDocTypeAsProduct } from './mongoose/schemas/product';
4
+ import { IDocType, IDocTypeAsProduct, IModel } from './mongoose/schemas/product';
5
5
  type IKeyOfProjection = keyof factory.product.IProduct | 'hasOfferCatalog.id';
6
6
  /**
7
7
  * プロダクト検索条件
@@ -65,7 +65,7 @@ export declare class ProductRepo {
65
65
  };
66
66
  $unset?: Partial<Record<IUnsetKey, 1>>;
67
67
  }[]): Promise<{
68
- bulkWriteResult?: mongo.BulkWriteResult;
68
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
69
69
  modifiedProducts?: {
70
70
  id: string;
71
71
  }[];
@@ -80,7 +80,7 @@ export declare class ProductRepo {
80
80
  hasOfferCatalog: {
81
81
  id: string;
82
82
  };
83
- }): Promise<mongo.DeleteResult>;
83
+ }): Promise<import("mongodb").DeleteResult>;
84
84
  /**
85
85
  * プロジェクト指定で削除する
86
86
  */
@@ -1,5 +1,5 @@
1
- import type { Connection, UpdateWriteOpResult, mongo } from 'mongoose';
2
- import { IDocType } from './mongoose/schemas/reservation';
1
+ import type { Connection, UpdateWriteOpResult } from 'mongoose';
2
+ import { IDocType, IModel } from './mongoose/schemas/reservation';
3
3
  import { factory } from '../factory';
4
4
  export interface IUpdatePartiallyParams {
5
5
  additionalTicketText?: string;
@@ -76,7 +76,7 @@ export declare class ReservationRepo {
76
76
  reservationNumber: string;
77
77
  underName?: factory.reservation.IUnderName;
78
78
  broker?: factory.reservation.IBroker;
79
- }): Promise<mongo.BulkWriteResult | undefined>;
79
+ }): Promise<Awaited<ReturnType<IModel['bulkWrite']>> | undefined>;
80
80
  /**
81
81
  * 予約取消
82
82
  */
@@ -17,7 +17,7 @@ export declare class RoleRepo {
17
17
  */
18
18
  findUniquePermissionsByRoleName(params: {
19
19
  roleName: {
20
- $in: string[];
20
+ $in: factory.role.organizationRole.RoleName[];
21
21
  };
22
22
  }): Promise<string[]>;
23
23
  addPermissionIfNotExists(params: {
@@ -1,5 +1,6 @@
1
- import { Connection, mongo } from 'mongoose';
1
+ import { Connection } from 'mongoose';
2
2
  import { factory } from '../factory';
3
+ import { IModel } from './mongoose/schemas/seller';
3
4
  type IMakesOffer = Pick<factory.seller.IMakesOffer, 'typeOf' | 'availableAtOrFrom' | 'eligibleTransactionDuration'>;
4
5
  type IMakesOfferAsFindResult = IMakesOffer & {
5
6
  offeredBy: {
@@ -50,7 +51,7 @@ export declare class SellerMakesOfferRepo {
50
51
  id: string;
51
52
  };
52
53
  }[];
53
- }): Promise<mongo.BulkWriteResult | undefined>;
54
+ }): Promise<Awaited<ReturnType<IModel['bulkWrite']>> | undefined>;
54
55
  /**
55
56
  * 販売者とアプリケーションに対してオファーが存在すれば削除する
56
57
  */
@@ -66,6 +67,6 @@ export declare class SellerMakesOfferRepo {
66
67
  id: string;
67
68
  };
68
69
  }[];
69
- }): Promise<mongo.BulkWriteResult | undefined>;
70
+ }): Promise<Awaited<ReturnType<IModel['bulkWrite']>> | undefined>;
70
71
  }
71
72
  export {};
@@ -71,7 +71,7 @@ class TransactionNumberCounterRepo {
71
71
  throw error;
72
72
  }
73
73
  }
74
- if (doc === undefined) {
74
+ if (doc === undefined || doc === null) {
75
75
  throw new factory_1.factory.errors.NotFound('DataFeed');
76
76
  }
77
77
  const incrReply = doc.interactionStatistic?.userInteractionCount;
package/package.json CHANGED
@@ -46,7 +46,7 @@
46
46
  "csvtojson": "^2.0.10",
47
47
  "dependency-cruiser": "17.3.8",
48
48
  "eslint": "9.39.2",
49
- "mongoose": "8.24.8",
49
+ "mongoose": "8.24.9",
50
50
  "rimraf": "6.1.3",
51
51
  "size-limit": "12.0.0",
52
52
  "typescript": "5.9.3",
@@ -89,5 +89,5 @@
89
89
  "postversion": "git push origin --tags",
90
90
  "prepublishOnly": "npm run clean && npm run build"
91
91
  },
92
- "version": "28.2.0-alpha.3"
92
+ "version": "28.2.0-alpha.4"
93
93
  }