@chevre/domain 22.9.0-alpha.26 → 22.9.0-alpha.29
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/repo/action.d.ts +8 -5
- package/lib/chevre/repo/mongoose/schemas/action.js +18 -0
- package/lib/chevre/repo/reservation.d.ts +1 -1
- package/lib/chevre/repo/seller.d.ts +8 -8
- package/lib/chevre/repo/task.d.ts +5 -1
- package/lib/chevre/repo/transaction.d.ts +5 -5
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay.d.ts +2 -1
- package/lib/chevre/service/assetTransaction/pay.js +3 -1
- package/lib/chevre/service/assetTransaction/refund/potentialActions.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/refund/potentialActions.js +18 -5
- package/lib/chevre/service/assetTransaction/reserve/start.js +6 -4
- package/lib/chevre/service/notification.js +1 -1
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.js +4 -1
- package/lib/chevre/service/payment/any/factory.d.ts +2 -12
- package/lib/chevre/service/payment/any/onPayActionCompleted.js +3 -2
- package/lib/chevre/service/payment/any/onPaymentStatusChanged.d.ts +2 -2
- package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.js +3 -2
- package/lib/chevre/service/payment/creditCard/factory.d.ts +1 -0
- package/lib/chevre/service/payment/creditCard/factory.js +2 -2
- package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +3 -4
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +111 -60
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +2 -1
- package/lib/chevre/service/payment/movieTicket/voidTransaction.js +3 -0
- package/lib/chevre/service/reserve/cancelReservation.js +17 -23
- package/lib/chevre/service/reserve/checkInReservation.d.ts +3 -0
- package/lib/chevre/service/reserve/checkInReservation.js +4 -4
- package/lib/chevre/service/reserve/confirmReservation.js +1 -1
- package/lib/chevre/service/reserve/factory.js +11 -7
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.d.ts +2 -0
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +14 -9
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +14 -8
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.d.ts +3 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +8 -7
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +14 -9
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +13 -8
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.d.ts +2 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +13 -8
- package/lib/chevre/service/task/deletePerson.js +38 -37
- package/lib/chevre/service/task/onAuthorizationCreated.js +4 -3
- package/lib/chevre/service/task/payment/refundByTask.js +3 -1
- package/package.json +2 -2
|
@@ -2,7 +2,10 @@ import { factory as surfrockFactory } from '@surfrock/sdk';
|
|
|
2
2
|
import { Connection, FilterQuery, UpdateQuery } from 'mongoose';
|
|
3
3
|
import * as factory from '../factory';
|
|
4
4
|
export type IAction4transaction<T extends factory.actionType.AcceptAction | factory.actionType.AuthorizeAction> = T extends factory.actionType.AcceptAction ? factory.action.accept.coaOffer.IAction | factory.action.accept.pay.IAction : T extends factory.actionType.AuthorizeAction ? (factory.action.authorize.offer.eventService.IAction | factory.action.authorize.offer.moneyTransfer.IAction | factory.action.authorize.offer.product.IAction | factory.action.authorize.paymentMethod.any.IAction) : never;
|
|
5
|
-
export type IAction<T extends factory.actionType> = T extends factory.actionType.OrderAction ? factory.action.trade.order.IAction : T extends factory.actionType.AcceptAction ? IAction4transaction<factory.actionType.AcceptAction> : T extends factory.actionType.AuthorizeAction ? factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>> : T extends factory.actionType.CheckAction ? (factory.action.check.paymentMethod.movieTicket.IAction | factory.action.check.token.IAction) : T extends factory.actionType.MoneyTransfer ? factory.action.transfer.moneyTransfer.IAction : T extends factory.actionType.ReplaceAction ? factory.action.update.replace.IAction<factory.action.update.replace.IAttributes<any, any>> : T extends factory.actionType.InformAction ? factory.action.interact.inform.IAction<
|
|
5
|
+
export type IAction<T extends factory.actionType> = T extends factory.actionType.OrderAction ? factory.action.trade.order.IAction : T extends factory.actionType.AcceptAction ? IAction4transaction<factory.actionType.AcceptAction> : T extends factory.actionType.AuthorizeAction ? factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>> : T extends factory.actionType.CheckAction ? (factory.action.check.paymentMethod.movieTicket.IAction | factory.action.check.token.IAction) : T extends factory.actionType.MoneyTransfer ? factory.action.transfer.moneyTransfer.IAction : T extends factory.actionType.ReplaceAction ? factory.action.update.replace.IAction<factory.action.update.replace.IAttributes<any, any>> : T extends factory.actionType.InformAction ? factory.action.interact.inform.IAction<factory.action.interact.inform.IAttributes<factory.action.interact.inform.IObject>> & {
|
|
6
|
+
error?: any;
|
|
7
|
+
purpose?: never;
|
|
8
|
+
} : factory.action.IAction<factory.action.IAttributes<T, any, any>>;
|
|
6
9
|
interface IAggregationByStatus {
|
|
7
10
|
actionCount: number;
|
|
8
11
|
avgDuration: number;
|
|
@@ -352,9 +355,9 @@ export declare class ActionRepo {
|
|
|
352
355
|
location?: any;
|
|
353
356
|
endDate?: Date | undefined;
|
|
354
357
|
sameAs?: import("@chevre/factory/lib/action").ISameAs | undefined;
|
|
355
|
-
target?: factory.entryPoint.IEntryPoint | undefined;
|
|
356
358
|
startDate: Date;
|
|
357
359
|
description?: string | undefined;
|
|
360
|
+
target?: factory.entryPoint.IEntryPoint | undefined;
|
|
358
361
|
amount?: any;
|
|
359
362
|
fromLocation?: any;
|
|
360
363
|
toLocation?: any;
|
|
@@ -377,9 +380,9 @@ export declare class ActionRepo {
|
|
|
377
380
|
location?: any;
|
|
378
381
|
endDate?: Date | undefined;
|
|
379
382
|
sameAs?: import("@chevre/factory/lib/action").ISameAs | undefined;
|
|
380
|
-
target?: factory.entryPoint.IEntryPoint | undefined;
|
|
381
383
|
startDate: Date;
|
|
382
384
|
description?: string | undefined;
|
|
385
|
+
target?: factory.entryPoint.IEntryPoint | undefined;
|
|
383
386
|
amount?: any;
|
|
384
387
|
fromLocation?: any;
|
|
385
388
|
toLocation?: any;
|
|
@@ -404,9 +407,9 @@ export declare class ActionRepo {
|
|
|
404
407
|
location?: any;
|
|
405
408
|
endDate?: Date | undefined;
|
|
406
409
|
sameAs?: import("@chevre/factory/lib/action").ISameAs | undefined;
|
|
407
|
-
target?: factory.entryPoint.IEntryPoint | undefined;
|
|
408
410
|
startDate: Date;
|
|
409
411
|
description?: string | undefined;
|
|
412
|
+
target?: factory.entryPoint.IEntryPoint | undefined;
|
|
410
413
|
amount?: any;
|
|
411
414
|
fromLocation?: any;
|
|
412
415
|
toLocation?: any;
|
|
@@ -429,9 +432,9 @@ export declare class ActionRepo {
|
|
|
429
432
|
location?: any;
|
|
430
433
|
endDate?: Date | undefined;
|
|
431
434
|
sameAs?: import("@chevre/factory/lib/action").ISameAs | undefined;
|
|
432
|
-
target?: factory.entryPoint.IEntryPoint | undefined;
|
|
433
435
|
startDate: Date;
|
|
434
436
|
description?: string | undefined;
|
|
437
|
+
target?: factory.entryPoint.IEntryPoint | undefined;
|
|
435
438
|
amount?: any;
|
|
436
439
|
fromLocation?: any;
|
|
437
440
|
toLocation?: any;
|
|
@@ -229,6 +229,15 @@ const indexes = [
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
],
|
|
232
|
+
[
|
|
233
|
+
{ 'about.id': 1, startDate: -1 },
|
|
234
|
+
{
|
|
235
|
+
name: 'aboutId',
|
|
236
|
+
partialFilterExpression: {
|
|
237
|
+
'about.id': { $exists: true }
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
],
|
|
232
241
|
[
|
|
233
242
|
{ 'about.orderNumber': 1, startDate: -1 },
|
|
234
243
|
{
|
|
@@ -400,6 +409,15 @@ const indexes = [
|
|
|
400
409
|
}
|
|
401
410
|
}
|
|
402
411
|
],
|
|
412
|
+
[
|
|
413
|
+
{ 'instrument.id': 1, startDate: -1 },
|
|
414
|
+
{
|
|
415
|
+
name: 'instrumentId',
|
|
416
|
+
partialFilterExpression: {
|
|
417
|
+
'instrument.id': { $exists: true }
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
],
|
|
403
421
|
[
|
|
404
422
|
{ 'instrument.orderNumber': 1, startDate: -1 },
|
|
405
423
|
{
|
|
@@ -22,7 +22,7 @@ export type IAttendedReservation = Pick<factory.reservation.IReservation<factory
|
|
|
22
22
|
export declare class ReservationRepo {
|
|
23
23
|
private readonly reservationModel;
|
|
24
24
|
constructor(connection: Connection);
|
|
25
|
-
static CREATE_MONGO_CONDITIONS(params: factory.reservation.ISearchConditions<factory.reservationType>): FilterQuery<import("@chevre/factory/lib/reservation/
|
|
25
|
+
static CREATE_MONGO_CONDITIONS(params: factory.reservation.ISearchConditions<factory.reservationType>): FilterQuery<import("@chevre/factory/lib/reservation/event").IReservation | import("@chevre/factory/lib/reservation/busReservation").IReservation | import("@chevre/factory/lib/reservation/reservationPackage").IReservation>[];
|
|
26
26
|
/**
|
|
27
27
|
* 汎用予約カウント
|
|
28
28
|
*/
|
|
@@ -82,10 +82,10 @@ export declare class SellerRepo {
|
|
|
82
82
|
name: import("@chevre/factory/lib/multilingualString").IMultilingualString;
|
|
83
83
|
location?: factory.organization.ILocation | undefined;
|
|
84
84
|
additionalProperty?: import("@chevre/factory/lib/propertyValue").IPropertyValue<string>[] | undefined;
|
|
85
|
+
branchCode: string;
|
|
86
|
+
telephone?: string | undefined;
|
|
85
87
|
hasMerchantReturnPolicy?: factory.seller.IHasMerchantReturnPolicy | undefined;
|
|
86
88
|
makesOffer?: factory.seller.IMakesOffer[] | undefined;
|
|
87
|
-
telephone?: string | undefined;
|
|
88
|
-
branchCode: string;
|
|
89
89
|
paymentAccepted?: factory.seller.IPaymentAccepted[] | undefined;
|
|
90
90
|
}> & {
|
|
91
91
|
url?: string | undefined;
|
|
@@ -94,10 +94,10 @@ export declare class SellerRepo {
|
|
|
94
94
|
name: import("@chevre/factory/lib/multilingualString").IMultilingualString;
|
|
95
95
|
location?: factory.organization.ILocation | undefined;
|
|
96
96
|
additionalProperty?: import("@chevre/factory/lib/propertyValue").IPropertyValue<string>[] | undefined;
|
|
97
|
+
branchCode: string;
|
|
98
|
+
telephone?: string | undefined;
|
|
97
99
|
hasMerchantReturnPolicy?: factory.seller.IHasMerchantReturnPolicy | undefined;
|
|
98
100
|
makesOffer?: factory.seller.IMakesOffer[] | undefined;
|
|
99
|
-
telephone?: string | undefined;
|
|
100
|
-
branchCode: string;
|
|
101
101
|
paymentAccepted?: factory.seller.IPaymentAccepted[] | undefined;
|
|
102
102
|
} & {
|
|
103
103
|
_id: Types.ObjectId;
|
|
@@ -108,10 +108,10 @@ export declare class SellerRepo {
|
|
|
108
108
|
name: import("@chevre/factory/lib/multilingualString").IMultilingualString;
|
|
109
109
|
location?: factory.organization.ILocation | undefined;
|
|
110
110
|
additionalProperty?: import("@chevre/factory/lib/propertyValue").IPropertyValue<string>[] | undefined;
|
|
111
|
+
branchCode: string;
|
|
112
|
+
telephone?: string | undefined;
|
|
111
113
|
hasMerchantReturnPolicy?: factory.seller.IHasMerchantReturnPolicy | undefined;
|
|
112
114
|
makesOffer?: factory.seller.IMakesOffer[] | undefined;
|
|
113
|
-
telephone?: string | undefined;
|
|
114
|
-
branchCode: string;
|
|
115
115
|
paymentAccepted?: factory.seller.IPaymentAccepted[] | undefined;
|
|
116
116
|
}> & {
|
|
117
117
|
url?: string | undefined;
|
|
@@ -120,10 +120,10 @@ export declare class SellerRepo {
|
|
|
120
120
|
name: import("@chevre/factory/lib/multilingualString").IMultilingualString;
|
|
121
121
|
location?: factory.organization.ILocation | undefined;
|
|
122
122
|
additionalProperty?: import("@chevre/factory/lib/propertyValue").IPropertyValue<string>[] | undefined;
|
|
123
|
+
branchCode: string;
|
|
124
|
+
telephone?: string | undefined;
|
|
123
125
|
hasMerchantReturnPolicy?: factory.seller.IHasMerchantReturnPolicy | undefined;
|
|
124
126
|
makesOffer?: factory.seller.IMakesOffer[] | undefined;
|
|
125
|
-
telephone?: string | undefined;
|
|
126
|
-
branchCode: string;
|
|
127
127
|
paymentAccepted?: factory.seller.IPaymentAccepted[] | undefined;
|
|
128
128
|
} & {
|
|
129
129
|
_id: Types.ObjectId;
|
|
@@ -55,7 +55,11 @@ export declare class TaskRepo {
|
|
|
55
55
|
* タスク識別子から冪等作成する
|
|
56
56
|
*/
|
|
57
57
|
createIfNotExistByIdentifier(params: factory.task.IAttributes<factory.taskName>, options: IOptionOnCreate): Promise<void>;
|
|
58
|
-
createInformTaskIfNotExist(params: factory.task.IAttributes<factory.taskName.TriggerWebhook
|
|
58
|
+
createInformTaskIfNotExist(params: factory.task.IAttributes<factory.taskName.TriggerWebhook> & {
|
|
59
|
+
data: factory.task.triggerWebhook.IInformAnyResourceAction & {
|
|
60
|
+
object: factory.notification.person.IPersonAsNotification;
|
|
61
|
+
};
|
|
62
|
+
}, options: IOptionOnCreate): Promise<void>;
|
|
59
63
|
/**
|
|
60
64
|
* 取引削除タスク冪等作成
|
|
61
65
|
*/
|
|
@@ -134,7 +134,7 @@ export declare class TransactionRepo {
|
|
|
134
134
|
status: {
|
|
135
135
|
$in: factory.transactionStatusType[];
|
|
136
136
|
};
|
|
137
|
-
}): Promise<Pick<import("@chevre/factory/lib/transaction/
|
|
137
|
+
}): Promise<Pick<import("@chevre/factory/lib/transaction/placeOrder").ITransaction | import("@chevre/factory/lib/transaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/transaction/returnOrder").ITransaction, "id" | "typeOf" | "status">[]>;
|
|
138
138
|
/**
|
|
139
139
|
* set task status exported by transaction id
|
|
140
140
|
* IDでタスクをエクスポート済に変更する
|
|
@@ -205,11 +205,11 @@ export declare class TransactionRepo {
|
|
|
205
205
|
$lt: Date;
|
|
206
206
|
};
|
|
207
207
|
}): Promise<import("mongodb").DeleteResult>;
|
|
208
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/transaction/
|
|
208
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/transaction/placeOrder").ITransaction | import("@chevre/factory/lib/transaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/transaction/returnOrder").ITransaction> & ((import("@chevre/factory/lib/transaction/placeOrder").IAttributes & {
|
|
209
209
|
id: string;
|
|
210
210
|
} & {
|
|
211
211
|
_id: import("mongoose").Types.ObjectId;
|
|
212
|
-
}) | (import("@chevre/factory/lib/transaction/
|
|
212
|
+
}) | (import("@chevre/factory/lib/transaction/moneyTransfer").IAttributes & {
|
|
213
213
|
id: string;
|
|
214
214
|
} & {
|
|
215
215
|
_id: import("mongoose").Types.ObjectId;
|
|
@@ -217,11 +217,11 @@ export declare class TransactionRepo {
|
|
|
217
217
|
id: string;
|
|
218
218
|
} & {
|
|
219
219
|
_id: import("mongoose").Types.ObjectId;
|
|
220
|
-
})), import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/transaction/
|
|
220
|
+
})), import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/transaction/placeOrder").ITransaction | import("@chevre/factory/lib/transaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/transaction/returnOrder").ITransaction> & ((import("@chevre/factory/lib/transaction/placeOrder").IAttributes & {
|
|
221
221
|
id: string;
|
|
222
222
|
} & {
|
|
223
223
|
_id: import("mongoose").Types.ObjectId;
|
|
224
|
-
}) | (import("@chevre/factory/lib/transaction/
|
|
224
|
+
}) | (import("@chevre/factory/lib/transaction/moneyTransfer").IAttributes & {
|
|
225
225
|
id: string;
|
|
226
226
|
} & {
|
|
227
227
|
_id: import("mongoose").Types.ObjectId;
|
|
@@ -4,7 +4,7 @@ import * as factory from '../../../factory';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare function createStartParams(params: {
|
|
6
6
|
paramsWithoutDetail: factory.assetTransaction.cancelReservation.IStartParamsWithoutDetail & {
|
|
7
|
-
instrument: factory.
|
|
7
|
+
instrument: factory.assetTransaction.cancelReservation.IInstrument[];
|
|
8
8
|
};
|
|
9
9
|
project: factory.assetTransaction.IProject;
|
|
10
10
|
transactionNumber: string;
|
|
@@ -11,7 +11,7 @@ export type IStartParams = factory.assetTransaction.cancelReservation.IStartPara
|
|
|
11
11
|
seller: {
|
|
12
12
|
id?: string;
|
|
13
13
|
};
|
|
14
|
-
instrument: factory.
|
|
14
|
+
instrument: factory.assetTransaction.cancelReservation.IInstrument[];
|
|
15
15
|
};
|
|
16
16
|
export declare function validateStartParams(params: IStartParams): (repos: {
|
|
17
17
|
reservation: ReservationRepo;
|
|
@@ -102,7 +102,8 @@ export declare function publishPaymentUrl(params: Pick<factory.assetTransaction.
|
|
|
102
102
|
* 決済ロケーションを無効化する
|
|
103
103
|
* 実質、外部で実行された決済に対する返金処理
|
|
104
104
|
*/
|
|
105
|
-
export declare function invalidatePaymentUrl(params: Omit<factory.task.refund.IData, 'sameAs'> & {
|
|
105
|
+
export declare function invalidatePaymentUrl(params: Omit<factory.task.refund.IData, 'sameAs' | 'purpose'> & {
|
|
106
|
+
purpose: factory.action.trade.refund.IPurposeAsPlaceOrder;
|
|
106
107
|
sameAs?: {
|
|
107
108
|
id: string;
|
|
108
109
|
};
|
|
@@ -158,7 +158,9 @@ function invalidatePaymentUrl(params) {
|
|
|
158
158
|
const paymentServiceType = (_a = params.object[0]) === null || _a === void 0 ? void 0 : _a.typeOf;
|
|
159
159
|
switch (paymentServiceType) {
|
|
160
160
|
case factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
161
|
-
yield CreditCardPayment.refundCreditCard(params
|
|
161
|
+
yield CreditCardPayment.refundCreditCard(params
|
|
162
|
+
// { requirePayAction: false }
|
|
163
|
+
)(repos, settings);
|
|
162
164
|
break;
|
|
163
165
|
default:
|
|
164
166
|
throw new factory.errors.NotImplemented(`Payment service '${paymentServiceType}' not implemented`);
|
|
@@ -5,5 +5,5 @@ import * as factory from '../../../factory';
|
|
|
5
5
|
export declare function createPotentialActions(params: {
|
|
6
6
|
transaction: factory.assetTransaction.ITransaction<factory.assetTransactionType.Refund>;
|
|
7
7
|
seller: factory.assetTransaction.pay.IRecipient;
|
|
8
|
-
potentialActions
|
|
8
|
+
potentialActions: factory.assetTransaction.refund.IPotentialActionsParams;
|
|
9
9
|
}): Promise<factory.assetTransaction.IPotentialActions<factory.assetTransactionType.Refund>>;
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.createPotentialActions = createPotentialActions;
|
|
13
13
|
const factory = require("../../../factory");
|
|
14
14
|
function createReundActions(params) {
|
|
15
|
-
var _a, _b
|
|
15
|
+
var _a, _b;
|
|
16
16
|
const { transaction, seller } = params;
|
|
17
17
|
const refundActions = [];
|
|
18
18
|
const informPaymentActions = createInformPaymentActions(params);
|
|
@@ -23,12 +23,25 @@ function createReundActions(params) {
|
|
|
23
23
|
// typeOf: params.transaction.agent.typeOf
|
|
24
24
|
// };
|
|
25
25
|
const agent = Object.assign({ id: seller.id, typeOf: seller.typeOf }, (typeof seller.name === 'string') ? { name: seller.name } : undefined);
|
|
26
|
-
|
|
26
|
+
const purpose = (_b = (_a = params.potentialActions) === null || _a === void 0 ? void 0 : _a.refund) === null || _b === void 0 ? void 0 : _b.purpose;
|
|
27
|
+
if (purpose.typeOf !== factory.actionType.ReturnAction) {
|
|
28
|
+
throw new factory.errors.Argument('potentialActions?.refund?.purpose.typeOf', `must be ${factory.actionType.ReturnAction}`);
|
|
29
|
+
}
|
|
30
|
+
refundActions.push({
|
|
31
|
+
project: transaction.project,
|
|
32
|
+
typeOf: factory.actionType.RefundAction,
|
|
33
|
+
object: [transaction.object],
|
|
34
|
+
agent,
|
|
35
|
+
potentialActions: {
|
|
27
36
|
informPayment: informPaymentActions,
|
|
28
37
|
add2report: true
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
},
|
|
39
|
+
recipient: transaction.recipient,
|
|
40
|
+
purpose // purpose required(2025-02-20~)
|
|
41
|
+
// ...(params.potentialActions?.refund?.purpose !== undefined)
|
|
42
|
+
// ? { purpose: params.potentialActions?.refund?.purpose }
|
|
43
|
+
// : { purpose: { typeOf: transaction.typeOf, transactionNumber: transaction.transactionNumber, id: transaction.id } }
|
|
44
|
+
});
|
|
32
45
|
return refundActions;
|
|
33
46
|
}
|
|
34
47
|
function createInformPaymentActions(params) {
|
|
@@ -65,7 +65,11 @@ function start(params, options) {
|
|
|
65
65
|
const { id } = yield repos.assetTransaction.startWithMinimalResponse(startParams);
|
|
66
66
|
yield addReservations({
|
|
67
67
|
reservationFor: startParams.object.reservationFor,
|
|
68
|
-
transaction: {
|
|
68
|
+
transaction: {
|
|
69
|
+
id,
|
|
70
|
+
transactionNumber: reservationNumber,
|
|
71
|
+
instrument: (Array.isArray(startParams.instrument)) ? startParams.instrument : []
|
|
72
|
+
},
|
|
69
73
|
event,
|
|
70
74
|
// stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd,
|
|
71
75
|
objectSubReservations
|
|
@@ -194,9 +198,7 @@ function addReservations(params) {
|
|
|
194
198
|
yield (0, onReservationsCreated_1.onReservationsCreated)({
|
|
195
199
|
project: { id: event.project.id },
|
|
196
200
|
event: { id: event.id },
|
|
197
|
-
transaction:
|
|
198
|
-
transactionNumber: reservationNumber
|
|
199
|
-
}
|
|
201
|
+
transaction: params.transaction
|
|
200
202
|
})(repos);
|
|
201
203
|
});
|
|
202
204
|
}
|
|
@@ -315,7 +315,7 @@ function processInformAction(params, options) {
|
|
|
315
315
|
try {
|
|
316
316
|
const urlTemplate = (_e = informActionAttributes.target) === null || _e === void 0 ? void 0 : _e.urlTemplate;
|
|
317
317
|
if (typeof urlTemplate === 'string') {
|
|
318
|
-
const requestBody = JSON.stringify(Object.assign({ data: informActionAttributes.object }, (typeof identifier === 'string' && identifier !== '')
|
|
318
|
+
const requestBody = JSON.stringify(Object.assign({ data: informActionAttributes.object, id: action.id }, (typeof identifier === 'string' && identifier !== '')
|
|
319
319
|
? { identifier }
|
|
320
320
|
: undefined));
|
|
321
321
|
const timestamp = action.startDate.valueOf();
|
|
@@ -31,7 +31,10 @@ function processStartReserve4chevre(params, options) {
|
|
|
31
31
|
const startReserveTransactionResult = yield ReserveTransactionService.start(Object.assign(Object.assign({}, startParams), { object: startParamObject,
|
|
32
32
|
// discontinue preSearchedEvent(2024-07-17~)
|
|
33
33
|
// preSearchedEvent: event,
|
|
34
|
-
preSearchedTicketOffers: params.ticketOffers, preSearchedUnitPriceOffers: params.unitPriceOffers, availableAtOrFrom: { id: params.availableAtOrFrom.id }, validateEvent: params.validateEvent, validateEventOfferPeriod: params.validateEventOfferPeriod, validateAppliesToMovieTicket: true, instrument: [
|
|
34
|
+
preSearchedTicketOffers: params.ticketOffers, preSearchedUnitPriceOffers: params.unitPriceOffers, availableAtOrFrom: { id: params.availableAtOrFrom.id }, validateEvent: params.validateEvent, validateEventOfferPeriod: params.validateEventOfferPeriod, validateAppliesToMovieTicket: true, instrument: [
|
|
35
|
+
{ orderNumber: params.orderNumber, typeOf: factory.order.OrderType.Order },
|
|
36
|
+
{ id: transaction.id, typeOf: transaction.typeOf }
|
|
37
|
+
] }), options)(repos, settings);
|
|
35
38
|
// 予約取引結果から注文オファーを生成する
|
|
36
39
|
acceptedOffers4result = (0, factory_1.responseBody2acceptedOffers4result)({
|
|
37
40
|
issuedThrough: startReserveTransactionResult.issuedThrough,
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
|
-
export
|
|
3
|
-
id: string;
|
|
4
|
-
typeOf: factory.actionType.PayAction;
|
|
5
|
-
object: factory.invoice.IInvoice[];
|
|
6
|
-
}
|
|
7
|
-
export interface IOnPaymentStatusChangedRefundAction {
|
|
8
|
-
id: string;
|
|
9
|
-
typeOf: factory.actionType.RefundAction;
|
|
10
|
-
object: factory.invoice.IInvoice[];
|
|
11
|
-
}
|
|
12
|
-
export type IOnPaymentStatusChangedParams = IOnPaymentStatusChangedPayAction | IOnPaymentStatusChangedRefundAction;
|
|
2
|
+
export type INotification = factory.notification.payAction.IPayAction4inform | factory.notification.refundAction.IRefundAction4inform;
|
|
13
3
|
export declare function creatPublishPaymentUrlParams(params: {
|
|
14
4
|
accountId?: string;
|
|
15
5
|
object: Pick<factory.action.authorize.paymentMethod.any.IObjectIncludingPaymentMethodDetails, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod'>;
|
|
@@ -47,4 +37,4 @@ export declare function createAuthorizeResult(params: {
|
|
|
47
37
|
/**
|
|
48
38
|
* 通知対象としてのアクションを最適化
|
|
49
39
|
*/
|
|
50
|
-
export declare function optimizeAction4inform(action: Pick<factory.action.trade.pay.IAction, 'id' | 'object' | 'project' | 'typeOf'> | Pick<factory.action.trade.refund.IAction, 'id' | 'object' | 'project' | 'typeOf'>):
|
|
40
|
+
export declare function optimizeAction4inform(action: Pick<factory.action.trade.pay.IAction, 'id' | 'object' | 'project' | 'typeOf'> | Pick<factory.action.trade.refund.IAction, 'id' | 'object' | 'project' | 'typeOf'>): INotification;
|
|
@@ -29,7 +29,7 @@ function onPayActionCompleted(payAction) {
|
|
|
29
29
|
}
|
|
30
30
|
const informPayment = potentialActions === null || potentialActions === void 0 ? void 0 : potentialActions.informPayment;
|
|
31
31
|
if (Array.isArray(informPayment)) {
|
|
32
|
-
taskAttributes.push(...informPayment.map(({ purpose,
|
|
32
|
+
taskAttributes.push(...informPayment.map(({ purpose, id }) => {
|
|
33
33
|
let data;
|
|
34
34
|
if (typeof id === 'string' && id !== '') {
|
|
35
35
|
let about;
|
|
@@ -43,7 +43,8 @@ function onPayActionCompleted(payAction) {
|
|
|
43
43
|
}
|
|
44
44
|
data = Object.assign(Object.assign({
|
|
45
45
|
// optimize(2024-07-01~)
|
|
46
|
-
recipient,
|
|
46
|
+
// recipient, // discontinue recipient(2025-02-19~)
|
|
47
|
+
object: aciton4inform, id, typeOf: factory.actionType.InformAction }, (typeof (purpose === null || purpose === void 0 ? void 0 : purpose.typeOf) === 'string') ? { purpose } : undefined), (typeof (about === null || about === void 0 ? void 0 : about.typeOf) === 'string') ? { about } : undefined // add(2025-02-14~)
|
|
47
48
|
);
|
|
48
49
|
}
|
|
49
50
|
else {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
2
2
|
import type { ActionRepo } from '../../../repo/action';
|
|
3
|
-
import {
|
|
3
|
+
import { INotification } from './factory';
|
|
4
4
|
/**
|
|
5
5
|
* 決済ステータス変更イベント
|
|
6
6
|
*/
|
|
7
|
-
export declare function onPaymentStatusChanged(params:
|
|
7
|
+
export declare function onPaymentStatusChanged(params: INotification): (repos: {
|
|
8
8
|
action: ActionRepo;
|
|
9
9
|
accountingReport: AccountingReportRepo;
|
|
10
10
|
}) => Promise<void>;
|
|
@@ -93,7 +93,7 @@ function onRefundActionCompletedOrFailed(refundAction) {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
if (Array.isArray(informPayment)) {
|
|
96
|
-
taskAttributes.push(...informPayment.map(({ purpose,
|
|
96
|
+
taskAttributes.push(...informPayment.map(({ purpose, id }) => {
|
|
97
97
|
let data;
|
|
98
98
|
if (typeof id === 'string' && id !== '') {
|
|
99
99
|
let about;
|
|
@@ -105,7 +105,8 @@ function onRefundActionCompletedOrFailed(refundAction) {
|
|
|
105
105
|
}
|
|
106
106
|
data = Object.assign(Object.assign({
|
|
107
107
|
// optimize(2024-07-01~)
|
|
108
|
-
recipient,
|
|
108
|
+
// recipient, // discontinue recipient(2025-02-19~)
|
|
109
|
+
object: aciton4inform, id, typeOf: factory.actionType.InformAction }, (typeof (purpose === null || purpose === void 0 ? void 0 : purpose.typeOf) === 'string') ? { purpose } : undefined), (typeof (about === null || about === void 0 ? void 0 : about.typeOf) === 'string') ? { about } : undefined // add(2025-02-14~)
|
|
109
110
|
);
|
|
110
111
|
}
|
|
111
112
|
else {
|
|
@@ -9,6 +9,7 @@ interface IProcessAlterTranResult {
|
|
|
9
9
|
interface IProcessAlterTranResult4refund {
|
|
10
10
|
searchTradeArgs?: GMO.factory.credit.ISearchTradeArgs & GMO.factory.credit.IOptionalSiteArgs;
|
|
11
11
|
searchTradeResult?: GMO.factory.credit.ISearchTradeResult;
|
|
12
|
+
searchTradeResultAsError?: factory.action.trade.refund.ISearchTradeResultAsError;
|
|
12
13
|
alterTranArgs?: GMO.factory.credit.IAlterTranArgs & GMO.factory.credit.IOptionalSiteArgs;
|
|
13
14
|
alterTranResult?: GMO.factory.credit.IAlterTranResult | factory.action.trade.refund.IAlterTranResultAsError;
|
|
14
15
|
}
|
|
@@ -30,7 +30,7 @@ function processAlterTranResult2payRecipe(params) {
|
|
|
30
30
|
}
|
|
31
31
|
function processAlterTranResult2refundRecipe(params) {
|
|
32
32
|
const { processAlterTranResult, project } = params;
|
|
33
|
-
const { searchTradeArgs, searchTradeResult, alterTranResult, alterTranArgs } = processAlterTranResult;
|
|
33
|
+
const { searchTradeArgs, searchTradeResult, searchTradeResultAsError, alterTranResult, alterTranArgs } = processAlterTranResult;
|
|
34
34
|
return {
|
|
35
35
|
project: { id: project.id, typeOf: factory.organizationType.Project },
|
|
36
36
|
typeOf: 'Recipe',
|
|
@@ -41,7 +41,7 @@ function processAlterTranResult2refundRecipe(params) {
|
|
|
41
41
|
{
|
|
42
42
|
typeOf: 'HowToStep',
|
|
43
43
|
identifier: factory.recipe.StepIdentifier.searchTrade,
|
|
44
|
-
itemListElement: [Object.assign(Object.assign({ typeOf: 'HowToDirection' }, (searchTradeArgs !== undefined) ? { beforeMedia: searchTradeArgs } : undefined), (searchTradeResult !== undefined) ? { afterMedia: searchTradeResult } : undefined)]
|
|
44
|
+
itemListElement: [Object.assign(Object.assign(Object.assign({ typeOf: 'HowToDirection' }, (searchTradeArgs !== undefined) ? { beforeMedia: searchTradeArgs } : undefined), (searchTradeResult !== undefined) ? { afterMedia: searchTradeResult } : undefined), (searchTradeResultAsError !== undefined) ? { afterMedia: searchTradeResultAsError } : undefined)]
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
typeOf: 'HowToStep',
|
|
@@ -7,14 +7,13 @@ import type { TaskRepo } from '../../../repo/task';
|
|
|
7
7
|
import * as factory from '../../../factory';
|
|
8
8
|
import { Settings } from '../../../settings';
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* refund CreditCard IF payment
|
|
11
11
|
*/
|
|
12
|
-
declare function refundCreditCard(params:
|
|
12
|
+
declare function refundCreditCard(params: Pick<factory.action.trade.refund.IAttributes, 'agent' | 'object' | 'potentialActions' | 'project' | 'recipient' | 'typeOf' | 'instrument'> & {
|
|
13
|
+
purpose: factory.action.trade.refund.IPurposeAsReturnAction | factory.action.trade.refund.IPurposeAsPlaceOrder;
|
|
13
14
|
sameAs?: {
|
|
14
15
|
id: string;
|
|
15
16
|
};
|
|
16
|
-
}, options: {
|
|
17
|
-
requirePayAction: boolean;
|
|
18
17
|
}): (repos: {
|
|
19
18
|
action: ActionRepo;
|
|
20
19
|
accountingReport: AccountingReportRepo;
|