@chevre/domain 28.2.0-alpha.2 → 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 (88) hide show
  1. package/lib/chevre/repo/action/inform.d.ts +2 -1
  2. package/lib/chevre/repo/action/update.d.ts +2 -1
  3. package/lib/chevre/repo/action/use.d.ts +2 -1
  4. package/lib/chevre/repo/additionalProperty.d.ts +4 -2
  5. package/lib/chevre/repo/additionalProperty.js +6 -7
  6. package/lib/chevre/repo/adminAction.d.ts +3 -2
  7. package/lib/chevre/repo/adminAssetTransaction.d.ts +3 -2
  8. package/lib/chevre/repo/adminAsyncAction.d.ts +3 -2
  9. package/lib/chevre/repo/adminCheckMovieTicketAction.d.ts +2 -1
  10. package/lib/chevre/repo/adminEvent.d.ts +13 -11
  11. package/lib/chevre/repo/adminEvent.js +1 -2
  12. package/lib/chevre/repo/adminEventSeries.d.ts +5 -3
  13. package/lib/chevre/repo/adminEventSeries.js +1 -1
  14. package/lib/chevre/repo/adminPaymentServiceChannel.d.ts +2 -1
  15. package/lib/chevre/repo/adminPendingReservation.d.ts +4 -3
  16. package/lib/chevre/repo/adminScheduledTask.d.ts +3 -2
  17. package/lib/chevre/repo/adminTask.d.ts +5 -4
  18. package/lib/chevre/repo/aggregateOffer.d.ts +8 -7
  19. package/lib/chevre/repo/aggregateOffer.js +6 -8
  20. package/lib/chevre/repo/assetTransaction.d.ts +10 -8
  21. package/lib/chevre/repo/assetTransaction.js +3 -1
  22. package/lib/chevre/repo/authorization.d.ts +5 -3
  23. package/lib/chevre/repo/categoryCode.d.ts +5 -4
  24. package/lib/chevre/repo/categoryCode.js +0 -1
  25. package/lib/chevre/repo/creativeWork.d.ts +7 -6
  26. package/lib/chevre/repo/creativeWork.js +8 -9
  27. package/lib/chevre/repo/customer.d.ts +3 -2
  28. package/lib/chevre/repo/customerType.d.ts +5 -4
  29. package/lib/chevre/repo/emailMessage.d.ts +5 -2
  30. package/lib/chevre/repo/emailMessage.js +10 -8
  31. package/lib/chevre/repo/event.d.ts +4 -2
  32. package/lib/chevre/repo/eventOffer.d.ts +6 -5
  33. package/lib/chevre/repo/eventSellerMakesOffer.d.ts +3 -2
  34. package/lib/chevre/repo/eventSeries.d.ts +4 -2
  35. package/lib/chevre/repo/factory/action/createMongoConditions.d.ts +1 -1
  36. package/lib/chevre/repo/factory/reservation/createMongoConditions.d.ts +3 -2
  37. package/lib/chevre/repo/identity.d.ts +3 -2
  38. package/lib/chevre/repo/identityProvider.d.ts +3 -2
  39. package/lib/chevre/repo/issuer.d.ts +3 -2
  40. package/lib/chevre/repo/issuer.js +6 -7
  41. package/lib/chevre/repo/member.d.ts +6 -5
  42. package/lib/chevre/repo/merchantReturnPolicy.d.ts +6 -4
  43. package/lib/chevre/repo/merchantReturnPolicy.js +12 -10
  44. package/lib/chevre/repo/message.d.ts +4 -3
  45. package/lib/chevre/repo/message.js +1 -2
  46. package/lib/chevre/repo/mongoose/schemas/order.d.ts +5 -1
  47. package/lib/chevre/repo/mongoose/types.d.ts +2 -0
  48. package/lib/chevre/repo/mongoose/types.js +2 -0
  49. package/lib/chevre/repo/movieTicketType.d.ts +2 -1
  50. package/lib/chevre/repo/movieTicketType.js +0 -4
  51. package/lib/chevre/repo/note.d.ts +6 -4
  52. package/lib/chevre/repo/note.js +4 -1
  53. package/lib/chevre/repo/noteAboutOrder.d.ts +6 -4
  54. package/lib/chevre/repo/noteAboutOrder.js +1 -1
  55. package/lib/chevre/repo/offerCatalog.d.ts +5 -4
  56. package/lib/chevre/repo/offerCatalog.js +8 -6
  57. package/lib/chevre/repo/offerCatalogItem.d.ts +4 -3
  58. package/lib/chevre/repo/offerCatalogItem.js +9 -7
  59. package/lib/chevre/repo/offerItemCondition.d.ts +1 -1
  60. package/lib/chevre/repo/offerItemCondition.js +7 -8
  61. package/lib/chevre/repo/order.d.ts +27 -6
  62. package/lib/chevre/repo/paymentService.d.ts +4 -3
  63. package/lib/chevre/repo/paymentServiceProvider.d.ts +4 -2
  64. package/lib/chevre/repo/paymentServiceProvider.js +3 -3
  65. package/lib/chevre/repo/place/entranceGate.d.ts +5 -4
  66. package/lib/chevre/repo/place/movieTheater.d.ts +7 -6
  67. package/lib/chevre/repo/place/movieTheater.js +6 -7
  68. package/lib/chevre/repo/place/screeningRoom.d.ts +7 -6
  69. package/lib/chevre/repo/place/seat.d.ts +5 -4
  70. package/lib/chevre/repo/place/section.d.ts +4 -3
  71. package/lib/chevre/repo/place/section.js +1 -1
  72. package/lib/chevre/repo/potentialAction.d.ts +3 -2
  73. package/lib/chevre/repo/priceSpecification.d.ts +2 -2
  74. package/lib/chevre/repo/priceSpecification.js +1 -1
  75. package/lib/chevre/repo/product.d.ts +7 -6
  76. package/lib/chevre/repo/project.d.ts +4 -3
  77. package/lib/chevre/repo/reservation.d.ts +3 -3
  78. package/lib/chevre/repo/role.d.ts +3 -2
  79. package/lib/chevre/repo/seller.d.ts +4 -3
  80. package/lib/chevre/repo/sellerMakesOffer.d.ts +4 -3
  81. package/lib/chevre/repo/sellerReturnPolicy.d.ts +4 -2
  82. package/lib/chevre/repo/setting.d.ts +4 -3
  83. package/lib/chevre/repo/ticket.d.ts +4 -3
  84. package/lib/chevre/repo/transaction/placeOrder.d.ts +16 -2
  85. package/lib/chevre/repo/transactionNumberCounter.js +1 -1
  86. package/lib/chevre/repo/webSite.d.ts +5 -3
  87. package/lib/chevre/repo/webSite.js +1 -1
  88. package/package.json +2 -2
