@chevre/domain
Version:
Chevre Domain Library for Node.js
24 lines (23 loc) • 1.27 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.createStartParams = createStartParams;
const factory = require("../../../factory");
function createStartParams(params, passport, seller, amount, fromLocation, toLocation, transactionNumber) {
var _a;
// 取引ファクトリーで新しい進行中取引オブジェクトを作成
return {
project: params.project,
typeOf: factory.transactionType.MoneyTransfer,
agent: params.agent,
recipient: params.recipient,
seller: {
id: String(seller.id),
name: seller.name,
typeOf: seller.typeOf
},
object: Object.assign(Object.assign({ amount: amount, fromLocation: fromLocation, toLocation: toLocation, pendingTransaction: Object.assign({ transactionNumber }, (typeof ((_a = params.object.pendingTransaction) === null || _a === void 0 ? void 0 : _a.identifier) === 'string')
? { identifier: params.object.pendingTransaction.identifier }
: undefined) }, (passport !== undefined) ? { passport } : undefined), (typeof params.object.description === 'string') ? { description: params.object.description } : undefined),
expires: params.expires
};
}
;