@chevre/domain 26.0.0-alpha.10 → 26.0.0-alpha.11
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/orderInTransaction.d.ts +0 -3
- package/lib/chevre/repo/orderInTransaction.js +30 -22
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +0 -2
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +2 -2
- package/lib/chevre/service/task/publishPaymentUrl.js +1 -3
- package/package.json +1 -1
|
@@ -79,7 +79,6 @@ export interface IPaymentMethodByPaymentUrl {
|
|
|
79
79
|
*/
|
|
80
80
|
export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
|
|
81
81
|
private readonly orderModel;
|
|
82
|
-
private readonly transactionModel;
|
|
83
82
|
constructor(connection: Connection);
|
|
84
83
|
createPlaceOrderIfNotExists(params: Pick<IOrderInTransaction, 'orderNumber' | 'project' | 'identifier' | 'broker' | 'seller' | 'customer'>): Promise<import("mongoose").UpdateWriteOpResult | undefined>;
|
|
85
84
|
/**
|
|
@@ -177,8 +176,6 @@ export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
|
|
|
177
176
|
savePaymentMethodId(params: {
|
|
178
177
|
id: string;
|
|
179
178
|
paymentMethod: IPaymentMethodByPaymentUrl;
|
|
180
|
-
}, options: {
|
|
181
|
-
savePaymentMethodIdInTransaction: boolean;
|
|
182
179
|
}): Promise<void>;
|
|
183
180
|
/**
|
|
184
181
|
* 進行中取引に保管された採用済決済方法を検索する
|
|
@@ -5,7 +5,11 @@ exports.OrderInTransactionRepo = void 0;
|
|
|
5
5
|
const errorHandler_1 = require("../errorHandler");
|
|
6
6
|
const factory_1 = require("../factory");
|
|
7
7
|
const order_1 = require("./mongoose/schemas/order");
|
|
8
|
-
|
|
8
|
+
// import {
|
|
9
|
+
// createSchema as createTransactionSchema,
|
|
10
|
+
// IModel as ITransactionModel, modelName as transactionModelName,
|
|
11
|
+
// IDocType as ITransactionDocType
|
|
12
|
+
// } from './mongoose/schemas/transaction';
|
|
9
13
|
const acceptedOfferInReserve_1 = require("./acceptedOfferInReserve");
|
|
10
14
|
// const debug = createDebug('chevre-domain:repo:orderInTransaction');
|
|
11
15
|
/**
|
|
@@ -13,11 +17,11 @@ const acceptedOfferInReserve_1 = require("./acceptedOfferInReserve");
|
|
|
13
17
|
*/
|
|
14
18
|
class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInReserveRepo {
|
|
15
19
|
orderModel;
|
|
16
|
-
transactionModel;
|
|
20
|
+
// private readonly transactionModel: ITransactionModel;
|
|
17
21
|
constructor(connection) {
|
|
18
22
|
super(connection);
|
|
19
23
|
this.orderModel = connection.model(order_1.modelName, (0, order_1.createSchema)());
|
|
20
|
-
this.transactionModel = connection.model
|
|
24
|
+
// this.transactionModel = connection.model<ITransactionDocType, ITransactionModel>(transactionModelName, createTransactionSchema());
|
|
21
25
|
}
|
|
22
26
|
async createPlaceOrderIfNotExists(params) {
|
|
23
27
|
const { orderNumber, project, identifier, broker, seller, customer } = params;
|
|
@@ -284,29 +288,33 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
|
|
|
284
288
|
* 特定の進行中取引の決済方法IDを保管する
|
|
285
289
|
* transactionsへの保管としてひとまず定義(2026-07-11~)
|
|
286
290
|
*/
|
|
287
|
-
async savePaymentMethodId(params
|
|
288
|
-
const { savePaymentMethodIdInTransaction } = options;
|
|
291
|
+
async savePaymentMethodId(params) {
|
|
289
292
|
const { paymentMethodId } = params.paymentMethod;
|
|
290
293
|
if (typeof paymentMethodId !== 'string' || paymentMethodId === '') {
|
|
291
294
|
throw new factory_1.factory.errors.ArgumentNull('paymentMethod.paymentMethodId');
|
|
292
295
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
296
|
+
// savePaymentMethodIdInTransactionは廃止(2026-08-04~)
|
|
297
|
+
// if (savePaymentMethodIdInTransaction) {
|
|
298
|
+
// await this.transactionModel.findOneAndUpdate(
|
|
299
|
+
// {
|
|
300
|
+
// _id: { $eq: params.id },
|
|
301
|
+
// status: { $eq: factory.transactionStatusType.InProgress }
|
|
302
|
+
// },
|
|
303
|
+
// {
|
|
304
|
+
// $set: { 'object.paymentMethods': { paymentMethodId } }
|
|
305
|
+
// },
|
|
306
|
+
// {
|
|
307
|
+
// projection: { _id: 1 }
|
|
308
|
+
// }
|
|
309
|
+
// )
|
|
310
|
+
// .lean<{ _id: ObjectId }>()
|
|
311
|
+
// .exec()
|
|
312
|
+
// .then((doc) => {
|
|
313
|
+
// if (doc === null) {
|
|
314
|
+
// throw new factory.errors.NotFound(factory.transactionType.PlaceOrder);
|
|
315
|
+
// }
|
|
316
|
+
// });
|
|
317
|
+
// }
|
|
310
318
|
// 注文ドキュメントにも保管する(2026-07-12~)
|
|
311
319
|
await this.orderModel.findOneAndUpdate({
|
|
312
320
|
identifier: { $eq: params.id },
|
|
@@ -60,7 +60,5 @@ declare function publishPaymentUrl(params: {
|
|
|
60
60
|
*/
|
|
61
61
|
identifier?: string;
|
|
62
62
|
instrument: factory.action.trade.pay.IAcceptedPaymentMethodOfferAsInstrument[];
|
|
63
|
-
}, options: {
|
|
64
|
-
savePaymentMethodIdInTransaction: boolean;
|
|
65
63
|
}): IPublishPaymentUrlOperation<Pick<PayTransactionService.IPublishPaymentUrlResult, 'paymentMethodId' | 'paymentUrl'>>;
|
|
66
64
|
export { IPublishPaymentUrlRepos, publishPaymentUrl };
|
|
@@ -41,7 +41,7 @@ const factory_2 = require("./factory");
|
|
|
41
41
|
/**
|
|
42
42
|
* 外部決済ロケーションを発行する
|
|
43
43
|
*/
|
|
44
|
-
function publishPaymentUrl(params
|
|
44
|
+
function publishPaymentUrl(params) {
|
|
45
45
|
return async (repos, settings) => {
|
|
46
46
|
const { paymentServiceType, purpose, project } = params;
|
|
47
47
|
if (purpose.typeOf !== factory_1.factory.transactionType.PlaceOrder) {
|
|
@@ -107,7 +107,7 @@ function publishPaymentUrl(params, options) {
|
|
|
107
107
|
await repos.orderInTransaction.savePaymentMethodId({
|
|
108
108
|
id: transaction.id,
|
|
109
109
|
paymentMethod: { paymentMethodId: result.paymentMethodId }
|
|
110
|
-
}
|
|
110
|
+
});
|
|
111
111
|
return {
|
|
112
112
|
paymentMethodId: result.paymentMethodId,
|
|
113
113
|
paymentUrl: result.paymentUrl
|
|
@@ -36,14 +36,12 @@ function call(params) {
|
|
|
36
36
|
const actionRepo = new acceptPay_1.AcceptPayActionRepo(connection);
|
|
37
37
|
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
38
38
|
try {
|
|
39
|
-
const { savePaymentMethodIdInTransaction, project: _project, ...publishPaymentUrlParams } = params.data;
|
|
39
|
+
const { savePaymentMethodIdInTransaction: _savePaymentMethodIdInTransaction, project: _project, ...publishPaymentUrlParams } = params.data;
|
|
40
40
|
await (0, any_1.publishPaymentUrl)({
|
|
41
41
|
...publishPaymentUrlParams,
|
|
42
42
|
project: { id: params.project.id },
|
|
43
43
|
instrument: (Array.isArray(params.data.instrument)) ? params.data.instrument : [],
|
|
44
44
|
sameAs: { id: params.id }
|
|
45
|
-
}, {
|
|
46
|
-
savePaymentMethodIdInTransaction: savePaymentMethodIdInTransaction === true
|
|
47
45
|
})({
|
|
48
46
|
acceptPayAction: actionRepo,
|
|
49
47
|
authorizeInvoiceAction: new authorizeInvoice_1.AuthorizeInvoiceActionRepo(connection),
|
package/package.json
CHANGED