@chevre/domain 23.1.0-alpha.3 → 23.1.0-alpha.31
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/acceptedPaymentMethodOffer/adminAcceptedPaymentMethodOffers.ts +68 -0
- package/example/src/chevre/actions/checkAcceptPayActions.ts +60 -0
- package/example/src/chevre/assetTransaction/checkPayTransactionsTicketToken.ts +67 -0
- package/example/src/chevre/assetTransaction/processReserve.ts +8 -3
- package/example/src/chevre/authorizeEventServiceOffer.ts +7 -5
- package/example/src/chevre/eventSeries/migrateEventSeriesUnacceptedPaymentMethod.ts +93 -0
- package/example/src/chevre/member/migrateMemberIdentifier.ts +99 -0
- package/example/src/chevre/place/checkSectionCount.ts +27 -0
- package/example/src/chevre/place/findSectionsByRoom.ts +50 -0
- package/example/src/chevre/project/unsetProjectSettings.ts +73 -0
- package/example/src/chevre/reIndex.ts +1 -2
- package/example/src/chevre/roles/{addAdminSellerEventIfNotExists.ts → addAdminSellerEventOfferIfNotExists.ts} +1 -1
- package/example/src/chevre/stockHolder/findSeatsBySection.ts +59 -0
- package/example/src/chevre/stockHolder/searchSeats.ts +2 -2
- package/lib/chevre/repo/acceptedPaymentMethod.d.ts +41 -0
- package/lib/chevre/repo/acceptedPaymentMethod.js +180 -0
- package/lib/chevre/repo/authorization.d.ts +3 -2
- package/lib/chevre/repo/authorization.js +13 -5
- package/lib/chevre/repo/event.d.ts +1 -35
- package/lib/chevre/repo/event.js +2 -102
- package/lib/chevre/repo/eventOffer.d.ts +1 -1
- package/lib/chevre/repo/eventOffer.js +16 -10
- package/lib/chevre/repo/member.d.ts +18 -1
- package/lib/chevre/repo/member.js +14 -8
- package/lib/chevre/repo/mongoose/schemas/acceptedPaymentMethod.d.ts +10 -0
- package/lib/chevre/repo/mongoose/schemas/acceptedPaymentMethod.js +97 -0
- package/lib/chevre/repo/mongoose/schemas/eventOffer.js +48 -35
- package/lib/chevre/repo/mongoose/schemas/member.js +10 -0
- package/lib/chevre/repo/place/seat.d.ts +24 -0
- package/lib/chevre/repo/place/seat.js +103 -21
- package/lib/chevre/repo/place/section.d.ts +20 -0
- package/lib/chevre/repo/place/section.js +47 -0
- package/lib/chevre/repo/ticket.d.ts +7 -1
- package/lib/chevre/repo/ticket.js +14 -1
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +15 -2
- package/lib/chevre/service/assetTransaction/pay/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/factory.js +8 -3
- package/lib/chevre/service/assetTransaction/pay/validateAcceptedPaymentMethodIfNeeded.d.ts +16 -0
- package/lib/chevre/service/assetTransaction/pay/validateAcceptedPaymentMethodIfNeeded.js +92 -0
- package/lib/chevre/service/assetTransaction/pay.d.ts +6 -1
- package/lib/chevre/service/assetTransaction/pay.js +6 -1
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +6 -0
- package/lib/chevre/service/assetTransaction/reserve/start.js +5 -1
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/fixExtendedEventOffer.d.ts +22 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/fixExtendedEventOffer.js +63 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateIssuedOfferIfExists.d.ts +7 -2
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateIssuedOfferIfExists.js +32 -32
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.js +10 -54
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/verifyTicketTokenAsNeeded.d.ts +23 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/verifyTicketTokenAsNeeded.js +62 -0
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.d.ts +36 -1
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +23 -27
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +0 -3
- package/lib/chevre/service/offer/event/authorize/factory.js +4 -3
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +43 -26
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +4 -0
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.js +4 -4
- package/lib/chevre/service/offer/event/authorize.d.ts +3 -0
- package/lib/chevre/service/offer/event/authorize.js +10 -5
- package/lib/chevre/service/offer/event/issueEventOfferTicket.d.ts +48 -0
- package/lib/chevre/service/offer/event/issueEventOfferTicket.js +123 -0
- package/lib/chevre/service/offer/event.d.ts +2 -1
- package/lib/chevre/service/offer/event.js +3 -1
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +9 -0
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.js +22 -11
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +19 -2
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +87 -9
- package/lib/chevre/service/payment/any/factory.d.ts +20 -3
- package/lib/chevre/service/payment/any/factory.js +26 -6
- package/lib/chevre/service/payment/any/publishPaymentUrl/fixTransactionNumberOnPublishPaymentUrl.d.ts +4 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl/fixTransactionNumberOnPublishPaymentUrl.js +15 -11
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.d.ts +6 -3
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +20 -28
- package/lib/chevre/service/payment/any.d.ts +5 -1
- package/lib/chevre/service/payment/any.js +22 -13
- package/lib/chevre/service/payment/factory.js +0 -5
- package/lib/chevre/service/payment/movieTicket/authorize.js +0 -5
- package/lib/chevre/service/task/authorizePayment.js +2 -0
- package/lib/chevre/service/task/publishPaymentUrl.js +4 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/publishCode.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +9 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.js +2 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +8 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.js +45 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validatePrice.d.ts +3 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validatePrice.js +38 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +2 -8
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +5 -35
- package/package.json +3 -3
- package/example/src/chevre/checkReplaceActions.ts +0 -65
- package/example/src/chevre/upsertManyEventsByAdditionalProperty.ts +0 -193
- package/lib/chevre/service/code.d.ts +0 -8
- package/lib/chevre/service/code.js +0 -7
|
@@ -30,7 +30,7 @@ class MemberRepo {
|
|
|
30
30
|
}
|
|
31
31
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
32
32
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
33
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
|
34
34
|
const andConditions = [];
|
|
35
35
|
const idEq = (_a = params.id) === null || _a === void 0 ? void 0 : _a.$eq;
|
|
36
36
|
if (typeof idEq === 'string') {
|
|
@@ -64,7 +64,11 @@ class MemberRepo {
|
|
|
64
64
|
if (Array.isArray(memberIdIn)) {
|
|
65
65
|
andConditions.push({ 'member.id': { $in: memberIdIn } });
|
|
66
66
|
}
|
|
67
|
-
const
|
|
67
|
+
const memberIdentifierEq = (_u = (_t = params.member) === null || _t === void 0 ? void 0 : _t.identifier) === null || _u === void 0 ? void 0 : _u.$eq;
|
|
68
|
+
if (typeof memberIdentifierEq === 'string') {
|
|
69
|
+
andConditions.push({ 'member.identifier': { $exists: true, $eq: memberIdentifierEq } });
|
|
70
|
+
}
|
|
71
|
+
const memberNameRegex = (_w = (_v = params.member) === null || _v === void 0 ? void 0 : _v.name) === null || _w === void 0 ? void 0 : _w.$regex;
|
|
68
72
|
if (typeof memberNameRegex === 'string' && memberNameRegex.length > 0) {
|
|
69
73
|
andConditions.push({
|
|
70
74
|
'member.name': {
|
|
@@ -73,7 +77,7 @@ class MemberRepo {
|
|
|
73
77
|
}
|
|
74
78
|
});
|
|
75
79
|
}
|
|
76
|
-
const memberHasRoleRoleNameEq = (
|
|
80
|
+
const memberHasRoleRoleNameEq = (_z = (_y = (_x = params.member) === null || _x === void 0 ? void 0 : _x.hasRole) === null || _y === void 0 ? void 0 : _y.roleName) === null || _z === void 0 ? void 0 : _z.$eq;
|
|
77
81
|
if (typeof memberHasRoleRoleNameEq === 'string') {
|
|
78
82
|
andConditions.push({
|
|
79
83
|
'member.hasRole.roleName': {
|
|
@@ -82,7 +86,7 @@ class MemberRepo {
|
|
|
82
86
|
}
|
|
83
87
|
});
|
|
84
88
|
}
|
|
85
|
-
const memberHasRoleRoleNameIn = (
|
|
89
|
+
const memberHasRoleRoleNameIn = (_2 = (_1 = (_0 = params.member) === null || _0 === void 0 ? void 0 : _0.hasRole) === null || _1 === void 0 ? void 0 : _1.roleName) === null || _2 === void 0 ? void 0 : _2.$in;
|
|
86
90
|
if (Array.isArray(memberHasRoleRoleNameIn)) {
|
|
87
91
|
andConditions.push({
|
|
88
92
|
'member.hasRole.roleName': {
|
|
@@ -110,7 +114,7 @@ class MemberRepo {
|
|
|
110
114
|
*/
|
|
111
115
|
searchCustomerMembers(params) {
|
|
112
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
117
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
114
118
|
if (typeof params.project.id !== 'string' || params.project.id === '') {
|
|
115
119
|
throw new factory.errors.ArgumentNull('project.id');
|
|
116
120
|
}
|
|
@@ -128,7 +132,8 @@ class MemberRepo {
|
|
|
128
132
|
}
|
|
129
133
|
},
|
|
130
134
|
id: Object.assign(Object.assign({}, (typeof ((_b = (_a = params.member) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq) === 'string') ? { $eq: params.member.id.$eq } : undefined), (Array.isArray((_d = (_c = params.member) === null || _c === void 0 ? void 0 : _c.id) === null || _d === void 0 ? void 0 : _d.$in)) ? { $in: params.member.id.$in } : undefined),
|
|
131
|
-
|
|
135
|
+
identifier: Object.assign({}, (typeof ((_f = (_e = params.member) === null || _e === void 0 ? void 0 : _e.identifier) === null || _f === void 0 ? void 0 : _f.$eq) === 'string') ? { $eq: params.member.identifier.$eq } : undefined),
|
|
136
|
+
name: Object.assign({}, (typeof ((_h = (_g = params.member) === null || _g === void 0 ? void 0 : _g.name) === null || _h === void 0 ? void 0 : _h.$regex) === 'string') ? { $regex: params.member.name.$regex } : undefined)
|
|
132
137
|
}
|
|
133
138
|
});
|
|
134
139
|
const projection = {
|
|
@@ -138,6 +143,7 @@ class MemberRepo {
|
|
|
138
143
|
// typeOf: 'WebApplication',
|
|
139
144
|
hasRole: '$member.hasRole',
|
|
140
145
|
id: '$member.id',
|
|
146
|
+
identifier: '$member.identifier',
|
|
141
147
|
member: '$member.member',
|
|
142
148
|
memberOf: '$member.memberOf',
|
|
143
149
|
name: '$member.name'
|
|
@@ -154,7 +160,7 @@ class MemberRepo {
|
|
|
154
160
|
},
|
|
155
161
|
{ $project: projection }
|
|
156
162
|
]);
|
|
157
|
-
if (typeof ((
|
|
163
|
+
if (typeof ((_j = params.sort) === null || _j === void 0 ? void 0 : _j['member.id']) === 'number') {
|
|
158
164
|
aggregate.sort(params.sort);
|
|
159
165
|
}
|
|
160
166
|
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
@@ -259,7 +265,7 @@ class MemberRepo {
|
|
|
259
265
|
'member.memberOf.id': { $eq: params.member.memberOf.id },
|
|
260
266
|
'member.memberOf.typeOf': { $eq: params.member.memberOf.typeOf }
|
|
261
267
|
}, {
|
|
262
|
-
$set: Object.assign(Object.assign(Object.assign({}, (Array.isArray(params.member.hasRole)) ? { 'member.hasRole': params.member.hasRole } : undefined), (typeof params.member.image === 'string') ? { 'member.image': params.member.image } : undefined), (typeof params.member.name === 'string') ? { 'member.name': params.member.name } : undefined
|
|
268
|
+
$set: Object.assign(Object.assign(Object.assign(Object.assign({}, (Array.isArray(params.member.hasRole)) ? { 'member.hasRole': params.member.hasRole } : undefined), (typeof params.member.image === 'string') ? { 'member.image': params.member.image } : undefined), (typeof params.member.name === 'string') ? { 'member.name': params.member.name } : undefined), (typeof params.member.identifier === 'string') ? { 'member.identifier': params.member.identifier } : undefined
|
|
263
269
|
// discontinue(2025-01-14~)
|
|
264
270
|
// ...(Array.isArray(params.member.member)) ? { 'member.member': params.member.member } : undefined
|
|
265
271
|
),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
|
+
import * as factory from '../../../factory';
|
|
3
|
+
type IDocType = factory.acceptedPaymentMethodOffer.IAcceptedPaymentMethodOffer;
|
|
4
|
+
type IModel = Model<IDocType>;
|
|
5
|
+
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
6
|
+
type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
|
|
7
|
+
declare const modelName = "AcceptedPaymentMethod";
|
|
8
|
+
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
9
|
+
declare function createSchema(): ISchema;
|
|
10
|
+
export { createSchema, IDocType, IModel, indexes, modelName };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.modelName = exports.indexes = void 0;
|
|
4
|
+
exports.createSchema = createSchema;
|
|
5
|
+
const mongoose_1 = require("mongoose");
|
|
6
|
+
const settings_1 = require("../../../settings");
|
|
7
|
+
const writeConcern_1 = require("../writeConcern");
|
|
8
|
+
const modelName = 'AcceptedPaymentMethod';
|
|
9
|
+
exports.modelName = modelName;
|
|
10
|
+
const schemaDefinition = {
|
|
11
|
+
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
12
|
+
seller: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
13
|
+
typeOf: { type: String, required: true },
|
|
14
|
+
identifier: { type: String, required: true },
|
|
15
|
+
itemOffered: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
16
|
+
validFrom: { type: Date, required: true },
|
|
17
|
+
validThrough: { type: Date, required: true },
|
|
18
|
+
acceptedPaymentMethod: { type: mongoose_1.SchemaTypes.Mixed, required: true }
|
|
19
|
+
// offeredBy: { type: SchemaTypes.Mixed, required: false }
|
|
20
|
+
};
|
|
21
|
+
const schemaOptions = {
|
|
22
|
+
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
23
|
+
autoCreate: false,
|
|
24
|
+
collection: 'acceptedPaymentMethods',
|
|
25
|
+
id: true,
|
|
26
|
+
read: settings_1.MONGO_READ_PREFERENCE,
|
|
27
|
+
writeConcern: writeConcern_1.writeConcern,
|
|
28
|
+
strict: true,
|
|
29
|
+
strictQuery: false,
|
|
30
|
+
timestamps: false,
|
|
31
|
+
versionKey: false,
|
|
32
|
+
toJSON: {
|
|
33
|
+
getters: false,
|
|
34
|
+
virtuals: false,
|
|
35
|
+
minimize: false,
|
|
36
|
+
versionKey: false
|
|
37
|
+
},
|
|
38
|
+
toObject: {
|
|
39
|
+
getters: false,
|
|
40
|
+
virtuals: true,
|
|
41
|
+
minimize: false,
|
|
42
|
+
versionKey: false
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const indexes = [
|
|
46
|
+
[
|
|
47
|
+
{ validFrom: 1 },
|
|
48
|
+
{ name: 'validFrom' }
|
|
49
|
+
],
|
|
50
|
+
[
|
|
51
|
+
{ validThrough: 1, validFrom: 1 },
|
|
52
|
+
{ name: 'validThrough' }
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
{
|
|
56
|
+
'project.id': 1,
|
|
57
|
+
'itemOffered.id': 1,
|
|
58
|
+
identifier: 1
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'uniqueByItemOfferedAndIdentifier',
|
|
62
|
+
unique: true
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
{ 'project.id': 1, validFrom: 1 },
|
|
67
|
+
{ name: 'projectId' }
|
|
68
|
+
],
|
|
69
|
+
[
|
|
70
|
+
{ 'seller.id': 1, validFrom: 1 },
|
|
71
|
+
{ name: 'sellerId' }
|
|
72
|
+
],
|
|
73
|
+
[
|
|
74
|
+
{ identifier: 1, validFrom: 1 },
|
|
75
|
+
{ name: 'identifier' }
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
{ 'itemOffered.id': 1, validFrom: 1 },
|
|
79
|
+
{ name: 'itemOfferedId' }
|
|
80
|
+
]
|
|
81
|
+
];
|
|
82
|
+
exports.indexes = indexes;
|
|
83
|
+
/**
|
|
84
|
+
* 対応決済方法オファースキーマ
|
|
85
|
+
*/
|
|
86
|
+
let schema;
|
|
87
|
+
function createSchema() {
|
|
88
|
+
if (schema === undefined) {
|
|
89
|
+
schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
|
|
90
|
+
if (settings_1.MONGO_AUTO_INDEX) {
|
|
91
|
+
indexes.forEach((indexParams) => {
|
|
92
|
+
schema === null || schema === void 0 ? void 0 : schema.index(...indexParams);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return schema;
|
|
97
|
+
}
|
|
@@ -44,41 +44,54 @@ const schemaOptions = {
|
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
const indexes = [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
47
|
+
[
|
|
48
|
+
{ validFrom: 1 },
|
|
49
|
+
{ name: 'validFrom' }
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
{ validThrough: 1, validFrom: 1 },
|
|
53
|
+
{ name: 'validThrough' }
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
{
|
|
57
|
+
'project.id': 1,
|
|
58
|
+
'itemOffered.id': 1,
|
|
59
|
+
identifier: 1
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'uniqueByItemOfferedAndIdentifier',
|
|
63
|
+
unique: true
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
[
|
|
67
|
+
{ 'project.id': 1, validFrom: 1 },
|
|
68
|
+
{ name: 'projectId' }
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
{ 'seller.id': 1, validFrom: 1 },
|
|
72
|
+
{ name: 'sellerId' }
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
{ identifier: 1, validFrom: 1 },
|
|
76
|
+
{ name: 'identifier' }
|
|
77
|
+
],
|
|
78
|
+
[
|
|
79
|
+
{ 'itemOffered.id': 1, validFrom: 1 },
|
|
80
|
+
{ name: 'itemOfferedId' }
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
{ 'availableAtOrFrom.identifier': 1, validFrom: 1 },
|
|
84
|
+
{ name: 'availableAtOrFrom' }
|
|
85
|
+
],
|
|
86
|
+
[
|
|
87
|
+
{ 'offeredBy.identifier': 1, validFrom: 1 },
|
|
88
|
+
{
|
|
89
|
+
name: 'offeredByIdentifier',
|
|
90
|
+
partialFilterExpression: {
|
|
91
|
+
'offeredBy.identifier': { $exists: true }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
]
|
|
82
95
|
];
|
|
83
96
|
exports.indexes = indexes;
|
|
84
97
|
/**
|
|
@@ -61,6 +61,16 @@ const indexes = [
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
],
|
|
64
|
+
[
|
|
65
|
+
{ 'project.id': 1, 'member.identifier': 1 }, // アプリケーションコード追加(2025-11-17~)
|
|
66
|
+
{
|
|
67
|
+
name: 'uniqueByMemberIdentifier',
|
|
68
|
+
unique: true,
|
|
69
|
+
partialFilterExpression: {
|
|
70
|
+
'member.identifier': { $exists: true }
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
],
|
|
64
74
|
[
|
|
65
75
|
{ 'project.id': 1, 'member.id': 1, 'member.memberOf.id': 1 },
|
|
66
76
|
{
|
|
@@ -79,6 +79,30 @@ export declare class SeatRepo {
|
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
81
|
}): Promise<factory.place.seat.IPlace[]>;
|
|
82
|
+
/**
|
|
83
|
+
* セクション指定の座席検索として再定義(2025-12-06~)
|
|
84
|
+
*/
|
|
85
|
+
findSeatsBySection(params: {
|
|
86
|
+
limit: number;
|
|
87
|
+
page: number;
|
|
88
|
+
projectId: string;
|
|
89
|
+
/**
|
|
90
|
+
* 販売者ID
|
|
91
|
+
*/
|
|
92
|
+
sellerId: string;
|
|
93
|
+
/**
|
|
94
|
+
* 施設コード
|
|
95
|
+
*/
|
|
96
|
+
movieTheaterCode: string;
|
|
97
|
+
/**
|
|
98
|
+
* ルームコード
|
|
99
|
+
*/
|
|
100
|
+
roomCode: string;
|
|
101
|
+
/**
|
|
102
|
+
* セクションコード
|
|
103
|
+
*/
|
|
104
|
+
sectionCode: string;
|
|
105
|
+
}, options: Pick<factory.place.seat.ISearchConditions, 'branchCode' | 'seatingType'>): Promise<Pick<factory.place.seat.IPlace, 'additionalProperty' | 'branchCode' | 'maximumAttendeeCapacity' | 'name' | 'seatingType'>[]>;
|
|
82
106
|
/**
|
|
83
107
|
* 座席区分集計検索
|
|
84
108
|
*/
|
|
@@ -39,30 +39,29 @@ class SeatRepo {
|
|
|
39
39
|
const includeSectionName = params['containedInPlace.name'] !== 0;
|
|
40
40
|
const includeSectionTypeOf = params['containedInPlace.typeOf'] !== 0;
|
|
41
41
|
const includeScreeningRooms = params['containedInPlace.containedInPlace'] !== 0;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
? {
|
|
51
|
-
containedInPlace: {
|
|
52
|
-
typeOf: '$typeOf',
|
|
53
|
-
branchCode: '$branchCode',
|
|
54
|
-
name: '$name',
|
|
42
|
+
/**
|
|
43
|
+
* containedInPlaceについて何かしたprojectするかどうか
|
|
44
|
+
*/
|
|
45
|
+
const includeContaindInPlace = includeSectionBranchCode || includeSectionName || includeSectionTypeOf || includeScreeningRooms;
|
|
46
|
+
const projectStage = Object.assign(Object.assign({ _id: 0, typeOf: '$containsPlace.containsPlace.typeOf', branchCode: '$containsPlace.containsPlace.branchCode', name: '$containsPlace.containsPlace.name', seatingType: '$containsPlace.containsPlace.seatingType', maximumAttendeeCapacity: '$containsPlace.containsPlace.maximumAttendeeCapacity' }, (includeContaindInPlace)
|
|
47
|
+
? {
|
|
48
|
+
containedInPlace: Object.assign(Object.assign(Object.assign(Object.assign({}, (includeSectionBranchCode) ? { branchCode: '$containsPlace.branchCode' } : undefined), (includeSectionName) ? { name: '$containsPlace.name' } : undefined), (includeSectionTypeOf) ? { typeOf: '$containsPlace.typeOf' } : undefined), (includeScreeningRooms)
|
|
49
|
+
? {
|
|
55
50
|
containedInPlace: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
typeOf: '$typeOf',
|
|
52
|
+
branchCode: '$branchCode',
|
|
53
|
+
name: '$name',
|
|
54
|
+
containedInPlace: {
|
|
55
|
+
id: '$containedInPlace.id',
|
|
56
|
+
typeOf: '$containedInPlace.typeOf',
|
|
57
|
+
branchCode: '$containedInPlace.branchCode',
|
|
58
|
+
name: '$containedInPlace.name'
|
|
59
|
+
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
additionalProperty: '$containsPlace.containsPlace.additionalProperty'
|
|
65
|
-
};
|
|
62
|
+
: undefined)
|
|
63
|
+
}
|
|
64
|
+
: undefined), { additionalProperty: '$containsPlace.containsPlace.additionalProperty' });
|
|
66
65
|
Object.keys(params)
|
|
67
66
|
.forEach((field) => {
|
|
68
67
|
if (typeof projectStage[field] === 'string') {
|
|
@@ -445,6 +444,89 @@ class SeatRepo {
|
|
|
445
444
|
.exec();
|
|
446
445
|
});
|
|
447
446
|
}
|
|
447
|
+
/**
|
|
448
|
+
* セクション指定の座席検索として再定義(2025-12-06~)
|
|
449
|
+
*/
|
|
450
|
+
findSeatsBySection(params, options) {
|
|
451
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
452
|
+
const { limit, page, projectId, sellerId, movieTheaterCode, roomCode, sectionCode } = params;
|
|
453
|
+
// まずルーム検索
|
|
454
|
+
const screeningRoomDoc = yield this.placeModel.findOne({
|
|
455
|
+
typeOf: { $eq: factory.placeType.ScreeningRoom },
|
|
456
|
+
'project.id': { $eq: projectId },
|
|
457
|
+
'parentOrganization.id': { $exists: true, $eq: sellerId },
|
|
458
|
+
'containedInPlace.branchCode': { $exists: true, $eq: movieTheaterCode },
|
|
459
|
+
branchCode: { $eq: roomCode }
|
|
460
|
+
}, { _id: 1 })
|
|
461
|
+
.lean()
|
|
462
|
+
.exec();
|
|
463
|
+
// console.log('screeningRoomDoc:', screeningRoomDoc);
|
|
464
|
+
if (screeningRoomDoc === null) {
|
|
465
|
+
return [];
|
|
466
|
+
}
|
|
467
|
+
const matchStageBeforeUnwind = {
|
|
468
|
+
$match: { _id: { $eq: screeningRoomDoc._id } }
|
|
469
|
+
};
|
|
470
|
+
const matchStages = SeatRepo.CREATE_MATCH_STAGES(Object.assign(Object.assign({}, options), { containedInPlace: {
|
|
471
|
+
branchCode: { $eq: sectionCode },
|
|
472
|
+
containedInPlace: {
|
|
473
|
+
containedInPlace: {}
|
|
474
|
+
}
|
|
475
|
+
} }), { filterTypeOf: false });
|
|
476
|
+
const pageMustBeOne = (typeof page === 'number' && page > 0) ? page : 1;
|
|
477
|
+
let skipStage;
|
|
478
|
+
let limitStage;
|
|
479
|
+
if (typeof limit === 'number' && limit > 0) {
|
|
480
|
+
skipStage = { $skip: limit * (pageMustBeOne - 1) };
|
|
481
|
+
limitStage = { $limit: limit };
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
throw new factory.errors.Argument('limit', 'must be number > 0');
|
|
485
|
+
}
|
|
486
|
+
const pipeline = [
|
|
487
|
+
// uniwind前はドキュメントの_id指定
|
|
488
|
+
matchStageBeforeUnwind,
|
|
489
|
+
{
|
|
490
|
+
$unwind: {
|
|
491
|
+
path: '$containsPlace'
|
|
492
|
+
// includeArrayIndex: 'sectionIndex'
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
$unwind: {
|
|
497
|
+
path: '$containsPlace.containsPlace'
|
|
498
|
+
// includeArrayIndex: 'seatIndex'
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
...matchStages,
|
|
502
|
+
{
|
|
503
|
+
$project: {
|
|
504
|
+
_id: 0,
|
|
505
|
+
branchCode: '$containsPlace.containsPlace.branchCode',
|
|
506
|
+
name: '$containsPlace.containsPlace.name',
|
|
507
|
+
seatingType: '$containsPlace.containsPlace.seatingType',
|
|
508
|
+
maximumAttendeeCapacity: '$containsPlace.containsPlace.maximumAttendeeCapacity',
|
|
509
|
+
additionalProperty: '$containsPlace.containsPlace.additionalProperty'
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
// {
|
|
513
|
+
// $sort: {
|
|
514
|
+
// // branchCode: factory.sortType.Ascending
|
|
515
|
+
// }
|
|
516
|
+
// },
|
|
517
|
+
skipStage,
|
|
518
|
+
limitStage
|
|
519
|
+
];
|
|
520
|
+
// console.log(pipeline);
|
|
521
|
+
return this.placeModel.aggregate(pipeline)
|
|
522
|
+
.option({
|
|
523
|
+
maxTimeMS: settings_1.MONGO_MAX_TIME_MS
|
|
524
|
+
// explain: true,
|
|
525
|
+
// hint: 'searchSeatsSort'
|
|
526
|
+
})
|
|
527
|
+
.exec();
|
|
528
|
+
});
|
|
529
|
+
}
|
|
448
530
|
/**
|
|
449
531
|
* 座席区分集計検索
|
|
450
532
|
*/
|
|
@@ -37,6 +37,26 @@ export declare class SectionRepo {
|
|
|
37
37
|
};
|
|
38
38
|
}, $unset: any): Promise<IUpdateSectionResult>;
|
|
39
39
|
searchScreeningRoomSections(searchConditions: factory.place.screeningRoomSection.ISearchConditions): Promise<IScreeningRoomSectionWithoutContainsPlace[]>;
|
|
40
|
+
/**
|
|
41
|
+
* ルーム指定のセクション検索として再定義(2025-12-07~)
|
|
42
|
+
*/
|
|
43
|
+
findSectionsByRoom(params: {
|
|
44
|
+
limit: number;
|
|
45
|
+
page: number;
|
|
46
|
+
projectId: string;
|
|
47
|
+
/**
|
|
48
|
+
* 販売者ID
|
|
49
|
+
*/
|
|
50
|
+
sellerId: string;
|
|
51
|
+
/**
|
|
52
|
+
* 施設コード
|
|
53
|
+
*/
|
|
54
|
+
movieTheaterCode: string;
|
|
55
|
+
/**
|
|
56
|
+
* ルームコード
|
|
57
|
+
*/
|
|
58
|
+
roomCode: string;
|
|
59
|
+
}): Promise<Pick<IScreeningRoomSectionWithoutContainsPlace, 'additionalProperty' | 'branchCode' | 'name'>[]>;
|
|
40
60
|
deleteScreeningRoomSection(screeningRoomSection: {
|
|
41
61
|
project: {
|
|
42
62
|
id: string;
|
|
@@ -248,6 +248,53 @@ class SectionRepo {
|
|
|
248
248
|
.exec();
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* ルーム指定のセクション検索として再定義(2025-12-07~)
|
|
253
|
+
*/
|
|
254
|
+
findSectionsByRoom(params
|
|
255
|
+
// options: Pick<
|
|
256
|
+
// factory.place.screeningRoomSection.ISearchConditions,
|
|
257
|
+
// 'branchCode'
|
|
258
|
+
// >
|
|
259
|
+
) {
|
|
260
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
261
|
+
const { limit, page, projectId, sellerId, movieTheaterCode, roomCode } = params;
|
|
262
|
+
const matchStageBeforeUnwind = {
|
|
263
|
+
$match: {
|
|
264
|
+
'project.id': { $eq: projectId },
|
|
265
|
+
'parentOrganization.id': { $exists: true, $eq: sellerId },
|
|
266
|
+
'containedInPlace.branchCode': { $exists: true, $eq: movieTheaterCode }, // 施設コード
|
|
267
|
+
branchCode: { $eq: roomCode } // ルームコード
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
const aggregate = this.placeModel.aggregate([
|
|
271
|
+
// uniwind前はドキュメントの_id指定
|
|
272
|
+
matchStageBeforeUnwind,
|
|
273
|
+
{ $unwind: '$containsPlace' },
|
|
274
|
+
// ...matchStages,
|
|
275
|
+
{
|
|
276
|
+
$project: {
|
|
277
|
+
_id: 0,
|
|
278
|
+
// typeOf: '$containsPlace.typeOf',
|
|
279
|
+
branchCode: '$containsPlace.branchCode',
|
|
280
|
+
name: '$containsPlace.name',
|
|
281
|
+
additionalProperty: '$containsPlace.additionalProperty'
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
]);
|
|
285
|
+
if (typeof limit === 'number' && limit > 0) {
|
|
286
|
+
const pageMustBePositive = (typeof page === 'number' && page > 0) ? page : 1;
|
|
287
|
+
aggregate.skip(limit * (pageMustBePositive - 1))
|
|
288
|
+
.limit(limit);
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
throw new factory.errors.Argument('limit', 'must be number > 0');
|
|
292
|
+
}
|
|
293
|
+
return aggregate
|
|
294
|
+
.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
295
|
+
.exec();
|
|
296
|
+
});
|
|
297
|
+
}
|
|
251
298
|
deleteScreeningRoomSection(screeningRoomSection) {
|
|
252
299
|
return __awaiter(this, void 0, void 0, function* () {
|
|
253
300
|
var _a;
|
|
@@ -38,5 +38,11 @@ export declare class TicketRepo {
|
|
|
38
38
|
* 承認コードからチケットを発行する
|
|
39
39
|
*/
|
|
40
40
|
issueByTicketToken(params: IIssueParams): Promise<Pick<ITicket, 'id'>>;
|
|
41
|
-
|
|
41
|
+
findTickets(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<ITicket[]>;
|
|
42
|
+
/**
|
|
43
|
+
* 発行日時を一定期間過ぎたチケットを削除する
|
|
44
|
+
*/
|
|
45
|
+
deleteTicketsByDateIssued(params: {
|
|
46
|
+
dateIssuedLt: Date;
|
|
47
|
+
}): Promise<void>;
|
|
42
48
|
}
|
|
@@ -69,7 +69,7 @@ class TicketRepo {
|
|
|
69
69
|
return { id: insertedId };
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
findTickets(params, inclusion) {
|
|
73
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
74
|
var _a;
|
|
75
75
|
const conditions = TicketRepo.CREATE_MONGO_CONDITIONS(params);
|
|
@@ -92,5 +92,18 @@ class TicketRepo {
|
|
|
92
92
|
.exec();
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* 発行日時を一定期間過ぎたチケットを削除する
|
|
97
|
+
*/
|
|
98
|
+
deleteTicketsByDateIssued(params) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
yield this.ticketModel.deleteMany({
|
|
101
|
+
dateIssued: {
|
|
102
|
+
$lt: params.dateIssuedLt
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
.exec();
|
|
106
|
+
});
|
|
107
|
+
}
|
|
95
108
|
}
|
|
96
109
|
exports.TicketRepo = TicketRepo;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* リポジトリ
|
|
3
3
|
*/
|
|
4
4
|
import type { AcceptedOfferRepo } from './repo/acceptedOffer';
|
|
5
|
+
import type { AcceptedPaymentMethodRepo } from './repo/acceptedPaymentMethod';
|
|
5
6
|
import type { AccountRepo } from './repo/account';
|
|
6
7
|
import type { AccountingReportRepo } from './repo/accountingReport';
|
|
7
8
|
import type { AccountTitleRepo } from './repo/accountTitle';
|
|
@@ -94,6 +95,10 @@ export type AcceptedOffer = AcceptedOfferRepo;
|
|
|
94
95
|
export declare namespace AcceptedOffer {
|
|
95
96
|
function createInstance(...params: ConstructorParameters<typeof AcceptedOfferRepo>): Promise<AcceptedOfferRepo>;
|
|
96
97
|
}
|
|
98
|
+
export type AcceptedPaymentMethod = AcceptedPaymentMethodRepo;
|
|
99
|
+
export declare namespace AcceptedPaymentMethod {
|
|
100
|
+
function createInstance(...params: ConstructorParameters<typeof AcceptedPaymentMethodRepo>): Promise<AcceptedPaymentMethodRepo>;
|
|
101
|
+
}
|
|
97
102
|
export type Account = AccountRepo;
|
|
98
103
|
export declare namespace Account {
|
|
99
104
|
function createInstance(...params: ConstructorParameters<typeof AccountRepo>): Promise<AccountRepo>;
|
package/lib/chevre/repository.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
exports.WebSite = exports.rateLimit = exports.Trip = exports.TransactionProcess = exports.TransactionNumber = exports.Transaction = exports.Ticket = exports.Telemetry = exports.Task = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductOffer = exports.ProductModel = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = exports.Permit = exports.Person = void 0;
|
|
12
|
+
exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentServiceChannel = exports.PaymentService = exports.Passport = exports.OwnershipInfo = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = exports.MovieTicketType = exports.Message = exports.MerchantReturnPolicy = exports.MemberProgram = exports.Member = exports.Issuer = exports.IdentityProvider = exports.Identity = exports.EventSeries = exports.EventSellerMakesOffer = exports.EventOffer = exports.Event = exports.EmailMessage = exports.CustomerType = exports.Customer = exports.Credentials = exports.CreativeWork = exports.ConfirmationNumber = exports.Comment = exports.Authorization = exports.CategoryCode = exports.AssetTransaction = exports.Aggregation = exports.AggregateReservation = exports.AggregateOrder = exports.AggregateOffer = exports.AdvanceBookingRequirement = exports.AdditionalProperty = exports.Action = exports.AccountTransaction = exports.AccountTitle = exports.AccountingReport = exports.Account = exports.AcceptedPaymentMethod = exports.AcceptedOffer = void 0;
|
|
13
|
+
exports.WebSite = exports.rateLimit = exports.Trip = exports.TransactionProcess = exports.TransactionNumber = exports.Transaction = exports.Ticket = exports.Telemetry = exports.Task = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductOffer = exports.ProductModel = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = exports.Permit = exports.Person = exports.paymentMethod = void 0;
|
|
14
14
|
var AcceptedOffer;
|
|
15
15
|
(function (AcceptedOffer) {
|
|
16
16
|
let repo;
|
|
@@ -24,6 +24,19 @@ var AcceptedOffer;
|
|
|
24
24
|
}
|
|
25
25
|
AcceptedOffer.createInstance = createInstance;
|
|
26
26
|
})(AcceptedOffer || (exports.AcceptedOffer = AcceptedOffer = {}));
|
|
27
|
+
var AcceptedPaymentMethod;
|
|
28
|
+
(function (AcceptedPaymentMethod) {
|
|
29
|
+
let repo;
|
|
30
|
+
function createInstance(...params) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
if (repo === undefined) {
|
|
33
|
+
repo = (yield Promise.resolve().then(() => require('./repo/acceptedPaymentMethod'))).AcceptedPaymentMethodRepo;
|
|
34
|
+
}
|
|
35
|
+
return new repo(...params);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
AcceptedPaymentMethod.createInstance = createInstance;
|
|
39
|
+
})(AcceptedPaymentMethod || (exports.AcceptedPaymentMethod = AcceptedPaymentMethod = {}));
|
|
27
40
|
var Account;
|
|
28
41
|
(function (Account) {
|
|
29
42
|
let repo;
|