@chevre/domain 21.27.0-alpha.24 → 21.27.0-alpha.25
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/aggregation/aggregateEventReservation.ts +0 -1
- package/example/src/chevre/aggregation/aggregateOffersOnEvent.ts +1 -1
- package/example/src/chevre/aggregation/searchAggregateReservations.ts +1 -1
- package/lib/chevre/repo/aggregateReservation.d.ts +2 -4
- package/lib/chevre/repo/aggregateReservation.js +1 -2
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +0 -1
- package/lib/chevre/repo/mongoose/schemas/event.js +1 -1
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +3 -4
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -13
- package/lib/chevre/service/assetTransaction/pay.js +2 -6
- package/lib/chevre/service/event.js +12 -3
- package/lib/chevre/service/task/aggregateScreeningEvent.js +0 -2
- package/package.json +3 -3
|
@@ -21,7 +21,6 @@ async function main() {
|
|
|
21
21
|
await (await chevre.service.aggregation.createService()).event.aggregateScreeningEvent({
|
|
22
22
|
id: String(process.env.EVENT_ID)
|
|
23
23
|
})({
|
|
24
|
-
aggregateReservation: await chevre.repository.AggregateReservation.createInstance(mongoose.connection),
|
|
25
24
|
event: await chevre.repository.Event.createInstance(mongoose.connection),
|
|
26
25
|
stockHolder: await chevre.repository.StockHolder.createInstance(client, mongoose.connection),
|
|
27
26
|
offer: await chevre.repository.Offer.createInstance(mongoose.connection),
|
|
@@ -30,7 +30,7 @@ async function main() {
|
|
|
30
30
|
typeOf: chevre.factory.eventType.ScreeningEvent
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
|
-
['aggregateEntranceGate', '
|
|
33
|
+
['aggregateEntranceGate', 'aggregateOffer']
|
|
34
34
|
);
|
|
35
35
|
console.log('aggregateReservations:', aggregateReservations);
|
|
36
36
|
|
|
@@ -21,7 +21,7 @@ async function main() {
|
|
|
21
21
|
typeOf: chevre.factory.eventType.ScreeningEvent
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
-
['aggregateEntranceGate', '
|
|
24
|
+
['aggregateEntranceGate', 'aggregateOffer']
|
|
25
25
|
);
|
|
26
26
|
console.log('aggregateReservations:', aggregateReservations);
|
|
27
27
|
}
|
|
@@ -13,17 +13,15 @@ export interface IAggregateReservation {
|
|
|
13
13
|
startDate: Date;
|
|
14
14
|
};
|
|
15
15
|
aggregateEntranceGate?: factory.event.event.IAggregateEntranceGate;
|
|
16
|
-
aggregateReservation?: factory.event.event.IAggregateReservation;
|
|
17
16
|
aggregateOffer?: factory.event.event.IAggregateOffer;
|
|
18
17
|
}
|
|
19
18
|
export interface IUpdateAggregateReservationParams {
|
|
20
19
|
$set: {
|
|
21
|
-
aggregateReservation?: factory.event.event.IAggregateReservation;
|
|
22
20
|
aggregateOffer?: factory.event.event.IAggregateOffer;
|
|
23
21
|
aggregateEntranceGate?: factory.event.event.IAggregateEntranceGate;
|
|
24
22
|
};
|
|
25
23
|
}
|
|
26
|
-
type ISearchWithReservationForIdResult = Pick<IAggregateReservation, 'aggregateEntranceGate' | 'aggregateOffer'
|
|
24
|
+
type ISearchWithReservationForIdResult = Pick<IAggregateReservation, 'aggregateEntranceGate' | 'aggregateOffer'> & {
|
|
27
25
|
/**
|
|
28
26
|
* イベントID
|
|
29
27
|
*/
|
|
@@ -61,7 +59,7 @@ export declare class MongoRepository {
|
|
|
61
59
|
/**
|
|
62
60
|
* 予約集計を検索する
|
|
63
61
|
*/
|
|
64
|
-
searchWithReservationForId(params: ISearchConditions, inclusion: ('aggregateEntranceGate' | 'aggregateOffer'
|
|
62
|
+
searchWithReservationForId(params: ISearchConditions, inclusion: ('aggregateEntranceGate' | 'aggregateOffer')[]): Promise<ISearchWithReservationForIdResult[]>;
|
|
65
63
|
/**
|
|
66
64
|
* 予約集計を保管する
|
|
67
65
|
*/
|
|
@@ -82,8 +82,7 @@ class MongoRepository {
|
|
|
82
82
|
_id: 0,
|
|
83
83
|
id: '$reservationFor.id',
|
|
84
84
|
aggregateEntranceGate: 1,
|
|
85
|
-
aggregateOffer: 1
|
|
86
|
-
aggregateReservation: 1
|
|
85
|
+
aggregateOffer: 1
|
|
87
86
|
};
|
|
88
87
|
}
|
|
89
88
|
const sortByStartDate = (_a = params.sort) === null || _a === void 0 ? void 0 : _a['reservationFor.startDate'];
|
|
@@ -11,7 +11,6 @@ const schemaDefinition = {
|
|
|
11
11
|
typeOf: { type: String, required: true },
|
|
12
12
|
reservationFor: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
13
13
|
aggregateEntranceGate: mongoose_1.SchemaTypes.Mixed,
|
|
14
|
-
aggregateReservation: mongoose_1.SchemaTypes.Mixed,
|
|
15
14
|
aggregateOffer: mongoose_1.SchemaTypes.Mixed
|
|
16
15
|
};
|
|
17
16
|
const schemaOptions = {
|
|
@@ -46,7 +46,7 @@ const schemaDefinition = {
|
|
|
46
46
|
remainingAttendeeCapacity: { type: Number },
|
|
47
47
|
checkInCount: { type: Number },
|
|
48
48
|
attendeeCount: { type: Number },
|
|
49
|
-
aggregateEntranceGate:
|
|
49
|
+
// aggregateEntranceGate: SchemaTypes.Mixed, // 廃止(2024-03-29~)
|
|
50
50
|
aggregateReservation: mongoose_1.SchemaTypes.Mixed,
|
|
51
51
|
aggregateOffer: mongoose_1.SchemaTypes.Mixed,
|
|
52
52
|
coaInfo: mongoose_1.SchemaTypes.Mixed
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { MongoRepository as AggregateReservationRepo } from '../../../repo/aggregateReservation';
|
|
2
1
|
import { IMinimizedIndividualEvent, MongoRepository as EventRepo } from '../../../repo/event';
|
|
3
2
|
import type { MongoRepository as OfferRepo } from '../../../repo/offer';
|
|
4
3
|
import type { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
@@ -9,8 +8,7 @@ import type { MongoRepository as ReservationRepo } from '../../../repo/reservati
|
|
|
9
8
|
import type { StockHolderRepository as StockHolderRepo } from '../../../repo/stockHolder';
|
|
10
9
|
import type { MongoRepository as TaskRepo } from '../../../repo/task';
|
|
11
10
|
import * as factory from '../../../factory';
|
|
12
|
-
export
|
|
13
|
-
aggregateReservation: AggregateReservationRepo;
|
|
11
|
+
export interface IAggregateScreeningEventRepos {
|
|
14
12
|
event: EventRepo;
|
|
15
13
|
stockHolder: StockHolderRepo;
|
|
16
14
|
offer: OfferRepo;
|
|
@@ -20,7 +18,8 @@ export type IAggregateScreeningEventOperation<T> = (repos: {
|
|
|
20
18
|
product: ProductRepo;
|
|
21
19
|
reservation: ReservationRepo;
|
|
22
20
|
task: TaskRepo;
|
|
23
|
-
}
|
|
21
|
+
}
|
|
22
|
+
export type IAggregateScreeningEventOperation<T> = (repos: IAggregateScreeningEventRepos) => Promise<T>;
|
|
24
23
|
/**
|
|
25
24
|
* イベントデータをID指定で集計する
|
|
26
25
|
*/
|
|
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.aggregateByEvent = exports.aggregateScreeningEvent = void 0;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* イベントの予約集計サービス
|
|
15
15
|
*/
|
|
16
16
|
const createDebug = require("debug");
|
|
17
17
|
const moment = require("moment-timezone");
|
|
@@ -122,18 +122,6 @@ function aggregateByEvent(params) {
|
|
|
122
122
|
debug('update:', update);
|
|
123
123
|
// 保管
|
|
124
124
|
yield repos.event.updateAggregationById({ id: event.id }, update);
|
|
125
|
-
if (settings_1.settings.useAggregateOfferProjects.includes(params.event.project.id)) {
|
|
126
|
-
// aggregateReservationsにも保管(2024-03-25~)
|
|
127
|
-
yield repos.aggregateReservation.save({
|
|
128
|
-
project: event.project,
|
|
129
|
-
reservationFor: {
|
|
130
|
-
id: event.id,
|
|
131
|
-
typeOf: event.typeOf,
|
|
132
|
-
startDate: moment(event.startDate)
|
|
133
|
-
.toDate()
|
|
134
|
-
}
|
|
135
|
-
}, { $set: { aggregateReservation } });
|
|
136
|
-
}
|
|
137
125
|
yield onAggregated({ event })({
|
|
138
126
|
task: repos.task
|
|
139
127
|
});
|
|
@@ -40,16 +40,12 @@ function publishPaymentUrl(params, purposeAsTransaction) {
|
|
|
40
40
|
// 決済サービス確認
|
|
41
41
|
const paymentServiceId = getPaymentServiceId(params);
|
|
42
42
|
// 決済受入アクション生成(2024-03-28~)
|
|
43
|
-
const actionAttributes = Object.assign({ project: params.project, typeOf:
|
|
43
|
+
const actionAttributes = Object.assign({ project: params.project, typeOf: factory.actionType.AcceptAction, agent: params.agent, object: {
|
|
44
44
|
object: params.object,
|
|
45
45
|
transactionNumber,
|
|
46
46
|
typeOf: params.typeOf
|
|
47
47
|
} }, (typeof (purposeAsTransaction === null || purposeAsTransaction === void 0 ? void 0 : purposeAsTransaction.id) === 'string')
|
|
48
|
-
? {
|
|
49
|
-
purpose: Object.assign({ typeOf: factory.transactionType.PlaceOrder }, {
|
|
50
|
-
id: purposeAsTransaction.id
|
|
51
|
-
})
|
|
52
|
-
}
|
|
48
|
+
? { purpose: { typeOf: factory.transactionType.PlaceOrder, id: purposeAsTransaction.id } }
|
|
53
49
|
: undefined);
|
|
54
50
|
const action = yield repos.action.start(actionAttributes);
|
|
55
51
|
let result;
|
|
@@ -468,15 +468,24 @@ function createScreeningEventFromCOA(params) {
|
|
|
468
468
|
typeOf: 'WebAPI',
|
|
469
469
|
identifier: factory.service.webAPI.Identifier.COA
|
|
470
470
|
},
|
|
471
|
-
|
|
472
|
-
|
|
471
|
+
eligibleQuantity: {
|
|
472
|
+
typeOf: 'QuantitativeValue',
|
|
473
|
+
unitCode: factory.unitCode.C62,
|
|
474
|
+
maxValue: Number(params.performanceFromCOA.availableNum)
|
|
475
|
+
},
|
|
473
476
|
itemOffered: {
|
|
474
477
|
serviceOutput: {
|
|
475
478
|
reservedTicket: {
|
|
476
479
|
typeOf: 'Ticket',
|
|
477
|
-
ticketedSeat: { typeOf: factory.placeType.Seat }
|
|
480
|
+
ticketedSeat: { typeOf: factory.placeType.Seat } // 必ず指定席
|
|
478
481
|
}
|
|
479
482
|
}
|
|
483
|
+
},
|
|
484
|
+
seller: {
|
|
485
|
+
typeOf: factory.organizationType.Corporation,
|
|
486
|
+
id: params.seller.id,
|
|
487
|
+
// name: params.sellerFromDB.name,
|
|
488
|
+
makesOffer: []
|
|
480
489
|
}
|
|
481
490
|
};
|
|
482
491
|
const { additionalProperty, coaInfo } = createScreeningEventAdditionalPropertyFromCOA(params);
|
|
@@ -11,7 +11,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.call = void 0;
|
|
13
13
|
const factory = require("../../factory");
|
|
14
|
-
const aggregateReservation_1 = require("../../repo/aggregateReservation");
|
|
15
14
|
const event_1 = require("../../repo/event");
|
|
16
15
|
const offer_1 = require("../../repo/offer");
|
|
17
16
|
const offerCatalog_1 = require("../../repo/offerCatalog");
|
|
@@ -31,7 +30,6 @@ function call(data) {
|
|
|
31
30
|
throw new factory.errors.Argument('settings', 'redisClient required');
|
|
32
31
|
}
|
|
33
32
|
yield AggregationService.event.aggregateScreeningEvent(data)({
|
|
34
|
-
aggregateReservation: new aggregateReservation_1.MongoRepository(settings.connection),
|
|
35
33
|
event: new event_1.MongoRepository(settings.connection),
|
|
36
34
|
stockHolder: new stockHolder_1.StockHolderRepository(settings.redisClient, settings.connection),
|
|
37
35
|
offer: new offer_1.MongoRepository(settings.connection),
|
package/package.json
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/credential-providers": "3.433.0",
|
|
13
|
-
"@chevre/factory": "4.364.0
|
|
14
|
-
"@cinerino/sdk": "5.15.0
|
|
13
|
+
"@chevre/factory": "4.364.0",
|
|
14
|
+
"@cinerino/sdk": "5.15.0",
|
|
15
15
|
"@motionpicture/coa-service": "9.4.0",
|
|
16
16
|
"@motionpicture/gmo-service": "5.3.0",
|
|
17
17
|
"@sendgrid/mail": "6.4.0",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"postversion": "git push origin --tags",
|
|
111
111
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
112
112
|
},
|
|
113
|
-
"version": "21.27.0-alpha.
|
|
113
|
+
"version": "21.27.0-alpha.25"
|
|
114
114
|
}
|