@dascompany/product 3.4.1 → 3.4.3

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.
@@ -13,7 +13,7 @@ export default class AdminReader {
13
13
  }
14
14
  static async getQuantity(queryOptions) {
15
15
  const quantity = await DatabaseConnection.getInstance().adminAccounts.count(queryOptions);
16
- return quantity;
16
+ return Number(quantity);
17
17
  }
18
18
  static correctAdmins(admins) {
19
19
  const correctAdmins = [];
@@ -10,7 +10,7 @@ export default class ClientAccountReader {
10
10
  }
11
11
  static async getQuantity(queryOptions) {
12
12
  const quantity = await DatabaseConnection.getInstance().clientAccounts.count(queryOptions);
13
- return quantity;
13
+ return Number(quantity);
14
14
  }
15
15
  static async getId(queryOptions) {
16
16
  const accountId = await DatabaseConnection.getInstance().clientAccounts.selectId(queryOptions);
@@ -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
  }
@@ -14,7 +14,7 @@ export default class FilesReader {
14
14
  }
15
15
  static async getQuantity(queryOptions) {
16
16
  const quantity = await DatabaseConnection.getInstance().files.count(queryOptions);
17
- return quantity;
17
+ return Number(quantity);
18
18
  }
19
19
  static async getForConnection(queryOptions) {
20
20
  const files = await DatabaseConnection.getInstance().files.selectForConnection(queryOptions);
@@ -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;
@@ -22,7 +22,7 @@ export default class OrderReader {
22
22
  }
23
23
  static async getQuantity(queryOptions) {
24
24
  const quantity = await DatabaseConnection.getInstance().orders.count(queryOptions);
25
- return quantity;
25
+ return Number(quantity);
26
26
  }
27
27
  static async correctOrders(orderRows) {
28
28
  const orders = [];
@@ -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
  }
@@ -23,11 +23,11 @@ export default class ProductReader {
23
23
  }
24
24
  static async getQuantity(queryOptions) {
25
25
  const quantity = await DatabaseConnection.getInstance().products.count(queryOptions);
26
- return quantity;
26
+ return Number(quantity);
27
27
  }
28
28
  static async getMaxPrice(queryOptions) {
29
29
  const price = await DatabaseConnection.getInstance().products.selectMaxPrice(queryOptions);
30
- return price;
30
+ return Number(price);
31
31
  }
32
32
  static async correctProducts(products) {
33
33
  const correctProducts = [];
@@ -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.3",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "vitest",