@@ -1,5 +1,7 @@
1
- import type { Connection, FilterQuery, mongo } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
+ import type { FilterQuery } from './mongoose/types';
2
3
  import { factory } from '../factory';
4
+ import { IModel, IDocType } from './mongoose/schemas/note';
3
5
  type INoteAboutOrder = factory.creativeWork.noteDigitalDocument.INoteAboutOrder;
4
6
  type IKeyOfProjection = keyof INoteAboutOrder;
5
7
  /**
@@ -8,7 +10,7 @@ type IKeyOfProjection = keyof INoteAboutOrder;
8
10
  export declare class NoteAboutOrderRepo {
9
11
  private readonly noteModel;
10
12
  constructor(connection: Connection);
11
- static CREATE_MONGO_CONDITIONS(params: factory.creativeWork.noteDigitalDocument.ISearchConditions): FilterQuery<import("@chevre/factory/lib/chevre/creativeWork/noteDigitalDocument").INoteAboutOrder>[];
13
+ static CREATE_MONGO_CONDITIONS(params: factory.creativeWork.noteDigitalDocument.ISearchConditions): FilterQuery<IDocType>[];
12
14
  /**
13
15
  * 検索
14
16
  */
@@ -20,13 +22,13 @@ export declare class NoteAboutOrderRepo {
20
22
  */
21
23
  upsertOrderNoteByIdentifier(params: Pick<INoteAboutOrder, 'about' | 'creator' | 'identifier' | 'project' | 'provider' | 'text' | 'version'>[], options: {
22
24
  overwrite: boolean;
23
- }): Promise<mongo.BulkWriteResult | undefined>;
25
+ }): Promise<Awaited<ReturnType<IModel['bulkWrite']>> | undefined>;
24
26
  updateById(params: {
25
27
  id: string;
26
28
  attributes: Pick<INoteAboutOrder, 'text' | 'editor'>;
27
29
  }): Promise<void>;
