@chevre/domain 24.1.0-alpha.24 → 24.1.0-alpha.25
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.
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.OrderInTransactionRepo = void 0;
|
|
7
|
-
|
|
8
|
-
const util_1 = require("util");
|
|
4
|
+
// import { isDeepStrictEqual } from 'util';
|
|
9
5
|
const factory_1 = require("../factory");
|
|
10
6
|
const order_1 = require("./mongoose/schemas/order");
|
|
11
7
|
const assetTransaction_1 = require("./mongoose/schemas/assetTransaction");
|
|
12
|
-
const debug = (
|
|
8
|
+
// const debug = createDebug('chevre-domain:repo:orderInTransaction');
|
|
13
9
|
/**
|
|
14
10
|
* 取引中注文リポジトリ
|
|
15
11
|
*/
|
|
@@ -75,15 +71,21 @@ class OrderInTransactionRepo {
|
|
|
75
71
|
}
|
|
76
72
|
return doc.acceptedOffers.map((acceptedOffer) => {
|
|
77
73
|
const priceBySubReservation = subReservations.find((subReservation) => subReservation.id === acceptedOffer.itemOffered.id)?.price;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
console.error('findAcceptedOffersWithPriceByOrderNumber: priceSpecMatched: false!!!', acceptedOffer.itemOffered.id, params.orderNumber, params.project.id);
|
|
74
|
+
// 予約の価格は必ず存在するはず
|
|
75
|
+
if (priceBySubReservation === undefined) {
|
|
76
|
+
console.error('findAcceptedOffersWithPriceByOrderNumber: priceBySubReservation: undefined!!!', acceptedOffer.itemOffered.id);
|
|
82
77
|
}
|
|
78
|
+
// const priceSpecMatched = isDeepStrictEqual(acceptedOffer.priceSpecification, priceBySubReservation);
|
|
79
|
+
// debug('findAcceptedOffersWithPriceByOrderNumber: priceSpecMatched?', priceSpecMatched, acceptedOffer.itemOffered.id, params.orderNumber, params.project.id);
|
|
80
|
+
// if (!priceSpecMatched) {
|
|
81
|
+
// console.error('findAcceptedOffersWithPriceByOrderNumber: priceSpecMatched: false!!!', acceptedOffer.itemOffered.id, params.orderNumber, params.project.id);
|
|
82
|
+
// }
|
|
83
|
+
// const overwritePriceSpec = priceSpecMatched || acceptedOffer.priceSpecification === undefined;
|
|
83
84
|
return {
|
|
84
85
|
...acceptedOffer,
|
|
85
|
-
// 予約取引内の価格仕様と一致した場合のみ上書きしてみる
|
|
86
|
-
...((
|
|
86
|
+
// // 予約取引内の価格仕様と一致した場合のみ上書きしてみる
|
|
87
|
+
// ...((overwritePriceSpec && priceBySubReservation !== undefined) && { priceSpecification: priceBySubReservation })
|
|
88
|
+
...((priceBySubReservation !== undefined) && { priceSpecification: priceBySubReservation })
|
|
87
89
|
};
|
|
88
90
|
});
|
|
89
91
|
}
|
package/package.json
CHANGED