@chevre/domain 25.2.0-alpha.34 → 25.2.0-alpha.36

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 (35) hide show
  1. package/lib/chevre/repo/aggregateOffer.d.ts +2 -3
  2. package/lib/chevre/repo/creativeWork.d.ts +2 -3
  3. package/lib/chevre/repo/customerType.d.ts +2 -3
  4. package/lib/chevre/repo/event.d.ts +10 -11
  5. package/lib/chevre/repo/eventOffer.d.ts +4 -5
  6. package/lib/chevre/repo/eventSellerMakesOffer.d.ts +2 -3
  7. package/lib/chevre/repo/eventSeries.d.ts +4 -5
  8. package/lib/chevre/repo/note.d.ts +3 -4
  9. package/lib/chevre/repo/noteAboutOrder.d.ts +2 -3
  10. package/lib/chevre/repo/offerCatalog.d.ts +2 -3
  11. package/lib/chevre/repo/offerCatalogItem.d.ts +2 -3
  12. package/lib/chevre/repo/orderInTransaction.d.ts +16 -1
  13. package/lib/chevre/repo/orderInTransaction.js +6 -3
  14. package/lib/chevre/repo/place/entranceGate.d.ts +4 -5
  15. package/lib/chevre/repo/place/movieTheater.d.ts +3 -4
  16. package/lib/chevre/repo/place/screeningRoom.d.ts +4 -5
  17. package/lib/chevre/repo/place/seat.d.ts +4 -5
  18. package/lib/chevre/repo/place/section.d.ts +3 -4
  19. package/lib/chevre/repo/product.d.ts +3 -4
  20. package/lib/chevre/repo/rateLimit/offer.js +0 -12
  21. package/lib/chevre/repo/reservation.d.ts +2 -3
  22. package/lib/chevre/repo/sellerMakesOffer.d.ts +3 -4
  23. package/lib/chevre/repo/stockHolder.d.ts +1 -1
  24. package/lib/chevre/repo/stockHolder.js +0 -146
  25. package/lib/chevre/repo/transactionNumberCounter.js +0 -34
  26. package/lib/chevre/repo/transactionProcess.js +0 -13
  27. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +2 -1
  28. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +13 -58
  29. package/lib/chevre/service/order/placeOrder/factory.js +3 -21
  30. package/lib/chevre/service/order/placeOrder.d.ts +2 -5
  31. package/lib/chevre/service/order/placeOrder.js +20 -31
  32. package/lib/chevre/service/task/placeOrder.js +2 -0
  33. package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -2
  34. package/lib/chevre/service/transaction/placeOrder/start.d.ts +1 -1
  35. package/package.json +6 -8
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { AnyExpression, Connection, Document, FilterQuery, PipelineStage } from 'mongoose';
1
+ import { AnyExpression, Connection, Document, FilterQuery, PipelineStage, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import { IDocType as IAggregateOfferDocType } from './mongoose/schemas/aggregateOffer';
5
4
  type IMatchStage = PipelineStage.Match;
@@ -80,7 +79,7 @@ export declare class AggregateOfferRepo {
80
79
  */
81
80
  productType: factory.product.ProductType;
82
81
  }): Promise<{
83
- bulkWriteResult?: BulkWriteResult;
82
+ bulkWriteResult?: mongo.BulkWriteResult;
84
83
  modifiedOffers?: {
85
84
  id: string;
86
85
  }[];
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery, Types } from 'mongoose';
1
+ import { Connection, FilterQuery, Types, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import { IDocType } from './mongoose/schemas/creativeWork';
5
4
  type IKeyOfProjection = keyof factory.creativeWork.movie.ICreativeWork;
@@ -32,7 +31,7 @@ export declare class CreativeWorkRepo {
32
31
  [key in keyof factory.creativeWork.movie.ICreativeWork]?: 1;
33
32
  };
34
33
  }[]): Promise<{
35
- bulkWriteResult?: BulkWriteResult;
34
+ bulkWriteResult?: mongo.BulkWriteResult;
36
35
  }>;