28
30
  unsetUnnecessaryFields(params: {
29
- filter: FilterQuery<factory.creativeWork.noteDigitalDocument.INoteAboutOrder>;
31
+ filter: FilterQuery<IDocType>;
30
32
  $unset: any;
31
33
  }): Promise<import("mongoose").UpdateWriteOpResult>;
32
34
  }
@@ -174,7 +174,7 @@ class NoteAboutOrderRepo {
174
174
  throw new factory_1.factory.errors.NotFound(this.noteModel.modelName);
175
175
  }
176
176
  }
177
- // public getCursor(conditions: FilterQuery<factory.creativeWork.noteDigitalDocument.INoteAboutOrder>, projection: any) {
177
+ // public getCursor(conditions: FilterQuery<IDocType>, projection: any) {
178
178
  // return this.noteModel.find(
179
179
  // {
180
180
  // ...conditions,
@@ -1,6 +1,7 @@
1
- import type { Connection, FilterQuery, mongo } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
+ import type { FilterQuery } from './mongoose/types';
2
3
  import { factory } from '../factory';
3
- import { IDocType } from './mongoose/schemas/offerCatalog';
4
+ import { IDocType, IModel } from './mongoose/schemas/offerCatalog';
4
5
  export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered'> & {
5
6
  numberOfItems?: number;
6
7
  itemListElementTypeOf: factory.offerType.Offer | 'OfferCatalog';
@@ -48,7 +49,7 @@ export declare class OfferCatalogRepo {
48
49
  */
49
50
  itemListElementType: factory.offerCatalog.IItemListElement['typeOf'];
50
51
  }): Promise<{
51
- bulkWriteResult?: mongo.BulkWriteResult;
52
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
52
53
  modifiedCatalogs?: {
53
54
  id: string;
54
55
  }[];
@@ -184,7 +185,7 @@ export declare class OfferCatalogRepo {
184
185
  __v: number;
185
186
  }) | null>;
186
187
  unsetUnnecessaryFields(params: {
187
- filter: FilterQuery<factory.offerCatalog.IOfferCatalog>;
188
+ filter: FilterQuery<IDocType>;
188
189
  $unset: any;
189
190
  }): Promise<import("mongoose").UpdateWriteOpResult>;
