@dascompany/product 3.6.3 → 3.6.5
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 +2 -2
- package/dist/reader/ProductReader.js +1 -0
- package/dist/repo/ProductRepo.js +1 -1
- package/dist/stockObjects/Product.d.ts +4 -1
- package/dist/stockObjects/Product.js +9 -1
- package/dist/tables/public/ProductsTable.js +1 -0
- package/dist/types/rows/ProductRow.d.ts +1 -0
- package/package.json +1 -1
package/dist/SQL.json
CHANGED
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"products": {
|
|
59
59
|
"select": "SELECT * FROM products",
|
|
60
60
|
"selectId": "SELECT id FROM products",
|
|
61
|
-
"insert": "INSERT INTO products( id, sku, article_number, url, title, description, net_price, promotional_net_price, vat, color, quantity, width, length, height, file_id, json_data, deleted) VALUES ($id::BIGINT, $sku::TEXT, $article_number::TEXT, $url::TEXT, $title::TEXT,
|
|
62
|
-
"update": "UPDATE products SET url = $url::TEXT, article_number = $article_number::TEXT, title = $title::TEXT, description = $description::TEXT , net_price = $net_price::DOUBLE PRECISION, promotional_net_price = $promotional_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",
|
|
61
|
+
"insert": "INSERT INTO products( id, sku, article_number, url, title, subtitle, description, net_price, promotional_net_price, vat, color, quantity, width, length, height, file_id, json_data, deleted) VALUES ($id::BIGINT, $sku::TEXT, $article_number::TEXT, $url::TEXT, $title::TEXT, subtitle::TEXT ,$description::TEXT, $net_price::DOUBLE PRECISION, $promotional_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)",
|
|
62
|
+
"update": "UPDATE products SET url = $url::TEXT, article_number = $article_number::TEXT, title = $title::TEXT, subtitle = $subtitle::text, description = $description::TEXT , net_price = $net_price::DOUBLE PRECISION, promotional_net_price = $promotional_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",
|
|
63
63
|
"delete": "UPDATE products SET deleted = true WHERE id = $id::BIGINT",
|
|
64
64
|
"maxPrice": "SELECT MAX(net_price) FROM products",
|
|
65
65
|
"count": "SELECT COUNT(*) AS total_rows FROM products",
|
|
@@ -45,6 +45,7 @@ export default class ProductReader {
|
|
|
45
45
|
articleNumber: product.article_number,
|
|
46
46
|
url: product.url,
|
|
47
47
|
title: product.title,
|
|
48
|
+
subtitle: product.subtitle,
|
|
48
49
|
description: product.description,
|
|
49
50
|
netPrice: PriceConverter.priceToPenny(product.net_price),
|
|
50
51
|
promotionalNetPrice: PriceConverter.priceToPenny(product.promotional_net_price),
|
package/dist/repo/ProductRepo.js
CHANGED
|
@@ -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.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.deleted);
|
|
10
10
|
product.setId(productRow.id);
|
|
11
11
|
product.setCreatedAt(productRow.created_at);
|
|
12
12
|
return product;
|
|
@@ -5,6 +5,7 @@ export default class Product extends StockObject {
|
|
|
5
5
|
private url;
|
|
6
6
|
private articleNumber;
|
|
7
7
|
private title;
|
|
8
|
+
private subtitle;
|
|
8
9
|
private description;
|
|
9
10
|
private netPrice;
|
|
10
11
|
private promotionalNetPrice;
|
|
@@ -20,11 +21,12 @@ export default class Product extends StockObject {
|
|
|
20
21
|
private file;
|
|
21
22
|
private jsonData;
|
|
22
23
|
private files;
|
|
23
|
-
constructor(sku: string, url: string, articleNumber: string, title: string, description: string, netPrice: number, promotionalNetPrice: number | null, vat: number, color: string, quantity: number, width: number, length: number, height: number, fileId: number, jsonData: any, deleted?: boolean);
|
|
24
|
+
constructor(sku: string, url: string, articleNumber: string, title: string, subtitle: string, description: string, netPrice: number, promotionalNetPrice: number | null, vat: number, color: string, quantity: number, width: number, length: number, height: number, fileId: number, jsonData: any, deleted?: boolean);
|
|
24
25
|
getSku(): string;
|
|
25
26
|
getUrl(): string;
|
|
26
27
|
getArticleNumber(): string;
|
|
27
28
|
getTitle(): string;
|
|
29
|
+
getSubtitle(): string;
|
|
28
30
|
getDescription(): string;
|
|
29
31
|
getNetPrice(): number;
|
|
30
32
|
getPromotionalNetPrice(): number | null;
|
|
@@ -62,6 +64,7 @@ export default class Product extends StockObject {
|
|
|
62
64
|
setUrl(url: string): string;
|
|
63
65
|
setArticleNumber(articleNumber: string): string;
|
|
64
66
|
setTitle(title: string): string;
|
|
67
|
+
setSubtitle(subtitle: string): string;
|
|
65
68
|
setDescription(description: string): string;
|
|
66
69
|
setNetPrice(netPrice: number): number;
|
|
67
70
|
setPromotionalNetPrice(promotionalNetPrice: number | null): number | null;
|
|
@@ -8,6 +8,7 @@ export default class Product extends StockObject {
|
|
|
8
8
|
url;
|
|
9
9
|
articleNumber;
|
|
10
10
|
title;
|
|
11
|
+
subtitle;
|
|
11
12
|
description;
|
|
12
13
|
netPrice;
|
|
13
14
|
promotionalNetPrice;
|
|
@@ -23,12 +24,13 @@ export default class Product extends StockObject {
|
|
|
23
24
|
file;
|
|
24
25
|
jsonData;
|
|
25
26
|
files;
|
|
26
|
-
constructor(sku, url, articleNumber, title, description, netPrice, promotionalNetPrice, vat, color, quantity, width, length, height, fileId, jsonData, deleted = false) {
|
|
27
|
+
constructor(sku, url, articleNumber, title, subtitle, description, netPrice, promotionalNetPrice, vat, color, quantity, width, length, height, fileId, jsonData, deleted = false) {
|
|
27
28
|
super();
|
|
28
29
|
this.sku = sku;
|
|
29
30
|
this.url = url;
|
|
30
31
|
this.articleNumber = articleNumber;
|
|
31
32
|
this.title = title;
|
|
33
|
+
this.subtitle = subtitle;
|
|
32
34
|
this.description = description;
|
|
33
35
|
this.netPrice = netPrice;
|
|
34
36
|
this.promotionalNetPrice = promotionalNetPrice;
|
|
@@ -57,6 +59,9 @@ export default class Product extends StockObject {
|
|
|
57
59
|
getTitle() {
|
|
58
60
|
return this.title;
|
|
59
61
|
}
|
|
62
|
+
getSubtitle() {
|
|
63
|
+
return this.subtitle;
|
|
64
|
+
}
|
|
60
65
|
getDescription() {
|
|
61
66
|
return this.description;
|
|
62
67
|
}
|
|
@@ -150,6 +155,9 @@ export default class Product extends StockObject {
|
|
|
150
155
|
setTitle(title) {
|
|
151
156
|
return this.title = title;
|
|
152
157
|
}
|
|
158
|
+
setSubtitle(subtitle) {
|
|
159
|
+
return this.subtitle = subtitle;
|
|
160
|
+
}
|
|
153
161
|
setDescription(description) {
|
|
154
162
|
return this.description = description;
|
|
155
163
|
}
|
|
@@ -67,6 +67,7 @@ export default class ProductsTable extends Table {
|
|
|
67
67
|
query.bindParameter('url', product.getUrl());
|
|
68
68
|
query.bindParameter('article_number', product.getArticleNumber());
|
|
69
69
|
query.bindParameter('title', product.getTitle());
|
|
70
|
+
query.bindParameter('subtitle', product.getSubtitle());
|
|
70
71
|
query.bindParameter('description', product.getDescription());
|
|
71
72
|
query.bindParameter('net_price', product.getNetPrice());
|
|
72
73
|
query.bindParameter('promotional_net_price', product.getPromotionalNetPrice());
|