37
36
  /**
38
37
  * コンテンツを検索する
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { ICustomerType } from './mongoose/schemas/customerType';
4
3
  import { factory } from '../factory';
5
4
  type IKeyOfProjection = keyof ICustomerType;
@@ -17,6 +16,6 @@ export declare class CustomerTypeRepo {
17
16
  saveManyByCodeValue(params: {
18
17
  attributes: ICustomerType;
19
18
  upsert?: boolean;
20
- }[]): Promise<BulkWriteResult | undefined>;
19
+ }[]): Promise<mongo.BulkWriteResult | undefined>;
21
20
  }
22
21
  export {};
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery } from 'mongoose';
1
+ import { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import * as EventFactory from '../factory/event';
5
4
  export interface IAttributes4patchUpdate {
@@ -83,7 +82,7 @@ export declare class EventRepo {
83
82
  */
84
83
  update: boolean;
85
84
  }): Promise<{
86
- bulkWriteResult?: BulkWriteResult;
85
+ bulkWriteResult?: mongo.BulkWriteResult;
87
86
  modifiedEvents: {
88
87
  id: string;
89
88
  }[];
@@ -202,7 +201,7 @@ export declare class EventRepo {
202
201
  organizer: {
203
202
  id: string;
204
203
  };
205
- }): Promise<import("mongodb").DeleteResult>;
204
+ }): Promise<mongo.DeleteResult>;
206
205
  deleteManyEventsByScreeningRoom(params: {
207
206
  project: {
208
207
  id: string;
@@ -219,7 +218,7 @@ export declare class EventRepo {
219
218
  id: string;
220
219
  };
221
220
  };
222
- }): Promise<import("mongodb").DeleteResult>;
221
+ }): Promise<mongo.DeleteResult>;
223
222
  deleteManyBySuperEventId(params: {
224
223
  project: {
225
224
  id: string;
@@ -227,7 +226,7 @@ export declare class EventRepo {
227
226
  superEvent: {
228
227
  id: string;
229
228
  };
230
- }): Promise<import("mongodb").DeleteResult>;
229
+ }): Promise<mongo.DeleteResult>;
231
230
  deleteManyBySuperEventLocationId(params: {
232
231
  project: {
233
232
  id: string;
@@ -237,7 +236,7 @@ export declare class EventRepo {
237
236
  id: string;
238
237
  };
239
238
  };
240
- }): Promise<import("mongodb").DeleteResult>;
239
+ }): Promise<mongo.DeleteResult>;
241
240
  /**
242
241
  * 興行(プロダクト)から削除する
243
242
  */
@@ -252,7 +251,7 @@ export declare class EventRepo {
252
251
  };
253
252
  };
254
253
  };
255
- }): Promise<import("mongodb").DeleteResult>;
254
+ }): Promise<mongo.DeleteResult>;
256
255
  deleteManyEventsEndedByProject(params: {
257
256
  typeOf: {
258
257
  $in: factory.eventType.ScreeningEvent[];
@@ -263,7 +262,7 @@ export declare class EventRepo {
263
262
  endDate: {
264
263
  $lte: Date;
265
264
  };
266
- }): Promise<import("mongodb").DeleteResult>;
265
+ }): Promise<mongo.DeleteResult>;
267
266
  deleteManyEventsEnded(params: {
268
267
  typeOf: {
269
268
  $eq: factory.eventType.ScreeningEvent;
@@ -271,7 +270,7 @@ export declare class EventRepo {
271
270
  endDate: {
272
271
  $lte: Date;
273
272
  };
274
- }): Promise<import("mongodb").DeleteResult>;
273
+ }): Promise<mongo.DeleteResult>;
275
274
  deleteByProject(params: {
276
275
  project: {
277
276
  id: string;
@@ -283,7 +282,7 @@ export declare class EventRepo {
283
282
  updateAggregationById(params: {
284
283
  id: string;
285
284
  }, update: IUpdateAggregateReservationParams): Promise<void>;
286
- bulkWrite(bulkWriteOps: any[]): Promise<BulkWriteResult & {
285
+ bulkWrite(bulkWriteOps: any[]): Promise<mongo.BulkWriteResult & {
287
286
  mongoose?: {
288
287
  validationErrors: import("mongoose").Error[];
289
288
  } | undefined;
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult, DeleteResult } from 'mongodb';
2
- import { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import { IDocType } from './mongoose/schemas/eventOffer';
5
4
  type IUnset = {
@@ -32,7 +31,7 @@ export declare class EventOfferRepo {
32
31
  */
33
32
  update: boolean;
34
33
  }): Promise<{
35
- bulkWriteResult?: BulkWriteResult;
34
+ bulkWriteResult?: mongo.BulkWriteResult;
36
35
  modifiedProductOffers?: {
37
36
  id: string;
38
37
  }[];
@@ -47,7 +46,7 @@ export declare class EventOfferRepo {
47
46
  seller: {
48
47
  id: string;
49
48
  };
50
- }): Promise<DeleteResult>;
49
+ }): Promise<mongo.DeleteResult>;
51
50
  /**
52
51
  * 有効期間を過ぎたイベントオファーを削除する
53
52
  */
@@ -55,6 +54,6 @@ export declare class EventOfferRepo {
55
54
  validThrough: {
56
55
  $lte: Date;
57
56
  };
58
- }): Promise<DeleteResult>;
57
+ }): Promise<mongo.DeleteResult>;
59
58
  }
