@dascompany/product 2.1.3 → 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,4 +1,6 @@
1
1
  import DatabaseConnection from "../DatabaseConnection";
2
+ import OrderStatusReader from "./OrderStatusReader";
3
+ import createQueryOptionsForId from "../utils/createQueryOptionsForId";
2
4
  export default class OrderReader {
3
5
  static async get(queryOptions) {
4
6
  const orderData = await DatabaseConnection.getInstance().orders.select(queryOptions);
@@ -31,6 +33,7 @@ export default class OrderReader {
31
33
  return orders;
32
34
  }
33
35
  static async correctOrder(order) {
36
+ const status = await OrderStatusReader.get(createQueryOptionsForId(order.id));
34
37
  const correctOrder = {
35
38
  id: order.id,
36
39
  email: order.email,
@@ -41,7 +44,8 @@ export default class OrderReader {
41
44
  deliveryDetailsId: order.delivery_details_id,
42
45
  invoiceDetailsId: order.invoice_details_id,
43
46
  paymentDetailsId: order.payment_details_id,
44
- zsiId: order.zsi_id
47
+ zsiId: order.zsi_id,
48
+ status
45
49
  };
46
50
  return correctOrder;
47
51
  }
@@ -1,3 +1,4 @@
1
+ import StatusI from "./StatusI";
1
2
  export default interface OrderI {
2
3
  id: number;
3
4
  email: string;
@@ -9,4 +10,5 @@ export default interface OrderI {
9
10
  invoiceDetailsId: number;
10
11
  paymentDetailsId: number;
11
12
  zsiId: number;
13
+ status: StatusI;
12
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dascompany/product",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "vitest",