@chevre/domain 28.1.0-alpha.1 → 28.1.0-alpha.2
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.
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +20 -20
- package/lib/chevre/repo/offerCatalog.d.ts +4 -4
- package/lib/chevre/repo/offerCatalog.js +19 -19
- package/lib/chevre/repo/offerCatalogItem.d.ts +1 -1
- package/lib/chevre/repo/offerCatalogItem.js +9 -9
- package/lib/chevre/service/offer/event/searchOfferCatalogItems.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import { IVirtuals } from '../virtuals';
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
|
-
export type IDocType =
|
|
4
|
+
export type IDocType = Pick<factory.offerCatalog.IOfferCatalog, 'description' | 'identifier' | 'itemListElement' | 'itemOffered' | 'name' | 'project' | 'typeOf'> & {
|
|
5
5
|
_id: string;
|
|
6
6
|
dateSynced?: Date;
|
|
7
7
|
};
|
|
@@ -13,11 +13,10 @@ const schemaDefinition = {
|
|
|
13
13
|
identifier: { type: String, required: true },
|
|
14
14
|
name: mongoose_1.SchemaTypes.Mixed,
|
|
15
15
|
description: mongoose_1.SchemaTypes.Mixed,
|
|
16
|
-
// alternateName: SchemaTypes.Mixed,
|
|
17
16
|
typeOf: { type: String, required: true },
|
|
18
17
|
itemListElement: [mongoose_1.SchemaTypes.Mixed],
|
|
19
18
|
itemOffered: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
20
|
-
additionalProperty: [
|
|
19
|
+
// additionalProperty: [SchemaTypes.Mixed], // TODO discontinue(2026-10-31~)
|
|
21
20
|
dateSynced: Date // 追加(2023-09-13~)
|
|
22
21
|
};
|
|
23
22
|
const schemaOptions = {
|
|
@@ -78,24 +77,6 @@ const indexes = [
|
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
],
|
|
81
|
-
[
|
|
82
|
-
{ 'itemOffered.serviceType.codeValue': 1, identifier: 1 },
|
|
83
|
-
{
|
|
84
|
-
name: 'searchByItemOfferedServiceTypeCodeValue',
|
|
85
|
-
partialFilterExpression: {
|
|
86
|
-
'itemOffered.serviceType.codeValue': { $exists: true }
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
[
|
|
91
|
-
{ additionalProperty: 1, identifier: 1 },
|
|
92
|
-
{
|
|
93
|
-
name: 'searchByAdditionalProperty',
|
|
94
|
-
partialFilterExpression: {
|
|
95
|
-
additionalProperty: { $exists: true }
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
],
|
|
99
80
|
[
|
|
100
81
|
// add unique index(2024-11-12~)
|
|
101
82
|
{ 'project.id': 1, identifier: 1 },
|
|
@@ -104,6 +85,25 @@ const indexes = [
|
|
|
104
85
|
name: 'uniqueIdentifier'
|
|
105
86
|
}
|
|
106
87
|
]
|
|
88
|
+
// 以下廃止(2026-10-31~)
|
|
89
|
+
// [
|
|
90
|
+
// { 'itemOffered.serviceType.codeValue': 1, identifier: 1 },
|
|
91
|
+
// {
|
|
92
|
+
// name: 'searchByItemOfferedServiceTypeCodeValue',
|
|
93
|
+
// partialFilterExpression: {
|
|
94
|
+
// 'itemOffered.serviceType.codeValue': { $exists: true }
|
|
95
|
+
// }
|
|
96
|
+
// }
|
|
97
|
+
// ],
|
|
98
|
+
// [
|
|
99
|
+
// { additionalProperty: 1, identifier: 1 },
|
|
100
|
+
// {
|
|
101
|
+
// name: 'searchByAdditionalProperty',
|
|
102
|
+
// partialFilterExpression: {
|
|
103
|
+
// additionalProperty: { $exists: true }
|
|
104
|
+
// }
|
|
105
|
+
// }
|
|
106
|
+
// ],
|
|
107
107
|
];
|
|
108
108
|
exports.indexes = indexes;
|
|
109
109
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Connection, FilterQuery, mongo } from 'mongoose';
|
|
2
2
|
import { factory } from '../factory';
|
|
3
3
|
import { IDocType } from './mongoose/schemas/offerCatalog';
|
|
4
|
-
export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered'
|
|
4
|
+
export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered'> & {
|
|
5
5
|
numberOfItems?: number;
|
|
6
6
|
itemListElementTypeOf: factory.offerType.Offer | 'OfferCatalog';
|
|
7
7
|
};
|
|
8
|
-
type IKeyOfProjection = 'name' | 'description' | 'project' | 'typeOf' | 'id' | 'identifier' | 'itemOffered' | '
|
|
8
|
+
type IKeyOfProjection = 'name' | 'description' | 'project' | 'typeOf' | 'id' | 'identifier' | 'itemOffered' | 'numberOfItems' | 'itemListElementTypeOf' | 'dateSynced';
|
|
9
9
|
/**
|
|
10
10
|
* カタログリポジトリ
|
|
11
11
|
*/
|
|
@@ -168,14 +168,14 @@ export declare class OfferCatalogRepo {
|
|
|
168
168
|
id: string;
|
|
169
169
|
};
|
|
170
170
|
}): Promise<void>;
|
|
171
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> &
|
|
171
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Pick<factory.offerCatalog.IOfferCatalog, "identifier" | "name" | "typeOf" | "description" | "itemOffered" | "project" | "itemListElement"> & {
|
|
172
172
|
_id: string;
|
|
173
173
|
dateSynced?: Date;
|
|
174
174
|
} & Required<{
|
|
175
175
|
_id: string;
|
|
176
176
|
}> & {
|
|
177
177
|
__v: number;
|
|
178
|
-
}, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> &
|
|
178
|
+
}, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Pick<factory.offerCatalog.IOfferCatalog, "identifier" | "name" | "typeOf" | "description" | "itemOffered" | "project" | "itemListElement"> & {
|
|
179
179
|
_id: string;
|
|
180
180
|
dateSynced?: Date;
|
|
181
181
|
} & Required<{
|
|
@@ -10,7 +10,7 @@ const AVAILABLE_PROJECT_FIELDS = [
|
|
|
10
10
|
'typeOf',
|
|
11
11
|
'identifier',
|
|
12
12
|
'itemOffered',
|
|
13
|
-
'additionalProperty',
|
|
13
|
+
// 'additionalProperty',
|
|
14
14
|
'numberOfItems',
|
|
15
15
|
'itemListElementTypeOf',
|
|
16
16
|
'dateSynced'
|
|
@@ -104,24 +104,24 @@ class OfferCatalogRepo {
|
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
const itemOfferedServiceTypeCodeValueEq = params.itemOffered?.serviceType?.codeValue?.$eq;
|
|
108
|
-
if (typeof itemOfferedServiceTypeCodeValueEq === 'string') {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
const additionalPropertyElemMatch = params.additionalProperty?.$elemMatch;
|
|
117
|
-
if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
107
|
+
// const itemOfferedServiceTypeCodeValueEq = params.itemOffered?.serviceType?.codeValue?.$eq;
|
|
108
|
+
// if (typeof itemOfferedServiceTypeCodeValueEq === 'string') {
|
|
109
|
+
// andConditions.push({
|
|
110
|
+
// 'itemOffered.serviceType.codeValue': {
|
|
111
|
+
// $exists: true,
|
|
112
|
+
// $eq: itemOfferedServiceTypeCodeValueEq
|
|
113
|
+
// }
|
|
114
|
+
// });
|
|
115
|
+
// }
|
|
116
|
+
// const additionalPropertyElemMatch = params.additionalProperty?.$elemMatch;
|
|
117
|
+
// if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
118
|
+
// andConditions.push({
|
|
119
|
+
// additionalProperty: {
|
|
120
|
+
// $exists: true,
|
|
121
|
+
// $elemMatch: additionalPropertyElemMatch
|
|
122
|
+
// }
|
|
123
|
+
// });
|
|
124
|
+
// }
|
|
125
125
|
return andConditions;
|
|
126
126
|
}
|
|
127
127
|
async save(params) {
|
|
@@ -6,7 +6,7 @@ export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, '
|
|
|
6
6
|
numberOfItems?: number;
|
|
7
7
|
itemListElementTypeOf: factory.offerType.Offer;
|
|
8
8
|
};
|
|
9
|
-
type IKeyOfProjection = 'name' | 'description' | 'project' | 'typeOf' | 'id' | 'identifier' | 'itemOffered' | '
|
|
9
|
+
type IKeyOfProjection = 'name' | 'description' | 'project' | 'typeOf' | 'id' | 'identifier' | 'itemOffered' | 'numberOfItems' | 'itemListElementTypeOf' | 'dateSynced' | 'relatedOffer';
|
|
10
10
|
/**
|
|
11
11
|
* サブカタログリポジトリ
|
|
12
12
|
*/
|
|
@@ -11,7 +11,7 @@ const AVAILABLE_PROJECT_FIELDS = [
|
|
|
11
11
|
'typeOf',
|
|
12
12
|
'identifier',
|
|
13
13
|
'itemOffered',
|
|
14
|
-
'additionalProperty',
|
|
14
|
+
// 'additionalProperty',
|
|
15
15
|
'numberOfItems',
|
|
16
16
|
'itemListElementTypeOf',
|
|
17
17
|
'dateSynced',
|
|
@@ -81,14 +81,14 @@ class OfferCatalogItemRepo {
|
|
|
81
81
|
if (typeof itemOfferedTypeOfEq === 'string') {
|
|
82
82
|
andConditions.push({ 'itemOffered.typeOf': { $exists: true, $eq: itemOfferedTypeOfEq } });
|
|
83
83
|
}
|
|
84
|
-
const itemOfferedServiceTypeCodeValueEq = params.itemOffered?.serviceType?.codeValue?.$eq;
|
|
85
|
-
if (typeof itemOfferedServiceTypeCodeValueEq === 'string') {
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
const additionalPropertyElemMatch = params.additionalProperty?.$elemMatch;
|
|
89
|
-
if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
90
|
-
|
|
91
|
-
}
|
|
84
|
+
// const itemOfferedServiceTypeCodeValueEq = params.itemOffered?.serviceType?.codeValue?.$eq;
|
|
85
|
+
// if (typeof itemOfferedServiceTypeCodeValueEq === 'string') {
|
|
86
|
+
// andConditions.push({ 'itemOffered.serviceType.codeValue': { $exists: true, $eq: itemOfferedServiceTypeCodeValueEq } });
|
|
87
|
+
// }
|
|
88
|
+
// const additionalPropertyElemMatch = params.additionalProperty?.$elemMatch;
|
|
89
|
+
// if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
90
|
+
// andConditions.push({ additionalProperty: { $exists: true, $elemMatch: additionalPropertyElemMatch } });
|
|
91
|
+
// }
|
|
92
92
|
const appliesToMovieTicketServiceOutputTypeOfIn = params.relatedOffer?.priceSpecification?.appliesToMovieTicket?.serviceOutput?.typeOf?.$in;
|
|
93
93
|
if (Array.isArray(appliesToMovieTicketServiceOutputTypeOfIn)) {
|
|
94
94
|
andConditions.push({
|
|
@@ -3,7 +3,7 @@ import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
|
3
3
|
import type { OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
|
|
4
4
|
import type { ProductRepo } from '../../../repo/product';
|
|
5
5
|
import { factory } from '../../../factory';
|
|
6
|
-
type ISearchOfferCatalogItemResult = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | '
|
|
6
|
+
type ISearchOfferCatalogItemResult = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'relatedOffer'> & {
|
|
7
7
|
elementIndex: number;
|
|
8
8
|
};
|
|
9
9
|
/**
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.1090.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.1090.0",
|
|
14
|
-
"@chevre/factory": "11.
|
|
14
|
+
"@chevre/factory": "11.2.0-alpha.0",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
16
|
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
@@ -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.1.0-alpha.
|
|
92
|
+
"version": "28.1.0-alpha.2"
|
|
93
93
|
}
|