60
59
  export {};
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection } from 'mongoose';
1
+ import type { Connection, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  /**
5
4
  * イベントのアプリケーションオファーリポジトリ
@@ -31,7 +30,7 @@ export declare class EventSellerMakesOfferRepo {
31
30
  };
32
31
  };
33
32
  }[]): Promise<{
34
- bulkWriteResult?: BulkWriteResult;
33
+ bulkWriteResult?: mongo.BulkWriteResult;
35
34
  modifiedEvents?: {
36
35
  id: string;
37
36
  }[];
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  type ISearchConditions = factory.eventSeries.ISearchConditions;
5
4
  type IKeyOfProjection = Exclude<keyof factory.eventSeries.IEvent, 'id' | 'videoFormat'>;
@@ -26,7 +25,7 @@ export declare class EventSeriesRepo {
26
25
  */
27
26
  upsert: boolean;
28
27
  }): Promise<{
29
- bulkWriteResult?: BulkWriteResult;
28
+ bulkWriteResult?: mongo.BulkWriteResult;
30
29
  modifiedEvents: {
31
30
  id: string;
32
31
  }[];
@@ -55,7 +54,7 @@ export declare class EventSeriesRepo {
55
54
  organizer: {
56
55
  id: string;
57
56
  };
58
- }): Promise<import("mongodb").DeleteResult>;
57
+ }): Promise<mongo.DeleteResult>;
59
58
  deleteManyByLocationId(params: {
60
59
  project: {
61
60
  id: string;
@@ -63,7 +62,7 @@ export declare class EventSeriesRepo {
63
62
  location: {
64
63
  id: string;
65
64
  };
66
- }): Promise<import("mongodb").DeleteResult>;
65
+ }): Promise<mongo.DeleteResult>;
67
66
  /**
68
67
  * 既存施設コンテンツの最大バージョンを集計する
69
68
  */
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult, DeleteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  type INoteDigitalDocument = factory.creativeWork.noteDigitalDocument.INoteDigitalDocument;
5
4
  type IKeyOfProjection = keyof INoteDigitalDocument;
