@dascompany/product 3.1.0 → 3.1.1

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.
package/dist/SQL.json CHANGED
@@ -62,8 +62,8 @@
62
62
  "products": {
63
63
  "select": "SELECT * FROM products",
64
64
  "selectId": "SELECT id FROM products",
65
- "insert": "INSERT INTO products( id, sku, url, title, description, net_price, installation_price, vat, color, quantity, width, length, height, file_id, json_data, deleted) VALUES ($id::BIGINT, $sku::TEXT, $url::TEXT, $title::TEXT, $description::TEXT, $net_price::DOUBLE PRECISION, $installation_price::DOUBLE PRECISION, $vat::INT, $color::TEXT, $quantity::INT, $width::INT, $length::INT, $height::DOUBLE PRECISION,$file_id::BIGINT , $json_data::JSON, false::BOOL)",
66
- "update": "UPDATE products SET url = $url::TEXT, title = $title::TEXT, description = $description::TEXT , net_price = $net_price::DOUBLE PRECISION, installation_price = $installation_price::DOUBLE PRECISION ,vat = $vat::INT, color = $color::TEXT, quantity = $quantity::INT, width = $width::INT, length = $length::INT, height = $height::DOUBLE PRECISION, file_id = $file_id::BIGINT, json_data = $json_data::JSON WHERE id = $id::BIGINT",
65
+ "insert": "INSERT INTO products( id, sku, url, title, description, net_price, vat, color, quantity, width, length, height, file_id, json_data, deleted) VALUES ($id::BIGINT, $sku::TEXT, $url::TEXT, $title::TEXT, $description::TEXT, $net_price::DOUBLE PRECISION, $vat::INT, $color::TEXT, $quantity::INT, $width::INT, $length::INT, $height::DOUBLE PRECISION,$file_id::BIGINT , $json_data::JSON, false::BOOL)",
66
+ "update": "UPDATE products SET url = $url::TEXT, title = $title::TEXT, description = $description::TEXT , net_price = $net_price::DOUBLE PRECISION, vat = $vat::INT, color = $color::TEXT, quantity = $quantity::INT, width = $width::INT, length = $length::INT, height = $height::DOUBLE PRECISION, file_id = $file_id::BIGINT, json_data = $json_data::JSON WHERE id = $id::BIGINT",
67
67
  "delete": "UPDATE products SET deleted = true WHERE id = $id::BIGINT",
68
68
  "maxPrice": "SELECT MAX(net_price) FROM products",
69
69
  "count": "SELECT COUNT(*) AS total_rows FROM products",
@@ -48,7 +48,6 @@ export default class ProductReader {
48
48
  title: product.title,
49
49
  description: product.description,
50
50
  netPrice: product.net_price,
51
- installationPrice: product.installation_price,
52
51
  vat: product.vat,
53
52
  color: product.color,
54
53
  quantity: product.quantity,
@@ -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.title, productRow.description, productRow.net_price, productRow.installation_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.title, productRow.description, productRow.net_price, productRow.vat, productRow.color, productRow.quantity, productRow.width, productRow.length, productRow.height, productRow.file_id, productRow.deleted);
10
10
  product.setId(productRow.id);
11
11
  product.setCreatedAt(productRow.created_at);
12
12
  return product;
@@ -6,7 +6,6 @@ export default class Product extends StockObject {
6
6
  private title;
7
7
  private description;
8
8
  private netPrice;
9
- private installationPrice;
10
9
  private vat;
11
10
  private color;
12
11
  private quantity;
@@ -19,13 +18,12 @@ export default class Product extends StockObject {
19
18
  private file;
20
19
  private jsonData;
21
20
  private files;
22
- constructor(sku: string, url: string, title: string, description: string, netPrice: number, installationPrice: number, vat: number, color: string, quantity: number, width: number, length: number, height: number, fileId: number, jsonData: any, deleted?: boolean);
21
+ constructor(sku: string, url: string, title: string, description: string, netPrice: number, vat: number, color: string, quantity: number, width: number, length: number, height: number, fileId: number, jsonData: any, deleted?: boolean);
23
22
  getSku(): string;
24
23
  getUrl(): string;
25
24
  getTitle(): string;
26
25
  getDescription(): string;
27
26
  getNetPrice(): number;
28
- getInstallationPrice(): number;
29
27
  getGrossPrice(): number;
30
28
  getVat(): number;
31
29
  getColor(): string;
@@ -45,7 +43,6 @@ export default class Product extends StockObject {
45
43
  title: string;
46
44
  description: string;
47
45
  netPrice: number;
48
- installationPrice: number;
49
46
  vat: number;
50
47
  color: string;
51
48
  quantity: number;
@@ -62,7 +59,6 @@ export default class Product extends StockObject {
62
59
  setTitle(title: string): string;
63
60
  setDescription(description: string): string;
64
61
  setNetPrice(netPrice: number): number;
65
- setInstallationPrice(installationPrice: number): number;
66
62
  setVat(vat: number): number;
67
63
  setColor(color: string): string;
68
64
  setQuantity(quantity: number): number;
@@ -9,7 +9,6 @@ export default class Product extends StockObject {
9
9
  title;
10
10
  description;
11
11
  netPrice;
12
- installationPrice;
13
12
  vat;
14
13
  color;
15
14
  quantity;
@@ -22,14 +21,13 @@ export default class Product extends StockObject {
22
21
  file;
23
22
  jsonData;
24
23
  files;
25
- constructor(sku, url, title, description, netPrice, installationPrice, vat, color, quantity, width, length, height, fileId, jsonData, deleted = false) {
24
+ constructor(sku, url, title, description, netPrice, vat, color, quantity, width, length, height, fileId, jsonData, deleted = false) {
26
25
  super();
27
26
  this.sku = sku;
28
27
  this.url = url;
29
28
  this.title = title;
30
29
  this.description = description;
31
30
  this.netPrice = netPrice;
32
- this.installationPrice = installationPrice;
33
31
  this.vat = vat;
34
32
  this.color = color;
35
33
  this.quantity = quantity;
@@ -58,9 +56,6 @@ export default class Product extends StockObject {
58
56
  getNetPrice() {
59
57
  return PriceConverter.netToGrossPrice(this.netPrice, this.vat);
60
58
  }
61
- getInstallationPrice() {
62
- return this.installationPrice;
63
- }
64
59
  getGrossPrice() {
65
60
  return this.netPrice;
66
61
  }
@@ -119,7 +114,6 @@ export default class Product extends StockObject {
119
114
  title: this.title,
120
115
  description: this.description,
121
116
  netPrice: this.netPrice,
122
- installationPrice: this.installationPrice,
123
117
  vat: this.vat,
124
118
  color: this.color,
125
119
  quantity: this.quantity,
@@ -149,9 +143,6 @@ export default class Product extends StockObject {
149
143
  setNetPrice(netPrice) {
150
144
  return this.netPrice = netPrice;
151
145
  }
152
- setInstallationPrice(installationPrice) {
153
- return this.installationPrice = installationPrice;
154
- }
155
146
  setVat(vat) {
156
147
  return this.vat = vat;
157
148
  }
@@ -68,7 +68,6 @@ export default class ProductsTable extends Table {
68
68
  query.bindParameter('title', product.getTitle());
69
69
  query.bindParameter('description', product.getDescription());
70
70
  query.bindParameter('net_price', product.getNetPrice());
71
- query.bindParameter('installation_price', product.getInstallationPrice());
72
71
  query.bindParameter('vat', product.getVat());
73
72
  query.bindParameter('color', product.getColor());
74
73
  query.bindParameter('quantity', product.getQuantity());
@@ -6,7 +6,6 @@ export default interface ProductRow {
6
6
  description: string;
7
7
  file_id: number;
8
8
  net_price: number;
9
- installation_price: number;
10
9
  vat: number;
11
10
  color: string;
12
11
  quantity: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dascompany/product",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "vitest",