@chevre/domain 21.25.0-alpha.17 → 21.25.0-alpha.18
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/service/aggregation/event/findEventOffers.d.ts +1 -1
- package/lib/chevre/service/aggregation/event/findEventOffers.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve/factory/price.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve.js +1 -1
- package/lib/chevre/service/offer/event/authorize.d.ts +2 -2
- package/lib/chevre/service/offer/event/authorize.js +7 -16
- package/lib/chevre/service/offer/event/cancel.d.ts +1 -1
- package/lib/chevre/service/offer/event/cancel.js +1 -1
- package/lib/chevre/service/offer/event/factory.d.ts +5 -5
- package/lib/chevre/service/offer/event/factory.js +6 -5
- package/lib/chevre/service/offer/event/processStartReserve4chevre.d.ts +3 -3
- package/lib/chevre/service/offer/event/processStartReserve4chevre.js +5 -9
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/offer/event/voidTransaction.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +2 -1
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +2 -1
- package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/factory.js +3 -2
- package/package.json +3 -3
|
@@ -4,7 +4,7 @@ import type { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCat
|
|
|
4
4
|
import type { MongoRepository as ProductRepo } from '../../../repo/product';
|
|
5
5
|
import * as factory from '../../../factory';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* 興行オファー検索
|
|
8
8
|
* NotFoundエラーをハンドリングする
|
|
9
9
|
*/
|
|
10
10
|
export declare function findEventOffers(params: {
|
|
@@ -112,7 +112,7 @@ function addReservations(params) {
|
|
|
112
112
|
availableOffers = params.preSearchedUnitPriceOffers;
|
|
113
113
|
}
|
|
114
114
|
else {
|
|
115
|
-
//
|
|
115
|
+
// 興行オファー検索
|
|
116
116
|
const searchEventTicketOffersResult = yield OfferService.event.searchEventTicketOffers({
|
|
117
117
|
ids: acceptedOfferIds,
|
|
118
118
|
event: { id: event.id },
|
|
@@ -19,7 +19,6 @@ import type { StockHolderRepository as StockHolderRepo } from '../../../repo/sto
|
|
|
19
19
|
import type { MongoRepository as TaskRepo } from '../../../repo/task';
|
|
20
20
|
import type { MongoRepository as TransactionRepo } from '../../../repo/transaction';
|
|
21
21
|
import type { RedisRepository as TransactionNumberRepo } from '../../../repo/transactionNumber';
|
|
22
|
-
import { IObjectWithoutDetail } from './factory';
|
|
23
22
|
interface IAuthorizeRepos {
|
|
24
23
|
action: ActionRepo;
|
|
25
24
|
assetTransaction: AssetTransactionRepo;
|
|
@@ -44,8 +43,9 @@ interface IAuthorizeRepos {
|
|
|
44
43
|
}
|
|
45
44
|
type IAuthorizeOperation<T> = (repos: IAuthorizeRepos) => Promise<T>;
|
|
46
45
|
type IAuthorizeOfferAction = factory.action.authorize.offer.eventService.IAction<factory.service.webAPI.Identifier>;
|
|
46
|
+
type IObjectWithoutDetail = factory.action.authorize.offer.eventService.IObjectWithoutDetail4chevre;
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* 興行オファー承認
|
|
49
49
|
*/
|
|
50
50
|
declare function authorize(params: {
|
|
51
51
|
project: {
|
|
@@ -17,11 +17,12 @@ const processStartReserve4chevre_1 = require("./processStartReserve4chevre");
|
|
|
17
17
|
const searchEventTicketOffers_1 = require("./searchEventTicketOffers");
|
|
18
18
|
const factory_1 = require("./factory");
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* 興行オファー承認
|
|
21
21
|
*/
|
|
22
22
|
function authorize(params) {
|
|
23
23
|
// tslint:disable-next-line:max-func-body-length
|
|
24
24
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
var _a;
|
|
25
26
|
const noOfferSpecified = params.noOfferSpecified === true;
|
|
26
27
|
const { transaction, event, bookingServiceIdentifire } = yield validateCreateRequest(params)({ event: repos.event, transaction: repos.transaction });
|
|
27
28
|
const { acceptedOffers, ticketOffers, unitPriceOffers } = yield validateAcceptedOffers({
|
|
@@ -49,24 +50,14 @@ function authorize(params) {
|
|
|
49
50
|
switch (bookingServiceIdentifire) {
|
|
50
51
|
// 実質使用する予定なしなので廃止(2022-05-12~)
|
|
51
52
|
// case factory.service.webAPI.Identifier.COA:
|
|
52
|
-
// const processStartReserve4coaResult = await processStartReserve4coa({ event, object: params.object });
|
|
53
|
-
// requestBody = processStartReserve4coaResult.requestBody;
|
|
54
|
-
// responseBody = processStartReserve4coaResult.responseBody;
|
|
55
53
|
// break;
|
|
56
54
|
case factory.service.webAPI.Identifier.Chevre:
|
|
57
|
-
const processStartReserveResult = yield (0, processStartReserve4chevre_1.processStartReserve4chevre)({
|
|
58
|
-
action,
|
|
59
|
-
event,
|
|
55
|
+
const processStartReserveResult = yield (0, processStartReserve4chevre_1.processStartReserve4chevre)(Object.assign({
|
|
56
|
+
// action,
|
|
57
|
+
acceptedOffer: acceptedOffers, event,
|
|
60
58
|
transactionNumber,
|
|
61
|
-
transaction,
|
|
62
|
-
|
|
63
|
-
ticketOffers,
|
|
64
|
-
unitPriceOffers,
|
|
65
|
-
validateEvent: params.validateEvent === true,
|
|
66
|
-
validateEventOfferPeriod: params.validateEventOfferPeriod === true,
|
|
67
|
-
useHoldStockByTransactionNumber: params.useHoldStockByTransactionNumber,
|
|
68
|
-
stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd
|
|
69
|
-
})(repos);
|
|
59
|
+
transaction, availableAtOrFrom: { id: params.store.id }, ticketOffers,
|
|
60
|
+
unitPriceOffers, validateEvent: params.validateEvent === true, validateEventOfferPeriod: params.validateEventOfferPeriod === true, useHoldStockByTransactionNumber: params.useHoldStockByTransactionNumber, stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd }, (typeof ((_a = params.object.broker) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? { broker: params.object.broker } : undefined))(repos);
|
|
70
61
|
acceptedOffers4result = processStartReserveResult.acceptedOffers4result;
|
|
71
62
|
// add orderInTransaction(2024-01-15~)
|
|
72
63
|
if (!noOfferSpecified) {
|
|
@@ -14,7 +14,7 @@ const factory = require("../../../factory");
|
|
|
14
14
|
const ReserveTransactionService = require("../../assetTransaction/reserve");
|
|
15
15
|
const any_1 = require("../any");
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* 興行オファー承認取消(apiから実行)
|
|
18
18
|
* 特定の承認アクションについて処理する
|
|
19
19
|
*/
|
|
20
20
|
function cancel(params) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as COA from '@motionpicture/coa-service';
|
|
2
2
|
import * as factory from '../../../factory';
|
|
3
3
|
import { IMinimizedIndividualEvent } from '../../../factory/event';
|
|
4
|
-
export type IReservationFor = factory.reservation.IReservationFor<factory.reservationType.EventReservation>;
|
|
5
|
-
export type IUnitPriceSpecification = factory.priceSpecification.IPriceSpecification<factory.priceSpecificationType.UnitPriceSpecification>;
|
|
6
|
-
export type IObjectWithoutDetail = factory.action.authorize.offer.eventService.IObjectWithoutDetail4chevre;
|
|
7
|
-
export type IObjectWithDetail = factory.action.authorize.offer.eventService.IObject<factory.service.webAPI.Identifier.Chevre>;
|
|
8
4
|
export declare function createReserveTransactionStartParams(params: {
|
|
9
5
|
project: {
|
|
10
6
|
id: string;
|
|
11
7
|
};
|
|
12
|
-
|
|
8
|
+
acceptedOffer: factory.action.authorize.offer.eventService.IAcceptedOffer<factory.service.webAPI.Identifier.Chevre>[];
|
|
9
|
+
event: {
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
broker?: factory.reservation.IBroker<factory.reservationType>;
|
|
13
13
|
transaction: factory.transaction.ITransaction<factory.transactionType>;
|
|
14
14
|
transactionNumber: string;
|
|
15
15
|
}): factory.assetTransaction.reserve.IStartParamsWithoutDetail;
|
|
@@ -6,9 +6,9 @@ const moment = require("moment");
|
|
|
6
6
|
const util_1 = require("util");
|
|
7
7
|
const factory = require("../../../factory");
|
|
8
8
|
function createReserveTransactionStartParams(params) {
|
|
9
|
-
var _a
|
|
10
|
-
const acceptedTicketOffersWithoutDetail = (Array.isArray(params.
|
|
11
|
-
? params.
|
|
9
|
+
var _a;
|
|
10
|
+
const acceptedTicketOffersWithoutDetail = (Array.isArray(params.acceptedOffer))
|
|
11
|
+
? params.acceptedOffer.map((o) => {
|
|
12
12
|
var _a, _b, _c, _d, _e;
|
|
13
13
|
const issuedBy = {
|
|
14
14
|
typeOf: params.transaction.seller.typeOf,
|
|
@@ -53,7 +53,7 @@ function createReserveTransactionStartParams(params) {
|
|
|
53
53
|
// }
|
|
54
54
|
// ]
|
|
55
55
|
},
|
|
56
|
-
object: Object.assign({ acceptedOffer: acceptedTicketOffersWithoutDetail, reservationFor: { id:
|
|
56
|
+
object: Object.assign({ acceptedOffer: acceptedTicketOffersWithoutDetail, reservationFor: { id: params.event.id } }, (params.broker !== undefined) ? { broker: params.broker } : undefined),
|
|
57
57
|
expires: moment(params.transaction.expires)
|
|
58
58
|
.add(1, 'month')
|
|
59
59
|
.toDate() // 余裕を持って
|
|
@@ -105,7 +105,8 @@ function createAuthorizeSeatReservationActionAttributes(params) {
|
|
|
105
105
|
},
|
|
106
106
|
purpose: { typeOf: transaction.typeOf, id: transaction.id },
|
|
107
107
|
instrument: {
|
|
108
|
-
typeOf: 'WebAPI',
|
|
108
|
+
// typeOf: 'WebAPI',
|
|
109
|
+
typeOf: factory.assetTransactionType.Reserve,
|
|
109
110
|
identifier: factory.service.webAPI.Identifier.Chevre,
|
|
110
111
|
transactionNumber: params.pendingTransaction.transactionNumber
|
|
111
112
|
}
|
|
@@ -15,10 +15,10 @@ import type { RedisRepository as OfferRateLimitRepo } from '../../../repo/rateLi
|
|
|
15
15
|
import type { MongoRepository as ReservationRepo } from '../../../repo/reservation';
|
|
16
16
|
import type { StockHolderRepository as StockHolderRepo } from '../../../repo/stockHolder';
|
|
17
17
|
import type { MongoRepository as TaskRepo } from '../../../repo/task';
|
|
18
|
-
type IAuthorizeOfferAction = factory.action.authorize.offer.eventService.IAction<factory.service.webAPI.Identifier>;
|
|
19
18
|
declare function processStartReserve4chevre(params: {
|
|
20
|
-
|
|
19
|
+
acceptedOffer: factory.action.authorize.offer.eventService.IAcceptedOffer<factory.service.webAPI.Identifier.Chevre>[];
|
|
21
20
|
event: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>;
|
|
21
|
+
broker?: factory.reservation.IBroker<factory.reservationType>;
|
|
22
22
|
transactionNumber?: string;
|
|
23
23
|
transaction: factory.transaction.ITransaction<factory.transactionType.PlaceOrder>;
|
|
24
24
|
availableAtOrFrom: {
|
|
@@ -48,6 +48,6 @@ declare function processStartReserve4chevre(params: {
|
|
|
48
48
|
task: TaskRepo;
|
|
49
49
|
assetTransaction: AssetTransactionRepo;
|
|
50
50
|
}) => Promise<{
|
|
51
|
-
acceptedOffers4result:
|
|
51
|
+
acceptedOffers4result: factory.action.authorize.offer.eventService.IResultAcceptedOffer[];
|
|
52
52
|
}>;
|
|
53
53
|
export { processStartReserve4chevre };
|
|
@@ -16,11 +16,10 @@ const CodeService = require("../../code");
|
|
|
16
16
|
const factory_1 = require("./factory");
|
|
17
17
|
function processStartReserve4chevre(params) {
|
|
18
18
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
const action = params.action;
|
|
19
|
+
// const action = params.action;
|
|
20
20
|
const event = params.event;
|
|
21
21
|
const transactionNumber = params.transactionNumber;
|
|
22
22
|
const transaction = params.transaction;
|
|
23
|
-
// let requestBody: factory.assetTransaction.reserve.IStartParamsWithoutDetail;
|
|
24
23
|
let responseBody;
|
|
25
24
|
let acceptedOffers4result = [];
|
|
26
25
|
if (typeof transactionNumber !== 'string') {
|
|
@@ -28,13 +27,10 @@ function processStartReserve4chevre(params) {
|
|
|
28
27
|
throw new factory.errors.ServiceUnavailable('Unexpected error occurred: reserve transactionNumber not found');
|
|
29
28
|
}
|
|
30
29
|
// 予約取引開始
|
|
31
|
-
const startParams = (0, factory_1.createReserveTransactionStartParams)({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
transactionNumber
|
|
36
|
-
});
|
|
37
|
-
// requestBody = startParams;
|
|
30
|
+
const startParams = (0, factory_1.createReserveTransactionStartParams)(Object.assign({ project: transaction.project,
|
|
31
|
+
// object: <IObjectWithDetail>action.object,
|
|
32
|
+
acceptedOffer: params.acceptedOffer, event: { id: event.id }, transaction,
|
|
33
|
+
transactionNumber }, (params.broker !== undefined) ? { broker: params.broker } : undefined));
|
|
38
34
|
const startParamObject = yield validateObjectWithoutDetail(startParams)(repos);
|
|
39
35
|
// 予約取引開始
|
|
40
36
|
const startReserveTransactionResult = yield ReserveTransactionService.start(Object.assign(Object.assign({}, startParams), { object: startParamObject, preSearchedEvent: event, preSearchedTicketOffers: params.ticketOffers, preSearchedUnitPriceOffers: params.unitPriceOffers, availableAtOrFrom: { id: params.availableAtOrFrom.id }, validateEvent: params.validateEvent, validateEventOfferPeriod: params.validateEventOfferPeriod, validateAppliesToMovieTicket: true, useHoldStockByTransactionNumber: params.useHoldStockByTransactionNumber, stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd }))(repos);
|
|
@@ -19,7 +19,7 @@ interface IVoidTransactionRepos {
|
|
|
19
19
|
transaction: TransactionRepo;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* 興行オファー承認取消(タスクから実行)
|
|
23
23
|
* 取引中の承認アクション全てについて処理する
|
|
24
24
|
*/
|
|
25
25
|
export declare function voidTransaction(params: factory.task.IData<factory.taskName.VoidReserveTransaction>): (repos: IVoidTransactionRepos) => Promise<void>;
|
|
@@ -101,7 +101,8 @@ function authorize(params) {
|
|
|
101
101
|
const { price, eligibleMonetaryAmount } = (0, factory_1.offers2resultPrice)(acceptedOffers);
|
|
102
102
|
const acceptedOffers4result = (0, factory_1.responseBody2acceptedOffers4result)({
|
|
103
103
|
responseBody: params.result.responseBody,
|
|
104
|
-
object: action.object,
|
|
104
|
+
// object: action.object,
|
|
105
|
+
acceptedOffer: acceptedOffers,
|
|
105
106
|
event: screeningEvent,
|
|
106
107
|
seller: transaction.seller,
|
|
107
108
|
bookingTime: moment(action.startDate)
|
|
@@ -84,7 +84,8 @@ function changeOffers(params) {
|
|
|
84
84
|
const { price, eligibleMonetaryAmount } = (0, factory_1.offers2resultPrice)(acceptedOffers);
|
|
85
85
|
const acceptedOffers4result = (0, factory_1.responseBody2acceptedOffers4result)({
|
|
86
86
|
responseBody: updTmpReserveSeatResult,
|
|
87
|
-
object: authorizeAction.object,
|
|
87
|
+
// object: authorizeAction.object,
|
|
88
|
+
acceptedOffer: acceptedOffers,
|
|
88
89
|
event: screeningEvent,
|
|
89
90
|
seller: transaction.seller,
|
|
90
91
|
bookingTime: moment(authorizeAction.startDate)
|
|
@@ -22,7 +22,7 @@ type IResultAcceptedOffer = factory.action.authorize.offer.eventService.IResultA
|
|
|
22
22
|
*/
|
|
23
23
|
export declare function responseBody2acceptedOffers4result(params: {
|
|
24
24
|
responseBody: factory.action.authorize.offer.eventService.IResponseBody<factory.service.webAPI.Identifier.COA>;
|
|
25
|
-
|
|
25
|
+
acceptedOffer: factory.action.authorize.offer.eventService.IAcceptedOffer<factory.service.webAPI.Identifier.COA>[];
|
|
26
26
|
event: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>;
|
|
27
27
|
seller: Pick<factory.transaction.placeOrder.ISeller, 'typeOf' | 'name'>;
|
|
28
28
|
bookingTime: Date;
|
|
@@ -43,7 +43,8 @@ function createAuthorizeSeatReservationActionAttributes(params) {
|
|
|
43
43
|
},
|
|
44
44
|
purpose: { typeOf: transaction.typeOf, id: transaction.id },
|
|
45
45
|
instrument: {
|
|
46
|
-
typeOf: 'WebAPI',
|
|
46
|
+
// typeOf: 'WebAPI',
|
|
47
|
+
typeOf: 'COAReserveTransaction',
|
|
47
48
|
identifier: factory.service.webAPI.Identifier.COA,
|
|
48
49
|
transactionNumber: params.pendingTransaction.transactionNumber
|
|
49
50
|
}
|
|
@@ -77,7 +78,7 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
77
78
|
// tslint:disable-next-line:max-func-body-length
|
|
78
79
|
acceptedOffers4result.push(...params.responseBody.listTmpReserve.map((tmpReserve, index) => {
|
|
79
80
|
var _a, _b, _c, _d;
|
|
80
|
-
const requestedOffer = params.
|
|
81
|
+
const requestedOffer = params.acceptedOffer.find((o) => {
|
|
81
82
|
var _a, _b, _c, _d;
|
|
82
83
|
return ((_d = (_c = (_b = (_a = o.itemOffered) === null || _a === void 0 ? void 0 : _a.serviceOutput) === null || _b === void 0 ? void 0 : _b.reservedTicket) === null || _c === void 0 ? void 0 : _c.ticketedSeat) === null || _d === void 0 ? void 0 : _d.seatNumber) === tmpReserve.seatNum
|
|
83
84
|
&& o.itemOffered.serviceOutput.reservedTicket.ticketedSeat.seatSection === tmpReserve.seatSection;
|
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.360.0
|
|
14
|
-
"@cinerino/sdk": "5.13.0
|
|
13
|
+
"@chevre/factory": "4.360.0",
|
|
14
|
+
"@cinerino/sdk": "5.13.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.25.0-alpha.
|
|
113
|
+
"version": "21.25.0-alpha.18"
|
|
114
114
|
}
|