@@ -29,7 +28,7 @@ export declare class NoteRepo {
29
28
  */
30
29
  update: boolean;
31
30
  }): Promise<{
32
- bulkWriteResult?: BulkWriteResult;
31
+ bulkWriteResult?: mongo.BulkWriteResult;
33
32
  modifiedNotes?: {
34
33
  id: string;
35
34
  }[];
@@ -42,7 +41,7 @@ export declare class NoteRepo {
42
41
  id: string;
43
42
  typeOf: factory.creativeWork.noteDigitalDocument.IAbout['typeOf'];
44
43
  };
45
- }): Promise<DeleteResult>;
44
+ }): Promise<mongo.DeleteResult>;
46
45
  unsetUnnecessaryFields(params: {
47
46
  filter: any;
48
47
  $unset: any;
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  type INoteAboutOrder = factory.creativeWork.noteDigitalDocument.INoteAboutOrder;
5
4
  type IKeyOfProjection = keyof INoteAboutOrder;
@@ -21,7 +20,7 @@ export declare class NoteAboutOrderRepo {
21
20
  */
22
21
  upsertOrderNoteByIdentifier(params: Pick<INoteAboutOrder, 'about' | 'creator' | 'identifier' | 'project' | 'provider' | 'text' | 'version'>[], options: {
23
22
  overwrite: boolean;
24
- }): Promise<BulkWriteResult | undefined>;
23
+ }): Promise<mongo.BulkWriteResult | undefined>;
25
24
  updateById(params: {
26
25
  id: string;
27
26
  attributes: Pick<INoteAboutOrder, 'text' | 'editor'>;
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import { IDocType } from './mongoose/schemas/offerCatalog';
5
4
  export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty'> & {
@@ -49,7 +48,7 @@ export declare class OfferCatalogRepo {
49
48
  */
50
49
  itemListElementType: factory.offerCatalog.IItemListElement['typeOf'];
51
50
  }): Promise<{
52
- bulkWriteResult?: BulkWriteResult;
51
+ bulkWriteResult?: mongo.BulkWriteResult;
53
52
  modifiedCatalogs?: {
54
53
  id: string;
55
54
  }[];
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery } from 'mongoose';
1
+ import { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty' | 'relatedOffer'> & {
5
4
  numberOfItems?: number;
@@ -42,7 +41,7 @@ export declare class OfferCatalogItemRepo {
42
41
  */
43
42
  productType: factory.product.ProductType;
44
43
  }): Promise<{
45
- bulkWriteResult?: BulkWriteResult;
44
+ bulkWriteResult?: mongo.BulkWriteResult;
46
45
  modifiedCatalogs?: {
47
46
  id: string;
48
47
  }[];
@@ -16,10 +16,20 @@ export type IOrderInTransaction = Pick<factory.order.IOrder, 'orderNumber' | 'pr
16
16
  /**
17
17
  * typeOf: Orderへドキュメント変換時の編集フィールド
18
18
  */
19
- export type IPlacingOrder = Pick<factory.order.IOrder, 'confirmationNumber' | 'orderDate' | 'orderNumber' | 'orderStatus' | 'orderedItem' | 'paymentMethods' | 'price' | 'priceCurrency' | 'typeOf'> & {
19
+ export type IPlacingOrder = Pick<factory.order.IOrder, 'orderDate' | 'orderStatus' | 'orderedItem' | 'paymentMethods' | 'price' | 'priceCurrency' | 'typeOf'> & {
20
20
  url?: never;
21
21
  identifier?: never;
22
22
  name?: never;
23
+ /**
24
+ * 上書きしてはいけない
25
+ * 注文取引進行中にセット済であり上書きしてはいけない
26
+ */
27
+ orderNumber?: never;
28
+ /**
29
+ * 上書きしてはいけない
30
+ * 注文取引進行中にセット済であり上書きしてはいけない
31
+ */
32
+ confirmationNumber?: never;
23
33
  /**
24
34
  * 上書きしてはいけない
25
35
  */
@@ -103,6 +113,11 @@ export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
103
113
  project: {
104
114
  id: string;
105
115
  };
116
+ }, options: {
117
+ /**
118
+ * 注文取引タイプのドキュメントのみを参照対象にするかどうか
119
+ */
120
+ onlyPlaceOrder: boolean;
106
121
  }): Promise<(Pick<factory.order.IAcceptedOffer, 'id' | 'itemOffered' | 'offeredThrough' | 'serialNumber' | 'typeOf'> & {
107
122
  priceSpecification?: factory.order.ITicketPriceSpecification;
108
123
  })[]>;
@@ -96,10 +96,12 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
96
96
  * 取引進行中の注文からacceptedOffersを検索する
97
97
  * 予約取引から予約ごとの価格仕様も参照する
98
98
  */
99
- async findAcceptedOffersWithPriceByIdentifier(params) {
99
+ async findAcceptedOffersWithPriceByIdentifier(params, options) {
100
+ const onlyPlaceOrder = options.onlyPlaceOrder === true;
100
101
  const doc = await this.orderModel.findOne({
101
102
  identifier: { $eq: params.identifier },
102
- typeOf: { $eq: factory_1.factory.transactionType.PlaceOrder }
103
+ 'project.id': { $eq: params.project.id },
104
+ ...((onlyPlaceOrder) && { typeOf: { $eq: factory_1.factory.transactionType.PlaceOrder } })
103
105
  }, { acceptedOffers: 1 })
104
106
  .lean()
105
107
  .exec();
@@ -145,7 +147,8 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
145
147
  if (!(order.orderDate instanceof Date)) {
146
148
  throw new factory_1.factory.errors.Argument('orderDate', 'must be Date');
147
149
  }
148
- const setFields = order;
150
+ const { confirmationNumber: _confirmationNumber, orderNumber: _orderNumber, ...setFields } = order;
151
+ // const setFields: AnyKeys<factory.order.IOrder> = order;
149
152
  // typeOf:PlaceOrderのドキュメントが存在すれば、typeOf:Orderに変更する
150
153
  await this.orderModel.updateOne({
151
154
  identifier: { $eq: identifier },
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection } from 'mongoose';
1
+ import { Connection, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  /**
5
4
  * ゲートを操作する組織
@@ -37,12 +36,12 @@ export declare class EntranceGateRepo {
37
36
  addEntranceGatesByIdentifierIfNotExist(params: {
38
37
  $set: ICreatingEntranceGate;
39
38
  }[], options: IUpdateOptions): Promise<{
40
- bulkWriteResult?: BulkWriteResult;
39
+ bulkWriteResult?: mongo.BulkWriteResult;
41
40
  }>;
42
41
  updateEntranceGatesByIdentifier(params: {
43
42
  $set: ICreatingEntranceGate;
44
43
  }[], options: IUpdateOptions): Promise<{
45
- bulkWriteResult?: BulkWriteResult;
44
+ bulkWriteResult?: mongo.BulkWriteResult;
46
45
  }>;
47
46
  deleteEntranceGatesByIdentifier(params: {
48
47
  /**
@@ -50,7 +49,7 @@ export declare class EntranceGateRepo {
50
49
  */
51
50
  identifier: string;
52
51
  }[], options: IUpdateOptions): Promise<{
53
- bulkWriteResult?: BulkWriteResult;
52
+ bulkWriteResult?: mongo.BulkWriteResult;
54
53
  }>;
55
54
  private createMatchStages;
56
55
  }
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  import { IDocType } from '../mongoose/schemas/civicStructure';
5
4
  export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
@@ -49,7 +48,7 @@ export declare class MovieTheaterRepo {
49
48
  [key in keyof IUpsertingMovieTheater]?: 1;
50
49
  };
51
50
  }[], options: IUpsertOptions): Promise<{
52
- bulkWriteResult?: BulkWriteResult;
51
+ bulkWriteResult?: mongo.BulkWriteResult;
53
52
  /**
54
53
  * 追加あるいは編集された施設
55
54
  */
@@ -86,7 +85,7 @@ export declare class MovieTheaterRepo {
86
85
  */
87
86
  id: string;
88
87
  };
89
- }): Promise<import("mongodb").DeleteResult>;
88
+ }): Promise<mongo.DeleteResult>;
90
89
  /**
91
90
  * プロジェクトに属する施設を全削除
92
91
  */
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery, PipelineStage } from 'mongoose';
1
+ import type { Connection, FilterQuery, PipelineStage, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  import { IDocType } from '../mongoose/schemas/place';
5
4
  export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
@@ -66,7 +65,7 @@ export declare class ScreeningRoomRepo {
66
65
  [key in keyof IUpsertingRoom]?: 1;
67
66
  };
68
67
  }[], options: IUpsertOptions): Promise<{
69
- bulkWriteResult?: BulkWriteResult;
68
+ bulkWriteResult?: mongo.BulkWriteResult;
70
69
  }>;
