@chevre/domain 28.0.0-alpha.3 → 28.0.0-alpha.30
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/eventEmitter/transaction.d.ts +2 -2
- package/lib/chevre/eventEmitter/transaction.js +1 -1
- package/lib/chevre/factory/event.d.ts +1 -1
- package/lib/chevre/factory/event.js +1 -5
- package/lib/chevre/repo/acceptedOffer.d.ts +6 -5
- package/lib/chevre/repo/acceptedOffer.js +14 -9
- package/lib/chevre/repo/acceptedOfferInReserve.d.ts +6 -8
- package/lib/chevre/repo/acceptedOfferInReserve.js +13 -7
- package/lib/chevre/repo/adminAcceptedOffer.d.ts +25 -12
- package/lib/chevre/repo/adminAcceptedOffer.js +20 -10
- package/lib/chevre/repo/adminEvent.d.ts +1 -7
- package/lib/chevre/repo/adminEvent.js +3 -9
- package/lib/chevre/repo/adminEventSeries.d.ts +67 -0
- package/lib/chevre/repo/adminEventSeries.js +178 -0
- package/lib/chevre/repo/{paymentServiceChannel.d.ts → adminPaymentServiceChannel.d.ts} +13 -11
- package/lib/chevre/repo/{paymentServiceChannel.js → adminPaymentServiceChannel.js} +20 -19
- package/lib/chevre/repo/adminTask.d.ts +2 -2
- package/lib/chevre/repo/adminTransaction.d.ts +20 -30
- package/lib/chevre/repo/adminTransaction.js +0 -98
- package/lib/chevre/repo/aggregateEvent.js +0 -1
- package/lib/chevre/repo/aggregateTransaction.d.ts +0 -1
- package/lib/chevre/repo/aggregateTransaction.js +0 -1
- package/lib/chevre/repo/categoryCode.js +0 -21
- package/lib/chevre/repo/event.d.ts +2 -2
- package/lib/chevre/repo/event.js +71 -110
- package/lib/chevre/repo/eventSeries.d.ts +5 -84
- package/lib/chevre/repo/eventSeries.js +21 -212
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +1 -1
- package/lib/chevre/repo/issuer.d.ts +2 -6
- package/lib/chevre/repo/memberProgram.d.ts +1 -38
- package/lib/chevre/repo/memberProgram.js +1 -62
- package/lib/chevre/repo/mongoose/schemas/civicStructure.d.ts +1 -0
- package/lib/chevre/repo/mongoose/schemas/event.js +0 -13
- package/lib/chevre/repo/mongoose/schemas/eventSeries.js +1 -18
- package/lib/chevre/repo/mongoose/schemas/issuer.d.ts +1 -3
- package/lib/chevre/repo/mongoose/schemas/issuer.js +0 -10
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +22 -1
- package/lib/chevre/repo/mongoose/schemas/paymentServiceChannel.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/place.js +0 -9
- package/lib/chevre/repo/mongoose/schemas/seller.d.ts +3 -1
- package/lib/chevre/repo/mongoose/schemas/seller.js +0 -2
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/transaction.js +81 -70
- package/lib/chevre/repo/order.d.ts +2 -2
- package/lib/chevre/repo/order.js +0 -31
- package/lib/chevre/repo/orderInTransaction.d.ts +5 -25
- package/lib/chevre/repo/orderInTransaction.js +0 -6
- package/lib/chevre/repo/place/movieTheater.d.ts +3 -1
- package/lib/chevre/repo/place/movieTheater.js +3 -1
- package/lib/chevre/repo/place/{hasPOS.d.ts → pos.d.ts} +13 -20
- package/lib/chevre/repo/place/{hasPOS.js → pos.js} +66 -29
- package/lib/chevre/repo/place/screeningRoom.d.ts +24 -3
- package/lib/chevre/repo/place/screeningRoom.js +28 -17
- package/lib/chevre/repo/priceSpecification.d.ts +8 -8
- package/lib/chevre/repo/seller.d.ts +11 -4
- package/lib/chevre/repo/seller.js +31 -58
- package/lib/chevre/repo/sellerPaymentAccepted.d.ts +14 -21
- package/lib/chevre/repo/sellerPaymentAccepted.js +65 -38
- package/lib/chevre/repo/task.d.ts +3 -3
- package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -8
- package/lib/chevre/repo/transaction/placeOrder.js +31 -112
- package/lib/chevre/repo/transaction.js +0 -1
- package/lib/chevre/repository.d.ts +15 -10
- package/lib/chevre/repository.js +30 -19
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +1 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +2 -2
- package/lib/chevre/service/aggregation/system.js +1 -3
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateAcceptedPaymentMethodIfNeeded.js +1 -2
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.js +2 -2
- package/lib/chevre/service/assetTransaction/reserve/start.js +2 -1
- package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -1
- package/lib/chevre/service/event/saveScreeningEventSeries.d.ts +2 -2
- package/lib/chevre/service/event/saveScreeningEventSeries.js +2 -3
- package/lib/chevre/service/event/saveScreeningEvents.d.ts +2 -0
- package/lib/chevre/service/event/saveScreeningEvents.js +4 -4
- package/lib/chevre/service/event.d.ts +2 -0
- package/lib/chevre/service/event.js +0 -1
- package/lib/chevre/service/offer/any.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -3
- package/lib/chevre/service/offer/event/authorize/factory.js +1 -8
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize.js +1 -4
- package/lib/chevre/service/offer/event/issueEventOfferTicket.js +1 -12
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +3 -9
- package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +2 -8
- package/lib/chevre/service/offer/event/searchOffersByIds.js +3 -9
- package/lib/chevre/service/offer/event/voidTransaction.js +2 -5
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -4
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +2 -9
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +0 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +1 -4
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -4
- package/lib/chevre/service/offer/onEventChanged.js +9 -21
- package/lib/chevre/service/offer.js +1 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +4 -6
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +23 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
- package/lib/chevre/service/order/sendOrder.js +2 -14
- package/lib/chevre/service/payment/any/authorize.js +1 -1
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +1 -4
- package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/payment/creditCard/getGMOInfoFromSeller.js +1 -1
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.d.ts +3 -3
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket/payActionParams2seatInfoSyncIn.js +1 -1
- package/lib/chevre/service/payment/movieTicket/validation.js +1 -1
- package/lib/chevre/service/task/importEventsFromCOA.js +2 -0
- package/lib/chevre/service/task/onResourceDeleted.js +8 -8
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.d.ts +7 -3
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +51 -50
- package/lib/chevre/service/task/onResourceUpdated.js +5 -25
- package/lib/chevre/service/task/syncResourcesFromCOA.js +5 -3
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -7
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -4
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +1 -4
- package/lib/chevre/service/transaction/returnOrder/preStart/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -2
- package/package.json +2 -2
- package/lib/chevre/service/delivery/factory.d.ts +0 -16
- package/lib/chevre/service/delivery/factory.js +0 -124
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
import { Connection } from 'mongoose';
|
|
2
2
|
import { factory } from '../factory';
|
|
3
|
-
type
|
|
4
|
-
type IMemberProgram = factory.issuer.IMemberProgram & {
|
|
5
|
-
hasTiers?: IMemberProgramTier[];
|
|
6
|
-
};
|
|
3
|
+
type IMemberProgram = factory.issuer.IMemberProgram;
|
|
7
4
|
type IMemberProgramAsSearchResult = IMemberProgram & {
|
|
8
5
|
hostingOrganization: {
|
|
9
6
|
identifier: string;
|
|
10
7
|
};
|
|
11
8
|
};
|
|
12
|
-
type IMemberProgramTierAsSearchResult = IMemberProgramTier & {
|
|
13
|
-
isTierOf: {
|
|
14
|
-
identifier: string;
|
|
15
|
-
hostingOrganization: {
|
|
16
|
-
identifier: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
9
|
/**
|
|
21
10
|
* メンバープログラムリポジトリ
|
|
22
11
|
*/
|
|
@@ -44,31 +33,6 @@ export declare class MemberProgramRepo {
|
|
|
44
33
|
$in?: string[];
|
|
45
34
|
};
|
|
46
35
|
}): Promise<IMemberProgramAsSearchResult[]>;
|
|
47
|
-
/**
|
|
48
|
-
* tierを検索する
|
|
49
|
-
*/
|
|
50
|
-
projectMemberProgramTiers(params: {
|
|
51
|
-
limit?: number;
|
|
52
|
-
page?: number;
|
|
53
|
-
project?: {
|
|
54
|
-
id?: {
|
|
55
|
-
$eq?: string;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
isTierOf?: {
|
|
59
|
-
hostingOrganization?: {
|
|
60
|
-
id?: {
|
|
61
|
-
$eq?: string;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
identifier?: {
|
|
65
|
-
$eq?: string;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
identifier?: {
|
|
69
|
-
$eq?: string;
|
|
70
|
-
};
|
|
71
|
-
}): Promise<IMemberProgramTierAsSearchResult[]>;
|
|
72
36
|
create(params: {
|
|
73
37
|
project: {
|
|
74
38
|
id: string;
|
|
@@ -83,7 +47,6 @@ export declare class MemberProgramRepo {
|
|
|
83
47
|
id: string;
|
|
84
48
|
};
|
|
85
49
|
identifier: string;
|
|
86
|
-
hasTiers?: Pick<factory.issuer.IMemberProgramTier, 'identifier'>[];
|
|
87
50
|
hostingOrganization: {
|
|
88
51
|
id: string;
|
|
89
52
|
};
|
|
@@ -47,7 +47,6 @@ class MemberProgramRepo {
|
|
|
47
47
|
_id: 0,
|
|
48
48
|
typeOf: '$hasMemberProgram.typeOf',
|
|
49
49
|
identifier: '$hasMemberProgram.identifier',
|
|
50
|
-
hasTiers: '$hasMemberProgram.hasTiers',
|
|
51
50
|
hostingOrganization: {
|
|
52
51
|
identifier: '$identifier'
|
|
53
52
|
}
|
|
@@ -62,62 +61,6 @@ class MemberProgramRepo {
|
|
|
62
61
|
return aggregate.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
63
62
|
.exec();
|
|
64
63
|
}
|
|
65
|
-
/**
|
|
66
|
-
* tierを検索する
|
|
67
|
-
*/
|
|
68
|
-
async projectMemberProgramTiers(params) {
|
|
69
|
-
const matchStages = [];
|
|
70
|
-
const projectIdEq = params.project?.id?.$eq;
|
|
71
|
-
if (typeof projectIdEq === 'string') {
|
|
72
|
-
matchStages.push({ $match: { 'project.id': { $eq: projectIdEq } } });
|
|
73
|
-
}
|
|
74
|
-
const hostingOrganizationIdEq = params.isTierOf?.hostingOrganization?.id?.$eq;
|
|
75
|
-
if (typeof hostingOrganizationIdEq === 'string') {
|
|
76
|
-
matchStages.push({ $match: { _id: { $eq: new mongoose_1.Types.ObjectId(hostingOrganizationIdEq) } } });
|
|
77
|
-
}
|
|
78
|
-
const memberProgramIdentifierEq = params.isTierOf?.identifier?.$eq;
|
|
79
|
-
if (typeof memberProgramIdentifierEq === 'string') {
|
|
80
|
-
matchStages.push({ $match: { 'hasMemberProgram.identifier': { $exists: true, $eq: memberProgramIdentifierEq } } });
|
|
81
|
-
}
|
|
82
|
-
const identifierEq = params.identifier?.$eq;
|
|
83
|
-
if (typeof identifierEq === 'string') {
|
|
84
|
-
matchStages.push({ $match: { 'hasMemberProgram.hasTiers.identifier': { $exists: true, $eq: identifierEq } } });
|
|
85
|
-
}
|
|
86
|
-
const aggregate = this.issuerModel.aggregate([
|
|
87
|
-
{
|
|
88
|
-
$unwind: {
|
|
89
|
-
path: '$hasMemberProgram'
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
$unwind: {
|
|
94
|
-
path: '$hasMemberProgram.hasTiers'
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
...matchStages,
|
|
98
|
-
{ $sort: { 'hasMemberProgram.hasTiers.identifier': factory_1.factory.sortType.Ascending } },
|
|
99
|
-
{
|
|
100
|
-
$project: {
|
|
101
|
-
_id: 0,
|
|
102
|
-
typeOf: '$hasMemberProgram.hasTiers.typeOf',
|
|
103
|
-
identifier: '$hasMemberProgram.hasTiers.identifier',
|
|
104
|
-
isTierOf: {
|
|
105
|
-
identifier: '$hasMemberProgram.identifier',
|
|
106
|
-
hostingOrganization: {
|
|
107
|
-
identifier: '$identifier'
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
]);
|
|
113
|
-
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
114
|
-
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
115
|
-
aggregate.skip(params.limit * (page - 1))
|
|
116
|
-
.limit(params.limit);
|
|
117
|
-
}
|
|
118
|
-
return aggregate.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
119
|
-
.exec();
|
|
120
|
-
}
|
|
121
64
|
async create(params) {
|
|
122
65
|
let doc = await this.issuerModel.findOne({
|
|
123
66
|
_id: { $eq: params.hostingOrganization.id },
|
|
@@ -146,13 +89,9 @@ class MemberProgramRepo {
|
|
|
146
89
|
}
|
|
147
90
|
}
|
|
148
91
|
async updateOne(params) {
|
|
149
|
-
const hasTiers = (Array.isArray(params.hasTiers))
|
|
150
|
-
? params.hasTiers.map(({ identifier }) => ({ identifier, typeOf: 'MemberProgramTier' }))
|
|
151
|
-
: [];
|
|
152
92
|
const updatingMemberProgram = {
|
|
153
93
|
typeOf: 'MemberProgram',
|
|
154
|
-
identifier: params.identifier
|
|
155
|
-
hasTiers
|
|
94
|
+
identifier: params.identifier
|
|
156
95
|
};
|
|
157
96
|
const doc = await this.issuerModel.findOneAndUpdate({
|
|
158
97
|
_id: { $eq: params.hostingOrganization.id },
|
|
@@ -3,6 +3,7 @@ import { IVirtuals } from '../virtuals';
|
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
4
|
export type IDocType = Omit<factory.place.movieTheater.IPlace, 'id'> & {
|
|
5
5
|
hasPOS?: factory.place.movieTheater.IPOS[];
|
|
6
|
+
hasEntranceGate?: factory.place.movieTheater.IEntranceGate[];
|
|
6
7
|
};
|
|
7
8
|
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
8
9
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
@@ -88,10 +88,6 @@ const indexes = [
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
],
|
|
91
|
-
[
|
|
92
|
-
{ typeOf: 1, startDate: 1 },
|
|
93
|
-
{ name: 'searchByTypeOf' }
|
|
94
|
-
],
|
|
95
91
|
[
|
|
96
92
|
{ eventStatus: 1, startDate: 1 },
|
|
97
93
|
{ name: 'searchByEventStatus' }
|
|
@@ -182,15 +178,6 @@ const indexes = [
|
|
|
182
178
|
name: 'searchByOffersItemOfferedId'
|
|
183
179
|
}
|
|
184
180
|
],
|
|
185
|
-
[
|
|
186
|
-
{ 'offers.seller.makesOffer': 1, startDate: 1 },
|
|
187
|
-
{
|
|
188
|
-
name: 'searchBySellerMakesOffer',
|
|
189
|
-
partialFilterExpression: {
|
|
190
|
-
'offers.seller.makesOffer': { $exists: true }
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
],
|
|
194
181
|
[
|
|
195
182
|
{ 'offers.seller.makesOffer.availableAtOrFrom.id': 1, startDate: 1 },
|
|
196
183
|
{
|
|
@@ -26,7 +26,7 @@ const schemaDefinition = {
|
|
|
26
26
|
startDate: { type: Date, required: true }, // required(2025-10-08~)
|
|
27
27
|
subEvent: mongoose_1.SchemaTypes.Mixed, // support(2025-12-31~)
|
|
28
28
|
workPerformed: mongoose_1.SchemaTypes.Mixed,
|
|
29
|
-
soundFormat:
|
|
29
|
+
// soundFormat: SchemaTypes.Mixed, // discontinue(2026-10-07~)
|
|
30
30
|
subtitleLanguage: mongoose_1.SchemaTypes.Mixed,
|
|
31
31
|
dubLanguage: mongoose_1.SchemaTypes.Mixed,
|
|
32
32
|
kanaName: String,
|
|
@@ -74,14 +74,6 @@ const indexes = [
|
|
|
74
74
|
{ 'organizer.id': 1, startDate: 1 },
|
|
75
75
|
{ name: 'organizerId' }
|
|
76
76
|
],
|
|
77
|
-
[
|
|
78
|
-
{ typeOf: 1, startDate: 1 },
|
|
79
|
-
{ name: 'typeOf' }
|
|
80
|
-
],
|
|
81
|
-
[
|
|
82
|
-
{ eventStatus: 1, startDate: 1 },
|
|
83
|
-
{ name: 'eventStatus' }
|
|
84
|
-
],
|
|
85
77
|
[
|
|
86
78
|
{ 'location.id': 1, startDate: 1 },
|
|
87
79
|
{
|
|
@@ -146,15 +138,6 @@ const indexes = [
|
|
|
146
138
|
}
|
|
147
139
|
}
|
|
148
140
|
],
|
|
149
|
-
[
|
|
150
|
-
{ 'soundFormat.typeOf': 1, startDate: 1 },
|
|
151
|
-
{
|
|
152
|
-
name: 'soundFormatTypeOf',
|
|
153
|
-
partialFilterExpression: {
|
|
154
|
-
'soundFormat.typeOf': { $exists: true }
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
],
|
|
158
141
|
[
|
|
159
142
|
{ 'name.ja': 1, startDate: 1 },
|
|
160
143
|
{
|
|
@@ -2,9 +2,7 @@ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from '
|
|
|
2
2
|
import { factory } from '../../../factory';
|
|
3
3
|
import { IVirtuals } from '../virtuals';
|
|
4
4
|
export type IDocType = Omit<factory.issuer.IIssuer, 'id'> & {
|
|
5
|
-
hasMemberProgram?:
|
|
6
|
-
hasTiers?: Pick<factory.issuer.IMemberProgramTier, 'identifier' | 'typeOf'>[];
|
|
7
|
-
})[];
|
|
5
|
+
hasMemberProgram?: factory.issuer.IMemberProgram[];
|
|
8
6
|
};
|
|
9
7
|
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
10
8
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
@@ -61,16 +61,6 @@ const indexes = [
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
],
|
|
64
|
-
[
|
|
65
|
-
{ 'project.id': 1, 'hasMemberProgram.hasTiers.identifier': 1 },
|
|
66
|
-
{
|
|
67
|
-
name: 'uniqueMemberProgramTierIdentifier',
|
|
68
|
-
unique: true,
|
|
69
|
-
partialFilterExpression: {
|
|
70
|
-
'hasMemberProgram.hasTiers.identifier': { $exists: true }
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
],
|
|
74
64
|
[
|
|
75
65
|
{ 'hasMemberProgram.identifier': 1, identifier: 1 },
|
|
76
66
|
{ name: 'hasMemberProgramIdentifier' }
|
|
@@ -1,8 +1,29 @@
|
|
|
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 IMinimizedReservationFor = Pick<factory.acceptedOffer.IEventAsReservationFor, 'endDate' | 'id' | 'startDate' | 'typeOf'> & {
|
|
5
|
+
location: Pick<factory.acceptedOffer.IEventAsReservationFor['location'], 'branchCode' | 'typeOf'>;
|
|
6
|
+
superEvent: Pick<factory.acceptedOffer.ISuperEvent, 'id' | 'typeOf'> & {
|
|
7
|
+
location: Pick<factory.acceptedOffer.ISuperEvent['location'], 'branchCode' | 'typeOf'>;
|
|
8
|
+
workPerformed: Pick<factory.acceptedOffer.ISuperEvent['workPerformed'], 'identifier' | 'typeOf'>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type IMinimizedItemOffered = Pick<factory.acceptedOffer.IEventReservation, 'id' | 'reservationNumber' | 'typeOf'> & {
|
|
12
|
+
/**
|
|
13
|
+
* 予約番号ごとに、ひとつめのオファーのみreservationForを含むように変更するのでoptionalに
|
|
14
|
+
* 2026-06-04~
|
|
15
|
+
*/
|
|
16
|
+
reservationFor?: IMinimizedReservationFor;
|
|
17
|
+
reservedTicket?: never;
|
|
18
|
+
};
|
|
19
|
+
export type IMinimizedAcceptedOffer = Pick<factory.acceptedOffer.IOptimizedAcceptedOffer, 'id' | 'offeredThrough' | 'serialNumber' | 'typeOf'> & {
|
|
20
|
+
itemOffered: IMinimizedItemOffered;
|
|
21
|
+
priceSpecification?: never;
|
|
22
|
+
name?: never;
|
|
23
|
+
};
|
|
24
|
+
export type IAcceptedOfferInDoc = IMinimizedAcceptedOffer | factory.acceptedOffer.ICOAAcceptedOffer;
|
|
4
25
|
type IDocType = Omit<factory.order.IOrder, 'id'> & {
|
|
5
|
-
acceptedOffers?:
|
|
26
|
+
acceptedOffers?: IAcceptedOfferInDoc[];
|
|
6
27
|
/**
|
|
7
28
|
* 注文取引IDとして再定義(2026-06-22~)
|
|
8
29
|
*/
|
|
@@ -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
|
-
type IDocType =
|
|
4
|
+
type IDocType = Pick<factory.serviceChannel.IServiceChannel, 'credentials' | 'project' | 'providesService' | 'serviceUrl' | 'typeOf'>;
|
|
5
5
|
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
6
6
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
7
7
|
type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
|
|
@@ -34,15 +34,6 @@ const schemaDefinition = {
|
|
|
34
34
|
// ↓ルームの施設からの分離に伴い属性追加(2023-06-22~)
|
|
35
35
|
openSeatingAllowed: mongoose_1.SchemaTypes.Mixed,
|
|
36
36
|
amenityFeature: mongoose_1.SchemaTypes.Mixed
|
|
37
|
-
// ↓migrated to civicStructures(2024-09-19~)
|
|
38
|
-
// alternateName: SchemaTypes.Mixed,
|
|
39
|
-
// hasEntranceGate: [SchemaTypes.Mixed],
|
|
40
|
-
// hasPOS: [SchemaTypes.Mixed],
|
|
41
|
-
// sameAs: String,
|
|
42
|
-
// telephone: String,
|
|
43
|
-
// url: String,
|
|
44
|
-
// kanaName: String,
|
|
45
|
-
// offers: SchemaTypes.Mixed,
|
|
46
37
|
};
|
|
47
38
|
const schemaOptions = {
|
|
48
39
|
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import { IVirtuals } from '../virtuals';
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
|
-
type IDocType =
|
|
4
|
+
type IDocType = Pick<factory.seller.ISeller, 'additionalProperty' | 'branchCode' | 'hasMerchantReturnPolicy' | 'makesOffer' | 'name' | 'project' | 'telephone' | 'typeOf' | 'url'> & {
|
|
5
|
+
paymentAccepted?: factory.seller.IPaymentAccepted[];
|
|
6
|
+
};
|
|
5
7
|
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
6
8
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
7
9
|
type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
|
|
@@ -9,12 +9,10 @@ const modelName = 'Seller';
|
|
|
9
9
|
exports.modelName = modelName;
|
|
10
10
|
const schemaDefinition = {
|
|
11
11
|
additionalProperty: [mongoose_1.SchemaTypes.Mixed],
|
|
12
|
-
// areaServed: [SchemaTypes.Mixed],
|
|
13
12
|
branchCode: String,
|
|
14
13
|
hasMerchantReturnPolicy: [mongoose_1.SchemaTypes.Mixed],
|
|
15
14
|
makesOffer: [mongoose_1.SchemaTypes.Mixed],
|
|
16
15
|
name: mongoose_1.SchemaTypes.Mixed,
|
|
17
|
-
// parentOrganization: SchemaTypes.Mixed,
|
|
18
16
|
paymentAccepted: [mongoose_1.SchemaTypes.Mixed],
|
|
19
17
|
project: mongoose_1.SchemaTypes.Mixed,
|
|
20
18
|
typeOf: {
|
|
@@ -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
|
-
type IPlaceOrder = Pick<factory.transaction.placeOrder.ITransaction, 'agent' | 'endDate' | '
|
|
4
|
+
type IPlaceOrder = Pick<factory.transaction.placeOrder.ITransaction, 'agent' | 'endDate' | 'expires' | 'instrument' | 'object' | 'project' | 'result' | 'seller' | 'startDate' | 'status' | 'tasksExportAction' | 'typeOf'>;
|
|
5
5
|
type IDocType = IPlaceOrder;
|
|
6
6
|
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
7
7
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
@@ -4,26 +4,25 @@ exports.modelName = exports.indexes = void 0;
|
|
|
4
4
|
exports.createSchema = createSchema;
|
|
5
5
|
const mongoose_1 = require("mongoose");
|
|
6
6
|
const writeConcern_1 = require("../writeConcern");
|
|
7
|
-
const factory_1 = require("../../../factory");
|
|
8
7
|
const settings_1 = require("../../../settings");
|
|
9
8
|
const modelName = 'Transaction';
|
|
10
9
|
exports.modelName = modelName;
|
|
11
10
|
const schemaDefinition = {
|
|
12
|
-
project: mongoose_1.SchemaTypes.Mixed,
|
|
13
|
-
status: String,
|
|
14
|
-
typeOf: String,
|
|
15
|
-
agent: mongoose_1.SchemaTypes.Mixed,
|
|
16
|
-
|
|
11
|
+
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
12
|
+
status: { type: String, required: true },
|
|
13
|
+
typeOf: { type: String, required: true },
|
|
14
|
+
agent: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
15
|
+
expires: { type: Date, required: true },
|
|
16
|
+
startDate: { type: Date, required: true },
|
|
17
17
|
seller: mongoose_1.SchemaTypes.Mixed,
|
|
18
|
-
error: mongoose_1.SchemaTypes.Mixed,
|
|
19
18
|
result: mongoose_1.SchemaTypes.Mixed,
|
|
20
19
|
object: mongoose_1.SchemaTypes.Mixed,
|
|
21
|
-
expires: Date,
|
|
22
|
-
startDate: Date,
|
|
23
20
|
endDate: Date,
|
|
24
21
|
tasksExportAction: mongoose_1.SchemaTypes.Mixed,
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
instrument: mongoose_1.SchemaTypes.Mixed,
|
|
23
|
+
// recipient: SchemaTypes.Mixed, // discontinue(2026-09-09~)
|
|
24
|
+
// error: SchemaTypes.Mixed, // discontinue(2026-09-14~)
|
|
25
|
+
// potentialActions: SchemaTypes.Mixed, // discontinue(2026-09-14~)
|
|
27
26
|
};
|
|
28
27
|
const schemaOptions = {
|
|
29
28
|
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
@@ -54,10 +53,6 @@ const indexes = [
|
|
|
54
53
|
{ 'project.id': 1, startDate: -1 },
|
|
55
54
|
{ name: 'searchByProjectId-v20220721' }
|
|
56
55
|
],
|
|
57
|
-
[
|
|
58
|
-
{ typeOf: 1, startDate: -1 },
|
|
59
|
-
{ name: 'searchByTypeOfAndStartDate' }
|
|
60
|
-
],
|
|
61
56
|
[
|
|
62
57
|
{ status: 1, startDate: -1 },
|
|
63
58
|
{ name: 'searchByStatusAndStartDate' }
|
|
@@ -66,19 +61,6 @@ const indexes = [
|
|
|
66
61
|
{ startDate: -1 },
|
|
67
62
|
{ name: 'searchByStartDateDescending' }
|
|
68
63
|
],
|
|
69
|
-
[
|
|
70
|
-
{ endDate: 1, startDate: -1 },
|
|
71
|
-
{
|
|
72
|
-
name: 'searchByEndDateAndStartDate',
|
|
73
|
-
partialFilterExpression: {
|
|
74
|
-
endDate: { $exists: true }
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
[
|
|
79
|
-
{ expires: 1, startDate: -1 },
|
|
80
|
-
{ name: 'searchByExpiresAndStartDate' }
|
|
81
|
-
],
|
|
82
64
|
[
|
|
83
65
|
{ 'object.confirmationNumber': 1, startDate: -1 },
|
|
84
66
|
{
|
|
@@ -99,37 +81,31 @@ const indexes = [
|
|
|
99
81
|
],
|
|
100
82
|
[
|
|
101
83
|
// 注文取引のobject.orderNumberも発行されている場合ユニークなはず(2026-02-21~)
|
|
84
|
+
// 返品取引廃止につきuniquePlacingOrderNumberをreIndex
|
|
85
|
+
{ 'object.orderNumber': 1 },
|
|
102
86
|
{
|
|
103
|
-
|
|
104
|
-
'object.orderNumber': 1
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: 'uniquePlacingOrderNumber',
|
|
87
|
+
name: 'uniqueOrderNumber',
|
|
108
88
|
unique: true,
|
|
109
89
|
partialFilterExpression: {
|
|
110
|
-
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
111
90
|
'object.orderNumber': { $exists: true }
|
|
112
91
|
}
|
|
113
92
|
}
|
|
114
93
|
],
|
|
115
|
-
[
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
],
|
|
94
|
+
// [
|
|
95
|
+
// // 注文取引のobject.orderNumberも発行されている場合ユニークなはず(2026-02-21~)
|
|
96
|
+
// {
|
|
97
|
+
// typeOf: 1,
|
|
98
|
+
// 'object.orderNumber': 1
|
|
99
|
+
// },
|
|
100
|
+
// {
|
|
101
|
+
// name: 'uniquePlacingOrderNumber',
|
|
102
|
+
// unique: true,
|
|
103
|
+
// partialFilterExpression: {
|
|
104
|
+
// typeOf: factory.transactionType.PlaceOrder,
|
|
105
|
+
// 'object.orderNumber': { $exists: true }
|
|
106
|
+
// }
|
|
107
|
+
// }
|
|
108
|
+
// ],
|
|
133
109
|
[
|
|
134
110
|
{ 'agent.identifier': 1, startDate: -1 },
|
|
135
111
|
{
|
|
@@ -171,24 +147,6 @@ const indexes = [
|
|
|
171
147
|
}
|
|
172
148
|
}
|
|
173
149
|
],
|
|
174
|
-
[
|
|
175
|
-
{ 'tasksExportAction.actionStatus': 1, startDate: -1 },
|
|
176
|
-
{
|
|
177
|
-
name: 'searchByTasksExportActionActionStatus',
|
|
178
|
-
partialFilterExpression: {
|
|
179
|
-
'tasksExportAction.actionStatus': { $exists: true }
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
],
|
|
183
|
-
[
|
|
184
|
-
{ 'tasksExportAction.startDate': 1, startDate: -1 },
|
|
185
|
-
{
|
|
186
|
-
name: 'searchByTasksExportActionActionStartDate',
|
|
187
|
-
partialFilterExpression: {
|
|
188
|
-
'tasksExportAction.startDate': { $exists: true }
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
],
|
|
192
150
|
// typeOf: ReturnOrder廃止につき以下廃止(2026-09-08~)
|
|
193
151
|
// [
|
|
194
152
|
// { 'object.order.orderNumber': 1, startDate: -1 },
|
|
@@ -212,6 +170,59 @@ const indexes = [
|
|
|
212
170
|
// }
|
|
213
171
|
// }
|
|
214
172
|
// ],
|
|
173
|
+
// [
|
|
174
|
+
// { endDate: 1, startDate: -1 },
|
|
175
|
+
// {
|
|
176
|
+
// name: 'searchByEndDateAndStartDate',
|
|
177
|
+
// partialFilterExpression: {
|
|
178
|
+
// endDate: { $exists: true }
|
|
179
|
+
// }
|
|
180
|
+
// }
|
|
181
|
+
// ],
|
|
182
|
+
// [
|
|
183
|
+
// { expires: 1, startDate: -1 },
|
|
184
|
+
// { name: 'searchByExpiresAndStartDate' }
|
|
185
|
+
// ],
|
|
186
|
+
// [
|
|
187
|
+
// { 'tasksExportAction.startDate': 1, startDate: -1 },
|
|
188
|
+
// {
|
|
189
|
+
// name: 'searchByTasksExportActionActionStartDate',
|
|
190
|
+
// partialFilterExpression: {
|
|
191
|
+
// 'tasksExportAction.startDate': { $exists: true }
|
|
192
|
+
// }
|
|
193
|
+
// }
|
|
194
|
+
// ],
|
|
195
|
+
// [
|
|
196
|
+
// { 'tasksExportAction.actionStatus': 1, startDate: -1 },
|
|
197
|
+
// {
|
|
198
|
+
// name: 'searchByTasksExportActionActionStatus',
|
|
199
|
+
// partialFilterExpression: {
|
|
200
|
+
// 'tasksExportAction.actionStatus': { $exists: true }
|
|
201
|
+
// }
|
|
202
|
+
// }
|
|
203
|
+
// ],
|
|
204
|
+
// [
|
|
205
|
+
// { typeOf: 1, startDate: -1 },
|
|
206
|
+
// { name: 'searchByTypeOfAndStartDate' }
|
|
207
|
+
// ],
|
|
208
|
+
// [
|
|
209
|
+
// { 'agent.typeOf': 1, startDate: -1 },
|
|
210
|
+
// {
|
|
211
|
+
// name: 'searchByAgentTypeOfAndStartDate',
|
|
212
|
+
// partialFilterExpression: {
|
|
213
|
+
// 'agent.typeOf': { $exists: true }
|
|
214
|
+
// }
|
|
215
|
+
// }
|
|
216
|
+
// ],
|
|
217
|
+
// [
|
|
218
|
+
// { 'agent.id': 1, startDate: -1 },
|
|
219
|
+
// {
|
|
220
|
+
// name: 'searchByAgentIdAndStartDate',
|
|
221
|
+
// partialFilterExpression: {
|
|
222
|
+
// 'agent.id': { $exists: true }
|
|
223
|
+
// }
|
|
224
|
+
// }
|
|
225
|
+
// ],
|
|
215
226
|
];
|
|
216
227
|
exports.indexes = indexes;
|
|
217
228
|
/**
|
|
@@ -133,7 +133,7 @@ export declare class OrderRepo {
|
|
|
133
133
|
id: string;
|
|
134
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
|
-
acceptedOffers?:
|
|
136
|
+
acceptedOffers?: import("./mongoose/schemas/order").IAcceptedOfferInDoc[];
|
|
137
137
|
identifier?: string;
|
|
138
138
|
paymentMethodId?: string;
|
|
139
139
|
} & {
|
|
@@ -141,7 +141,7 @@ export declare class OrderRepo {
|
|
|
141
141
|
} & {
|
|
142
142
|
__v: number;
|
|
143
143
|
}, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<factory.order.IOrder, "id"> & {
|
|
144
|
-
acceptedOffers?:
|
|
144
|
+
acceptedOffers?: import("./mongoose/schemas/order").IAcceptedOfferInDoc[];
|
|
145
145
|
identifier?: string;
|
|
146
146
|
paymentMethodId?: string;
|
|
147
147
|
} & {
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -487,37 +487,6 @@ class OrderRepo {
|
|
|
487
487
|
}
|
|
488
488
|
return andConditions;
|
|
489
489
|
}
|
|
490
|
-
// OrderInTransactionリポジトリにて注文ドキュメントが生成されるように変更したのでもう不要
|
|
491
|
-
// /**
|
|
492
|
-
// * なければ作成する
|
|
493
|
-
// */
|
|
494
|
-
// public async createIfNotExist(order: IOrderWithoutAcceptedOffers & {
|
|
495
|
-
// acceptedOffers: factory.order.IAcceptedOffer[];
|
|
496
|
-
// }): Promise<void> {
|
|
497
|
-
// try {
|
|
498
|
-
// // 存在しなければ上書き
|
|
499
|
-
// // updateOneに変更(2024-01-14~)
|
|
500
|
-
// // await this.orderModel.findOneAndUpdate(
|
|
501
|
-
// await this.orderModel.updateOne(
|
|
502
|
-
// { orderNumber: order.orderNumber },
|
|
503
|
-
// { $setOnInsert: order },
|
|
504
|
-
// {
|
|
505
|
-
// // new: true,
|
|
506
|
-
// upsert: true
|
|
507
|
-
// }
|
|
508
|
-
// )
|
|
509
|
-
// .exec();
|
|
510
|
-
// } catch (error) {
|
|
511
|
-
// let throwsError = true;
|
|
512
|
-
// if (await isMongoDuplicateError(error)) {
|
|
513
|
-
// // すでにorderNumberが存在する場合ok
|
|
514
|
-
// throwsError = false;
|
|
515
|
-
// }
|
|
516
|
-
// if (throwsError) {
|
|
517
|
-
// throw error;
|
|
518
|
-
// }
|
|
519
|
-
// }
|
|
520
|
-
// }
|
|
521
490
|
/**
|
|
522
491
|
* 注文ステータスを変更する
|
|
523
492
|
*/
|