@chevre/domain 22.14.0-alpha.9 → 23.0.0-alpha.1
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/example/src/chevre/{createEventBySchedule.ts → addEventBySchedule.ts} +2 -2
- package/example/src/chevre/aggregateEventPublicFields.ts +1 -1
- package/example/src/chevre/aggregation/createAggregateEventTasks.ts +2 -2
- package/example/src/chevre/authorizeEventServiceOffer.ts +119 -0
- package/example/src/chevre/checkEventDuration.ts +1 -1
- package/example/src/chevre/findAnyEventById.ts +1 -1
- package/example/src/chevre/findReservationByCode.ts +0 -1
- package/example/src/chevre/productOffer/publishMemberTierToken.ts +92 -0
- package/example/src/chevre/reIndex.ts +3 -1
- package/example/src/chevre/roles/addAdminProductOfferPermissionIfNotExists.ts +48 -0
- package/example/src/chevre/roles/removeConsolePermissionIfExists.ts +1 -2
- package/example/src/chevre/updateEventPartiallyById.ts +1 -1
- package/lib/chevre/factory/event.d.ts +2 -4
- package/lib/chevre/repo/accountingReport.d.ts +4 -4
- package/lib/chevre/repo/accountingReport.js +1 -1
- package/lib/chevre/repo/action.d.ts +1 -1
- package/lib/chevre/repo/aggregateReservation.d.ts +2 -2
- package/lib/chevre/repo/creativeWork.d.ts +1 -3
- package/lib/chevre/repo/creativeWork.js +65 -47
- package/lib/chevre/repo/event.d.ts +47 -51
- package/lib/chevre/repo/event.js +13 -112
- package/lib/chevre/repo/eventSeries.d.ts +14 -14
- package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +2 -15
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/event.d.ts +3 -6
- package/lib/chevre/repo/mongoose/schemas/eventSeries.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/place.js +13 -14
- package/lib/chevre/repo/mongoose/schemas/product.js +14 -4
- package/lib/chevre/repo/mongoose/schemas/{offer/event.d.ts → productOffer.d.ts} +6 -3
- package/lib/chevre/repo/mongoose/schemas/{offer/event.js → productOffer.js} +26 -29
- package/lib/chevre/repo/mongoose/schemas/seller.js +17 -6
- package/lib/chevre/repo/productOffer.d.ts +36 -61
- package/lib/chevre/repo/productOffer.js +163 -157
- package/lib/chevre/repository.d.ts +0 -5
- package/lib/chevre/repository.js +2 -15
- package/lib/chevre/service/aggregation/event/aggregateOffers.d.ts +1 -1
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +2 -6
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +3 -19
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.d.ts +1 -3
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +1 -6
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +0 -2
- package/lib/chevre/service/assetTransaction/reserve/start.js +4 -4
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.d.ts +3 -3
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +57 -32
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +2 -2
- package/lib/chevre/service/offer/event/authorize/factory.js +2 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +2 -4
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.js +2 -2
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -2
- package/lib/chevre/service/offer/event/authorize.js +2 -2
- package/lib/chevre/service/offer/event/checkAvailability.d.ts +1 -1
- package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +1 -1
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +1 -1
- package/lib/chevre/service/offer/event/searchOffersByIds.d.ts +1 -1
- package/lib/chevre/service/offer/event/searchOffersByIds.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
- package/lib/chevre/service/offer/onEventChanged.js +2 -19
- package/lib/chevre/service/offer/product.d.ts +0 -3
- package/lib/chevre/service/offer/product.js +29 -38
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +0 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +1 -1
- package/lib/chevre/service/payment/movieTicket/factory.d.ts +2 -2
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.d.ts +1 -1
- package/lib/chevre/service/reserve/useReservation.js +2 -3
- package/lib/chevre/service/reserve/verifyToken4reservation.d.ts +0 -2
- package/lib/chevre/service/task/checkResource.d.ts +2 -2
- package/lib/chevre/service/task/checkResource.js +8 -6
- package/lib/chevre/service/task/createAccountingReport.d.ts +2 -2
- package/lib/chevre/service/task/createAccountingReport.js +15 -15
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.d.ts +1 -1
- package/lib/chevre/service/task/createEvent/createEventBySchedule.d.ts +1 -1
- package/lib/chevre/service/task/createEvent/createEventBySchedule.js +2 -1
- package/lib/chevre/service/task/createEvent/createEventSeries.d.ts +1 -1
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +7 -6
- package/lib/chevre/service/task/useReservation.js +1 -2
- package/lib/chevre/service/taskHandler.js +2 -0
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.d.ts +0 -1
- package/lib/chevre/service/validation/validateEvent.js +1 -1
- package/package.json +3 -3
- package/example/src/chevre/eventOffer/adminEventOffers.ts +0 -67
- package/example/src/chevre/roles/addPermissionIfNotExists.ts +0 -48
- package/example/src/chevre/upsertMoviesByIdentifier.ts +0 -58
- package/lib/chevre/repo/offer/event.d.ts +0 -38
- package/lib/chevre/repo/offer/event.js +0 -142
|
@@ -25,7 +25,7 @@ const schemaDefinition = {
|
|
|
25
25
|
description: mongoose_1.SchemaTypes.Mixed,
|
|
26
26
|
address: mongoose_1.SchemaTypes.Mixed,
|
|
27
27
|
branchCode: { type: String, required: true },
|
|
28
|
-
containedInPlace: mongoose_1.SchemaTypes.Mixed,
|
|
28
|
+
containedInPlace: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
29
29
|
containsPlace: [mongoose_1.SchemaTypes.Mixed],
|
|
30
30
|
maximumAttendeeCapacity: Number,
|
|
31
31
|
openingHoursSpecification: mongoose_1.SchemaTypes.Mixed,
|
|
@@ -170,20 +170,19 @@ const indexes = [
|
|
|
170
170
|
'containedInPlace.branchCode': { $exists: true }
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
+
],
|
|
174
|
+
[
|
|
175
|
+
// unique index(2025-10-01~)
|
|
176
|
+
{
|
|
177
|
+
// 'project.id': 1,
|
|
178
|
+
'containedInPlace.id': 1, // 施設内ユニーク
|
|
179
|
+
branchCode: 1
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
unique: true,
|
|
183
|
+
name: 'uniqueBranchCode'
|
|
184
|
+
}
|
|
173
185
|
]
|
|
174
|
-
// [
|
|
175
|
-
// {
|
|
176
|
-
// typeOf: 1,
|
|
177
|
-
// 'project.id': 1,
|
|
178
|
-
// 'containedInPlace.branchCode': 1,
|
|
179
|
-
// branchCode: 1,
|
|
180
|
-
// 'containsPlace.branchCode': 1,
|
|
181
|
-
// 'containsPlace.containsPlace.branchCode': 1
|
|
182
|
-
// },
|
|
183
|
-
// {
|
|
184
|
-
// name: 'projectSeatsUsingSort'
|
|
185
|
-
// }
|
|
186
|
-
// ]
|
|
187
186
|
];
|
|
188
187
|
exports.indexes = indexes;
|
|
189
188
|
/**
|
|
@@ -50,10 +50,10 @@ const indexes = [
|
|
|
50
50
|
{ productID: 1 },
|
|
51
51
|
{ name: 'searchByProductID' }
|
|
52
52
|
],
|
|
53
|
-
[
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
],
|
|
53
|
+
// [
|
|
54
|
+
// { 'project.id': 1, productID: 1 },
|
|
55
|
+
// { name: 'searchByProjectId-v20220721' }
|
|
56
|
+
// ], // migrate to uniqueProductID(2025-09-30~)
|
|
57
57
|
[
|
|
58
58
|
{ 'hasOfferCatalog.id': 1, productID: 1 },
|
|
59
59
|
{
|
|
@@ -129,6 +129,16 @@ const indexes = [
|
|
|
129
129
|
additionalProperty: { $exists: true }
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
+
],
|
|
133
|
+
[
|
|
134
|
+
{
|
|
135
|
+
'project.id': 1,
|
|
136
|
+
productID: 1
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'uniqueProductID',
|
|
140
|
+
unique: true
|
|
141
|
+
}
|
|
132
142
|
]
|
|
133
143
|
];
|
|
134
144
|
exports.indexes = indexes;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
|
-
import * as factory from '
|
|
3
|
-
type IDocType = factory.
|
|
2
|
+
import * as factory from '../../../factory';
|
|
3
|
+
type IDocType = Omit<factory.productOffer.IProductOffer, 'acceptedPaymentMethod' | 'validForMemberTier'> & {
|
|
4
|
+
acceptedPaymentMethod?: factory.productOffer.IAcceptedPaymentMethod;
|
|
5
|
+
validForMemberTier?: factory.productOffer.IValidForMemberTier;
|
|
6
|
+
};
|
|
4
7
|
type IModel = Model<IDocType>;
|
|
5
8
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
6
9
|
type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
|
|
7
|
-
declare const modelName = "
|
|
10
|
+
declare const modelName = "ProductOffer";
|
|
8
11
|
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
9
12
|
declare function createSchema(): ISchema;
|
|
10
13
|
export { createSchema, IDocType, IModel, indexes, modelName };
|
|
@@ -3,25 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.modelName = exports.indexes = void 0;
|
|
4
4
|
exports.createSchema = createSchema;
|
|
5
5
|
const mongoose_1 = require("mongoose");
|
|
6
|
-
const settings_1 = require("
|
|
7
|
-
const writeConcern_1 = require("
|
|
8
|
-
const modelName = '
|
|
6
|
+
const settings_1 = require("../../../settings");
|
|
7
|
+
const writeConcern_1 = require("../writeConcern");
|
|
8
|
+
const modelName = 'ProductOffer';
|
|
9
9
|
exports.modelName = modelName;
|
|
10
10
|
const schemaDefinition = {
|
|
11
11
|
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
12
|
-
seller: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
13
12
|
typeOf: { type: String, required: true },
|
|
14
13
|
identifier: { type: String, required: true },
|
|
15
14
|
itemOffered: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
16
|
-
|
|
15
|
+
offeredBy: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
16
|
+
availability: { type: String, required: true },
|
|
17
17
|
validFrom: { type: Date, required: true },
|
|
18
18
|
validThrough: { type: Date, required: true },
|
|
19
|
-
|
|
19
|
+
// availableAtOrFrom: { type: SchemaTypes.Mixed, required: false },
|
|
20
|
+
validForMemberTier: { type: mongoose_1.SchemaTypes.Mixed, required: false },
|
|
21
|
+
acceptedPaymentMethod: { type: mongoose_1.SchemaTypes.Mixed, required: false }
|
|
20
22
|
};
|
|
21
23
|
const schemaOptions = {
|
|
22
24
|
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
23
25
|
autoCreate: false,
|
|
24
|
-
collection: '
|
|
26
|
+
collection: 'productOffers',
|
|
25
27
|
id: true,
|
|
26
28
|
read: settings_1.MONGO_READ_PREFERENCE,
|
|
27
29
|
writeConcern: writeConcern_1.writeConcern,
|
|
@@ -49,7 +51,8 @@ const indexes = [
|
|
|
49
51
|
],
|
|
50
52
|
[
|
|
51
53
|
{
|
|
52
|
-
'
|
|
54
|
+
'project.id': 1,
|
|
55
|
+
'itemOffered.identifier': 1,
|
|
53
56
|
identifier: 1
|
|
54
57
|
},
|
|
55
58
|
{
|
|
@@ -57,45 +60,39 @@ const indexes = [
|
|
|
57
60
|
unique: true
|
|
58
61
|
}
|
|
59
62
|
],
|
|
60
|
-
[
|
|
61
|
-
{
|
|
62
|
-
'itemOffered.id': 1,
|
|
63
|
-
'availableAtOrFrom.id': 1,
|
|
64
|
-
'validForMemberTier.identifier': 1
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: 'uniqueByItemOfferedAndAvailableAt',
|
|
68
|
-
unique: true
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
63
|
[
|
|
72
64
|
{ 'project.id': 1, validFrom: 1 },
|
|
73
65
|
{ name: 'projectId' }
|
|
74
66
|
],
|
|
75
|
-
[
|
|
76
|
-
{ 'seller.id': 1, validFrom: 1 },
|
|
77
|
-
{ name: 'sellerId' }
|
|
78
|
-
],
|
|
79
67
|
[
|
|
80
68
|
{ identifier: 1, validFrom: 1 },
|
|
81
69
|
{ name: 'identifier' }
|
|
82
70
|
],
|
|
83
71
|
[
|
|
84
|
-
{ 'itemOffered.
|
|
85
|
-
{ name: '
|
|
72
|
+
{ 'itemOffered.identifier': 1, validFrom: 1 },
|
|
73
|
+
{ name: 'itemOfferedIdentifier' }
|
|
74
|
+
],
|
|
75
|
+
[
|
|
76
|
+
{ 'offeredBy.id': 1, validFrom: 1 },
|
|
77
|
+
{ name: 'offeredById' }
|
|
86
78
|
],
|
|
87
79
|
[
|
|
88
|
-
{
|
|
89
|
-
{ name: '
|
|
80
|
+
{ validThrough: 1, validFrom: 1 },
|
|
81
|
+
{ name: 'validThrough' }
|
|
90
82
|
],
|
|
91
83
|
[
|
|
92
84
|
{ 'validForMemberTier.identifier': 1, validFrom: 1 },
|
|
93
|
-
{
|
|
85
|
+
{
|
|
86
|
+
name: 'validForMemberTierIdentifier',
|
|
87
|
+
partialFilterExpression: {
|
|
88
|
+
'validForMemberTier.identifier': { $exists: true }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
94
91
|
]
|
|
95
92
|
];
|
|
96
93
|
exports.indexes = indexes;
|
|
97
94
|
/**
|
|
98
|
-
*
|
|
95
|
+
* プロダクトオファー(汎用的なオファー設定)スキーマ
|
|
99
96
|
*/
|
|
100
97
|
let schema;
|
|
101
98
|
function createSchema() {
|
|
@@ -57,12 +57,12 @@ const indexes = [
|
|
|
57
57
|
{ typeOf: 1, branchCode: 1 },
|
|
58
58
|
{ name: 'searchByTypeOf' }
|
|
59
59
|
],
|
|
60
|
-
[
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
],
|
|
60
|
+
// [
|
|
61
|
+
// { 'project.id': 1, branchCode: 1 },
|
|
62
|
+
// {
|
|
63
|
+
// name: 'searchByProjectId-v20220721'
|
|
64
|
+
// }
|
|
65
|
+
// ],
|
|
66
66
|
[
|
|
67
67
|
{ 'name.ja': 1, branchCode: 1 },
|
|
68
68
|
{
|
|
@@ -107,6 +107,17 @@ const indexes = [
|
|
|
107
107
|
'hasMerchantReturnPolicy.identifier': { $exists: true }
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
+
],
|
|
111
|
+
[
|
|
112
|
+
// unique index(2025-10-01~)
|
|
113
|
+
{
|
|
114
|
+
'project.id': 1,
|
|
115
|
+
branchCode: 1
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
unique: true,
|
|
119
|
+
name: 'uniqueBranchCode'
|
|
120
|
+
}
|
|
110
121
|
]
|
|
111
122
|
];
|
|
112
123
|
exports.indexes = indexes;
|
|
@@ -1,77 +1,52 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BulkWriteResult, DeleteResult } from 'mongodb';
|
|
2
|
+
import { Connection, FilterQuery } from 'mongoose';
|
|
2
3
|
import * as factory from '../factory';
|
|
4
|
+
import { IDocType } from './mongoose/schemas/productOffer';
|
|
5
|
+
type IUnset = {
|
|
6
|
+
[key in keyof IDocType]?: 1;
|
|
7
|
+
};
|
|
8
|
+
type IDocWithId = factory.productOffer.IProductOffer & {
|
|
9
|
+
id: string;
|
|
10
|
+
};
|
|
11
|
+
type IKeyOfProjection = keyof IDocType;
|
|
3
12
|
/**
|
|
4
13
|
* プロダクトオファーリポジトリ
|
|
5
14
|
*/
|
|
6
15
|
export declare class ProductOfferRepo {
|
|
7
|
-
private readonly
|
|
16
|
+
private readonly productOfferModel;
|
|
8
17
|
constructor(connection: Connection);
|
|
18
|
+
static CREATE_MONGO_CONDITIONS(params: factory.productOffer.ISearchConditions): FilterQuery<IDocType>[];
|
|
19
|
+
findProductOffers(params: factory.productOffer.ISearchConditions, inclusion: IKeyOfProjection[]): Promise<IDocWithId[]>;
|
|
9
20
|
/**
|
|
10
|
-
*
|
|
21
|
+
* オファーコードとオファーコレクションコードをキーにして冪等置換
|
|
11
22
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
seller?: {
|
|
26
|
-
id?: {
|
|
27
|
-
$eq?: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
}): Promise<(Pick<factory.product.IOffer, 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'> & {
|
|
31
|
-
itemOffered: Pick<factory.product.IProduct, 'id' | 'name' | 'typeOf'>;
|
|
32
|
-
})[]>;
|
|
33
|
-
create(params: factory.product.IOffer & {
|
|
34
|
-
project: {
|
|
35
|
-
id: string;
|
|
36
|
-
};
|
|
37
|
-
itemOffered: {
|
|
38
|
-
/**
|
|
39
|
-
* プロダクトID
|
|
40
|
-
*/
|
|
41
|
-
id: string;
|
|
42
|
-
};
|
|
23
|
+
upsertOffersByIdentifier(params: {
|
|
24
|
+
$set: Pick<IDocType, 'acceptedPaymentMethod' | 'availability' | 'identifier' | 'itemOffered' | 'offeredBy' | 'project' | 'typeOf' | 'validForMemberTier' | 'validFrom' | 'validThrough'> & {
|
|
25
|
+
id?: never;
|
|
26
|
+
};
|
|
27
|
+
$unset: IUnset;
|
|
28
|
+
}[], options: {
|
|
29
|
+
/**
|
|
30
|
+
* falseの場合setOnInsertのみ
|
|
31
|
+
* trueの場合setのみ
|
|
32
|
+
*/
|
|
33
|
+
update: boolean;
|
|
43
34
|
}): Promise<{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
update(params: factory.product.IOffer & {
|
|
47
|
-
project: {
|
|
35
|
+
bulkWriteResult: BulkWriteResult;
|
|
36
|
+
modifiedProductOffers: {
|
|
48
37
|
id: string;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
};
|
|
56
|
-
}): Promise<{
|
|
57
|
-
id: string;
|
|
58
|
-
}>;
|
|
59
|
-
deleteOne(params: Pick<factory.product.IOffer, 'seller'> & {
|
|
38
|
+
}[];
|
|
39
|
+
} | void>;
|
|
40
|
+
/**
|
|
41
|
+
* 販売者の提供するプロダクトオファーを削除する
|
|
42
|
+
*/
|
|
43
|
+
deleteProductOffersBySeller(params: {
|
|
60
44
|
project: {
|
|
61
45
|
id: string;
|
|
62
46
|
};
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* プロダクトID
|
|
66
|
-
*/
|
|
67
|
-
id: string;
|
|
68
|
-
};
|
|
69
|
-
}): Promise<{
|
|
70
|
-
id: string;
|
|
71
|
-
}>;
|
|
72
|
-
deleteManyBySellerId(params: Pick<factory.product.IOffer, 'seller'> & {
|
|
73
|
-
project: {
|
|
47
|
+
offeredBy: {
|
|
74
48
|
id: string;
|
|
75
49
|
};
|
|
76
|
-
}): Promise<
|
|
50
|
+
}): Promise<DeleteResult>;
|
|
77
51
|
}
|
|
52
|
+
export {};
|