71
70
  deleteRoomByBranchCode(screeningRoom: {
72
71
  /**
@@ -84,7 +83,7 @@ export declare class ScreeningRoomRepo {
84
83
  */
85
84
  id: string;
86
85
  };
87
- }): Promise<import("mongodb").DeleteResult>;
86
+ }): Promise<mongo.DeleteResult>;
88
87
  searchScreeningRooms(searchConditions: factory.place.screeningRoom.ISearchConditions): Promise<Omit<factory.place.screeningRoom.IPlace, 'containsPlace' | 'parentOrganization'>[]>;
89
88
  findRooms(params: Omit<factory.place.screeningRoom.ISearchConditions, '$projection'>): Promise<Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'openSeatingAllowed' | 'maximumAttendeeCapacity'>[]>;
90
89
  /**
@@ -116,7 +115,7 @@ export declare class ScreeningRoomRepo {
116
115
  */
117
116
  id: string;
118
117
  };
119
- }): Promise<import("mongodb").DeleteResult>;
118
+ }): Promise<mongo.DeleteResult>;
120
119
  /**
121
120
  * プロジェクトに属するルームを全削除
122
121
  */
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { AnyExpression, Connection, PipelineStage } from 'mongoose';
1
+ import type { AnyExpression, Connection, PipelineStage, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  type IMatchStage = PipelineStage.Match;
5
4
  type ICreatingSeat = Pick<factory.place.seat.IPlace, 'additionalProperty' | 'branchCode' | 'name' | 'maximumAttendeeCapacity' | 'seatingType'>;
@@ -45,7 +44,7 @@ export declare class SeatRepo {
45
44
  addSeatsByBranchCodeIfNotExist(params: {
46
45
  $set: ICreatingSeat;
47
46
  }[], options: IUpdateOptions): Promise<{
48
- bulkWriteResult?: BulkWriteResult;
47
+ bulkWriteResult?: mongo.BulkWriteResult;
49
48
  }>;
50
49
  /**
51
50
  * コードをキーにして冪等編集
@@ -56,7 +55,7 @@ export declare class SeatRepo {
56
55
  [key in keyof ICreatingSeat]?: 1;
57
56
  };
58
57
  }[], options: IUpdateOptions): Promise<{
59
- bulkWriteResult?: BulkWriteResult;
58
+ bulkWriteResult?: mongo.BulkWriteResult;
60
59
  }>;
61
60
  updateSeatByBranchCode(seat: ICreatingSeat, $unset: any, // eslint-disable-line @typescript-eslint/no-explicit-any
62
61
  options: IUpdateOptions): Promise<IUpdateSeatResult>;
@@ -166,7 +165,7 @@ export declare class SeatRepo {
166
165
  */
167
166
  branchCode: string;
168
167
  }[], options: IUpdateOptions): Promise<{
169
- bulkWriteResult?: BulkWriteResult;
168
+ bulkWriteResult?: mongo.BulkWriteResult;
170
169
  }>;
