@dascompany/product 2.1.2 → 2.1.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.
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ParameterType, QueryOptions } from "@dascompany/database";
|
|
2
1
|
import DatabaseConnection from "../DatabaseConnection";
|
|
3
|
-
import OrderProductsReader from "./OrderProductsReader";
|
|
4
2
|
import OrderStatusReader from "./OrderStatusReader";
|
|
3
|
+
import createQueryOptionsForId from "../utils/createQueryOptionsForId";
|
|
5
4
|
export default class OrderReader {
|
|
6
5
|
static async get(queryOptions) {
|
|
7
6
|
const orderData = await DatabaseConnection.getInstance().orders.select(queryOptions);
|
|
@@ -34,10 +33,7 @@ export default class OrderReader {
|
|
|
34
33
|
return orders;
|
|
35
34
|
}
|
|
36
35
|
static async correctOrder(order) {
|
|
37
|
-
const
|
|
38
|
-
queryOptions.setWhere([{ name: 'order_id', type: ParameterType.bigint, value: order.id }]);
|
|
39
|
-
const products = await OrderProductsReader.getAll(queryOptions);
|
|
40
|
-
const status = await OrderStatusReader.get(queryOptions);
|
|
36
|
+
const status = await OrderStatusReader.get(createQueryOptionsForId(order.id));
|
|
41
37
|
const correctOrder = {
|
|
42
38
|
id: order.id,
|
|
43
39
|
email: order.email,
|
|
@@ -49,8 +45,7 @@ export default class OrderReader {
|
|
|
49
45
|
invoiceDetailsId: order.invoice_details_id,
|
|
50
46
|
paymentDetailsId: order.payment_details_id,
|
|
51
47
|
zsiId: order.zsi_id,
|
|
52
|
-
status
|
|
53
|
-
products
|
|
48
|
+
status
|
|
54
49
|
};
|
|
55
50
|
return correctOrder;
|
|
56
51
|
}
|
package/dist/types/OrderI.d.ts
CHANGED