@chevre/domain 24.0.0-alpha.80 → 24.0.0-alpha.82
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/errorHandler.d.ts +5 -0
- package/lib/chevre/errorHandler.js +26 -4
- package/lib/chevre/repo/accountingReport.js +2 -25
- package/lib/chevre/repo/aggregateOffer.js +11 -36
- package/lib/chevre/repo/event.js +2 -37
- package/lib/chevre/repo/eventSeries.js +0 -144
- package/lib/chevre/repo/message.js +1 -3
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +0 -1
- package/lib/chevre/repo/offer/unitPriceInCatalog.js +1 -1
- package/lib/chevre/repo/order.js +2 -4
- package/lib/chevre/repo/ownershipInfo.js +2 -4
- package/lib/chevre/repo/passport.js +1 -1
- package/lib/chevre/repo/pendingReservation.js +2 -35
- package/lib/chevre/repo/task.js +5 -7
- package/lib/chevre/repo/transactionNumberCounter.js +4 -6
- package/lib/chevre/repository.d.ts +0 -13
- package/lib/chevre/repository.js +1 -26
- package/lib/chevre/service/aggregation/event/importFromCOA.js +4 -8
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateAcceptedPaymentMethodIfNeeded.js +15 -23
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +0 -2
- package/lib/chevre/service/assetTransaction/reserve/start.js +0 -1
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.d.ts +0 -3
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +1 -11
- package/lib/chevre/service/event.js +4 -10
- package/lib/chevre/service/notification/triggerWebhook.js +43 -48
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +0 -2
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -2
- package/lib/chevre/service/offer/event/importFromCOA/factory.js +0 -12
- package/lib/chevre/service/offer/event/importFromCOA.js +5 -16
- package/lib/chevre/service/offer/event/issueEventOfferTicket.d.ts +1 -3
- package/lib/chevre/service/offer/event/issueEventOfferTicket.js +11 -13
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.js +5 -15
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +0 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +1 -12
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/validateAcceptedOffers.js +0 -15
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +2 -5
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +2 -3
- package/lib/chevre/service/offer/factory.js +6 -2
- package/lib/chevre/service/payment/creditCard/authorize/handleAuthorizeError.js +2 -7
- package/lib/chevre/service/payment/creditCard/gmoError.d.ts +1 -31
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +2 -2
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +1 -1
- package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket/processSeatInfoSync.js +2 -2
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket/processSeatInfoSync.js +2 -2
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket/processSeatInfoSyncCancel.js +1 -2
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +10 -3
- package/lib/chevre/service/reserveCOA/cancelReservation.js +12 -16
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +0 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +0 -6
- package/lib/chevre/service/task/onResourceDeleted.js +0 -2
- package/lib/chevre/service/task/onResourceUpdated.js +0 -2
- package/lib/chevre/service/taskHandler.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +26 -32
- package/lib/chevre/service/transaction/placeOrder/confirm.js +2 -4
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +1 -1
- package/lib/chevre/service/transaction/returnOrder.js +2 -5
- package/package.json +3 -3
- package/lib/chevre/repo/mongoose/schemas/productOffer.d.ts +0 -14
- package/lib/chevre/repo/mongoose/schemas/productOffer.js +0 -108
- package/lib/chevre/repo/place/busStop.d.ts +0 -27
- package/lib/chevre/repo/place/busStop.js +0 -169
- package/lib/chevre/repo/productOffer.d.ts +0 -52
- package/lib/chevre/repo/productOffer.js +0 -209
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.d.ts +0 -16
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.js +0 -129
|
@@ -122,11 +122,15 @@ function createCompoundPriceSpec4event(params) {
|
|
|
122
122
|
priceComponent
|
|
123
123
|
};
|
|
124
124
|
// 必要な属性のみに限定(2023-02-24~)
|
|
125
|
-
const { acceptedPaymentMethod, name, description, alternateName, color, typeOf, id, availability, category, eligibleMembershipType, eligibleSeatingType,
|
|
125
|
+
const { acceptedPaymentMethod, name, description, alternateName, color, typeOf, id, availability, category, eligibleMembershipType, eligibleSeatingType,
|
|
126
|
+
// eligibleMonetaryAmount, // discontinue(2026-04-19~)
|
|
127
|
+
eligibleSubReservation, priceCurrency, validFrom, validThrough, validRateLimit, additionalProperty, identifier, itemOffered, offerIndex, parentOffer } = params.offer;
|
|
126
128
|
return {
|
|
127
129
|
name, description, alternateName, color, typeOf, id,
|
|
128
130
|
category,
|
|
129
|
-
eligibleMembershipType, eligibleSeatingType,
|
|
131
|
+
eligibleMembershipType, eligibleSeatingType,
|
|
132
|
+
// eligibleMonetaryAmount, // discontinue(2026-04-19~)
|
|
133
|
+
eligibleSubReservation,
|
|
130
134
|
priceCurrency,
|
|
131
135
|
validFrom, validThrough, validRateLimit, additionalProperty,
|
|
132
136
|
identifier, itemOffered,
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.handleAuthorizeError = handleAuthorizeError;
|
|
7
|
-
const
|
|
4
|
+
const gmo_service_1 = require("@motionpicture/gmo-service");
|
|
8
5
|
const http_status_1 = require("http-status");
|
|
9
6
|
const factory_1 = require("../../../../factory");
|
|
10
|
-
const debug = (0, debug_1.default)('chevre-domain:service:payment');
|
|
11
7
|
function handleAuthorizeError(error) {
|
|
12
|
-
debug('handling creditCard authorizeError:', error);
|
|
13
8
|
let handledError = error;
|
|
14
|
-
if (error
|
|
9
|
+
if (error instanceof gmo_service_1.GMO.error.badRequest.GMOBadRequestError) {
|
|
15
10
|
if (Array.isArray(error.errors) && error.errors.length > 0) {
|
|
16
11
|
const gmoErrors = error.errors;
|
|
17
12
|
// 流量制限オーバーエラーの場合
|
|
@@ -8,34 +8,4 @@ declare enum GMOErrorInfo {
|
|
|
8
8
|
*/
|
|
9
9
|
JobCodeNotAcceptable = "E01050004"
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* エラー番号
|
|
14
|
-
*/
|
|
15
|
-
errorNumber: string;
|
|
16
|
-
/**
|
|
17
|
-
* コード
|
|
18
|
-
*/
|
|
19
|
-
code: string;
|
|
20
|
-
/**
|
|
21
|
-
* 詳細コード
|
|
22
|
-
*/
|
|
23
|
-
info: GMOErrorInfo | string;
|
|
24
|
-
/**
|
|
25
|
-
* 状態
|
|
26
|
-
*/
|
|
27
|
-
state: string;
|
|
28
|
-
/**
|
|
29
|
-
* 課金対象
|
|
30
|
-
*/
|
|
31
|
-
billing: string;
|
|
32
|
-
/**
|
|
33
|
-
* エラー内容と加盟店側の対処の方法
|
|
34
|
-
*/
|
|
35
|
-
content: string;
|
|
36
|
-
/**
|
|
37
|
-
* ユーザへ表示するメッセージ例
|
|
38
|
-
*/
|
|
39
|
-
userMessage: string;
|
|
40
|
-
}
|
|
41
|
-
export { GMOErrorInfo, IGMOError };
|
|
11
|
+
export { GMOErrorInfo };
|
|
@@ -133,7 +133,7 @@ function processAlterTran(params) {
|
|
|
133
133
|
let throwsError = true;
|
|
134
134
|
if (purpose.typeOf === factory_1.factory.transactionType.PlaceOrder) {
|
|
135
135
|
// handle notFoundError as searchTradeResult(2025-02-20~)
|
|
136
|
-
if (error
|
|
136
|
+
if (error instanceof gmo_service_1.GMO.error.badRequest.GMOBadRequestError) {
|
|
137
137
|
if (Array.isArray(error.errors) && error.errors.length > 0) {
|
|
138
138
|
const gmoErrors = error.errors;
|
|
139
139
|
// 指定されたIDとパスワードの取引が存在しません。
|
|
@@ -201,7 +201,7 @@ function processAlterTran(params) {
|
|
|
201
201
|
catch (error) {
|
|
202
202
|
let throwsError = true;
|
|
203
203
|
// 未決済(3D 登録済)->取消をトライするとE01050004エラーとなるが、この場合何もする必要はない(2024-01-09~)
|
|
204
|
-
if (error
|
|
204
|
+
if (error instanceof gmo_service_1.GMO.error.badRequest.GMOBadRequestError) {
|
|
205
205
|
if (Array.isArray(error.errors) && error.errors.length === 1
|
|
206
206
|
&& error.errors[0].info === gmoError_1.GMOErrorInfo.JobCodeNotAcceptable) {
|
|
207
207
|
if (status === gmo_service_1.GMO.factory.util.Status.Authenticated
|
|
@@ -26,7 +26,7 @@ async function searchGMOTrade(params, settings) {
|
|
|
26
26
|
catch (error) {
|
|
27
27
|
// searchTradeでのエラーをハンドリング(2024-04-08~)
|
|
28
28
|
let throwsError = true;
|
|
29
|
-
if (error
|
|
29
|
+
if (error instanceof gmo_service_1.GMO.error.badRequest.GMOBadRequestError) {
|
|
30
30
|
if (Array.isArray(error.errors) && error.errors.length > 0) {
|
|
31
31
|
const gmoErrors = error.errors;
|
|
32
32
|
// 指定されたIDとパスワードの取引が存在しません。
|
|
@@ -73,7 +73,7 @@ function voidTransaction(params) {
|
|
|
73
73
|
catch (error) {
|
|
74
74
|
// searchTradeでのエラーをハンドリング(2024-01-27~)
|
|
75
75
|
let throwsError = true;
|
|
76
|
-
if (error
|
|
76
|
+
if (error instanceof gmo_service_1.GMO.error.badRequest.GMOBadRequestError) {
|
|
77
77
|
if (Array.isArray(error.errors) && error.errors.length > 0) {
|
|
78
78
|
const gmoErrors = error.errors;
|
|
79
79
|
// 指定されたIDとパスワードの取引が存在しません。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processSeatInfoSync = processSeatInfoSync;
|
|
4
|
+
const sdk_1 = require("@surfrock/sdk");
|
|
4
5
|
const http_status_1 = require("http-status");
|
|
5
|
-
const errorHandler_1 = require("../../../../errorHandler");
|
|
6
6
|
const factory_1 = require("../factory");
|
|
7
7
|
function processSeatInfoSync(params) {
|
|
8
8
|
return async (repos) => {
|
|
@@ -14,7 +14,7 @@ function processSeatInfoSync(params) {
|
|
|
14
14
|
catch (error) {
|
|
15
15
|
let throwsError = true;
|
|
16
16
|
// 「既に存在する興行システム座席予約番号が入力されました」の場合、着券済なのでok
|
|
17
|
-
if (error
|
|
17
|
+
if (error instanceof sdk_1.Surfrock.RequestError) {
|
|
18
18
|
if (error.code === http_status_1.status.BAD_REQUEST && error.message === factory_1.MovieticketReserveRequestErrorMessage.AlreadyPaid) {
|
|
19
19
|
seatInfoSyncResult = error;
|
|
20
20
|
throwsError = false;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processSeatInfoSync = processSeatInfoSync;
|
|
4
|
+
const sdk_1 = require("@surfrock/sdk");
|
|
4
5
|
const http_status_1 = require("http-status");
|
|
5
|
-
const errorHandler_1 = require("../../../../errorHandler");
|
|
6
6
|
const factory_1 = require("../../../../factory");
|
|
7
7
|
const factory_2 = require("../factory");
|
|
8
8
|
function processSeatInfoSync(params) {
|
|
@@ -16,7 +16,7 @@ function processSeatInfoSync(params) {
|
|
|
16
16
|
catch (error) {
|
|
17
17
|
let throwsError = true;
|
|
18
18
|
// 「存在しない興行会社システム座席予約番号が入力されました」の場合、取消済なのでok
|
|
19
|
-
if (error
|
|
19
|
+
if (error instanceof sdk_1.Surfrock.RequestError) {
|
|
20
20
|
if (error.code === http_status_1.status.BAD_REQUEST && error.message === factory_2.MovieticketReserveRequestErrorMessage.NotFound) {
|
|
21
21
|
seatInfoSyncResult = error;
|
|
22
22
|
throwsError = false;
|
package/lib/chevre/service/payment/movieTicket/refundMovieTicket/processSeatInfoSyncCancel.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.processSeatInfoSyncCancel = processSeatInfoSyncCancel;
|
|
4
4
|
const sdk_1 = require("@surfrock/sdk");
|
|
5
5
|
const http_status_1 = require("http-status");
|
|
6
|
-
const errorHandler_1 = require("../../../../errorHandler");
|
|
7
6
|
function processSeatInfoSyncCancel(params) {
|
|
8
7
|
return async (repos) => {
|
|
9
8
|
let seatInfoSyncCancelResult;
|
|
@@ -13,7 +12,7 @@ function processSeatInfoSyncCancel(params) {
|
|
|
13
12
|
}
|
|
14
13
|
catch (error) {
|
|
15
14
|
let throwsError = true;
|
|
16
|
-
if (error
|
|
15
|
+
if (error instanceof sdk_1.Surfrock.RequestError) {
|
|
17
16
|
const surfrockRequestError = error;
|
|
18
17
|
if (surfrockRequestError.code === http_status_1.status.BAD_REQUEST) {
|
|
19
18
|
const firstSoapServeError = surfrockRequestError.errors?.at(0);
|
|
@@ -123,16 +123,23 @@ function refundMovieTicket(params, options) {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
catch (error) {
|
|
126
|
-
let message =
|
|
126
|
+
let message = (error instanceof Error) ? error.message : String(error);
|
|
127
127
|
message += `決済ID:${paymentMethodId}`; // エラー通知先で情報を読み取りやすくするために、messageに情報付加
|
|
128
128
|
try {
|
|
129
|
-
const actionError = {
|
|
129
|
+
const actionError = {
|
|
130
|
+
...(error instanceof Error) ? error : {},
|
|
131
|
+
message: message,
|
|
132
|
+
name: (error instanceof Error) ? error.name : 'UnknownError'
|
|
133
|
+
};
|
|
130
134
|
await repos.actions.refund.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
|
|
131
135
|
}
|
|
132
136
|
catch (__) {
|
|
133
137
|
// 失敗したら仕方ない
|
|
134
138
|
}
|
|
135
|
-
const handledError = (0, errorHandler_1.handleMvtkReserveError)({
|
|
139
|
+
const handledError = (0, errorHandler_1.handleMvtkReserveError)({
|
|
140
|
+
...(error instanceof Error) ? error : {},
|
|
141
|
+
message: message
|
|
142
|
+
});
|
|
136
143
|
throw handledError;
|
|
137
144
|
}
|
|
138
145
|
// アクションとしてはFailedだが後続処理を実行するケースに対応(2024-03-21~)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cancelPendingReservation = cancelPendingReservation;
|
|
4
|
-
const http_status_1 = require("http-status");
|
|
5
4
|
const factory_1 = require("../../factory");
|
|
6
5
|
const factory_2 = require("./factory");
|
|
6
|
+
const errorHandler_1 = require("../../errorHandler");
|
|
7
7
|
function createCancelPendingReservationAction(params) {
|
|
8
8
|
const { object, instrument, project } = params;
|
|
9
9
|
return {
|
|
@@ -31,21 +31,17 @@ function cancelPendingReservation(params) {
|
|
|
31
31
|
catch (error) {
|
|
32
32
|
let deleted = false;
|
|
33
33
|
// COAサービスエラーの場合ハンドリング
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
project: { id: params.project.id }
|
|
46
|
-
});
|
|
47
|
-
deleted = true;
|
|
48
|
-
}
|
|
34
|
+
if ((0, errorHandler_1.isCOAClientError)(error)) {
|
|
35
|
+
// すでに取消済の場合こうなるので、okとする
|
|
36
|
+
if (error.message === '座席取消失敗') {
|
|
37
|
+
recipe = (0, factory_2.processCancelPendingCOAReserveResult2recipe)({
|
|
38
|
+
processCancelPendingCOAReserveResult: {
|
|
39
|
+
delTmpReserveArgs,
|
|
40
|
+
delTmpReserveResult: { ...error, message: error.message }
|
|
41
|
+
},
|
|
42
|
+
project: { id: params.project.id }
|
|
43
|
+
});
|
|
44
|
+
deleted = true;
|
|
49
45
|
}
|
|
50
46
|
}
|
|
51
47
|
if (!deleted) {
|
|
@@ -6,7 +6,6 @@ import type { MemberRepo } from '../../../repo/member';
|
|
|
6
6
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
7
7
|
import type { MovieTheaterRepo } from '../../../repo/place/movieTheater';
|
|
8
8
|
import type { ScreeningRoomRepo } from '../../../repo/place/screeningRoom';
|
|
9
|
-
import type { ProductOfferRepo } from '../../../repo/productOffer';
|
|
10
9
|
export declare function deleteResourcesBySeller(params: {
|
|
11
10
|
project: {
|
|
12
11
|
id: string;
|
|
@@ -21,5 +20,4 @@ export declare function deleteResourcesBySeller(params: {
|
|
|
21
20
|
movieTheater: MovieTheaterRepo;
|
|
22
21
|
screeningRoom: ScreeningRoomRepo;
|
|
23
22
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
24
|
-
productOffer: ProductOfferRepo;
|
|
25
23
|
}) => Promise<void>;
|
|
@@ -57,15 +57,9 @@ function deleteResourcesBySeller(params) {
|
|
|
57
57
|
project: { id: params.project.id },
|
|
58
58
|
parentOrganization: { id: sellerId }
|
|
59
59
|
});
|
|
60
|
-
// プロダクトオファー削除(2025-10-02~)
|
|
61
|
-
const deleteProductOfferResult = await repos.productOffer.deleteProductOffersBySeller({
|
|
62
|
-
project: { id: params.project.id },
|
|
63
|
-
offeredBy: { id: sellerId }
|
|
64
|
-
});
|
|
65
60
|
deleteResult = {
|
|
66
61
|
deleteMemberResult, deletePaymentServiceProviderResult,
|
|
67
62
|
deleteEventOfferResult,
|
|
68
|
-
deleteProductOfferResult,
|
|
69
63
|
deleteEventResult, deleteEventSeriesResult, deleteScreeningRoomResult, deleteMovieTheaterResult
|
|
70
64
|
};
|
|
71
65
|
}
|
|
@@ -18,7 +18,6 @@ const movieTheater_1 = require("../../repo/place/movieTheater");
|
|
|
18
18
|
const screeningRoom_1 = require("../../repo/place/screeningRoom");
|
|
19
19
|
const product_1 = require("../../repo/product");
|
|
20
20
|
const productModel_1 = require("../../repo/productModel");
|
|
21
|
-
const productOffer_1 = require("../../repo/productOffer");
|
|
22
21
|
const setting_1 = require("../../repo/setting");
|
|
23
22
|
const task_1 = require("../../repo/task");
|
|
24
23
|
const deleteResourcesByAggregateOffer_1 = require("./onResourceDeleted/deleteResourcesByAggregateOffer");
|
|
@@ -53,7 +52,6 @@ function call(params) {
|
|
|
53
52
|
screeningRoom: new screeningRoom_1.ScreeningRoomRepo(connection),
|
|
54
53
|
product: new product_1.ProductRepo(connection),
|
|
55
54
|
productModel: new productModel_1.ProductModelRepo(connection),
|
|
56
|
-
productOffer: new productOffer_1.ProductOfferRepo(connection),
|
|
57
55
|
setting: new setting_1.SettingRepo(connection),
|
|
58
56
|
task: new task_1.TaskRepo(connection)
|
|
59
57
|
});
|
|
@@ -21,7 +21,6 @@ const movieTheater_1 = require("../../repo/place/movieTheater");
|
|
|
21
21
|
const screeningRoom_1 = require("../../repo/place/screeningRoom");
|
|
22
22
|
const product_1 = require("../../repo/product");
|
|
23
23
|
const productModel_1 = require("../../repo/productModel");
|
|
24
|
-
const productOffer_1 = require("../../repo/productOffer");
|
|
25
24
|
const setting_1 = require("../../repo/setting");
|
|
26
25
|
const task_1 = require("../../repo/task");
|
|
27
26
|
const onAggregateOfferUpdated_1 = require("./onResourceUpdated/onAggregateOfferUpdated");
|
|
@@ -53,7 +52,6 @@ function call(data) {
|
|
|
53
52
|
screeningRoom: new screeningRoom_1.ScreeningRoomRepo(connection),
|
|
54
53
|
product: new product_1.ProductRepo(connection),
|
|
55
54
|
productModel: new productModel_1.ProductModelRepo(connection),
|
|
56
|
-
productOffer: new productOffer_1.ProductOfferRepo(connection),
|
|
57
55
|
setting: new setting_1.SettingRepo(connection),
|
|
58
56
|
task: new task_1.TaskRepo(connection)
|
|
59
57
|
});
|
|
@@ -100,7 +100,6 @@ function executeTask(task, next) {
|
|
|
100
100
|
}, (typeof next === 'function') ? next : undefined);
|
|
101
101
|
}
|
|
102
102
|
catch (error) {
|
|
103
|
-
debug('service.task.execute throwed an error. task:', task.name, task.id, 'error:', error?.name, error?.message);
|
|
104
103
|
await (0, onOperationFailed_1.onOperationFailed)({
|
|
105
104
|
task, now, error,
|
|
106
105
|
...(typeof next === 'function') ? { next } : undefined
|
|
@@ -36,38 +36,32 @@ eventReservationAcceptedOffers, payTransactions, customer) {
|
|
|
36
36
|
debug('processing validateMovieTicket... movieTicketPaymentMethodTypes:', movieTicketPaymentMethodTypes);
|
|
37
37
|
if (Array.isArray(movieTicketPaymentMethodTypes) && movieTicketPaymentMethodTypes.length > 0) {
|
|
38
38
|
movieTicketPaymentMethodTypes.forEach((paymentMethodType) => {
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
(0, validateMovieTicket_1.validateMovieTicket)(paymentMethodType, { id: transaction.id }, authorizedMovieTickets, eventReservationAcceptedOffers);
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
debug('validateMovieTicket throwed an error. transaction:', transaction.id, 'paymentMethodType:', paymentMethodType, 'message:', error.message);
|
|
69
|
-
throw error;
|
|
70
|
-
}
|
|
39
|
+
const authorizeMovieTicketActions = authorizePaymentActions.filter((a) => {
|
|
40
|
+
const resultAsInvoice = (Array.isArray(a.result))
|
|
41
|
+
// ? a.result.find(({ typeOf }) => typeOf === factory.action.authorize.paymentMethod.any.ResultType.Payment)
|
|
42
|
+
? a.result[0]
|
|
43
|
+
: undefined;
|
|
44
|
+
return resultAsInvoice?.issuedThrough.typeOf === factory_1.factory.service.paymentService.PaymentServiceType.MovieTicket
|
|
45
|
+
// 決済方法区分は必ず存在するはず(2023-08-15~)
|
|
46
|
+
&& resultAsInvoice.paymentMethodAsObject?.typeOf === paymentMethodType;
|
|
47
|
+
});
|
|
48
|
+
// 決済承認アクションobject.movieTicketsではなく、payTransaction.object参照で再実装(2024-06-20~)
|
|
49
|
+
const authorizedMovieTickets = [];
|
|
50
|
+
// authorizeMovieTicketActions.forEach((a) => {
|
|
51
|
+
// authorizedMovieTickets.push(...(Array.isArray(a.object.movieTickets)) ? a.object.movieTickets : []);
|
|
52
|
+
// });
|
|
53
|
+
// 決済承認アクションのinstrument依存をobject依存へ変更(2025-12-14~)
|
|
54
|
+
const payTransactionNumbers = authorizeMovieTicketActions.map((authorizeAction) => authorizeAction.object.paymentMethodId);
|
|
55
|
+
// const payTransactionNumbers = authorizeMovieTicketActions.map(({ instrument }) => instrument.transactionNumber);
|
|
56
|
+
payTransactions.filter(({ object }) => payTransactionNumbers.includes(object.paymentMethodId))
|
|
57
|
+
.forEach(({ object }) => {
|
|
58
|
+
if (Array.isArray(object.paymentMethod.movieTickets)) {
|
|
59
|
+
authorizedMovieTickets.push(...object.paymentMethod.movieTickets);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
debug(authorizedMovieTickets.length, 'movie tickets authorized', 'transaction:', transaction.id);
|
|
63
|
+
// validateMovieTicket(paymentMethodType, { id: transaction.id }, authorizePaymentActions, eventReservationAcceptedOffers);
|
|
64
|
+
(0, validateMovieTicket_1.validateMovieTicket)(paymentMethodType, { id: transaction.id }, authorizedMovieTickets, eventReservationAcceptedOffers);
|
|
71
65
|
});
|
|
72
66
|
}
|
|
73
67
|
// 決済URLが発行されている場合、検証
|
|
@@ -168,12 +168,10 @@ function confirm(params, options) {
|
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
catch (error) {
|
|
171
|
-
if (await (0, errorHandler_1.
|
|
171
|
+
if (await (0, errorHandler_1.isMongoDuplicateError)(error)) {
|
|
172
172
|
// 万が一同一注文番号で確定しようとすると、MongoDBでE11000 duplicate key errorが発生する
|
|
173
173
|
// message: 'E11000 duplicate key error collection: prodttts.transactions index:result.order.orderNumber_1 dup key:...',
|
|
174
|
-
|
|
175
|
-
throw new factory_1.factory.errors.AlreadyInUse('transaction', ['result.order.orderNumber']);
|
|
176
|
-
}
|
|
174
|
+
throw new factory_1.factory.errors.AlreadyInUse('transaction', ['result.order.orderNumber']);
|
|
177
175
|
}
|
|
178
176
|
throw error;
|
|
179
177
|
}
|
|
@@ -18,7 +18,7 @@ function fixCustomer(params) {
|
|
|
18
18
|
formattedTelephone = phoneUtil.format(phoneNumber, google_libphonenumber_1.PhoneNumberFormat.E164);
|
|
19
19
|
}
|
|
20
20
|
catch (error) {
|
|
21
|
-
throw new factory_1.factory.errors.Argument('telephone', error.message);
|
|
21
|
+
throw new factory_1.factory.errors.Argument('telephone', (error instanceof Error) ? error.message : String(error));
|
|
22
22
|
}
|
|
23
23
|
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
24
24
|
typeOf: params.typeOf,
|
|
@@ -40,12 +40,9 @@ function start(params) {
|
|
|
40
40
|
returnOrderTransaction = await repos.returnOrder.startReturnOrder(returnOrderAttributes);
|
|
41
41
|
}
|
|
42
42
|
catch (error) {
|
|
43
|
-
if (await (0, errorHandler_1.
|
|
43
|
+
if (await (0, errorHandler_1.isMongoDuplicateError)(error)) {
|
|
44
44
|
// 同一取引に対して返品取引を作成しようとすると、MongoDBでE11000 duplicate key errorが発生する
|
|
45
|
-
|
|
46
|
-
if (error.code === errorHandler_1.MongoErrorCode.DuplicateKey) {
|
|
47
|
-
throw new factory_1.factory.errors.Argument('orderNumber', 'Already returned');
|
|
48
|
-
}
|
|
45
|
+
throw new factory_1.factory.errors.Argument('orderNumber', 'Already returned');
|
|
49
46
|
}
|
|
50
47
|
throw error;
|
|
51
48
|
}
|
package/package.json
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "8.0.0-alpha.
|
|
14
|
+
"@chevre/factory": "8.0.0-alpha.4",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
|
-
"@motionpicture/gmo-service": "6.0.0",
|
|
16
|
+
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
18
18
|
"@surfrock/sdk": "2.0.0",
|
|
19
19
|
"debug": "4.4.3",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"postversion": "git push origin --tags",
|
|
92
92
|
"prepublishOnly": "npm run clean && npm run build"
|
|
93
93
|
},
|
|
94
|
-
"version": "24.0.0-alpha.
|
|
94
|
+
"version": "24.0.0-alpha.82"
|
|
95
95
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
|
-
import { factory } from '../../../factory';
|
|
3
|
-
import { IVirtuals } from '../virtuals';
|
|
4
|
-
type IDocType = Omit<factory.productOffer.IProductOffer, 'acceptedPaymentMethod' | 'validForMemberTier'> & {
|
|
5
|
-
acceptedPaymentMethod?: factory.productOffer.IAcceptedPaymentMethod;
|
|
6
|
-
validForMemberTier?: factory.productOffer.IValidForMemberTier;
|
|
7
|
-
};
|
|
8
|
-
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
9
|
-
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
10
|
-
type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
|
|
11
|
-
declare const modelName = "ProductOffer";
|
|
12
|
-
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
13
|
-
declare function createSchema(): ISchema;
|
|
14
|
-
export { createSchema, IDocType, IModel, indexes, modelName };
|
|
@@ -1,108 +0,0 @@
|
|
|
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 = 'ProductOffer';
|
|
9
|
-
exports.modelName = modelName;
|
|
10
|
-
const schemaDefinition = {
|
|
11
|
-
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
12
|
-
typeOf: { type: String, required: true },
|
|
13
|
-
identifier: { type: String, required: true },
|
|
14
|
-
itemOffered: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
15
|
-
offeredBy: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
16
|
-
availability: { type: String, required: true },
|
|
17
|
-
validFrom: { type: Date, required: true },
|
|
18
|
-
validThrough: { type: Date, required: true },
|
|
19
|
-
// availableAtOrFrom: { type: SchemaTypes.Mixed, required: false },
|
|
20
|
-
validForMemberTier: { type: mongoose_1.SchemaTypes.Mixed, required: false },
|
|
21
|
-
acceptedPaymentMethod: { type: mongoose_1.SchemaTypes.Mixed, required: false }
|
|
22
|
-
};
|
|
23
|
-
const schemaOptions = {
|
|
24
|
-
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
25
|
-
autoCreate: false,
|
|
26
|
-
collection: 'productOffers',
|
|
27
|
-
id: true,
|
|
28
|
-
read: settings_1.MONGO_READ_PREFERENCE,
|
|
29
|
-
writeConcern: writeConcern_1.writeConcern,
|
|
30
|
-
strict: true,
|
|
31
|
-
strictQuery: false,
|
|
32
|
-
timestamps: false,
|
|
33
|
-
versionKey: false,
|
|
34
|
-
toJSON: {
|
|
35
|
-
getters: false,
|
|
36
|
-
virtuals: false,
|
|
37
|
-
minimize: false,
|
|
38
|
-
versionKey: false
|
|
39
|
-
},
|
|
40
|
-
toObject: {
|
|
41
|
-
getters: false,
|
|
42
|
-
virtuals: true,
|
|
43
|
-
minimize: false,
|
|
44
|
-
versionKey: false
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const indexes = [
|
|
48
|
-
[
|
|
49
|
-
{ validFrom: 1 },
|
|
50
|
-
{ name: 'validFrom' }
|
|
51
|
-
],
|
|
52
|
-
[
|
|
53
|
-
{
|
|
54
|
-
'project.id': 1,
|
|
55
|
-
'itemOffered.identifier': 1,
|
|
56
|
-
identifier: 1
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
name: 'uniqueByItemOfferedAndIdentifier',
|
|
60
|
-
unique: true
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
[
|
|
64
|
-
{ 'project.id': 1, validFrom: 1 },
|
|
65
|
-
{ name: 'projectId' }
|
|
66
|
-
],
|
|
67
|
-
[
|
|
68
|
-
{ identifier: 1, validFrom: 1 },
|
|
69
|
-
{ name: 'identifier' }
|
|
70
|
-
],
|
|
71
|
-
[
|
|
72
|
-
{ 'itemOffered.identifier': 1, validFrom: 1 },
|
|
73
|
-
{ name: 'itemOfferedIdentifier' }
|
|
74
|
-
],
|
|
75
|
-
[
|
|
76
|
-
{ 'offeredBy.id': 1, validFrom: 1 },
|
|
77
|
-
{ name: 'offeredById' }
|
|
78
|
-
],
|
|
79
|
-
[
|
|
80
|
-
{ validThrough: 1, validFrom: 1 },
|
|
81
|
-
{ name: 'validThrough' }
|
|
82
|
-
],
|
|
83
|
-
[
|
|
84
|
-
{ 'validForMemberTier.identifier': 1, validFrom: 1 },
|
|
85
|
-
{
|
|
86
|
-
name: 'validForMemberTierIdentifier',
|
|
87
|
-
partialFilterExpression: {
|
|
88
|
-
'validForMemberTier.identifier': { $exists: true }
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
];
|
|
93
|
-
exports.indexes = indexes;
|
|
94
|
-
/**
|
|
95
|
-
* プロダクトオファー(汎用的なオファー設定)スキーマ
|
|
96
|
-
*/
|
|
97
|
-
let schema;
|
|
98
|
-
function createSchema() {
|
|
99
|
-
if (schema === undefined) {
|
|
100
|
-
schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
|
|
101
|
-
if (settings_1.MONGO_AUTO_INDEX) {
|
|
102
|
-
indexes.forEach((indexParams) => {
|
|
103
|
-
schema?.index(...indexParams);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return schema;
|
|
108
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Connection, FilterQuery } from 'mongoose';
|
|
2
|
-
import { factory } from '../../factory';
|
|
3
|
-
/**
|
|
4
|
-
* ターミナルリポジトリ
|
|
5
|
-
*/
|
|
6
|
-
export declare class BusStopRepo {
|
|
7
|
-
private readonly civicStructureModel;
|
|
8
|
-
constructor(connection: Connection);
|
|
9
|
-
static CREATE_BUS_STOP_MONGO_CONDITIONS(params: factory.place.busStop.ISearchConditions): FilterQuery<import("@chevre/factory/lib/chevre/place/busStop").IPlace>[];
|
|
10
|
-
saveBusStop(params: factory.place.busStop.IPlace): Promise<factory.place.busStop.IPlace>;
|
|
11
|
-
findBusStopByBranchCode(params: {
|
|
12
|
-
project: {
|
|
13
|
-
id: string;
|
|
14
|
-
};
|
|
15
|
-
branchCode: string;
|
|
16
|
-
}): Promise<factory.place.movieTheater.IPlace>;
|
|
17
|
-
searchBusStops(params: factory.place.busStop.ISearchConditions): Promise<factory.place.busStop.IPlace[]>;
|
|
18
|
-
findBusStopById(params: {
|
|
19
|
-
id: string;
|
|
20
|
-
}, projection?: any): Promise<factory.place.busStop.IPlace>;
|
|
21
|
-
deleteBusStopById(params: {
|
|
22
|
-
project: {
|
|
23
|
-
id: string;
|
|
24
|
-
};
|
|
25
|
-
id: string;
|
|
26
|
-
}): Promise<void>;
|
|
27
|
-
}
|