@chevre/domain 21.17.0-alpha.1 → 21.17.0-alpha.2
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/factory/transaction.d.ts +0 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/factory.js +3 -3
- package/lib/chevre/service/transaction/placeOrderInProgress.js +6 -16
- package/package.json +2 -2
|
@@ -11,7 +11,6 @@ export declare namespace placeOrder {
|
|
|
11
11
|
type IStartParams = factory.transaction.placeOrder.IStartParamsWithoutDetail & {
|
|
12
12
|
passportValidator?: IPassportValidator;
|
|
13
13
|
broker?: factory.order.IBroker;
|
|
14
|
-
validateSeller?: boolean;
|
|
15
14
|
};
|
|
16
15
|
type IOrderURLGenerator = (order: factory.order.IOrder) => string;
|
|
17
16
|
type IResultOrderParams = factory.transaction.placeOrder.IResultOrderParams & {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
|
-
export declare function createStartParams(params: factory.transaction.placeOrder.IStartParamsWithoutDetail, passport: factory.waiter.passport.IPassport | undefined, seller: Pick<factory.seller.ISeller, 'id' | 'name' | 'typeOf' | 'project' | 'additionalProperty'>, broker?: factory.order.IBroker): factory.transaction.placeOrder.IStartParams;
|
|
2
|
+
export declare function createStartParams(params: factory.transaction.placeOrder.IStartParamsWithoutDetail & {}, expiresInSeconds: number, passport: factory.waiter.passport.IPassport | undefined, seller: Pick<factory.seller.ISeller, 'id' | 'name' | 'typeOf' | 'project' | 'additionalProperty'>, broker?: factory.order.IBroker): factory.transaction.placeOrder.IStartParams;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createStartParams = void 0;
|
|
4
4
|
const factory = require("../../../factory");
|
|
5
|
-
function createStartParams(params, passport, seller, broker) {
|
|
5
|
+
function createStartParams(params, expiresInSeconds, passport, seller, broker) {
|
|
6
6
|
var _a, _b, _c, _d;
|
|
7
7
|
const transactionObject = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ passportToken: (typeof ((_a = params.object.passport) === null || _a === void 0 ? void 0 : _a.token) === 'string') ? params.object.passport.token : undefined }, (passport !== undefined) ? { passport } : undefined), (params.object.clientUser !== undefined && params.object.clientUser !== null)
|
|
8
8
|
? { clientUser: params.object.clientUser }
|
|
@@ -10,7 +10,7 @@ function createStartParams(params, passport, seller, broker) {
|
|
|
10
10
|
if (typeof seller.id !== 'string') {
|
|
11
11
|
throw new factory.errors.NotFound('seller.id');
|
|
12
12
|
}
|
|
13
|
-
if (typeof
|
|
13
|
+
if (typeof expiresInSeconds !== 'number') {
|
|
14
14
|
throw new factory.errors.ArgumentNull('expiresInSeconds');
|
|
15
15
|
}
|
|
16
16
|
return {
|
|
@@ -25,7 +25,7 @@ function createStartParams(params, passport, seller, broker) {
|
|
|
25
25
|
additionalProperty: (Array.isArray(seller.additionalProperty)) ? seller.additionalProperty : []
|
|
26
26
|
},
|
|
27
27
|
object: transactionObject,
|
|
28
|
-
expiresInSeconds:
|
|
28
|
+
expiresInSeconds: expiresInSeconds
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
exports.createStartParams = createStartParams;
|
|
@@ -40,25 +40,15 @@ function start(params) {
|
|
|
40
40
|
throw new factory.errors.NotFound(factory.organizationType.Corporation);
|
|
41
41
|
}
|
|
42
42
|
let makesOfferFromClient;
|
|
43
|
-
// 販売者オファー検証(2022-10-14~)
|
|
44
|
-
|
|
45
|
-
const validateSellerResult = (0, validateSeller_1.validateSeller)({ seller, clientUser: params.object.clientUser });
|
|
46
|
-
makesOfferFromClient = validateSellerResult.makesOfferFromClient;
|
|
47
|
-
}
|
|
43
|
+
const validateSellerResult = (0, validateSeller_1.validateSeller)({ seller, clientUser: params.object.clientUser }); // 販売者オファー検証(2022-10-14~)
|
|
44
|
+
makesOfferFromClient = validateSellerResult.makesOfferFromClient;
|
|
48
45
|
const passport = yield (0, validation_2.validateWaiterPassport)(params);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
expiresInSeconds = makesOfferFromClient.eligibleTransactionDuration.maxValue;
|
|
53
|
-
}
|
|
54
|
-
else if (typeof params.expiresInSeconds === 'number') {
|
|
55
|
-
expiresInSeconds = params.expiresInSeconds;
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
throw new factory.errors.ArgumentNull('expiresInSeconds');
|
|
46
|
+
const expiresInSeconds = (_a = makesOfferFromClient === null || makesOfferFromClient === void 0 ? void 0 : makesOfferFromClient.eligibleTransactionDuration) === null || _a === void 0 ? void 0 : _a.maxValue;
|
|
47
|
+
if (typeof expiresInSeconds !== 'number') {
|
|
48
|
+
throw new factory.errors.NotFound('eligibleTransactionDuration.maxValue');
|
|
59
49
|
}
|
|
60
50
|
// 取引ファクトリーで新しい進行中取引オブジェクトを作成
|
|
61
|
-
const startParams = (0, factory_1.createStartParams)(
|
|
51
|
+
const startParams = (0, factory_1.createStartParams)(params, expiresInSeconds, passport, seller, params.broker);
|
|
62
52
|
let transaction;
|
|
63
53
|
try {
|
|
64
54
|
transaction = yield repos.transaction.start(startParams);
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/credential-providers": "3.433.0",
|
|
13
|
-
"@chevre/factory": "4.343.0-alpha.
|
|
13
|
+
"@chevre/factory": "4.343.0-alpha.1",
|
|
14
14
|
"@cinerino/sdk": "5.0.0",
|
|
15
15
|
"@motionpicture/coa-service": "9.2.0",
|
|
16
16
|
"@motionpicture/gmo-service": "5.2.0",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"postversion": "git push origin --tags",
|
|
118
118
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
119
119
|
},
|
|
120
|
-
"version": "21.17.0-alpha.
|
|
120
|
+
"version": "21.17.0-alpha.2"
|
|
121
121
|
}
|