@dascompany/product 4.2.14 → 4.2.16

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.
@@ -48,9 +48,8 @@ export default class ProductReader {
48
48
  title: product.title,
49
49
  subtitle: product.subtitle,
50
50
  description: product.description,
51
- netPrice: product.net_price,
52
- promotionalGrossPrice: PriceConverter.netToGrossPrice(product.promotional_net_price, vat),
53
- promotionalNetPrice: product.promotional_net_price,
51
+ price: { netPrice: product.net_price, grossPrice: PriceConverter.netToGrossPrice(Number(product.net_price), vat) },
52
+ promotionalPrice: { netPrice: product.promotional_net_price, grossPrice: PriceConverter.netToGrossPrice(product.promotional_net_price, vat) },
54
53
  color: product.color,
55
54
  quantity: product.quantity,
56
55
  width: product.width,
@@ -59,7 +58,6 @@ export default class ProductReader {
59
58
  createdAt: product.created_at,
60
59
  deleted: product.deleted,
61
60
  thumbnail: thumbnail ? thumbnail : null,
62
- grossPrice: PriceConverter.netToGrossPrice(Number(product.net_price), vat),
63
61
  jsonData: product.json_data
64
62
  };
65
63
  }
@@ -6,7 +6,7 @@ export default class ProductRepo {
6
6
  return this.createProductFromRow(product);
7
7
  }
8
8
  static createProductFromRow(productRow) {
9
- const product = new Product(productRow.sku, productRow.url, productRow.article_number, productRow.title, productRow.subtitle, productRow.description, productRow.net_price, productRow.promotional_net_price, productRow.vat, productRow.color, productRow.quantity, productRow.width, productRow.length, productRow.height, productRow.file_id, productRow.deleted);
9
+ const product = new Product(productRow.sku, productRow.url, productRow.article_number, productRow.title, productRow.subtitle, productRow.description, productRow.net_price, productRow.promotional_net_price, productRow.vat, productRow.color, productRow.quantity, productRow.width, productRow.length, productRow.height, productRow.file_id, productRow.json_data, productRow.deleted);
10
10
  product.setId(productRow.id);
11
11
  product.setCreatedAt(productRow.created_at);
12
12
  return product;
@@ -1,4 +1,5 @@
1
1
  import type FileI from "./FileI";
2
+ import PriceI from "./PriceI";
2
3
  export default interface ProductI {
3
4
  id: string;
4
5
  sku: string;
@@ -7,11 +8,9 @@ export default interface ProductI {
7
8
  title: string;
8
9
  subtitle: string;
9
10
  description: string;
10
- netPrice: number;
11
- promotionalNetPrice: number;
12
- promotionalGrossPrice: number;
13
- installationPrice: number;
14
- grossPrice: number;
11
+ price: PriceI;
12
+ promotionalPrice: PriceI;
13
+ installationPrice: PriceI;
15
14
  vat: number;
16
15
  color: string;
17
16
  quantity: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dascompany/product",
3
- "version": "4.2.14",
3
+ "version": "4.2.16",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "vitest",