@dascompany/product 3.4.1 → 3.4.2

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.
@@ -4,6 +4,7 @@ import createQueryOptionsForId from "../utils/createQueryOptionsForId";
4
4
  export default class CompanyDataReader {
5
5
  static async get() {
6
6
  const companyData = await DatabaseConnection.getInstance().companyData.select();
7
+ console.log('companyData', companyData);
7
8
  if (companyData) {
8
9
  const address = companyData?.address_id ? await AddressesReader.get(createQueryOptionsForId(companyData.address_id)) : null;
9
10
  return {
@@ -17,7 +17,7 @@ export default class FileConnectionsReader {
17
17
  fileId: fileConnections.file_id,
18
18
  connectionType: fileConnections.connection_type,
19
19
  connectionId: fileConnections.connection_id,
20
- sequence: fileConnections.sequence
20
+ sequence: Number(fileConnections.sequence)
21
21
  };
22
22
  return correctFileConnection;
23
23
  }
@@ -33,7 +33,7 @@ export default class FilesReader {
33
33
  id: file.id,
34
34
  name: file.name,
35
35
  catalog: file.catalog,
36
- type: file.type,
36
+ type: Number(file.type),
37
37
  createdAt: file.created_at
38
38
  };
39
39
  return correctFile;
@@ -23,9 +23,9 @@ export default class OrderProductsReader {
23
23
  productId: orderProduct.product_id,
24
24
  sku: orderProduct.sku,
25
25
  title: orderProduct.title,
26
- netPrice: orderProduct.net_price,
27
- grossPrice: PriceConverter.netToGrossPrice(orderProduct.net_price, orderProduct.vat),
28
- vat: orderProduct.vat,
26
+ netPrice: Number(orderProduct.net_price),
27
+ grossPrice: PriceConverter.netToGrossPrice(Number(orderProduct.net_price), Number(orderProduct.vat)),
28
+ vat: Number(orderProduct.vat),
29
29
  thumbnail,
30
30
  };
31
31
  return correctProduct;
@@ -39,7 +39,7 @@ export default class OrderReader {
39
39
  const correctOrder = {
40
40
  id: order.id,
41
41
  email: order.email,
42
- price: order.price,
42
+ price: Number(order.price),
43
43
  createdAt: order.created_at,
44
44
  clientId: order.client_id,
45
45
  deliveryDetailsId: order.delivery_details_id,
@@ -19,7 +19,7 @@ export default class OrderStatusReader {
19
19
  orderId: status.order_id,
20
20
  createdAt: status.created_at,
21
21
  userId: status.user_id,
22
- type: status.type
22
+ type: Number(status.type)
23
23
  };
24
24
  return correctStatus;
25
25
  }
@@ -45,17 +45,17 @@ export default class ProductReader {
45
45
  url: product.url,
46
46
  title: product.title,
47
47
  description: product.description,
48
- netPrice: product.net_price,
49
- vat: product.vat,
48
+ netPrice: Number(product.net_price),
49
+ vat: Number(product.vat),
50
50
  color: product.color,
51
- quantity: product.quantity,
51
+ quantity: Number(product.quantity),
52
52
  width: product.width,
53
53
  height: product.height,
54
54
  length: product.length,
55
55
  createdAt: product.created_at,
56
56
  deleted: product.deleted,
57
57
  thumbnail: thumbnail ? thumbnail : null,
58
- grossPrice: PriceConverter.netToGrossPrice(product.net_price, product.vat),
58
+ grossPrice: PriceConverter.netToGrossPrice(Number(product.net_price), Number(product.vat)),
59
59
  jsonData: product.json_data
60
60
  };
61
61
  }
@@ -1,6 +1,6 @@
1
1
  import AddressI from "./AddressI";
2
2
  export default interface CompanyDetailsI {
3
- id: number | null;
3
+ id: string | null;
4
4
  name: string;
5
5
  taxNumber: string;
6
6
  address: AddressI;
@@ -2,5 +2,5 @@ export default interface FileI {
2
2
  id: string;
3
3
  name: string;
4
4
  catalog: string;
5
- type: string;
5
+ type: number;
6
6
  }
@@ -1,5 +1,5 @@
1
1
  export default interface PaymentMethodI {
2
- id: number;
2
+ id: string;
3
3
  key: string;
4
4
  active: boolean;
5
5
  }
@@ -10,7 +10,7 @@ export default interface ProductI {
10
10
  grossPrice: number;
11
11
  vat: number;
12
12
  color: string;
13
- quantity: string;
13
+ quantity: number;
14
14
  width: number;
15
15
  length: number;
16
16
  height: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dascompany/product",
3
- "version": "3.4.1",
3
+ "version": "3.4.2",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "vitest",