@chevre/domain 28.0.0-alpha.2 → 28.0.0-alpha.4
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/eventEmitter/transaction.d.ts +2 -2
- package/lib/chevre/eventEmitter/transaction.js +1 -1
- package/lib/chevre/repo/adminTransaction.d.ts +35 -29
- package/lib/chevre/repo/adminTransaction.js +0 -98
- package/lib/chevre/repo/aggregateTransaction.d.ts +0 -1
- package/lib/chevre/repo/aggregateTransaction.js +0 -1
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +2 -3
- package/lib/chevre/repo/mongoose/schemas/transaction.js +39 -27
- package/lib/chevre/repo/orderInTransaction.js +0 -6
- package/lib/chevre/repo/transaction/placeOrder.d.ts +6 -11
- package/lib/chevre/repo/transaction/placeOrder.js +38 -110
- package/lib/chevre/repo/transaction/returnOrderInProgress.d.ts +1 -1
- package/lib/chevre/repo/transaction.d.ts +1 -1
- package/lib/chevre/repo/transaction.js +0 -1
- package/lib/chevre/service/aggregation/system.js +1 -3
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +2 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize.js +1 -4
- package/lib/chevre/service/offer/event/issueEventOfferTicket.js +1 -1
- package/lib/chevre/service/offer/event/voidTransaction.js +2 -5
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -4
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +2 -8
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +1 -4
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -4
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +1 -1
- package/lib/chevre/service/payment/any/authorize.js +1 -1
- package/lib/chevre/service/payment/any/factory.d.ts +2 -2
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +1 -4
- package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/transaction/deleteTransaction.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -2
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -4
- package/lib/chevre/service/transaction/placeOrder/start.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +1 -4
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +1 -3
- package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +13 -1
- package/lib/chevre/service/transaction/returnOrder.d.ts +14 -3
- package/lib/chevre/service/transaction/returnOrder.js +1 -6
- package/lib/chevre/service/transaction.d.ts +1 -1
- package/package.json +2 -2
|
@@ -34,7 +34,7 @@ function start(params, options) {
|
|
|
34
34
|
// in case already locked
|
|
35
35
|
const alreadyStartedTransaction = (await repos.placeOrder.findPlaceOrderTransactions({
|
|
36
36
|
limit: 1, page: 1,
|
|
37
|
-
typeOf:
|
|
37
|
+
// typeOf: factory.transactionType.PlaceOrder,
|
|
38
38
|
project: { id: { $eq: startParams.project.id } },
|
|
39
39
|
status: { $in: [factory_1.factory.transactionStatusType.InProgress] },
|
|
40
40
|
agent: { identifiers: [{ name: factory_2.AGENT_IDENTIFIER_NAME_PASSPORT, value: passport.identifier }] },
|
|
@@ -8,10 +8,7 @@ const fixCustomer_1 = require("./updateAgent/fixCustomer");
|
|
|
8
8
|
*/
|
|
9
9
|
function updateAgent(params) {
|
|
10
10
|
return async (repos) => {
|
|
11
|
-
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
12
|
-
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
13
|
-
id: params.id
|
|
14
|
-
}, ['agent', 'object', 'typeOf', 'project']);
|
|
11
|
+
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.id }, ['agent', 'object', 'typeOf', 'project']);
|
|
15
12
|
if (transaction.agent.id !== params.agent.id) {
|
|
16
13
|
throw new factory_1.factory.errors.Forbidden('Transaction not yours');
|
|
17
14
|
}
|
|
@@ -4,9 +4,7 @@ exports.createPotentialActions = createPotentialActions;
|
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
5
|
const returnPaymentMethod_1 = require("./potentialActions/returnPaymentMethod");
|
|
6
6
|
const sendEmailMessage_1 = require("./potentialActions/sendEmailMessage");
|
|
7
|
-
async function createPotentialActions(params,
|
|
8
|
-
// settings: Settings
|
|
9
|
-
setting) {
|
|
7
|
+
async function createPotentialActions(params, setting) {
|
|
10
8
|
const emailMessages = [];
|
|
11
9
|
const returnOrderActions = await Promise.all(params.orders.map(async (order) => {
|
|
12
10
|
let returnOrderParams = params.potentialActions?.returnOrder;
|
|
@@ -23,10 +23,22 @@ interface IPreStartOperationRepos {
|
|
|
23
23
|
}
|
|
24
24
|
type IPreStartOperation<T> = (repos: IPreStartOperationRepos) => Promise<T>;
|
|
25
25
|
type IFixedSeller = Pick<ISellerWithId, 'id' | 'name' | 'project' | 'hasMerchantReturnPolicy' | 'typeOf'>;
|
|
26
|
+
/**
|
|
27
|
+
* 注文返品開始パラメータ
|
|
28
|
+
*/
|
|
29
|
+
export interface IStartParamsWithoutDetail {
|
|
30
|
+
project: Pick<factory.project.IProject, 'id' | 'typeOf'>;
|
|
31
|
+
expiresInSeconds: number;
|
|
32
|
+
agent: factory.transaction.returnOrder.IAgent;
|
|
33
|
+
object: {
|
|
34
|
+
order: [factory.transaction.returnOrder.IReturnableOrder];
|
|
35
|
+
reason: factory.transaction.returnOrder.Reason;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
26
38
|
/**
|
|
27
39
|
* 返品取引開始前処理
|
|
28
40
|
*/
|
|
29
|
-
declare function preStart(params:
|
|
41
|
+
declare function preStart(params: IStartParamsWithoutDetail): IPreStartOperation<{
|
|
30
42
|
transactionObject: factory.transaction.returnOrder.IObject;
|
|
31
43
|
seller: IFixedSeller;
|
|
32
44
|
expiresInSeconds: number;
|
|
@@ -13,7 +13,7 @@ import type { SellerReturnPolicyRepo } from '../../repo/sellerReturnPolicy';
|
|
|
13
13
|
import type { SettingRepo } from '../../repo/setting';
|
|
14
14
|
import type { TaskRepo } from '../../repo/task';
|
|
15
15
|
import type { IStartedTransaction, ReturnOrderInProgressRepo } from '../../repo/transaction/returnOrderInProgress';
|
|
16
|
-
import { preStart } from './returnOrder/preStart';
|
|
16
|
+
import { preStart, IStartParamsWithoutDetail } from './returnOrder/preStart';
|
|
17
17
|
interface IStartOperationRepos {
|
|
18
18
|
acceptedOffer: AcceptedOfferRepo;
|
|
19
19
|
event: EventRepo;
|
|
@@ -31,7 +31,7 @@ type IStartOperation<T> = (repos: IStartOperationRepos) => Promise<T>;
|
|
|
31
31
|
/**
|
|
32
32
|
* 返品取引開始
|
|
33
33
|
*/
|
|
34
|
-
declare function start(params:
|
|
34
|
+
declare function start(params: IStartParamsWithoutDetail): IStartOperation<IStartedTransaction>;
|
|
35
35
|
interface IConfirmRepos {
|
|
36
36
|
acceptedOffer: AcceptedOfferRepo;
|
|
37
37
|
message: MessageRepo;
|
|
@@ -43,7 +43,18 @@ interface IConfirmRepos {
|
|
|
43
43
|
/**
|
|
44
44
|
* 取引確定
|
|
45
45
|
*/
|
|
46
|
-
declare function confirm(params:
|
|
46
|
+
declare function confirm(params: {
|
|
47
|
+
/**
|
|
48
|
+
* 取引ID
|
|
49
|
+
*/
|
|
50
|
+
id: string;
|
|
51
|
+
agent: {
|
|
52
|
+
id: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* 取引確定後アクション
|
|
56
|
+
*/
|
|
57
|
+
potentialActions?: factory.transaction.returnOrder.IPotentialActionsParams;
|
|
47
58
|
object: {
|
|
48
59
|
order: {
|
|
49
60
|
dateReturned: Date;
|
|
@@ -16,16 +16,11 @@ Object.defineProperty(exports, "preStart", { enumerable: true, get: function ()
|
|
|
16
16
|
*/
|
|
17
17
|
function start(params) {
|
|
18
18
|
return async (repos) => {
|
|
19
|
-
const { transactionObject, expiresInSeconds, seller } = await (0, preStart_1.preStart)(params)(repos);
|
|
19
|
+
const { transactionObject, expiresInSeconds, seller: _seller } = await (0, preStart_1.preStart)(params)(repos);
|
|
20
20
|
const returnOrderAttributes = {
|
|
21
21
|
project: params.project,
|
|
22
22
|
typeOf: factory_1.factory.transactionType.ReturnOrder,
|
|
23
23
|
agent: params.agent,
|
|
24
|
-
seller: {
|
|
25
|
-
id: String(seller.id),
|
|
26
|
-
typeOf: seller.typeOf,
|
|
27
|
-
name: seller.name
|
|
28
|
-
},
|
|
29
24
|
object: transactionObject,
|
|
30
25
|
expiresInSeconds
|
|
31
26
|
};
|
|
@@ -44,4 +44,4 @@ export declare function exportOneTransactionTasksIfExists(params: {
|
|
|
44
44
|
endDate?: factory.sortType;
|
|
45
45
|
startDate?: factory.sortType;
|
|
46
46
|
};
|
|
47
|
-
}): IExportTasksOperation<Pick<factory.transaction.ITransaction
|
|
47
|
+
}): IExportTasksOperation<Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'typeOf'> | undefined>;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.1090.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.1090.0",
|
|
14
|
-
"@chevre/factory": "
|
|
14
|
+
"@chevre/factory": "11.0.0-alpha.1",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
16
|
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"postversion": "git push origin --tags",
|
|
89
89
|
"prepublishOnly": "npm run clean && npm run build"
|
|
90
90
|
},
|
|
91
|
-
"version": "28.0.0-alpha.
|
|
91
|
+
"version": "28.0.0-alpha.4"
|
|
92
92
|
}
|