190
191
  aggregateItemList(params: {
@@ -126,27 +126,26 @@ class OfferCatalogRepo {
126
126
  }
127
127
  async save(params) {
128
128
  let savedId;
129
- let doc;
130
129
  if (typeof params.id !== 'string' || params.id === '') {
131
130
  const { default: uniqid } = await import('uniqid');
132
131
  const newId = uniqid();
133
132
  const { id, $unset, ...creatingDoc } = params; // eslint-disable-line @typescript-eslint/no-unused-vars
134
- doc = await this.offerCatalogModel.create({ ...creatingDoc, _id: newId });
133
+ await this.offerCatalogModel.create({ ...creatingDoc, _id: newId });
135
134
  savedId = newId;
136
135
  }
137
136
  else {
138
137
  // 上書き禁止属性を除外
139
138
  const { id, identifier, itemOffered, project, typeOf, $unset, ...updateFields } = params; // eslint-disable-line @typescript-eslint/no-unused-vars
140
- doc = await this.offerCatalogModel.findOneAndUpdate({ _id: { $eq: params.id } }, {
139
+ const doc = await this.offerCatalogModel.findOneAndUpdate({ _id: { $eq: params.id } }, {
141
140
  $set: updateFields,
142
141
  ...(params.$unset !== undefined) ? { $unset: params.$unset } : undefined
143
142
  }, { upsert: false, new: true, projection: { _id: 1 } })
144
143
  .exec();
144
+ if (doc === null) {
145
+ throw new factory_1.factory.errors.NotFound(this.offerCatalogModel.modelName);
146
+ }
145
147
  savedId = id;
146
148
  }
147
- if (doc === null) {
148
- throw new factory_1.factory.errors.NotFound(this.offerCatalogModel.modelName);
149
- }
150
149
  return { id: savedId };
151
150
  }
152
151
  /**
@@ -169,6 +168,9 @@ class OfferCatalogRepo {
169
168
  })
170
169
  .lean()
171
170
  .exec();
171
+ if (doc === null) {
172
+ throw new factory_1.factory.errors.NotFound('OfferCatalog');
173
+ }
172
174
  return { id: doc.id };
173
175
  }
174
176
  /**
@@ -1,6 +1,7 @@
1
- import { Connection, FilterQuery, mongo } from 'mongoose';
1
+ import { Connection } from 'mongoose';
2
+ import type { FilterQuery } from './mongoose/types';
2
3
  import { factory } from '../factory';
3
- import { IDocType } from './mongoose/schemas/offerCatalogItem';
4
+ import { IDocType, IModel } from './mongoose/schemas/offerCatalogItem';
4
5
  type IOfferCatalogItem = Pick<factory.offerCatalog.IOfferCatalog, 'description' | 'identifier' | 'itemListElement' | 'itemOffered' | 'name' | 'project' | 'relatedOffer' | 'typeOf' | 'id'>;
5
6
  export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'relatedOffer'> & {
6
7
  numberOfItems?: number;
@@ -43,7 +44,7 @@ export declare class OfferCatalogItemRepo {
43
44
  */
44
45
  productType: factory.product.ProductType;
45
46
  }): Promise<{
46
- bulkWriteResult?: mongo.BulkWriteResult;
47
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
47
48
  modifiedCatalogs?: {
48
49
  id: string;
49
50
  }[];
@@ -101,23 +101,25 @@ class OfferCatalogItemRepo {
101
101
  return andConditions;
102
102
  }
103
103
  async save(params) {
104
- let doc;
104
+ let savedId;
105
105
  if (typeof params.id !== 'string' || params.id.length === 0) {
106
106
  const { id, $unset, ...creatingDoc } = params; // eslint-disable-line @typescript-eslint/no-unused-vars
107
- doc = await this.offerCatalogItemModel.create(creatingDoc);
107
+ const createdDoc = await this.offerCatalogItemModel.create(creatingDoc);
108
+ savedId = createdDoc.id;
108
109
  }
109
110
  else {
110
111
  const { id, identifier, project, typeOf, $unset, ...updateFields } = params; // eslint-disable-line @typescript-eslint/no-unused-vars
111
- doc = await this.offerCatalogItemModel.findOneAndUpdate({ _id: { $eq: params.id } }, {
112
+ const doc = await this.offerCatalogItemModel.findOneAndUpdate({ _id: { $eq: params.id } }, {
112
113
  $set: updateFields,
113
114
  ...(params.$unset !== undefined) ? { $unset: params.$unset } : undefined
114
115
  }, { upsert: false, new: true, projection: { _id: 1 } })
115
116
  .exec();
117
+ if (doc === null) {
118
+ throw new factory_1.factory.errors.NotFound(this.offerCatalogItemModel.modelName);
119
+ }
120
+ savedId = params.id;
116
121
  }
117
- if (doc === null) {
118
- throw new factory_1.factory.errors.NotFound(this.offerCatalogItemModel.modelName);
119
- }
120
- return { id: doc.id };
122
+ return { id: savedId };
121
123
  }
122
124
  /**
123
125
  * プロジェクトとコードから冪等保管
@@ -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) {
@@ -1,4 +1,5 @@
1
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
+ import type { FilterQuery } from './mongoose/types';
2
3
  import { factory } from '../factory';
3
4
  import { IDocType } from './mongoose/schemas/order';
4
5
  type IOrderWithoutAcceptedOffers = factory.order.IOrder;
@@ -33,7 +34,7 @@ type ISearchConditions = Pick<factory.order.ISearchConditions, 'acceptedOffers'
33
34
  export declare class OrderRepo {
34
35
  private readonly orderModel;
35
36
  constructor(connection: Connection);
36
- static CREATE_MONGO_CONDITIONS(params: ISearchConditions): FilterQuery<factory.order.IOrder>[];
37
+ static CREATE_MONGO_CONDITIONS(params: ISearchConditions): FilterQuery<IDocType>[];
37
38
  /**
38
39
  * 注文ステータスを変更する
39
40
  */
@@ -132,7 +133,7 @@ export declare class OrderRepo {
132
133
  }): Promise<(IOrderWithoutAcceptedOffers & {
133
134
  id: string;
134
135
  })[]>;
135
- 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"> & {
136
137
  acceptedOffers?: import("./mongoose/schemas/order").IAcceptedOfferInDoc[];
137
138
  identifier?: string;
138
139
  paymentMethodId?: string;
@@ -140,17 +141,37 @@ export declare class OrderRepo {
140
141
  _id: import("mongoose").Types.ObjectId;
141
142
  } & {
142
143
  __v: number;
143
- }, 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"> & {
144
145
  acceptedOffers?: import("./mongoose/schemas/order").IAcceptedOfferInDoc[];
145
146
  identifier?: string;
146
147
  paymentMethodId?: string;
148
+ }, "typeOf"> & {
149
+ typeOf: factory.transactionType.PlaceOrder;
147
150
  } & {
148
151
  _id: import("mongoose").Types.ObjectId;
149
152
  } & {
150
153
  __v: number;
151
- }) | 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>;
152
173
  unsetUnnecessaryFields(params: {
153
- filter: FilterQuery<factory.order.IOrder>;
174
+ filter: FilterQuery<IDocType>;
154
175
  $unset: any;
155
176
  arrayFilters?: any[];
156
177
  }): Promise<import("mongoose").UpdateWriteOpResult>;
@@ -1,6 +1,7 @@
1
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
+ import type { FilterQuery } from './mongoose/types';
2
3
  import { factory } from '../factory';
3
- import { IModel } from './mongoose/schemas/paymentService';
4
+ import { IModel, IDocType } from './mongoose/schemas/paymentService';
4
5
  type IUnsetKey = keyof Pick<factory.service.paymentService.IService, 'additionalProperty' | 'availableChannel' | 'serviceOutput' | 'serviceType'>;
5
6
  type IKeyOfProjection4paymentService = keyof factory.service.paymentService.IService;
6
7
  /**
@@ -14,7 +15,7 @@ export declare class PaymentServiceRepo {
14
15
  private readonly paymentServiceModel;
15
16
  private readonly paymentServiceChannelModel;
16
17
  constructor(connection: Connection);
17
- static CREATE_MONGO_CONDITIONS(params: ISearchConditions4paymentService): FilterQuery<import("@chevre/factory/lib/chevre/service/paymentService").IService>[];
18
+ static CREATE_MONGO_CONDITIONS(params: ISearchConditions4paymentService): FilterQuery<IDocType>[];
18
19
  /**
19
20
  * 決済サービスを保管する
20
21
  */
@@ -1,4 +1,6 @@
1
- import { Connection, FilterQuery } from 'mongoose';
1
+ import { Connection } from 'mongoose';
2
+ import type { FilterQuery } from './mongoose/types';
3
+ import { IDocType } from './mongoose/schemas/paymentService';
2
4
  import { factory } from '../factory';
3
5
  type IAvailablePaymentServiceType = factory.service.paymentService.PaymentServiceType.CreditCard | factory.service.paymentService.PaymentServiceType.MovieTicket;
4
6
  export type IPublicPaymentServiceByProvider = Pick<factory.service.paymentService.IService, 'name' | 'description' | 'typeOf' | 'id' | 'productID' | 'serviceType' | 'serviceOutput' | 'additionalProperty'> & {
@@ -77,7 +79,7 @@ export declare class PaymentServiceProviderRepo {
77
79
  };
78
80
  }): Promise<import("mongoose").UpdateWriteOpResult>;
79
81
  unsetUnnecessaryFields(params: {
80
- filter: FilterQuery<factory.service.paymentService.IService>;
82
+ filter: FilterQuery<IDocType>;
81
83
  $unset: any;
82
84
  }): Promise<import("mongoose").UpdateWriteOpResult>;
83
85
  }