171
170
  deleteSeatByBranchCode(seat: {
172
171
  /**
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, PipelineStage } from 'mongoose';
1
+ import type { Connection, PipelineStage, mongo } from 'mongoose';
3
2
  import { factory } from '../../factory';
4
3
  type IScreeningRoomSectionWithoutContainsPlace = Omit<factory.place.screeningRoomSection.IPlace, 'containsPlace'>;
5
4
  type ICreatingSection = Pick<factory.place.screeningRoomSection.IPlace, 'additionalProperty' | 'branchCode' | 'name'>;
@@ -57,7 +56,7 @@ export declare class SectionRepo {
57
56
  addSeatSectionsByBranchCodeIfNotExist(params: {
58
57
  $set: IUpsertingSeatSection;
59
58
  }[], options: IUpsertOptions): Promise<{
60
- bulkWriteResult?: BulkWriteResult;
59
+ bulkWriteResult?: mongo.BulkWriteResult;
61
60
  }>;
62
61
  /**
63
62
  * コードをキーにして冪等編集
@@ -65,7 +64,7 @@ export declare class SectionRepo {
65
64
  updateSeatSectionsByBranchCode(params: {
66
65
  $set: IUpsertingSeatSection;
67
66
  }[], options: IUpsertOptions): Promise<{
68
- bulkWriteResult?: BulkWriteResult;
67
+ bulkWriteResult?: mongo.BulkWriteResult;
69
68
  }>;
70
69
  migrateSectionIdentifier(screeningRoomSection: {
71
70
  project: {
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery, Types } from 'mongoose';
1
+ import { Connection, FilterQuery, Types, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import { IDocType, IDocTypeAsProduct } from './mongoose/schemas/product';
5
4
  type IKeyOfProjection = keyof factory.product.IProduct | 'hasOfferCatalog.id';
@@ -65,7 +64,7 @@ export declare class ProductRepo {
65
64
  };
66
65
  $unset?: Partial<Record<IUnsetKey, 1>>;
67
66
  }[]): Promise<{
68
- bulkWriteResult?: BulkWriteResult;
67
+ bulkWriteResult?: mongo.BulkWriteResult;
69
68
  modifiedProducts?: {
70
69
  id: string;
71
70
  }[];
@@ -80,7 +79,7 @@ export declare class ProductRepo {
80
79
  hasOfferCatalog: {
81
80
  id: string;
82
81
  };
83
- }): Promise<import("mongodb").DeleteResult>;
82
+ }): Promise<mongo.DeleteResult>;
84
83
  /**
85
84
  * プロジェクト指定で削除する
86
85
  */
@@ -28,7 +28,6 @@ class OfferRateLimitRepo {
28
28
  * ロックする
29
29
  * discontinue array params(2025-05-26~)
30
30
  */
31
- // public async lock(ratelimitKeys: IRateLimitKey[]): Promise<void> {
32
31
  async lock(params) {
33
32
  const key = OfferRateLimitRepo.createKey(params);
34
33
  const value = params.reservationNumber;
@@ -50,18 +49,8 @@ class OfferRateLimitRepo {
50
49
  catch (_error) {
51
50
  throw new factory_1.factory.errors.RateLimitExceeded('Offer');
52
51
  }
53
- // const multi = this.redisClient.multi();
54
- // multi.setNX(key, value)
55
- // .expire(key, ttl);
56
- // const results = await multi.exec();
57
- // if (Array.isArray(results) && (results[0] === 1 || (<any>results)[0] === true)) {
58
- // return;
59
- // } else {
60
- // throw new factory.errors.RateLimitExceeded('Offer');
61
- // }
62
52
  }
63
53
  // discontinue array params(2025-05-26~)
64
- // public async unlock(ratelimitKeys: IRateLimitKey[]): Promise<void> {
65
54
  async unlock(params) {
66
55
  const key = OfferRateLimitRepo.createKey(params);
67
56
  // reimplement using concurrentLockRepo(2025-05-27~)
@@ -69,7 +58,6 @@ class OfferRateLimitRepo {
69
58
  about: { identifier: key, typeOf: 'Thing' },
70
59
  audience: { identifier: params.reservationNumber, typeOf: 'Audience' }
71
60
  });
72
- // await this.redisClient.del(key);
73
61
  }
74
62
  async getHolder(ratelimitKey) {
75
63
  const key = OfferRateLimitRepo.createKey(ratelimitKey);
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, UpdateWriteOpResult } from 'mongoose';
1
+ import type { Connection, UpdateWriteOpResult, mongo } from 'mongoose';
3
2
  import { IDocType } from './mongoose/schemas/reservation';
4
3
  import { factory } from '../factory';
5
4
  export interface IUpdatePartiallyParams {
@@ -77,7 +76,7 @@ export declare class ReservationRepo {
77
76
  reservationNumber: string;
78
77
  underName?: factory.reservation.IUnderName;
79
78
  broker?: factory.reservation.IBroker;
80
- }): Promise<BulkWriteResult | undefined>;
79
+ }): Promise<mongo.BulkWriteResult | undefined>;
81
80
  /**
82
81
  * 予約取消
83
82
  */
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection } from 'mongoose';
1
+ import { Connection, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  type IMakesOffer = Pick<factory.seller.IMakesOffer, 'typeOf' | 'availableAtOrFrom' | 'eligibleTransactionDuration'>;
5
4
  type IMakesOfferAsFindResult = IMakesOffer & {
@@ -51,7 +50,7 @@ export declare class SellerMakesOfferRepo {
51
50
  id: string;
52
51
  };
53
52
  }[];
54
- }): Promise<BulkWriteResult | undefined>;
53
+ }): Promise<mongo.BulkWriteResult | undefined>;
55
54
  /**
56
55
  * 販売者とアプリケーションに対してオファーが存在すれば削除する
57
56
  */
@@ -67,6 +66,6 @@ export declare class SellerMakesOfferRepo {
67
66
  id: string;
68
67
  };
69
68
  }[];
70
- }): Promise<BulkWriteResult | undefined>;
69
+ }): Promise<mongo.BulkWriteResult | undefined>;
71
70
  }
72
71
  export {};
@@ -16,7 +16,7 @@ export declare class StockHolderRepo implements AbstractStockHolderRepo {
16
16
  /**
17
17
  * 座席をロックする
18
18
  */
19
- lock(lockKey: ILockKey & {}): Promise<void>;
19
+ lock(lockKey: ILockKey): Promise<void>;
20
20
  /**
21
21
  * 座席ロックを解除する
22
22
  */