Compare commits
2 Commits
72b74f5037
...
b922229687
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b922229687 | ||
|
|
886830cd83 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,3 +7,4 @@ decompiledReference
|
|||||||
scripts/s3-backup/data/
|
scripts/s3-backup/data/
|
||||||
scripts/s3-backup/tmp/
|
scripts/s3-backup/tmp/
|
||||||
scripts/s3-backup/certs/
|
scripts/s3-backup/certs/
|
||||||
|
scripts/minimal-db/data/
|
||||||
@@ -29,7 +29,8 @@ static const char* PRODUCT_LIST_SQL =
|
|||||||
"a.nIstVater AS isParent, a.kVaterArtikel AS parentArticleId, "
|
"a.nIstVater AS isParent, a.kVaterArtikel AS parentArticleId, "
|
||||||
"CASE WHEN a.kStueckliste <> 0 THEN '1' ELSE '0' END AS isCompositeProduct, "
|
"CASE WHEN a.kStueckliste <> 0 THEN '1' ELSE '0' END AS isCompositeProduct, "
|
||||||
"(SELECT TOP 1 pv.cVariantName FROM Pos.vProductVariant pv "
|
"(SELECT TOP 1 pv.cVariantName FROM Pos.vProductVariant pv "
|
||||||
"WHERE pv.kProduct = a.kArtikel) AS variantName "
|
"WHERE pv.kProduct = a.kArtikel) AS variantName, "
|
||||||
|
"a.cBarcode AS barcode "
|
||||||
"FROM dbo.tArtikel a "
|
"FROM dbo.tArtikel a "
|
||||||
"INNER JOIN dbo.tArtikelBeschreibung ab ON ab.kArtikel = a.kArtikel AND ab.kSprache = ? "
|
"INNER JOIN dbo.tArtikelBeschreibung ab ON ab.kArtikel = a.kArtikel AND ab.kSprache = ? "
|
||||||
"LEFT JOIN TaxRates tr ON tr.kSteuerklasse = a.kSteuerklasse "
|
"LEFT JOIN TaxRates tr ON tr.kSteuerklasse = a.kSteuerklasse "
|
||||||
@@ -127,7 +128,7 @@ inline nlohmann::json get_product_list(int64_t cursor, int limit) {
|
|||||||
{"d_price", "0.0"},
|
{"d_price", "0.0"},
|
||||||
{"tax_rate2", ""},
|
{"tax_rate2", ""},
|
||||||
{"use_in_out_tax", "0"},
|
{"use_in_out_tax", "0"},
|
||||||
{"barcode", nullptr},
|
{"barcode", row[13].str.empty() ? nullptr : nlohmann::json(row[13].str)},
|
||||||
{"use_stock", "0"},
|
{"use_stock", "0"},
|
||||||
{"q_div", "0"},
|
{"q_div", "0"},
|
||||||
{"quantity", "0"},
|
{"quantity", "0"},
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
"cert": "node generate-cert.js",
|
"cert": "node generate-cert.js",
|
||||||
"backup:s3": "node scripts/s3-backup/backup.mjs",
|
"backup:s3": "node scripts/s3-backup/backup.mjs",
|
||||||
"backup:s3:quick": "node scripts/s3-backup/backup.mjs --skip-trust",
|
"backup:s3:quick": "node scripts/s3-backup/backup.mjs --skip-trust",
|
||||||
|
"db:minimal": "node scripts/create-minimal-db.mjs",
|
||||||
|
"db:minimal:extract": "node scripts/create-minimal-db.mjs extract",
|
||||||
"start": "node --watch server.js",
|
"start": "node --watch server.js",
|
||||||
"test:client": "node test-client.js"
|
"test:client": "node test-client.js"
|
||||||
},
|
},
|
||||||
|
|||||||
1005
scripts/create-minimal-db.mjs
Normal file
1005
scripts/create-minimal-db.mjs
Normal file
File diff suppressed because it is too large
Load Diff
15068
scripts/minimal-db/definitions.json
Normal file
15068
scripts/minimal-db/definitions.json
Normal file
File diff suppressed because one or more lines are too long
184
scripts/minimal-db/manifest.json
Normal file
184
scripts/minimal-db/manifest.json
Normal file
@@ -0,0 +1,184 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"extractedAt": "2026-07-15T21:37:45.653Z",
|
||||||
|
"source": "eazybusiness",
|
||||||
|
"tableCount": 43,
|
||||||
|
"indexCount": 158,
|
||||||
|
"triggerCount": 77,
|
||||||
|
"typeCount": 11,
|
||||||
|
"rowCount": 9575,
|
||||||
|
"tables": [
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tArtikel"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tArtikelAttribut"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tArtikelAttributSprache"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tArtikelBeschreibung"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tArtikelbildPlattform"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tAttribut"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tAttributSprache"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tBild"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tFirmaHistory"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tKategorie"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tKategorieArtikel"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tKategorieShop"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tKategorieSprache"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tKategoriebildPlattform"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tKunde"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tKundenGruppe"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tLaufendeNummern"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tLieferschein"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tPickliste"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tPicklistePos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tPlattform"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tPreis"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tPreisDetail"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tSessionId"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tShop"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tShopSubshop"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tSteuersatz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tSteuerzone"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tStueckliste"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tVersand"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tVersandArt"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tWarenLager"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tWarenLagerPlatz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tZahlung"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tZahlungsArtSprache"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tZahlungsart"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "dbo",
|
||||||
|
"table": "tpk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "Pos",
|
||||||
|
"table": "tAuftragMapping"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "Pos",
|
||||||
|
"table": "tAuftragPositionMapping"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "Verkauf",
|
||||||
|
"table": "tAuftrag"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "Verkauf",
|
||||||
|
"table": "tAuftragAdresse"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "Verkauf",
|
||||||
|
"table": "tAuftragEckdaten"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"schema": "Verkauf",
|
||||||
|
"table": "tAuftragPosition"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -50,7 +50,8 @@ SELECT TOP (@limit)
|
|||||||
SELECT TOP 1 pv.cVariantName
|
SELECT TOP 1 pv.cVariantName
|
||||||
FROM Pos.vProductVariant pv
|
FROM Pos.vProductVariant pv
|
||||||
WHERE pv.kProduct = a.kArtikel
|
WHERE pv.kProduct = a.kArtikel
|
||||||
) AS variantName
|
) AS variantName,
|
||||||
|
a.cBarcode AS barcode
|
||||||
FROM dbo.tArtikel a
|
FROM dbo.tArtikel a
|
||||||
INNER JOIN dbo.tArtikelBeschreibung ab ON ab.kArtikel = a.kArtikel AND ab.kSprache = @languageId
|
INNER JOIN dbo.tArtikelBeschreibung ab ON ab.kArtikel = a.kArtikel AND ab.kSprache = @languageId
|
||||||
LEFT JOIN TaxRates tr ON tr.kSteuerklasse = a.kSteuerklasse
|
LEFT JOIN TaxRates tr ON tr.kSteuerklasse = a.kSteuerklasse
|
||||||
@@ -149,6 +150,7 @@ export async function getProductList({ cursor = 0, limit = 20 } = {}) {
|
|||||||
imghash: product.imgHash ?? null,
|
imghash: product.imgHash ?? null,
|
||||||
imgsrc: product.imgHash ?? null,
|
imgsrc: product.imgHash ?? null,
|
||||||
sku: product.sku,
|
sku: product.sku,
|
||||||
|
barcode: product.barcode ?? null,
|
||||||
name: product.name,
|
name: product.name,
|
||||||
tax_rate: String(Math.round(Number(product.taxRate || 0))),
|
tax_rate: String(Math.round(Number(product.taxRate || 0))),
|
||||||
price: basePrice,
|
price: basePrice,
|
||||||
|
|||||||
Reference in New Issue
Block a user