@@ -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,6 +1,7 @@
1
- import type { Connection, FilterQuery, mongo } from 'mongoose';
1
+ import type { Connection } from 'mongoose';
2
+ import type { FilterQuery } from '../mongoose/types';
2
3
  import { factory } from '../../factory';
3
- import { IDocType } from '../mongoose/schemas/civicStructure';
4
+ import { IDocType, IModel } from '../mongoose/schemas/civicStructure';
4
5
  export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
5
6
  export type IMovieTheaterIncludingScreeningRooms = Pick<factory.place.movieTheater.IPlace, 'additionalProperty' | 'branchCode' | 'kanaName' | 'name' | 'offers' | 'parentOrganization' | 'project' | 'telephone' | 'typeOf'> & {
6
7
  containsPlace: factory.place.screeningRoom.IPlace[];
@@ -28,7 +29,7 @@ interface IUpsertOptions {
28
29
  export declare class MovieTheaterRepo {
29
30
  private readonly civicStructureModel;
30
31
  constructor(connection: Connection);
31
- static CREATE_MOVIE_THEATER_MONGO_CONDITIONS(params: factory.place.movieTheater.ISearchConditions): FilterQuery<import("@chevre/factory/lib/chevre/place/movieTheater").IPlace>[];
32
+ static CREATE_MOVIE_THEATER_MONGO_CONDITIONS(params: factory.place.movieTheater.ISearchConditions): FilterQuery<IDocType>[];
32
33
  /**
33
34
  * 施設を保管する
34
35
  */
@@ -48,7 +49,7 @@ export declare class MovieTheaterRepo {
48
49
  [key in keyof IUpsertingMovieTheater]?: 1;
49
50
  };
50
51
  }[], options: IUpsertOptions): Promise<{
51
- bulkWriteResult?: mongo.BulkWriteResult;
52
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
52
53
  /**
53
54
  * 追加あるいは編集された施設
54
55
  */
@@ -85,7 +86,7 @@ export declare class MovieTheaterRepo {
85
86
  */
86
87
  id: string;
87
88
  };
88
- }): Promise<mongo.DeleteResult>;
89
+ }): Promise<import("mongodb").DeleteResult>;
89
90
  /**
90
91
  * プロジェクトに属する施設を全削除
91
92
  */
