@chevre/domain 21.8.0-alpha.61 → 21.8.0-alpha.63

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.
@@ -29,9 +29,9 @@ async function main() {
29
29
  onlyValid: true,
30
30
  validateOfferRateLimit: true,
31
31
  addSortIndex: true,
32
+ useIncludeInDataCatalog: true,
32
33
  limit: 100,
33
- page: 1,
34
- useOffersAsPrimaryForcible: false
34
+ page: 1
35
35
  // ...(typeof availableAtId === 'string') ? { store: { id: availableAtId } } : undefined
36
36
  })({
37
37
  event: eventRepo,
@@ -6,7 +6,7 @@ import { chevre } from '../../../lib/index';
6
6
  const PROJECT_ID = process.env.PROJECT_ID;
7
7
 
8
8
  async function main() {
9
- await mongoose.connect(<string>process.env.MONGOLAB_URI);
9
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
10
10
 
11
11
  const eventRepo = new chevre.repository.Event(mongoose.connection);
12
12
 
@@ -16,7 +16,7 @@ async function main() {
16
16
  // page: 1,
17
17
  // sort: { startDate: 1 },
18
18
  // typeOf: chevre.factory.eventType.ScreeningEvent,
19
- // project: { id: { $eq: PROJECT_ID } },
19
+ project: { id: { $eq: PROJECT_ID } },
20
20
  id: { $eq: 'al6aff83y' },
21
21
  typeOfIn: [chevre.factory.eventType.Event, chevre.factory.eventType.ScreeningEvent]
22
22
  },
@@ -5,19 +5,19 @@ import * as mongoose from 'mongoose';
5
5
  import { chevre } from '../../../lib/index';
6
6
 
7
7
  async function main() {
8
- await mongoose.connect(<string>process.env.MONGOLAB_URI);
8
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
9
9
 
10
10
  const offerRepo = new chevre.repository.Offer(mongoose.connection);
11
11
 
12
- const { offers } = await offerRepo.findOffersByOfferCatalogId({
12
+ const { offers } = await offerRepo.searchByOfferCatalogIdWithSortIndex({
13
13
  limit: 100,
14
14
  page: 1,
15
15
  // ids: ['xx', 'xxx', '1001', '901'],
16
16
  offerCatalog: {
17
- id: '0001'
17
+ id: '0004'
18
18
  },
19
19
  excludeAppliesToMovieTicket: false,
20
- useOffersAsPrimaryForcible: false
20
+ useIncludeInDataCatalog: true
21
21
  });
22
22
  // console.log(offers);
23
23
  console.log(offers.map((offer) => {
@@ -18,21 +18,32 @@ export type IUnitPriceOfferFromAggregateOffer = factory.unitPriceOffer.IUnitPric
18
18
  export declare class MongoRepository {
19
19
  private readonly aggregateOfferModel;
20
20
  private readonly offerCatalogModel;
21
- private readonly taskModel;
22
21
  constructor(connection: Connection);
23
22
  static CREATE_AGGREGATE_OFFERS_MATCH_CONDITIONS(params: factory.unitPriceOffer.ISearchConditions): IMatchStage[];
24
23
  static CREATE_AGGREGATE_OFFERS_PROJECTION(params: IProjection): {
25
24
  [field: string]: AnyExpression;
26
25
  };
27
26
  /**
28
- * カタログIDで単価オファーを検索する
27
+ * カタログIDで単価オファーを全て検索する
29
28
  * 必ずカタログデータから単価オファーIDを参照する
30
29
  */
31
- searchByOfferCatalogId(params: {
30
+ searchAllByOfferCatalogId(params: {
31
+ offerCatalog: {
32
+ id: string;
33
+ };
34
+ projection?: IProjection;
35
+ }): Promise<{
36
+ offers: IUnitPriceOfferFromAggregateOffer[];
37
+ }>;
38
+ /**
39
+ * 単価オファーIDとカタログIDで単価オファーを検索する
40
+ * 必ずカタログデータから単価オファーIDを参照する
41
+ */
42
+ searchByIdsAndOfferCatalogId(params: {
32
43
  /**
33
- * 指定したIDの単価オファーだけ取得する場合
44
+ * 指定したIDの単価オファーだけ取得
34
45
  */
35
- ids?: string[];
46
+ ids: string[];
36
47
  offerCatalog: {
37
48
  id: string;
38
49
  };
@@ -53,10 +64,6 @@ export declare class MongoRepository {
53
64
  * カタログ内ソートインデックスはsortedOfferIdsで判断する
54
65
  */
55
66
  searchByOfferCatalogIdWithSortIndex(params: {
56
- /**
57
- * 指定したIDの単価オファーだけ取得する場合
58
- */
59
- ids?: string[];
60
67
  offerCatalog: {
61
68
  id: string;
62
69
  };
@@ -66,6 +73,7 @@ export declare class MongoRepository {
66
73
  unacceptedPaymentMethod?: string[];
67
74
  excludeAppliesToMovieTicket: boolean;
68
75
  onlyValid?: boolean;
76
+ useIncludeInDataCatalog: boolean;
69
77
  limit?: number;
70
78
  page?: number;
71
79
  projection?: IProjection;
@@ -83,11 +91,7 @@ export declare class MongoRepository {
83
91
  id: string;
84
92
  }): Promise<factory.aggregateOffer.IAggregateOffer>;
85
93
  count(params: Omit<factory.unitPriceOffer.ISearchConditions, 'limit' | 'page' | 'sort'>): Promise<number>;
86
- search(params: factory.unitPriceOffer.ISearchConditions, projection?: IProjection,
87
- /**
88
- * 強制的にoffersコレクションを使用する
89
- */
90
- useOffersAsPrimary?: boolean): Promise<factory.unitPriceOffer.IUnitPriceOffer[]>;
94
+ search(params: factory.unitPriceOffer.ISearchConditions, projection?: IProjection): Promise<factory.unitPriceOffer.IUnitPriceOffer[]>;
91
95
  save(params: factory.unitPriceOffer.IUnitPriceOffer & {
92
96
  $unset?: any;
93
97
  }): Promise<factory.unitPriceOffer.IUnitPriceOffer>;
@@ -132,27 +136,6 @@ export declare class MongoRepository {
132
136
  isDeleted: boolean;
133
137
  typeOf: factory.offerType.AggregateOffer | factory.offerType.Offer;
134
138
  }): Promise<BulkWriteOpResultObject | void>;
135
- /**
136
- * オファー同期専用のタスク保管
137
- */
138
- saveSyncTask(params: {
139
- id: {
140
- $in: string[];
141
- };
142
- identifier: {
143
- $in: string[];
144
- };
145
- isDeleted: boolean;
146
- project: {
147
- id: string;
148
- };
149
- typeOf: factory.offerType.AggregateOffer | factory.offerType.Offer;
150
- options: {
151
- emitImmediately: boolean;
152
- };
153
- }): Promise<{
154
- id: string;
155
- }[]>;
156
139
  private searchFromAggregateOffer;
157
140
  }
158
141
  export {};