@@ -94,7 +95,7 @@ export declare class MovieTheaterRepo {
94
95
  id: string;
95
96
  };
96
97
  }): Promise<void>;
97
- getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("../mongoose/virtuals").IVirtuals, {}> & Omit<import("@chevre/factory/lib/chevre/place/movieTheater").IPlace, "id"> & {
98
+ getCursor(conditions: FilterQuery<IDocType>, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("../mongoose/virtuals").IVirtuals, {}> & Omit<import("@chevre/factory/lib/chevre/place/movieTheater").IPlace, "id"> & {
98
99
  hasPOS?: factory.place.movieTheater.IPOS[];
99
100
  hasEntranceGate?: factory.place.movieTheater.IEntranceGate[];
100
101
  } & {
@@ -80,14 +80,13 @@ class MovieTheaterRepo {
80
80
  */
81
81
  async saveMovieTheater(params) {
82
82
  let savedId;
83
- let doc;
84
83
  if (params.id === '') {
85
84
  const {
86
85
  // 入場ゲートを保管しない(2026-01-11~)
87
86
  id, hasEntranceGate, // eslint-disable-line @typescript-eslint/no-unused-vars
88
87
  ...creatingParams } = params; // omit id(2024-09-12~)
89
- doc = await this.civicStructureModel.create(creatingParams);
90
- savedId = doc.id;
88
+ const createdDoc = await this.civicStructureModel.create(creatingParams);
89
+ savedId = createdDoc.id;
91
90
  }
92
91
  else {
93
92
  // 上書き禁止属性を除外(2022-08-24~)
@@ -95,13 +94,13 @@ class MovieTheaterRepo {
95
94
  // 入場ゲートを保管しない(2026-01-11~)
96
95
  id, branchCode, project, typeOf, hasEntranceGate, // eslint-disable-line @typescript-eslint/no-unused-vars
97
96
  ...updateFields } = params;
98
- doc = await this.civicStructureModel.findOneAndUpdate({ _id: { $eq: params.id } }, updateFields, { upsert: false, new: true, projection: { _id: 1 } })
97
+ const doc = await this.civicStructureModel.findOneAndUpdate({ _id: { $eq: params.id } }, updateFields, { upsert: false, new: true, projection: { _id: 1 } })
99
98
  .exec();
99
+ if (doc === null) {
100
+ throw new factory_1.factory.errors.NotFound(this.civicStructureModel.modelName);
101
+ }
100
102
  savedId = params.id;
101
103
  }
102
- if (doc === null) {
103
- throw new factory_1.factory.errors.NotFound(this.civicStructureModel.modelName);
104
- }
105
104
  return { id: savedId };
106
105
  }
107
106
  async saveMovieTheaterByBranchCode4coa(params) {
@@ -1,6 +1,7 @@
1
- import type { Connection, FilterQuery, PipelineStage, mongo } from 'mongoose';
1
+ import type { Connection, PipelineStage } from 'mongoose';
2
+ import type { FilterQuery } from '../mongoose/types';
2
3
  import { factory } from '../../factory';
3
- import { IDocType } from '../mongoose/schemas/place';
4
+ import { IDocType, IModel } from '../mongoose/schemas/place';
4
5
  export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
5
6
  type IMatchStage = PipelineStage.Match;
6
7
  type IUpsertingRoom = Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'openSeatingAllowed'>;
@@ -65,7 +66,7 @@ export declare class ScreeningRoomRepo {
65
66
  [key in keyof IUpsertingRoom]?: 1;
66
67
  };
67
68
  }[], options: IUpsertOptions): Promise<{
68
- bulkWriteResult?: mongo.BulkWriteResult;
69
+ bulkWriteResult?: Awaited<ReturnType<IModel['bulkWrite']>>;
69
70
  }>;
70
71
  deleteRoomByBranchCode(screeningRoom: {
71
72
  /**
@@ -83,7 +84,7 @@ export declare class ScreeningRoomRepo {
83
84
  */
84
85
  id: string;
85
86
  };
86
- }): Promise<mongo.DeleteResult>;
87
+ }): Promise<import("mongodb").DeleteResult>;
87
88
  /**
88
89
  * ルーム検索
89
90
  * sectionCount,seatCountのprojectが可能
@@ -136,7 +137,7 @@ export declare class ScreeningRoomRepo {
136
137
  */
137
138
  id: string;
138
139
  };
139
- }): Promise<mongo.DeleteResult>;
140
+ }): Promise<import("mongodb").DeleteResult>;
140
141
  /**
141
142
  * プロジェクトに属するルームを全削除
142
143
  */
@@ -145,7 +146,7 @@ export declare class ScreeningRoomRepo {
145
146
  id: string;
146
147
  };
147
148
  }): Promise<void>;
148
- getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("../mongoose/virtuals").IVirtuals, {}> & Omit<import("@chevre/factory/lib/chevre/place/screeningRoom").IPlace, "containsPlace"> & {
149
+ getCursor(conditions: FilterQuery<IDocType>, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("../mongoose/virtuals").IVirtuals, {}> & Omit<import("@chevre/factory/lib/chevre/place/screeningRoom").IPlace, "containsPlace"> & {
149
150
  description?: any;
150
151
  openingHoursSpecification?: any;
151
152
  smokingAllowed?: boolean;
@@ -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: {
@@ -338,7 +338,7 @@ class SectionRepo {
338
338
  // if (!Array.isArray(containsPlace)) {
339
339
  // throw new factory.errors.ArgumentNull('containsPlace');
340
340
  // }
341
- // const doc = await this.placeModel.findOneAndUpdate<HydratedDocument<IUpdateSectionResult>>(
341
+ // const doc = await this.placeModel.findOneAndUpdate(
342
342
  // {
343
343
  // typeOf: { $eq: factory.placeType.ScreeningRoom },
344
344
  // 'project.id': { $eq: project.id },
@@ -1,4 +1,5 @@
1
- import { Connection, FilterQuery, QueryOptions } from 'mongoose';
1
+ import { Connection, QueryOptions } from 'mongoose';
2
+ import type { FilterQuery } from './mongoose/types';
2
3
  import { factory } from '../factory';
3
4
  import { IDocType } from './mongoose/schemas/potentialAction';
4
5
  export type ISavingPotentialAction = Pick<factory.potentialAction.IPotentialAction, 'target' | 'project' | 'typeOf' | 'identifier'> & {
@@ -14,7 +15,7 @@ type IKeyOfProjection = keyof factory.potentialAction.IPotentialAction;
14
15
  export declare class PotentialActionRepo {
15
16
  private readonly potentialActionModel;
16
17
  constructor(connection: Connection);
17
- static CREATE_FILTER_QUERY(params: factory.potentialAction.ISearchConditions): FilterQuery<factory.potentialAction.IPotentialInformAction>[];
18
+ static CREATE_FILTER_QUERY(params: factory.potentialAction.ISearchConditions): FilterQuery<IDocType>[];
18
19
  save(params: {
19
20
  id?: string;
20
21
  attributes: ISavingPotentialAction & IUnset;
@@ -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